Optimization Method for PLC Real-Time Data Acquisition Based on Edge Gateway and Edge Computing

By deploying edge gateways and edge computing in industrial automation production, building an edge data acquisition network and optimizing data sampling frequency, the problems of PLC real-time data acquisition delay and resource consumption are solved, and efficient and real-time data acquisition and processing are achieved.

CN119376330BActive Publication Date: 2025-06-24NANJING GUANGJIN TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411407446.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-06-24
Estimated Expiration
2044-10-10

AI Technical Summary

Technical Problem

The prior art is difficult to effectively optimize the real-time data acquisition of PLC in industrial automation production, resulting in delayed and inaccurate data acquisition, and increases the pressure on cloud computing.

Method used

By deploying edge gateways and edge computing in industrial automation production, building an edge data acquisition network, performing data preprocessing, filtering and aggregation, optimizing the data sampling frequency of PLC, and reasonably allocating computing resources in collaboration with edge computing and cloud computing.

Benefits of technology

It realizes real-time and accurate data acquisition in industrial automation production, reduces data transmission bandwidth and cloud processing pressure, improves system resource utilization, and ensures real-time and accuracy of scenarios such as industrial control and fault detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119376330B_ABST
    Figure CN119376330B_ABST
Patent Text Reader

Abstract

The present invention discloses an optimized method for real-time data acquisition of PLCs based on edge gateways and edge computing, which relates to the technical field of data acquisition. In the present invention, data collectors are deployed at each PLC location, the transmission distances between each PLC location and the central cloud processor are calculated, and an edge data acquisition network is constructed; the relationship between the change rate of each type of data and the sampling frequency is calculated, and an optimized model for the data sampling frequency of PLCs is constructed; important data is used to screen the types of abnormalities occurring in PLCs, and important events of PLCs are found; after the change rate of real-time data is judged using an optimized threshold, the real-time sampling frequency is optimized; the cloud processor analyzes the device data when abnormalities occur in all PLCs within the scope of industrial production, calculates the depth judgment threshold for PLCs to have abnormalities, and uses the edge data collector and the cloud processor to perform double abnormality judgment on PLCs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data acquisition, and particularly to an optimization method for real-time data acquisition of PLC based on an edge gateway and edge computing. Background Art

[0002] With the improvement of the complexity of production systems, the functions of PLCs have gradually expanded. Starting from the initial switch logic control, they have gradually covered complex control tasks such as process control and motion control. The data acquisition ability of PLCs has also expanded from simple sensor signal acquisition to processing a large amount of industrial data. In industrial control scenarios, the purpose of real-time data acquisition is to monitor the production process, improve production efficiency, ensure the safe operation of equipment, and optimize the overall production process. With the in-depth development of industrial automation, especially the proposal of the concept of Industry 4.0, the demand for data acquisition in factories has gradually expanded from simple periodic acquisition to the acquisition of high-frequency and dynamically changing real-time data. Real-time data acquisition needs to process a large amount of sensor data, ensure its reliability and real-time nature, and at the same time face challenges such as how to optimize the acquisition efficiency, reduce latency, and reduce resource consumption. With the development of the industrial Internet of Things, data acquisition is no longer limited to local control systems. More and more industrial systems need to transmit data to the cloud for big data analysis, artificial intelligence prediction, and equipment maintenance. However, directly transmitting a large amount of raw data to the cloud will increase the pressure on network bandwidth and cloud computing. And currently, a fixed sampling frequency is often used for data acquisition, but the data change rate of PLCs is not constant, often resulting in delayed, inaccurate, or redundant data acquisition, which greatly consumes cloud computing space. Summary of the Invention

[0003] The purpose of the present invention is to provide an optimization method for real-time data acquisition of PLC based on an edge gateway and edge computing to solve the problems raised in the prior art.

[0004] To achieve the above purpose, the present invention provides the following technical solutions:

[0005] An optimization method for real-time data acquisition of PLC based on an edge gateway and edge computing, the method comprising the following steps:

[0006] S100. Collect the positions of each PLC in industrial automation production, deploy data collectors at each PLC position, calculate the transmission distance between each PLC position and the central cloud processor, and construct an edge data acquisition network;

[0007] Further, the specific steps for constructing the edge data acquisition network are:

[0008] S101. Establish a plane rectangular coordinate system within the industrial automation production area, with the cloud processor as the origin, and collect the position coordinates of each PLC in the coordinate system during industrial automation production as {(x1, y1), (x2, y2), (x3, y3),..., (x n , y n ). (x1, y1), (x2, y2), (x3, y3),..., (x n , y n ) represent the position coordinates of the 1st, 2nd, 3rd,..., nth PLC in the coordinate system during industrial automation production, where n is a positive integer; deploy data collectors at the coordinate positions of each PLC, and construct an edge data collection network by combining the cloud processor and n data collectors;

[0009] S102. After constructing the edge data collection network, calculate the data transmission distance between each edge data collector and the cloud processor. The formula is: In the formula, L represents the data transmission distance between each edge data collector and the cloud processor during industrial automation production, x and y represent the coordinate positions of the PLC in each edge data collector, and by using the formula, the data transmission distances between all PLC edge data collectors and the cloud processor are calculated as {L1, L2, L3,..., L n}, and L1, L2, L3,..., L n represent the data transmission distances between the 1st, 2nd, 3rd,..., nth PLC edge data collectors and the cloud processor calculated during industrial automation production.

[0010] Constructing an edge data collection network in industrial automation production can not only collect and transmit data, but also preprocess, filter, and aggregate data locally, reduce unnecessary data transmission, thereby reducing bandwidth requirements and cloud processing pressure; calculating the data transmission distance between each PLC and the cloud processor can calculate the data transmission time more clearly and optimize data latency more accurately.

[0011] S200. Collect the sampling frequency of all data of each PLC by the cloud processor in history and the change data of all data, calculate the relationship between the change rate of each type of data and the sampling frequency, and construct an optimization model for the data sampling frequency of the PLC;

[0012] Furthermore, the specific steps for constructing an optimization model for the data sampling frequency of the PLC are as follows:

[0013] S201. Collect the change values of each type of data when the cloud processor collects all data of each PLC in history as {P1, P2, P3,..., P m}, P1, P2, P3,..., P mRepresents the change values of the 1st, 2nd, 3rd, …, mth types of data in each collected PLC, where m is a positive integer; and extracts the time data when each type of data changes as {t1, t2, t3, …, t m}, t1, t2, t3, …, t m Represents the time data when the 1st, 2nd, 3rd, …, mth types of data in the PLC change; uses the linear regression algorithm to analyze the change values and time data of each type of data, and constructs the correlation function between the change value and time of each type of data in the PLC as P(t); calculates all the correlation functions for all data to obtain all the correlation functions as {P(t)1, P(t)2, P(t)3, …, P(t) m}, P(t)1, P(t)2, P(t)3, …, P(t m Represents the correlation functions of the 1st, 2nd, 3rd, …, mth types of data calculated in the PLC;

[0014] S202. After calculating the correlation function of each type of data in the PLC, take the derivative of the correlation function to calculate the change rate of each type of data. The formula is: In the formula, V represents the change rate of the calculated data, represents taking the derivative of the correlation function P(t) with respect to t; after m calculations, the change rates of each type of data are {V1, V2, V3, …, V m}, V1, V2, V3, …, V m Represents the change rates of the 1st, 2nd, 3rd, …, mth types of data calculated in the PLC;

[0015] S203. Extract the lowest sampling frequency f min reached when the cloud processor collected data from the PLC in history, and design and construct the optimization relationship between the change rate of each type of data and the sampling frequency according to the change rate of each type of data in the PLC in history. The formula is:

[0016] f(t) = f min + k × V;

[0017] In the formula, f(t) represents the optimized sampling frequency, V represents the change rate of each type of data, and k represents the influence coefficient of the change rate of data on the sampling frequency; extract the maximum sampling frequency f max of the cloud processor for PLC data in history and the maximum change rate v max of the data in history, and calculate the influence coefficient of the change rate of data on the sampling frequency

[0018] After calculating the optimization relationship between the change rate of each type of data and the sampling frequency, set the optimization limit value of the sampling frequency of each type of data as f minand f max Using the optimization constraints and optimization relationships, the sampling frequency optimization model for each type of data is constructed as follows:

[0019] f(t) = max(f min , min(f max , f min + k × V));

[0020] In the formula, f(t) represents the optimized sampling frequency, max represents the maximum value of the data within the parentheses, min represents the minimum value of the data within the parentheses, and |V| represents the absolute value of the change rate of each type of data; the sampling frequency optimization model for each type of data in the PLC is constructed.

[0021] By analyzing the relationship between the PLC data change rate and the sampling frequency using historical data, a sampling frequency optimization model is constructed to optimize the data sampling frequency of the PLC according to requirements and real-time conditions, avoiding unnecessary high-frequency acquisitions, thereby significantly reducing the amount of data. This not only reduces the pressure on data storage but also reduces the burden of data transmission. When the system data changes slowly or is stable, reducing the sampling frequency can reduce the use of the processor, memory, and bandwidth, saving computing resources and reducing the system load; when the data changes rapidly or a critical event occurs, dynamic sampling rate adjustment can quickly increase the sampling frequency to capture more detailed changes and ensure that the system can respond in a timely manner. This is particularly important for scenarios with high real-time requirements such as industrial control and fault detection.

[0022] S300. Collect historical data collected by the cloud processor for the PLC and determine the data values when different types of abnormalities occur in the PLC. Analyze the data collected for each type of abnormality to find the data that affects the occurrence of abnormalities in the PLC as important data. Use the important data to screen the types of abnormalities that occur in the PLC and find the important events of the PLC;

[0023] Further, the specific steps for finding the important events of the PLC are as follows:

[0024] S301. Collect historical data collected by the cloud processor for the PLC and determine the data values when different types of abnormalities occur in the PLC. Let the change amounts of all PLC data when each type of abnormality occurs be {B1, B2, B3,..., B u}; B1, B2, B3,..., B u represent the change amounts of the 1st, 2nd, 3rd,..., u-th types of data of the PLC when each type of abnormality occurs, and u is a positive integer. Judge the change amounts of all the collected data and extract the data type with the largest change as the characteristic data of the abnormality; extract the characteristic data of each type of abnormality in the same way from the history.

[0025] S302. After extracting the characteristic data of all abnormalities of each PLC, collect the abnormal data that changed during equipment failure shutdown in the history of industrial automation generation as {D1, D2, D3, ..., D h},

[0026] D1, D2, D3, ..., D h represents the 1st, 2nd, 3rd, ..., hth abnormal data that changed during equipment failure shutdown in the history of industrial automation generation collected, where h is a positive integer; search for the characteristic data of each abnormality of the PLC among the abnormal data of equipment failure shutdown collected, and determine the characteristic data existing in the abnormal data of equipment failure shutdown as the important data of the PLC;

[0027] S303. According to the important data of the PLC found, select the types of PLC abnormalities corresponding to the important data as the important events of the PLC to form an important event database.

[0028] Important event detection can identify abnormalities or important changes in the system in real time, enabling the system to respond quickly when an event occurs, for early warning, adjustment or taking corrective measures. And it enables the system to focus on processing data at critical moments rather than continuously processing all data. The system only allocates more resources for processing when an important event is detected, effectively reducing the processing overhead of invalid data and saving computing, storage and network resources. When the system detects an important event, it can dynamically increase the sampling frequency of data acquisition to capture more detailed data; while at irrelevant times, it reduces the sampling frequency to save resources. This on-demand sampling mechanism greatly improves the resource utilization rate of the system.

[0029] S400. Calculate the optimization threshold of the PLC sampling frequency according to the transmission distance between each PLC and the cloud processor; use the edge data acquisition network to collect the data of each PLC at each location, calculate the real-time data change rate, and optimize the real-time sampling frequency after judging the real-time data change rate with the optimization threshold;

[0030] Furthermore, the specific steps for optimizing the real-time sampling frequency are as follows:

[0031] S401. Collect the data sampling frequency and data change period when the cloud processor collects the data of each PLC with a delay in history, and calculate the optimization threshold in combination with the data transmission distance between each PLC and the cloud processor. The formula is: In the formula, In represents the optimization threshold calculated for each PLC, P y represents the data sampling frequency when the cloud processor collects the data of each PLC with a delay in history, T yIt represents the data change cycle when there is a delay in the cloud processor collecting each PLC data in the collected history. L represents the data transmission distance between each PLC and the cloud processor, and V c represents the data transmission speed; the optimization threshold of each PLC is obtained through formula calculation;

[0032] S402. Use the edge data collector of each PLC to collect the real-time data of the PLC, extract the real-time change cycle of the data as Ts and the real-time sampling frequency as Ps, and calculate the real-time difference between the change cycle and the sampling frequency as Cc. When Cc≥In, it is judged that the real-time sampling frequency of the PLC needs to be optimized. When Cc<In, it is judged that the real-time sampling frequency of the PLC does not need to be optimized;

[0033] S403. Calculate the real-time PLC data change rate Vs by combining the data change value of the collected PLC with the derivative of the change cycle, optimize the sampling frequency of the PLC that needs to be optimized, input the calculated real-time data change rate into the sampling frequency optimization model to obtain the optimized sampling frequency f(t); use the optimized sampling frequency f(t) to sample and collect the data of the PLC.

[0034] S500. In the edge data collection network, use the data change rate when each PLC has an abnormality in the history, calculate the abnormal sampling frequency using the abnormal change rate, and use the abnormal sampling frequency as the edge warning threshold; the cloud processor analyzes the device data when all PLCs in the industrial production range have an abnormality, and calculates the depth judgment threshold for the PLC to have an abnormality;

[0035] Furthermore, the specific steps for calculating the edge warning threshold and the depth judgment threshold of the PLC are as follows:

[0036] S501. Collect the characteristic data when the PLC has an abnormality in the history, extract the data change amount and change cycle when each abnormal characteristic data has an abnormality in the history, calculate the change rate of the characteristic data as Ve, and calculate the abnormal sampling frequency using the data change rate when each PLC has an abnormality in the edge data collection network. The formula is: Py = f min +k×Ve. In the formula, Py represents the calculated abnormal sampling frequency. Use the abnormal sampling frequency to calculate the edge warning threshold. The formula is: In_p = Py_p - Py_st. In the formula, In_p represents the calculated edge warning threshold, Py_p represents the average value of all data abnormal sampling frequencies calculated, and Py_st represents the standard deviation of all data sampling frequencies calculated;

[0037] S502. Collect the data value Z of the important data found in S302 during equipment failure shutdowns in historical industrial automation production, and calculate the depth judgment threshold of the PLC. The formula is: Ins = Zp - Zst, where Ins represents the calculated depth judgment threshold of the PLC, Zp represents the average value of all important historical data collected, and Zst represents the standard deviation of all important historical data collected.

[0038] S600. Use the edge data acquisition network to collect data of each PLC, and determine whether the PLC is abnormal for preliminary warning; judge the occurring abnormalities, and when it is an important event, use the edge gateway to transmit the collected important data to the cloud processor.

[0039] Further, the specific steps for determining whether the PLC is abnormal for preliminary warning are as follows:

[0040] S601. Use the edge data acquisition network to collect all characteristic data of each PLC according to the optimized sampling frequency, and obtain the real-time characteristic data as {Te1, Te2, Te3,..., Te g}, where Te1, Te2, Te3,..., Te g represent the 1st, 2nd, 3rd,..., gth types of real-time characteristic data collected. Use the edge warning threshold to judge the real-time characteristic data. When Te < In_p, it is judged that the PLC is working normally; when Te ≥ In_p, it is judged that the PLC has an abnormal risk and a preliminary warning is issued.

[0041] S602. After judging that the PLC has an abnormal risk and issuing a preliminary warning, search in the important event database according to the warning abnormal type. When the abnormal type of the preliminary warning is an important event, transmit the collected real-time characteristic data as important data to the cloud processor.

[0042] S700. After the cloud processor receives the important data transmitted by the edge data collector, perform in-depth analysis on the important data transmitted by all PLCs, and use the depth judgment threshold to perform a secondary in-depth abnormality judgment on the PLCs with preliminary warnings.

[0043] Edge collect PLC data through the edge data acquisition network, and use the cloud processor to collect and analyze important data. In the close cooperation between edge computing and cloud computing, edge computing processes tasks with high real-time performance, such as fast data analysis and response, while the cloud is responsible for complex historical data analysis and model training. The innovation of this architecture lies in the reasonable allocation of computing resources, achieving a balance between real-time processing and in-depth analysis, while ensuring the flexibility and scalability of the system.

[0044] Further, the specific steps for performing a secondary in-depth anomaly judgment on the preliminarily warned PLCs using the depth judgment threshold are as follows:

[0045] S701. After the cloud processor receives the transmitted real-time important data, it uses the depth judgment threshold to judge the real-time important data. When Te≥Ins, the cloud processor determines that there is a risk of production shutdown due to a fault in industrial automation and issues a warning to all PLCs; when Te<Ins, the cloud processor determines that industrial automation production is normal, and the preliminarily warned PLCs are individually abnormal, and the maintenance quality of the preliminarily warned PLCs is ensured.

[0046] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0047] 1. The present invention constructs an edge data acquisition network in industrial automation production, which can not only collect and transmit data, but also preprocess, filter, and aggregate data locally, reducing unnecessary data transmission, thereby reducing bandwidth requirements and cloud processing pressure; calculating the data transmission distance between each PLC and the cloud processor can more clearly calculate the data transmission time and more accurately optimize data latency.

[0048] 2. The present invention constructs a sampling frequency optimization model to optimize the data sampling frequency of PLCs according to requirements and real-time conditions, avoiding unnecessary high-frequency acquisitions, thereby greatly reducing the amount of data. It not only reduces the pressure on data storage but also reduces the burden of data transmission. When the system data changes slowly or stably, reducing the sampling frequency can reduce the use of the processor, memory, and bandwidth, saving computing resources and reducing system load; when the data changes rapidly or a critical event occurs, dynamic sampling rate adjustment can quickly increase the sampling frequency to capture more detailed changes and ensure that the system can respond in a timely manner.

[0049] 3. In the close cooperation between edge computing and cloud computing in the present invention, edge computing processes tasks with high real-time performance, such as rapid data analysis and response, while the cloud is responsible for complex historical data analysis and model training. The innovation of this architecture lies in the reasonable allocation of computing resources, achieving a balance between real-time processing and in-depth analysis, while ensuring the flexibility and scalability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Figure 1 It is a schematic diagram of the steps of the PLC real-time data acquisition optimization method based on an edge gateway and edge computing according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0052] Embodiment: As Figure 1 shown, the present invention provides a technical solution,

[0053] An optimized method for real-time data acquisition of PLC based on edge gateway and edge computing, the method comprising the following steps:

[0054] S100. Collect the positions of each PLC in industrial automation production, deploy data collectors at each PLC position, calculate the transmission distance between each PLC position and the central cloud processor, and construct an edge data acquisition network;

[0055] The specific steps for constructing the edge data acquisition network are as follows:

[0056] S101. Establish a plane rectangular coordinate system in the industrial automation production area, use the cloud processor as the origin, and collect the position coordinates of each PLC in the coordinate system in industrial automation production as {(x1, y1), (x2, y2), (x3, y3),..., (x n , y n )}, (x1, y1), (x2, y2), (x3, y3),..., (x n , y n ) represent the position coordinates of the 1st, 2nd, 3rd,..., nth PLC in the coordinate system in industrial automation production, and n is a positive integer; deploy data collectors at the coordinate positions of each PLC, and construct an edge data acquisition network in combination with the cloud processor and n data collectors;

[0057] S102. After constructing the edge data acquisition network, calculate the data transmission distance between each edge data collector and the cloud processor. The formula is: In the formula, L represents the data transmission distance between each edge data collector and the cloud processor in industrial automation production, x and y represent the coordinate positions of the PLC in each edge data collector, and the data transmission distances between all PLC edge data collectors and the cloud processor are calculated using the formula as {L1, L2, L3,..., L n}, L1, L2, L3,..., L n represent the data transmission distances between the edge data collectors of the 1st, 2nd, 3rd,..., nth PLC and the cloud processor calculated in industrial automation production.

[0058] In industrial automation production, building an edge data acquisition network can not only collect and transmit data, but also preprocess, filter, and aggregate data locally, reducing unnecessary data transmission, thereby reducing bandwidth requirements and cloud processing pressure; calculating the data transmission distance between each PLC and the cloud processor can more clearly calculate the data transmission time and more accurately optimize data latency.

[0059] S200. Collect the sampling frequency of all data of each PLC by the cloud processor in history and the change data of all data, calculate the relationship between the change rate of each type of data and the sampling frequency, and build an optimization model for the data sampling frequency of the PLC.

[0060] The specific steps for building an optimization model for the data sampling frequency of the PLC are as follows:

[0061] S201. When collecting all data of each PLC by the cloud processor in history, the change values of each type of data are {P1, P2, P3,..., P m}, P1, P2, P3,..., P m represent the change values of the 1st, 2nd, 3rd,..., mth types of data in each collected PLC, where m is a positive integer; and extract the time data when each type of data changes as {t1, t2, t3,..., t m}, t1, t2, t3,..., t m represent the time data when the 1st, 2nd, 3rd,..., mth types of data in the PLC change; use the linear regression algorithm to analyze the change values of each type of data and the time data, and build an association function between the change value of each type of data in the PLC and time as P(t); calculate all the association functions of all data to obtain all the association functions as {P(t)1, P(t)2, P(t)3,..., P(t) m}, P(t)1, P(t)2, P(t)3,..., P(t) m represent the association functions of the 1st, 2nd, 3rd,..., mth types of data calculated in the PLC;

[0062] S202. After calculating the association function of each type of data in the PLC, take the derivative of the association function to calculate the change rate of each type of data. The formula is: In the formula, V represents the change rate of the calculated data, represents taking the derivative of the association function P(t) with respect to t; after m calculations, the change rate of each type of data is {V1, V2, V3,..., V m}, V1, V2, V3,..., V m represent the change rates of the 1st, 2nd, 3rd,..., mth types of data calculated in the PLC;

[0063] S203. Extract the minimum sampling frequency f reached when the cloud processor collected PLC data in history. min According to the change rate of each type of data in the PLC in history, design and construct the optimization relationship between the change rate of each type of data and the sampling frequency. The formula is:

[0064] f(t) = f min + k × V;

[0065] In the formula, f(t) represents the optimized sampling frequency, V represents the change rate of each type of data, and k represents the influence coefficient of the data change rate on the sampling frequency; extract the maximum sampling frequency f of the PLC data in the cloud processor in history max and the maximum change rate v of the data in history max , and calculate the influence coefficient of the data change rate on the sampling frequency

[0066] After calculating the optimization relationship between the change rate of each type of data and the sampling frequency, set the optimization limit values of the sampling frequency of each type of data to f min and f max , and use the optimization limit and the optimization relationship to construct the sampling frequency optimization model of each type of data as:

[0067] f(t) = max(f min , min(f max , f min + k × |V|));

[0068] In the formula, f(t) represents the optimized sampling frequency, max represents extracting the maximum value of the data in the parentheses, min represents extracting the minimum value of the data in the parentheses, and |V| represents the absolute value of the change rate of each type of data; construct the sampling frequency optimization model for each type of data in the PLC.

[0069] Use historical data to analyze the relationship between the PLC data change rate and the sampling frequency, construct a sampling frequency optimization model, and optimize the data sampling frequency of the PLC according to requirements and real-time conditions, avoiding unnecessary high-frequency acquisitions, thereby greatly reducing the amount of data. This not only reduces the pressure on data storage but also reduces the burden of data transmission. When the system data changes slowly or is stable, reducing the sampling frequency can reduce the use of the processor, memory, and bandwidth, saving computing resources and reducing the system load; when the data changes rapidly or a key event occurs, dynamic sampling rate adjustment can quickly increase the sampling frequency to capture more detailed changes and ensure that the system can respond in a timely manner. This is particularly important for scenarios with high real-time requirements such as industrial control and fault detection.

[0070] S300. Collect the data collected by the cloud processor for the PLC in history, and judge the data values when different types of abnormalities occur in the PLC. Analyze the data collected for each type of abnormality to find the data that affects the occurrence of abnormalities in the PLC as important data. Use the important data to screen the types of abnormalities that occur in the PLC, and find the important events of the PLC;

[0071] The specific steps to find the important events of the PLC are as follows:

[0072] S301. Collect the data collected by the cloud processor for the PLC in history, and judge the data values when different types of abnormalities occur in the PLC. Let the change amounts of all PLC data when each type of abnormality occurs be {B1, B2, B3,..., B u}, where B1, B2, B3,..., B u represent the change amounts of the 1st, 2nd, 3rd,..., u-th types of data of the PLC when each type of abnormality occurs, and u is a positive integer. Judge the change amounts of all the collected data, and extract the data type with the largest change as the characteristic data of the abnormality; extract the characteristic data of each type of abnormality in the same history.

[0073] S302. After extracting the characteristic data of all abnormalities of each PLC, collect the abnormal data that changes when equipment failures and shutdowns occur in industrial automation in history as {D1, D2, D3,..., D h},

[0074] where D1, D2, D3,..., D h represent the 1st, 2nd, 3rd,..., h-th types of abnormal data that change when equipment failures and shutdowns occur in industrial automation in the collected history, and h is a positive integer. Search for the characteristic data of each type of abnormality of the PLC in the abnormal data of equipment failures and shutdowns that occur, and judge the characteristic data that exists in the abnormal data of equipment failures and shutdowns as the important data of the PLC;

[0075] S303. According to the important data of the PLC found, select the types of PLC abnormalities corresponding to the important data as the important events of the PLC to form an important event database.

[0076] Important event detection can identify anomalies or important changes in the system in real time, enabling the system to respond quickly when an event occurs, issue warnings, make adjustments, or take corrective measures. It also allows the system to focus on processing data at critical moments rather than continuously processing all data. The system only allocates more resources for processing when an important event is detected, effectively reducing the processing overhead of invalid data and saving computing, storage, and network resources. When the system detects an important event, it can dynamically increase the sampling frequency of data collection to capture more detailed data; at other times, it reduces the sampling frequency to save resources. This on-demand sampling mechanism greatly improves the resource utilization rate of the system.

[0077] S400. Calculate the optimization threshold of the PLC sampling frequency according to the transmission distance between each PLC and the cloud processor; use the edge data acquisition network to collect the data of each PLC at each location, calculate the real-time data change rate, and optimize the real-time sampling frequency after judging the real-time data change rate using the optimization threshold.

[0078] The specific steps for optimizing the real-time sampling frequency are as follows:

[0079] S401. Collect the data sampling frequency and data change period when the cloud processor collects the data of each PLC with a delay in history, and calculate the optimization threshold in combination with the data transmission distance between each PLC and the cloud processor. The formula is: In the formula, In represents the optimization threshold of each calculated PLC, P y represents the data sampling frequency when the cloud processor collects the data of each PLC with a delay in the collected history, T y represents the data change period when the cloud processor collects the data of each PLC with a delay in the collected history, L represents the data transmission distance between each PLC and the cloud processor, and V c represents the data transmission speed; calculate the optimization threshold of each PLC through the formula.

[0080] S402. Use the edge data collector of each PLC to collect the real-time data of the PLC, extract the real-time change period Ts of the data and the real-time sampling frequency Ps, calculate the real-time difference Cc between the change period and the sampling frequency. When Cc ≥ In, it is judged that the real-time sampling frequency of the PLC needs to be optimized; when Cc < In, it is judged that the real-time sampling frequency of the PLC does not need to be optimized.

[0081] S403. Based on the data change value of the collected PLC and combined with the change period, the derivative calculation is performed to obtain the real-time PLC data change rate Vs. Optimize the sampling frequency of the PLC to be optimized, input the calculated real-time data change rate into the sampling frequency optimization model to obtain the optimized sampling frequency f(t); use the optimized sampling frequency f(t) to sample and collect the data of the PLC.

[0082] S500. In the edge data acquisition network, use the data change rate when each PLC has an abnormality in history, calculate the abnormal sampling frequency using the abnormal change rate, and use the abnormal sampling frequency as the edge warning threshold; the cloud processor analyzes the device data when all PLCs have abnormalities within the industrial production range and calculates the depth judgment threshold for the PLC to have an abnormality;

[0083] The specific steps for calculating the edge warning threshold and the depth judgment threshold of the PLC are as follows:

[0084] S501. Collect the characteristic data when the PLC has an abnormality in history, extract the data change amount and change period of the characteristic data of each abnormality when it has an abnormality in history, calculate the change rate of the characteristic data as Ve, and calculate the abnormal sampling frequency using the data change rate when each PLC has an abnormality in the edge data acquisition network. The formula is: Py = f min + k×Ve. In the formula, Py represents the calculated abnormal sampling frequency. Calculate the edge warning threshold using the abnormal sampling frequency. The formula is: In_p = Py_p - Py_st. In the formula, In_p represents the calculated edge warning threshold, Py_p represents the average value of the abnormal sampling frequencies of all data, and Py_st represents the standard deviation of the sampling frequencies of all data;

[0085] S502. Collect the data value Z when the important data found in S302 has a device failure and shutdown during industrial automation generation in history, and calculate the depth judgment threshold of the PLC. The formula is: Ins = Zp - Zst. In the formula, Ins represents the calculated depth judgment threshold of the PLC, Zp represents the average value of all important data in the collected history, and Zst represents the standard deviation of all important data in the collected history.

[0086] S600. Use the edge data acquisition network to collect the data of each PLC, and judge whether the PLC has an abnormality for preliminary warning; judge the occurrence of the abnormality. When it is an important event, use the edge gateway to transmit the collected important data to the cloud processor;

[0087] The specific steps for judging whether the PLC has an abnormality for preliminary warning are as follows:

[0088] S601. Use the edge data acquisition network to collect all the characteristic data of each PLC according to the optimized sampling frequency, and obtain the real-time characteristic data as {Te1, Te2, Te3, ..., Te g}, where Te1, Te2, Te3, ..., Te g represent the 1st, 2nd, 3rd, ..., gth kinds of real-time characteristic data collected. Use the edge warning threshold to judge the real-time characteristic data. When Te < In_p, it is judged that the PLC is working normally; when Te ≥ In_p, it is judged that the PLC has an abnormal risk and a preliminary warning is issued.

[0089] S602. After judging that the PLC has an abnormal risk and issuing a preliminary warning, search in the important event database according to the type of warning abnormality. When the type of abnormality in the preliminary warning is an important event, transmit the collected real-time characteristic data as important data to the cloud processor.

[0090] S700. After the cloud processor receives the important data transmitted by the edge data collector, deeply analyze all the important data transmitted by the PLCs, and use the deep judgment threshold to perform a secondary deep abnormality judgment on the PLCs with preliminary warnings.

[0091] Edge collect PLC data through the edge data acquisition network, and use the cloud processor to collect and analyze important data. In the close cooperation between edge computing and cloud computing, edge computing processes tasks with high real-time performance, such as fast data analysis and response, while the cloud is responsible for complex historical data analysis and model training. The innovation of this architecture lies in the reasonable allocation of computing resources, achieving a balance between real-time processing and in-depth analysis, while ensuring the flexibility and scalability of the system.

[0092] The specific steps for performing a secondary deep abnormality judgment on the PLCs with preliminary warnings using the deep judgment threshold are as follows:

[0093] S701. After the cloud processor receives the transmitted real-time important data, use the deep judgment threshold to judge the real-time important data. When Te ≥ Ins, the cloud processor judges that there is a risk of production shutdown due to a fault in industrial automation and issues a warning to all PLCs; when Te < Ins, the cloud processor judges that industrial automation production is normal, and the PLC with a preliminary warning is a separate abnormality, and the maintenance quality of the PLC with a preliminary warning is ensured.

[0094] Example: Build an edge data acquisition network in an industrial automation production area. According to historical data calculation, the sampling frequency optimization model is constructed as F(t) = max(2, min(10, 2 + 0.3×|V|));

[0095] Suppose the optimized threshold calculated based on historical data is 1.2s, and the real-time difference between the change period and the sampling frequency in the real-time PLC is calculated to be 2s, it is determined that the sampling frequency needs to be optimized; the PLC data is collected using the edge data acquisition network, and the real-time data change rate is calculated to be 30; the real-time data change rate is input into the optimization model, and the optimized sampling frequency output is 10.

[0096] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be regarded as limiting the claims involved.

Claims

1. A PLC real-time data acquisition optimization method based on edge gateway and edge computing, characterized by: The method comprises the following steps: S100, collect the location of each PLC in industrial automation production, deploy a data collector at each PLC location, calculate the transmission distance between each PLC location and the central cloud processor, and build an edge data collection network; S200, collecting the sampling frequency of all data of each PLC and the change data of all data by the cloud processor in history, calculating the relationship between the change rate of each data and the sampling frequency, and building a data sampling frequency optimization model for the PLC; The specific steps to build the PLC data sampling frequency optimization model are: S201, when the cloud processor collects all the data of each PLC in the collection history, the change value of each data is {P1, P2, P3, ..., P m }, P1, P2, P3, ..., P m represents the change value of the 1st, 2nd, 3rd, ..., mth type of data collected in each PLC, where m is a positive integer; and the time data when each type of data changes is extracted as {t1, t2, t3, ..., t m }, t1, t2, t3, ..., t m Indicates the time data when the 1st, 2nd, 3rd, ..., mth data in the PLC changes; uses a linear regression algorithm to analyze the change value and time data of each data, and constructs a correlation function between the change value and time of each data in the PLC as P(t); calculates the correlation functions of all data and obtains all correlation functions as {P(t)1, P(t)2, P(t)3, ..., P(t) m }, P(t)1, P(t)2, P(t)3,..., P(t) m represents the correlation function of the 1st, 2nd, 3rd, ..., mth data in the calculated PLC; S202, after calculating the correlation function of each data in the PLC, the correlation function is derived to calculate the change rate of each data, the formula is: In the formula, V represents the rate of change of the calculated data. It means to find the derivative of the correlation function P(t) at t; after m times of calculation, the change rate of each data is {V1, V2, V3, ..., V m }, V1, V2, V3, ..., V m Indicates the change rate of the 1st, 2nd, 3rd, ..., mth type of data in the calculated PLC; S203, extract the lowest sampling frequency reached by the cloud processor when collecting PLC data in the history as f min According to the change rate of each PLC data in history, the optimal relationship between the change rate of each data and the sampling frequency is designed and constructed. The formula is: f(t)=f min +k×V; In the formula, f(t) represents the optimized sampling frequency, V represents the change rate of each data, and k represents the influence coefficient of the data change rate on the sampling frequency; extract the maximum sampling frequency f of PLC data in the cloud processor in the history max and the maximum rate of change of data in history v max , calculate the coefficient of influence of data change rate on sampling frequency After calculating the optimal relationship between each data change rate and sampling frequency, set the optimal limit of each data sampling frequency to f min and f max , using optimization restrictions and optimization relations to build the sampling frequency optimization model for each type of data: f(t)=max(f min ,min(f max ,f min +k×|V|)); In the formula, f(t) represents the optimized sampling frequency, max represents the maximum value of the data in the brackets, min represents the minimum value of the data in the brackets, and |V| represents the absolute value of the change rate of each data. The sampling frequency optimization model for each data in the PLC is constructed; S300, the cloud processor collects data from the PLC in the collection history, and determines the data values ​​when different types of abnormalities occur in the PLC, analyzes the data collected for each type of abnormality, finds the data that affects the abnormality of the PLC as important data, uses the important data to filter the types of abnormalities that occur in the PLC, and finds important events of the PLC; S400, calculating the optimized threshold of the PLC sampling frequency according to the transmission distance between each PLC and the cloud processor; using the edge data collection network to collect data from the PLC at each location, calculating the real-time data change rate, and optimizing the real-time sampling frequency after judging the real-time data change rate using the optimized threshold; S500, in the edge data collection network, the data change rate of each PLC when an abnormality occurs in history is used to calculate the abnormal sampling frequency using the abnormal change rate, and the abnormal sampling frequency is used as the edge warning threshold; the cloud processor uses the device data of all PLCs in the industrial production range when an abnormality occurs to analyze and calculate the depth judgment threshold of the PLC abnormality; S600, using the edge data collection network to collect data from each PLC, and determine whether the PLC has an abnormality and issue a preliminary warning; determine the abnormality that has occurred, and when it is an important event, use the edge gateway to transmit the collected important data to the cloud processor; After S700 and the cloud processor receive the important data transmitted by the edge data collector, they conduct in-depth analysis on the important data transmitted by all PLCs, and use the deep judgment threshold to make a secondary deep abnormal judgment on the PLC that has been initially warned.

2. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 1 is characterized in that: The specific steps of constructing the edge data collection network in S100 are: S101, establish a plane rectangular coordinate system in the industrial automation production area, take the cloud processor as the origin, and collect the position coordinates of each PLC in the industrial automation production in the coordinate system as {(x1, y1), (x2, y2), (x3, y3), ..., (x n ,y n )}, (x1, y1), (x2, y2), (x3, y3),..., (x n ,y n ) represents the position coordinates of the 1st, 2nd, 3rd, ..., nth PLC in the industrial automation production in the coordinate system, and n is a positive integer; a data collector is deployed at the coordinate position of each PLC, and an edge data collection network is constructed by combining the cloud processor and n data collectors; S102. After building the edge data collection network, calculate the data transmission distance between each edge data collector and the cloud processor. The formula is: In the formula, L represents the data transmission distance between each edge data collector and the cloud processor in industrial automation production, x and y represent the coordinate position of the PLC in each edge data collector, and the data transmission distance between all PLC edge data collectors and the cloud processor is calculated by the formula as {L1, L2, L3, ..., L n }, L1, L2, L3, ..., L n Represents the data transmission distance between the 1st, 2nd, 3rd, ..., nth PLC edge data collector and the cloud processor in the calculated industrial automation production.

3. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 1 is characterized in that: The specific steps of searching for important events of the PLC in S300 are: S301, the cloud processor collects data from the PLC in the collection history, and determines the data value when different types of abnormalities occur in the PLC. Suppose the change amount of all PLC data collected when each abnormality occurs is {B1, B2, B3, ..., B u }, B1, B2, B3, ..., B u Indicates the changes in the 1st, 2nd, 3rd, ..., uth types of PLC data when each abnormality is collected, where u is a positive integer; judge the changes in all collected data, and extract the data type with the largest change as the characteristic data of the abnormality; similarly, extract the characteristic data of each abnormality in the history; S302, after extracting all abnormal feature data of each PLC, collect the abnormal data of changes when equipment failure occurs in the industrial automation generation in history as {D1, D2, D3, ..., D h }, D1, D2, D3, ..., D h Indicates the 1st, 2nd, 3rd, ..., hth abnormal data that have changed when equipment failure and shutdown occurred in the industrial automation generation in the collected history, where h is a positive integer; the characteristic data of each abnormality of PLC is searched in the collected abnormal data of equipment failure and shutdown, and the characteristic data existing in the abnormal data of equipment failure and shutdown is judged as important data of PLC; S303. According to the searched important data of the PLC, select the PLC abnormality type corresponding to the important data as the important event of the PLC to form an important event database.

4. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 3 is characterized in that: The specific steps of optimizing the real-time sampling frequency in S400 are: S401, collect the data sampling frequency and data change cycle when the cloud processor collects each PLC data with delay in history, and calculate the optimization threshold value in combination with the data transmission distance between each PLC and the cloud processor. The formula is: In the formula, In represents the optimization threshold of each PLC, P y Indicates the data sampling frequency when the cloud processor collects each PLC data with delay in the collected history, T y represents the data change cycle when the cloud processor collects each PLC data with a delay in the collected history, L represents the data transmission distance between each PLC and the cloud processor, V c Indicates the data transmission speed; the optimization threshold of each PLC is calculated by formula; S402, using the edge data collector of each PLC to collect the real-time data of the PLC, extracting the real-time change period of the data as Ts and the real-time sampling frequency as Ps, calculating the real-time difference between the change period and the sampling frequency as Cc, and when Cc≥In, judging that the real-time sampling frequency of the PLC needs to be optimized, and when Cc<In, judging that the real-time sampling frequency of the PLC does not need to be optimized; S403. Calculate the real-time PLC data change rate Vs based on the collected PLC data change value and the derivative of the change period, optimize the sampling frequency of the PLC that needs to be optimized, input the calculated real-time data change rate into the sampling frequency optimization model, and obtain the optimized sampling frequency f(t); use the optimized sampling frequency f(t) to sample and collect the PLC data.

5. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 1 is characterized in that: The specific steps of calculating the edge warning threshold and depth judgment threshold of the PLC in S500 are: S501. Collect the characteristic data of PLC anomalies in history, extract the data change amount and change cycle of each abnormal characteristic data when the abnormality occurs in history, and calculate the change rate of the characteristic data as Ve. In the edge data acquisition network, use the change rate of the data when each PLC abnormality occurs in history to calculate the abnormal sampling frequency. The formula is: Py = f min +k×Ve, where Py represents the calculated abnormal sampling frequency, and the edge warning threshold is calculated using the abnormal sampling frequency. The formula is: In_p=Py_p-Py_st, where In_p represents the calculated edge warning threshold, Py_p represents the average value of all calculated data abnormal sampling frequencies, and Py_st represents the standard deviation of all calculated data sampling frequencies; S502. Collect the data value Z of the important data found in S302 when equipment failure occurs in the industrial automation generation in the history, and calculate the depth judgment threshold of the PLC. The formula is: Ins=Zp-Zst, where Ins represents the calculated depth judgment threshold of the PLC, Zp represents the average value of all the important data collected in the history, and Zst represents the standard deviation of all the important data collected in the history.

6. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 5 is characterized in that: The specific steps of determining whether an abnormality occurs in the PLC and providing a preliminary warning in S600 are: S601, using the edge data acquisition network to collect all feature data of each PLC according to the optimized sampling frequency, the real-time feature data is {Te1, Te2, Te3, ..., Te g }, Te1, Te2, Te3,..., Te g Indicates the first, second, third, ..., g types of real-time feature data collected. The real-time feature data is judged using the edge warning threshold. When Te<In_p, the PLC is judged to be working normally; when Te≥In_p, the PLC is judged to have an abnormal risk and a preliminary warning is issued; S602. After determining that the PLC has an abnormal risk and issuing a preliminary warning, search in the important event database according to the type of abnormality in the warning. When the abnormality type of the preliminary warning is an important event, the collected real-time feature data is transmitted to the cloud processor as important data.

7. The PLC real-time data acquisition optimization method based on edge gateway and edge computing according to claim 6 is characterized in that: The specific steps of performing a secondary depth abnormality judgment on the PLC of the preliminary warning using the depth judgment threshold in S700 are: S701, after receiving the transmitted real-time important data, the cloud processor uses the depth judgment threshold to judge the real-time important data. When Te≥Ins, the cloud processor determines that there is a risk of failure and shutdown in industrial automation production, and issues an early warning to all PLCs; When Te<Ins, the cloud processor determines that the industrial automation production is normal, and initially warns that the PLC is a separate abnormality, and sends a preliminary warning to the PLC for maintenance quality.

Citation Information

Patent Citations

  • Data acquisition system and method based on distributed clusters

    CN107222360A

  • Data acquisition method and system of industrial Internet of Things gateway

    CN116527718A

  • Intelligent Internet of Things data processing method and management platform oriented to cloud-side collaboration

    CN117914786A