A heterogeneous device-oriented environmental air quality intelligent station cooperative linkage control method

By constructing an addressing mapping table and a state dependency graph, combined with dynamic priority rearrangement and timeout timers, the interruption problem caused by changes in device state in the linkage control of heterogeneous devices was solved, realizing adaptive linkage control of the intelligent ambient air quality station and improving the automation level and operational stability of device linkage.

CN123177243APending Publication Date: 2026-11-27HANGZHOU WEIZHIZHAO INTELLIGENT TECH CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611361922.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-03
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

In existing intelligent ambient air quality monitoring stations, the linkage control of heterogeneous devices cannot sense changes in the real-time operating status of the devices. This can easily lead to interruptions or erroneous results during the linkage process due to device overload or malfunction. Furthermore, the maintenance costs are high and logical errors are easily introduced when devices are replaced or the topology is changed.

Method used

By constructing an addressing mapping table and a state dependency graph based on device identity, a candidate node execution sequence is generated, and a dynamic priority reordering mechanism is introduced to adjust the execution order according to the real-time status feedback of the device. Combined with a timeout timer and a global reset process, adaptive linkage control is achieved.

Benefits of technology

It improves the flexibility and robustness of linkage control, reduces interruptions caused by equipment busyness, idleness or failure, enhances the continuity and reliability of automated operation and maintenance, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123177243A_ABST
    Figure CN123177243A_ABST
Patent Text Reader

Abstract

The application discloses a kind of environmental air quality intelligent station collaborative linkage control methods for heterogeneous equipment, belong to environmental air quality monitoring technical field.It includes: scanning the heterogeneous equipment accessed in station house, extracting the communication protocol type and register address range of each device, constructing addressing mapping table based on device identity identification;According to addressing mapping table, corresponding virtual device node is allocated to each device, and state dependency graph between virtual device node is established;Obtain the linkage trigger event configured by user, and analyze the linkage trigger event into initial node instruction;With initial node instruction as starting point, forward breadth traversal is carried out along state dependency graph, and candidate node execution sequence is generated.The method can automatically generate linkage execution sequence and dynamically adjust execution priority according to real-time state of device, improve the adaptive ability of heterogeneous equipment collaborative control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of ambient air quality monitoring, and in particular, to a method for cooperative linkage control of an ambient air quality intelligent station oriented to heterogeneous devices. Background Art

[0002] Existing ambient air quality intelligent stations integrate multiple heterogeneous types of monitoring, calibration, and auxiliary devices, with significant differences in communication protocols and register mapping relationships among devices. When implementing station operation and maintenance linkage control, pre-defined fixed instruction scripts or statically configured linkage process tables are commonly used to solidify the cooperative actions between devices in program logic. When a trigger event occurs, the system sequentially issues control instructions to each device in a preset order to complete the entire linkage process.

[0003] The above fixed-sequence linkage control method cannot perceive real-time operating state changes of devices during the linkage process. In actual station operation, each device may be in different working conditions such as sampling, analysis, calibration, or fault. When executing a fixed instruction sequence, if a preceding device is in a busy state and cannot respond to instructions in a timely manner, or if a certain device malfunctions, subsequent linkage steps that rely on the output results of this device will directly fail, leading to interruption of the entire linkage task or erroneous results. Operation and maintenance personnel have to intervene to conduct state troubleshooting and process correction, which reduces the continuity and reliability of automated station operation.

[0004] On the other hand, the gas path connections and circuit signal interactions between devices in the station form inherent process dependency relationships, which determine the logical sequence of linkage control actions. The existing fixed script method usually relies on manual sorting of these dependency relationships and manual arrangement of instruction sequences. When devices are replaced, topology changes occur, or local faults need to be isolated, the script must be modified, resulting in high maintenance costs and easy introduction of logical errors.

[0005] Therefore, in the cooperative linkage control of heterogeneous devices, it is necessary to solve the problem of automatically generating an execution sequence that conforms to the physical and logical dependency relationships between devices, and on this basis, solve the problem of dynamically adjusting the execution order of device instructions based on real-time device state feedback obtained during the linkage process, so as to avoid linkage blockage and failure caused by device busy / idle status or faults. Summary of the Invention

[0006] This invention provides a collaborative control method for intelligent ambient air quality stations with heterogeneous equipment. The aim is to achieve automatic construction and real-time adaptive optimization of the linkage control process for heterogeneous equipment. By establishing a state dependency graph between virtual equipment nodes, the method automatically derives candidate sequences for linkage execution. Before the sequence is executed, a dynamic priority reordering mechanism based on real-time equipment status feedback is introduced, enabling the linkage control to adapt to the dynamic changes in the operating status of equipment within the station, reducing linkage interruptions caused by equipment busyness, idleness, or failure, and improving the flexibility and robustness of automated operation and maintenance of the station.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a collaborative control method for an intelligent air quality station for heterogeneous devices, characterized by comprising: scanning the heterogeneous devices connected within the station building, extracting the communication protocol type and register address range of each device, and constructing an addressing mapping table based on device identity; assigning a corresponding virtual device node to each device according to the addressing mapping table, and establishing a state dependency graph between the virtual device nodes; acquiring user-configured linkage trigger events, and parsing the linkage trigger events into initial node instructions; performing a forward breadth-first traversal along the state dependency graph starting from the initial node instructions to generate a candidate node execution sequence; performing dynamic priority reordering for each node in the candidate node execution sequence based on its corresponding real-time device status feedback value to obtain an optimized execution sequence; sending control frames to the corresponding physical devices according to the optimized execution sequence, and starting a timeout timer after each control frame is sent, and deciding whether to continue executing the next node or trigger a global reset process based on the timeout result and the status word returned by the device.

[0008] As a technical solution of the present invention, the step of extracting the communication protocol type and register address range of each device and constructing an addressing mapping table based on device identification specifically includes: reading the identification information frame broadcast by each device, parsing the manufacturer code, device model, and firmware version number from the identification information frame; matching the manufacturer code and device model with a pre-stored protocol feature library to determine the communication protocol type and register address mapping rules of the device; calculating the status register address range and control register address range of each device according to the register address mapping rules; and associating and storing the device identification with the corresponding communication protocol type, status register address range, and control register address range to form the addressing mapping table. In this way, regardless of the brand or model of the analyzer, sampling pump, or valve connected to the station, they can be automatically identified and incorporated into a unified addressing system, laying the foundation for subsequent precise control.

[0009] Preferably, the step of assigning a corresponding virtual device node to each device according to the addressing mapping table and establishing a state dependency graph between the virtual device nodes specifically includes: instantiating a virtual device node containing an input queue and an output queue for each device according to the device identity identifier in the addressing mapping table; obtaining a preset station process flow topology file, and parsing the gas path connection relationship and circuit signal connection relationship of each device from the topology file; adding directed edges between the virtual device nodes according to the gas path connection relationship and the circuit signal connection relationship, with the direction of the directed edges pointing from the upstream device to the downstream device; generating the state dependency graph according to the directed edges and the virtual device nodes, and attaching the predecessor node list and successor node list of each node in the state dependency graph. By introducing the process topology file, the physical flow direction and electrical interlock signals of the sample gas from the cutter, sampling pipeline to the analytical instrument and then to the venting are realistically restored, making the linkage logic naturally conform to the process constraints and avoiding control conflicts.

[0010] As a further improvement of the present invention, the step of obtaining the user-configured linkage trigger event and parsing the linkage trigger event into an initial node instruction specifically includes: receiving the user-configured linkage trigger event, which includes an event type identifier and event trigger parameters; querying a preset event-instruction conversion table according to the event type identifier to obtain an instruction template corresponding to the event type identifier; filling the event trigger parameters into the parameter field of the instruction template to generate an initial node instruction; querying the addressing mapping table according to the target device identity identifier in the initial node instruction to route the initial node instruction to the corresponding virtual device node, and marking the virtual device node as the starting execution node. Thus, the user's macro-level operational intent is accurately decomposed into basic machine instructions acting on a specific device, achieving a seamless conversion from business semantics to device actions.

[0011] Based on this, the step of generating a candidate node execution sequence by performing a forward breadth-first traversal along the state dependency graph, starting from the initial node instruction, specifically includes: setting the initial execution node as the current layer node set and initializing the candidate node execution sequence to empty; traversing each node in the current layer node set, obtaining the successor node list for that node, and adding all nodes in the successor node list to the next layer node set; when the next layer node set is not empty, checking whether each node in the next layer node set is already in the candidate node execution sequence, and if not, appending the next layer node set to the end of the candidate node execution sequence; assigning the next layer node set to the current layer node set, and repeating the above traversal operation until the current layer node set is empty, thus obtaining a candidate node execution sequence containing hierarchical order. This forward breadth-first traversal mechanism ensures that all devices affected by the initial event are included in the execution queue in the correct causal order, effectively preventing downstream devices from acting prematurely or being missed.

[0012] To ensure the real-time adaptability of the execution sequence, the step of dynamically prioritizing each node in the candidate node execution sequence based on its corresponding real-time device status feedback value to obtain an optimized execution sequence specifically includes: sequentially selecting one node from the candidate node execution sequence as the current processing node; sending a status query frame to the physical device corresponding to the current processing node, receiving the status word returned by the physical device, and parsing the device busy / idle flag and fault flag from the status word; calculating the execution priority value of the current processing node based on the combined status of the device busy / idle flag and the fault flag; when the execution priority value is lower than a preset priority threshold, swapping the current processing node with the first subsequent node in the candidate node execution sequence whose priority value is higher than the priority threshold; repeating the above steps of extraction, parsing, calculation, and swapping until all nodes in the candidate node execution sequence have been traversed to generate the optimized execution sequence. This method dynamically adjusts the execution order by online sensing of device busy / idle and health status, avoiding queue blocking due to individual device busyness or abnormalities, and significantly improving the smoothness and success rate of overall linkage.

[0013] The specific method for calculating the execution priority value of the current processing node based on the combined state of the device busy / idle flag and the fault flag is as follows: Read the first value of the device busy / idle flag and the second value of the fault flag; when the second value indicates that the device is in a fault state, set the execution priority value of the current processing node to the lowest priority value; when the second value indicates that the device is not in a fault state and the first value indicates that the device is in an idle state, set the execution priority value of the current processing node to the highest priority value; when the second value indicates that the device is not in a fault state and the first value indicates that the device is in a busy state, calculate the waiting time coefficient based on the task remaining time field in the status word, and determine the execution priority value based on the waiting time coefficient. This hierarchical priority calculation strategy ensures that healthy and idle devices are prioritized for scheduling, while faulty devices are automatically delayed or disabled, achieving dynamic optimal allocation of system resources.

[0014] Preferably, the steps of sending control frames to the corresponding physical devices according to the optimized execution sequence, starting a timeout timer after each control frame is sent, and deciding whether to continue executing the next node or trigger a global reset process based on the timeout result and the status word returned by the device, specifically include: taking a node sequentially from the optimized execution sequence as the current node to be executed; obtaining the control register address range from the addressing mapping table according to the device identity of the current node to be executed; assembling a control frame according to the control register address range and the instruction parameters of the current node to be executed; sending the control frame to the corresponding physical device and starting a timeout timer at the time of sending; waiting to receive the status word returned by the physical device when the timeout timer value does not exceed a preset timeout threshold, and parsing the instruction response code in the status word; continuing to execute the next node in the optimized execution sequence when the instruction response code indicates execution failure or the timeout value exceeds the timeout threshold, and triggering a global reset process. By equipping each frame of instructions with independent timeout monitoring and response verification, the system has the ability to quickly detect single-step anomalies, ensuring control reliability while providing a clear trigger entry point for fault recovery.

[0015] Furthermore, the steps for triggering the global reset process include: immediately stopping the execution of nodes that have not yet been executed in the optimized execution sequence and generating an interrupt flag; sending emergency stop frames to all physical devices that have issued control frames but have not returned a success status word, according to the addressing mapping table; traversing all virtual device nodes in the state dependency graph and sending a state reset frame to the physical device corresponding to each virtual device node, the state reset frame carrying an instruction code to restore the factory sampling mode; recording the interrupt flag, the identity of the currently timed-out physical device, and the current timestamp to the interrupt log, and generating a task list to be restored according to the dependency relationship of the incomplete nodes in the interrupt log. This global reset process ensures that in the event of an unrecoverable failure during a single linkage, the entire station can safely return to the known initial sampling state and retain complete on-site information, facilitating post-event traceability and task continuation, thereby ensuring the continuity and effectiveness of ambient air monitoring data.

[0016] Preferably, the control frame includes a frame header, a device identification field, a register address field, an instruction code field, an instruction parameter field, and a frame tail check field. The control frame adopts a unified structured design, enabling heterogeneous devices to be driven by the same set of control logic and shielding them from underlying protocol differences.

[0017] This invention abstracts physically dispersed and protocol-inconsistent ambient air monitoring devices into a unified virtual node network by constructing an addressing mapping table and a state dependency graph. It generates an initial execution sequence based on a forward breadth-first traversal of dependencies and introduces a dynamic priority reordering mechanism based on real-time state feedback. This ensures that the linkage process strictly adheres to the sequential constraints of the process flow while adapting to the current busy / idle status and health condition of the devices. Combined with frame-by-frame timeout response monitoring and a robust global reset strategy, it effectively solves the problems of response delay, logical conflicts, and difficulty in anomaly recovery in the collaborative control of heterogeneous devices, significantly improving the automation level and operational stability of the linkage of intelligent urban ambient air quality stations.

[0018] The technical effects and advantages provided by the present invention in the above technical solution are as follows: By scanning the heterogeneous devices connected and extracting their communication protocol types and register address ranges, an addressing mapping table based on device identity is constructed, unifying the underlying differentiated physical communication details into addressable register operation interfaces. Based on this, a virtual device node is instantiated for each device, and directed edges are generated according to the gas path connections and circuit signal connections in the station's process flow, forming a state dependency graph. Starting from the initial node instruction parsed from the linkage trigger event, a forward breadth-first traversal is performed on the state dependency graph, acquiring successor nodes layer by layer and generating a candidate node execution sequence with hierarchical order. This process automatically converts the physical connection topology between devices into an execution sequence that conforms to the process's causal logic, eliminating the need for manual script pre-compilation or manual scheduling of linkage steps. When the station's device access relationships change, only the topology configuration file needs to be updated to regenerate an execution sequence adapted to the new topology, reducing the configuration workload for station maintenance and eliminating logical errors in sequence caused by human misunderstanding.

[0019] After obtaining the candidate node execution sequence, instead of issuing instructions directly in a static order, status query frames are sent sequentially to the physical devices corresponding to each node in the sequence. The busy / idle flag and fault flag in the returned status word are parsed. An execution priority value is calculated for each node based on the combined status of the fault flag and the busy / idle flag: when a device is in a fault state, the corresponding node is set to the lowest priority to avoid repeatedly sending invalid control instructions to the faulty device; when a device is idle, it is given the highest priority so that it can be scheduled for execution first; when a device is busy, a waiting time coefficient is calculated based on the task remaining time field in the status word, and an intermediate priority value is generated. The candidate node execution sequence is dynamically rearranged based on this priority value, swapping the positions of low-priority nodes with subsequent high-priority nodes. This process allows the coordinated execution sequence to adaptively adjust the execution order according to the transient operating conditions of each device, prioritizing devices that can be executed immediately and shifting or logically avoiding devices that are temporarily unresponsive. This effectively reduces the overall delay caused by waiting for a single device to be ready and avoids the entire coordinated sequence from being stuck due to a single point of failure, improving the execution efficiency and process integrity of the coordinated process. Meanwhile, during the control frame issuance phase, node-by-node decision-making is performed by combining the timeout timer and the status word returned by the device. When the instruction response code indicates failure or timeout occurs, a global reset process is triggered, stopping unexecuted nodes and sending emergency stop frames and status reset frames to protect the safety of field equipment and generate a recoverable task list, further enhancing the handling capability under abnormal operating conditions. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.

[0021] Figure 1 This is a flowchart of a collaborative control method for an intelligent ambient air quality station oriented towards heterogeneous devices. Figure 2 This is a flowchart of the address mapping table construction process based on device identity. Detailed Implementation

[0022] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. 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.

[0023] See Figure 1 This invention provides a collaborative control method for an intelligent air quality monitoring station with heterogeneous devices. The method includes: scanning the heterogeneous devices connected to the station, extracting the communication protocol type and register address range of each device, and constructing an addressing mapping table based on device identity; assigning a corresponding virtual device node to each device according to the addressing mapping table, and establishing a state dependency graph between the virtual device nodes; acquiring user-configured linkage trigger events and parsing the linkage trigger events into initial node instructions; performing a forward breadth-first traversal along the state dependency graph starting from the initial node instructions to generate a candidate node execution sequence; for each node in the candidate node execution sequence, performing dynamic priority reordering based on its corresponding real-time device status feedback value to obtain an optimized execution sequence; sending control frames to the corresponding physical devices according to the optimized execution sequence, and starting a timeout timer after each control frame is sent; and deciding whether to continue executing the next node or trigger a global reset process based on the timeout result and the status word returned by the device.

[0024] In specific implementation, please refer to Figure 2The process of scanning heterogeneous devices connected to the station and extracting the communication protocol type and register address range of each device to construct an addressing mapping table based on device identification is implemented in the following way: The collaborative linkage controller listens to a predefined broadcast port through the station's local area network. After the heterogeneous devices start up, they send out identification information frames. The identification information frames use User Datagram Protocol (UDP) messages, and the message data segment includes a frame synchronization header field, a device identification field, a vendor code field, a device model field, a firmware version number field, and a cyclic redundancy check (CRC) field. After receiving the identification information frame, the collaborative linkage controller verifies the CRC field. If the verification is successful, the vendor code, device model, and firmware version number are parsed from the identification information frame.

[0025] Optionally, heterogeneous equipment includes particulate matter analyzers, gaseous pollutant analyzers, dynamic calibrators, zero-gas generators, and sampling manifold control units. The equipment identification for each type of heterogeneous equipment consists of a globally unique serial number burned into the device at the factory. The collaborative controller maintains an online equipment list; after resolving the manufacturer's identifier and equipment model, it marks the equipment as online.

[0026] The collaborative controller uses the parsed manufacturer code and device model as joint query conditions to retrieve the locally stored protocol feature library. The protocol feature library is a pre-built structured data table, where each record contains a manufacturer code column, a device model column, a communication protocol type column, and a register address mapping rule identifier column. When a record matching both the manufacturer code and device model is found in the protocol feature library, the collaborative controller reads the value of the communication protocol type column as the communication protocol type of the heterogeneous device, and simultaneously reads the value of the register address mapping rule identifier column, loading the corresponding register address mapping rule from the rule configuration file based on the identifier. The register address mapping rule defines the status register base address, the control register base address, and the address range span.

[0027] Based on the loaded register address mapping rules, the collaborative controller calculates the status register address range and control register address range for each heterogeneous device. For devices using the Modbus protocol, the starting address of the status register address range is determined by the following formula:

[0028] in, Indicates the starting address of the address range of the status register; This represents the predefined base address of the status register in the register address mapping rule. It is read directly from the corresponding field in the rule configuration file and is a hexadecimal value. represents the device index number extracted from the device identity identifier, where the extraction method involves taking the last two characters of the device identity identifier string, converting these two characters into a decimal integer, and if the converted value is greater than 99, taking the remainder of this value modulo 100 as the , with a value ranging from 0 to 99; represents the address interval span of a single device's registers. Based on the statistics of the maximum number of registers required for a single device in the ambient air quality intelligent station, the total number of status and control registers for various analyzers and auxiliary devices does not exceed 200, therefore is set to 200. The end address of the status register address interval is determined by . The start address of the control register address interval uses the control register base address predefined in the register address mapping rules , and utilizes the same and to calculate according to the above formula form , and the end address of the control register address interval is determined by . For other communication protocol types that are not Modbus protocols, the register address mapping rules specify the address calculation function corresponding to each protocol, and the cooperative linkage controller calls the corresponding address calculation function to obtain the status register address interval and the control register address interval.

[0029] The cooperative linkage controller associates the device identity identifier of each heterogeneous device, the determined communication protocol type, the calculated status register start address, status register end address, control register start address, and control register end address, encapsulates them into a mapping record, and stores the mapping records of all heterogeneous devices into the addressing mapping table. The addressing mapping table is implemented in memory as a hash table, using the device identity identifier as the key and the mapping record as the value, supporting constant-time complexity lookup operations through the device identity identifier. After the addressing mapping table is constructed, the cooperative linkage controller reports the ready status to the station management platform, waiting for the user to configure linkage trigger events.

[0030] In implementation, the collaborative controller assigns a corresponding virtual device node to each device based on the addressing mapping table and establishes a state dependency graph between the virtual device nodes. The collaborative controller iterates through each mapping record stored in the addressing mapping table and extracts the device identity field from the mapping record. For each extracted device identity, the collaborative controller instantiates a virtual device node object. The virtual device node object contains a node identifier field, a device identity field, an input queue field, an output queue field, a predecessor node list field, and a successor node list field. The node identifier field is assigned a globally unique incrementing integer value, and the device identity field is assigned the device identity extracted from the addressing mapping table. The input queue and output queue fields are each initialized as a first-in, first-out (FIFO) message queue. The input queue is used to receive messages sent by upstream virtual device nodes, and the output queue is used to forward messages to downstream virtual device nodes.

[0031] Optionally, the virtual device node object also includes a node status field, which is initially set to the "idle" state. The collaborative controller maintains a virtual node index table in memory, using the device identity as the key and pointers to virtual device node objects as the values, to establish a fast mapping relationship between device identities and virtual device nodes.

[0032] The collaborative controller reads the station's process flow topology file stored in non-volatile memory. The station's process flow topology file uses Extensible Markup Language (XML) format, with multiple device connection relationship elements under the root element. Each device connection relationship element includes an upstream device identifier sub-element, a downstream device identifier sub-element, a connection type sub-element, and a connection feature sub-element. The connection type sub-element takes the value of either "gas path" or "circuit signal." The connection feature sub-element records the gas path interface number when the connection type sub-element is "gas path," and records the signal line number when the connection type sub-element is "circuit signal." The collaborative controller parses the station's process flow topology file, extracts each group of device connections, and encapsulates each group of device connections into a connection relationship triplet. The connection relationship triplet has the form (upstream device identifier, downstream device identifier, connection type). All connection relationship triplets constitute the connection relationship set.

[0033] The collaborative controller iterates through each triplet of connection relationships in the set. For each triplet, the controller extracts the upstream and downstream device identifiers, searches for the virtual device node object corresponding to the upstream device identifier in the virtual node index table, and marks this virtual device node object as the upstream virtual device node. Simultaneously, it searches for the virtual device node object corresponding to the downstream device identifier in the virtual node index table and marks this virtual device node as the downstream virtual device node. The controller checks if a directed virtual edge with the same direction already exists between the upstream and downstream virtual device nodes. If not, it adds a directed virtual edge between them, with the direction of the edge pointing from the upstream virtual device node to the downstream virtual device node. This addition of a directed virtual edge simultaneously triggers updates to the predecessor and successor node lists of both virtual device nodes: the node identifier of the downstream virtual device node is appended to the successor node list of the upstream virtual device node, and the node identifier of the upstream virtual device node is appended to the predecessor node list of the downstream virtual device node.

[0034] Optionally, when the connection type in the connection triplet is "gas path", the coordinated linkage controller also adds a gas path connection attribute to the virtual directed edge, which includes gas path interface number information. When the connection type in the connection triplet is "circuit signal", the coordinated linkage controller adds a circuit signal connection attribute to the virtual directed edge, which includes signal line number information.

[0035] After processing all connection triples, the collaborative controller generates a state dependency graph based on all created virtual device node objects and the virtual directed edges between them. This graph is organized in memory as an adjacency list, with each virtual device node as a vertex. Each vertex's adjacency list contains all subsequent vertices pointed to by virtual directed edges originating from that vertex. Furthermore, to support reverse traversal, the collaborative controller also maintains a reverse adjacency list for each vertex in the state dependency graph. This reverse adjacency list contains all virtual directed edges pointing to the preceding vertex.

[0036] The collaborative controller calculates and attaches a list of predecessor nodes and a list of successor nodes for each virtual device node in the state dependency graph. For any virtual device node... The list of preceding nodes is generated by traversing the reverse adjacency list. For associated edges, add the starting vertex of the edge to the list of predecessor nodes. The list of successor nodes is generated by traversing the adjacency list. For associated edges, the terminating vertex of the edge is added to the successor node list. Each element in the predecessor node list stores the node identifier and device identity identifier of the corresponding predecessor virtual device node, and each element in the successor node list stores the node identifier and device identity identifier of the corresponding successor virtual device node. Ultimately, each virtual device node in the state dependency graph carries both a predecessor node list and a successor node list, which are directly used to obtain the node's adjacent node information during subsequent forward breadth-first traversal.

[0037] In practice, the collaborative linkage controller acquires the user-configured linkage trigger events and parses them into initial node instructions. The controller provides a linkage configuration interface to the station management platform, where users select a preset event type or a custom event type and fill in the event trigger parameters. The station management platform packages the user-configured linkage trigger events into a linkage trigger message, which includes an event type identifier field and an event trigger parameter field. The collaborative linkage controller receives the linkage trigger message and extracts the event type identifier and event trigger parameters from it.

[0038] The collaborative controller uses the extracted event type identifier as the query key to search the event-command conversion table maintained in its memory. The event-command conversion table is a hash table structure where the key is the event type identifier string and the value is a command template object. The command template object contains a command template identifier field, a command template mnemonic field, a parameter field list field, and a target device identification placeholder field. The event type identifier string is named according to the rule "device category_event category_event level". The device category can be one of the following: particulate matter analyzer, gaseous pollutant analyzer, dynamic calibrator, zero gas generator, or sampling manifold control unit. The event category can be one of the following: fault, warning, state switch, or manual trigger. The event level can be one of three: level one, level two, or level three. When a key in the event-command conversion table that exactly matches the event type identifier string exists, the collaborative controller retrieves the corresponding command template object.

[0039] Optionally, if no key in the event-command conversion table exactly matches the event type identifier string, the collaborative controller uses a prefix matching method, taking the "device category_event category" part of the event type identifier string as the secondary query key, and searches for a general command template in the event-command conversion table. If the secondary query key still cannot match, a default no-operation command template is returned.

[0040] After obtaining the instruction template object, the collaborative controller reads the parameter field list from the instruction template object. Each element in the parameter field list contains a parameter name, parameter index position, and parameter value type. The collaborative controller populates the event trigger parameters into the parameter fields of the instruction template one by one according to their parameter index positions. The event trigger parameter is a set of key-value pairs, where the key is the parameter name string and the value is the parameter value string. For each parameter name in the parameter field list, the collaborative controller searches for a matching key in the event trigger parameter key-value pair set. If found, the corresponding parameter value string is populated into the corresponding parameter field position; otherwise, the parameter field position is left empty. After population, the collaborative controller generates a complete initial node instruction. The initial node instruction consists of three parts: the instruction template mnemonic, the populated parameter fields, and the target device identification field. The target device identification field is taken from the target device identification placeholder in the instruction template object, which is selected by the user from the online device list when configuring the linkage trigger event.

[0041] The collaborative controller extracts the target device identification field value from the initial node instruction and uses this value as the lookup key to search for the corresponding mapping record in the addressing mapping table. The addressing mapping table uses the device identification as the key, and the corresponding mapping record contains the communication protocol type, status register address range, and control register address range. The collaborative controller further searches the virtual node index table for the virtual device node object corresponding to the target device identification, writes the initial node instruction into the input queue of the virtual device node object, and marks the virtual device node as the starting execution node. Marking the starting execution node involves assigning the node identifier of the starting execution node to a global variable "Starting Node Identifier" and updating the node status field of the starting execution node from "Idle" to "Pending Execution" in the state dependency graph.

[0042] The collaborative control system starts from the initial execution node and performs a forward breadth-first traversal along the state dependency graph to generate candidate node execution sequences. The system creates a queue data structure as the breadth-first traversal queue and a list data structure as the candidate node execution sequence list, initialized as an empty list. The system adds the node identifier of the initial execution node to the breadth-first traversal queue and simultaneously creates an auxiliary hash table to record the identifiers of visited nodes, placing the node identifier of the initial execution node into the visited node identifier hash table.

[0043] The collaborative controller initializes the current layer node set, adding the node identifier of the starting execution node to it. The controller creates an empty next-layer node set and iterates through each node identifier in the current layer node set. For each encountered node identifier, the controller locates the corresponding virtual device node in the state dependency graph and obtains its successor node list. For each successor node identifier in the successor node list, the controller checks if it exists in the visited node identifier hash table. If not, it adds the successor node identifier to the tail of the next-layer node set, the breadth-first traversal queue, and the candidate node execution sequence list, and inserts it into the visited node identifier hash table. After completing the traversal of all node identifiers in the current layer node set, the controller assigns the next-layer node set to the current layer node set and resets the next-layer node set to empty. The collaborative controller repeats the above process until the next layer of nodes is empty after a certain round of traversal and no new successor node is generated in the current layer of nodes. At this time, the breadth traversal ends, and the candidate node execution sequence list is the candidate node execution sequence containing the hierarchical order.

[0044] The order of nodes in the candidate node execution sequence reflects the layer-by-layer diffusion relationship along the state dependency graph, starting from the initial execution node. Nodes at the same layer are arranged in the candidate node execution sequence according to the order in which they were first discovered. The collaborative linkage controller stores the generated candidate node execution sequence in memory for use in the subsequent dynamic priority reordering stage.

[0045] In practical implementation, the collaborative controller dynamically prioritizes each virtual device node in the candidate node execution sequence based on the real-time status feedback value of the physical device corresponding to the virtual device node, resulting in an optimized execution sequence. The collaborative controller maintains an execution sequence pointer in memory, initially pointing to the first element of the candidate node execution sequence. The controller determines whether the execution sequence pointer has exceeded the end of the candidate node execution sequence. If not, it retrieves the node identifier of the virtual device node currently pointed to by the execution sequence pointer from the candidate node execution sequence and uses that virtual device node as the current processing node.

[0046] The collaborative controller looks up the mapping record corresponding to the device identity of the current processing node through the addressing mapping table, and reads the status register address range from the mapping record. Based on the communication protocol type recorded in the mapping record, the collaborative controller calls the status query frame assembly function corresponding to the communication protocol type from the protocol driver library and sends a status query frame to the physical device corresponding to the current processing node. The destination address of the status query frame is the communication address of the physical device, and the frame payload carries the starting address of the status register address range and the number of registers to be read. After receiving the status query frame, the physical device packages the specified number of data in its status register into a status word and returns it. The collaborative controller receives the status word returned by the physical device, which at least includes a device busy / idle flag field, a fault flag field, and a task remaining time field.

[0047] The collaborative controller parses the first value of the device's busy / idle flag and the second value of the fault flag from the fixed offset position of the status word. The device's busy / idle flag is located at bit 0 of the 3rd byte of the status word; a value of 0 indicates the physical device is idle, and a value of 1 indicates the physical device is busy. The fault flag is located at bit 1 of the 3rd byte of the status word; a value of 0 indicates the physical device is not faulty, and a value of 1 indicates the physical device is faulty. The remaining task time field is located in bytes 5 and 6 of the status word and is a two-byte unsigned integer in hundreds of milliseconds.

[0048] The collaborative control system calculates the execution priority of the current processing node based on the combined state of the first value of the device's busy / idle flag and the second value of the fault flag. When the second value is 1, indicating that the fault flag indicates the physical device is in a fault state, the collaborative control system sets the execution priority of the current processing node to the lowest priority value, defined as 0. When both the second and first values ​​are 0, indicating that the fault flag indicates the physical device is not in a fault state and the busy / idle flag indicates the physical device is idle, the collaborative control system sets the execution priority of the current processing node to the highest priority value, defined as 255. When both the second and first values ​​are 0, indicating that the fault flag indicates the physical device is not in a fault state and the busy / idle flag indicates the physical device is busy, the collaborative control system reads the original value of the remaining task time from the task remaining time field of the status word, calculates a waiting time coefficient based on the original value of the remaining task time, and determines the execution priority value based on the waiting time coefficient. (Waiting time coefficient) The calculation method is as follows:

[0049] in, This represents the waiting time coefficient, which is a floating-point number ranging from 0.0 to... . This represents the raw value of the remaining task time, read from the task remaining time field in the status word, in hundreds of milliseconds. The value range is from 0 to 65535, when A value of 0 indicates that the physical device is about to complete its current task. This represents the predefined maximum task waiting time, set to 60000, or 6000 seconds. This value is based on the statistics of the longest single analysis cycle in the intelligent air quality monitoring station. A complete sampling-analysis cycle of a gaseous pollutant analyzer does not exceed 3600 seconds, and the filter membrane replacement cycle of a particulate matter analyzer does not exceed 3000 seconds. The maximum task time of various devices is taken into account and a margin is allowed, and it is set to 6000 seconds. This represents the priority scaling factor, set to 254.0. This value is used to map the wait time coefficient to the priority numerical space, so that in An open interval is formed between the priority value and the highest priority value of 255 to avoid overlap between the priority value calculated from the waiting time coefficient of busy devices and the highest priority value of 255 in idle states. When determining the execution priority value based on the waiting time coefficient, the coordinated control controller will execute the priority value. Take as ,in This indicates that the waiting time coefficient is rounded down. The value range is from 1 to 254. When... When rounded down to approximately 255, Approaching 0, but through Setting it to 254.0 ensures... The maximum value does not exceed 254.0, therefore The minimum value is 1, which distinguishes it from the lowest priority value of 0 for fault states.

[0050] After calculating the execution priority value of the current processing node, the collaborative controller compares this value with a preset priority threshold. The priority threshold is set to 128, which is the midpoint between the highest priority value of 255 and the lowest priority value of 0. This distinguishes nodes with shorter remaining time and higher execution urgency in busy states from nodes with longer remaining time and lower execution urgency. When the execution priority value is lower than the priority threshold, the collaborative controller scans the candidate node execution sequence from the position after the current processing node, searching for the first virtual device node with an execution priority value higher than the priority threshold. The current processing node is then swapped with the found virtual device node in the candidate node execution sequence. If no virtual device node with an execution priority value higher than the priority threshold is found by the end of the candidate node execution sequence, no swap operation is performed. When the execution priority value is higher than or equal to the priority threshold, the collaborative controller maintains the current processing node's position in the candidate node execution sequence.

[0051] The collaborative controller moves the execution sequence pointer one position forward, pointing to the next virtual device node in the candidate node execution sequence. This virtual device node is then designated as the new current processing node. The process of sending status query frames to the physical device, parsing status words, calculating execution priority values, and swapping positions as needed is repeated until the execution sequence pointer has traversed all virtual device nodes in the candidate node execution sequence. After traversal, the node order in the candidate node execution sequence is the optimized execution sequence generated after dynamic priority rearrangement. Virtual device nodes with higher priority values ​​are placed before those with lower priority values ​​in the optimized execution sequence. The order of nodes at the same level is dynamically adjusted based on real-time status after rearrangement.

[0052] In practice, the collaborative controller sends control frames to the corresponding physical devices according to the optimized execution sequence. After each control frame is sent, a timeout timer is started. Based on the timeout result and the status word returned by the physical device, a decision is made on whether to continue executing the next virtual device node in the optimized execution sequence or trigger a global reset process. The collaborative controller maintains an execution index counter in memory, initially set to zero, to indicate the position of the currently executing node in the optimized execution sequence. The collaborative controller reads the length of the optimized execution sequence. If the value of the execution index counter is less than the length of the optimized execution sequence, the virtual device node at the position currently pointed to by the execution index counter is retrieved from the optimized execution sequence and used as the current node to be executed.

[0053] The collaborative controller extracts the device identification from the currently executing node and uses it as the lookup key to search for the corresponding mapping record in the addressing mapping table. The controller then reads the control register address range from the found mapping record; this range contains the start and end addresses of the control registers. Next, the controller obtains the instruction parameters for the currently executing node, which are the parameter fields filled during the initial node's instruction parsing phase. Finally, the controller calls the frame assembly function, writing the start address of the control register from the control register address range into the register address field of the control frame, writing the instruction parameters into the instruction parameter field of the control frame, and encapsulating the control frame according to the communication protocol type corresponding to the currently executing node.

[0054] A control frame consists of a frame header field, a device identification field, a register address field, an instruction code field, an instruction parameter field, and a frame tail checksum field in that order. The frame header field is a fixed value (0xA55A), occupying two bytes, and is used to identify the start boundary of the control frame. The device identification field occupies sixteen bytes and carries the globally unique serial number of the target physical device. The register address field occupies four bytes and carries the starting address of the target control register. The instruction code field occupies two bytes and carries the operation type code, which includes four types: parameter write, mode switch, calibration start, and emergency stop. The instruction parameter field is a variable-length field, ranging from four to sixty-four bytes, and carries the operation parameters corresponding to the instruction code. The frame tail checksum field occupies two bytes and uses a cyclic redundancy check algorithm to calculate the checksum value for all bytes from the frame header field to the instruction parameter field.

[0055] The collaborative controller sends the assembled control frame to the target physical device via the station's local area network and starts a timeout timer the moment the first byte of the control frame leaves the network transmission buffer. The timeout timer is a hardware timer with a timing accuracy of ten milliseconds. The preset timeout threshold is 3000 milliseconds. This threshold is set based on the statistical values ​​of the maximum response time of various physical devices in the station after receiving the control frame, executing instructions, and returning a status word. The gas mixing response time of the dynamic calibrator does not exceed 2000 milliseconds, the mode switching response time of the gaseous pollutant analyzer does not exceed 1500 milliseconds, the start / stop response time of the zero gas generator does not exceed 800 milliseconds, and the valve switching response time of the sampling manifold control unit does not exceed 500 milliseconds. Taking the maximum response time of 2000 milliseconds for each device and adding 1000 milliseconds for network transmission and processing overhead, the timeout threshold is set to 3000 milliseconds. After the timeout timer starts, the collaborative controller enters a waiting state, waiting for the physical device to return a status word or for the timeout timer to reach the timeout threshold.

[0056] The collaborative controller periodically checks the current timeout timer value while in a waiting state and compares it with the timeout threshold. When the current timeout timer value is less than 3000 milliseconds, the collaborative controller checks the station's local area network receive buffer for a response message from the target physical device. If a response message is received, the collaborative controller extracts the status word from the response message and parses the instruction response code field within the status word. The instruction response code field is located in the second byte of the status word. A value of 0x00 indicates successful instruction execution; 0x01 indicates instruction failure with an unclassified reason; 0x02 indicates instruction failure with out-of-bounds parameter; and 0x03 indicates instruction failure with the device busy. When the value of the instruction response code field is 0x00, the collaborative controller determines that the current node to be executed has been executed successfully, stops the timeout timer and resets the timeout timer, increments the value of the execution index counter by one, and continues to take the next virtual device node from the optimized execution sequence as the new current node to be executed, repeating the operations of control frame assembly, distribution and timeout timer start.

[0057] When the value of the command response code field is 0x01, 0x02, or 0x03, indicating that the command response code has failed, the collaborative controller triggers a global reset procedure. Similarly, when the current countdown value of the timeout timer exceeds 3000 milliseconds (i.e., the countdown value exceeds the timeout threshold) and the physical device has not yet returned a status word, the collaborative controller also triggers a global reset procedure.

[0058] When the global reset procedure is triggered, the collaborative controller immediately stops executing any nodes that have not yet been executed in the optimized execution sequence. The collaborative controller records the current value of the execution index counter as the breakpoint position, marks all unexecuted virtual device nodes after the current value of the execution index counter in the optimized execution sequence as unexecuted, and generates an interrupt flag. The interrupt flag is a Boolean global variable, initially false, and set to true when the global reset is triggered.

[0059] The coordinated control controller iterates through all mapping records in the addressing mapping table. For each mapping record, it determines whether the corresponding physical device has received a control frame but has not returned a success status word. This is done by checking a device tracking table. The device tracking table inserts a record each time a control frame is received, containing a device identification field and a timestamp field. It deletes the corresponding record each time a success status word with a 0x00 command response code is received. The currently existing records in the device tracking table constitute the list of physical devices that have received control frames but have not returned a success status word. The coordinated control controller sends an emergency stop frame to each physical device in the device tracking table. The command code field of the emergency stop frame is the operation type code 0xFF for emergency stop, the register address field is filled with the starting address of the corresponding physical device's control register, and the command parameter field is empty. Upon receiving the emergency stop frame, the physical device terminates any currently executing operations and enters a safe standby state.

[0060] The collaborative controller traverses all virtual device nodes in the state dependency graph. For each virtual device node in the state dependency graph, the collaborative controller looks up the control register address range of the physical device corresponding to the virtual device node through the addressing mapping table and sends a state reset frame to that physical device. The instruction code field of the state reset frame is filled with the instruction code 0x7E corresponding to the factory default sampling mode, the register address field is filled with the starting address of the control register address range, and the instruction parameter field carries a reset mode code with a value of 0x01. The reset mode code 0x01 indicates restoration to the factory preset standard sampling mode parameter set. After receiving the state reset frame, the physical device restores all operating parameters to the factory preset values, including sampling flow parameters, calibration cycle parameters, and range switching parameters.

[0061] The coordinated control unit records relevant information about the global reset process to the interrupt log. The interrupt log is stored in the non-volatile memory of the coordinated control unit and is written append-only. Each log entry includes an interrupt flag field, a current timeout physical device identifier field, a current timestamp field, and an incomplete node list field. The interrupt flag field records a Boolean value of true. The current timeout physical device identifier field records the device identifier of the physical device that triggered the global reset. If the reset was triggered due to an instruction response code indicating execution failure, it records the device identifier of the physical device that returned an execution failure status word; if the reset was triggered due to a timeout, it records the device identifier of the physical device that did not respond within the timeout period. The current timestamp field records the system clock time when the global reset was triggered, in Coordinated Universal Time (UTC) millisecond timestamp format. The incomplete node list field records the node identifiers of all virtual device nodes marked as inactive in the optimized execution sequence, separated by semicolons.

[0062] The collaborative controller generates a task list to be recovered based on the node identifiers recorded in the incomplete node list field of the interrupt log, and the predecessor and successor node lists of each virtual device node in the state dependency graph. The task list to be recovered is a singly linked list, and each node in the list contains a task node identifier field, a device identity identifier field, a predecessor task pointer field, and a successor task pointer field. The collaborative controller reads each node identifier from the incomplete node list field, locates the corresponding virtual device node in the state dependency graph, and extracts the predecessor node list for that virtual device node. If a node identifier in the predecessor node list is also located in the incomplete node list field, the memory address of that predecessor node is recorded in the predecessor task pointer field. Following the topological order of the dependency relationships, the collaborative controller arranges incomplete nodes without predecessor dependencies or whose predecessor dependencies have been completed at the beginning of the task list to be recovered, so that the task list to be recovered can be directly used for sequence reconstruction during recovery execution.

[0063] Optionally, the task node identifier field of each node in the task list to be restored also includes a recovery priority auxiliary value, which is calculated according to the following formula:

[0064] in, This represents the recovery priority auxiliary value, which is an integer. This represents the hierarchy depth weighting coefficient, set to 100. This value is used to amplify the contribution of hierarchy depth in recovery priority, so that upstream nodes in the dependency chain are given priority in recovery execution. This represents the level depth of the virtual device node to be restored in the state dependency graph. The level depth is counted starting from level 0, where the initial execution node is the first node to be restored. Obtained by traversing the state dependency graph downwards from the root node. The value ranges from 0 to the maximum number of layers in the state dependency graph minus one. This represents the retry count weighting coefficient, set to 1. This value is used to distinguish nodes with different retry counts within the same level. This indicates the total number of retries performed by the corresponding physical device during this coordinated action. The initial value is 0, and the retries count for unfinished devices is incremented by one after each global reset. The maximum value is 3, when When the value reaches 3, the device is moved to the manual intervention queue and is no longer included in the pending recovery task list. The collaborative controller assists in recovery based on priority values. Sort the nodes in the task list to be restored in descending order to generate the final task list to be restored.

[0065] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A collaborative control method for intelligent ambient air quality stations with heterogeneous equipment, characterized in that, include: Scan the heterogeneous devices connected in the station, extract the communication protocol type and register address range of each device, and construct an addressing mapping table based on device identity; Based on the addressing mapping table, a corresponding virtual device node is assigned to each device, and a state dependency graph between the virtual device nodes is established. Obtain the user-configured linkage trigger events and parse the linkage trigger events into initial node instructions; Starting from the initial node instruction, a forward breadth-first traversal is performed along the state dependency graph to generate a candidate node execution sequence; For each node in the candidate node execution sequence, dynamic priority rearrangement is performed based on its corresponding real-time device status feedback value to obtain an optimized execution sequence. According to the optimized execution sequence, control frames are sent to the corresponding physical devices, and a timeout timer is started after each control frame is sent. Based on the timeout result and the status word returned by the device, a decision is made on whether to continue executing the next node or trigger a global reset process.

2. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 1, characterized in that, The step of extracting the communication protocol type and register address range of each device and constructing an addressing mapping table based on device identity includes: Read the identification information frame broadcast by each device, and parse the manufacturer code, device model and firmware version number from the identification information frame; Based on the manufacturer code and the device model, a pre-stored protocol feature library is matched to determine the communication protocol type and register address mapping rules of the device; Based on the register address mapping rules, calculate the status register address range and control register address range for each device; The device identifier is associated with and stored in relation to the corresponding communication protocol type, the status register address range, and the control register address range to form the addressing mapping table.

3. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 1, characterized in that, The step of allocating a corresponding virtual device node to each device according to the addressing mapping table and establishing a state dependency graph between the virtual device nodes includes: Based on the device identity identifier in the addressing mapping table, instantiate a virtual device node containing an input queue and an output queue for each device; Obtain the preset station process flow topology file, and parse the air circuit connection relationship and circuit signal connection relationship of each device from the topology file; Based on the gas path connection relationship and the circuit signal connection relationship, a directed edge is added between the virtual device nodes, and the direction of the directed edge is from the upstream device to the downstream device; Based on the directed edges and the virtual device nodes, the state dependency graph is generated, and a list of predecessor nodes and a list of successor nodes are attached to each node in the state dependency graph.

4. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 1, characterized in that, The step of obtaining the user-configured linkage trigger event and parsing the linkage trigger event into an initial node instruction includes: Receive user-configured linkage trigger events, wherein the linkage trigger events include event type identifiers and event trigger parameters; Based on the event type identifier, query the preset event-instruction conversion table to obtain the instruction template corresponding to the event type identifier; The event triggering parameters are filled into the parameter field of the instruction template to generate the initial node instruction; Based on the target device identifier in the initial node instruction, the addressing mapping table is queried, the initial node instruction is routed to the corresponding virtual device node, and the virtual device node is marked as the starting execution node.

5. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 4, characterized in that, The step of generating a candidate node execution sequence by performing a forward breadth-first traversal along the state dependency graph, starting from the initial node instruction, includes: The starting execution node is set as the current layer node set, and the candidate node execution sequence is initialized to empty; Iterate through each node in the current layer node set, obtain the list of successor nodes for that node, and add all nodes in the list of successor nodes to the next layer node set; When the next-level node set is not empty, check whether each node in the next-level node set is already in the candidate node execution sequence. If not, append the next-level node set to the end of the candidate node execution sequence. Assign the next layer node set to the current layer node set, and repeat the above traversal operation until the current layer node set is empty, thus obtaining a candidate node execution sequence containing the hierarchical order.

6. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 1, characterized in that, The step of performing dynamic priority rearrangement for each node in the candidate node execution sequence based on its corresponding real-time device status feedback value to obtain an optimized execution sequence includes: One node is selected sequentially from the candidate node execution sequence as the current processing node; Send a status query frame to the physical device corresponding to the current processing node, receive the status word returned by the physical device, and parse the device busy / idle flag and fault flag from the status word; The execution priority value of the current processing node is calculated based on the combined state of the device busy / idle flag and the fault flag. When the execution priority value is lower than the preset priority threshold, the current processing node is swapped with the first subsequent node in the candidate node execution sequence whose priority value is higher than the priority threshold. Repeat the above steps of extraction, parsing, calculation, and swapping until all nodes in the candidate node execution sequence have been traversed, and then generate the optimized execution sequence.

7. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 6, characterized in that, The step of calculating the execution priority value of the current processing node based on the combined state of the device busy / idle flag and the fault flag includes: Read the first value of the busy / idle flag bit and the second value of the fault flag bit of the device; When the second numerical indication device is in a fault state, the execution priority value of the current processing node is set to the lowest priority value; When the second numerical indicator device is not in a fault state and the first numerical indicator device is in an idle state, the execution priority value of the current processing node is set to the highest priority value. When the second numerical indicator device is not in a fault state and the first numerical indicator device is in a busy state, the waiting time coefficient is calculated based on the task remaining time field in the status word, and the execution priority value is determined based on the waiting time coefficient.

8. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 1, characterized in that, The steps of sending control frames to the corresponding physical devices according to the optimized execution sequence, starting a timeout timer after each control frame is sent, and deciding whether to continue executing the next node or trigger a global reset process based on the timeout result and the status word returned by the device include: One node is selected sequentially from the optimized execution sequence as the current node to be executed, and the control register address range is obtained from the addressing mapping table according to the device identity of the current node to be executed. Based on the control register address range and the instruction parameters of the current node to be executed, a control frame is assembled, the control frame is sent to the corresponding physical device, and a timeout timer is started at the time of sending. When the timeout timer's countdown value does not exceed the preset timeout threshold, wait to receive the status word returned by the physical device and parse the instruction response code in the status word; When the instruction response code indicates successful execution, the next node in the optimized execution sequence continues to be executed; when the instruction response code indicates failure or the timeout value exceeds the timeout threshold, a global reset process is triggered.

9. A collaborative control method for an intelligent ambient air quality station oriented towards heterogeneous equipment, as described in claim 8, is characterized in that... The steps for triggering the global reset procedure include: Immediately stop executing any nodes that have not yet been executed in the optimized execution sequence and generate an interrupt flag; According to the addressing mapping table, an emergency stop frame is sent to all physical devices that have sent control frames but have not returned a success status word. Traverse all virtual device nodes in the state dependency graph and send a state reset frame to the physical device corresponding to each virtual device node. The state reset frame carries an instruction code to restore the factory sampling mode. Record the interrupt flag, the physical device identity of the current timeout, and the current timestamp to the interrupt log, and generate a list of tasks to be recovered based on the dependencies of incomplete nodes in the interrupt log.

10. The method for collaborative control of an intelligent ambient air quality station for heterogeneous equipment according to claim 8, characterized in that, The control frame includes a frame header, a device identification field, a register address field, an instruction code field, an instruction parameter field, and a frame tail check field.