Intelligent gate control access method and system based on drive identification and data mapping

By adopting a smart gate control access method based on driver recognition and data mapping, the automated equipment access and control strategy execution of water conservancy terminals have been realized, solving the problem of inconsistent equipment access and improving the intelligence and reliability of the water conservancy system.

CN120729915BActive Publication Date: 2025-11-18CEIEC ELECTRIC TECH +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511178571.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-11-18
Estimated Expiration
2045-08-22

AI Technical Summary

Technical Problem

Existing IoT gate control solutions rely on fixed drivers and manual configuration, resulting in inconsistent device access, making it difficult to meet the needs of large-scale device access and efficient management. Furthermore, inconsistent communication protocols affect the automation level and reliability of water conservancy gate control systems.

Method used

The intelligent gate access method based on driver recognition and data mapping is adopted. The gateway edge computing node automatically identifies the access device, parses the device variable format, dynamically executes the control strategy, and verifies the execution behavior through simulated data. It builds the linkage relationship between the device and the upstream and downstream areas, reducing manual intervention.

Benefits of technology

It enables automatic identification and protocol adaptation of gate control equipment, improves the system's intelligence level and operational reliability, adapts to the access of large-scale heterogeneous equipment, enhances strategy adaptability and equipment versatility, and improves the automation capability and overall collaborative efficiency of the water conservancy system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120729915B_ABST
    Figure CN120729915B_ABST
Patent Text Reader

Abstract

The application provides a smart gate control access method and system based on driving identification and data mapping, and is applied to the field of data processing; the application realizes automatic identification and protocol adaptation of the gate control equipment through a gateway edge computing node built in a water conservancy terminal, avoids the cumbersome process of traditional manual configuration of a communication channel and a protocol driver, effectively reduces manual intervention, can analyze the variable format and the equipment function after the equipment is accessed, automatically matches and executes a control strategy, can also perform dynamic verification and behavior analysis based on simulation data if the strategy cannot be directly applied, and further constructs the linkage relationship of the equipment to upstream and downstream areas, the mechanism enhances the strategy adaptability and the equipment universality, helps to improve the intelligent level, the operation reliability and the automation capability of the gate control system, and is especially suitable for a smart water conservancy scene of large-scale equipment heterogeneous access and unified control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and in particular to a smart gate access method and system based on drive recognition and data mapping. Background Technology

[0002] With the development of smart water conservancy and irrigation area automation, gate control systems need to connect to a large number of devices (such as integrated gates, RTUs, video monitoring equipment, etc.) to achieve real-time data acquisition and remote control.

[0003] Existing IoT gate control solutions use fixed drive and manual configuration methods. Traditional solutions often rely on PLCs, and there are inconsistencies in communication protocols and access methods among different brands. In addition, they mainly rely on manual configuration. When connecting devices, existing traditional IoT solutions mainly use manual channel configuration and fixed master-slave switching mechanisms, which are difficult to meet the needs of large-scale device access and efficient management. Summary of the Invention

[0004] This invention aims to solve the problem of how to improve the automation and reliability of water conservancy gate control with reduced human intervention, and provides a smart gate control access method and system based on drive recognition and data mapping.

[0005] The present invention employs the following technical means to solve the technical problem:

[0006] This invention provides a smart gate access method based on driver recognition and data mapping, comprising:

[0007] Based on the gateway edge computing node preset by the water conservancy terminal, newly added logical ports are monitored, and the access gate control equipment is identified through the logical ports;

[0008] Determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols;

[0009] If so, then read the preset device data points of the gate control device, parse the variable format of the gate control device according to the device data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset device function of the gate control device. The device data points specifically include water level, gate opening degree and fault status, and the variable format specifically includes encoding method, variable structure type and register address mapping.

[0010] Determine whether the control strategy can be synchronized with the gate control device;

[0011] If not, the verification content of the control strategy is obtained. Based on the simulation data pre-recorded by the water conservancy terminal, the execution behavior of the gate control device on the control strategy is dynamically verified. According to the execution behavior, the influence parameters of the gate control device on the upstream and downstream areas are identified. Based on the influence parameters, the linkage relationship of the control strategy on the upstream and downstream areas is constructed. The verification content specifically includes logical conflicts, null value dependencies, and threshold overlaps. The influence parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity, and water body lag time.

[0012] Furthermore, before the step of reading the preset device data points of the gate control device and parsing the variable format of the gate control device based on the device data points, the method further includes:

[0013] Based on the handshake request pre-initiated by the water conservancy terminal, the device identifier of the gate control device is obtained, wherein the device identifier specifically includes firmware version, communication capability and device address;

[0014] Determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal;

[0015] If so, the device protocol type of the gate control device is identified, and the pre-matched driver program of the water conservancy terminal is dynamically loaded according to the device protocol type to construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure, the driver program specifically includes driver activation, communication test and feedback confirmation, and the driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

[0016] Furthermore, the step of dynamically executing the control strategy pre-recorded by the water conservancy terminal based on the preset equipment functions of the gate control device also includes:

[0017] Based on the trigger type of the control strategy, the strategy trigger conditions of the device function are identified, wherein the trigger type specifically includes instruction trigger, linkage trigger, and timed trigger;

[0018] Determine whether the triggering condition of the strategy matches the triggering type;

[0019] If so, the current hydrological status data is collected through the water conservancy terminal as preset decision input information. Based on the collection cycle of the decision input information, the strategy scheduling thread of the gate control equipment is dynamically constructed. The hydrological status data specifically includes upstream water level, downstream water level, gate opening degree, equipment operating status, remote command value, rainfall and warning level.

[0020] Furthermore, the step of obtaining the verification content of the control strategy further includes:

[0021] Based on the internal structure of the control strategy, the integrity of the strategy fields of the control strategy is detected, wherein the internal structure of the strategy specifically includes a set of conditions, a set of actions, and data point references.

[0022] Determine whether the integrity of the policy field is missing;

[0023] If so, the preset dependency relationship of the control strategy is obtained, the preset linkage strategy of the control strategy is identified according to the dependency relationship, and the invalid command of the control strategy is checked from the gate control device according to the triggering state of the linkage strategy. The invalid command specifically includes the overriding strategy or the conflict strategy.

[0024] Furthermore, the step of determining whether the gate control device matches the preset protocol type also includes:

[0025] Collect the corresponding protocol raw data frame from the gate control device. The protocol raw data frame specifically includes message start and end characters, message length bytes, function code, check bit type, response time interval, and communication baud rate.

[0026] Determine whether the original data frame of the protocol matches the protocol feature fields, wherein the protocol feature fields specifically include the protocol frame header, address field, and data length;

[0027] If so, the corresponding byte order is extracted from the original protocol data frame. Based on the byte order, the data type of the original protocol data frame is divided. According to the data type, the decoded data of the original protocol data frame is parsed. Specifically, the data type includes 16-bit integer, 32-bit floating point and fractional offset. The decoded data specifically includes opening value, water level value and status word.

[0028] Furthermore, the step of determining whether the control strategy can be synchronized with the gate control device further includes:

[0029] Based on the real-time status information preset by the gate control device, the execution type of the control strategy is obtained. The real-time status information specifically includes communication status, current working mode, gate status and control authority ownership. The execution type specifically includes opening adjustment type, status control type and mode switching type.

[0030] Determine whether the real-time status information supports the execution type;

[0031] If so, the preset execution capability of the gate control device is identified, the upload frequency of the gate control device is collected according to the execution capability, the feedback cycle of the water conservancy terminal to the control strategy is constructed based on the upload frequency, the feedback cycle is compared with the preset strategy tolerance time, and the strategy feedback information of the gate control device is generated. The execution capability specifically includes execution confirmation frame, execution result data point and failure reason code.

[0032] Furthermore, the step of monitoring newly added logical ports based on the gateway edge computing node preset by the water conservancy terminal, and identifying the access gate control device through the logical ports, further includes:

[0033] Detect abnormal data injection into the logical port, wherein the abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes;

[0034] Determine whether the injected abnormal data exceeds a preset injection threshold;

[0035] If so, the connection between the water conservancy terminal and the gate control device is dynamically disconnected, the data feature packets of the gate control device are collected, and the injection behavior of the gate control device is detected based on the data feature packets. The data feature packets specifically include device identification code, encryption signature, manufacturer code and protocol version information, and the injection behavior specifically includes high-frequency injection of non-protocol data, repetitive frame flooding and spoofing communication attempts.

[0036] This invention also provides a smart gate access system based on drive recognition and data mapping, comprising:

[0037] The monitoring module is used to monitor newly added logical ports based on the gateway edge computing nodes preset in the water conservancy terminal, and to identify the access gate control devices through the logical ports;

[0038] The judgment module is used to determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols;

[0039] The execution module is used to read the preset device data points of the gate control device if the condition is met, parse the variable format of the gate control device according to the device data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset device function of the gate control device. Specifically, the device data points include water level, gate opening degree and fault status, and the variable format includes encoding method, variable structure type and register address mapping.

[0040] The second judgment module is used to determine whether the control strategy can be synchronized with the gate control device;

[0041] The second execution module is used to, if not, obtain the verification content of the control strategy, dynamically verify the execution behavior of the gate control device on the control strategy based on the simulation data pre-recorded by the water conservancy terminal, identify the impact parameters of the gate control device on the upstream and downstream areas according to the execution behavior, and construct the linkage relationship of the control strategy on the upstream and downstream areas based on the impact parameters. The verification content specifically includes logical conflicts, null value dependencies, and threshold overlaps, and the impact parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity, and water body lag time.

[0042] Furthermore, it also includes:

[0043] The acquisition module is used to acquire the device identifier of the gate control device based on the handshake request pre-initiated by the water conservancy terminal, wherein the device identifier specifically includes firmware version, communication capability and device address;

[0044] The third judgment module is used to determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal;

[0045] The third execution module is used to identify the device protocol type of the gate control device if the device protocol type is specified, dynamically load the pre-matched driver program of the water conservancy terminal according to the device protocol type, and construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure. The driver program specifically includes driver activation, communication test and feedback confirmation. The driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

[0046] Furthermore, the execution module also includes:

[0047] The identification unit is used to identify the policy triggering conditions of the device function based on the triggering type of the control policy, wherein the triggering type specifically includes instruction triggering, linkage triggering and timed triggering;

[0048] The judgment unit is used to determine whether the strategy triggering condition matches the triggering type;

[0049] The execution unit is used to collect current hydrological status data as preset decision input information through the water conservancy terminal if the condition is met, and dynamically construct the strategy scheduling thread of the gate control equipment according to the collection cycle of the decision input information. The hydrological status data specifically includes upstream water level, downstream water level, gate opening, equipment operating status, remote command value, rainfall and warning level.

[0050] This invention provides a smart gate access method and system based on drive recognition and data mapping, which has the following beneficial effects:

[0051] This invention achieves automatic identification and protocol adaptation of gate control equipment by embedding a gateway edge computing node in the water conservancy terminal. This avoids the cumbersome process of manually configuring communication channels and protocol drivers, effectively reducing manual intervention. After the equipment is connected, its variable format and equipment function can be parsed, and control strategies can be automatically matched and executed. If the strategy cannot be applied directly, dynamic verification and behavior analysis can be performed based on simulation data to further build the linkage relationship between the equipment and upstream and downstream areas. This mechanism enhances the adaptability of strategies and the universality of equipment, which helps to improve the intelligence level, operational reliability and automation capabilities of the gate control system. It is particularly suitable for smart water conservancy scenarios with large-scale heterogeneous equipment access and unified control. Attached Figure Description

[0052] Figure 1 This is a flowchart illustrating an embodiment of the intelligent gate access method based on driver recognition and data mapping of the present invention.

[0053] Figure 2 This is a structural block diagram of an embodiment of the intelligent gate access system based on drive recognition and data mapping of the present invention. Detailed Implementation

[0054] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The realization of the purpose, functional features, and advantages of the invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings.

[0055] 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 a part of the embodiments of the present invention, and not all of them. 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.

[0056] Reference Appendix Figure 1 The present invention provides a smart gate access method based on driver recognition and data mapping, comprising:

[0057] S1: Based on the gateway edge computing node preset by the water conservancy terminal, monitor the newly added logical port and identify the access gate control device through the logical port;

[0058] S2: Determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols;

[0059] S3: If so, then read the preset device data points of the gate control device, parse the variable format of the gate control device according to the device data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset device function of the gate control device. The device data points specifically include water level, gate opening degree and fault status, and the variable format specifically includes encoding method, variable structure type and register address mapping.

[0060] S4: Determine whether the control strategy can be synchronized with the gate control device;

[0061] S5: If not, obtain the verification content of the control strategy, dynamically verify the execution behavior of the gate control device on the control strategy based on the simulation data pre-recorded by the water conservancy terminal, identify the impact parameters of the gate control device on the upstream and downstream areas based on the execution behavior, and construct the linkage relationship of the control strategy on the upstream and downstream areas based on the impact parameters. The verification content specifically includes logical conflicts, null value dependencies and threshold overlaps, and the impact parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity and water body lag time.

[0062] In this embodiment, the system monitors newly added logical ports based on the pre-installed gateway edge computing nodes in the water conservancy terminal. It identifies accessing gate control devices through these logical ports and then determines whether these devices match a pre-defined protocol type to execute corresponding steps. For example, if the system determines that an accessing gate control device cannot match a pre-defined protocol type, it assumes that the communication protocol used by the device is not in the system's supported protocol template library. The system records a device access failure log, including the device's port information, initial message sample, and timestamp, marking the device as "to be identified" to avoid misjudging it as unauthorized access. Simultaneously, a fuzzy protocol parser is activated to attempt to extract field structures from the communication data, using pattern matching, etc. The system employs a "semi-automatic identification" method, using techniques such as protocol template similarity assessment. If automatic identification fails, the system prompts maintenance personnel to annotate basic device information and communication structure, supporting subsequent manual input of protocol field templates (such as register numbers and function codes) for unified platform management. For example, when the system determines that the access gate control device matches a pre-defined protocol type, it assumes the device's communication protocol is in the system's supported protocol template library. The system then reads the gate control device's pre-defined data points, specifically including water level, gate opening, and fault status. Based on these data points, the system parses the gate control device's variable format, which includes encoding methods, variable structure types, and register address mappings. The system dynamically executes pre-defined control strategies from pre-recorded control protocols on the water conservancy terminals. By automatically matching the communication protocols of the gate control devices, the system can quickly determine if the devices are within the supported range. Once a protocol match is successful, the system automatically reads the preset data point information, eliminating the need for tedious manual configuration of register addresses, function codes, and parsing formats. This mechanism significantly reduces manual intervention time, lowers the deployment and debugging threshold, and facilitates unmanned deployment in distributed water conservancy sites. Simultaneously, the system supports parsing variable formats for different device data points, including encoding methods (such as BCD, floating-point, integer), variable structure types (such as single registers, composite fields), and register address mappings. Through these mechanisms, the system possesses compatibility... The system can handle gate control equipment from the same manufacturer but different models, eliminating reliance on a single source of equipment. This enhances the overall system's adaptability and scalability, making it particularly suitable for the diverse equipment and brands found in water conservancy systems. Furthermore, based on analyzing equipment functions, the system can automatically execute preset control strategies in the water conservancy terminal, such as automatic gate opening and closing and coordinated regulation, based on real-time data like water level and gate opening. This strategy invocation is based on data-driven and function-recognition-based intelligent triggering, eliminating the need for manual setting of control logic paths. This improves real-time response and the accuracy of strategy execution, comprehensively enhancing the operational reliability and intelligent scheduling level of the water conservancy gate control system. The system then determines whether these control strategies can be synchronized with the gate control equipment to execute the corresponding steps.For example, when the system determines that these control strategies can synchronize with the gate control equipment, it assumes that the instruction set contained in the control strategy is consistent with the operation supported by the device's communication protocol, and there is no protocol conflict at the communication layer. The system will then establish a real-time data channel between the device and the control strategy internally, initiate continuous matching and monitoring of device data points and strategy logic conditions (such as real-time monitoring of whether the water level triggers the strategy threshold), and simultaneously convert the control instructions in the strategy (such as setting the opening degree and executing open / close gate) into corresponding protocol writing commands. These commands are then executed and distributed according to factors such as time priority and strategy weight, and a "Strategy-Device Binding Successful" message is written. This system facilitates later tracking, activates feedback mechanisms, and collects execution results in real time (such as gate opening changes and water level responses). For example, when the system determines that these control strategies cannot synchronize with the gate control equipment, it considers that the instruction set contained in the control strategy cannot be consistent with the operation supported by the equipment's communication protocol. The system will then obtain the verification content of these control strategies, specifically including logical conflicts, null value dependencies, and threshold overlaps. Based on the simulation data pre-collected by the water conservancy terminal, the system dynamically verifies the gate control equipment's execution behavior of the control strategy. According to different execution behaviors, it identifies the impact parameters of the gate control equipment on upstream and downstream areas. The system incorporates parameters such as water level change rate, water level response amplitude, discharge volume, flow velocity, and water body lag time. Based on these influencing parameters, a control strategy is constructed to link the upstream and downstream areas. When the control strategy instruction set is incompatible with the equipment protocol, the system does not simply report an error or terminate. Instead, it analyzes the verification content extracted from the strategy (such as logical conflicts, null dependencies, and threshold overlaps) to accurately identify key mismatch points. This prevents equipment failures or operational anomalies caused by erroneous instructions, thereby enhancing the system's fault tolerance and compatibility. Furthermore, by calling the simulation data built into the water conservancy terminal for strategy behavior verification, the system can dynamically simulate different... The system analyzes the execution effect of strategies on current equipment and their response behavior in actual operation. This "virtual execution + verification and evaluation" mechanism helps optimize strategy logic and improve the accuracy and feasibility of strategy deployment without the need for trial and error on real equipment. Furthermore, during strategy simulation, the system further identifies parameters affecting upstream and downstream areas (such as water level response amplitude and water body lag time), thereby constructing a linkage relationship between upstream and downstream areas. This not only enhances the global scheduling capability of the strategy but also provides data support for intelligent decision-making under complex operating conditions, contributing to improved overall collaborative efficiency and operational stability of the water conservancy system.

[0063] It should be noted that the system reads the preset device data points of the gate control device, parses the variable format of the gate control device based on the device data points, and dynamically executes the control strategy pre-recorded by the water conservancy terminal according to the preset device functions of the gate control device. A specific example is as follows:

[0064] Suppose a remotely controlled sluice gate device is deployed in a smart water conservancy project. This device, provided by a certain manufacturer, supports Modbus-TCP protocol communication and connects to the water conservancy terminal through an edge gateway. The system has included multiple automatic control strategies to automatically adjust the gate status based on real-time water level and opening degree. The device's data points are shown in Table 1 below.

[0065] Table 1:

[0066] Data point name Register address Data type Byte order Description Upstream water level 40001~40002 FLOAT32 Little endian Current upstream water level (unit: m) Gate opening 40003 UINT16 Single byte Current gate opening (0~100%) Fault status 40004 BIT8 - 0 = normal, 1 = communication failure Control command 40010 UINT16 - Control instruction code (see Table 2)

[0067] The control commands are described in Table 2 below.

[0068] Table 2:

[0069] Instruction code Instruction meaning 0 Stop control 1 Full open 2 Full close 3 Set target opening

[0070] The target opening degree is written to register 40011. The logic of a certain control strategy recorded in the system is as follows:

[0071] If the upstream water level is >4.5m and the current opening is >80%, then set the target opening to 60% and issue the "Set Target Opening" control command.

[0072] 1. First, the system reads the device data points by initiating a Modbus read command to the gate control device through the gateway:

[0073] Read Holding Registers:

[0074] -Address 40001~40002 (upstream water level);

[0075] -Address 40003 (Opening);

[0076] -Address 40004 (fault status);

[0077] The reading results are as follows:

[0078] 40001~40002: Register value is 0xCDCC 0x4489 → interpreted as upstream water level = 4.8m (FLOAT32, little-endian format);

[0079] 40003: Register value 90 → Opening degree = 90%;

[0080] 40004: Register value 0x00 → No fault;

[0081] 2. Parse variable format: The system parses field formats according to the device model configuration.

[0082] The upstream water level is a 2-byte floating-point value, which needs to be concatenated in little-endian format and then converted to floating-point type.

[0083] The openness is a 16-bit unsigned integer, which can be used directly;

[0084] The fault status is 1 byte, determined by bit flags;

[0085] The system concludes that: upstream water level = 4.8m, opening degree = 90%, and the equipment is normal;

[0086] 3. Match the control strategy logic and determine whether the conditions are met:

[0087] 4.8m > 4.5m;

[0088] 90% > 80%;

[0089] The strategy is triggered, and the execution process begins.

[0090] 4. Generate control commands. The operation specified by the control strategy is as follows:

[0091] Set the target opening degree to 60%;

[0092] Control command code = 3 (Set target opening);

[0093] The system issued the following instructions:

[0094] Write the value 60 (representing 60% opening) to register 40011.

[0095] Write the value 3 (trigger control instruction code) to register 40010.

[0096] The write operation will be completed via Modbus write to multiple registers command;

[0097] 5. Status feedback and verification: After a few seconds, the system will automatically re-read the status.

[0098] Current opening value (40003);

[0099] Upstream water level (40001~40002);

[0100] If the reading feedback shows that the opening value has changed to 60 and the water level is trending downward, the system determines that the strategy is successful. If there is no change in the feedback or the opening is still 90%, the system will try to retry, issue an alarm, or prompt manual intervention.

[0101] In summary, the examples above fully demonstrate the following points: the accuracy of data point reading and variable format parsing is crucial for subsequent control; dynamic matching of strategy logic and instruction execution mechanisms enhance automatic response capabilities; and system feedback mechanisms and closed-loop verification ensure effective, reliable, and safe control.

[0102] It should be added that the verification content of the control strategy is obtained, and the execution behavior of the gate control device on the control strategy is dynamically verified based on the simulation data pre-recorded by the water conservancy terminal. According to the execution behavior, the impact parameters of the gate control device on the upstream and downstream areas are identified. Based on the impact parameters, the linkage relationship of the control strategy on the upstream and downstream areas is constructed. A specific example is as follows:

[0103] Suppose that a smart water conservancy system has intelligent gate control devices GZ-102 (upstream sluice gate) and GZ-205 (downstream control gate) deployed in a certain area, and the system has a preset control strategy:

[0104] Strategy C1: When the upstream water level monitored by GZ-102 is >4.7 meters and the current gate opening is >85%, the gate opening will be adjusted to 60% to alleviate the upward trend of the upstream water level. However, when this strategy is synchronized to the GZ-102 device, it cannot be executed directly due to incompatibility of some instructions. The system initiates the strategy verification and simulation verification process.

[0105] The first step is to obtain the verification content of the control policy. The system extracts the verification elements from policy C1, as shown in Table 3 below.

[0106] Table 3:

[0107] Check item Check content Result Logical conflict Are the conditions self-contradictory (e.g. require >4.5m and <4.3m at the same time) No Null value dependency Whether the strategy depends on variable items that do not exist in the device No Threshold overlap Whether there is a control target or time overlap with other strategies There is a slight overlap, and the system prompts "risk acceptable"

[0108] After verification, the system will indicate that the strategy structure is reasonable, but direct synchronization is not supported, and the simulation verification stage is required.

[0109] The second step is to load simulation data for strategy verification. The system calls historical simulation data pre-recorded in the water conservancy terminal (from the flood season in July 2023). The simulation data mainly includes:

[0110] The upstream water level is recorded every 10 minutes, ranging from 4.2m to 5.0m.

[0111] Historical range of gate opening variation: 70%–100%;

[0112] Control response time: 30s~2min;

[0113] Downstream water level and flow velocity response data;

[0114] The simulated execution replay (capturing 3 typical time points) is shown in Table 4 below.

[0115] Table 4:

[0116] Time point Upstream water level Current opening Whether the strategy is triggered Simulated target opening Execution behavior T1=7:40 4.75m 90% Yes 60% Gate simulation starts slow closing T2=8:10 4.82m 95% Yes 60% Gate simulation fast closing T3=9:00 4.60m 88% No - Not triggered

[0117] The third step is to analyze the impact of simulated execution behavior on upstream and downstream processes. Based on the simulation data, the system automatically generates execution response curves and extracts the following influencing parameters, as shown in Table 5 below.

[0118] Table 5:

[0119] Time point Gate adjustment time Upstream water level change rate Downstream water level response Discharge flow change Water body lag time T1 90s -0.12 m / h +0.08m +22 m³ / s 12 minutes T2 70s -0.18 m / h +0.14m +35 m³ / s 15 minutes

[0120] Note: After the gate is opened from 90% to 60%, the upstream water level drops significantly, while the downstream water level rises due to the change in flow rate. There is a response lag of 10 to 15 minutes. High-frequency closing will create a short-term flow shock downstream, which may affect the operation of agricultural canals or other supporting equipment.

[0121] The fourth step is to establish upstream and downstream linkages. Based on the response parameters mentioned above, the system automatically constructs the following linkage diagram:

[0122] Strategy C1 → Control device GZ-102 → Upstream water level drops, flood discharge increases → Downstream water level rises, lags by about 12 to 15 minutes → It is recommended that the linkage device GZ-205 make a 5% slow opening adjustment → To avoid sudden flood peaks, the system will prompt that this strategy is recommended to be synchronized with the downstream control plan and incorporated into the basin collaborative linkage framework.

[0123] In summary, the above examples demonstrate that the strategy execution and actual effectiveness are ensured through a strategy verification and simulation validation mechanism. Simulated behavior identifies the real impact of control actions on the environment, avoiding "blind control." By constructing a linkage graph through influence parameters, decision support is provided for upstream and downstream scheduling coordination, significantly improving the automation level, response efficiency, and system security of the entire smart water conservancy system.

[0124] Regarding control strategies, the relevant strategies are as follows:

[0125] 1. Strategies based on water level changes

[0126] High water level → close the gate;

[0127] Triggering condition: The upstream water level exceeds the preset safety threshold (e.g., 4.5 meters);

[0128] Control action: Gradually close the gate to prevent the water level from rising further;

[0129] Low water level → Open the gate;

[0130] Triggering condition: The downstream water level is lower than the minimum water level line (e.g., 1.2 meters).

[0131] Control action: Open the gate to increase downstream water flow and ensure irrigation water supply;

[0132] Abnormally rapid change in water level → alarm and flow restriction;

[0133] Triggering condition: The rate of change of water level exceeds the set threshold (e.g., a rise or fall of more than 0.3 meters per hour).

[0134] Control actions: Automatically triggers early warning and adjusts the gate opening to reduce water flow fluctuations;

[0135] 2. Time- and remote command-based strategies.

[0136] Remote command → Adjust opening degree;

[0137] Triggering condition: Receiving a specific opening adjustment command from the remote control center;

[0138] Control action: Adjust the gate to the specified opening degree and provide feedback on the execution status;

[0139] Timed gate opening / closing;

[0140] Triggering conditions: preset time points or time periods (e.g., opening the gate at 6:00 AM and closing the gate at 9:00 PM daily);

[0141] Control actions: Automatically execute corresponding gate actions on time to ensure irrigation or flood control scheduling;

[0142] 3. Strategies based on equipment status and faults;

[0143] Equipment failure → Automatic switching to backup gate;

[0144] Triggering condition: The main gate control equipment detects a fault signal;

[0145] Control action: Immediately activate the backup gate to ensure uninterrupted water flow control;

[0146] Sensor malfunction → Gate locking action activated, alarm notification triggered;

[0147] Triggering condition: Abnormal data from critical sensors (e.g., no data from the water level sensor for an extended period of time);

[0148] Control action: Prohibit gate operation to prevent misoperation, and send an alarm to notify maintenance personnel;

[0149] 4. Multi-device linkage strategy

[0150] Reduce the opening of the upstream gate → adjust the downstream gate accordingly;

[0151] Triggering condition: The opening of the upstream gate decreases by more than 10%;

[0152] Control action: The downstream gate dynamically adjusts its opening according to changes in water flow to achieve flow balance;

[0153] Reservoir releases water → downstream gates open in response;

[0154] Triggering condition: The reservoir dispatch center initiates water release operations;

[0155] Control actions: The downstream gates open synchronously to ensure smooth flood discharge and prevent blockage;

[0156] 5. Safety and environmental protection strategies: low-flow mode at night.

[0157] Triggering conditions: Specific time period at night (e.g., 23:00 to 5:00);

[0158] Control actions: Maintain the gate opening at the minimum level to ensure ecological flow, thereby reducing energy consumption and ecological impact;

[0159] Flood peak warning → Early and gradual closure of floodgates;

[0160] Triggering condition: Weather forecasts or upstream sensor data indicate the arrival of the flood peak;

[0161] Control measures: Close some gates in advance to reduce the peak flow and protect downstream safety.

[0162] In this embodiment, before step S3 of reading the preset device data points of the gate control device and parsing the variable format of the gate control device based on the device data points, the method further includes:

[0163] S301: Based on the handshake request pre-initiated by the water conservancy terminal, obtain the device identifier of the gate control device, wherein the device identifier specifically includes firmware version, communication capability and device address;

[0164] S302: Determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal;

[0165] S303: If yes, then identify the device protocol type of the gate control device, dynamically load the pre-matched driver program of the water conservancy terminal according to the device protocol type, and construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure. The driver program specifically includes driver activation, communication test and feedback confirmation. The driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

[0166] In this embodiment, the system obtains the device identifier of the gate control device based on the handshake request initiated in advance by the water conservancy terminal. The device identifier specifically includes firmware version, communication capability, and device address. Then, the system determines whether the device identifier of the gate control device matches the manufacturer number pre-set by the water conservancy terminal to execute the corresponding steps. For example, when the system determines that the device identifier of the gate control device cannot match the manufacturer number pre-set by the water conservancy terminal, the system will assume that devices from different manufacturers often use proprietary communication protocols, register mapping methods, or data formats. If they do not match, the system will not be able to correctly parse its data or issue instructions. The system will set the device to an "unauthenticated" or "pending approval" state, suspend the automatic control strategy synchronization and data acquisition operations to avoid false triggering, and simultaneously activate the authentication mechanism of the water conservancy terminal to attempt to read the device's digital signature, certificate, or manufacturer-defined verification field. If the device... Supports online verification and can be linked to the central platform for manufacturer authentication. The system can also call the "general driver compatibility mode" to attempt to parse the device according to known standard protocols (such as Modbus, IEC104). If the parsing is successful, it is marked as "partially compatible" and continues to run some functions (such as read-only data, control disabled). For example, when the system determines that the device identifier of the gate control device can match the manufacturer number pre-set in the water conservancy terminal, the system will consider that it can issue instructions or parse data to the gate control device. The system will identify the device protocol type of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure. According to different device protocol types, the system dynamically loads the driver pre-matched in the water conservancy terminal and constructs the driver parameters of the gate control device. The driver parameters specifically include data reading instruction structure, register offset rules and data point mapping information.Based on the identification results, the system can automatically parse the communication protocol type of the device (such as register range, baud rate, and command structure), thus eliminating the need for manual input of protocol parameters. Compared to the traditional method of relying on PLCs or engineers to configure registers, this automatic identification mechanism significantly improves the device's online speed and adapts to the actual needs of parallel deployment of multiple devices and multiple vendors. Simultaneously, based on the identified device protocol type, the system dynamically loads the preset driver template in the water conservancy terminal and constructs the driver parameters required for communication with the device, including data reading instruction structure, register offset rules, and data point mapping information. In this way, the system can accurately read key parameters such as water level, opening degree, and fault status. The system maps parameters to standardized data structures to ensure effective transmission and response of control commands, avoiding control failures or false triggers due to register misalignment or command incompatibility. Through this identification, adaptation, and driver construction process, the system establishes a standardized and modular device access mechanism. This mechanism not only supports automatic access and management of current devices but also provides a unified template for plug-and-play functionality of subsequently added devices. The standardized data structures and control interfaces also provide a solid data foundation and execution channel for the system to achieve more advanced functions (such as strategy linkage, anomaly analysis, and hydrological prediction), fundamentally improving the intelligence level and sustainable scalability of the entire water conservancy automation system.

[0167] It should be noted that the device protocol type of the gate control device is identified, and the pre-matched driver program of the water conservancy terminal is dynamically loaded according to the device protocol type to construct the driver parameters of the gate control device. A specific example is as follows:

[0168] Assuming the device information is as follows:

[0169] Equipment Name: XG-WATER-3000 Intelligent Water Gate Controller;

[0170] Manufacturer ID: XG (already in the system's water conservancy terminal whitelist);

[0171] Access method: RS485 serial port;

[0172] Protocol type: Modbus RTU;

[0173] Baud rate: 9600;

[0174] Data format: 8N1 ​​(8-bit data, no parity, 1 stop bit);

[0175] Step 1: Identify the device protocol type. The system reads the basic information returned by the device through the handshake request initiated by the water conservancy terminal.

[0176] Firmware version: v3.2.5;

[0177] Device address: 0x07;

[0178] Communication protocol declaration: Modbus RTU, function codes 0x03 (read) and 0x06 (write);

[0179] The system thus identified the protocol type as Modbus RTU, the communication rate as 9600bps, and confirmed that the device protocol already had a corresponding template in the terminal driver library.

[0180] Step two: Dynamically load the driver. The system automatically loads the driver from the water terminal driver library based on the manufacturer number "XG" and the protocol type "Modbus RTU".

[0181] Driver template name: XG_Modbus_Template_V1.4;

[0182] The driver content includes,

[0183] Communication initialization sequence (including device activation steps);

[0184] Byte order rules (big-endian format);

[0185] Control command structure definition;

[0186] The mapping relationship between standard variable names and registers;

[0187] At this point, the system does not require engineers to manually configure any register addresses or baud rates; all content is automatically populated by the driver template.

[0188] Step 3: Construct driver parameters. After loading the driver, the system automatically generates the following driver parameter structure, as shown in Table 6 below.

[0189] Table 6:

[0190] Variable name Register address Data type Meaning description Unit Water_Level_Down 0x0001 Uint16 Current downstream water level cm Gate_Open_Percent 0x0002 Uint8 Current gate opening percentage % Device_Health_Code 0x0003 Uint16 Current device health status code - Manual_Override 0x0005 Bool Whether manual control is activated -

[0191] And define the corresponding read / write operation commands:

[0192] Read status instructions: 0x03 0x0001 0x0004 (read 4 registers consecutively from address 0x0001);

[0193] Control gate opening command: Write the target opening to 0x0002 (e.g., 0x06 0x0002 0x0050 means set to 80%), and write the confirmation bit to 0x0006 to trigger the action (value is 0x0001);

[0194] The actual running example is as follows:

[0195] Scenario: The remote control platform wants to increase the opening of the sluice gate from the current 30% to 80%.

[0196] The system call controls defined in the driver parameters are packaged as follows:

[0197] Write the target opening instruction: 0x06 0x0002 0x0050 (0x0050 = decimal 80);

[0198] Confirmation command written: 0x06 0x0006 0x0001;

[0199] The control platform sends the above two commands, and the device responds with confirmation;

[0200] The system then executes the status readback command: 0x03 0x0002 0x0001, reads the current gate opening value, confirms whether the change is complete, and finally logs the control success event and synchronizes the status data to the central control platform in real time.

[0201] In summary, the examples above demonstrate that no manual configuration of registers or function codes is required, significantly reducing deployment costs. They automatically adapt to device characteristics, avoiding communication failures caused by protocol incompatibility. Furthermore, the standardized data structure allows control strategies to be reused across devices, making maintenance easy. Additionally, the high decoupling between drivers and instructions facilitates future OTA upgrades or multi-vendor expansion.

[0202] In this embodiment, step S3, which dynamically executes the control strategy pre-recorded by the water conservancy terminal based on the preset equipment functions of the gate control device, further includes:

[0203] S31: Based on the trigger type of the control strategy, identify the strategy trigger conditions of the device function, wherein the trigger type specifically includes instruction trigger, linkage trigger, and timed trigger;

[0204] S32: Determine whether the triggering condition of the strategy matches the triggering type;

[0205] S33: If so, the current hydrological status data is collected through the water conservancy terminal as preset decision input information. Based on the collection cycle of the decision input information, the strategy scheduling thread of the gate control equipment is dynamically constructed. The hydrological status data specifically includes upstream water level, downstream water level, gate opening, equipment operating status, remote command value, rainfall, and warning level.

[0206] In this embodiment, the system identifies the policy triggering conditions of the device function based on the triggering type of the control strategy, specifically including command triggering, linkage triggering, and timed triggering. The system then determines whether the policy triggering conditions of the device function match the triggering type of the control strategy to execute the corresponding steps. For example, if the system determines that the policy triggering conditions of the device function cannot match the triggering type of the control strategy, the system will consider that the current gate control device cannot correctly respond to or cooperate with the expected execution mode of the control strategy, which may lead to the control strategy becoming invalid, ignored, or triggered incorrectly. The system will immediately stop the automatic synchronization of the strategy with the device to prevent the issuance of invalid strategies from causing the device to refuse, report errors, or freeze control. Simultaneously, if the device supports "command triggering," the system... The system can be converted to a system where control commands are periodically issued by the platform or manually, or downgraded to "timed triggering." This simplifies the control logic by setting up scheduled tasks and records policy mismatch information, including the control policy ID and name, the device number and function type to be bound, and the reason for failure (e.g., "lack of event listening capability," "no support for linkage response"). For example, when the system determines that the policy triggering conditions of the device function match the triggering type of the control policy, the system assumes that the current gate control device can correctly cooperate with the control policy. The system will then collect current hydrological status data through the water conservancy terminal as pre-set decision input information. Specific hydrological status data includes upstream water level, downstream water level, gate opening, equipment operating status, and remote commands. Based on the data collection cycle of the gate control equipment, including values, rainfall, and warning levels, the system dynamically constructs a strategy scheduling thread. When the system determines that the triggering conditions of the equipment function match the triggering type of the control strategy, it indicates that the current control logic will not be interrupted due to protocol deficiencies or insufficient capabilities. The equipment can accurately respond to strategy requirements such as linkage triggering, timed triggering, or command triggering, thus avoiding the problem of unresponsive or failed strategy issuance from the source. This mechanism ensures that the control strategy "can be issued, recognized, and executed." Simultaneously, by collecting key hydrological status data (such as upstream and downstream water levels, rainfall, and gate opening) in real time through water conservancy terminals, the system obtains complete and continuous decision-making basis. This data, as input to the control strategy, can not only trigger... A single action can form a logical judgment chain to achieve "predictive scheduling" and "situational response," such as "early warning level + sudden increase in rainfall → advance pre-discharge" or "high downstream water level + gate already open → stop further opening." This improves the accuracy and intelligence of the system response. Furthermore, based on the data acquisition cycle of different decision inputs (such as rainfall every 1 minute, remote commands every 5 seconds, and equipment status every 10 seconds), computing resources are dynamically allocated to build a lightweight strategy scheduling thread. This enables asynchronous parallel scheduling of various control strategies. This thread-level strategy management method not only improves the system's processing efficiency but also supports the collaborative control and distributed management of large-scale multi-gate equipment, providing a fundamental support for the scalability, low latency, and high availability of smart water conservancy systems.

[0207] It should be noted that the current hydrological status data is collected through the water conservancy terminal as preset decision input information. Based on the collection cycle of the decision input information, the strategy scheduling thread of the gate control equipment is dynamically constructed. A specific example is as follows:

[0208] Suppose that an irrigation district has deployed multiple automated sluice gates, each equipped with RTUs, upstream / downstream water level gauges, rainfall sensors, cameras, and other equipment, all connected to a unified water conservancy terminal; the water conservancy terminal is responsible for receiving data, executing control strategies, and performing threaded scheduling of scheduling tasks.

[0209] Example 1,

[0210] Control strategy name: High water level early warning and advance flood discharge strategy;

[0211] Strategy type: Linkage trigger;

[0212] Control rules,

[0213] If the upstream water level is ≥220cm;

[0214] And the current rainfall is ≥10mm (cumulative in the last hour);

[0215] If the current gate opening is ≤20%, then adjust the gate opening to 50% to slow down the rising water level.

[0216] Decision input data points,

[0217] Upstream water level (Up_Level): Collected every 5 minutes;

[0218] Rainfall (Rain_1h): Collected cumulatively every minute and refreshed in real time;

[0219] Gate opening percentage (Gate_Open_Percent): Collected every 2 minutes;

[0220] System behavior,

[0221] The system identifies the trigger strategy as "linkage trigger";

[0222] System build strategy thread Thread_LeakageStrategy_HighLevelRainfall;

[0223] This thread includes: monitoring changes in rainfall data and updating the status; checking every 5 minutes whether the water level, rainfall, and gate opening meet the trigger conditions; if they do, automatically sending Modbus commands to control the gate to adjust its opening; and upon success, logging, triggering the camera to take a picture, and reporting to the dispatch platform.

[0224] Example 2,

[0225] Control strategy name: Remote manual command gate shutdown;

[0226] Strategy type: Remote command triggered;

[0227] Control rules,

[0228] If the central control platform sends an "emergency shutdown" command, immediately adjust the opening to 0%;

[0229] Decision input data points,

[0230] Remote command value (Remote_Command): Event-triggered, does not rely on periodic data collection;

[0231] System behavior,

[0232] The system identified it as a "remotely triggered" strategy;

[0233] Construct a Thread_RemoteCommandListener; this thread is a resident listener thread that listens for MQTT command channels or platform API interfaces; once it receives an "emergency shutdown" command:

[0234] Parse command parameters,

[0235] Construct a gate closing instruction (write the opening degree to 0%).

[0236] Send to the corresponding gate control device;

[0237] Update the execution status and return the result;

[0238] Example 3,

[0239] Control strategy name: Timed daily drainage strategy;

[0240] Strategy type: Timed trigger;

[0241] Control rules,

[0242] The gates automatically open to 40% capacity at 6:00 AM and 6:00 PM every day.

[0243] The drainage will automatically shut off after 45 minutes.

[0244] Decision input data points: No real-time sensor dependency, based solely on the system clock;

[0245] System behavior,

[0246] The system identified it as a "timed trigger" strategy;

[0247] Create a timed scheduling thread named Thread_DailyDrainSchedule;

[0248] Internally, the thread defines 06:00 and 18:00 daily as trigger points; upon these times, it sends a "set opening degree to 40%" command; a timer is started and counts for 45 minutes; at the end of the timer, a "set opening degree to 0%" command (closing the gate) is sent; the device feedback status is synchronized, and the control log is pushed to the management platform, as shown in Table 7 below.

[0249] Table 7:

[0250] Item Content example Control strategy name High water level pre-discharge, remote gate closing, timed drainage Trigger type Linkage, instruction, timing Required input data points Water level, rainfall, remote instruction, system time Input data acquisition period Every 1 minute / 2 minutes / 5 minutes / event listening Scheduling thread name Thread_xxx (generate independent thread for each strategy) Execution content Determine whether the trigger condition is met → issue control instruction → record feedback

[0251] In summary, the above examples demonstrate how a system can save resources by tightly coupling strategies with data acquisition rhythm. Each strategy is executed only during the required period, without occupying unnecessary threads, thus improving overall system performance and achieving timely and intelligent strategy response. It can achieve millisecond-level control in response to sudden increases in rainfall or remote emergency commands, meeting the requirements of flood season scheduling. It supports parallel strategy threads and is adaptable to large-scale equipment deployments. Even with dozens of gate control devices and hundreds of strategies, the system can automatically schedule each thread according to the data cycle without requiring manual adjustment.

[0252] In this embodiment, step S5, which involves obtaining the verification content of the control strategy, further includes:

[0253] S51: Based on the internal structure of the control strategy preset, detect the integrity of the strategy fields of the control strategy, wherein the internal structure of the strategy specifically includes a set of conditions, a set of actions, and data point references;

[0254] S52: Determine whether the integrity of the strategy field is missing;

[0255] S53: If so, obtain the preset dependency relationship of the control strategy, identify the preset linkage strategy of the control strategy according to the dependency relationship, and check the invalid command of the control strategy from the gate control device according to the triggering state of the linkage strategy. The invalid command specifically includes the overriding strategy or the conflict strategy.

[0256] In this embodiment, the system, based on the pre-defined internal structure of the control strategy (which specifically includes a set of conditions, a set of actions, and data point references), checks the integrity of the strategy fields of these control strategies. The system then determines whether any strategy fields are missing in order to execute the corresponding steps. For example, if the system determines that the strategy fields of a control strategy are not missing, it considers the current control strategy to have complete and valid execution conditions and operation definitions, and can be securely loaded and issued to the corresponding gate control device for execution. The system marks the strategy as "executable," loads it into the strategy scheduling thread of the corresponding device, waits for a scheduling cycle or event trigger, and simultaneously establishes a state context for the strategy. This includes whether the system is currently active, whether current conditions are met, the last execution time and result, and, based on the trigger type of the strategy (such as timed, linked, or command), starting a listening thread (for remote command triggering), starting a timed check task (for timed or periodic judgment), and registering linked sensor events (such as water level or rainfall changes). For example, when the system determines that the completeness of the control strategy's strategy fields is missing, the system will consider that the current control strategy does not have complete and legal execution conditions. The system will obtain the pre-set dependencies of these control strategies, identify the pre-set linked strategies of the control strategy based on different dependencies, and, based on the trigger status of these linked strategies, trigger the gate control... The system checks for invalid commands in the control strategy, specifically including overriding or conflicting strategies. When the system detects a missing field in a control strategy (e.g., missing trigger conditions, reference to invalid data points, or no configured action instructions), it will not execute blindly but will proactively mark the strategy as "unexecutable," suspending its automatic scheduling. This avoids risks such as equipment malfunction, sluice gate malfunction, or water waste caused by erroneous strategy issuance. Simultaneously, it obtains the preset dependencies in the control strategy (e.g., the trigger status or execution result of strategy B depending on strategy A), allowing it to locate the linkage structure between this strategy and other strategies. When a field is missing, the system determines the relationship by searching for its "linkage strategy." The system checks whether there are already effective overriding policies (with higher priority) or conflicting policies (with contradictory execution results). It further clarifies whether the current policy has been "structurally abandoned" due to logical conflicts. This mechanism effectively prevents policies from repeatedly controlling the same device or causing state disorder due to contradictory conditions. After identifying the linkage policy, the system enters the gate control device's instruction cache or the current execution channel to check whether there are invalid control commands derived from the current invalid policy, such as instructions issued without being triggered or duplicate commands that conflict with other policies. The recycling, cancellation, or alarm prompts for these "invalid commands" help ensure the clarity and uniqueness of the device control instruction chain and improve the data closure and execution transparency of the policy scheduling system.

[0257] It should be noted that the process involves obtaining the preset dependencies of the control strategy, identifying the preset linkage strategies based on these dependencies, and checking for invalid commands of the control strategy from the gate control device based on the triggering state of the linkage strategies. A specific example is as follows:

[0258] The example scenario is that the upstream flood discharge and downstream water replenishment of a mountain reservoir need to be controlled in a coordinated manner.

[0259] I. System Background:

[0260] Equipment Name: Gate No. 3 (Main Control Object);

[0261] Gate control equipment type: RTU control unit + water level sensor + camera monitoring;

[0262] Reservoir structure:

[0263] The upstream area is mainly a reservoir area, which is prone to water accumulation;

[0264] The downstream section is an agricultural irrigation canal, requiring water to be supplied only as needed.

[0265] Objective: To prioritize flood discharge during floods and automatically replenish water downstream when there is no danger;

[0266] II. Strategy Definition and Dependency Structure:

[0267] Strategy A: Flood control and discharge strategy (No.: ST-A01);

[0268] Triggering conditions: Upstream water level ≥ 250 cm and weather is heavy rain;

[0269] Action: Close gate No. 3 to 20% opening (to control leakage);

[0270] Priority: High;

[0271] Current status: Executed;

[0272] Strategy B: Conventional agricultural irrigation supplementation strategy (No.: ST-B05);

[0273] Triggering conditions: Downstream water level ≤ 140 cm and air temperature ≥ 30℃;

[0274] Action: Open gate No. 3 to 60% opening;

[0275] Priority: Medium;

[0276] Dependency: It must be ensured that "Policy A is not executed" (logical mutual exclusion);

[0277] Current field issue: Undefined temperature data point reference → Field missing;

[0278] III. Example of system processing:

[0279] Strategy B failed to load (field missing). The system found that the temperature field referenced by Strategy B was not configured (e.g., no temperature sensor was bound), and the field integrity check failed. The system marked Strategy B as "incomplete configuration".

[0280] The system obtains the dependencies of strategy B and identifies the preset dependency structure of strategy B: its execution condition is "strategy A is not executed", that is, strategy B cannot be effective at the same time as strategy A.

[0281] The system identifies the status of the linkage strategy and checks the current status of strategy A. It finds that strategy A was successfully triggered at 9:45 a.m., controlling gate No. 3 to a 20% opening.

[0282] Checking the equipment command log revealed an invalid command. The system read the control command buffer of gate 3 via the RTU and found that strategy B was manually triggered by the administrator at 10:00 today, generating the following control command:

[0283] Command ID:CMD-B05-1000

[0284] Content: Set opening degree to 60%

[0285] Source strategy: ST-B05 Issuance time: 10:00

[0286] Current status: Pending execution (not triggered due to scheduling delay or dependencies);

[0287] The system detected that the command violated dependency logic (policy A has been executed), and the source policy field was missing → it was determined to be an "invalid command";

[0288] The system's handling measure is to mark command CMD-B05-1000 as an "invalid command" and notify the operations and maintenance system to record the exception log.

[0289] [Exception] Command CMD-B05-1000 was detected to violate the policy dependency structure and has been revoked;

[0290] Strategy ST-B05 has incomplete fields, missing temperature data point bindings;

[0291] Cancel the command from the execution queue;

[0292] If an automatic error correction mechanism is configured, it can also prompt maintenance personnel to bind "temperature sensor T-SZ1" to strategy B;

[0293] In summary, in the examples above, the system can prevent improper equipment operation caused by missing policy fields or incorrect dependencies (such as reverse gate opening during flood discharge). At the same time, the entire process of command logging, dependency relationships, and conflict identification is traceable, and the priority logic and execution boundaries between multiple policies are clear and unambiguous. It can automatically clear, remind, record, and analyze invalid control commands.

[0294] In this embodiment, step S2, which determines whether the gate control device matches a preset protocol type, further includes:

[0295] S21: Collect the corresponding protocol raw data frame from the gate control device, wherein the protocol raw data frame specifically includes message start and end characters, message length bytes, function code, check bit type, response time interval, and communication baud rate;

[0296] S22: Determine whether the original data frame of the protocol matches the protocol feature field, wherein the protocol feature field specifically includes the protocol frame header, address field and data length;

[0297] S23: If so, extract the corresponding byte order from the original protocol data frame, classify the data type of the original protocol data frame based on the byte order, and parse the decoded data of the original protocol data frame according to the data type. The data type specifically includes 16-bit integer, 32-bit floating point and fractional offset, and the decoded data specifically includes opening value, water level value and status word.

[0298] In this embodiment, the system collects the corresponding protocol raw data frames from the gate control device. The protocol raw data frames specifically include message start and end characters, message length bytes, function code, checksum type, response time interval, and communication baud rate. Then, it determines whether these protocol raw data frames match protocol feature fields. Protocol feature fields specifically include the protocol frame header, address field, and data length, in order to execute corresponding steps. For example, when the system determines that these protocol raw data frames cannot match the protocol feature fields, the system will consider that the current gate control device's communication data structure does not conform to the standard protocol template supported by the system, or that the device has communication anomalies, configuration errors, or unknown protocol types. The system cannot correctly parse its data content and instruction behavior, and will cache the failed data frames, including timestamps, message hexadecimal content, and source device address, for subsequent manual protocol reverse engineering or vendor protocol comparison. Simultaneously, it attempts to compare with the built-in "protocol fallback library," such as earlier... For Modbus / RTU variants and older manufacturer protocols, if some fields can be initially matched, such as identical frame headers but mismatched data segments, the system can enter a "semi-automatic protocol calibration mode" and notify maintenance personnel that the device has an unknown or incompatible protocol. A data frame reference template is provided for manufacturer feedback or new template input. The system supports marking the current device as a "device to be adapted," skipping automatic parsing but allowing manual input of key data points. For example, when the system determines that these protocol raw data frames can match protocol feature fields, the system considers the current gate control device's communication data structure to conform to the system's supported standard protocol template. The system extracts the corresponding byte order from the protocol raw data frames and, based on these byte orders, classifies the data types of the protocol raw data frames. Specific data types include 16-bit integers, 32-bit floating-point numbers, and fractional offsets. According to different data types, the system parses the decoded data of the protocol raw data frames. The decoded data specifically includes opening value, water level value, and status word.The system can accurately identify and match key feature fields (such as frame header, address field, data length, etc.) in the original data frames of the gate control device's protocol. This means that the communication protocol used by the device is consistent with the standard template library supported by the system. Based on this matching process, the system can automatically identify the device's data structure and complete device access without manual configuration of communication templates. This function effectively breaks down the barriers of protocol format differences between different manufacturers' devices, greatly improving the system's adaptation speed and access efficiency when facing multiple brands and models of devices. At the same time, by extracting byte order and parsing data types (such as 16-bit integer, 32-bit floating-point, decimal offset, etc.) from the original protocol data frames, the system can accurately restore the data content transmitted by the device, such as accurately decoding the open circuit. Key data points such as opening degree, water level, and status words facilitate refined monitoring during water conservancy scheduling, preventing data distortion caused by human error or protocol differences. This ensures the consistency and reliability of hydrological data across various analysis and control scenarios. Furthermore, successfully acquired and decoded key data points directly participate in the triggering and decision-making processes of control strategies. For example, the system can determine whether to trigger gate operation based on real-time opening degree or water level values, or activate safety mechanisms based on alarm bits in status words. This automatically driven control logic, based on decoded data, significantly enhances the system's intelligent response capabilities, enabling the gate control system to quickly and autonomously make precise controls in emergency situations, thereby improving the reliability and operational efficiency of the overall water conservancy automation system.

[0299] In this embodiment, step S4, which determines whether the control strategy can be synchronized with the gate control device, further includes:

[0300] S41: Based on the real-time status information preset by the gate control device, obtain the execution type of the control strategy, wherein the real-time status information specifically includes communication status, current working mode, gate status and control authority attribution, and the execution type specifically includes opening adjustment type, status control type and mode switching type;

[0301] S42: Determine whether the real-time status information supports the execution type;

[0302] S43: If so, identify the preset execution capability of the gate control device, collect the upload frequency of the gate control device according to the execution capability, construct the feedback cycle of the water conservancy terminal to the control strategy based on the upload frequency, compare the feedback cycle with the preset strategy tolerance time, and generate the strategy feedback information of the gate control device. The execution capability specifically includes execution confirmation frame, execution result data point and failure reason code.

[0303] In this embodiment, the system obtains the execution type of the control strategy based on the real-time status information pre-set by the gate control device. This real-time status information specifically includes communication status, current operating mode, gate status, and control authority. The execution types specifically include opening adjustment, status control, and mode switching. The system then determines whether the real-time status information supports these execution types and executes the corresponding steps accordingly. For example, if the system determines that the pre-set real-time status information of the gate control device cannot support the execution type of the control strategy, the system considers the current device to be in a state where it lacks the conditions or authority to execute, and cannot adjust or respond according to the target logic of the preset control strategy. The system records the unexecuted control strategy, detailing the reason for the failure (e.g., "device in manual mode" or "communication disconnected"), for background analysis. Simultaneously, if redundant devices or alternative paths (e.g., backup gates) exist, the system can automatically attempt to switch control targets. If the strategy allows for delayed execution, the system can enter an "execution queue" to wait for the status to recover and prompt the user to perform necessary interventions, such as prompting the maintenance personnel. If the user switches the device to "remote mode" or restores the communication connection, and the permission ownership is inconsistent, they can request the upper-level platform to release the control permission. For example, when the system determines that the pre-set real-time status information of the gate control device can support the execution type of the control strategy, the system will consider the current device to be in normal operation. The system will identify the pre-set execution capabilities of the gate control device. The execution capabilities specifically include execution confirmation frames, execution result data points, and failure reason codes. Based on these execution capabilities, the system collects the upload frequency of the gate control device. Based on different upload frequencies, it constructs the feedback cycle of the water conservancy terminal to the control strategy. The feedback cycle is compared with the pre-set strategy tolerance time to generate the strategy feedback information of the gate control device. By identifying the device's execution capabilities (such as execution confirmation frames, result data points, and failure reason codes), the system can clearly track whether the control command has been received and correctly executed by the device, avoiding the black box operation problem of "issuing commands but the device does not respond". For example, if the device actively uploads an "execution confirmation frame", it can confirm that the action has been triggered; uploading "result data points" can verify whether the gate has opened to the target opening degree.Uploading a "failure reason code" allows for tracing the root cause of execution failure. This mechanism effectively improves the reliability and auditability of the control link. Simultaneously, by constructing a feedback cycle based on the device's upload frequency and comparing it with the control policy's "tolerance duration," the system can intelligently determine whether the device has "timed out without feedback," and whether a retry or alarm is needed. For example, if the policy tolerance duration is 30 seconds and the device feedback cycle is 60 seconds, the system can provide an early warning of policy feedback delay risks, preventing operational loss of control or misjudgment of device failure. This mechanism can dynamically adapt to the feedback rhythm of different devices and operating conditions, enhancing the system's fault tolerance and energy-saving capabilities regarding policy execution rhythm. Ultimately, it generates "policy feedback information" based on the policy execution result, feedback cycle, and device capabilities, such as "execution successful," "execution failed - reason code 04," and "execution timed out - no feedback." This feedback information can be uploaded to the water conservancy central control platform or regional water affairs supervision system as basic data for intelligent scheduling, task evaluation, or operational statistics. In this way, the system not only improves automation but also enhances data collaboration and management transparency with upper-level platforms, providing comprehensive support for smart water conservancy supervision.

[0304] It should be noted that the preset execution capability of the gate control device is identified, and the upload frequency of the gate control device is collected based on the execution capability. Based on the upload frequency, the feedback cycle of the water conservancy terminal to the control strategy is constructed. The feedback cycle is compared with the preset strategy tolerance time to generate the strategy feedback information of the gate control device. A specific example is as follows:

[0305] Suppose that the water conservancy terminal system of a smart irrigation district controls an automatic gate control device of model GZ-120. The device is installed at the gate in the middle section of the main irrigation canal. Its task is to adjust the gate opening and regulate the irrigation flow according to the remote control strategy.

[0306] System strategy objective: Adjust the gate opening from the current 20% to the target 50% opening;

[0307] Strategy ID: ST-KD-120;

[0308] Policy tolerance time: 60 seconds (referring to the maximum time the system can wait for the device to respond with success).

[0309] Device upload frequency: The device reports status data every 15 seconds;

[0310] First, the system identifies the device's capabilities (execution capabilities). Before executing the control strategy, the system first identifies the device's "execution capabilities," as shown in Table 8 below.

[0311] Table 8:

[0312] Ability type Explanation Execution confirmation frame The device immediately feedbacks the "control command received" message after receiving the control instruction Execution result data point Contains "current opening value" and "execution status flag bit" (0: not completed, 1: completed) Failure reason code If failed, provide a 2-bit hexadecimal code, such as 0x01 indicating "overcurrent protection"

[0313] The system then determines that the device supports the above three execution capabilities and meets the execution conditions;

[0314] Then the system execution and data collection process begins.

[0315] T0 time point: Strategy issuance;

[0316] Control command: Set the opening degree to 50%;

[0317] The system log command has been issued.

[0318] T+15s: First report;

[0319] Opening value: remains at 20%;

[0320] Status flag: Executing (flag bit = 0);

[0321] The system determines that the control action has started but not yet completed.

[0322] T+30s: Second report;

[0323] Opening degree: 42%;

[0324] Status flag: Executing;

[0325] The system determines: Continue to wait for feedback; the situation is still within the policy tolerance period.

[0326] T+45s: Third report submitted;

[0327] Opening degree: 49.9%;

[0328] Status flag: Execution completed (flag bit = 1);

[0329] System judgment: Task completed, deviation within the allowable range (±0.5%);

[0330] The system then generates policy feedback information.

[0331] {

[0332] Strategy ID: "ST-KD-120",

[0333] "Target opening": "50%",

[0334] "Actual opening": "49.9%",

[0335] Execution status: "Successful"

[0336] "Return cycle":"3",

[0337] "Strategy tolerance duration": "60 seconds",

[0338] Total response time: 45 seconds

[0339] Deviation range: ±0.1%

[0340] "Device execution frame status": "Received successfully",

[0341] Status code: "0x00 (Normal)"

[0342] Based on the device's upload frequency (once every 15 seconds), the system sets the longest listening period to a maximum of 4 feedbacks within 60 seconds. This strategy was successfully completed within the 3rd feedback, demonstrating accurate execution and timely response. The system then recognizes the strategy as a successful closed loop.

[0343] Finally, a comparison of the handling when the strategy is not completed (supplementary information on failure scenarios).

[0344] If the device has not completed its operation or has not sent a feedback by T+60s:

[0345] The system returned the following information:

[0346] {

[0347] Strategy ID: "ST-KD-120",

[0348] Execution status: "Failed"

[0349] Reason for failure: "No feedback exceeded the tolerance period".

[0350] Suggested action: "Check device communication status or resend command"

[0351] In summary, in the examples above, since the upload frequency determines the maximum window for waiting for the policy response, a reasonable comparison of the tolerance time ensures efficient feedback. At the same time, by using execution frames, status flags, and failure codes, a closed-loop control logic is formed, which facilitates subsequent operation and maintenance, scheduling decisions, or serves as a data audit record.

[0352] In this embodiment, step S1, which involves monitoring newly added logical ports based on the gateway edge computing node preset in the water conservancy terminal and identifying the access gate control device through the logical port, further includes:

[0353] S11: Detect abnormal data injection into the logical port, wherein the abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes;

[0354] S12: Determine whether the abnormal data injection exceeds the preset injection threshold;

[0355] S13: If so, dynamically disconnect the connection between the water conservancy terminal and the gate control device, collect the data feature packets of the gate control device, and detect the injection behavior of the gate control device based on the data feature packets. The data feature packets specifically include device identification code, encryption signature, manufacturer code and protocol version information. The injection behavior specifically includes high-frequency injection of non-protocol data, repetitive frame flooding and spoofing communication attempts.

[0356] In this embodiment, the system detects abnormal data injection at the logical port. Abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes. It then determines whether this abnormal data injection exceeds a pre-set injection threshold to execute corresponding steps. For example, if the system determines that the abnormal data injection at the logical port does not exceed the pre-set injection threshold, the system considers the current data anomaly to be within the system's tolerable safety range, and the device operation is not currently under substantial threat or interference. Immediate isolation or interruption is not necessary, but the system should implement steady-state monitoring and early warning protection measures to prevent risk escalation. The system timestamps the currently detected abnormal data types (such as illegal frames and unusual baud rate changes) and writes... An error log cache is established for the logical port for post-event auditing and trend analysis. Enhanced analysis of the received frame structure and frequency density of this port is performed to detect trends such as increasing abnormal duration or sudden frequency increases. The tolerance threshold is temporarily raised to avoid misjudging communication interruptions, or, without affecting the main task scheduling, a backup port is switched for partial data transmission and reception verification. For example, if the system determines that the abnormal input injection into the logical port exceeds a pre-set injection threshold, it considers the current data anomaly to be within the abnormal range. The system dynamically disconnects the water conservancy terminal from the gate control equipment and collects the data feature packets from the gate control equipment. These data feature packets specifically include the equipment identification code, encryption signature, and manufacturer code. Based on protocol version information and these data feature packets, the system detects injection behavior in gate control equipment. Injection behavior specifically includes high-frequency injection of non-protocol data, rampant repetitive frame attacks, and spoofing communication attempts. By dynamically disconnecting the communication connection between the water conservancy terminal and the gate control equipment, the system can promptly block potential attack chains before problems escalate, preventing illegal commands from interfering with the gate control logic. This effectively ensures the operational stability and data integrity of critical operations such as water level scheduling and flood discharge commands. Furthermore, after disconnecting communication, the system further collects data feature packets from abnormal devices, including key fields such as device identification code, encryption signature, vendor code, and protocol version. By comparing these with the registered device files on the water conservancy terminal platform, the system can quickly determine whether the device is legally registered. The system identifies whether there is feature tampering or impersonation, enabling device-level anomaly tracing. This step provides strong data support for subsequent anomaly node isolation, access authorization review, and risk accountability. Based on the analysis results of feature packets, the system can further classify and identify abnormal behaviors, such as typical security threats like "high-frequency injection of non-protocol data," "repeated frame flooding," and "impersonation communication attempts." Different types of injection behaviors will trigger different response strategies, such as triggering port isolation, dynamically reallocating logical ports, increasing verification strength, or calling redundant link devices to take over operations. This multi-level response mechanism not only improves the system's adaptability and anti-interference capabilities in complex environments but also helps to achieve secure and controllable access and stable operation of large-scale IoT devices in smart water conservancy systems.

[0357] Reference Appendix Figure 2 The present invention provides a smart gate access system based on driver recognition and data mapping, comprising:

[0358] Monitoring module 10 is used to monitor newly added logical ports based on the gateway edge computing nodes preset in the water conservancy terminal, and to identify the access gate control devices through the logical ports;

[0359] The judgment module 20 is used to determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols;

[0360] The execution module 30 is used to read the preset equipment data points of the gate control device if the condition is met, parse the variable format of the gate control device according to the equipment data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset equipment function of the gate control device. Specifically, the equipment data points include water level, gate opening degree and fault status, and the variable format includes encoding method, variable structure type and register address mapping.

[0361] The second judgment module 40 is used to determine whether the control strategy can be synchronized with the gate control device;

[0362] The second execution module 50 is used to, if not, obtain the verification content of the control strategy, dynamically verify the execution behavior of the gate control device on the control strategy based on the simulation data pre-recorded by the water conservancy terminal, identify the influence parameters of the gate control device on the upstream and downstream areas according to the execution behavior, and construct the linkage relationship of the control strategy on the upstream and downstream areas based on the influence parameters. The verification content specifically includes logical conflicts, null value dependencies and threshold overlaps, and the influence parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity and water body lag time.

[0363] In this embodiment, the monitoring module 10 monitors newly added logical ports based on the pre-installed gateway edge computing nodes in the water conservancy terminal. It identifies the accessed gate control devices through these logical ports. Then, the judgment module 20 determines whether these gate control devices match the pre-defined protocol type to execute corresponding steps. For example, if the system determines that the accessed gate control device cannot match the pre-defined protocol type, the system will consider that the communication protocol used by the device is not in the system's supported protocol template library. The system will record a device access failure log, including the device's port information, initial message sample, and timestamp, marking the device as "to be identified" to avoid misjudging it as illegal access. Simultaneously, a fuzzy protocol parser will be activated to attempt to extract protocols from the communication data. The field structure uses pattern matching and protocol template similarity judgment for "semi-automatic recognition." If automatic recognition fails, the system can prompt maintenance personnel to annotate the basic information of the equipment and the communication structure, supporting subsequent manual input of protocol field templates (such as register numbers, function codes, etc.) for unified platform management. For example, when the system determines that the access gate control equipment can match the pre-set protocol type, the execution module 30 will assume that the communication protocol of the equipment is in the protocol template library supported by the system. The system will read the pre-set equipment data points of the gate control equipment, which specifically include water level, gate opening degree, and fault status. Based on different equipment data points, the system will parse the variable format of the gate control equipment, which specifically includes encoding method, variable... The system maps variable structure types and register addresses, dynamically executing pre-set control strategies from the water conservancy terminal based on the pre-configured device functions of the gate control equipment. By automatically matching the communication protocols of the gate control equipment, the system can quickly determine whether the equipment is within the supported range. Once the protocol match is successful, the system can automatically read the preset data point information, eliminating the tedious steps of manually configuring register addresses, function codes, and parsing formats. This mechanism significantly reduces manual intervention time, lowers the deployment and debugging threshold, and facilitates unmanned deployment in distributed water conservancy sites. Simultaneously, the system supports parsing variable formats for different device data points, including encoding methods (such as BCD, floating-point, integer) and variable structure types (such as single register, composite register, etc.). Through field and register address mapping, the system is compatible with gate control equipment from different manufacturers and models, no longer relying on a unified equipment source. This improves the overall equipment adaptability and expansion flexibility of the system, making it particularly suitable for the real-world environment of water conservancy systems where equipment updates vary and brands are diverse. Furthermore, based on parsing equipment functions, the system can automatically execute preset control strategies in the water conservancy terminal, such as automatic gate opening and closing and linkage adjustment, according to real-time data such as water level and opening degree. This strategy invocation is based on data-driven and function recognition-based intelligent triggering, eliminating the need for manual setting of control logic paths. This improves real-time response and the accuracy of strategy execution, comprehensively enhancing the operational reliability and scheduling intelligence level of the water conservancy gate control system.Then, the second judgment module 40 determines whether these control strategies can be synchronized with the gate control equipment to execute the corresponding steps. For example, when the system determines that these control strategies can be synchronized with the gate control equipment, the system will consider that the instruction set contained in the control strategy is consistent with the operation supported by the device communication protocol, and there is no protocol conflict at the communication layer. The system will establish a real-time data channel between the device and the control strategy internally, start continuous matching and listening of the device data points and strategy logic conditions (such as real-time monitoring of whether the water level triggers the strategy threshold), and at the same time convert the control instructions in the strategy (such as setting the opening degree, executing the gate opening / closing) into the corresponding protocol writing commands, according to time priority and strategy. The system executes and distributes the policies based on factors such as weight, and writes them to the "Policy-Device Binding Successful" log for later tracking. It also initiates a feedback mechanism to collect execution results in real time (such as gate opening changes and water level responses). For example, if the system determines that these control policies cannot synchronize with the gate control equipment, the second execution module 50 will consider that the instruction set contained in the control policy is inconsistent with the operations supported by the device communication protocol. The system will then obtain the verification content of these control policies, specifically including logical conflicts, null dependencies, and threshold overlaps. Based on the pre-collected simulation data from the water conservancy terminal, it dynamically verifies the gate control equipment's execution behavior of the control policies and identifies different execution behaviors. The gate control equipment's impact parameters on upstream and downstream areas include water level change rate, water level response amplitude, discharge volume, flow velocity, and water body lag time. Based on these parameters, a control strategy is constructed to link the upstream and downstream areas. When the control strategy instruction set is incompatible with the equipment protocol, the system does not simply report an error or terminate. Instead, it extracts and analyzes the verification content in the strategy (such as logical conflicts, null value dependencies, and threshold overlaps) to accurately identify key mismatch points. This avoids equipment failures or operational anomalies caused by erroneous instructions, thereby enhancing the system's fault tolerance and compatibility. Simultaneously, the strategy behavior is verified by calling the simulation data built into the water conservancy terminal. The system can dynamically simulate the execution effects of different strategies on the current equipment and analyze their response behavior in actual operation. This "virtual execution + verification and evaluation" mechanism helps optimize strategy logic and improve the accuracy and feasibility of strategy deployment before it can be implemented without the need for trial and error on real equipment. Furthermore, during strategy simulation, the system further identifies the impact parameters of equipment execution on upstream and downstream areas (such as water level response amplitude and water body lag time), thereby constructing a linkage relationship between upstream and downstream areas. This not only enhances the global scheduling capability of the strategy but also provides data support for intelligent decision-making under complex operating conditions, contributing to improved overall collaborative efficiency and operational stability of the water conservancy system.

[0364] In this embodiment, it also includes:

[0365] The acquisition module is used to acquire the device identifier of the gate control device based on the handshake request pre-initiated by the water conservancy terminal, wherein the device identifier specifically includes firmware version, communication capability and device address;

[0366] The third judgment module is used to determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal;

[0367] The third execution module is used to identify the device protocol type of the gate control device if the device protocol type is specified, dynamically load the pre-matched driver program of the water conservancy terminal according to the device protocol type, and construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure. The driver program specifically includes driver activation, communication test and feedback confirmation. The driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

[0368] In this embodiment, the system obtains the device identifier of the gate control device based on the handshake request initiated in advance by the water conservancy terminal. The device identifier specifically includes firmware version, communication capabilities, and device address. Then, the system determines whether the device identifier of the gate control device matches the manufacturer number pre-set in the water conservancy terminal to execute the corresponding steps. For example, when the system determines that the device identifier of the gate control device cannot match the manufacturer number pre-set in the water conservancy terminal, the system will assume that devices from different manufacturers often use proprietary communication protocols, register mapping methods, or data formats. If they do not match, the system will not be able to correctly parse its data or issue instructions, and the system will set the device to an "unauthenticated" or "pending approval" state, suspending automatic authentication. The control strategy is synchronized with data acquisition operations to avoid accidental triggering. Simultaneously, the authentication mechanism of the water conservancy terminal is activated, attempting to read the device's digital signature, certificate, or manufacturer-defined verification fields. If the device supports online verification, it can be linked to the central platform for manufacturer authentication. The system can also invoke a "general driver compatibility mode" to attempt to parse the device according to known standard protocols (such as Modbus, IEC104). If parsing is successful, it is marked as "partially compatible," and some functions continue to run (such as read-only data and disabling control). For example, when the system determines that the gate control device's identifier matches the manufacturer number pre-set in the water conservancy terminal, the system considers it capable of issuing commands or unlocking the gate control device. By analyzing the data, the system identifies the device protocol type of the gate control equipment. This protocol type specifically includes register range, communication baud rate, and command structure. Based on different device protocol types, the system dynamically loads the pre-matched driver program from the water conservancy terminal, constructing the gate control equipment's driver parameters. These parameters include data read instruction structure, register offset rules, and data point mapping information. Based on this identification result, the system can automatically parse the device's communication protocol type (such as register range, baud rate, and command structure), thus eliminating the need for manual input of protocol parameters. Compared to the traditional method of relying on PLCs or engineers to configure registers, this automatic identification mechanism significantly improves the speed of equipment deployment. To meet the practical needs of parallel deployment of multiple devices and multiple vendors, and based on the identified device protocol type, the system dynamically loads the preset driver template in the water conservancy terminal and constructs the driver parameters required for communication with the device, including data reading instruction structure, register offset rules, and data point mapping information. In this way, the system can accurately read key parameters such as water level, opening degree, and fault status, and map them into standardized data structures to ensure the effective transmission and response of control commands. This avoids control failures or false triggers caused by register misalignment or command incompatibility. Furthermore, through this identification, adaptation, and driver construction process, the system establishes a standardized and modular device access mechanism.This mechanism not only supports the automatic access and management of current devices, but also provides a unified template for plug-and-play of newly added devices. The standardized data structure and control interface also provide a solid data foundation and execution channel for the system to achieve more advanced functions (such as strategy linkage, anomaly analysis, and hydrological prediction), fundamentally improving the intelligence level and sustainable expansion capability of the entire water conservancy automation system.

[0369] In this embodiment, the execution module further includes:

[0370] The identification unit is used to identify the policy triggering conditions of the device function based on the triggering type of the control policy, wherein the triggering type specifically includes instruction triggering, linkage triggering and timed triggering;

[0371] The judgment unit is used to determine whether the strategy triggering condition matches the triggering type;

[0372] The execution unit is used to collect current hydrological status data as preset decision input information through the water conservancy terminal if the condition is met, and dynamically construct the strategy scheduling thread of the gate control equipment according to the collection cycle of the decision input information. The hydrological status data specifically includes upstream water level, downstream water level, gate opening, equipment operating status, remote command value, rainfall and warning level.

[0373] In this embodiment, the system identifies the policy triggering conditions of the device function based on the triggering type of the control strategy, specifically including command triggering, linkage triggering, and timed triggering. The system then determines whether the policy triggering conditions of the device function match the triggering type of the control strategy to execute the corresponding steps. For example, if the system determines that the policy triggering conditions of the device function cannot match the triggering type of the control strategy, the system will consider that the current gate control device cannot correctly respond to or cooperate with the expected execution mode of the control strategy, which may lead to the control strategy becoming invalid, ignored, or triggered incorrectly. The system will immediately stop the automatic synchronization of the strategy with the device to prevent the issuance of invalid strategies from causing the device to refuse, report errors, or freeze control. Simultaneously, if the device supports "command triggering," the system... The system can be converted to a system where control commands are periodically issued by the platform or manually, or downgraded to "timed triggering." This simplifies the control logic by setting up scheduled tasks and records policy mismatch information, including the control policy ID and name, the device number and function type to be bound, and the reason for failure (e.g., "lack of event listening capability," "no support for linkage response"). For example, when the system determines that the policy triggering conditions of the device function match the triggering type of the control policy, the system assumes that the current gate control device can correctly cooperate with the control policy. The system will then collect current hydrological status data through the water conservancy terminal as pre-set decision input information. Specific hydrological status data includes upstream water level, downstream water level, gate opening, equipment operating status, and remote commands. Based on the data collection cycle of the gate control equipment, including values, rainfall, and warning levels, the system dynamically constructs a strategy scheduling thread. When the system determines that the triggering conditions of the equipment function match the triggering type of the control strategy, it indicates that the current control logic will not be interrupted due to protocol deficiencies or insufficient capabilities. The equipment can accurately respond to strategy requirements such as linkage triggering, timed triggering, or command triggering, thus avoiding the problem of unresponsive or failed strategy issuance from the source. This mechanism ensures that the control strategy "can be issued, recognized, and executed." Simultaneously, by collecting key hydrological status data (such as upstream and downstream water levels, rainfall, and gate opening) in real time through water conservancy terminals, the system obtains complete and continuous decision-making basis. This data, as input to the control strategy, can not only trigger... A single action can form a logical judgment chain to achieve "predictive scheduling" and "situational response," such as "early warning level + sudden increase in rainfall → advance pre-discharge" or "high downstream water level + gate already open → stop further opening." This improves the accuracy and intelligence of the system response. Furthermore, based on the data acquisition cycle of different decision inputs (such as rainfall every 1 minute, remote commands every 5 seconds, and equipment status every 10 seconds), computing resources are dynamically allocated to build a lightweight strategy scheduling thread. This enables asynchronous parallel scheduling of various control strategies. This thread-level strategy management method not only improves the system's processing efficiency but also supports the collaborative control and distributed management of large-scale multi-gate equipment, providing a fundamental support for the scalability, low latency, and high availability of smart water conservancy systems.

[0374] In this embodiment, the second execution module further includes:

[0375] The detection unit is used to detect the integrity of the policy fields of the control policy based on the internal structure of the policy preset by the control policy, wherein the internal structure of the policy specifically includes a set of conditions, a set of actions, and data point references.

[0376] The second judgment unit is used to determine whether the integrity of the strategy field is missing;

[0377] The second execution unit is configured to, if so, obtain the preset dependency relationship of the control strategy, identify the preset linkage strategy of the control strategy based on the dependency relationship, and check the invalid command of the control strategy from the gate control device according to the triggering state of the linkage strategy, wherein the invalid command specifically includes an overriding strategy or a conflict strategy.

[0378] In this embodiment, the system, based on the pre-defined internal structure of the control strategy (which specifically includes a set of conditions, a set of actions, and data point references), checks the integrity of the strategy fields of these control strategies. The system then determines whether any strategy fields are missing in order to execute the corresponding steps. For example, if the system determines that the strategy fields of a control strategy are not missing, it considers the current control strategy to have complete and valid execution conditions and operation definitions, and can be securely loaded and issued to the corresponding gate control device for execution. The system marks the strategy as "executable," loads it into the strategy scheduling thread of the corresponding device, waits for a scheduling cycle or event trigger, and simultaneously establishes a state context for the strategy. This includes whether the system is currently active, whether current conditions are met, the last execution time and result, and, based on the trigger type of the strategy (such as timed, linked, or command), starting a listening thread (for remote command triggering), starting a timed check task (for timed or periodic judgment), and registering linked sensor events (such as water level or rainfall changes). For example, when the system determines that the completeness of the control strategy's strategy fields is missing, the system will consider that the current control strategy does not have complete and legal execution conditions. The system will obtain the pre-set dependencies of these control strategies, identify the pre-set linked strategies of the control strategy based on different dependencies, and, based on the trigger status of these linked strategies, trigger the gate control... The system checks for invalid commands in the control strategy, specifically including overriding or conflicting strategies. When the system detects a missing field in a control strategy (e.g., missing trigger conditions, reference to invalid data points, or no configured action instructions), it will not execute blindly but will proactively mark the strategy as "unexecutable," suspending its automatic scheduling. This avoids risks such as equipment malfunction, sluice gate malfunction, or water waste caused by erroneous strategy issuance. Simultaneously, it obtains the preset dependencies in the control strategy (e.g., the trigger status or execution result of strategy B depending on strategy A), allowing it to locate the linkage structure between this strategy and other strategies. When a field is missing, the system determines the relationship by searching for its "linkage strategy." The system checks whether there are already effective overriding policies (with higher priority) or conflicting policies (with contradictory execution results). It further clarifies whether the current policy has been "structurally abandoned" due to logical conflicts. This mechanism effectively prevents policies from repeatedly controlling the same device or causing state disorder due to contradictory conditions. After identifying the linkage policy, the system enters the gate control device's instruction cache or the current execution channel to check whether there are invalid control commands derived from the current invalid policy, such as instructions issued without being triggered or duplicate commands that conflict with other policies. The recycling, cancellation, or alarm prompts for these "invalid commands" help ensure the clarity and uniqueness of the device control instruction chain and improve the data closure and execution transparency of the policy scheduling system.

[0379] In this embodiment, the determination module further includes:

[0380] The acquisition unit is used to acquire the corresponding protocol raw data frame from the gate control device. The protocol raw data frame specifically includes message start and end characters, message length bytes, function code, check bit type, response time interval, and communication baud rate.

[0381] The third judgment unit is used to judge whether the original protocol data frame matches the protocol feature field, wherein the protocol feature field specifically includes the protocol frame header, address field and data length;

[0382] The third execution unit is configured to, if so, extract the corresponding byte order from the original protocol data frame, classify the data type of the original protocol data frame based on the byte order, and parse the decoded data of the original protocol data frame according to the data type. Specifically, the data type includes 16-bit integer, 32-bit floating-point, and fractional offset, and the decoded data specifically includes opening value, water level value, and status word.

[0383] In this embodiment, the system collects the corresponding protocol raw data frames from the gate control device. The protocol raw data frames specifically include message start and end characters, message length bytes, function code, checksum type, response time interval, and communication baud rate. Then, it determines whether these protocol raw data frames match protocol feature fields. Protocol feature fields specifically include the protocol frame header, address field, and data length, in order to execute corresponding steps. For example, when the system determines that these protocol raw data frames cannot match the protocol feature fields, the system will consider that the current gate control device's communication data structure does not conform to the standard protocol template supported by the system, or that the device has communication anomalies, configuration errors, or unknown protocol types. The system cannot correctly parse its data content and instruction behavior, and will cache the failed data frames, including timestamps, message hexadecimal content, and source device address, for subsequent manual protocol reverse engineering or vendor protocol comparison. Simultaneously, it attempts to compare with the built-in "protocol fallback library," such as earlier... For Modbus / RTU variants and older manufacturer protocols, if some fields can be initially matched, such as identical frame headers but mismatched data segments, the system can enter a "semi-automatic protocol calibration mode" and notify maintenance personnel that the device has an unknown or incompatible protocol. A data frame reference template is provided for manufacturer feedback or new template input. The system supports marking the current device as a "device to be adapted," skipping automatic parsing but allowing manual input of key data points. For example, when the system determines that these protocol raw data frames can match protocol feature fields, the system considers the current gate control device's communication data structure to conform to the system's supported standard protocol template. The system extracts the corresponding byte order from the protocol raw data frames and, based on these byte orders, classifies the data types of the protocol raw data frames. Specific data types include 16-bit integers, 32-bit floating-point numbers, and fractional offsets. According to different data types, the system parses the decoded data of the protocol raw data frames. The decoded data specifically includes opening value, water level value, and status word.The system can accurately identify and match key feature fields (such as frame header, address field, data length, etc.) in the original data frames of the gate control device's protocol. This means that the communication protocol used by the device is consistent with the standard template library supported by the system. Based on this matching process, the system can automatically identify the device's data structure and complete device access without manual configuration of communication templates. This function effectively breaks down the barriers of protocol format differences between different manufacturers' devices, greatly improving the system's adaptation speed and access efficiency when facing multiple brands and models of devices. At the same time, by extracting byte order and parsing data types (such as 16-bit integer, 32-bit floating-point, decimal offset, etc.) from the original protocol data frames, the system can accurately restore the data content transmitted by the device, such as accurately decoding the open circuit. Key data points such as opening degree, water level, and status words facilitate refined monitoring during water conservancy scheduling, preventing data distortion caused by human error or protocol differences. This ensures the consistency and reliability of hydrological data across various analysis and control scenarios. Furthermore, successfully acquired and decoded key data points directly participate in the triggering and decision-making processes of control strategies. For example, the system can determine whether to trigger gate operation based on real-time opening degree or water level values, or activate safety mechanisms based on alarm bits in status words. This automatically driven control logic, based on decoded data, significantly enhances the system's intelligent response capabilities, enabling the gate control system to quickly and autonomously make precise controls in emergency situations, thereby improving the reliability and operational efficiency of the overall water conservancy automation system.

[0384] In this embodiment, the second determination module further includes:

[0385] The acquisition unit is used to acquire the execution type of the control strategy based on the real-time status information preset by the gate control device. The real-time status information specifically includes communication status, current working mode, gate status and control authority ownership. The execution type specifically includes opening adjustment type, status control type and mode switching type.

[0386] The fourth determination unit is used to determine whether the real-time status information supports the execution type;

[0387] The fourth execution unit is used to identify the preset execution capability of the gate control device if the condition is met, collect the upload frequency of the gate control device according to the execution capability, construct the feedback cycle of the water conservancy terminal to the control strategy based on the upload frequency, compare the feedback cycle with the preset strategy tolerance time, and generate the strategy feedback information of the gate control device. The execution capability specifically includes an execution confirmation frame, execution result data points, and failure reason code.

[0388] In this embodiment, the system obtains the execution type of the control strategy based on the real-time status information pre-set by the gate control device. This real-time status information specifically includes communication status, current operating mode, gate status, and control authority. The execution types specifically include opening adjustment, status control, and mode switching. The system then determines whether the real-time status information supports these execution types and executes the corresponding steps accordingly. For example, if the system determines that the pre-set real-time status information of the gate control device cannot support the execution type of the control strategy, the system considers the current device to be in a state where it lacks the conditions or authority to execute, and cannot adjust or respond according to the target logic of the preset control strategy. The system records the unexecuted control strategy, detailing the reason for the failure (e.g., "device in manual mode" or "communication disconnected"), for background analysis. Simultaneously, if redundant devices or alternative paths (e.g., backup gates) exist, the system can automatically attempt to switch control targets. If the strategy allows for delayed execution, the system can enter an "execution queue" to wait for the status to recover and prompt the user to perform necessary interventions, such as prompting the maintenance personnel. If the user switches the device to "remote mode" or restores the communication connection, and the permission ownership is inconsistent, they can request the upper-level platform to release the control permission. For example, when the system determines that the pre-set real-time status information of the gate control device can support the execution type of the control strategy, the system will consider the current device to be in normal operation. The system will identify the pre-set execution capabilities of the gate control device. The execution capabilities specifically include execution confirmation frames, execution result data points, and failure reason codes. Based on these execution capabilities, the system collects the upload frequency of the gate control device. Based on different upload frequencies, it constructs the feedback cycle of the water conservancy terminal to the control strategy. The feedback cycle is compared with the pre-set strategy tolerance time to generate the strategy feedback information of the gate control device. By identifying the device's execution capabilities (such as execution confirmation frames, result data points, and failure reason codes), the system can clearly track whether the control command has been received and correctly executed by the device, avoiding the black box operation problem of "issuing commands but the device does not respond". For example, if the device actively uploads an "execution confirmation frame", it can confirm that the action has been triggered; uploading "result data points" can verify whether the gate has opened to the target opening degree.Uploading a "failure reason code" allows for tracing the root cause of execution failure. This mechanism effectively improves the reliability and auditability of the control link. Simultaneously, by constructing a feedback cycle based on the device's upload frequency and comparing it with the control policy's "tolerance duration," the system can intelligently determine whether the device has "timed out without feedback," and whether a retry or alarm is needed. For example, if the policy tolerance duration is 30 seconds and the device feedback cycle is 60 seconds, the system can provide an early warning of policy feedback delay risks, preventing operational loss of control or misjudgment of device failure. This mechanism can dynamically adapt to the feedback rhythm of different devices and operating conditions, enhancing the system's fault tolerance and energy-saving capabilities regarding policy execution rhythm. Ultimately, it generates "policy feedback information" based on the policy execution result, feedback cycle, and device capabilities, such as "execution successful," "execution failed - reason code 04," and "execution timed out - no feedback." This feedback information can be uploaded to the water conservancy central control platform or regional water affairs supervision system as basic data for intelligent scheduling, task evaluation, or operational statistics. In this way, the system not only improves automation but also enhances data collaboration and management transparency with upper-level platforms, providing comprehensive support for smart water conservancy supervision.

[0389] In this embodiment, the monitoring module further includes:

[0390] The second detection unit is used to detect abnormal data injection into the logic port, wherein the abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes.

[0391] The fifth judgment unit is used to determine whether the abnormal data injection exceeds a preset injection threshold;

[0392] The fifth execution unit is used to dynamically disconnect the connection between the water conservancy terminal and the gate control device if the condition is met, collect the data feature packets of the gate control device, and detect the injection behavior of the gate control device based on the data feature packets. Specifically, the data feature packets include device identification code, encryption signature, manufacturer code and protocol version information, and the injection behavior specifically includes high-frequency injection of non-protocol data, repetitive frame flooding and spoofing communication attempts.

[0393] In this embodiment, the system detects abnormal data injection at the logical port. Abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes. It then determines whether this abnormal data injection exceeds a pre-set injection threshold to execute corresponding steps. For example, if the system determines that the abnormal data injection at the logical port does not exceed the pre-set injection threshold, the system considers the current data anomaly to be within the system's tolerable safety range, and the device operation is not currently under substantial threat or interference. Immediate isolation or interruption is not necessary, but the system should implement steady-state monitoring and early warning protection measures to prevent risk escalation. The system timestamps the currently detected abnormal data types (such as illegal frames and unusual baud rate changes) and writes... An error log cache is established for the logical port for post-event auditing and trend analysis. Enhanced analysis of the received frame structure and frequency density of this port is performed to detect trends such as increasing abnormal duration or sudden frequency increases. The tolerance threshold is temporarily raised to avoid misjudging communication interruptions, or, without affecting the main task scheduling, a backup port is switched for partial data transmission and reception verification. For example, if the system determines that the abnormal input injection into the logical port exceeds a pre-set injection threshold, it considers the current data anomaly to be within the abnormal range. The system dynamically disconnects the water conservancy terminal from the gate control equipment and collects the data feature packets from the gate control equipment. These data feature packets specifically include the equipment identification code, encryption signature, and manufacturer code. Based on protocol version information and these data feature packets, the system detects injection behavior in gate control equipment. Injection behavior specifically includes high-frequency injection of non-protocol data, rampant repetitive frame attacks, and spoofing communication attempts. By dynamically disconnecting the communication connection between the water conservancy terminal and the gate control equipment, the system can promptly block potential attack chains before problems escalate, preventing illegal commands from interfering with the gate control logic. This effectively ensures the operational stability and data integrity of critical operations such as water level scheduling and flood discharge commands. Furthermore, after disconnecting communication, the system further collects data feature packets from abnormal devices, including key fields such as device identification code, encryption signature, vendor code, and protocol version. By comparing these with the registered device files on the water conservancy terminal platform, the system can quickly determine whether the device is legally registered. The system identifies whether there is feature tampering or impersonation, enabling device-level anomaly tracing. This step provides strong data support for subsequent anomaly node isolation, access authorization review, and risk accountability. Based on the analysis results of feature packets, the system can further classify and identify abnormal behaviors, such as typical security threats like "high-frequency injection of non-protocol data," "repeated frame flooding," and "impersonation communication attempts." Different types of injection behaviors will trigger different response strategies, such as triggering port isolation, dynamically reallocating logical ports, increasing verification strength, or calling redundant link devices to take over operations. This multi-level response mechanism not only improves the system's adaptability and anti-interference capabilities in complex environments but also helps to achieve secure and controllable access and stable operation of large-scale IoT devices in smart water conservancy systems.

[0394] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A smart gate access method based on drive recognition and data mapping, characterized in that, Includes the following steps: Based on the gateway edge computing node preset by the water conservancy terminal, newly added logical ports are monitored, and the access gate control equipment is identified through the logical ports; Determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols; If so, then read the preset device data points of the gate control device, parse the variable format of the gate control device according to the device data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset device function of the gate control device. The device data points specifically include water level, gate opening degree and fault status, and the variable format specifically includes encoding method, variable structure type and register address mapping. Determine whether the control strategy can be synchronized with the gate control device; If not, the verification content of the control strategy is obtained. Based on the simulation data pre-recorded by the water conservancy terminal, the execution behavior of the gate control device on the control strategy is dynamically verified. According to the execution behavior, the influence parameters of the gate control device on the upstream and downstream areas are identified. Based on the influence parameters, the linkage relationship of the control strategy on the upstream and downstream areas is constructed. The verification content specifically includes logical conflicts, null value dependencies, and threshold overlaps. The influence parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity, and water body lag time.

2. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, Before the step of reading the preset device data points of the gate control device and parsing the variable format of the gate control device based on the device data points, the method further includes: Based on the handshake request pre-initiated by the water conservancy terminal, the device identifier of the gate control device is obtained, wherein the device identifier specifically includes firmware version, communication capability and device address; Determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal; If so, the device protocol type of the gate control device is identified, and the pre-matched driver program of the water conservancy terminal is dynamically loaded according to the device protocol type to construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure, the driver program specifically includes driver activation, communication test and feedback confirmation, and the driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

3. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, The step of dynamically executing the control strategy pre-recorded by the water conservancy terminal based on the preset equipment functions of the gate control device further includes: Based on the trigger type of the control strategy, the strategy trigger conditions of the device function are identified, wherein the trigger type specifically includes instruction trigger, linkage trigger, and timed trigger; Determine whether the triggering condition of the strategy matches the triggering type; If so, the current hydrological status data is collected through the water conservancy terminal as preset decision input information. Based on the collection cycle of the decision input information, the strategy scheduling thread of the gate control equipment is dynamically constructed. The hydrological status data specifically includes upstream water level, downstream water level, gate opening degree, equipment operating status, remote command value, rainfall and warning level.

4. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, The step of obtaining the verification content of the control strategy further includes: Based on the internal structure of the control strategy, the integrity of the strategy fields of the control strategy is detected, wherein the internal structure of the strategy specifically includes a set of conditions, a set of actions, and data point references. Determine whether the integrity of the policy field is missing; If so, the preset dependency relationship of the control strategy is obtained, the preset linkage strategy of the control strategy is identified according to the dependency relationship, and the invalid command of the control strategy is checked from the gate control device according to the triggering state of the linkage strategy. The invalid command specifically includes the overriding strategy or the conflict strategy.

5. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, The step of determining whether the gate control device matches the preset protocol type further includes: Collect the corresponding protocol raw data frame from the gate control device. The protocol raw data frame specifically includes message start and end characters, message length bytes, function code, check bit type, response time interval, and communication baud rate. Determine whether the original data frame of the protocol matches the protocol feature fields, wherein the protocol feature fields specifically include the protocol frame header, address field, and data length; If so, the corresponding byte order is extracted from the original protocol data frame. Based on the byte order, the data type of the original protocol data frame is divided. According to the data type, the decoded data of the original protocol data frame is parsed. Specifically, the data type includes 16-bit integer, 32-bit floating point and fractional offset. The decoded data specifically includes opening value, water level value and status word.

6. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, The step of determining whether the control strategy can be synchronized with the gate control device further includes: Based on the real-time status information preset by the gate control device, the execution type of the control strategy is obtained. The real-time status information specifically includes communication status, current working mode, gate status and control authority ownership. The execution type specifically includes opening adjustment type, status control type and mode switching type. Determine whether the real-time status information supports the execution type; If so, the preset execution capability of the gate control device is identified, the upload frequency of the gate control device is collected according to the execution capability, the feedback cycle of the water conservancy terminal to the control strategy is constructed based on the upload frequency, the feedback cycle is compared with the preset strategy tolerance time, and the strategy feedback information of the gate control device is generated. The execution capability specifically includes execution confirmation frame, execution result data point and failure reason code.

7. The intelligent gate access method based on drive recognition and data mapping according to claim 1, characterized in that, The step of monitoring newly added logical ports and identifying access control devices through the logical ports of the gateway edge computing node preset by the water conservancy terminal further includes: Detect abnormal data injection into the logical port, wherein the abnormal data specifically includes high-frequency non-protocol data, illegal frames, and abnormal baud rate changes; Determine whether the injected abnormal data exceeds a preset injection threshold; If so, the connection between the water conservancy terminal and the gate control device is dynamically disconnected, the data feature packets of the gate control device are collected, and the injection behavior of the gate control device is detected based on the data feature packets. The data feature packets specifically include device identification code, encryption signature, manufacturer code and protocol version information, and the injection behavior specifically includes high-frequency injection of non-protocol data, repetitive frame flooding and spoofing communication attempts.

8. A smart gate access system based on drive recognition and data mapping, characterized in that, include: The monitoring module is used to monitor newly added logical ports based on the gateway edge computing nodes preset in the water conservancy terminal, and to identify the access gate control devices through the logical ports; The judgment module is used to determine whether the gate control device matches a preset protocol type, wherein the protocol type specifically includes Modbus, IEC104 and proprietary protocols; The execution module is used to read the preset device data points of the gate control device if the condition is met, parse the variable format of the gate control device according to the device data points, and dynamically execute the control strategy pre-recorded by the water conservancy terminal according to the preset device function of the gate control device. Specifically, the device data points include water level, gate opening degree and fault status, and the variable format includes encoding method, variable structure type and register address mapping. The second judgment module is used to determine whether the control strategy can be synchronized with the gate control device; The second execution module is used to, if not, obtain the verification content of the control strategy, dynamically verify the execution behavior of the gate control device on the control strategy based on the simulation data pre-recorded by the water conservancy terminal, identify the impact parameters of the gate control device on the upstream and downstream areas according to the execution behavior, and construct the linkage relationship of the control strategy on the upstream and downstream areas based on the impact parameters. The verification content specifically includes logical conflicts, null value dependencies, and threshold overlaps, and the impact parameters specifically include water level change rate, water level response amplitude, discharge flow, flow velocity, and water body lag time.

9. The intelligent gate access system based on drive recognition and data mapping according to claim 8, characterized in that, Also includes: The acquisition module is used to acquire the device identifier of the gate control device based on the handshake request pre-initiated by the water conservancy terminal, wherein the device identifier specifically includes firmware version, communication capability and device address; The third judgment module is used to determine whether the device identifier matches the preset manufacturer number of the water conservancy terminal; The third execution module is used to identify the device protocol type of the gate control device if the device protocol type is specified, dynamically load the pre-matched driver program of the water conservancy terminal according to the device protocol type, and construct the driver parameters of the gate control device. The device protocol type specifically includes register range, communication baud rate and command structure. The driver program specifically includes driver activation, communication test and feedback confirmation. The driver parameters specifically include data read instruction structure, register offset rules and data point mapping information.

10. The intelligent gate access system based on drive recognition and data mapping according to claim 8, characterized in that, The execution module further includes: The identification unit is used to identify the policy triggering conditions of the device function based on the triggering type of the control policy, wherein the triggering type specifically includes instruction triggering, linkage triggering and timed triggering; The judgment unit is used to determine whether the strategy triggering condition matches the triggering type; The execution unit is used to collect current hydrological status data as preset decision input information through the water conservancy terminal if the condition is met, and dynamically construct the strategy scheduling thread of the gate control equipment according to the collection cycle of the decision input information. The hydrological status data specifically includes upstream water level, downstream water level, gate opening, equipment operating status, remote command value, rainfall and warning level.

Citation Information

Patent Citations

  • Water conservancy monitoring terminal access system and method based on virtual gateway

    CN119299249A

  • Water and electricity integrated monitoring system for water conservancy pump station and control method

    CN119439857A