An Industrial Internet of Water Affairs Data Acquisition and Instruction Control Middleware
By designing the water industry Internet data acquisition and instruction control middleware, the data acquisition complexity and compatibility problems caused by the diversity of communication protocols of water equipment are solved, efficient and intelligent instruction control and data processing are achieved, dynamically adapting to equipment changes, and improving the scalability and reliability of the system.
Patent Information
- Application Number
- CN202510283882.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-11
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-03-11
AI Technical Summary
The water industry has diverse communication protocols for field equipment, resulting in complex data collection, poor data compatibility, lack of accuracy and intelligence in command control, traditional data processing methods cannot meet real-time requirements, and the network topology structure is static, making it difficult to adapt to dynamic changes in equipment.
Design a water industry Internet data acquisition and instruction control middleware, including data acquisition module, data processing module, instruction control module and collaborative dispatching engine. The data acquisition module is connected to the device through a multi-source heterogeneous interface, the data processing module performs protocol normalization and data packet standardization, the instruction control module has powerful instruction analysis and optimization capabilities, and the collaborative scheduling engine allocates transmission paths through dynamic routing algorithms.
It realizes unified collection and processing of data between water equipment, improves the universality and accuracy of data collection, enhances the accuracy and intelligence of instruction control, meets the needs of real-time and efficientness, dynamically adapts to equipment changes, and improves the scalability and reliability of the system.
Smart Images

Figure CN119814838B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial Internet, and specifically to an industrial Internet data acquisition and instruction control middleware for the water service industry. Background Art
[0002] In today's digital age, the water service industry is accelerating towards intelligence and high efficiency. With the booming development of advanced technologies such as the Internet of Things, big data, and artificial intelligence, the limitations of traditional water service management models have become increasingly prominent. As the key links in the intelligent transformation of water services, data acquisition and instruction control are facing many problems that urgently need to be solved.
[0003] On the one hand, the types of equipment in the water service industrial field are diverse, and the communication protocols are different. From basic water level sensors, water pressure sensors to complex water pumps, sewage treatment equipment, etc., the equipment produced by different manufacturers often adopts unique communication protocols, such as Modbus, Profibus, OPC, etc. This makes the data acquisition process extremely complex and difficult to achieve unified and efficient management. The data formats between devices are incompatible, and the interface standards are inconsistent, resulting in frequent errors in data transmission and integration, seriously affecting the accuracy and integrity of data. For example, in a large water service treatment plant, sensors and execution devices in different areas may adopt different communication protocols respectively. This requires a large amount of manpower and time for protocol conversion and data adaptation when the central control system obtains and processes data, not only increasing the system construction cost, but also reducing the real-time performance of data acquisition and unable to provide accurate basis for decision-making in a timely manner.
[0004] On the other hand, the existing water service systems lack accuracy and intelligence in instruction control. When it is necessary to control equipment, due to the inability to obtain the operating status of the equipment in real time and comprehensively, the issued instructions often cannot be optimized and adjusted according to the actual situation of the equipment. For example, when adjusting the flow rate of a water pump, if the control is only based on preset fixed parameters without considering factors such as the current load, energy consumption, and pipeline pressure of the water pump, it may lead to low operating efficiency of the water pump, increased energy consumption, and even shortened equipment service life. Moreover, for complex control tasks, such as the collaborative operation of multiple devices, the existing instruction control methods are difficult to reasonably arrange the operation sequence and parameter settings, unable to achieve efficient collaboration between devices, and affecting the operating efficiency of the entire water service system.
[0005] In addition, with the continuous expansion of the scale of water service systems, the amount of data has increased explosively, and the requirements for data processing and transmission are also getting higher and higher. Traditional data processing methods are slow and inefficient in the face of massive multi-source heterogeneous data and cannot meet the real-time requirements. At the same time, in the data transmission process, due to the lack of effective routing optimization and load balancing strategies, problems such as network congestion and data loss are likely to occur, further reducing the reliability and stability of the system.
[0006] In terms of network topology management, the existing water network topology structure is often static and difficult to adapt to the dynamic changes of devices. When new devices are connected or old devices are removed due to faults, the topology structure cannot be updated automatically in a timely manner, resulting in unreasonable selection of data transmission paths and affecting data transmission efficiency. Summary of the Invention
[0007] The purpose of the present invention is to provide a middleware for data collection and instruction control in the water service industrial Internet to solve the problems mentioned in the above background technology.
[0008] To achieve the above purpose, the present invention provides the following technical solution: A middleware for data collection and instruction control in the water service industrial Internet, the middleware includes:
[0009] A data collection module, used to connect to water service devices through multi-source heterogeneous interfaces, collect dynamic data streams in the water service industrial scenario in real time, and classify the data streams into structured data and unstructured data and then transmit them to the data processing module;
[0010] A data processing module, used to perform protocol normalization processing on the dynamic data stream and generate standardized data packets according to a preset data topology model;
[0011] An instruction control module, used to receive external control instructions, parse the operation objects and parameters in the instructions, and dynamically generate an executable instruction set for the device according to the real-time state of the water service device;
[0012] A collaborative scheduling engine, used to allocate the transmission paths of data streams and instructions through a dynamic routing algorithm based on the priority of the data stream and the device resource load status, and coordinate the interaction timing of the data collection module, the data processing module and the instruction control module;
[0013] Among them, the data processing module includes:
[0014] A protocol adaptation unit, used to call the corresponding decoding rules according to the device communication protocol type and convert heterogeneous data into a unified intermediate format;
[0015] A topology construction unit, used to construct a dynamic data stream topology structure based on the physical connection relationship and data dependency relationship between device nodes;
[0016] A load balancing strategy based on the real-time response delay and bandwidth occupancy of device nodes is preset in the collaborative scheduling engine.
[0017] Preferably, the data collection module further includes:
[0018] The device interface unit connects various water production devices and sensor devices by dynamically loading drivers. For devices that output analog signals, the analog signals are converted into digital signals through algorithms.
[0019] The protocol parsing unit is used to identify the message header fields in the device communication protocol and extract the valid data payload.
[0020] The data cache queue is used to divide independent storage areas according to data categories and set the overflow elimination rules of the queue according to data timeliness.
[0021] Preferably, the instruction control module includes:
[0022] The instruction decomposition unit is used to disassemble the composite control instruction into an atomic operation sequence and mark the timing constraint relationship between operations.
[0023] The device status monitoring unit is used to obtain the operation parameters of water devices in real time and determine whether the device is in a safe state where instructions can be executed.
[0024] The instruction optimization unit is used to select the optimal parameter combination for instruction execution through the greedy algorithm according to the device historical response data.
[0025] Preferably, the collaborative scheduling engine specifically includes:
[0026] The path weight calculation unit is used to calculate the comprehensive weight value of each path according to the real-time network delay, remaining bandwidth and data packet size of the device node.
[0027] The path selection unit is used to construct a minimum spanning tree based on the comprehensive weight value and reserve redundant transmission channels for high-priority data streams.
[0028] The fault-tolerant retransmission unit is used to reallocate the transmission path according to the path historical success rate when detecting data packet loss.
[0029] Preferably, the instruction optimization unit further includes:
[0030] The parameter constraint library is used to store the minimum / maximum operation thresholds of water devices and the coupling relationship between parameters.
[0031] The cost function construction unit is used to establish a multi-objective optimization function with device energy consumption, execution time and error range as variables.
[0032] The iterative solution unit is used to generate a candidate parameter set through Monte Carlo sampling and screen the optimal solution that meets the constraint conditions.
[0033] Preferably, the protocol parsing unit specifically includes:
[0034] The message feature extraction sub-unit is used to identify the positions of the start symbol, check code, and end symbol from the device messages;
[0035] The protocol template matching sub-unit is used to compare the similarity between the message structure and the pre-stored protocol templates, and select the template with the highest matching degree for parsing;
[0036] The abnormal message processing sub-unit is used to perform fragment recombination or trigger a retransmission request for the messages that cannot match the templates.
[0037] Preferably, the topology construction unit specifically includes:
[0038] The node relationship discovery sub-unit is used to infer the physical connection relationship through the communication response time between devices;
[0039] The dependency analysis sub-unit is used to construct a directed data dependency graph between device nodes based on the content relevance of the data flow;
[0040] The topology update sub-unit is used to update the topology structure through an incremental algorithm when device nodes are added or deleted.
[0041] Preferably, the fault-tolerant retransmission unit further includes:
[0042] The packet loss detection sub-unit is used to determine whether packet loss occurs based on the continuity of the sequence numbers of the data packets;
[0043] The path reliability evaluation sub-unit is used to count the historical packet loss rate and average delay of each path, and generate a path reliability score;
[0044] The dynamic switching sub-unit is used to select an alternative path with a score higher than the threshold for data transmission during retransmission.
[0045] Preferably, the iterative solution unit further includes:
[0046] The sampling space partitioning sub-unit is used to discretize the continuous parameter space into a multi-dimensional grid according to the parameter constraint library;
[0047] The grid search sub-unit is used to calculate the cost function value at the grid intersection points and record the local optimal solutions;
[0048] The convergence judgment sub-unit is used to judge whether the convergence condition is reached according to the difference between the optimal solutions of adjacent iteration rounds.
[0049] Preferably, the dependency analysis sub-unit specifically includes:
[0050] The data flow tracing sub-unit is used to mark the sequence of device nodes through which the data flows, and record the processing delay of each node;
[0051] An association rule mining subunit, which is used to discover strong association relationships between device nodes through the frequent itemset algorithm;
[0052] A directed graph generation subunit, which is used to map the association relationships into weighted directed edges and construct a minimum spanning tree topology.
[0053] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0054] The data acquisition module of the present invention can be seamlessly connected to various water service devices through multi-source heterogeneous interfaces to realize real-time acquisition of dynamic data streams. It classifies the acquired data into structured and unstructured data for subsequent targeted processing. The protocol adaptation unit in the data processing module can call corresponding decoding rules according to the types of device communication protocols to convert heterogeneous data into a unified intermediate format, effectively solving the data compatibility problem caused by the complexity of water service device communication protocols. For example, in a large water service treatment plant with various brands and models of devices, whether it is a sensor using the Modbus protocol or a large water pump using the OPC protocol, data can be successfully acquired and processed, greatly improving the generality and accuracy of data acquisition. The topology construction unit constructs a dynamic data stream topology structure based on the physical connection relationships and data dependency relationships between device nodes, making data processing more targeted and efficient, and ensuring that data can be transmitted and processed quickly and accurately in a complex water service network environment.
[0055] The instruction control module has strong instruction parsing and optimization capabilities. The instruction decomposition unit can disassemble composite control instructions into atomic operation sequences and mark the timing constraint relationships between operations, providing guarantee for the orderly execution of complex control tasks. The device status monitoring unit obtains the operation parameters of water service devices in real time and judges whether the devices are in a safe state for executing instructions by comparing with preset safety thresholds, effectively avoiding the failure risk caused by executing instructions due to device anomalies. For example, during the operation of a water pump, if it is detected that the motor temperature is too high, the system will prohibit issuing instructions that may increase the device burden to ensure the safe and stable operation of the device. The instruction optimization unit selects the optimal parameter combination for instruction execution according to the device historical response data, using the greedy algorithm in combination with the parameter constraint library and the cost function construction unit. Taking the adjustment of the water pump flow rate as an example, this unit will comprehensively consider factors such as device energy consumption, execution time, and error range to select the best flow rate parameter, which not only improves the device operation efficiency but also reduces energy consumption and errors, realizing precise and intelligent instruction control.
[0056] The collaborative scheduling engine is one of the core advantages of the present invention. Based on the priority of data streams and the load status of device resources, it allocates the transmission paths of data streams and instructions through a dynamic routing algorithm. The path weight calculation unit comprehensively considers the real-time network latency, remaining bandwidth, and packet size of device nodes to calculate the comprehensive weight value of each path, ensuring the rationality of data transmission path selection. For example, for water quality monitoring data with high real-time requirements, the system will preferentially select paths with low network latency and sufficient bandwidth for transmission to ensure the timely acquisition of data. The path selection unit constructs a minimum spanning tree based on the comprehensive weight value and reserves redundant transmission channels for high-priority data streams, greatly improving the reliability of data transmission. At the same time, the preset load balancing strategy based on the real-time response latency and bandwidth occupancy of device nodes can effectively avoid network congestion, ensure the stable operation of the entire system, and improve the overall performance and reliability of the system.
[0057] The topology construction unit can dynamically discover the physical connection relationship and data dependency relationship between device nodes. The node relationship discovery subunit infers the physical connection relationship through the communication response time between devices, and the dependency analysis subunit constructs a directed data dependency graph between device nodes based on the content relevance of data streams. When device nodes are added or deleted, the topology update subunit timely updates the topology structure through an incremental algorithm. This enables the system to quickly adapt to the dynamic changes of water service devices and ensures that the data transmission path is always in the optimal state. For example, when a new device is connected to the water service industrial Internet, the system can automatically identify and update the topology structure, incorporating the new device into the data collection and instruction control scope, improving the scalability and flexibility of the system.
[0058] During the data collection and transmission process, the present invention provides a perfect processing mechanism for possible abnormal situations. The abnormal message processing subunit in the protocol parsing unit performs fragment recombination or triggers a retransmission request for messages that cannot match the template to ensure data integrity. The fault-tolerant retransmission unit in the collaborative scheduling engine reallocates the transmission path according to the historical success rate of the path when detecting packet loss, further improving the reliability of data transmission. The device status monitoring unit in the instruction control module monitors the device status in real time. Once an abnormality is detected, it immediately prohibits the execution of instructions and issues an alarm, comprehensively ensuring the stable operation of the water service system. Description of the Drawings
[0059] Figure 1 is the working principle diagram of the data collection and instruction control middleware for the water service industrial Internet described in the present invention;
[0060] Figure 2 is the working flow chart of water service instruction processing and optimization;
[0061] Figure 3 is the working flow chart of the dynamic routing of the collaborative scheduling engine. Specific Embodiments
[0062] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0063] Please refer to Figures 1-3 , the present invention provides a middleware for water service industrial Internet data collection and instruction control, aiming to solve the problems of multi-source heterogeneous data collection and instruction control in the water service industrial scenario, and realize efficient and stable data transmission and precise equipment control. Specifically, it includes:
[0064] Data collection module: Connects to water service equipment through multi-source heterogeneous interfaces. These interfaces have the ability to adapt to multiple communication protocols and can be compatible with the communication methods of different types of water service equipment. When collecting the dynamic data stream in the water service industrial scenario in real time, for analog signals, the analog signals output by the water service equipment are accessed by the device interface unit and converted into digital signals through analog-to-digital conversion; for digital signals, they are directly received and processed. The collected data is classified into structured data and unstructured data according to its characteristics and then transmitted to the data processing module. For example, the operating parameters of water service equipment, such as numerical data like water level and water pressure, belong to structured data; while the fault alarm text information of the equipment, equipment maintenance logs, etc. belong to unstructured data.
[0065] Data processing module: After receiving the dynamic data stream, first, the protocol adaptation unit calls the corresponding decoding rules according to the device communication protocol type to convert the heterogeneous data into a unified intermediate format. In this process, the protocol adaptation unit has a decoding rule library for multiple communication protocols built-in, such as decoding programs for common protocols like Modbus and OPC. Taking the Modbus protocol as an example, if a Modbus RTU format data packet is received, the protocol adaptation unit extracts the valid data according to its specific frame format. Then, the topology construction unit constructs a dynamic data stream topology structure based on the physical connection relationship and data dependency relationship between device nodes. The topology construction unit discovers the physical connection relationship through the node relationship discovery subunit by inferring the communication response time between devices; the dependency analysis subunit constructs a directed data dependency graph between device nodes based on the content relevance of the data stream; the topology update subunit updates the topology structure through an incremental algorithm when device nodes are added or deleted. After data processing, a standardized data packet is generated according to the preset data topology model for subsequent transmission and processing.
[0066] Instruction Control Module: Responsible for receiving external control instructions. The instruction decomposition unit disassembles the composite control instructions into an atomic operation sequence and marks the timing constraint relationships between operations. For example, for a composite instruction to control the start / stop of a water pump and adjust the flow rate, the instruction decomposition unit will disassemble it into atomic operations such as starting the water pump, adjusting the flow rate, and stopping the water pump, and mark the sequence of each operation. The device status monitoring unit continuously obtains the operating parameters of water supply devices, such as temperature, rotation speed, etc., and determines whether the device is in a safe state to execute instructions based on preset safety thresholds. The instruction optimization unit selects the optimal parameter combination for instruction execution through a greedy algorithm according to the device's historical response data. When selecting the optimal parameter combination, the instruction optimization unit utilizes the minimum / maximum operation thresholds of water supply devices and the coupling relationships between parameters stored in the parameter constraint library. The cost function construction unit uses device energy consumption, execution time, and error range as variables to establish a multi-objective optimization function. The iterative solution unit generates a candidate parameter set through Monte Carlo sampling and filters out the optimal solution that meets the constraint conditions.
[0067] Collaborative Scheduling Engine: Based on the priority of data streams and the load status of device resources, it allocates the transmission paths of data streams and instructions through a dynamic routing algorithm. The path weight calculation unit calculates the comprehensive weight value W of each path according to the real-time network delay D, remaining bandwidth B, and data packet size S of device nodes. The calculation formula is , where , , are weight coefficients, and , , , are the maximum values of network delay, remaining bandwidth, and data packet size respectively. The path selection unit constructs a minimum spanning tree based on the comprehensive weight value and reserves redundant transmission channels for high-priority data streams. The fault-tolerant retransmission unit reallocates the transmission path according to the historical success rate of the path when detecting data packet loss. The collaborative scheduling engine also coordinates the interaction timing of the data acquisition module, data processing module, and instruction control module to ensure the orderly operation of each module. A load balancing strategy based on the real-time response delay and bandwidth occupancy of device nodes is preset in the collaborative scheduling engine to optimize system performance.
[0068] The present invention will be further described below in conjunction with Embodiments 1 to 5:
[0069] Embodiment 1
[0070] In the data acquisition module, after the device interface unit accesses the analog signal output by the water supply sensor, it uses an efficient analog-to-digital conversion algorithm to convert the analog signal into a more accurate digital signal. During the conversion process, in order to reduce noise interference, the noise is filtered out through a filtering algorithm, so that the converted digital signal can more accurately reflect the true sensor measurement value.
[0071] When the protocol parsing unit identifies the header fields in the device communication protocol, the message feature extraction subunit identifies the positions of the start symbol, check code, and end symbol from the device message. For the identification of the start symbol and end symbol, a specific byte pattern matching algorithm is used. For example, if the start symbol is two fixed bytes "0xAA 0xBB", when the message feature extraction subunit receives the message data, it compares byte by byte. When it finds that two consecutive bytes match the start symbol, it determines the start position; similarly, it identifies the end symbol. The protocol template matching subunit compares the message structure with the pre-stored protocol templates for similarity, and selects the template with the highest matching degree for parsing. During the similarity comparison process, the Hamming distance algorithm is used to calculate the difference degree between the message structure and each protocol template. The Hamming distance calculation formula is , where and are two strings of equal length, and are the th characters in the strings respectively, is the exclusive OR operation, is the length of the string. The protocol template with the smallest Hamming distance is selected as the matching result. The abnormal message processing subunit performs fragmentation recombination or triggers a retransmission request for the message that cannot match the template. When it is found that the message cannot match the template, first, it determines whether the message is a fragmented message. If the message length is less than the normal message length and contains some valid data, it attempts to perform fragmentation recombination. According to the information such as the sequence number carried by the message, multiple fragmented messages are concatenated in order into a complete message; if recombination fails, a retransmission request is triggered to ensure the integrity of the data.
[0072] The data cache queue divides independent storage areas according to data categories. For example, water level data, water pressure data, water quality data, etc. are stored in different queue areas respectively. According to the data timeliness, the overflow elimination rules of the queue are set, and a combination of timestamp and first-in-first-out (FIFO) is adopted. For data with high timeliness requirements, such as real-time water pressure data, a shorter effective time is set. When the storage time of the data in the queue exceeds , regardless of whether the queue is full or not, it will be eliminated; for data with relatively low timeliness requirements, such as daily water quality monitoring data, a longer effective time is set. When the queue is full and new data enters, the data that entered the queue earliest is eliminated according to the first-in-first-out principle.
[0073] Embodiment 2
[0074] When the instruction decomposition unit disassembles a composite control instruction into an atomic operation sequence, it adopts a recursive parsing algorithm. For complex composite instructions, the instruction decomposition unit first determines whether the instruction contains sub-instructions. If it does, it recursively calls itself to disassemble each sub-instruction until an atomic operation sequence is obtained. In terms of annotating the timing constraint relationships between operations, the timestamp annotation method is adopted. A timestamp is assigned to each atomic operation, and the value of the timestamp represents the execution order of the operation in the entire instruction sequence. For example, for a composite instruction that controls the opening and closing of multiple valves, atomic operations such as opening valve 1, opening valve 2, closing valve 1, and closing valve 2 are respectively annotated with timestamps , , , , and , to clarify the order of execution between operations.
[0075] The device status monitoring unit continuously obtains the operating parameters of water supply equipment, such as the rotational speed of the water pump , the temperature of the motor , etc. When determining whether the device is in a safe state to execute instructions, multiple safety thresholds are preset. For example, the safe threshold range for the rotational speed of the water pump is , and the safe threshold for the temperature of the motor is . When it is monitored that the rotational speed of the water pump is less than or greater than , or the temperature of the motor is greater than , it is determined that the device is in an unsafe state, the execution of relevant instructions is prohibited, and an alarm signal is issued.
[0076] When the instruction optimization unit selects the optimal parameter combination for instruction execution through a greedy algorithm based on the historical response data of the device, it first establishes a historical response database of the device. The database stores the parameter combinations of each instruction execution and the corresponding device response results, including the energy consumption of the device , the execution time t, and the error range . The cost function construction unit takes the energy consumption of the device, the execution time, and the error range as variables to establish a multi-objective optimization function , where , , are weight coefficients, and , , , are respectively the maximum values of the energy consumption of the device, the execution time, and the error range. The iterative solution unit generates a candidate parameter set through Monte Carlo sampling. During the sampling process, random sampling is performed according to the parameter ranges in the parameter constraint library. For example, for the water pump flow regulation instruction, the value range of the flow parameter is , multiple candidate flow values are randomly generated within this range. Then, the optimal solution that meets the constraint conditions is selected. The constraint conditions include the minimum / maximum operation thresholds in the parameter constraint library and the coupling relationships between parameters. For example, there is a certain coupling relationship between flow and pressure. When the flow increases, the pressure will change accordingly, and this relationship needs to be considered when selecting the optimal solution.
[0077] Embodiment III
[0078] When calculating the comprehensive weight value of each path, the path weight calculation unit monitors the network delay, remaining bandwidth, and packet size in real time. For the network delay D, a heartbeat packet-based monitoring method is adopted. Every fixed time interval t 0 a heartbeat packet is sent to the device node, and the round-trip time of the heartbeat packet is recorded as the network delay D. The remaining bandwidth B is obtained by querying the interface status information of the network device. The packet size S is measured when the packet is generated. In the formula for calculating the comprehensive weight value W , the weight coefficients , , are dynamically adjusted according to different application scenarios. For example, in a scenario with high real-time requirements, increase the value of , and decrease the values of and so that the network delay accounts for a larger proportion in the weight calculation.
[0079] When the path selection unit constructs a minimum spanning tree based on the comprehensive weight value, the Prim algorithm is used. Starting from a certain device node, continuously select the edge with the smallest weight connected to the nodes already added to the tree, and add the corresponding nodes to the tree until all nodes are added. In terms of reserving redundant transmission channels for high-priority data streams, according to the priority level of the data stream, a certain number of backup paths are reserved for high-priority data streams. For example, the data streams are divided into three priorities. For the highest-priority data stream, two backup paths are reserved; for the second-highest-priority data stream, one backup path is reserved.
[0080] When the fault-tolerant retransmission unit detects packet loss, the packet loss detection subunit determines whether packet loss has occurred based on the continuity of the packet sequence numbers. When the received packet sequence number is interrupted, it is determined that packet loss has occurred. The path reliability evaluation subunit statistically calculates the historical packet loss rate P and the average delay of each path, and generates a path reliability score R. The calculation formula is , where is the maximum value of the average delay. The dynamic switching subunit selects a backup path with a score higher than the threshold for data transmission during retransmission. When packet loss is detected and the reliability score R of the current path is lower than the threshold When there is a need for retransmission, select the path with the highest score from the alternative paths for retransmission.
[0081] Embodiment 4
[0082] In this embodiment, the instruction optimization unit is further improved in depth to improve the accuracy and efficiency of optimizing instruction execution parameters.
[0083] When the parameter constraint library stores the minimum / maximum operation thresholds of water service equipment and the coupling relationships between parameters, a relational database is used for management. For example, for the flow rate and pressure parameters of a water pump, a data table is established in the database to record the minimum value of the flow rate , the maximum value , the minimum value of the pressure , the maximum value , and the coupling relationship expression between the flow rate and the pressure, such as , where k and b are constants.
[0084] When the cost function construction unit uses equipment energy consumption, execution time, and error range as variables to establish a multi-objective optimization function, more actual factors are considered. In addition to equipment energy consumption , execution time t, and error range , the degree of equipment wear W is also added as a variable to construct a new multi-objective optimization function , where is the weight coefficient of the degree of equipment wear, and is the maximum value of the degree of equipment wear. The degree of equipment wear W is estimated based on factors such as equipment operation time and load size.
[0085] When the iterative solution unit generates a candidate parameter set through Monte Carlo sampling, the sampling space division sub-unit discretizes the continuous parameter space into a multi-dimensional grid according to the parameter constraint library. For example, for the optimization problem of two parameters, flow rate and pressure, the value range of the flow rate is divided into n intervals, and the value range of the pressure is divided into m intervals, forming n×m grid intersection points. The grid search sub-unit calculates the cost function value at the grid intersection points and records the local optimal solutions. The convergence judgment sub-unit determines whether the convergence condition is reached based on the difference between the optimal solutions of adjacent iteration rounds. Let the optimal solutions obtained in two adjacent iterations be F i and . When , it is determined that the convergence condition is reached, where is the preset convergence accuracy.
[0086] Embodiment 5
[0087] In the topology construction unit, when the node relationship discovery subunit infers the physical connection relationship through the communication response time between devices, it adopts the method of taking the average value of multiple measurements. To reduce measurement errors, probe packets are sent to device nodes at regular time intervals, the communication response time is recorded, and the average value is taken as the communication response time between devices after continuous measurement n times. . According to the size of to judge the physical connection relationship. If is less than the threshold
[0088] it is considered that there is a physical connection between the two device nodes. Based on the content relevance of the data flow, the dependency analysis subunit constructs a data dependency directed graph between device nodes. The data flow tracing subunit marks the sequence of device nodes through which the data flows and records the processing delay of each node. For example, when a set of water quality monitoring data is transmitted from sensor node A to data processing node B and then to storage node C, the node sequence A is marked, and the processing delays t B of nodes A and B are recorded. th The association rule mining subunit discovers the strong association relationship between device nodes through the frequent item set algorithm. In the frequent item set algorithm, the support threshold S th and the confidence threshold C th are set. For the device node set I, calculate the frequency of each subset appearing in the dataset. If the frequency is greater than the support threshold S th, then the subset is a frequent item set. For the frequent item set, calculate its confidence. If the confidence is greater than the confidence threshold C
[0089] it is considered that there is a strong association relationship. The directed graph generation subunit maps the association relationship into a weighted directed edge and constructs a minimum spanning tree topology. The weight is set according to the strength of the association relationship. The stronger the association relationship, the greater the weight.
[0090] In the protocol parsing unit, when the message feature extraction subunit identifies the positions of the start symbol, check code, and end symbol from the device message, for the identification of the check code, the cyclic redundancy check (CRC) algorithm is adopted. According to the preset CRC polynomial, the message data is calculated to obtain the calculation result , and the check code carried in the message for comparison. If , the check passes; otherwise, it is determined that there may be an error in the message data. When the protocol template matching subunit compares the message structure with the pre-stored protocol template, in addition to using the Hamming distance algorithm, semantic analysis is also added. For some fields with specific semantics, such as the device type field, semantic matching is performed to improve the accuracy of the matching. When the abnormal message processing subunit performs fragment recombination or triggers a retransmission request for a message that cannot match the template, during the fragment recombination process, if an error is found in the fragment message, error correction coding technology is used for error correction. For example, the Hamming code is used to correct the error in the fragment message to improve the success rate of fragment recombination.
[0091] It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device.
[0092] Although the embodiments of the present invention have been shown and described, it will be understood by those of ordinary skill in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the present invention, and the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A water industry Internet data collection and command control middleware, characterized in that: The middleware includes: The data acquisition module is used to connect with water equipment through multi-source heterogeneous interfaces, collect dynamic data streams in water industry scenarios in real time, and classify the data streams into structured data and unstructured data before transmitting them to the data processing module; A data processing module, used for performing protocol normalization processing on the dynamic data stream and generating a standardized data packet according to a preset data topology model; The command control module is used to receive external control commands, parse the operation objects and parameters in the commands, and dynamically generate executable command sets for the equipment according to the real-time status of the water equipment; The collaborative scheduling engine is used to allocate the transmission paths of data streams and instructions through a dynamic routing algorithm based on the priority of data streams and the load status of device resources, and coordinate the interaction timing of the data acquisition module, data processing module and instruction control module; Wherein, the data processing module includes: The protocol adapter unit is used to call the corresponding decoding rules according to the device communication protocol type and convert the heterogeneous data into a unified intermediate format; A topology construction unit is used to construct a dynamic data flow topology structure based on the physical connection relationship and data dependency relationship between device nodes; The collaborative scheduling engine is pre-installed with a load balancing strategy based on the real-time response delay and bandwidth occupancy of the device nodes; The command control module comprises: Instruction decomposition unit, used to decompose compound control instructions into atomic operation sequences and mark the timing constraints between operations; Equipment status monitoring unit, used to obtain the operating parameters of water equipment in real time and determine whether the equipment is in a safe state to execute instructions; The instruction optimization unit is used to select the optimal parameter combination for instruction execution through a greedy algorithm based on the historical response data of the device; The instruction optimization unit also includes: Parameter constraint library, used to store the minimum / maximum operating thresholds of water equipment and the coupling relationship between parameters; The cost function building unit is used to build a multi-objective optimization function using device energy consumption, execution time and error range as variables; The iterative solution unit is used to generate a candidate parameter set through Monte Carlo sampling and select the optimal solution that meets the constraint conditions.
2. The water industry Internet data collection and command control middleware according to claim 1 is characterized in that: The data acquisition module also includes: The device interface unit connects various water production equipment and sensor equipment through dynamic loading and driving. For devices that output analog signals, the analog signals are converted into digital signals through algorithms. A protocol parsing unit, used to identify the message header fields in the device communication protocol and extract the effective data payload; The data cache queue is used to divide independent storage areas by data category and set queue overflow elimination rules based on data timeliness.
3. The water industry Internet data collection and command control middleware according to claim 1 is characterized in that: The collaborative scheduling engine specifically includes: A path weight calculation unit, used to calculate the comprehensive weight value of each path according to the real-time network delay, remaining bandwidth and data packet size of the device node; A path selection unit, used to construct a minimum spanning tree based on the comprehensive weight value and reserve redundant transmission channels for high priority data streams; The fault-tolerant retransmission unit is used to reallocate the transmission path according to the historical success rate of the path when data packet loss is detected.
4. The water industry Internet data collection and command control middleware according to claim 2 is characterized in that: The protocol parsing unit specifically includes: The message feature extraction subunit is used to identify the positions of the start character, check code and end character from the device message; The protocol template matching subunit is used to compare the message structure with the pre-stored protocol template for similarity and select the template with the highest matching degree for parsing; The abnormal message processing subunit is used to reassemble the fragments of the message that cannot match the template or trigger a retransmission request.
5. The water industry Internet data collection and command control middleware according to claim 1 is characterized in that: The topology construction unit specifically includes: A node relationship discovery subunit, used to infer physical connection relationships through communication response time between devices; The dependency analysis subunit is used to construct a data dependency directed graph between device nodes based on the content relevance of the data stream; The topology update subunit is used to update the topology structure through an incremental algorithm when device nodes are added or deleted.
6. The water industry Internet data collection and command control middleware according to claim 3 is characterized in that: The error-tolerant retransmission unit also includes: A packet loss detection subunit, used to determine whether packet loss occurs based on the continuity of the sequence number of the data packet; The path reliability evaluation subunit is used to count the historical packet loss rate and average delay of each path and generate a path reliability score; The dynamic switching subunit is used to select a backup path with a score higher than a threshold for data transmission during retransmission.
7. The water industry Internet data collection and command control middleware according to claim 1 is characterized in that: The iterative solution unit also includes: A sampling space partitioning subunit is used to discretize the continuous parameter space into a multi-dimensional grid according to the parameter constraint library; The grid search subunit is used to calculate the cost function value at the grid intersection and record the local optimal solution; The convergence judgment subunit is used to judge whether the convergence condition is met according to the difference of the optimal solutions of adjacent iteration rounds.
8. The water industry Internet data collection and command control middleware according to claim 5 is characterized in that: The dependency analysis subunit specifically includes: The data flow tracking subunit is used to mark the sequence of device nodes through which data flows and record the processing delay of each node; The association rule mining subunit is used to discover the strong association relationship between device nodes through the frequent item set algorithm; The directed graph generation subunit is used to map the association relationship into directed edges with weights and construct the minimum spanning tree topology.
Citation Information
Patent Citations
Asset data acquisition method based on Internet of Things
CN119254791A
Remote control method and device for cooking equipment, equipment and storage medium
CN119363795A