An industrial data acquisition method and system based on blockchain technology

By introducing the combination of blockchain technology and local database into the industrial data acquisition system, the security and availability issues of the data acquisition system are solved, and efficient and secure data query and storage are achieved.

CN119938775BActive Publication Date: 2025-10-21ZHEJIANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311453293.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-02
Publication Date
2025-10-21
Estimated Expiration
2043-11-02

AI Technical Summary

Technical Problem

The security of existing industrial data acquisition systems is not guaranteed, making them vulnerable to illegal intrusion. Furthermore, the high degree of data centralization makes them susceptible to server outages.

Method used

Introducing blockchain technology into industrial data acquisition systems allows for the synchronous storage of device information from lower-level machines in both the blockchain network and a local database. By utilizing smart contracts on the blockchain network to set up trigger events for device information updates and combining this with information verification in the local database, data query efficiency and security are improved.

Benefits of technology

It improves the security and availability of the data acquisition system, reduces the cost of illegal intrusion attacks, and solves the problem of low blockchain query efficiency through the redundancy protection mechanism of the local database, ensuring the timeliness and accuracy of data acquisition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938775B_ABST
    Figure CN119938775B_ABST
Patent Text Reader

Abstract

The application discloses an industrial data acquisition method and system based on a blockchain technology, and comprises the following steps: setting a data query processing mode of a blockchain network in an industrial data acquisition system as synchronously storing device information of a lower computer in the blockchain network and a local database; setting an event function of a smart contract in the blockchain network as a device information update trigger event; verifying information of device online of the lower computer by using the local database in combination with the blockchain network, improving the efficiency and security of the blockchain data query; and collecting industrial data by using the device of the lower computer verified by information. In order to guarantee the safety of data acquisition, the application introduces the blockchain technology, improves the attack cost, improves the safety coefficient of the system, and the decentralization characteristic of the blockchain technology can guarantee the availability of the data acquisition system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data acquisition technology, and in particular to an industrial data acquisition method and system based on blockchain technology. Background Art

[0002] With the deep integration of informatization and industrialization, information technology has penetrated every link in the industrial chain. Industrial data acquisition enables real-time collection and organization of various industrial data from production sites, providing a large amount of industrial data for enterprise information systems such as MES and ERP. By deeply mining this accumulated industrial big data, production process optimization and intelligent decision-making can be achieved. Traditional data acquisition systems use common industrial communication protocols, such as Modbus, to communicate with IoT devices. This method is characterized by fast transmission, high efficiency, and ease of implementation, but it also lacks security protection mechanisms such as authentication and encryption. Some external illegal devices can analyze and detect messages, send abnormal operations and illegal data, and cause system operation to malfunction, affecting enterprise production. For data storage, typical industrial data acquisition systems adopt a centralized storage solution, designating a server as the data server and adding a redundant backup server for security reasons. This solution ensures fast data access and efficient operation, but when a server fails or the network is interrupted, the availability of the entire system is affected.

[0003] Therefore, the security of industrial data collection in the existing technology is not guaranteed and is easily affected by illegal intrusions. In addition, the data storage is highly centralized and is easily affected by server interruptions. Summary of the Invention

[0004] The purpose of the present invention is to provide an industrial data collection method based on blockchain technology to solve the technical problems in the existing technology that the security of industrial data collection is not guaranteed and is easily affected by illegal intrusion, and that data storage is highly centralized and easily affected by server interruptions.

[0005] In order to solve the above technical problems, the present invention specifically provides the following technical solutions:

[0006] An industrial data collection method based on blockchain technology includes the following steps:

[0007] In an industrial data acquisition system, a data query processing mode of a blockchain network is set to synchronously store device information of a lower computer in the blockchain network and a local database. The industrial data acquisition system includes: a lower computer, a network communication device, a host computer, a blockchain network, and a local database, wherein the blockchain network is located at the host computer;

[0008] The event function of the smart contract in the blockchain network is set as a device information update trigger event, which is used to capture the updated device information in the blockchain network and store it in the local database;

[0009] Utilize the local database combined with the blockchain network to verify the information of the lower-level device online, thereby improving the efficiency and security of blockchain data query;

[0010] Industrial data is collected using lower-level computer equipment that has passed information verification.

[0011] As a preferred solution of the present invention, the device information in the local database is consistent with the device information in the blockchain network.

[0012] As a preferred solution of the present invention, the construction of the device information update triggering event includes:

[0013] Setting the addition of a new device to a lower computer in the industrial data acquisition system or the status update of an existing device in the lower computer in the industrial data acquisition system as an information update trigger condition;

[0014] When the information update trigger condition is met, the device information of the new device of the lower computer in the blockchain network and the device information of the existing device of the lower computer with updated status are added to the local database;

[0015] When the information update trigger condition is not met, the device information in the current local database remains unchanged.

[0016] As a preferred solution of the present invention, the updating of the existing device status of the lower computer in the industrial data acquisition system includes:

[0017] Establish a status update recognition model;

[0018] Input the real-time working condition data corresponding to the real-time status of the existing equipment of the lower computer in the industrial data acquisition system into the state update recognition model, wherein if the output value of the state update recognition model is infinite, the existing equipment of the lower computer in the industrial data acquisition system is marked as a non-updated state;

[0019] If the output value of the state update identification model is not infinite, the existing device of the lower computer in the industrial data acquisition system is marked as state updated, and the state update identification model output value is added to the real-time time sequence of the existing device of the lower computer in the industrial data acquisition system to obtain the state update time point of the existing device of the lower computer;

[0020] The establishment of the state update recognition model includes:

[0021] Obtaining historical states of existing devices of a lower computer in an industrial data acquisition system over a set of historical time series, and manually marking an update label for each historical state in the historical time series, wherein if the historical state is different from the set state of the existing devices of the lower computer in the industrial data acquisition system, the historical state is marked as updated; if the historical state is different from the set state of the existing devices of the lower computer in the industrial data acquisition system, the historical state is marked as not updated;

[0022] Select existing devices in the lower computer of the industrial data acquisition system that have both unupdated and updated historical states as positive sample devices, obtain historical working condition data of the positive sample devices in a set of historical time series, and select existing devices in the lower computer of the industrial data acquisition system that only have unupdated historical states as negative sample devices;

[0023] The historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the negative sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series are used as input items of the neural network. The minimum time difference between the historical working condition data of the positive sample device corresponding to the updated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series is used as the state update time difference of the positive sample device, and the state update time difference of the negative sample device is set to infinity.

[0024] The state update time difference of the positive sample device and the state update time difference of the negative sample device are used as the output of the neural network;

[0025] The neural network is used to train the input items and output items of the neural network to obtain the state update recognition network. The model expression of the state update recognition network is:

[0026] T = BP (data_old);

[0027] Where T is the most recent time difference between the unupdated historical state and the updated historical state, data_old is the historical operating data of the unupdated historical state, and BP is the neural network.

[0028] As a preferred solution of the present invention, when the status of the existing equipment of the lower computer in the industrial data acquisition system is updated in the information update trigger condition, the device information of the existing equipment of the lower computer with updated status is added to the local database at the status update time point of the existing equipment of the lower computer.

[0029] As a preferred solution of the present invention, the method of using a local database in combination with a blockchain network to verify the online information of the lower computer includes:

[0030] Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where:

[0031] If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database;

[0032] If the local database status fails, an information verification request is initiated to the blockchain network to query the device information of the lower computer connected to the industrial data acquisition system in the blockchain network.

[0033] As a preferred solution of the present invention, the method of using a local database in combination with a blockchain network to verify the online information of the lower computer includes:

[0034] Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where:

[0035] If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database;

[0036] If the local database status fails, a data rewrite request is initiated to the blockchain network to rewrite the device information stored in the blockchain network to the local database, and then the device information of the lower computer connected to the industrial data acquisition system is queried in the rewritten local database.

[0037] As a preferred solution of the present invention, the device of determining the lower computer that has passed the information verification includes:

[0038] When the device information of the lower computer connected to the industrial data acquisition system can be queried in the local database or blockchain network, the device information of the lower computer connected to the industrial data acquisition system is marked as the device of the lower computer that has passed the information verification;

[0039] When the device information of the lower computer connected to the industrial data acquisition system cannot be queried in the local database and the blockchain network, the device information of the lower computer connected to the industrial data acquisition system will be marked as a device of the lower computer that has not passed the information verification.

[0040] As a preferred solution of the present invention, the present invention provides an industrial data acquisition system that applies an industrial data acquisition method based on blockchain technology, including: a lower computer, a network communication device, a host computer, a blockchain network, and a local database, wherein:

[0041] The lower computer includes at least one of a remote terminal unit, a programmable logic control unit, and an intelligent instrument, and is used for collecting industrial data and controlling the collection process, as well as collecting the equipment status of the lower computer and the working condition data of the lower computer, and converting the industrial data from the status signal to a digital signal;

[0042] The host computer includes at least one of a human-machine interface, a computer, configuration software, application software, and a database;

[0043] The network communication device is used to communicate with the lower computer and the upper computer, so that the industrial data, device status and working condition data of the lower computer are transmitted to the upper computer;

[0044] The blockchain network is located between the upper computers and is used to store the device information of the lower computers. It monitors the device information update trigger event in the industrial data acquisition system and verifies the device information of the lower computers in combination with the local database.

[0045] The local database is used to store the device information of the lower computer.

[0046] As a preferred solution of the present invention, the data query processing method of the blockchain network is to synchronously store the device information of the lower computer in the blockchain network and the local database;

[0047] The event function of the smart contract in the blockchain network is to trigger events when device information is updated.

[0048] Compared with the prior art, the present invention has the following beneficial effects:

[0049] In order to ensure the security of data collection, the present invention introduces blockchain technology into the current data collection system, so that the host computer joins the blockchain network. In this way, due to the large number of data storage nodes, the attack cost is increased, and the system security factor is improved. In addition, the decentralized nature of blockchain technology can ensure the availability of the data collection system. In order to make up for the efficiency disadvantages of querying device information of blockchain technology, the local database is used for data query processing to solve the problem of low data query efficiency caused by the blockchain structure. It is also equivalent to adding a layer of redundant protection mechanism in front of the blockchain, thereby improving the security of the blockchain. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other implementation drawings based on the provided drawings without inventive effort.

[0051] Figure 1 Flowchart of the industrial data collection method based on blockchain technology provided by an embodiment of the present invention;

[0052] Figure 2 Flowchart of information verification for online equipment of a lower computer provided by an embodiment of the present invention;

[0053] Figure 3 A structural diagram of an existing data acquisition system provided by an embodiment of the present invention;

[0054] Figure 4 This is a structural diagram of the industrial data acquisition system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0055] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0056] Traditional data acquisition systems use common industrial communication protocols, such as Modbus, when communicating with IoT devices. This approach is characterized by fast transmission, high efficiency, and ease of implementation, but it also lacks security mechanisms such as authentication and encryption. Some external illegal devices can analyze and detect messages, send abnormal operations and illegal data, and prevent the system from operating normally, affecting enterprise production. In terms of data storage, general industrial data acquisition systems use centralized storage solutions, designating a server as a data server and adding a redundant backup server for security reasons. This solution can ensure fast data access and efficient operation, but when a server fails or the network is interrupted, the availability of the entire system is affected. Therefore, the present invention provides an industrial data acquisition method based on blockchain technology, which introduces blockchain technology and enables a host computer to join the blockchain network. This increases the attack cost due to the large number of data storage nodes, thereby improving the system's security factor. Furthermore, the decentralized nature of blockchain technology can ensure the availability of the data acquisition system.

[0057] like Figure 1 As shown, the present invention provides an industrial data collection method based on blockchain technology, comprising the following steps:

[0058] In the industrial data acquisition system, the data query processing mode of the blockchain network is set to synchronously store the device information of the lower computer in the blockchain network and the local database. The industrial data acquisition system includes: a lower computer, a network communication device, a host computer, a blockchain network and a local database, wherein the blockchain network is located at the host computer;

[0059] Set the event function of the smart contract in the blockchain network as the device information update trigger event. The device information update trigger event is used to capture the updated device information in the blockchain network and store it in the local database;

[0060] Utilize the local database combined with the blockchain network to verify the information of the lower-level device online, thereby improving the efficiency and security of blockchain data query;

[0061] Industrial data is collected using lower-level computer equipment that has passed information verification.

[0062] like Figure 3 As shown in the figure, the network structure of the existing data acquisition system consists of a host computer, network equipment, and a slave computer. The slave computer includes RTU, PLC, intelligent instruments and other equipment, focusing on the collection and control of field instrument data. This node has the functions of data acquisition, equipment or process control, and converts the status signal into a digital signal, which is transmitted to the host computer system through various communication methods. The host computer includes HMI, computer, configuration software, application software, database, etc., and usually has a friendly human-computer interface. It collects data from each slave computer through the network to realize remote monitoring and control functions.

[0063] In order to ensure the security of data collection, the present invention introduces blockchain technology into the existing data collection system, so that the host computer joins the blockchain network. In this way, due to the large number of host computer nodes, if hackers want to obtain or tamper with data, they need to invest higher resources to succeed. The cost of attack is far higher than the value of the data, thus defeating the purpose of the attack and improving the security factor of the system.

[0064] At the same time, the introduction of blockchain technology will result in a long time and very low efficiency when traversing the data in the block due to the chain structure adopted by the blockchain. Therefore, when using the blockchain to store a large amount of device information, in order to improve the efficiency of querying device information, the present invention does not choose to directly use smart contracts to perform data query processing. In order to query device information in the simplest way, the device-related information is stored simultaneously in the blockchain network and the local database (MySQL). Compared with the blockchain network, MySQL has the characteristics of faster and more flexible query. A data synchronization backup is made in the local database, so that the data in MySQL is always consistent with the data on the blockchain. This can not only solve the problem of low data query efficiency caused by the blockchain structure, but also add another layer of redundant protection mechanism in front of the blockchain, improving the security of the blockchain.

[0065] Furthermore, to ensure that the data on the local database can be synchronized with the data on the blockchain in a timely manner, the event function of the smart contract can be used to set an event trigger condition. When a new device is added or the device status changes, the condition will be triggered, and the system will then store the newly added blockchain data in the MySQL database. When the device is online and ready to be connected to the system, a verification operation must be initiated first, that is, a search in MySQL. The query speed is much faster than the query on the blockchain. Even if the MySQL database fails, the device information on the blockchain can be immediately rewritten into the database to restore the data, or the blockchain network can be used directly to query and verify the device information, as follows:

[0066] The construction of the device information update trigger event includes:

[0067] Setting the addition of a new device to a lower computer in the industrial data acquisition system or the status update of an existing device in the lower computer in the industrial data acquisition system as an information update trigger condition;

[0068] When the information update trigger condition is met, the device information of the new device of the lower computer in the blockchain network and the device information of the existing device of the lower computer with updated status are added to the local database;

[0069] When the information update trigger condition is not met, the device information in the current local database remains unchanged.

[0070] Update the existing device status of the lower computer in the industrial data acquisition system, including:

[0071] Establish a status update recognition model;

[0072] Input the real-time working condition data corresponding to the real-time status of the existing equipment of the lower computer in the industrial data acquisition system into the state update recognition model, wherein if the output value of the state update recognition model is infinite, the existing equipment of the lower computer in the industrial data acquisition system is marked as a non-updated state;

[0073] If the output value of the state update identification model is not infinite, the existing device of the lower computer in the industrial data acquisition system is marked as state updated, and the state update identification model output value is added to the real-time time sequence of the existing device of the lower computer in the industrial data acquisition system to obtain the state update time point of the existing device of the lower computer;

[0074] The establishment of the state update recognition model includes:

[0075] Obtain the historical status of existing devices of the lower computer in the industrial data acquisition system over a set of historical time series, and manually mark the historical status of each historical time series with an update label, wherein if the historical status is different from the set status of the existing devices of the lower computer in the industrial data acquisition system, the historical status is marked as updated; if the historical status is different from the set status of the existing devices of the lower computer in the industrial data acquisition system, the historical status is marked as not updated;

[0076] Select existing devices in the lower computer of the industrial data acquisition system that have both unupdated and updated historical states as positive sample devices, obtain historical working condition data of the positive sample devices in a set of historical time series, and select existing devices in the lower computer of the industrial data acquisition system that only have unupdated historical states as negative sample devices;

[0077] The historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the negative sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series are used as input items of the neural network. The minimum time difference between the historical working condition data of the positive sample device corresponding to the updated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series is used as the state update time difference of the positive sample device, and the state update time difference of the negative sample device is set to infinity.

[0078] The state update time difference of the positive sample device and the state update time difference of the negative sample device are used as the output of the neural network;

[0079] The neural network is used to train the input items and output items of the neural network to obtain the state update recognition network. The model expression of the state update recognition network is:

[0080] T = BP (data_old);

[0081] Where T is the most recent time difference between the unupdated historical state and the updated historical state, data_old is the historical operating data of the unupdated historical state, and BP is the neural network.

[0082] When the status of the existing device of the lower computer in the industrial data acquisition system is updated in the information update trigger condition, the device information of the existing device of the lower computer with the updated status is added to the local database at the status update time point of the existing device of the lower computer.

[0083] The present invention constructs a status update recognition model, which can realize that when the device status of the lower computer is not updated, it can know in advance whether a status update will occur subsequently, and at the same time, the time node of the subsequent status update can be measured in advance, so that the device information of the existing device of the lower computer with the updated status can be added to the local database at the same time as the status update, without the need to add the device information with a lag after the update status is identified. The timeliness of the device information update in the local database is stronger, thereby ensuring that the accuracy of the device information in the local database is higher, and the timeliness and accuracy of the devices of the lower computer that have passed the information verification are determined to be higher, and ultimately the timeliness and accuracy of data collection in the blockchain are achieved.

[0084] When a device is online and ready to be connected to the system, a verification operation must be initiated first, that is, a search in MySQL. The query speed is much faster than the query on the blockchain. Even if the MySQL database fails, the device information on the blockchain can be immediately rewritten into the database to restore the data, or the blockchain network can be used to query and verify the device information directly, as follows:

[0085] like Figure 2 As shown, the local database is combined with the blockchain network to verify the information of the lower-level device online, including:

[0086] Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where:

[0087] If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database;

[0088] If the local database status fails, an information verification request is initiated to the blockchain network to query the device information of the lower computer connected to the industrial data acquisition system in the blockchain network.

[0089] Use the local database combined with the blockchain network to verify the information of the lower-level device online, including:

[0090] Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where:

[0091] If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database;

[0092] If the local database status fails, a data rewrite request is initiated to the blockchain network to rewrite the device information stored in the blockchain network to the local database, and then the device information of the lower computer connected to the industrial data acquisition system is queried in the rewritten local database.

[0093] Determine the devices on the lower computer that have passed information verification, including:

[0094] When the device information of the lower computer connected to the industrial data acquisition system can be queried in the local database or blockchain network, the device information of the lower computer connected to the industrial data acquisition system is marked as the device of the lower computer that has passed the information verification;

[0095] When the device information of the lower computer connected to the industrial data acquisition system cannot be queried in the local database and the blockchain network, the device information of the lower computer connected to the industrial data acquisition system will be marked as a device of the lower computer that has not passed the information verification.

[0096] like Figure 4 As shown, based on the above-mentioned industrial data collection method based on blockchain technology, the present invention provides an industrial data collection system, including: a lower computer, a network communication device, a host computer, a blockchain network, and a local database, wherein:

[0097] The lower computer includes at least one of a remote terminal unit, a programmable logic control unit, and an intelligent instrument, and is used for collecting industrial data and controlling the collection process, as well as collecting the equipment status of the lower computer and the working condition data of the lower computer, and converting the industrial data from the status signal to a digital signal;

[0098] The host computer includes at least one of a human-machine interface, a computer, configuration software, application software, and a database;

[0099] The network communication equipment is used to connect the lower computer and the upper computer, so that the industrial data, equipment status and working condition data of the lower computer are transmitted to the upper computer;

[0100] The blockchain network is located between the upper computers and is used to store the device information of the lower computers. It monitors the device information update trigger events in the industrial data acquisition system and verifies the device information of the lower computers in combination with the local database.

[0101] The local database is used to store the device information of the lower computer.

[0102] The data query processing method of the blockchain network is to synchronously store the device information of the lower computer in the blockchain network and the local database;

[0103] The event function of the smart contract in the blockchain network is to trigger events when device information is updated.

[0104] The industrial data acquisition system has a six-layer structure, as follows:

[0105] (1) Application layer: The application layer is the user's operation layer. After the user runs the program, he can perform equipment configuration, query, and management operations at this layer, and can also query historical data.

[0106] (2) Smart contract layer. This layer mainly records all the contracts designed in this article. In the application layer, it also creates contract instances related to web3.js. After the new contract is created and deployed, it will be automatically executed.

[0107] (3) Incentive layer: The incentive mechanism is a part of the blockchain that must exist. The setting of the incentive mechanism can encourage users to actively record accounts to a certain extent, which provides a certain guarantee for the normal operation of data nodes.

[0108] (4) Consensus layer: This system adopts a hybrid consensus mechanism of PoW and PoS to make up for the shortcomings of a single consensus mechanism and improve the work efficiency and security of the blockchain-based data collection system.

[0109] (5) Network layer: The network layer uses P2P network protocol to improve the security and stability of the system.

[0110] (6) Data layer: The data layer is used to store device information, operation records, historical data and other information.

[0111] A smart contract is a collection of the required information, various functions, and various states generated during contract execution. The smart contract designed in this invention consists of a data storage structure, functions, and event triggers. Because smart contracts are deployed in Ethereum as transactions, they cannot be modified or updated within Ethereum. The smart contract in this invention primarily involves device management. Specifically, the various types of information stored in the device management smart contract are shown in Table 1.

[0112] Table 1 Field information of device management smart contract

[0113]

[0114] The main functions of the smart contract are designed as follows:

[0115] (1) struct DevContent(): This structure is responsible for storing device information.

[0116] (2) functionAddDevdata(): This function is used by administrators to add devices to the blockchain network.

[0117] (3) Function CheckDevdata(): This function can detect whether the device is secure and whether the collected data is reliable by verifying the device’s ID, password and other information.

[0118] (4) function ModifyDevStatus(): This function is used to modify the device status. By querying the device status information, you can determine whether the device is available.

[0119] (5) function RestoreDevdataToDB(): This function is used to manually synchronize the device information set maintained on the blockchain to the database table off-chain and restore the data information in the table.

[0120] (6) event SaveDevdataToDB(): monitors the device adding function of the AddDevdata() function. After the addition is successful, the device information is sent to the background service program and added to the off-chain database.

[0121] After a smart contract is written in Solidity, it is called from the Go backend code. When deploying a smart contract, the Ethereum Client class API provides an interface for generating block transaction information, such as obtaining device information and uploading data. It also generates a contract address. By obtaining this contract address and instantiating it, the relevant methods of the smart contract can be called. The code design is shown in Table 2.

[0122] Table 2 Smart contract call interface code

[0123]

[0124] In order to ensure the security of data collection, the present invention introduces blockchain technology into the current data collection system, so that the host computer joins the blockchain network. In this way, due to the large number of data storage nodes, the attack cost is increased, and the system security factor is improved. In addition, the decentralized nature of blockchain technology can ensure the availability of the data collection system. In order to make up for the efficiency disadvantages of querying device information of blockchain technology, the local database is used for data query processing to solve the problem of low data query efficiency caused by the blockchain structure. It is also equivalent to adding a layer of redundant protection mechanism in front of the blockchain, thereby improving the security of the blockchain.

[0125] The above embodiments are merely exemplary embodiments of the present application and are not intended to limit the scope of the present application. The scope of protection of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and scope of protection of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the scope of protection of the present application.

Claims

1. An industrial data collection method based on blockchain technology, characterized by: The following steps are involved: In an industrial data acquisition system, a data query processing mode of a blockchain network is set to synchronously store device information of a lower computer in the blockchain network and a local database. The industrial data acquisition system includes: a lower computer, a network communication device, a host computer, a blockchain network, and a local database, wherein the blockchain network is located at the host computer; The event function of the smart contract in the blockchain network is set as a device information update trigger event, which is used to capture the updated device information in the blockchain network and store it in the local database; Use the local database combined with the blockchain network to verify the information of the lower-level device online; Collect industrial data using devices on lower computers that have passed information verification; The construction of the device information update triggering event includes: Setting the addition of a new device to a lower computer in the industrial data acquisition system or the status update of an existing device in the lower computer in the industrial data acquisition system as an information update trigger condition; When the information update trigger condition is met, the device information of the new device of the lower computer in the blockchain network and the device information of the existing device of the lower computer with updated status are added to the local database; When the information update trigger condition is not met, the device information in the current local database remains unchanged; The existing device status update of the lower computer in the industrial data acquisition system includes: Establish a status update recognition model; Input the real-time working condition data corresponding to the real-time status of the existing equipment of the lower computer in the industrial data acquisition system into the state update recognition model, wherein if the output value of the state update recognition model is infinite, the existing equipment of the lower computer in the industrial data acquisition system is marked as a non-updated state; If the output value of the state update identification model is not infinite, the existing device of the lower computer in the industrial data acquisition system is marked as state updated, and the state update identification model output value is added to the real-time time sequence of the existing device of the lower computer in the industrial data acquisition system to obtain the state update time point of the existing device of the lower computer; The establishment of the state update recognition model includes: Obtaining historical states of existing devices of a lower computer in an industrial data acquisition system over a set of historical time series, and manually marking an update label for each historical state in the historical time series, wherein if the historical state is different from the set state of the existing devices of the lower computer in the industrial data acquisition system, the historical state is marked as updated; if the historical state is different from the set state of the existing devices of the lower computer in the industrial data acquisition system, the historical state is marked as not updated; Select existing devices in the lower computer of the industrial data acquisition system that have both unupdated and updated historical states as positive sample devices, obtain historical working condition data of the positive sample devices in a set of historical time series, and select existing devices in the lower computer of the industrial data acquisition system that only have unupdated historical states as negative sample devices; The historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the negative sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series are used as input items of the neural network. The minimum time difference between the historical working condition data of the positive sample device corresponding to the updated historical state in a set of historical working condition data of the historical time series and the historical working condition data of the positive sample device corresponding to the unupdated historical state in a set of historical working condition data of the historical time series is used as the state update time difference of the positive sample device, and the state update time difference of the negative sample device is set to infinity. The state update time difference of the positive sample device and the state update time difference of the negative sample device are used as the output of the neural network; The neural network is used to train the input items and output items of the neural network to obtain the state update recognition network. The model expression of the state update recognition network is: T = BP(data_old); Where T is the most recent time difference between the unupdated historical state and the updated historical state, data_old is the historical operating data of the unupdated historical state, and BP is the neural network.

2. The industrial data collection method based on blockchain technology according to claim 1 is characterized in that: The device information in the local database is consistent with the device information in the blockchain network.

3. The industrial data collection method based on blockchain technology according to claim 1 is characterized in that: The use of the local database combined with the blockchain network to verify the information of the device online on the lower computer includes: Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where: If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database; If the local database status fails, an information verification request is initiated to the blockchain network to query the device information of the lower computer connected to the industrial data acquisition system in the blockchain network.

4. The industrial data collection method based on blockchain technology according to claim 1 is characterized in that: The use of the local database combined with the blockchain network to verify the information of the device online on the lower computer includes: Connect the lower computer's equipment to the industrial data acquisition system and initiate an information verification request to the local database, where: If the local database is in normal state, the device information of the lower computer connected to the industrial data acquisition system is queried in the local database; If the local database status fails, a data rewrite request is initiated to the blockchain network to rewrite the device information stored in the blockchain network to the local database, and then the device information of the lower computer connected to the industrial data acquisition system is queried in the rewritten local database.

5. The industrial data collection method based on blockchain technology according to claim 1 is characterized in that: Determine the devices on the lower computer that have passed information verification, including: When the device information of the lower computer connected to the industrial data acquisition system can be queried in the local database or blockchain network, the device information of the lower computer connected to the industrial data acquisition system is marked as the device of the lower computer that has passed the information verification; When the device information of the lower computer connected to the industrial data acquisition system cannot be queried in the local database and the blockchain network, the device information of the lower computer connected to the industrial data acquisition system will be marked as a device of the lower computer that has not passed the information verification.

6. An industrial data collection system using the industrial data collection method based on blockchain technology according to any one of claims 1 to 5, characterized in that: include: Lower computer, network communication equipment, upper computer, blockchain network, local database, among which, The lower computer includes at least one of a remote terminal unit, a programmable logic control unit, and an intelligent instrument, and is used for collecting industrial data and controlling the collection process, as well as collecting the equipment status of the lower computer and the working condition data of the lower computer, and converting the industrial data from the status signal to a digital signal; The host computer includes at least one of a human-machine interface, a computer, configuration software, application software, and a database; The network communication device is used to communicate with the lower computer and the upper computer, so that the industrial data, device status and working condition data of the lower computer are transmitted to the upper computer; The blockchain network is located between the upper computers and is used to store the device information of the lower computers. It monitors the device information update trigger event in the industrial data acquisition system and verifies the device information of the lower computers in combination with the local database. The local database is used to store the device information of the lower computer.

7. An industrial data acquisition system according to claim 6, characterized in that: The data query processing method of the blockchain network is to synchronously store the device information of the lower computer in the blockchain network and the local database; The event function of the smart contract in the blockchain network is to trigger events when device information is updated.

Citation Information

Patent Citations

  • Two-stage consensus block chain system with state buffer capability and deployment method

    CN111125131A

  • Internet of Things data storage method based on block chain and NB-IoT chip

    CN114499876A