A device control method and system based on an industrial PLC controller
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-08-11
AI Technical Summary
[0002]传统的供水控制系统采用集中式控制架构,依靠单一控制器管理所有供水设备,这种方式在面对多设备协同运行时暴露出诸多局限性
加密认证处理模块,用于将所述设备负载分配方案输入第二功能块进行加密认证处理,得到安全控制指令包;
Smart Images

Figure CN121541563B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial PLC control technology, and in particular to a device control method and system based on an industrial PLC controller. Background Technology
[0002] Traditional water supply control systems employ a centralized control architecture, relying on a single controller to manage all water supply equipment. This approach reveals numerous limitations when multiple devices operate collaboratively. Traditional water supply control systems lack effective data management mechanisms; equipment operation data is stored in a scattered manner, hindering rapid retrieval and analysis, resulting in slow response times. Furthermore, traditional water supply control systems have weak communication security, often employing plaintext transmission or simple encryption, making them vulnerable to network attacks and data tampering, posing a serious threat to the secure operation of the water supply control system. Summary of the Invention
[0003] This invention provides a device control method and system based on an industrial PLC controller, which improves the intelligence level, operating efficiency, and safety and reliability of the water supply control system.
[0004] The first aspect of this invention provides a device control method based on an industrial PLC controller, the device control method based on an industrial PLC controller comprising: Use the main PLC controller to construct an equipment time index table and a parameter index table for multiple water supply devices; In the first functional block, load prediction is performed in conjunction with the parameter index table to create a device load allocation scheme; The device load distribution scheme is input into the second function block for encryption and authentication processing to obtain a security control instruction package; The safety control instruction package is transmitted to the edge PLC controller, and the pressure anomaly judgment result and equipment fault early warning information are generated using the equipment time index table.
[0005] In conjunction with the first aspect, in a first implementation of the first aspect of the present invention, the step of constructing an equipment time index table and a parameter index table for multiple water supply devices using a main PLC controller includes: The equipment numbers, timestamps, and operating parameters of multiple water supply devices are converted to obtain formatted raw data. In the main PLC controller, a chained storage allocation is performed on the formatted raw data to obtain the device time index table; The pressure value in the formatted raw data is allocated to the first storage area of the main PLC controller, the flow value is allocated to the second storage area of the main PLC controller, and the power value is allocated to the third storage area of the main PLC controller. Perform FNV-1a hash function operations and open addressing conflict resolution on the first storage area, the second storage area, and the third storage area to establish a parameter index table.
[0006] In conjunction with the first aspect, in a second implementation of the first aspect of the present invention, the step of performing load prediction and creating a device load allocation scheme in the first functional block, based on the parameter index table, includes: The storage areas for pressure, flow, and power values are located using the parameter index table, and the first data sequence is read. Normalization is performed on the first data sequence to obtain the second data sequence, and a time feature vector is generated based on the current controller time of the main PLC controller. The second data sequence and the time feature vector are input into the three-layer neural network of the first functional block to perform forward propagation calculation and matrix operation with the weight matrix of the preset data block to obtain the target time period load prediction value; A device load allocation scheme is created based on the predicted load values for the target time period.
[0007] In conjunction with the first aspect, in a third implementation of the first aspect of the present invention, the step of creating a device load allocation scheme based on the target time period load prediction value includes: Obtain pipeline distance data, operating efficiency data, cumulative operating time data, and health score data for each water supply device to obtain a device parameter dataset; The priority score of each water supply device is obtained by performing the reciprocal operation on the pipeline distance data, directly taking the value of the operating efficiency data, performing the inverse operation on the cumulative operating time data, and directly taking the value of the health score data, and then multiplying them by the corresponding weight coefficients respectively. Perform a descending sort operation on the priority scores of each water supply device to obtain the device priority sorting queue; Based on the device priority sorting queue, a greedy allocation algorithm is executed sequentially to allocate the target time period load prediction value to each water supply device and calculate the minimum capacity limit of each water supply device to obtain the device load allocation scheme.
[0008] In conjunction with the first aspect, in the fourth implementation of the first aspect of the present invention, the step of inputting the device load allocation scheme into the second functional block for encryption and authentication processing to obtain a security control instruction package includes: The device load allocation scheme is formatted into structured data containing device identifiers, target load values, and control parameters, and header information is added to obtain the original instruction data; Based on the original instruction data, the 128-bit key of the security data block is called in the second function block to perform AES-CBC mode encryption and generate a random initialization vector to obtain encrypted instruction data; The HMAC-SHA256 operation is performed on the encrypted instruction data using the authentication key in the second function block to generate a message authentication code, which is then appended to the end of the data to obtain authenticated encrypted data. The authentication encrypted data is combined with the packet header, timestamp, and serial number, and a CRC32 check value is calculated to form a security control instruction packet.
[0009] In conjunction with the first aspect, in a fifth implementation of the first aspect of the present invention, the step of transmitting the safety control instruction packet to the edge PLC controller and generating pressure anomaly determination results and equipment fault early warning information using the equipment time index table includes: The safety control instruction package is transmitted to the edge PLC controller via the PROFINET bus and CRC32 verification and HMAC-SHA256 message authentication are performed to obtain a verified encrypted data packet. The encrypted data packet that has passed verification is decrypted using the local key of the edge PLC controller using AES-CBC to obtain the target control parameter data; The target control parameter data is input into the OB35 cyclic interruption organization block to execute the self-tuning PID control algorithm and converted into a water pump speed control signal through the analog output module. Based on the execution result of the pump speed control signal, the outlet pressure value, instantaneous flow rate value, motor power value, and 16-bit device status word are collected to obtain real-time status data; By combining the equipment time index table, gradient change and abrupt change detection are performed on the real-time status data to obtain pressure anomaly judgment results and equipment fault early warning information.
[0010] In conjunction with the first aspect, in the sixth implementation of the first aspect of the present invention, the step of inputting the target control parameter data into the OB35 cyclic interruption organization block to execute a self-tuning PID control algorithm and converting it into a water pump speed control signal through an analog output module includes: The target control parameter data is loaded into the OB35 loop interrupt organization block and the execution cycle is configured to obtain the real-time control loop task. Based on the pressure setpoint in the real-time control cycle task, a self-tuning PID control algorithm is used to determine the critical gain and critical period parameters, and obtain the PID control coefficients. The deviation between the current pressure feedback and the target pressure setting is calculated using the PID control coefficients to obtain a standardized control output value. The standardized control output value is sent to the AQ analog output module to be converted into a continuous voltage signal and output to the inverter control terminal to obtain the water pump speed control signal.
[0011] In conjunction with the first aspect, in the seventh implementation of the first aspect of the present invention, the step of combining the equipment time index table to perform gradient change and abrupt change detection on the real-time status data to obtain pressure anomaly determination results and equipment fault early warning information includes: The real-time status data is subjected to CRC check and hierarchical storage using the device time index table to obtain the verified stored data; Based on the verified stored data, perform pressure value time difference gradient calculation and flow value adjacent time absolute difference calculation to obtain pressure gradient change value and flow change detection value; The pressure gradient change value is compared with a preset gradient threshold to obtain a pressure comparison result, and the flow rate change detection value is compared with a preset change threshold to obtain a flow rate comparison result. Based on the pressure comparison result and the flow rate comparison result, an abnormal state logic judgment is performed to obtain the pressure abnormality judgment result; Based on the pressure anomaly determination results, combined with vibration acceleration, motor winding temperature and three-phase current, a comprehensive fault prediction analysis is performed to obtain equipment fault early warning information.
[0012] In conjunction with the first aspect, in the eighth implementation of the first aspect of the present invention, the step of performing comprehensive fault prediction analysis based on the pressure anomaly determination result, combined with vibration acceleration, motor winding temperature, and three-phase current, to obtain equipment fault early warning information includes: The pressure anomaly determination result is combined with the vibration acceleration of each water supply device, the motor winding temperature and the three-phase current input to the upper-level proxy model to perform multi-source data fusion and fault mode recognition operations to obtain the fault feature vector. Based on the fault feature vector, Bayesian network inference and Markov state transition probability calculation are performed in the upper-layer agent model, and pattern matching analysis is performed in combination with the historical fault database to obtain the fault type probability distribution matrix. The fault type probability distribution matrix is input into the lower-level decision model to perform a weighted comprehensive evaluation of the maintenance cost function, downtime risk function, and equipment life loss function to obtain the optimal maintenance strategy vector; Based on the optimal maintenance strategy vector, an error interruption organization block is triggered, and equipment fault warning information is recorded in the second data block according to the predicted maintenance level.
[0013] A second aspect of the present invention provides a device control system based on an industrial PLC controller, the device control system based on an industrial PLC controller comprising: The module is used to build equipment time index tables and parameter index tables for multiple water supply devices using the main PLC controller; The load prediction module is used in the first functional block to perform load prediction in conjunction with the parameter index table and create a device load allocation scheme. The encryption authentication processing module is used to input the device load distribution scheme into the second function block for encryption authentication processing to obtain a security control instruction package; The generation module is used to transmit the safety control instruction package to the edge PLC controller and use the equipment time index table to generate pressure anomaly judgment results and equipment fault early warning information.
[0014] Compared with existing technologies, this invention has the following advantages: By adopting a two-stage hierarchical index structure, combined with a dual indexing mechanism of equipment time index table and parameter index table, high-speed data retrieval and storage are achieved. The combination of chain storage structure and hash index technology significantly shortens data search time. The hierarchical storage architecture optimizes memory utilization and supports efficient management of massive equipment data. Simultaneously, the three-layer neural network algorithm implemented in the PLC environment combines historical pressure, flow data, and time feature vectors for intelligent prediction. An adaptive weight update mechanism enables the system to dynamically adapt to changing water demand patterns, and multi-dimensional feature fusion technology provides more accurate future load prediction capabilities. Furthermore, the multi-dimensional priority evaluation function comprehensively considers key factors such as equipment distance, efficiency, operating time, and health. The greedy allocation algorithm combined with a dynamic scheduling mechanism maximizes equipment operating efficiency and balances lifespan, while hysteresis control characteristics prevent frequent equipment start-ups and shutdowns. The three-layer security protection system established by this invention includes AES-128 encryption, HMAC-SHA256 authentication, and CRC32 verification. A dynamic key update mechanism and random initialization vector ensure the confidentiality and integrity of communication data. A custom application layer protocol provides multiple verification guarantees, effectively preventing network attacks and data tampering. By using a multi-dimensional anomaly detection algorithm to monitor pressure gradient changes and flow surges in real time, and combining an upper-level agent model with a lower-level decision model to achieve intelligent fault diagnosis and predictive maintenance, a comprehensive health assessment system that combines multi-source parameters such as vibration, temperature, and current to provide comprehensive equipment status monitoring, an OB35 cyclic interruption organization block to ensure the real-time performance and accuracy of the PID control algorithm, self-tuning PID parameter optimization technology to adapt to control requirements under different operating conditions, and emergency control mode and fault recording mechanism to provide system safety assurance and fault tracing capabilities, the system improves the intelligence level, operating efficiency, and safety and reliability of the distributed water supply system. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] The structures, proportions, sizes, etc., shown in the accompanying drawings of this specification are only for the purpose of assisting those skilled in the art in understanding and reading the content disclosed in the specification, and are not intended to limit the conditions under which the present invention can be implemented. Therefore, they have no substantial technical significance. Any modifications to the structure, changes in the proportions, or adjustments to the size, without affecting the effects and objectives that the present invention can produce, should still fall within the scope of the technical content disclosed in the present invention.
[0017] Figure 1 This is a flowchart illustrating the equipment control method based on an industrial PLC controller provided in an embodiment of the present invention. Figure 2 This is a schematic block diagram of the structure of a device control system based on an industrial PLC controller provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0020] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0021] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items, and all possible combinations, and includes such combinations. See also Figure 1One embodiment of the equipment control method based on an industrial PLC controller in this invention includes: Step 100: Use the main PLC controller to construct an equipment time index table and a parameter index table for multiple water supply devices; In this embodiment, the raw operating data of multiple water supply devices undergoes a unified format conversion process. The device number, timestamp information, and corresponding operating parameter values (including outlet pressure, instantaneous flow rate, and motor power) reported by each device are converted into a unified structure through a data standardization process, forming formatted raw data. In the main PLC controller, a chain-style dynamic memory allocation program is invoked to map the device number and corresponding timestamp contained in the formatted raw data into a chain-style node structure. Each node occupies 32 bytes and sequentially includes a device identifier field, a timestamp field, a data address pointer, a CRC16 check field, and extended fields. The pointer fields connect the upper and lower nodes, dynamically generating a device time index table supporting 65,535 device identifiers. The index structure is stored in the PLC's data block DB100 area. The pressure value from the formatted raw data is written to the main PLC's first storage area (MW100-MW199), the flow rate value to the second storage area (MW200-MW299), and the power value to the third storage area (MW300-MW399). Each storage area is allocated consecutively according to channel number order, with each channel occupying 2 bytes. The FNV-1a hash function is used to calculate the key value of each data item. The FNV-1a algorithm takes the initial value 2166136261 as the basis, performs XOR on each byte and multiplies it by the constant 16777619 to generate a balanced hash index key. If a hash collision occurs during this process, the open addressing method is called to perform address probing and reallocation. The free storage slots are searched sequentially in a linear increment until the mapping of all parameter key values is completed. The parameter index table is then constructed in the data block DB200 of the main PLC.
[0022] Step 200: In the first function block, perform load prediction in conjunction with the parameter index table to create a device load allocation scheme; In this embodiment, the parameter indexing mechanism is invoked within the first functional block of the main PLC controller. Based on the hash index table, the addresses of pressure, flow, and power values in the three storage areas from MW100 to MW399 are quickly located. Historical operating data within a continuous sampling period is extracted according to a set time window to form a first data sequence. The first data sequence is then input into a normalization module for linear transformation. The pressure value is normalized to the [0,1] interval based on the maximum value of 1.2 MPa and the minimum value of 0.2 MPa. The flow rate is mapped to a range of 0 to 500 cubic meters per hour. The power value is converted with an upper limit of 200 kW to obtain a second data sequence. Simultaneously, the local controller timestamp of the current main PLC controller is read, and the hour field, weekday field, and holiday flag are parsed and encoded into 24-dimensional, 7-dimensional, and 1-dimensional one-hot vectors, respectively. These are then concatenated to generate a time feature vector. The normalized second data sequence is combined with the time feature vector to form the neural network input data. This input is then fed into a three-layer feedforward neural network configured within the first functional block for forward propagation calculations. The neural network performs optimized deployment in a PLC-restricted computing environment. Its input layer contains 79 nodes, the hidden layer consists of neurons driven by 16 ReLU activation functions, and the output layer generates a single load prediction value for the corresponding target prediction period. During forward propagation, the neural network calls the weight matrix preset in data block DB300 and performs matrix multiplication and nonlinear transformation operations to output a prediction value reflecting the load demand of the current equipment cluster within the next 15 minutes. Based on the prediction value, combined with the operating capacity limit, health status score, and runtime parameters of each device, a load priority evaluation model is used for sorting. A dynamic greedy strategy is then used to allocate the total load to each target device according to priority, constructing a device load allocation scheme.
[0023] Step 300: Input the device load distribution scheme into the second function block for encryption and authentication processing to obtain the security control instruction package; In this embodiment, the equipment load allocation scheme is formatted and converted according to a predetermined structure. A structured data packet containing equipment identifier, target load value, and execution control parameters is constructed in the second function block of the main PLC controller. A fixed-format header is added to the front of the data, with header fields including version number, instruction type, data length, and protocol identifier, forming the original instruction data. Based on the original instruction data, the 128-bit symmetric encryption key configured in the security data block SDB10 is called in the FB40 function block. Encryption is performed using the CBC mode of the AES algorithm. Simultaneously, a pseudo-random number generator generates a unique 16-byte initialization vector IV in real time during each encryption process. The initialization vector IV and the encrypted input data participate in the encryption process together to ensure that the same plaintext encrypted at different times yields completely different ciphertexts, thereby enhancing the data's resistance to analysis in the communication link and obtaining encrypted instruction data in ciphertext form. In FB40, the second set of independent keys is invoked to process the encrypted instruction data using the HMAC-SHA256 algorithm. Taking the authentication key and encrypted payload as input, a 256-bit message authentication code is constructed using a hash function and appended to the end of the data. This ensures the data is not tampered with during transmission and verifies the legitimacy of the instruction source, forming authenticated encrypted data. The authenticated encrypted data is combined with the original packet header information, the current PLC controller's 64-bit nanosecond-level timestamp field, and a 32-bit incrementing sequence number. A CRC32 checksum operation is then performed using the standard polynomial parameter 0x04C11DB7 to generate a checksum field. The above packet header, timestamp, sequence number, encrypted payload, authentication code, and checksum are then combined to form a secure control instruction packet.
[0024] Step 400: Transmit the safety control instruction package to the edge PLC controller, and use the equipment time index table to generate pressure anomaly judgment results and equipment fault early warning information.
[0025] In this embodiment, the safety control command packet is transmitted at high speed to the target edge PLC controller via the PROFINET industrial Ethernet communication bus. Within the controller's internal communication processing logic, CRC32 checksum and HMAC-SHA256 message authentication verification are performed sequentially. The CRC32 checksum detects whether data bits have been flipped, corrupted, or lost during transmission. The authentication code verification recalculates the HMAC value using a preset authentication key and compares it with the authentication code appended to the end of the data packet to ensure the data has not been tampered with and its source is trustworthy. Once both verification processes pass, the command packet is determined to be a legitimate and valid encrypted data packet. Using the 128-bit AES symmetric key stored locally on the edge PLC controller and the random initialization vector IV embedded during communication, the encrypted data packet is decrypted using CBC mode to recover the original control parameter data containing the target load value, control parameters, and equipment behavior commands. After the decryption process is completed, the original control parameter data is input into the OB35 cyclic interrupt organization block, and a self-tuning PID control algorithm is loaded based on the control parameters. The PID parameters are automatically calibrated using the Ziegler-Nichols method to adapt to different equipment load conditions. Simultaneously, the PID output is converted into a standard 0–10V voltage signal through the analog output module and input to the water pump driver, forming a real-time control output for the water pump speed. After the water pump speed control signal is applied, the edge PLC completes the real-time acquisition of the water pump's current operating status through its connected high-precision sensors. The acquired parameters include the outlet pressure value (measured by a 4–20mA pressure transmitter), the instantaneous flow rate value (acquired by an electromagnetic flowmeter), the motor power value (output by a power transmitter), and a 16-bit status word (containing multiple status identifiers such as operation, fault, protection, and communication). All the acquired real-time status data is then structured and integrated. The edge PLC calls the locally stored data mirroring device time index table to perform a structural comparison between the real-time status data and the data from the previous time segment. It calculates the gradient rate of change of pressure values and the abrupt change in flow rates within a continuous time window, and compares these calculations with preset anomaly thresholds. If the gradient rate of change exceeds 0.3 MPa / min or the abrupt change exceeds 50 m... 3 When the flow rate drops below 0.8, it is determined that there is an abnormal pressure or a sudden change in flow. The abnormal pressure judgment result is output, and the equipment health score is comprehensively evaluated by combining the equipment operating temperature, vibration and historical status words. When the score value is lower than the set threshold of 0.8, the fault warning module is automatically triggered and the equipment fault warning information is output.
[0026] In one specific embodiment, the process of performing step 100 may specifically include the following steps: The equipment numbers, timestamps, and operating parameters of multiple water supply devices are converted to obtain formatted raw data. In the main PLC controller, a chained storage allocation is performed on the formatted raw data to obtain the device time index table; The pressure value in the formatted raw data is assigned to the first storage area of the main PLC controller, the flow value is assigned to the second storage area of the main PLC controller, and the power value is assigned to the third storage area of the main PLC controller. Perform FNV-1a hash function operations and open addressing collision resolution on the first, second, and third storage areas, and establish a parameter index table.
[0027] In this embodiment, the data receiving buffer function block performs structured unpacking and preprocessing operations on the raw information. The equipment number information (4 bytes), timestamp field (8 bytes, nanosecond precision), and operating parameter value fields (each corresponding to pressure, flow rate, and motor power, occupying 2 bytes) contained in each raw data record are uniformly converted to a unified format. Fields are rearranged and byte-aligned according to a predetermined structure format to ensure that the memory layout of all data records within the PLC is continuous and consistent, generating standardized, fixed-length formatted raw data. Through the chained dynamic index allocation module, index node space is allocated for each formatted raw data record in the PLC's data block DB100. Each index node occupies 32 bytes and includes, in sequence, an equipment number field, a timestamp field, a data address pointer field (pointing to the actual storage location of the operating parameters), a CRC16 check field, and a reserved extension field. By maintaining a "previous pointer-next pointer" linked list structure, newly generated index nodes are inserted at the end of the linked list, forming a time-ordered chained index system and constructing the equipment time index table. Based on the content of the formatted raw data, the three key values in the operating parameter field—pressure, flow rate, and power—are written to three independent areas in the PLC main memory. The pressure value is written to the first storage area (100 channels from MW100 to MW199, 2 bytes per channel), the flow rate value is written to the second storage area (MW200 to MW299), and the power value is written to the third storage area (MW300 to MW399). In each write operation, the channel number, write offset, and parameter type are recorded as indexes to construct auxiliary data. An improved FNV-1a hash function is used to calculate hash keys for the channel numbers and corresponding parameter values of the three storage areas. The hash function uses 2166136261 as the initial value and performs bitwise XOR and multiplication operations on the byte sequence corresponding to each channel to obtain a hash value as the index key. When mapping the index key to the preset hash table address space in the PLC, if an already occupied hash position is encountered, conflict resolution is achieved using open addressing. This involves linear probing of adjacent slots until an unoccupied position is found, avoiding overwriting errors caused by conflicts and improving storage efficiency. A parameter index table with hash addressing capabilities is constructed in the PLC's data block DB200. This index table supports rapid location and real-time retrieval of pressure, flow, and power data at any given time. Combined with the aforementioned chained time index structure, high-speed bidirectional retrieval across devices, time periods, and parameter dimensions is achieved, forming an efficient data structure system within the PLC controller.
[0028] In one specific embodiment, the process of performing step 200 may specifically include the following steps: The storage areas for pressure, flow, and power values are located using the parameter index table, and the first data sequence is read. Normalization is performed on the first data sequence to obtain the second data sequence, and a time feature vector is generated based on the current controller time of the main PLC controller. The second data sequence and time feature vector are input into the three-layer neural network of the first functional block to perform forward propagation calculation and matrix operation with the weight matrix of the preset data block to obtain the load prediction value for the target time period. Create a device load allocation scheme based on the target period load forecast.
[0029] In this embodiment, the parameter index access module is called in the main PLC controller. The parameter index table jointly constructed by the FNV-1a hash function and the open addressing mechanism locates the actual address of the pressure value, flow value and power value in the main storage area of MW100–MW399. According to the set time sliding window interval, the required continuous historical data is retrieved channel by channel and time point by time to obtain the original operation record sequence covering the most recent 24 hours, forming the first data sequence. The sequence is structured into a matrix form, with row vectors corresponding to time segments and column vectors corresponding to different parameter channels. In the first function block FC20, a normalization function template is loaded. Linear normalization is performed on each physical quantity extracted from the first data sequence. The pressure value is compressed and mapped to the standard numerical range of [0.2MPa, 1.2MPa] according to its physical range, the flow rate value is standardized according to the range of [0, 500m³ / h], and the power value is scaled according to the range of [0, 200kW]. This unifies the dimensions and units of all input parameters and generates the second data sequence. At the same time, the current local system time of the main PLC controller is retrieved. By parsing the current hour field, weekday field, and holiday status flag, they are encoded into a 24-dimensional hourly unique hot vector, a 7-dimensional weekday unique hot vector, and a 1-digit holiday flag, forming a total of 32-dimensional time feature vector. This vector is then concatenated with the normalized operating parameter data to form an input vector set. Within the first functional block, a structured three-layer feedforward neural network is initiated. The network structure consists of an input layer, a hidden layer, and an output layer. The input layer accepts an input vector of length 79, containing 48 sets of sampling points for pressure, flow, and power, plus a 32-dimensional time code and a 1-bit interval identifier. The hidden layer is configured with 16 ReLU activation neurons to achieve nonlinear transformation capability. The output layer is a single node used to predict the load demand value within the next 15 minutes. By reading the weight matrix from the DB300 data block, performing matrix multiplication on the input vector and adding bias terms, the forward propagation process from the input layer to the hidden layer and from the hidden layer to the output layer is completed sequentially to generate the load prediction value for the target time period, which represents the total load level that all devices in the system need to bear in the future time window under the current operating state. Based on the intelligent load scheduling module, the system extracts four key characteristics of each device from the device status database: current operating efficiency, health score, distance from the load center, and cumulative runtime over the past 24 hours. These are then ranked and scored according to a weighted priority function. An improved greedy allocation strategy is then executed, distributing the target time period load forecast to the optimal device in priority order. The actual target load carried by each device must not exceed its design capacity limit. If the remaining load is still greater than zero, the load is allocated to the next higher priority device until the target time period load forecast is fully distributed. Hysteresis control parameters are introduced to automatically stop the corresponding device when the load falls below a stop threshold to avoid high-frequency start-stop cycles. A set of target load configurations corresponding to each device identifier is output, forming the device load allocation scheme.
[0030] In one specific embodiment, the process of creating a device load allocation scheme based on the target time period load forecast value may specifically include the following steps: Obtain pipeline distance data, operating efficiency data, cumulative operating time data, and health score data for each water supply device to obtain a device parameter dataset; The priority score of each water supply device is obtained by performing the reciprocal operation on the pipeline distance data, the direct value of the operating efficiency data, the inverse operation on the cumulative operating time data, and the direct value of the health score data, and then multiplying them by the corresponding weight coefficients respectively. Perform a descending sort operation on the priority scores of each water supply device to obtain the device priority sorting queue; Based on the priority sorting queue, a greedy allocation algorithm is executed sequentially to allocate the target time period load prediction value to each water supply device and calculate the minimum capacity limit of each water supply device to obtain the device load allocation scheme.
[0031] In this embodiment, the device parameter collection module is called in the FC30 function block of the main PLC controller. The device time index table constructed by the chain structure is used to locate the number of all online water supply devices. The static and dynamic operation indicators of each device are read in sequence, including pipeline distance data (unit: km, accuracy: 0.1 km, calculated from the results of the preset GIS geographic information coordinate system), operation efficiency data (calculated as the ratio of the current operating power to the device's calibrated standard power, ranging from 0.70 to 0.95), cumulative operating time data (derived as the ratio of the cumulative operating time in the past 24 hours to the total duration, ranging from 0 to 1), and health score data (calculated by weighting the temperature, current, and vibration data uploaded by the edge PLC, with a range limited to 0.8 to 1.0). The above four indicators together constitute the operating characteristics of each device and form the device parameter dataset. In the priority evaluation module, standardized feature mapping operations are performed on the equipment parameter dataset. For pipeline distance data, a reciprocal transformation is performed to reflect its negative correlation with energy efficiency; that is, equipment closer to the load center has higher priority. Operating efficiency data is directly used in the calculation without transformation. Cumulative operating time data, reflecting the current load status of the equipment, undergoes an inverse proportional operation, reflecting that equipment with less recent operation has higher priority, thus achieving load balancing. Health score is used directly as a positive indicator, maintaining its original meaning in the evaluation model. The results of these four transformations are multiplied by their corresponding weighting coefficients K1=0.3 (reciprocal distance), K2=0.35 (operating efficiency), K3=0.2 (inverse proportionality of operating time), and K4=0.15 (health), respectively. The four results are then summed to form a unique priority score for each device, indicating its priority in load allocation during the current scheduling cycle. The priority scores of all devices are sorted in descending order to generate a device priority ranking queue, thus clarifying the order of all devices eligible for scheduling. Based on the device priority sorting queue, a greedy allocation algorithm is executed sequentially. Using the target time period load value as the initial remaining load, devices are added to the allocation sequence one by one according to the priority queue order. The actual load value L allocated to each device is determined. i L should be satisfied i = min(C i ,L r ), where C i L represents the maximum processing capacity calibrated for this device. r This represents the total load that has not yet been fully allocated. The system updates L after each allocation is completed. r The system calculates the value and checks if it is zero. If not, it continues to allocate the load to the next priority device until the total load is fully allocated. During this process, minimum capacity limits are set for each device to start and stop. Two capacity thresholds are defined based on hysteresis control logic: the start threshold is 0.3 × C. iThe stopping threshold is 0.1 × C. i This ensures that equipment only starts or stops when the actual load exceeds the threshold range, avoiding equipment fatigue caused by frequent start-stop cycles. The greedy allocation process outputs a complete set of control configurations, including equipment number, target load value, and minimum capacity limit, forming a device load allocation scheme for the target time period.
[0032] In one specific embodiment, the process of performing step 300 may specifically include the following steps: The equipment load allocation scheme is formatted into structured data containing equipment identifiers, target load values, and control parameters, and header information is added to obtain the raw instruction data; Based on the original instruction data, the second function block calls the 128-bit key of the security data block to perform AES-CBC mode encryption and generate a random initialization vector to obtain the encrypted instruction data; The HMAC-SHA256 operation is performed on the encrypted instruction data using the authentication key in the second function block to generate a message authentication code, which is then appended to the end of the data to obtain authenticated encrypted data. The authentication encrypted data is combined with the packet header, timestamp, and serial number, and a CRC32 check value is calculated to form a security control instruction packet.
[0033] In this embodiment, the structured encapsulation operation of the equipment load allocation scheme is completed in the main PLC controller, which encapsulates the scheduling and control parameters of each target device, including the device identifier (4-byte unsigned integer) and the target load value (represented in floating-point form, in kW or m). 3The ` / h` parameter and additional control parameters (such as PID parameters, threshold flags, fault status words, etc.) are combined into a fixed-length structure according to the set field order. Structured instruction segments are generated for each device, and the structured instruction segments of all devices are sequentially concatenated to form the main data body. A header is added to the front of the data body. The header fields include the protocol version number (1 byte), data type identifier (1 byte), payload length (2 bytes), command number (4 bytes), and source controller identifier (2 bytes). The original instruction data is generated based on the encapsulated complete structure. In the original data structure, the data body and the header are logically associated but physically connected. The system enters the second function block FB40 and loads the 128-bit symmetric key stored in the secure data block SDB10. The original instruction data is protected for confidentiality using the AES encryption algorithm. Block encryption is performed in CBC mode. Before encryption, an internal pseudo-random number generation module generates a 16-byte random initialization vector (IV). This IV is transmitted separately in plaintext within the packet but is only used in this encryption process to ensure the non-repetitive nature of the encrypted output. The AES-CBC encryption process encrypts the original data in 16-byte blocks sequentially. An initial perturbation is introduced through an XOR operation with the initialization vector, ensuring that the same data yields completely different ciphertext outputs in different encryption rounds, resulting in encrypted instruction data in ciphertext format. In the second function block, another authentication key, independent of the encryption key, is introduced. The encrypted instruction data is protected for message integrity using the HMAC-SHA256 algorithm. This includes performing two rounds of hash digest operations on the authentication key and encrypted data to generate a 256-bit authentication code (MAC). The authentication code is appended to the end of the encrypted data as a data integrity check value to form the authenticated encrypted data body. The authentication encrypted data body, along with the packet header information, the current timestamp field of the main PLC controller (encoded in 64-bit format with nanosecond precision), and the global control command sequence number (used to identify duplicate and lost packets), are structurally concatenated to obtain the data segment to be verified. The CRC32 verification module performs a 32-bit redundancy check calculation on the data segment to be verified. The standard generator polynomial 0x04C11DB7 is used to shift and XOR each bit of the concatenated data to calculate the CRC check code, which is then appended to the end of the data to form a security control command packet containing the packet header, timestamp, sequence number, authentication encrypted data body, and CRC check field.
[0034] In one specific embodiment, the process of performing step 400 may specifically include the following steps: The safety control command packet is transmitted to the edge PLC controller via the PROFINET bus and performs CRC32 check verification and HMAC-SHA256 message authentication verification to obtain a successfully verified encrypted data packet. The encrypted data packets that pass verification are decrypted using the local key of the edge PLC controller to obtain the target control parameter data; The target control parameter data is input into the OB35 cyclic interrupt organization block to execute the self-tuning PID control algorithm and converted into a water pump speed control signal through the analog output module. Based on the execution results of the water pump speed control signal, the outlet pressure value, instantaneous flow value, motor power value, and 16-bit equipment status word are collected to obtain real-time status data; By combining the equipment time index table, gradient change and abrupt change detection are performed on the real-time status data to obtain pressure anomaly judgment results and equipment fault early warning information.
[0035] In this embodiment, a real-time data link based on RT class communication is established between the main PLC and the edge PLC controller via the PROFINET industrial Ethernet bus. The safety control command packets generated in the main PLC are sent to the receive buffers of each target edge PLC controller at a transmission rate of 100Mbps. After receiving the data packets, the edge PLC executes an integrity verification process via the FB50 function block. The CRC32 check module recalculates and verifies all bits in the command packet except the CRC field, using the standard polynomial 0x04C11DB7 for bit shifting and XOR operations. The local calculation result is compared with the checksum appended to the end of the data. If they match, the primary integrity verification is passed. HMAC-SHA256 authentication verification is then performed on the encrypted command payload in the data packet using an independent authentication key. The message digest is reconstructed and compared with the original authentication code to ensure that the data has not been tampered with and its source can be confirmed. When both verifications pass, the data packet is marked as a valid encrypted data packet. The 16-byte initialization vector (IV) field is extracted from the encrypted data packet, and the 128-bit symmetric key stored locally on the edge PLC is called. The decryption process is performed in AES-CBC mode, using a group-by-group decryption and XOR rollback method to restore the ciphertext to the original structured control parameter data. The decrypted output data structure contains key control instruction fields such as device number, target load value, PID adjustment coefficient, execution threshold, and status trigger identifier. The self-tuning PID control algorithm module is called in the OB35 cyclic interrupt organization block, using the target control parameter data as a dynamic input load. The PID controller's adjustment parameters are updated in real time within a 10ms interrupt cycle, and the optimal K is calculated using the Ziegler-Nichols method. p T i T dThe parameter group represents the proportional coefficient, integral time, and derivative time, respectively. Based on the target load value, the output control signal is calculated and converted into a 0–10V standard voltage signal via the analog output module AQ 4×U / I ST, and then sent to the pump frequency converter to regulate the pump speed. After the pump executes the control command, the feedback signal corresponding to the control behavior is acquired in real time. In the FC50 function block, the signal from the 4–20mA pressure transmitter is read through the high-precision analog input channel to obtain the current outlet pressure value. Simultaneously, the outputs of the electromagnetic flowmeter and power transmitter are read to obtain the instantaneous flow rate and motor power data. Combined with the digital input channel, a 16-bit status word is obtained. The status word encoding includes multiple status indicators such as running, stopping, overload, communication failure, and emergency stop. These five data items constitute the real-time status dataset. The system calls the device time index table of the local mirror of the edge PLC, matches the corresponding device number and timestamp field, compares the current real-time status data with the historical data of the previous period, performs gradient change calculation on the pressure value, and uses the gradient function to determine whether there is a sudden increase or decrease trend. If the gradient is greater than 0.3MPa / min or less than -0.3MPa / min, a pressure anomaly judgment is triggered. At the same time, the system performs absolute change difference analysis on the flow rate value. If the interpolation is greater than 50m³, the system will detect the change. 3 If the value is / h, it is initially determined that the equipment is malfunctioning. The current temperature, current and vibration factor data are fused together to calculate a health score. If the score is lower than the 0.8 threshold, the equipment fault early warning process is triggered synchronously, and the abnormality type, equipment number, timestamp and parameter value are recorded in the OB121 emergency error interrupt, and fed back to the main PLC or upper monitoring system through the communication bus.
[0036] In one specific embodiment, the process of inputting the target control parameter data into the OB35 cyclic interruption organization block to execute the self-tuning PID control algorithm and converting it into a water pump speed control signal through the analog output module can specifically include the following steps: The target control parameter data is loaded into the OB35 loop interrupt organization block and the execution cycle is configured to obtain the real-time control loop task. Based on the pressure setpoint in the real-time control cyclic task, a self-tuning PID control algorithm is used to determine the critical gain and critical period parameters, and obtain the PID control coefficients. The PID control coefficients are used to perform PID control calculations on the deviation between the current pressure feedback and the target pressure setting to obtain a standardized control output value. The standardized control output value is sent to the AQ analog output module to be converted into a continuous voltage signal and output to the inverter control terminal to obtain the water pump speed control signal.
[0037] In this embodiment, the target control parameter data is written into the data area of the OB35 cyclic interrupt organization block in the edge PLC controller. The target control parameter data includes the equipment number, target pressure setpoint, load threshold, PID controller start / stop flag, adjustment response time, etc. A fixed execution cycle of 10ms is set for the OB35 organization block by calling the PLC system configuration interface, forming a high-priority real-time control cyclic task. The self-tuning PID control algorithm module is started in the OB35 interrupt function entry point, and the pressure setpoint in the target control parameters in the current control cycle is used as the reference input. Combined with the current actual outlet pressure value collected by the 4-20mA pressure transmitter, a closed-loop response model of the pressure control loop is constructed. By applying a step signal disturbance and recording the pressure response curve in real time, the fluctuation amplitude and fluctuation period of the output are analyzed, and the critical gain K of the system is automatically determined. u and critical period T u And according to the Ziegler-Nichols tuning rule, the three key parameters of the PID controller are calculated sequentially: proportional gain K. p = 0.6·Ku, integration time T i = 0.5·Tu, differential time T d = 0.125·Tu, this set of parameters is directly assigned to the coefficient register of the PID controller and dynamically called during each interrupt cycle. After the PID controller parameters are initialized, the difference between the actual pressure feedback value collected in the current cycle and the target pressure setpoint is calculated to construct the deviation value. This deviation value is then used as input to execute the PID controller's calculation logic, accumulating the adjustment action in three parts: proportional, integral, and derivative. The three calculation results are weighted and combined to generate a standardized control output value. The output value is a unit normalized value, ranging from 0 to 1, representing the proportional level of the adjustment intensity. Through the analog output function module, the normalized output value is mapped to the corresponding analog voltage range according to the preset voltage range and equipment type. It is then converted into a continuous voltage signal by the AQ 4×U / I ST module, with a voltage range of 0–10V or 4–20mA. The corresponding channel and range are selected according to the controlled object. The analog voltage signal is sent to the control input terminal of the field water pump driver through a shielded cable. The frequency converter linearly adjusts the output frequency according to the input voltage, thereby adjusting the real-time speed of the water pump and realizing dynamic control of the water supply pressure of the pipeline network.
[0038] In one specific embodiment, the process of performing gradient change and abrupt change detection on real-time status data in conjunction with the equipment time index table to obtain pressure anomaly determination results and equipment fault early warning information can specifically include the following steps: The device time index table is used to perform CRC check and hierarchical storage on the real-time status data to obtain the verified stored data; Based on the verified stored data, the pressure value time difference gradient calculation and the flow value adjacent time absolute difference calculation are performed to obtain the pressure gradient change value and the flow change detection value. The pressure gradient change value is compared with a preset gradient threshold to obtain the pressure comparison result, and the flow rate change detection value is compared with a preset change threshold to obtain the flow rate comparison result. Based on the pressure comparison results and flow comparison results, an abnormal state logic judgment is performed to obtain the pressure anomaly judgment result; Based on the pressure anomaly determination results, combined with vibration acceleration, motor winding temperature and three-phase current, a comprehensive fault prediction analysis is performed to obtain equipment fault early warning information.
[0039] In this embodiment, after the main PLC controller receives the real-time status data, the FB70 function block parses the header information and recalculates the redundancy check value of the data body content through the CRC check module. This value is then compared with the original data's attached CRC field. If the verification matches, the data is marked as valid and enters the storage process. In the storage process, based on the corresponding device number and timestamp field in the device time index table, the data is written to the device index chain table of the DB100 data block in a chained structure. The corresponding parameter hash index is updated in the DB200 area, completing the dual-layer storage operation for the periodic data. That is, the time-layer index and parameter mapping index are written in parallel, forming verified structured storage data. The FB80 function block retrieves historical data for two consecutive periods, performs time difference gradient calculation on the pressure value to obtain the pressure change rate, and simultaneously calculates the absolute difference between adjacent time points on the flow value to capture the instantaneous flow change amplitude. The pressure gradient change value is compared with the set pressure gradient threshold (±0.3MPa / min). If it exceeds the threshold range, the pressure comparison result is output as an abnormal state. The flow change detection value is compared with the set change identification threshold (e.g., 50m). 3A comparison of the magnitudes of the flow rate changes is performed. If the magnitude of the change exceeds the set limit, the flow rate comparison result is marked as a change. Simultaneously, a fault logic judgment module is loaded, performing Boolean logic combination on the aforementioned two comparison results. If the pressure anomaly flag is 1 and the flow rate change flag is 1, or if either of these occurs continuously for several control cycles, a pressure anomaly judgment result is output according to the configuration strategy. Based on the pressure anomaly judgment result, the equipment monitoring parameter dataset is called, including the vibration acceleration RMS value calculated in real time by the triaxial vibration sensor, the motor winding temperature value uploaded by the embedded temperature sensor, and the three-phase current data uploaded by the power supply module. A comprehensive scoring function is constructed after standardizing the above three types of sensor data according to the fault prediction model. The scoring function uses a weighted linear model or a neural network regression structure to nonlinearly combine and evaluate each anomaly factor. The scoring result is compared with the safety threshold set for the equipment category. If the score value is lower than the set lower limit, the equipment is marked as having a fault risk state, and the equipment fault early warning process is triggered. The equipment number, current anomaly item, predicted fault type, and timestamp are encapsulated into an early warning information frame, which is sent to the main PLC controller's upper-level scheduling task queue, and the DB500 fault record buffer is updated simultaneously.
[0040] In one specific embodiment, the process of performing a comprehensive fault prediction analysis based on the pressure anomaly determination result, combined with vibration acceleration, motor winding temperature, and three-phase current, to obtain equipment fault early warning information can specifically include the following steps: The pressure anomaly determination results are input into the upper-level agent model along with the vibration acceleration of each water supply equipment, the motor winding temperature and the three-phase current to perform multi-source data fusion and fault mode recognition operations, and the fault feature vector is obtained. Based on the fault feature vector, Bayesian network inference and Markov state transition probability calculation are performed in the upper-layer agent model, and pattern matching analysis is performed in combination with the historical fault database to obtain the fault type probability distribution matrix. The failure type probability distribution matrix is input into the lower-level decision model to perform a weighted comprehensive evaluation of the maintenance cost function, downtime risk function, and equipment life loss function to obtain the optimal maintenance strategy vector; The error interruption organization block is triggered based on the optimal maintenance strategy vector, and the equipment fault warning information is recorded in the second data block according to the predicted maintenance level.
[0041] In this embodiment, the FB80 function block of the main PLC controller receives and summarizes multi-dimensional status data reported from the edge PLC, including the pressure anomaly judgment result generated by the differential analysis module in the previous cycle, the vibration acceleration RMS value measured by the triaxial vibration sensor, the temperature data collected by the motor winding temperature sensor, and the three-phase current (Ia, Ib, Ic) values. This data is then synchronously associated with the corresponding device number to form a unified input data structure. This structured data is deployed in the proxy model interface of the upper-level control architecture. The upper-level proxy model, with fault detection and early warning identification as its core objective, performs standardization and normalization operations during the data processing stage, unifying the units and compressing the dimensions of numerical features such as vibration, temperature, and current. During the fusion stage, a multi-source data fusion mechanism is used to jointly express the pressure anomaly signal and continuous operating condition data at the feature level. Through principal component analysis, feature mapping transformation, and sliding window aggregation strategies, key feature combinations in the state evolution trajectory are extracted to generate a fault feature vector with fixed dimensions and a closed structure. Based on the fault feature vector, a Bayesian network inference module is initiated. The fault feature vector is used as an evidence node input into the prior conditional graph model. Node conditional probability updates are performed based on the joint probability graph constructed from the equipment type and fault history. Information is propagated through the dependency structure between variables to achieve a preliminary probability estimate of potential fault categories. Simultaneously, a Markov chain state transition probability calculation process is initiated. Based on the transition weights between the current equipment state and the historical state evolution sequence, the probability vector of the equipment potentially transitioning from the current state to different fault modes is calculated. These two types of probability information are then fused and input into the fault pattern matching module. Similarity calculations are performed with typical fault templates in the historical fault database. Pattern classification comparisons are conducted using metrics such as KL divergence, cosine similarity, or Euclidean distance to generate a fault type probability distribution matrix indexed by multiple possible fault types, describing the degree to which the current equipment is likely to belong among all known fault types. The probability distribution matrix of fault types is input into the lower-level decision-making model. Based on the distribution matrix, the lower-level decision-making model uses three cost functions to predict the cost of each type of fault: a maintenance cost function, which quantifies the direct material and labor costs required to immediately perform the corresponding type of repair or replacement; a downtime risk function, which calculates potential economic and safety losses based on the impact of equipment failure on the system's water supply task and the consequences of task delay; and a lifespan loss function, which assesses the degree of erosion of the remaining lifespan based on the current fault risk. These three functions are then weighted and summed according to configured weight coefficients to form a maintenance decision cost assessment vector for the current equipment. The dimension corresponding to the minimum cost is used as the recommended action, outputting the optimal maintenance strategy vector, which includes the predicted fault type, response priority, suggested maintenance level, and time window.The optimal maintenance strategy vector is synchronously written into the second data block DB600 of the main PLC, and the OB121 error interrupt organization block is triggered, forcing the system to enter the fault response processing flow. In the interrupt handling function, the maintenance level is marked as observation, recommended maintenance, and emergency replacement, forming a maintenance early warning record entry, including equipment number, trigger time, fault probability distribution, early warning level and recommended execution time, and added to the circular fault log queue for querying and subsequent analysis by the upper system.
[0042] The above describes the equipment control method based on an industrial PLC controller in the embodiments of the present invention. The following describes the equipment control system based on an industrial PLC controller in the embodiments of the present invention. Please refer to [link / reference]. Figure 2 One embodiment of the equipment control system based on an industrial PLC controller in this invention includes: Module 11 is used to construct an equipment time index table and a parameter index table for multiple water supply devices using the main PLC controller; The load prediction module 12 is used in the first function block to perform load prediction in conjunction with the parameter index table and create a device load allocation scheme. The encryption authentication processing module 13 is used to input the device load distribution scheme into the second function block for encryption authentication processing to obtain a security control instruction package. The generation module 14 is used to transmit safety control instruction packets to the edge PLC controller and generate pressure anomaly judgment results and equipment fault early warning information using the equipment time index table.
[0043] Through the collaborative efforts of the aforementioned components, and by employing a two-stage hierarchical indexing structure combined with a dual indexing mechanism of equipment time index table and parameter index table, high-speed data retrieval and storage are achieved. The combination of chained storage structure and hash indexing technology significantly shortens data lookup time, and the hierarchical storage architecture optimizes memory utilization, supporting efficient management of massive amounts of equipment data. Simultaneously, a three-layer neural network algorithm implemented in the PLC environment combines historical pressure, flow data, and time feature vectors for intelligent prediction. An adaptive weight update mechanism enables the system to dynamically adapt to changing water demand patterns, and multi-dimensional feature fusion technology provides more accurate future load prediction capabilities. Furthermore, the multi-dimensional priority evaluation function comprehensively considers key factors such as equipment distance, efficiency, operating time, and health. A greedy allocation algorithm combined with a dynamic scheduling mechanism maximizes equipment operating efficiency and balances lifespan, while hysteresis control characteristics prevent frequent equipment start-ups and shutdowns. The three-layer security protection system established in this invention includes AES-128 encryption, HMAC-SHA256 authentication, and CRC32 verification. A dynamic key update mechanism and random initialization vector ensure the confidentiality and integrity of communication data, and a custom application layer protocol provides multiple verification guarantees, effectively preventing network attacks and data tampering. By using a multi-dimensional anomaly detection algorithm to monitor pressure gradient changes and flow surges in real time, and combining an upper-level agent model with a lower-level decision model to achieve intelligent fault diagnosis and predictive maintenance, a comprehensive health assessment system that combines multi-source parameters such as vibration, temperature, and current to provide comprehensive equipment status monitoring, an OB35 cyclic interruption organization block to ensure the real-time performance and accuracy of the PID control algorithm, self-tuning PID parameter optimization technology to adapt to control requirements under different operating conditions, and emergency control mode and fault recording mechanism to provide system safety assurance and fault tracing capabilities, the system improves the intelligence level, operating efficiency, and safety and reliability of the distributed water supply system.
[0044] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0045] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0046] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A device control method based on an industrial PLC controller, characterized in that, include: Use the main PLC controller to construct an equipment time index table and a parameter index table for multiple water supply devices; Specifically, this includes: converting the device numbers, timestamps, and operating parameters of multiple water supply devices into formatted raw data; performing chained storage allocation on the formatted raw data in the main PLC controller to obtain a device time index table, where each index node includes a device number field, a timestamp field, a data address pointer field, a CRC16 check field, and a reserved extension field; allocating the pressure value in the formatted raw data to the first storage area of the main PLC controller, the flow value to the second storage area of the main PLC controller, and the power value to the third storage area of the main PLC controller; performing FNV-1a hash function calculation and open addressing conflict resolution on the first, second, and third storage areas to establish a parameter index table, wherein the improved FNV-1a hash function is used to calculate the hash key value of the channel number and its corresponding parameter value in the three storage areas to obtain the hash value as the index key; when the index key is mapped to the preset hash table address space in the PLC, if an already occupied hash position is encountered, the open addressing method is used for conflict resolution; In the first functional block, load prediction is performed in conjunction with the parameter index table to create a device load allocation scheme; The device load distribution scheme is input into the second function block for encryption and authentication processing to obtain a security control instruction package; The safety control instruction package is transmitted to the edge PLC controller, and the pressure anomaly judgment result and equipment fault early warning information are generated using the equipment time index table. Specifically, this includes: performing CRC verification and hierarchical storage on the real-time status data of the water supply equipment using the equipment time index table to obtain verified stored data; performing pressure value time difference gradient calculation and flow value adjacent time absolute difference calculation based on the verified stored data to obtain pressure gradient change value and flow change detection value; comparing the pressure gradient change value with a preset gradient threshold to obtain a pressure comparison result, and comparing the flow change detection value with a preset change threshold to obtain a flow comparison result; performing abnormal state logic judgment based on the pressure comparison result and flow comparison result to obtain... The pressure anomaly determination result is then input into the upper-level agent model along with the vibration acceleration, motor winding temperature, and three-phase current of each water supply device to perform multi-source data fusion and fault mode recognition operations, resulting in a fault feature vector. Based on the fault feature vector, Bayesian network inference and Markov state transition probability calculation are performed in the upper-level agent model, and pattern matching analysis is conducted using a historical fault database to obtain a fault type probability distribution matrix. The fault type probability distribution matrix is then input into the lower-level decision model to perform a weighted comprehensive evaluation of the maintenance cost function, downtime risk function, and equipment life loss function, resulting in an optimal maintenance strategy vector. Based on the optimal maintenance strategy vector, an error interruption organization block is triggered, and equipment fault warning information is recorded in the second data block according to the predicted maintenance level.
2. The equipment control method based on an industrial PLC controller according to claim 1, characterized in that, In the first functional block, load prediction is performed in conjunction with the parameter index table to create a device load allocation scheme, including: The storage areas for pressure, flow, and power values are located using the parameter index table, and the first data sequence is read. Normalization is performed on the first data sequence to obtain the second data sequence, and a time feature vector is generated based on the current controller time of the main PLC controller. The second data sequence and the time feature vector are input into the three-layer neural network of the first functional block to perform forward propagation calculation and matrix operation with the weight matrix of the preset data block to obtain the target time period load prediction value; A device load allocation scheme is created based on the predicted load values for the target time period.
3. The equipment control method based on an industrial PLC controller according to claim 2, characterized in that, The step of creating a device load allocation scheme based on the target time period load forecast includes: Obtain pipeline distance data, operating efficiency data, cumulative operating time data, and health score data for each water supply device to obtain a device parameter dataset; The priority score of each water supply device is obtained by performing the reciprocal operation on the pipeline distance data, directly taking the value of the operating efficiency data, performing the inverse operation on the cumulative operating time data, and directly taking the value of the health score data, and then multiplying them by the corresponding weight coefficients respectively. Perform a descending sort operation on the priority scores of each water supply device to obtain the device priority sorting queue; Based on the device priority sorting queue, a greedy allocation algorithm is executed sequentially to allocate the target time period load prediction value to each water supply device and calculate the minimum capacity limit of each water supply device to obtain the device load allocation scheme.
4. The equipment control method based on an industrial PLC controller according to claim 1, characterized in that, The step of inputting the device load distribution scheme into the second function block for encryption and authentication processing to obtain a security control instruction package includes: The device load allocation scheme is formatted into structured data containing device identifiers, target load values, and control parameters, and header information is added to obtain the original instruction data; Based on the original instruction data, the 128-bit key of the security data block is called in the second function block to perform AES-CBC mode encryption and generate a random initialization vector to obtain encrypted instruction data; The HMAC-SHA256 operation is performed on the encrypted instruction data using the authentication key in the second function block to generate a message authentication code, which is then appended to the end of the data to obtain authenticated encrypted data. The authentication encrypted data is combined with the packet header, timestamp, and serial number, and a CRC32 check value is calculated to form a security control instruction packet.
5. The equipment control method based on an industrial PLC controller according to claim 1, characterized in that, The step of transmitting the safety control instruction packet to the edge PLC controller and generating pressure anomaly determination results and equipment fault early warning information using the equipment time index table includes: The safety control instruction package is transmitted to the edge PLC controller via the PROFINET bus and CRC32 verification and HMAC-SHA256 message authentication are performed to obtain a verified encrypted data packet. The encrypted data packet that has passed verification is decrypted using the local key of the edge PLC controller using AES-CBC to obtain the target control parameter data; The target control parameter data is input into the OB35 cyclic interruption organization block to execute the self-tuning PID control algorithm and converted into a water pump speed control signal through the analog output module. Based on the execution result of the pump speed control signal, the outlet pressure value, instantaneous flow rate value, motor power value, and 16-bit device status word are collected to obtain real-time status data; By combining the equipment time index table, gradient change and abrupt change detection are performed on the real-time status data to obtain pressure anomaly judgment results and equipment fault early warning information.
6. The equipment control method based on an industrial PLC controller according to claim 5, characterized in that, The step of inputting the target control parameter data into the OB35 cyclic interruption organization block to execute the self-tuning PID control algorithm and converting it into a water pump speed control signal through the analog output module includes: The target control parameter data is loaded into the OB35 loop interrupt organization block and the execution cycle is configured to obtain the real-time control loop task. Based on the pressure setpoint in the real-time control cycle task, a self-tuning PID control algorithm is used to determine the critical gain and critical period parameters, and obtain the PID control coefficients. The deviation between the current pressure feedback and the target pressure setting is calculated using the PID control coefficients to obtain a standardized control output value. The standardized control output value is sent to the AQ analog output module to be converted into a continuous voltage signal and output to the inverter control terminal to obtain the water pump speed control signal.
7. A device control system based on an industrial PLC controller, characterized in that, A device control method based on an industrial PLC controller for performing any one of claims 1-6 includes: The module is used to build equipment time index tables and parameter index tables for multiple water supply devices using the main PLC controller; The load prediction module is used in the first functional block to perform load prediction in conjunction with the parameter index table and create a device load allocation scheme. The encryption authentication processing module is used to input the device load distribution scheme into the second function block for encryption authentication processing to obtain a security control instruction package; The generation module is used to transmit the safety control instruction package to the edge PLC controller and use the equipment time index table to generate pressure anomaly judgment results and equipment fault early warning information.
Citation Information
Patent Citations
Industrial data storage and index method based on time series
CN102446184A
Data deduplication method and data deduplication device
CN111124312A
Three-stage water pump station integrated operation and maintenance system and method
CN117803047A
Security enhanced CAN controller based on encryption authentication and intrusion detection
CN119341770A
Dynamic reliability evaluation method and system for gear box of large road maintenance machine
CN120145205A