A method for IoT data acquisition of tunnel electromechanical equipment

By establishing a basic data acquisition parameter table and an equipment status association table, the data acquisition tasks of tunnel electromechanical equipment are dynamically adjusted, solving the problems of data preservation and cache management during data acquisition interruptions of tunnel electromechanical equipment, and realizing dynamic coordination of data integrity and real-time performance.

CN123123397APending Publication Date: 2026-11-17SICHUAN GAOLU INFORMATION TECHNOLOGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611615411.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing data acquisition schemes for tunnel electromechanical equipment lack a mechanism to determine the data preservation targets based on equipment status change events when the uplink is interrupted, and lack a differentiated retention mechanism when the buffer space is insufficient, resulting in the inability to dynamically coordinate the amount of historical data retransmission with the amount of real-time data transmission.

Method used

Establish a basic data acquisition parameter table and a device status association table. Dynamically adjust data acquisition tasks based on device status change events, prioritize the retention of event-related data acquisition evidence, and dynamically allocate historical retransmission quotas after link recovery, taking into account the integrity of event evidence and actual transmission capacity.

Benefits of technology

It enables priority retention of event collection evidence when cache space is limited, and allocation of historical retransmission as needed after link recovery, ensuring data integrity and real-time consistency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123123397A_ABST
    Figure CN123123397A_ABST
Patent Text Reader

Abstract

This invention discloses an IoT data acquisition method for tunnel electromechanical equipment. It determines event-related acquisition points based on state change events and dynamically reconstructs the polling queue, organizing acquisition records of the same event into acquisition evidence groups. During uplink anomalies, event retransmission groups are formed according to event identifiers. When buffer space is insufficient, event preservation records are prioritized, while ordinary historical records are downgraded for retention. After the link is restored, the historical retransmission quota and transmission order are determined based on the integrity of the event evidence and the link's confirmation transmission capacity. The platform completes gap detection and event evidence recovery based on the data sequence number, event identifier, and original acquisition time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data acquisition and communication technology for tunnel electromechanical equipment, specifically a method for acquiring Internet of Things (IoT) data for tunnel electromechanical equipment. Background Technology

[0002] The tunnel electromechanical equipment data acquisition technology uses an Internet of Things (IoT) data acquisition gateway to read, organize, and upload the status and operational data of distributed electromechanical equipment in the tunnel, providing on-site data for the centralized monitoring platform.

[0003] For example, CN111325977A discloses a tunnel intelligent edge computing management and control system that connects to various heterogeneous electromechanical devices through an IoT gateway and performs protocol conversion and data optimization. However, existing tunnel data acquisition schemes typically cache historical records in the order of data generation when the uplink is interrupted for a long time, without determining the objects to be preserved for the out-of-network data based on the acquisition evidence relationship corresponding to the device status change event; when the cache space is insufficient, there is a lack of a differentiated retention mechanism between ordinary operating data and key records that constitute event evidence; after the link is restored, there is a lack of a processing mechanism to dynamically coordinate the amount of historical data retransmission and the amount of real-time data transmission based on the actual restored link transmission capacity.

[0004] To address the aforementioned issues, it is necessary to propose a method for collecting IoT data from tunnel electromechanical equipment. Summary of the Invention

[0005] To address the shortcomings of existing fixed polling methods in data acquisition for tunnel electromechanical equipment, which struggle to adjust associated acquisition tasks based on equipment status changes, and the lack of a unified scheduling relationship between event acquisition, routine acquisition, abnormal re-acquisition, and link loss recovery data in shared field communication channels, this invention provides an IoT data acquisition method for tunnel electromechanical equipment, comprising the following steps: S1. Establish a record of the acquisition points corresponding to the tunnel electromechanical equipment, establish a basic acquisition parameter table based on the field communication attributes of each acquisition point, and establish an equipment status association table based on the control relationship of the tunnel electromechanical equipment. The basic acquisition parameter table records the field communication channel, protocol reading information, data type, basic acquisition cycle, maximum allowed update time, minimum allowed polling interval, and communication response timeout time corresponding to each acquisition point; the device status association table records the trigger point identifier, trigger condition, event type, list of associated acquisition points, event acquisition cycle, event retention conditions, and data consistency rules.

[0006] S2. Perform normal polling on each field communication channel according to the basic acquisition parameter table, perform communication verification and data conversion on the field read response to form the original acquisition record; determine the state change event based on the state comparison results between adjacent valid acquisition results at the same acquisition point and the trigger conditions in the device state association table; The state change event record includes the event identifier, trigger point identifier, state before triggering, state after triggering, event start time, and event type, and determines the effective deadline of the event based on the event type.

[0007] S3. Query the device status association table according to the status change event, determine the event association collection point, switch the event association collection point to the event collection state, and generate the next event collection expiration time according to the event collection cycle. Based on the maximum allowed update time of each collection point, the current gateway monotonic timer value, and the gateway monotonic timer value corresponding to the most recent valid collection, the remaining collection time limit is determined; based on the message parameters of the current read transaction, the on-site communication channel configuration, the communication response timeout time, and the protocol frame interval, the upper limit of single communication transaction occupancy is determined; based on the event association status, the expiration time of the next event collection, the remaining collection time limit, and the upper limit of single communication transaction occupancy, the tasks to be collected in the same on-site communication channel are sorted to obtain a dynamic polling queue.

[0008] S4. Perform data collection according to the dynamic polling queue, and organize the trigger records, feedback records and operation records corresponding to the same state change event into a data collection evidence group according to the event identifier; The evidence collection group is validated for time validity based on the event's effective deadline. Communication validity is validated based on the communication validation results. Association consistency is validated based on the data consistency rules in the device status association table. Collection points that fail validation are identified based on the validation results. Targeted re-collection tasks are generated based on the collection points that fail validation and the event-related collection points that participate in the same data consistency rule judgment. Data quality bytes are generated based on the targeted re-collection results to obtain collection records with completed quality markings.

[0009] S5. During an uplink anomaly, records to be retransmitted are organized into event retransmission groups based on event identifiers. The required set of records and evidence integrity status for the corresponding event are determined based on the device status association table. When the record storage area capacity is insufficient, event preservation records are saved first, and ordinary historical records are downgraded and retained. After the link is restored, the link confirmation transmission capacity is determined based on the platform confirmation data. The historical retransmission quota is determined based on the link confirmation transmission capacity and real-time data transmission requirements. The historical retransmission order is determined based on the evidence integrity status of the event retransmission group. S6. The tunnel monitoring platform receives real-time data streams and historical retransmission streams, performs deduplication and gap detection based on the gateway identifier and data sequence number, reconstructs the event retransmission group based on the event identifier and determines the integrity status of event evidence on the platform side, and returns the missing point identifiers to the IoT data acquisition gateway along with the confirmation information. The IoT data acquisition gateway updates the event retransmission group and subsequent historical retransmission order based on the confirmation information.

[0010] Compared with the prior art, the beneficial effects of the present invention are: This invention organizes network outage data into event retransmission groups according to state change events. When buffer space is limited, records that constitute evidence of event collection are retained first, while ordinary historical records are downgraded and retained. After the link is restored, the historical retransmission quota is dynamically allocated based on the integrity of the event evidence and the actual confirmed transmission capacity, so that the historical retransmission process is simultaneously constrained by event integrity, real-time data timeliness, and restored link transmission capacity. Attached Figure Description

[0011] To facilitate understanding by those skilled in the art, the present invention will be further described below with reference to the accompanying drawings: Figure 1 This is a flowchart of a method for acquiring IoT data from tunnel electromechanical equipment, as proposed in an embodiment of the present invention. Figure 2 This is a table showing the parameter organization method proposed in the embodiments of the present invention; Figure 3 This is a schematic diagram illustrating the event-driven association acquisition principle proposed in the embodiments of the present invention; Figure 4 This refers to the device status association table proposed in the embodiments of the present invention; Figure 5 This is a schematic diagram of dynamic polling and retry scheduling of the shared communication channel proposed in the embodiments of the present invention; Figure 6 This is a schematic diagram illustrating the evidence collection group and consistency verification principle proposed in the embodiments of the present invention; Figure 7 This is a table showing the setting conditions, meanings, and subsequent processing of each segment proposed in the embodiments of the present invention; Figure 8 This is a schematic diagram of network outage recovery and traffic resuming based on the integrity of event evidence and the link confirmation transmission capability proposed in the embodiments of the present invention. Detailed Implementation

[0012] The technical solutions in the embodiments of the present invention will be clearly and completely described below. It should be understood that the described embodiments are used to illustrate the technical implementation process of the present invention, and not to limit the scope of protection of the present invention. The present invention provides a method for IoT data acquisition of tunnel electromechanical equipment, which is mainly used in highway tunnels, urban tunnels and other scenarios with distributed electromechanical equipment and centralized monitoring needs. The data acquisition objects may include jet fans, axial fans, frequency converters, lighting circuits, drainage pumps, fire pumps, distribution cabinets, UPS, lane indicators, roller shutters, CO detectors, visibility detectors, water level detectors and other field devices that can output operating data through digital quantities, analog quantities or communication registers.

[0013] In this embodiment, the method is collaboratively implemented by field electromechanical equipment, equipment controllers, an IoT data acquisition gateway, an uplink communication network, and a tunnel monitoring platform. The equipment controller can be a PLC, smart meter, frequency converter control unit, protection and control device, or an embedded controller with a fieldbus interface. The IoT data acquisition gateway includes at least a processor, memory, a field communication interface, an uplink network interface, and local non-volatile storage media. The field communication interface is used to access one or more of RS485, CAN, industrial Ethernet, digital input, or analog input. The uplink network interface is used to send the processed acquired data to the tunnel monitoring platform. When the processor executes the program in the memory, it sequentially completes the reading of acquisition parameters, polling scheduling, event association, data consistency verification, local caching, and data uploading.

[0014] The collection point referred to in this invention is a data object in an IoT data acquisition gateway that has a unique location identifier and can correspond to the status of a readable device. The criteria for determining its status are that the data object can at least identify the device it belongs to, the field communication channel, the reading address or input port, and the data type. For example, the start-up command status, operation feedback, inverter output frequency, operating current, and fault relay status of a wind turbine are stored as different collection points, rather than storing the entire wind turbine as a single abstract collection object.

[0015] The basic acquisition parameter table referred to in this invention is a data table written into the IoT data acquisition gateway before the tunnel electromechanical system is put into operation. This table defines how each acquisition point is read under normal circumstances. The criteria for determining readability are that each record must contain at least the point identifier, device identifier, field communication channel, protocol reading information, data type, engineering quantity unit, basic acquisition cycle, maximum allowable update time, minimum allowable polling interval for the device, and communication response timeout. The maximum allowable update time, as defined in this invention, refers to the maximum time interval allowed between two consecutive valid data updates for the same acquisition point by the monitoring configuration. When the uplink is available, this time also serves as the maximum freshness constraint for new acquisition records at that point when entering the uplink transmission sorting process. During periods when the link is unavailable, it is not used to negate already formed historical retransmission records. The quantitative fields in the basic acquisition parameter table are not generated temporarily based on experience during the operation of this method, but are written after being formed by the device protocol parameters, tunnel monitoring configuration, and field debugging results.

[0016] The device status association table referred to in this invention is a data table that establishes a correspondence between a data collection point that can characterize the start of a device action, a change in operating status, or the occurrence of an abnormal state, and other data collection points that need to improve the timeliness of data collection during the same event. The criteria for determining this correspondence are that each association record must at least include a trigger point identifier, trigger condition, event type, a list of associated data collection points, event collection cycle, event retention conditions, and data consistency rules. For action-type events, it also includes the allowed duration for action completion; for persistent state-type events, it also includes a persistent valid status code or persistent valid condition indicating that the event was already in a persistent state when the gateway was initialized. The device status association table is used to indicate which data should be prioritized for reading after a device status change, and is not used to directly determine whether a mechanical failure has occurred in the device.

[0017] To avoid the use of quantitative fields with unclear origins in the basic data acquisition parameter table and device status association table, this embodiment uniformly adopts structured configuration file import during the gateway deployment phase. Time values ​​in the configuration file are represented by both a numerical field and a unit field, with the unit field taking the values ​​of "ms", "s", or "min". After the gateway reads the data, it converts all values ​​to milliseconds (ms) and saves them. When the unit is "ms", the value remains unchanged; when the unit is "s", the input value is multiplied by 1000; and when the unit is "min", the input value is multiplied by 60000. The minimum allowable polling interval and communication response timeout time for the device are preferentially read from the device communication protocol manual or device controller communication parameters. The maximum allowable update time and the allowable duration for action completion are imported from the point configuration or commissioning records of the tunnel monitoring system. The basic data acquisition cycle is preferentially read from the data acquisition cycle configuration in the tunnel monitoring point table; when the point table does not have a separately configured basic data acquisition cycle, the maximum allowable update time for that point is directly taken as the basic data acquisition cycle. The gateway uniformly verifies that "the minimum allowed polling interval of the device is not greater than the basic collection cycle, and the basic collection cycle is not greater than the maximum allowed update time". If the above relationship is not met, the point will be refused to be enabled and the configuration verification failure message will be output. During the non-operational phase, the debugging personnel shall fill in a default cycle without a source.

[0018] The platform confirmation waiting time referred to in this invention refers to the maximum allowed time for the IoT data acquisition gateway to wait for the tunnel monitoring platform to return confirmation information after sending one or a batch of uploaded records. The criterion for determining this time is that it is directly imported from the response timeout field in the uplink communication configuration file and uniformly converted to milliseconds according to the aforementioned unit conversion rules. The response timeout field originates from the response timeout configuration of the uplink transmission protocol client or the communication parameters fixed during system integration; no new empirical value is temporarily generated based on network congestion levels during operation.

[0019] To ensure that the IoT data acquisition gateway and the tunnel monitoring platform use consistent data association rules for the same state change event, the device state association table is synchronously saved to both the IoT data acquisition gateway and the tunnel monitoring platform during configuration release, and a configuration version identifier is generated for each released device state association table. When the IoT data acquisition gateway generates a state change event, it writes the currently effective configuration version identifier into the corresponding event record; the tunnel monitoring platform reads the corresponding version of the device state association table based on the configuration version identifier carried in the event record, instead of directly using subsequently updated association rules to re-evaluate historical events.

[0020] Please see Figure 1 , Figure 1This is a flowchart of a method for acquiring IoT data from tunnel electromechanical equipment according to the present invention. The method in this embodiment includes steps S1 to S6, which are not independent data processing steps: Step S1 establishes acquisition points, a basic acquisition parameter table, and a device status association table; Step S2 performs normal polling according to the basic acquisition parameter table and generates status change events; Step S3 determines associated acquisition points based on status change events and reconstructs the polling order of the field communication channel; Step S4 reads the reconstructed acquisition task, performs acquisition consistency verification on the control, feedback, and operation quantities of the same device, and triggers re-acquisition when necessary; Step S5 writes valid acquired data into a real-time data stream, transfers it to a local cache when the uplink is abnormal, and forms a real-time data stream and a historical retransmission stream for parallel transmission after the link is restored; Step S6 the tunnel monitoring platform completes deduplication, gap detection, and timing recovery based on the gateway identifier and data sequence number, and returns a confirmation signal to the IoT data acquisition gateway.

[0021] Please see Figure 2 As shown, Figure 2 This is a table of parameter organization methods.

[0022] As a specific parameter organization method, the basic acquisition parameter table can be established according to the parameter organization method table. The values ​​in the table below are only used to illustrate the field relationships. In actual projects, they should be written according to the corresponding equipment's protocol manual, design point table, and commissioning records.

[0023] S1. Establish a record of acquisition points for tunnel electromechanical equipment, generate a basic acquisition parameter table based on the field communication attributes of each acquisition point, and establish an equipment status association table based on the equipment control relationship.

[0024] Specifically, during the initialization phase, the IoT data acquisition gateway reads the device point table of the tunnel electromechanical monitoring system. Each device point table record includes at least the device number, device type, installation area, field communication channel number, station address or slave address, function code or read type, register address or input port, raw data type, engineering quantity unit, and point semantics. For Modbus devices, the protocol read information can be saved as slave address, function code, start register, and register length; for PLC mapping data, it can be saved as communication connection identifier and variable address; for switch inputs, it is saved as input channel number and valid level. The gateway forms a unique point identifier according to "device number + point number," enabling the start command, operation feedback, fault feedback, and operation quantity of the same device to be indexed separately in subsequent steps.

[0025] The gateway further converts the raw data types into a unified data type marker. 16-bit unsigned integers, 16-bit signed integers, 32-bit integers, IEEE 754 floating-point numbers, Boolean values, and enumerated values ​​undergo byte concatenation, sign extension, or floating-point conversion according to the type field in the configuration file. For engineering quantities that the device transmits in integer form but requires decimal representation, the configuration file simultaneously writes a scaling factor and an offset, which are derived from the device's communication manual. For example, if the device manual specifies that the register value is in units of 0.1 A, the gateway multiplies the read integer value by 0.1 to obtain the operating current in A. This scaling factor is not derived from data changes but is imported from the device protocol parameters along with the register address.

[0026] After completing the data collection point recording, the gateway establishes a basic data collection parameter table. Each data collection point stores the most recent valid data collection time, the gateway monotonic timer value corresponding to the most recent valid data collection, the most recent valid raw value, the most recent valid engineered value, the current polling status, and the next basic expiration time in the basic data collection parameter table. During initialization, the most recent valid data collection time is empty, and the gateway adds this point to the initial polling queue. After the first successful read, the local absolute clock time calibrated by the system corresponding to the arrival time of this valid response is taken as the most recent valid data collection time. Simultaneously, the gateway monotonic timer value, the current device raw value, and the converted engineered value are stored at that time. Based on this gateway monotonic timer value, the next basic expiration time is registered according to the basic data collection cycle. Subsequently, each time this point is successfully read in step S2, the most recent valid data collection time, the gateway monotonic timer value corresponding to the most recent valid data collection, the raw value field, and the engineered value field are updated synchronously.

[0027] Subsequently, an equipment status association table is established. For electromechanical equipment with a clear action chain, points that can characterize the start of an action or a change in operating mode are designated as trigger points, and feedback points and operational quantity points that require continuous observation after the action are designated as association acquisition points. For example, the change in the start command status of a jet fan can be associated with operational feedback, inverter operating frequency, operating current, and fault status; the change in the start command status of a drainage pump can be associated with contactor feedback, operating current, water level changes, and fault status; and the change in the switch command status of a lighting circuit can be associated with circuit feedback and circuit current. The association relationships are stored in a list of point identifiers, without temporary searching during operation using natural language equipment names, thus enabling step S3 to directly read the corresponding association acquisition points based on the trigger point identifiers.

[0028] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the principle of event-driven correlation data collection.

[0029] like Figure 3As shown, the IoT data acquisition gateway establishes a correspondence between trigger points and associated acquisition points based on a device status association table. When the valid acquisition result of a trigger point meets a preset trigger condition, a status change event is generated, and the corresponding associated acquisition point is queried based on the status change event. The associated acquisition points include operational feedback, operational volume, and fault status acquisition points related to the current device action. After a status change event occurs, the associated acquisition point enters an event acquisition state and generates the next event acquisition expiration time according to the event acquisition cycle. Among them, action-type events and continuous status-type events respectively limit the duration of the event acquisition state according to the corresponding event validity expiration conditions.

[0030] The event type referred to in this invention refers to the type field in the device status association table used to limit the effective time range of status change events. Its values ​​include action-type events and continuous status-type events. Action-type events are triggered by discrete actions such as starting, stopping, and switching, and require corresponding feedback or operational data within the allowed time for action completion. Continuous status-type events are triggered by alarm setting, continuous limit exceeding, or other hold-up states, and continue until the event hold-up end condition in the device status association table is met. The effective event deadline referred to in this invention refers to the gateway time boundary used to limit the time range of evidence collection for the same event: the effective event deadline for action-type events is obtained by adding the allowed time for action completion to the event start time; for continuous status-type events, this field is empty when the event is generated, and the gateway time that meets the condition is written into the effective event deadline when the event hold-up end condition is met. During the period when this field is empty, all association records obtained after the event start time are processed as the current continuous event.

[0031] The event acquisition period referred to in this invention is a temporary polling period used to replace the basic acquisition period of associated acquisition points during the event holding period after a state change event occurs. The criterion for determining this period is that the event acquisition period is not less than the minimum allowable polling interval of the device corresponding to the acquisition point, and is less than or equal to the basic acquisition period of that point. In this embodiment, when generating the device state association table, no other observation density parameters are set separately. Instead, the minimum allowable polling interval of the device in the basic acquisition parameter table for each associated acquisition point is directly read and written into the event acquisition period field of the device state association table. Therefore, after a state change event occurs, the associated acquisition points perform temporary acquisition within the range allowed by the device protocol according to the fastest allowable polling interval; when the basic acquisition period itself is equal to the minimum allowable polling interval of the device, the original period remains unchanged during the event.

[0032] The state change event referred to in this invention is a structured event record determined in step S2 from two consecutive valid acquisition results that meets the triggering conditions in the device state association table. The judgment criteria are that at least the trigger point identifier, the state before triggering, the state after triggering, the event start time, and the event identifier can be determined. For Boolean quantities, the triggering condition can be limited to 0 to 1, 1 to 0, or any flip; for enumerated states, it can be limited to entering or leaving a specified state code; for alarm flags already generated by the device itself, it can be limited to the alarm bit changing from unset to set. A uniform rate of change threshold is not mandatory for analog quantities; exceeding the limit is only considered an optional triggering condition when the device point table already provides a clear upper or lower limit or alarm limit.

[0033] As an optional implementation, the equipment status association table also stores an "association consistency rule" field. This field does not store abstract terms like "normal" or "abnormal," but rather stores status combination conditions that can be directly executed by the gateway. For example, after a start command changes from 0 to 1, the operational feedback should show at least one transition from 0 to 1 within the allowed time for the action to complete. If the equipment has inverter operating frequency and operating current points, the association consistency rule can require both to produce at least one valid sampled value within the same event window, but it does not directly determine the equipment's mechanical status based on a uniform current threshold. Thus, this method only determines whether the collected data forms mutually corresponding evidence and does not replace the tunnel electromechanical fault diagnosis system.

[0034] It should be noted that step S1 pre-defines the communication boundaries, timeliness requirements, and device relationships needed for subsequent dynamic data acquisition into searchable data records. Subsequent steps do not rely on experience to temporarily determine "which points are important" or "how quickly to collect data" after an event occurs. Instead, they read data fields with existing sources based on the trigger point identifier, thus maintaining consistency between the source of acquisition parameters, communication execution, and subsequent data quality assessment.

[0035] Please see Figure 4 As shown, Figure 4 This is a table relating to device status.

[0036] like Figure 4 As shown, as a specific example of device status association, it can be organized according to a device status association table: S2. Perform routine polling on each field communication channel according to the basic acquisition parameter table, generate an original acquisition record with time and sequence information for each valid response, and identify status change events based on adjacent valid acquisition results.

[0037] The IoT data acquisition gateway maintains polling queues for each field communication channel. Acquisition points on the same RS485 bus enter the corresponding queue based on their station address and basic expiration time; industrial Ethernet or concurrently accessible devices can establish task queues based on the connected objects. This embodiment does not require all field channels to use the same protocol. The commonality in step S2 is that regardless of the underlying protocol used to read the message, it is converted into a unified raw acquisition record after successful reading, for continued use in steps S3 to S6.

[0038] The original acquisition record referred to in this invention is a structured record saved by the gateway for a single acquisition point after completing a field read. Its determination criteria include at least the gateway identifier, point identifier, field channel number, request sequence number, original device value, converted engineering value, gateway sending time, gateway receiving time, device source time, and communication verification result. The device source time refers to the sampling time or internal time contained in the device's returned message; when the device protocol does not provide a source time, this field is left empty, and the gateway receiving time is not used to disguise the device source time. The request sequence number is generated incrementally by the gateway for each field communication channel and is used to distinguish continuous reading processes at the same acquisition point.

[0039] The original acquisition time referred to in this invention refers to the timestamp formed by the IoT data acquisition gateway recording the arrival time of the valid response using the local absolute clock calibrated by the system after a field read passes protocol verification. The criterion for this is that the time remains on the same timeline after the gateway restarts and is saved along with the original acquisition record. The device source time is saved separately as an additional field. When the device source time is missing or different device clocks have not yet been uniformly calibrated, the device source time is not used to replace the original acquisition time for cross-device sequencing.

[0040] The gateway monotonic timing value referred to in this invention is a continuous timing value generated by the gateway operating system or hardware timer, used only to calculate the time interval between two processing moments during the same gateway operation. The criterion for determining this value is that it is not reset due to local absolute clock synchronization. The remaining acquisition time limit in step S3, the communication response timeout judgment, and the resampling time boundary in step S4 all use the gateway monotonic timing value to calculate the duration; when it is necessary to write the upload record and perform historical sorting in step S6, the original acquisition time is used.

[0041] After the gateway sends a read request, it waits for the device to return within the communication response timeout period corresponding to the basic acquisition parameter table. If a message is received, protocol layer verification is performed first, and the response is associated with the incomplete read transaction in the current field communication channel. For Modbus RTU request-response protocols, at least the slave address, function code or abnormal function code, CRC, and response data length are verified to match the current request transaction. For protocols where the response message can echo the object address or transaction identifier, the object address or transaction identifier is further verified. Only when the response can uniquely correspond to the current incomplete request transaction and the protocol verification passes is the read marked as valid communication. If the response times out, verification fails, or the response cannot correspond to the current request transaction, the read does not update the most recent valid acquisition time, but records a communication failure and hands this point over to the retry sub-queue in step S3 for processing. This avoids mistaking "request sent" for "data updated".

[0042] For valid communication data, the gateway performs engineering quantity conversion according to the data type, scaling factor, and offset in step S1, and compares the converted engineering value or status code with the most recent valid engineering value for that point. Simultaneously, it saves the current device original value to the most recent valid original value field. Boolean and enumerated values ​​are directly compared to see if the status code has changed. If a corresponding trigger condition exists in the device status association table, and the current valid status and the previous valid status meet the trigger condition, a status change event is generated. For analog quantities with device alarm upper or lower limits, a corresponding event is generated only when the upper or lower limit has been imported with the device configuration and the current engineering value crosses the boundary with the previous valid engineering value. Analog quantities without configured limits are not automatically constructed by the gateway to exceed the limit threshold.

[0043] When a data collection point does not yet have a recent valid engineering value, the current valid data collection first writes the most recent valid original value, the most recent valid engineering value, the most recent valid data collection time, and the gateway monotonic timer value corresponding to this valid response. This serves as the basis for subsequent state comparisons and time limit calculations. Action events are not generated based on a non-existent previous state. For data collection points defined as trigger points for continuous state events in the device state association table, if the first valid data collection result already meets the continuous valid status code or continuous valid condition in the association record, there is no need to wait for a historical transition from unset to set. A continuous state event is directly established based on the current valid state, and the original data collection time of this record is used as the event start time. Therefore, devices already in an alarm or continuously exceeding-limit state when the gateway restarts will not lose event collection due to the lack of a previous sampled value.

[0044] After a status change event is generated, the gateway assigns an event identifier to the event and writes the original acquisition time from the current original acquisition record that triggered the event into the event start time field. Simultaneously, the event record is written with the trigger point identifier, pre-trigger state, post-trigger state, event type, event valid end time, corresponding device identifier, field communication channel, and configuration version identifier. For action-type events, the event valid end time is determined by the event start time and the allowed duration for action completion. For continuous status-type events, the event valid end time is set to empty when the event is generated; it is written to the calibrated local absolute clock time when the event ends, provided the end conditions are met. If a device experiences a new trigger condition before a previous event has ended, a new event identifier can be created, or a combination of allowed trigger conditions can be pre-defined in the device status association table. If merging is allowed, only the associated acquisition points that the current event needs to read are expanded; the already saved event start time and original trigger record are not overwritten.

[0045] Step S2 also synchronously updates the most recent valid acquisition time and the gateway monotonic timer value corresponding to the most recent valid acquisition after each successful acquisition. For points that have not yet experienced a state change event, the next basic polling will continue according to the basic acquisition cycle; for trigger points that have generated state change events, instead of directly switching the entire bus to unified high-speed polling in step S2, the event record is handed over to step S3, which only rearranges the reading order of the data points associated with the current event.

[0046] As an optional implementation, if the device protocol can return the device's internal sampling sequence number or data update time stamp, the original acquisition record also saves this field. If the gateway obtains the same engineering value twice consecutively, but the device's internal sampling sequence number has changed, it is considered that the device has indeed resampled and the value remains unchanged; if the device's internal sampling sequence number has not changed, step S4 can further determine whether the data belongs to data that has not been updated on the device side. For devices that do not provide an internal sampling sequence number, data freezing is not determined solely by "consecutive identical values," to avoid mistakenly marking normal steady-state values ​​as communication anomalies.

[0047] It should be noted that step S2 does not simply read all devices at a fixed cycle, but simultaneously generates two types of subsequent scheduling criteria: "valid acquisition time" and "state change events." Only data that passes protocol verification updates the valid acquisition time, and state change events are only triggered by adjacent valid acquisition results, providing a clear event entry point for step S3 when increasing the sampling frequency.

[0048] S3. Read the device status association table corresponding to the status change event, determine the event association collection point, and dynamically reconstruct the next round of polling order based on the event association status of each collection point, the remaining allowed update time, and the on-site communication occupancy.

[0049] The event-associated collection point referred to in this invention is a collection point that can be directly retrieved from the current trigger point identifier through the device status association table, and that needs to have its collection interval shortened or be read preferentially during the current event. The criterion for determining this is that the point appears in the associated collection point list of the current event association record. After the gateway reads the event record, it writes the current event identifier and event collection status for these points and switches their temporary collection cycle from the basic collection cycle to the event collection cycle in the device status association table; other points that do not appear in the association list maintain their original basic collection cycle.

[0050] The "next event acquisition expiration time" referred to in this invention refers to the gateway monotonic timing boundary at which the associated acquisition point can next enter the event acquisition waiting queue. When an acquisition point first enters the event acquisition state, its next event acquisition expiration time is set to the current gateway monotonic timing value, allowing it to immediately participate in dynamic polling. After the point completes a valid event acquisition, the next event acquisition expiration time is updated by adding the event acquisition cycle to the gateway monotonic timing value corresponding to this valid acquisition. In the event of a communication failure, the expiration time is not postponed, allowing the point to continue participating in scheduling according to the retry boundary in step S3.

[0051] To address the issue of multiple devices sharing bandwidth in the same field communication channel, the gateway calculates the remaining time limit for each data collection point awaiting reading. For points with valid data collection records, the remaining time limit is calculated by subtracting the difference between the current gateway monotonic time value and the gateway monotonic time value corresponding to the most recent valid data collection from the maximum allowed update time for that point. For points without valid data collection results on the first attempt, the remaining time limit is set to 0, and the first reading is prioritized. If the calculation result is less than or equal to 0, it indicates that the point has reached the maximum allowed update time boundary and cannot be further delayed due to other events. Therefore, the calculation of the remaining time limit uses only the same monotonic time reference and is not mixed with the absolute timestamps used for historical records and cross-restart sorting.

[0052] The dynamic polling queue referred to in this invention refers to the next batch of read tasks reordered by the gateway based on the currently waiting tasks after each read transaction is completed on the field communication channel. The criterion for reordering is that the event association status and the remaining collection time limit are considered simultaneously during the sorting process, and the sorting result can change as new events arrive, a certain point of read is completed, or a certain point of read fails. This queue is not a fixed station address order during device installation.

[0053] The upper bound of single-transaction occupancy referred to in this invention refers to the maximum channel occupancy time reserved in a shared serial communication channel from the start of sending a read request to the point where the channel can safely begin the next read request. For Modbus RTU-type communication on RS485, this time is obtained by adding the communication response timeout time in the basic acquisition parameter table, the expected maximum response message byte count, the response message transmission time determined by the serial port baud rate, data bits, parity bits, and stop bits, to the response message transmission time determined by the same serial port configuration and the inter-frame silence time specified by the protocol; the above message byte count and serial port parameters are all derived from the current request transaction and the field communication channel configuration. For industrial Ethernet connections capable of concurrent communication, this embodiment maintains task queues separately for each connection object and does not use the upper bound of single-transaction occupancy of the shared serial channel for cross-connection preemption judgment.

[0054] Please see Figure 5 , Figure 5 This is a schematic diagram of dynamic polling and retry scheduling for a shared communication channel.

[0055] like Figure 5 As shown, the tasks to be collected in the same shared field communication channel include event-associated collection points and non-event-associated collection points. The IoT data acquisition gateway determines the tasks to be scheduled based on the event association status of each collection point, the expiration time of the next event collection, and the remaining collection time limit. It also determines the upper bound of a single communication transaction based on the message parameters corresponding to the current candidate read transaction and the field communication channel configuration. When the remaining collection time limit of a non-event-associated collection point is insufficient to continue yielding to the current event-associated collection point, the corresponding non-event-associated collection task is inserted first; the remaining tasks are dynamically sorted according to the remaining collection time limit to obtain a dynamic polling queue. Collection points that fail to read enter the retry sub-queue and rejoin the dynamic polling when the remaining collection time limit constraint is met.

[0056] Specifically, the gateway uses a hierarchical sorting method instead of a sourceless comprehensive score. The gateway first selects the event-related collection point with the smallest remaining collection time limit from among those whose current monotonic time value has reached the expiration time of the next event collection. It then obtains the upper bound of the single communication transaction occupancy for this candidate point according to the current request transaction and communication channel configuration. Next, it checks non-event-related collection points in the same shared communication channel. If any non-event-related collection point has a remaining collection time limit less than or equal to the upper bound of the single communication transaction occupancy, the non-event-related collection point with the smallest remaining collection time limit is executed first; otherwise, the event candidate point is executed. When no event-related collection point has expired, all waiting points are arranged in ascending order of remaining collection time limit. If the remaining collection time limits are the same, priority is given to the point with the earlier valid collection time; if still the same, they are processed according to the fixed order of the point identifiers. The above rules only use the time field, message length, and on-site communication configuration generated in steps S1 and S2, without setting risk weights, importance weights, or comprehensive scores requiring manual parameter tuning.

[0057] When an event-associated collection point enters the event collection state, the gateway directly reads the event collection period from the device status association table. Since this field was automatically written to the corresponding collection point's minimum allowed polling interval when the device status association table was generated in step S1, and the basic collection parameter table has already verified during initialization that the minimum allowed polling interval is not greater than the basic collection period and not greater than the maximum allowed update time, step S3 directly uses the event collection period that has already passed the initialization boundary verification. If subsequent configuration file updates cause the above boundary relationship to be invalid, the point will be refused activation during the configuration reload phase, rather than being temporarily corrected after the event occurs.

[0058] For a data collection point that experiences a communication timeout during a read operation, the gateway does not continuously retries indefinitely at the original location. Instead, it moves the point to a retry sub-queue within the same communication channel and recalculates the remaining collection time limit and the upper bound of the single communication transaction for that point before each retry. If the remaining collection time limit is not less than the upper bound of the single communication transaction, it indicates that sufficient time can still be reserved for a complete read transaction according to the current communication configuration, and the point is allowed to participate in one more retry according to the dynamic polling rules. If the remaining collection time limit is less than the upper bound of the single communication transaction, no new on-site read transaction is arranged, and the point is marked as having timed out, with the failure status handed over to the data quality processing in step S4. The remaining collection time limit is recalculated after each retry, so there is no need to pre-set a fixed number of retries or use the maximum allowed update time divided by the collection cycle to estimate the theoretical number of retries.

[0059] When a wind turbine start-up event occurs on the same RS485 bus, traditional fixed polling may still require waiting for multiple slow-responding slave stations to complete sequentially. Following this procedure, wind turbine operation feedback, inverter operating frequency, operating current, and fault status are temporarily added to the event association layer, and their next event acquisition expiration time is immediately reached upon entering event acquisition mode; however, other acquisition points are not permanently stopped. When the remaining acquisition time of a non-event-associated acquisition point is less than or equal to the upper bound of the single communication transaction occupancy corresponding to the current event candidate point, the non-event-associated acquisition point executes before the event candidate point. Therefore, dynamic polling can improve the temporal density of associated data during an event without creating new data gaps by simply "pausing all ordinary points."

[0060] During the event hold period, whenever an associated acquisition point completes a valid read, the gateway updates its most recent valid acquisition time and regenerates the next round of polling queue. For action-type events, event acquisition ends after the allowed duration for action completion is reached. If the data consistency rules of the device status association table stipulate that a certain feedback acquisition point must obtain a valid sample, then it is simultaneously checked whether the feedback acquisition point has formed a valid record. If not, high-speed acquisition ends and the "specified feedback acquisition point missing" quality status is retained and passed to steps S4 and S5 for uploading, without indefinitely maintaining event polling. For continuous status-type events, when the event hold end condition in the device status association table is met, that moment is written to the event's valid end time, and the event acquisition status of the associated point is cleared, restoring it to the basic acquisition cycle.

[0061] S4. Perform associated data collection according to the dynamic polling queue, organize the control quantity, feedback quantity and operation quantity under the same state change event into a collection evidence group, perform consistency verification on the collection time, protocol validity and preset state relationship, and perform targeted re-collection on inconsistent data.

[0062] The "collected evidence set" referred to in this invention is a data collection organized around a single state change event of the same device, combining the state change record of the trigger point with the valid records of associated collection points listed in the device state association table, according to the same event identifier. The criterion for determining whether a single record in the set can be traced back to a specific location identifier, gateway reception time, and communication verification result is valid. The collected evidence set is used to determine whether "this collection chain forms complete and mutually corresponding data," and does not directly output a conclusion of mechanical failure of the device.

[0063] Please see Figure 6 , Figure 6 This is a schematic diagram illustrating the evidence collection group and consistency verification principle.

[0064] like Figure 6As shown, the IoT data acquisition gateway uses the event identifier of the state change event as the association index to organize trigger records, feedback records, and operation records into a collection evidence group, and limits the effective time range of the collection evidence group by combining the effective deadline of the event. Time validity verification, communication validity verification, and association consistency verification are performed on the collection evidence group respectively. For collection records that pass the verification, corresponding data quality bytes are generated; for collection points that fail the verification, a targeted re-collection task is generated based on the collection point and the event-related collection points that participate in the same data consistency rule judgment, and the targeted re-collection result is rewritten into the corresponding collection evidence group.

[0065] The gateway first performs a communication validity check. Step S2 has already confirmed the message protocol verification result; the same check is performed on the data re-sampled in step S3. Records that fail protocol verification, whose responses do not correspond to the current request transaction, or that time out are not written into the evidence collection group as valid sample values; only the failure time and failure type are retained. Subsequently, a time validity check is performed: the gateway's receiving time at the associated collection point must not be earlier than the start time of the current state change event; for action-type events, it must not be later than the valid deadline already written into the event record; for persistent state-type events, when the valid deadline is still empty, records obtained after the event start time are treated as current persistent events. Once the event's end conditions are met and written into the valid deadline, that deadline is used to limit the final evidence collection group. If a device source time exists, it is also saved, but the device source clock is not used to replace the gateway's local receiving time as the basis for determining whether the current communication transaction is complete.

[0066] For Boolean values ​​and enumerated feedback, the gateway compares the pre-trigger state, post-trigger state, and associated feedback state according to the consistency rules in the device state association table. For example, for an event where the start command changes from 0 to 1, the running feedback can be required to have at least one valid read within the event window, and whether the change from 0 to 1 has occurred can be recorded. If no change has occurred, step S4 only marks the evidence group as "state association inconsistency" and does not directly determine the device as faulty, because the same phenomenon may also be caused by feedback point read failure, device action delay, or the device itself not executing the command. For operating quantities such as operating current, operating frequency, and water level, this embodiment prioritizes checking whether valid sampling and time records have been obtained within the event window. Only when the device state association table has been configured with a clear physical range according to the device protocol or engineering parameters will the corresponding range verification be performed.

[0067] To identify situations where "the gateway received a message but the data on the device side may not have been updated," when the device protocol provides an internal sampling sequence number, data update time, or device clock, step S4 compares this field with the previous valid record. If the internal sampling sequence number increments or the device update time advances, the point is marked as "source data has been updated." If neither the internal sampling sequence number nor the update time advances, but the gateway continuously receives data returned by the same device, it is marked as "source data update not confirmed." For cases where the device protocol does not provide the above fields, no inference is made based on whether the engineering values ​​are the same; only the "source update status cannot be determined" mark is retained to avoid misjudging a stable operating state as frozen.

[0068] When a communication failure occurs in the evidence collection group, a feedback collection point that must be validly sampled according to the data consistency rules of the device status association table is missing, the status association is inconsistent, or the source data has not been confirmed to be updated, the gateway generates a targeted re-sampling task. The targeted re-sampling task only includes the points in the current evidence collection group that failed the corresponding verification, as well as other associated collection points in the device status association table that participate in the same data consistency rule judgment along with the failed point. It does not re-read all equipment in the entire tunnel at high speed. For example, if the operating feedback is missing in a fan start-up event but the operating current has been validly read, and if the consistency rule also requires verification of the fault status, the re-sampling task includes both the operating feedback and the fault status, while retaining the already obtained current record, without needing to add water level, lighting, and other irrelevant points.

[0069] The targeted re-sampling task returns to the retry sub-queue of the communication channel where step S3 is located. Before each targeted re-sampling is prepared, the gateway recalculates the remaining collection time limit for the corresponding point and the upper bound of the single communication transaction occupancy for this re-sampling using the same method as in step S3; the next re-sampling is only scheduled if the remaining collection time limit is not less than the upper bound of the single communication transaction occupancy. After each re-sampling is completed, step S4 updates the current collection evidence group; if the associated data is supplemented within the allowed time limit, the data quality status is changed to re-sampling confirmation; if the remaining collection time limit is insufficient to accommodate a complete communication transaction and the data is still not supplemented, the re-sampling ends, and the existing original data, failure type, and missing points are retained without being filled with manually generated substitute values.

[0070] To enable the subsequent monitoring platform to distinguish different data validity states, this embodiment sets one data quality byte for each uploaded record. This byte stores the facts of the collection process bit by bit, rather than storing a difficult-to-interpret comprehensive credibility score. The definitions of each bit are shown in the table below; unused high-order bits are reserved as 0, and will be explained in the protocol version field later when expanding.

[0071] Please see Figure 7 , Figure 7 This table provides a comparison of the setting conditions, meanings, and subsequent processing for each segment.

[0072] like Figure 7 As shown, for normal polling records with empty event identifiers, bits 1, 3, 4, and 6 of the data quality byte are event processing status bits, which do not participate in the quality judgment of normal records and remain at 0; the tunnel monitoring platform only interprets these status bits when the event identifier is not empty. After the data quality byte is generated, it forms a complete quality-marked collection record to be uploaded together with the original collection record, and subsequent step S5 does not recalculate its collection quality meaning. If the same record is resent from the unconfirmed record area or the historical buffer area after the link is restored, bit 7 will only be set in the copy sent in this retransmission, without changing the original collection time, original request sequence number, and other quality bits. In this way, the platform can distinguish between two situations: "quality problems existed at the time of collection" and "the record was resent due to link abnormality".

[0073] It should be noted that step S4 does not use a difficult-to-trace judgment method such as "confidence greater than a certain threshold". Instead, it saves the validity of the protocol, the validity of the time, the confirmation of the source data update, the consistency of the association status, and whether it has been re-sampled. When a certain control feedback relationship is inconsistent, the acquisition layer is re-sampled first, rather than directly outputting the equipment failure conclusion. Thus, this invention still revolves around the acquisition, verification, and transmission of telemetry data of tunnel electromechanical equipment.

[0074] S5. Write the collected records that have completed quality marking into the queue of data to be uploaded; during the uplink anomaly, form an event retransmission group according to the status change event, and perform event preservation cache degradation when the record storage area is insufficient; after the link is restored, dynamically schedule the real-time data stream and the historical retransmission stream according to the evidence integrity status of the event retransmission group and the link confirmation transmission capability.

[0075] The IoT data acquisition gateway assigns a data sequence number to the acquisition record processed in step S4, and writes the point identifier, event identifier, original acquisition time, engineering value, data quality byte, and data sequence number together into the non-volatile record storage area. When the uplink is normal, newly formed acquisition records that have not yet been confirmed by the tunnel monitoring platform enter the real-time data stream; acquisition records that have already been sent but have not yet been confirmed remain in the pending confirmation record area.

[0076] When the uplink transitions to an abnormal state, the IoT data acquisition gateway marks the acquisition records that were sent before the link abnormality but have not yet been acknowledged as pending retransmission, and writes the newly generated acquisition records during the link abnormality period into the record storage area. For pending retransmission records with non-empty event identifiers, trigger records, feedback records, operation records, and targeted re-acquisition records belonging to the same state change event are organized into event retransmission groups according to the event identifier; for normal polling records with empty event identifiers, they are saved as ordinary historical records.

[0077] The event retransmission group referred to in this invention is a historical data set consisting of records to be retransmitted corresponding to the same event identifier. The IoT data acquisition gateway maintains an event confirmation summary for each event identifier, recording the location identifiers corresponding to the necessary records confirmed by the tunnel monitoring platform. The gateway reads the associated collection point list and data consistency rules from the device status association table corresponding to the event's configuration version to determine the necessary record set required to form a complete evidence collection group. It then merges the confirmed necessary record set in the event confirmation summary with the necessary record set to be retransmitted in the current event retransmission group and matches it with the necessary record set. When the merged record set covers all necessary records, the event retransmission group is marked as evidence complete; if any necessary records are still not covered, the event retransmission group is marked as evidence incomplete and the missing location identifiers are saved.

[0078] The event preservation records include trigger records for state change events, feedback records that must be obtained according to data consistency rules, records formed after targeted resampling, and operational records that must participate in the judgment according to data consistency rules. When the record storage area has sufficient space, the event preservation records, other event records, and ordinary historical records are persisted normally according to the original data sequence numbers.

[0079] When the remaining space in the record storage area is less than the storage space after serialization of the current complete acquisition record, it enters the event preservation cache degradation state. If the record to be written is an event preservation record, then first, ordinary historical records with empty event identifiers are searched in the record storage area, and ordinary historical records are released from earliest to latest according to the original acquisition time, until the storage space required to save the current event preservation record is formed; the data sequence number of the released record is written to the metadata area to form an unrecoverable sequence range, and the reason for cache degradation is recorded at the same time.

[0080] For ordinary historical records with empty event identifiers, in the event-preserving cache degradation state, the local absolute clock time synchronized with the system when the uplink entered an abnormal state is used as the starting time of the first historical retention interval, and subsequent historical retention intervals are continuously divided according to the maximum allowable update time of the collection point. When multiple ordinary historical records exist within the same historical retention interval for the same collection point, only the ordinary historical record with the latest original collection time is retained, and the data sequence number of the replaced record is written into the non-replaceable sequence interval. If there is still no space to save the new record after the above degradation process, the high-water mark of the data sequence number is retained, and the data sequence number not written to the record is recorded in the non-replaceable sequence interval, and the corresponding data sequence number is not reused.

[0081] After the link is restored, the IoT data acquisition gateway will form a real-time data stream from the newly generated acquisition records and a historical retransmission stream from the records to be retransmitted and the historical records saved during the link anomaly. For event retransmission groups with incomplete evidence, the gateway will further determine the set of missing necessary records. When only one point in the set of missing necessary records has not yet been confirmed by the platform, and there is a record to be retransmitted corresponding to that missing point in the record storage area, that record to be retransmitted will be identified as a candidate record for event closure. After the candidate record for event closure is confirmed by the platform, the evidence integrity status of the corresponding event retransmission group will be re-determined based on the updated event confirmation summary.

[0082] The IoT data acquisition gateway uses the platform confirmation waiting time as the link recovery scheduling cycle. The first complete scheduling cycle after the link recovers from the abnormal state is used as the capability detection cycle. During the link recovery scheduling cycle, records to be sent in the real-time data stream are sent first. After the link recovery scheduling cycle ends, the sum of serialized bytes of uploaded records sent during the link recovery scheduling cycle and confirmed by the tunnel monitoring platform is counted, and this byte count is used as the link confirmation transmission capacity for the next scheduling cycle.

[0083] For each subsequent scheduling cycle, the gateway reads the remaining real-time transmission timeout for each record to be sent in the real-time data stream. The sum of the serialized bytes corresponding to the records to be sent whose remaining real-time transmission timeout is less than or equal to the duration of one link recovery scheduling cycle is determined as the current real-time data transmission requirement. If the link confirmation transmission capacity is greater than the current real-time data transmission requirement, the difference in byte count is determined as the historical retransmission quota for the current scheduling cycle; if the link confirmation transmission capacity is less than or equal to the current real-time data transmission requirement, the historical retransmission quota is set to zero.

[0084] During scheduling periods where the historical retransmission quota is greater than zero, the gateway sequentially selects candidate records for event closure, other event preservation records, other records in the evidence integrity status event retransmission group, and ordinary historical records to add to the historical retransmission stream. The cumulative value of the serialized bytes of the selected records must not exceed the current historical retransmission quota. After the current scheduling period ends, the link confirmation transmission capacity for the next scheduling period is updated based on the actual number of serialized bytes of uploaded records confirmed by the platform during the current link recovery scheduling period.

[0085] Please see Figure 8 , Figure 8 This diagram illustrates the network outage recovery and retransmission based on the integrity of event evidence and the link confirmation transmission capability.

[0086] like Figure 8As shown, during uplink anomalies, the IoT data acquisition gateway groups the records to be retransmitted into event retransmission groups according to event identifiers, and identifies trigger records, specified feedback records, targeted re-collection records, and operational records participating in consistency judgment as event preservation records. When record storage space is insufficient, event preservation records are retained first, and ordinary historical records are retained in a downgraded manner. After the link is restored, the link confirmation transmission capacity is determined through the capability detection cycle, and the historical retransmission quota is obtained according to the real-time data transmission requirements. Within the historical retransmission quota, retransmission is performed in the order of event closure candidate records, other event preservation records, and ordinary historical records. The tunnel monitoring platform returns the event evidence integrity status and missing point identifiers based on the received event records.

[0087] S6. The tunnel monitoring platform receives real-time data streams and historical retransmission streams. Based on the gateway identifier, data sequence number, and event identifier, it performs duplicate record identification, sequence gap detection, and event retransmission group integrity verification, and returns confirmation information to the IoT data acquisition gateway.

[0088] The tunnel monitoring platform maintains the status of received data sequences for each IoT data acquisition gateway. After receiving an uploaded record, the platform determines whether the corresponding record has been received based on the gateway identifier and data sequence number. If the same data sequence number already exists, it returns a duplicate record confirmation. If the corresponding data sequence number has not been received, the record is saved and written into the corresponding historical data sequence according to the original acquisition time.

[0089] For records with non-empty event identifiers, the tunnel monitoring platform reconstructs the corresponding event retransmission group according to the event identifier, and reads the corresponding version of the device status association table based on the configuration version identifier carried by the event record. It then determines the necessary record set required for the event based on the data consistency rules in the device status association table. The platform matches the received trigger records, feedback records, operation records, and targeted re-sampling records with the necessary record set to obtain the event evidence completeness status on the platform side. If any necessary records are missing, the event identifier and the missing point identifier are written into the confirmation information; if all necessary records have been received, the corresponding event retransmission group is marked as having complete evidence.

[0090] After receiving the confirmation information containing the missing point identifier, the IoT data acquisition gateway queries the unconfirmed record under the corresponding event identifier in the local record storage area, and marks the record that matches the missing point identifier as the event closure candidate record, so that step S5 can send it first in the subsequent historical retransmission quota.

[0091] When the platform detects a missing data sequence number, it sends a missing sequence number query to the IoT data acquisition gateway. The gateway first queries the record storage area; if a corresponding complete record exists, it adds that record back to the historical retransmission stream. If no corresponding complete record exists, it queries the unrecoverable sequence range in the metadata area; if the corresponding data sequence number is within the unrecoverable sequence range, it returns the corresponding sequence range and the reason for cache degradation to the platform. The platform marks the sequence gap as unrecoverable data caused by cache degradation and does not repeatedly request the corresponding complete record.

[0092] For records in the historical data stream, if the original acquisition time is earlier than the latest real-time acquisition time of the same acquisition point already saved by the platform, the record will be added to the historical data sequence without overwriting the current real-time status; if the original acquisition time is later than the time corresponding to the current status and communication is valid, the current status of the corresponding acquisition point will be updated.

[0093] After completing record persistence and event retransmission group integrity verification, the platform generates confirmation information. This confirmation information includes at least the gateway identifier, the maximum continuously received data sequence number, the set of missing data sequence numbers, the corresponding event identifier, the event evidence integrity status, and the missing point identifier. The IoT data acquisition gateway updates its local records to be confirmed, event retransmission groups, and subsequent historical retransmission order based on this confirmation information.

[0094] As a specific operational example, when a jet fan is in normal operation, its operation feedback, inverter frequency, and operating current are polled according to the basic acquisition parameter table. After the tunnel control system issues a start command and changes the start command point from 0 to 1, step S2 generates an action-type state change event and writes the original acquisition time of the trigger record into the event start time; step S3 switches the operation feedback, inverter frequency, operating current, and fault status to event acquisition status according to the equipment status association table, sets the next event acquisition expiration time for each associated point, and rearranges the polling in the same RS485 channel according to the remaining acquisition time limit and the upper limit of the single communication transaction occupancy of the candidate transaction. Step S4 writes the start command change and the subsequently obtained operation feedback, frequency, and current data into the acquisition evidence group corresponding to the same event identifier; if the operation feedback read times out, targeted resampling is only generated for the operation feedback and the fault status and other associated acquisition points in the equipment status association table that participate in the same data consistency rule judgment with the operation feedback, without repeatedly reading all equipment in the entire tunnel at high speed. If the uplink is interrupted when some records of the wind turbine startup event have already been sent—for example, the startup command change record has been confirmed by the tunnel monitoring platform, but the operation feedback, operating current, and fault status records have not yet been confirmed—the IoT data acquisition gateway establishes a corresponding event retransmission group based on the event identifier and writes the confirmed startup command change record into the event confirmation summary for that event. The gateway determines, based on the device status association table, that the startup command change record, operation feedback record, and the corresponding operation quantity records required for consistency judgment belong to the necessary record set for that event, and matches the event confirmation summary and the local records to be retransmitted with the necessary record set.

[0095] During the network outage, if the storage space is insufficient, priority will be given to saving the operation feedback, targeted resampling records, and operation volume records that participate in the consistency judgment corresponding to the start event. For ordinary historical records with empty event identifiers, the time when the uplink enters the abnormal state is taken as the starting point of the interval, and the historical retention interval is divided according to the maximum allowable update time of the corresponding collection point. Each interval retains only the most recent ordinary historical records with the original collection time.

[0096] In the first scheduling cycle after link recovery, real-time data is prioritized for transmission. The link confirmation transmission capacity is formed by the amount of data actually confirmed by the platform during the first link recovery scheduling cycle. Subsequent scheduling cycles determine the historical retransmission quota based on the link confirmation transmission capacity and real-time data transmission requirements. When the operational feedback is the only necessary record for the current event that has not yet been confirmed by the platform, the operational feedback record is identified as a candidate record for event closure and is prioritized for transmission within the historical retransmission quota. After the platform confirms the operational feedback record, it updates the evidence integrity status of the wind turbine startup event and then continues to retransmit other event records and ordinary historical records.

[0097] In this embodiment of the invention, the data transmission relationship between each step can be summarized as follows: Step S1 generates collection point records, a basic collection parameter table, and a device status association table with configuration version identifiers; Step S2 performs on-site polling and outputs the original collection records and status change events carrying configuration version identifiers; Step S3 outputs event-associated collection points, a dynamic polling queue, and retry tasks based on the status change events; Step S4 forms collection evidence groups, directional re-collection results, and collection records with completed quality markings; Step S5 organizes network outage records into event retransmission groups based on event identifiers, forms event confirmation summaries based on platform confirmation information, generates non-retransmission sequence intervals when the cache is insufficient, and outputs real-time data streams, event closure candidate records, historical retransmission quotas, and historical retransmission streams after the link is restored; Step S6 completes duplicate record identification, sequence gap detection, and event evidence integrity verification based on data sequence numbers and event identifiers, and returns the event evidence integrity status and missing point identifiers to Step S5 along with the confirmation information, and Step S5 updates the event retransmission groups and subsequent retransmission order.

[0098] In this embodiment, Modbus message parsing, TCP connection, CRC check, non-volatile storage, and database persistence can all be implemented using existing technologies in the field. This invention does not differentiate between a specific fieldbus protocol, message middleware, or cloud platform framework; its core features are: selecting associated acquisition points from basic polling using state change events; dynamically reconstructing the shared channel polling order based on point update time constraints; forming acquisition evidence groups from control, feedback, and operational quantities for the same event and re-acquiring inconsistent data; and after uplink recovery, splitting and scheduling real-time data streams and historical retransmission streams, and restoring the transmission order using sequence numbers and original acquisition times.

[0099] The above provides a detailed description of the IoT data acquisition method for tunnel electromechanical equipment provided by the embodiments of the present invention. In actual deployment, the trigger points and association points in the equipment status association table can be adjusted according to the type of tunnel equipment, and different field interfaces can be selected according to the equipment communication protocol. As long as the data organization and signal transmission methods described in this embodiment are still implemented according to the status change event-driven association acquisition, the polling reconstruction based on the acquisition time limit, the acquisition consistency verification of the association data, and the processing relationship between real-time data and historical retransmission data after the link is restored, the data organization and signal transmission methods described in this embodiment can be adopted.

Claims

1. A method for acquiring IoT data from tunnel electromechanical equipment, characterized in that, Includes the following steps: Establish a table of data collection points, basic data collection parameters, and device status association; Regularly poll and generate state change events, determine the associated collection points based on the state change events, and reconstruct the dynamic polling queue; Organize the collected records of the same state change event into a collection evidence group and perform targeted recollection; During uplink anomalies, records to be retransmitted are organized into event retransmission groups according to event identifiers. When storage space is insufficient, event preservation records are retained first and ordinary historical records are retained in a downgraded manner. After the link is restored, the historical retransmission quota and transmission order are determined based on the evidence integrity status of the event retransmission group and the link confirmation transmission capacity, and then transmitted separately from the real-time data stream. The platform performs deduplication, gap detection, and time sequence restoration based on the data sequence number and the original acquisition time.

2. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 1, characterized in that, The basic acquisition parameter table records the point identifier, device identifier, field communication channel, protocol reading information, data type, basic acquisition cycle, maximum allowed update time, minimum allowed polling interval of the device, and communication response timeout time for each acquisition point. The device status association table records the trigger point identifier, trigger condition, event type, list of associated collection points, event collection cycle, event retention conditions, and data consistency rules.

3. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 2, characterized in that, The state change event is obtained by comparing the states of adjacent valid acquisition results at the same acquisition point. The state change event records the event identifier, trigger point identifier, state before triggering, state after triggering, event start time, and event type. The event start time is the original acquisition time corresponding to the original acquisition record that triggered the state change event.

4. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 2, characterized in that, According to the state change event, query the device state association table, write the associated collection point obtained from the query into the current event identifier and switch to the event collection state; The next event collection expiration time is generated for each event-related collection point based on the event collection cycle. The next event collection expiration time is updated after the event-related collection point completes valid collection.

5. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 4, characterized in that, Based on the maximum allowed update time, the current gateway monotonic timer value, and the gateway monotonic timer value corresponding to the most recent valid data collection, determine the remaining collection time limit for each data collection point; based on the message parameters of the current read transaction, the on-site communication channel configuration, the communication response timeout time, and the protocol frame interval, determine the upper limit of the single communication transaction occupancy. A dynamic polling queue is generated based on the event association status, the expiration time of the next event collection, the remaining collection time limit, and the upper limit of the single communication transaction.

6. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 5, characterized in that, Generate retry tasks for data collection points that failed to be read; Before retrying, the remaining collection time limit and the upper limit of a single communication transaction for the corresponding collection point are redefined. When the remaining collection time limit is not less than the upper limit of a single communication transaction, the collection point is added back to the dynamic polling queue. When the remaining collection time limit is less than the upper limit of a single communication transaction, the retry for the corresponding collection point is terminated.

7. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 1, characterized in that, Records sent but not confirmed before the link anomaly and collection records formed during the link anomaly are organized into an event retransmission group according to the event identifier. The necessary record set for the corresponding event is determined according to the data consistency rules of the device status association table. The confirmed necessary record set is determined according to the platform confirmation information. The confirmed necessary record set and the necessary record set to be retransmitted in the event retransmission group are matched together with the necessary record set to determine the evidence integrity status and missing point identifier of the corresponding event retransmission group.

8. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 7, characterized in that, Trigger records, feedback records required by data consistency rules, targeted resampling records, and operational records that must participate in consistency judgment are defined as event preservation records. When the record storage area is insufficient, ordinary historical records are released first to save event preservation records. The moment when the uplink enters an abnormal state is taken as the starting moment of the historical retention interval. The historical retention interval is continuously divided according to the maximum allowable update time of each collection point. The same collection point retains the latest ordinary historical records with the original collection time in the same historical retention interval, and the data sequence number that has been released or not written to the record is written into the non-recoverable sequence interval.

9. The method for acquiring IoT data of tunnel electromechanical equipment according to claim 7, characterized in that, Real-time data is sent during the first link recovery scheduling cycle after the link is restored. The link confirmation transmission capacity for the link recovery scheduling cycle immediately following the first link recovery scheduling cycle is determined based on the amount of uploaded data confirmed by the platform during the first link recovery scheduling cycle. The historical retransmission quota is determined based on the difference between the link confirmation transmission capacity and the current real-time data sending demand. Within the historical retransmission quota, event closure candidate records, other event preservation records, other records in the evidence integrity status event retransmission group, and ordinary historical records are sent in sequence.

10. A method for acquiring IoT data of tunnel electromechanical equipment according to claim 9, characterized in that, The tunnel monitoring platform reconstructs the event retransmission group based on the event identifier, determines the completeness status of the event evidence on the platform side based on the required record set, and returns the missing point identifier along with the confirmation information to the IoT data acquisition gateway; the IoT data acquisition gateway determines the event closure candidate record based on the missing point identifier and updates the subsequent historical retransmission order.