Water conservancy work condition data double-link automatic switching and transmission method and system
By atomizing and encapsulating water conservancy project data and analyzing link health indicators, switching criteria are dynamically generated to achieve smooth switching between dual links. This solves the problem of unstable link switching in water conservancy project data transmission and ensures the continuity and sequential consistency of data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- JIANGSU WATER CONSERVANCY SCI RES INST
- Filing Date
- 2026-04-21
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, the transmission of water conservancy project information data suffers from problems such as delayed link switching response, data interruption, data duplication or out-of-order transmission, and it is particularly difficult to meet the requirements for continuous transmission when the link status fluctuates.
A dual-link automatic switching and transmission method is adopted. By atomically encapsulating the work status data, a work status data frame containing sequence number, business timeliness identifier, timestamp and verification information is generated. Switching criteria are dynamically generated in combination with link health indicators to achieve smooth switching of primary and backup links and data order and integrity.
Under fluctuating link status conditions, maintain the continuity and sequence consistency of work status data transmission, reduce data loss, duplication and out-of-order situations during handover, and improve the adaptability to different types of work status data.
Smart Images

Figure CN122457541A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data transmission technology, specifically a method and system for automatic switching and transmission of water conservancy project data via dual links. Background Technology
[0002] The operational data generated during the operation of water conservancy projects are characterized by diverse sources, complex types, and high timeliness requirements. This data includes water levels, flow rates, rainfall, equipment status, and alarm information, and is typically uploaded in real-time to the dispatch center or monitoring platform via communication networks from field monitoring stations. In practical applications, the continuity and temporal consistency of this data directly affect the reliability of dispatch decisions, thus placing higher demands on the stability and continuity of the data transmission link.
[0003] In existing technologies, engineering data transmission often adopts a single communication link or a primary / backup switching method. The primary and backup links are usually switched based on a fixed threshold or a simple heartbeat mechanism. When the primary link fails, the backup link is triggered to take over. However, this type of method generally suffers from problems such as delayed switching response, data interruption during switching, data duplication or out-of-order transmission. Especially when the link status is fluctuating, frequent switching or untimely switching is likely to occur, making it difficult to meet the continuous transmission requirements of water conservancy engineering data in complex network environments. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention proposes a method and system for automatic switching and transmission of hydraulic engineering data between two links. This method combines dynamic changes in link status with the characteristics of engineering data to achieve smooth switching between two links while ensuring data order and integrity.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for automatic switching and transmission of hydraulic engineering data via dual links, comprising:
[0007] Collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate project data frames containing sequence number, business timeliness identifier, timestamp and verification information, and write them into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks.
[0008] The primary and backup transmission links are monitored in real time to obtain link performance parameters and form link health indicators. Based on the link health indicators and data service timeliness requirements, link switching criteria are dynamically generated.
[0009] When the main transmission link meets the link switching criteria, the transmission of the current engineering data frames in the transmission queue is not interrupted. Instead, they are transmitted synchronously on the backup transmission link. When the takeover conditions are met, the system switches to the backup transmission link to transmit engineering data frames.
[0010] Specifically, the process of collecting water conservancy project data, establishing a primary transmission link and a backup transmission link, atomically encapsulating the water conservancy project data to generate project data frames, and writing them into a transmission queue includes:
[0011] Collect water conservancy project data and assign a corresponding data source identifier and collection time stamp to each piece of water conservancy project data;
[0012] The collected water conservancy engineering data is split into multiple indivisible atomic data units, where each atomic data unit corresponds to only one measuring point object, one event action, or one state change segment.
[0013] According to the data source identifier, collection time stamp and service priority, the atomic data units are sequenced, and a sequence mark, category mark and time mark are written to each atomic data unit in sequence. Affixed association segment identifiers are added to atomic data units that are related to each other to form a candidate transmission sequence.
[0014] Establish a set of link identifiers for the primary transmission link and the backup transmission link, write each atomic data unit in the candidate transmission sequence into the corresponding link mapping field, and encapsulate the sequence marker, category marker, timeliness marker, associated segment identifier and data content together into a work status data frame;
[0015] According to the timeliness mark and associated segment identifier of the work status data frame, the work status data frame is written into the sending queue. Among them, work status data frames belonging to the same associated segment identifier are continuously written into the same waiting queue segment according to the sequential mark, and work status data frames not belonging to the same associated segment identifier are written into different queue levels according to the service priority.
[0016] Specifically, the step of establishing a set of link identifiers for the primary and backup transmission links, writing each atomic data unit in the candidate transmission sequence into its corresponding link mapping field, and encapsulating it into a work status data frame includes:
[0017] Assign link identifiers to the primary transmission link and the backup transmission link respectively, and generate a link identifier set containing the primary link identifier and the backup link identifier, wherein the link identifier set includes at least a primary link identifier segment, a backup link identifier segment, and a handover reserved identifier segment;
[0018] Based on the category label, time stamp label, and associated segment identifier of the atomic data unit, determine its link affiliation and write each atomic data unit into the corresponding link mapping field;
[0019] The sequence marker, category marker, time stamp marker, associated segment identifier, link mapping field, and data content are combined and arranged to form a frame data sequence to be encapsulated;
[0020] The frame data sequence is encapsulated according to a preset field arrangement order, and fields with the same associated segment identifier are combined to generate a work status data frame, resulting in a work status data frame sequence containing link mapping information.
[0021] Specifically, the real-time monitoring of the primary and backup transmission links, obtaining link performance parameters and forming link health indicators, and dynamically generating link switching criteria based on the link health indicators and data service timeliness requirements, includes:
[0022] According to the preset monitoring cycle, the main transmission link and the backup transmission link are detected and triggered respectively, the link interaction records are obtained, and the link identifier and collection time stamp are assigned;
[0023] The link interaction records are divided based on time continuity to generate link performance segments. Each link performance segment is then written with a segment number, a duration interval marker, and a status marker to form a set of link performance segments.
[0024] Based on the acquisition time stamp, the link performance segments within the corresponding time intervals of the main transmission link and the backup transmission link are aligned to construct a link comparison segment group under the same time window;
[0025] Based on the link comparison segment group, the link health index sequence corresponding to the main transmission link and the backup transmission link is generated respectively, and a time association identifier is written for each link health index sequence.
[0026] The link health index sequence is associated with water conservancy project data. The link health index sequence is divided into segments according to the time association identifier. Link switching criteria are generated based on the index change relationship of each segment. The link switching criteria include link cut-out conditions and link access conditions.
[0027] Specifically, based on the acquisition time stamp, link performance segments within the corresponding time intervals of the primary and backup transmission links are aligned to construct a link comparison segment group within the same time window, including:
[0028] The acquisition time stamps corresponding to each link performance segment of the main transmission link and the backup transmission link are extracted respectively, and the acquisition time stamps are rectified according to a unified time series reference to generate a rectified time stamp sequence that corresponds one-to-one with each link performance segment.
[0029] Based on the adjusted time stamp sequence, the link performance segments of the main transmission link and the backup transmission link are divided into time intervals according to a preset window length to form multiple time windows that are connected end to end, and the link performance segments that fall into the same time window are respectively assigned to the corresponding window segment set.
[0030] Within each time window, the window segment set of the primary transmission link and the window segment set of the backup transmission link are paired segment by segment according to the order of the time scale. For link performance segments with inconsistent numbers within the same time window, the segment combination that has been paired first is retained, and the unpaired segments are written into the cross-window pairing sequence.
[0031] The segments that are paired within each time window and the segments that are added to the cross-window matching sequence are organized into a link matching segment group, and a corresponding window identifier and pairing order identifier are written for each link matching segment group.
[0032] Specifically, based on the link comparison segment group, link health index sequences corresponding to the primary transmission link and the backup transmission link are generated respectively, and time-related identifiers are written for each link health index sequence, including:
[0033] The link performance segments belonging to the main transmission link in each link comparison segment group are extracted to form the main link segment set, and the link performance segments belonging to the backup transmission link are extracted to form the backup link segment set.
[0034] The primary link segment set and the backup link segment set are merged according to the window identifier, and the corresponding link status label group is generated according to the order of each link performance segment in the corresponding window and the segment status label.
[0035] Based on the link status tag group corresponding to each window, the main link health index of the main transmission link and the backup link health index of the backup transmission link are generated respectively, and arranged in order according to the window identifiers to form the main link health index sequence and the backup link health index sequence.
[0036] The generated primary link health indicator sequence and backup link health indicator sequence are associated with their corresponding window identifiers and written to the system. Time association identifiers are also written to each link health indicator sequence according to the time scale range.
[0037] Specifically, the link health index sequence is correlated with water conservancy project data, the link health index sequence is divided into segments according to time association identifiers, and link switching criteria are generated based on the index change relationships of each segment, including:
[0038] Based on time-related identifiers, water conservancy project data are associated with corresponding time periods in the main transmission link health index sequence and the backup transmission link health index sequence, forming data time period association groups;
[0039] Based on the data time period association group, the health index sequence of the main transmission link and the health index sequence of the backup transmission link are divided into continuous segments. The health indexes of the links in the same associated time period are merged into the same segment index group, and a segment order identifier is written for each segment index group.
[0040] According to the segment sequence identifier, the continuity, transition and alternation relationships of each segment index group of the main transmission link and the backup transmission link between adjacent segments are extracted to form a segment change relationship set corresponding to each associated time period;
[0041] Based on the segment change relationship set, the cut-out decision segment of the main transmission link and the access decision segment of the backup transmission link are determined, and the cut-out decision segment and the access decision segment are combined to generate the link switching criteria corresponding to the current water conservancy project data.
[0042] Specifically, when the primary transmission link meets the link switching criteria, the transmission of the current engineering data frames in the transmission queue is not interrupted, but synchronously transmitted on the backup transmission link. When the takeover conditions are met, the system switches to the backup transmission link to transmit the engineering data frames, including:
[0043] The system reads the current transmission queue of work status data frames in real time and matches the transmission time period corresponding to the work status data frames with the link switching criteria. When it is determined that the main transmission link enters the handover judgment segment, the system extracts the work status data frames that have not yet been transmitted in the current transmission queue and forms a frame group to be taken over.
[0044] The original transmission order of the frame group to be taken over is kept unchanged on the main transmission link. At the same time, a corresponding mirror transmission sequence is generated according to the arrangement order of the frame group to be taken over in the current transmission queue, and the mirror transmission sequence is written into the waiting segment corresponding to the backup transmission link.
[0045] The main transmission link is controlled to continue sending the current work status data frames in the sending queue, and the backup transmission link is controlled to synchronously send the corresponding work status data frames according to the mirrored sending sequence. During the synchronous sending process, the carry flag and arrival feedback flag of the work status data frames in the same sequence position of the main transmission link and the backup transmission link are recorded respectively.
[0046] Based on the transmission carry flag and arrival feedback flag, the access progress of the backup transmission link to the frame group to be taken over is determined. When the backup transmission link enters the access determination segment and its access progress corresponds to the continuation position of the current transmission queue, the writing of subsequent work status data frames to the main transmission link is stopped, and the subsequent work status data frames to be sent are transferred to the backup transmission link to continue sending.
[0047] A dual-link automatic switching and transmission system for hydraulic engineering data is used to implement the aforementioned dual-link automatic switching and transmission method for hydraulic engineering data, comprising: a data processing module, a switching criterion generation module, and a switching transmission module;
[0048] The data processing module is used to collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate project data frames, and write them into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks.
[0049] The switching criterion generation module is used to monitor the primary transmission link and the backup transmission link in real time, obtain link performance parameters and form a link health index, and dynamically generate a link switching criterion based on the link health index and the timeliness requirements of data services.
[0050] The switching transmission module is used to transmit the current work status data frames in the current transmission queue without interrupting the transmission of the main transmission link when the link switching criteria are met, and to transmit them synchronously on the backup transmission link. When the takeover conditions are met, the module switches to the backup transmission link to transmit the work status data frames.
[0051] Specifically, the switching criterion generation module includes: a performance acquisition unit, a health indicator generation unit, and a switching criterion generation unit;
[0052] The performance acquisition unit divides the link interaction record based on time continuity, generates link performance segments, and writes a segment number, a duration interval marker, and a status marker to each link performance segment to form a set of link performance segments.
[0053] The health indicator generation unit generates link health indicator sequences for the main transmission link and the backup transmission link, respectively, based on the link comparison segment group.
[0054] The switching criterion generation unit is used to associate the link health index sequence with water conservancy project data, divide the link health index sequence into segments according to the time association identifier, and generate link switching criteria based on the index change relationship of each segment.
[0055] Compared with the prior art, the beneficial effects of the present invention are:
[0056] This invention proposes a method and system for automatic switching and transmission of hydraulic engineering data across dual links. It performs atomic encapsulation and associated segment identification processing on the hydraulic engineering data, and generates a link health index sequence by combining link performance fragmentation analysis and cross-link timing alignment. Based on this, a dynamic switching criterion based on business timeliness is introduced. Simultaneously, queue mirroring distribution and dual-link synchronous transmission are used to achieve continuous transmission control during the switching process, thus transforming link switching from a single-point triggering process to a process based on the collaborative evolution of data and links. This enables the maintenance of continuity and sequential consistency of engineering data transmission under fluctuating link status conditions, reduces data loss, duplication, and out-of-order issues during switching, and improves adaptability to different types of engineering data. Attached Figure Description
[0057] Figure 1 A flowchart of a method for automatic switching and transmission of hydraulic engineering data via dual links provided by the present invention;
[0058] Figure 2 This is a schematic diagram of automatic switching and transmission provided by the present invention;
[0059] Figure 3 This invention provides an architecture diagram of a dual-link automatic switching and transmission system for hydraulic engineering data. Detailed Implementation
[0060] The present application will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any way. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application. These all fall within the protection scope of the present application.
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] It should be noted that, unless there is a conflict, the various features in the embodiments of this application can be combined with each other, all of which are within the protection scope of this application. Furthermore, although functional modules are divided in the device schematic diagram and a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than the module division in the device or the order in the flowchart. In addition, the terms "first," "second," and "third" used in this application do not limit the data or execution order, but only distinguish identical or similar items with essentially the same function and effect.
[0063] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items.
[0064] Example 1
[0065] Please see Figures 1-2 The present invention provides an embodiment of a method for automatic switching and transmission of hydraulic engineering data via dual links, comprising the following specific steps:
[0066] Step S1: Collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate a project data frame containing a sequence number, business timeliness identifier, timestamp and verification information, and write it into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks.
[0067] Furthermore, this is accomplished through multi-source acquisition terminals deployed at water conservancy monitoring stations. These terminals are connected to water level gauges, rain gauges, flow meters, gate opening sensors, and video monitoring equipment, respectively. They acquire corresponding water conservancy project data according to preset sampling cycles or event triggering methods. Water level, rainfall, and flow data are acquired periodically, gate status data is acquired through status change triggering, video screenshots are captured based on time intervals or alarm linkages, and alarm event data is generated by the on-site control unit or the upper-level monitoring logic. During the acquisition process, the time synchronization module inside the acquisition terminal performs unified time base calibration on various types of data. The time synchronization module can acquire standard time signals based on network time synchronization or satellite time synchronization and write a corresponding acquisition timestamp for each piece of acquired data. At the same time, a data source identifier is generated based on the station number, equipment number, and data type. The data source identifier and the acquisition timestamp are embedded into the corresponding data record to form original project data entries with source information and time information.
[0068] Furthermore, the data is processed in the acquisition terminal or upper-level data processing unit, where the acquired hydraulic engineering data is analyzed and broken down line by line according to preset data parsing rules. Specifically, for periodically collected water level, rainfall, and flow data, the data record formed by each measuring point at each sampling time is treated as an independent atomic data unit based on the correspondence between a single measuring point and a single sampling time. For gate status data, each opening change or opening / closing action is parsed into a corresponding state change segment based on the state change trigger record, and then formed into a separate atomic data unit. For video screenshot data, each frame of the screenshot is processed... The time stamps associated with the alarms are used as independent atomic data units. For alarm event data, each alarm event is divided into a single event action unit based on the generation time of the alarm trigger signal and the alarm type. During the division process, the composite structure data is parsed at the field level by combining the data source identifier and the acquisition time stamp. Combined data that spans measurement points, time periods, or events is removed and decomposed into information units that contain only a single measurement point object, a single event action, or a single state change. The corresponding data source identifier and acquisition time stamp are retained for each atomic data unit, and finally, a set of atomic data units that meet the single semantic constraint is obtained.
[0069] Furthermore, atomic data units are categorized at the station level based on data source identifiers, and then sorted by acquisition time scale within the same station range to form a basic time series. Based on this, a business priority rule is introduced to rearrange the basic time series, where alarm event data and control-related data are set to high priority, status change data to medium priority, and periodic monitoring data to low priority, ensuring that high-priority atomic data units are prioritized under the same or adjacent acquisition time scales. Subsequently, a sequence marker is written to each sorted atomic data unit, which can be an ascending sequence number. Alternatively, a sequence number can be generated based on a timestamp offset. At the same time, a category tag is written according to the data type of the atomic data unit, and a corresponding timeliness tag is written according to the business priority and data timeliness requirements. Furthermore, by analyzing the correlation between adjacent atomic data units in terms of data source identification, collection time stamp continuity, and business semantics, a unified correlation segment identifier is added to data units that are continuously collected within the same event chain, the same state evolution process, or the same time window. This organizes logically related atomic data units into traceable continuous segments, ultimately forming a candidate transmission sequence that combines time sequence, business priority, and semantic correlation.
[0070] Furthermore, taking the generated candidate transmission sequences of water conservancy project atomic data units carrying sequence markers, category markers, timeliness markers, and associated segment identifiers as the processing object, the IEEE EUI-64 standard is first used to assign globally unique 64-bit link identifiers to the selected primary and backup transmission links respectively. The feasible primary transmission link is a water conservancy industry virtual private network transmission link based on the operator's 5G SA architecture, and the feasible backup transmission link is a BeiDou-3 civilian short message communication link. Simultaneously, a link identifier set containing the primary link identifier and the backup link identifier is generated using a fixed-length binary encoding format. The total length of this link identifier set is set to 3. The 2-byte segment is divided into three fixed fields: the primary link identifier segment, the backup link identifier segment, and the handover reserved identifier segment. The primary link identifier segment occupies 8 bytes and contains the lower 64 bits of the EUI-64 link identifier corresponding to the primary transmission link. The backup link identifier segment occupies 8 bytes and contains the complete encoding of the EUI-64 link identifier corresponding to the backup transmission link. The handover reserved identifier segment occupies 16 bytes. The first 8 bytes are reserved for writing the quantization encoding of the primary / backup link handover trigger threshold, and the last 8 bytes are reserved for writing the identifier of the emergency extension link. Each identifier segment in the link identifier set is appended with a 2-byte CRC16 checksum for integrity verification during the transmission of the identifier segment.
[0071] After completing the link identifier set construction, based on the preset link affiliation decision rules and combined with the existing static traffic scheduling and dynamic priority mapping algorithms, the category marker, timeliness marker, and associated segment identifier of each atomic data unit are read to determine the link affiliation of each atomic data unit one by one. The category marker is predefined as a 1-byte enumeration code that distinguishes between real-time monitoring, event alarm, and non-real-time image data. The timeliness marker adopts a 3-level timeliness code conforming to the time-sensitive network standard: level 0 corresponds to emergency alarm data with an end-to-end latency requirement of ≤100ms, level 1 corresponds to real-time monitoring data with a latency requirement of ≤1s, and level 2 corresponds to non-real-time data with a latency requirement of ≤1min. The associated segment identifier is an 8-byte unique code used to mark atomic data units associated with the same monitoring object, the same acquisition period, and the same triggering event. Specifically, the timeliness marker is level 0 for emergency alarm event data. Sub-data units are determined to belong to both primary and backup links, and are synchronously written into the primary link mapping field and the backup link mapping field. Real-time monitoring atomic data units with a timeliness mark of level 1 are determined to belong to the primary link first, and are written into the primary link mapping field. At the same time, the index pointer and associated segment identifier of the unit are written into the backup link mapping field. Non-real-time video screenshot atomic data units with a timeliness mark of level 2 are uniformly determined to belong to the backup link for image fragment units in the same batch with the same associated segment identifier, and are written into the backup link mapping field. The link mapping field uses 16-bit binary encoding. The high 2 bits are the link ownership identifier bits, with 01 corresponding to the primary link, 10 to the backup link, and 11 to both links. The low 14 bits are the offset address encoding of the unit in the corresponding link transmission queue. Each atomic data unit corresponds to a unique link mapping field to ensure the uniqueness and traceability of link ownership.
[0072] After completing the link attribution determination and link mapping field writing for all atomic data units, based on the frame structure conforming to the water conservancy industry, the sequence markers, category markers, timeliness markers, associated segment identifiers, link mapping fields, and data content corresponding to the atomic data units are combined and arranged in a fixed format to form a frame data sequence to be encapsulated. Specifically, atomic data units are first grouped according to the associated segment identifier, and atomic data units with the same associated segment identifier are divided into the same data group. Within each group, they are arranged in ascending order according to the sequence markers. The sequence markers use 32-bit unsigned integer encoding, corresponding to the acquisition timing and splitting order of the atomic data units. To ensure the consistency of the time sequence after arrangement, the arrangement structure of each atomic data unit adopts a 4-byte alignment rule, which is fixed as 4-byte sequence marker + 1-byte category marker + 1-byte time marker + 8-byte associated segment identifier + 2-byte link mapping field + 2-byte data content length field + variable-length data content. The data content is the measured value of water conservancy project, gate status parameters, binary data of image fragments or alarm event triggering parameters corresponding to the atomic data unit. After the field arrangement of all atomic data units is completed, the results are sorted according to the grouping order of the associated segment identifier and the order marker within the group to form a continuous and structured sequence of frame data to be encapsulated.
[0073] Finally, the frame data sequence is standardized and encapsulated according to a preset fixed field arrangement order. The preset frame field arrangement order, from frame header to frame tail, is as follows: 2-byte fixed frame start character, 32-byte link identifier set, 2-byte frame length field, 8-byte associated segment identifier, 2-byte frame sequence number field, data segment area, 4-byte CRC32 frame check field, and 2-byte fixed frame end character. The frame start character is fixed at 0x680x68, and the frame end character is fixed at 0x160x16. During the encapsulation process, based on the existing data frame encapsulation algorithm, the frame data sequence to be encapsulated is traversed, all arranged data segments with the same associated segment identifier are extracted, and these segments are filled into the data segment area of the frame structure. Simultaneously, the associated segment identifier is written into the associated segment identifier field of the frame structure. The pre-generated link identifier is then... The link identifier set field of the frame structure is written into the set. After filling all fixed fields in a preset order, the frame length field and the CRC32 frame check field covering the entire content from the frame header to the data segment are calculated and written to complete the encapsulation of a single-frame work status data frame. For large data segments whose single frame length exceeds the maximum transmission unit of the corresponding transmission link, existing IP fragmentation technology is used for segmentation and encapsulation. Each fragmented frame retains a complete link identifier set, associated segment identifier, and fragment sequence number to ensure that the receiving end can completely reassemble the data. After traversal, all encapsulated work status data frames are arranged in ascending order of frame sequence number, finally forming a complete sequence of work status data frames carrying full link mapping information. Each work status data frame completes the binding of the primary and backup transmission links through the built-in link identifier set and link mapping field.
[0074] Furthermore, the generated work status data frame sequence is queued. Specifically, firstly, the work status data frames are classified according to the timeliness marker and associated segment identifier carried by each frame. Work status data frames with the same associated segment identifier are identified as a set of consecutive frames within the same data segment, and then sorted according to their sequence markers. Subsequently, the sorted work status data frames are sequentially and continuously written into the same pending transmission segment in the transmission queue, ensuring that the data frames within that segment maintain consistent order during subsequent transmissions. For work status data frames with different associated segment identifiers, the priority of the service corresponding to their timeliness markers is determined. The system performs hierarchical processing, writing high-priority data frames into the high-priority segment of the transmission queue, and writing medium- and low-priority data frames into their corresponding medium or low-priority segments. The queue hierarchy can be implemented using multi-level buffer queues or scheduling queues with priority identifiers. During the writing process, a segment start identifier and segment length information are added to each queue segment, and the relative position of each work status data frame in the queue is recorded, forming a transmission queue structure that maintains the continuity of associated segments and has priority differentiation capabilities, resulting in a hierarchical ordered transmission queue for scheduling and reading by the primary transmission link and the backup transmission link.
[0075] Step S2: Monitor the primary and backup transmission links in real time, obtain link performance parameters and form link health indicators. Based on the link health indicators and data service timeliness requirements, dynamically generate link switching criteria.
[0076] Furthermore, according to a pre-set monitoring cycle, such as the same as or an integer multiple thereof, probe triggering operations are initiated on the primary transmission link and the backup transmission link respectively. The probe triggering can use heartbeat messages, handshake request messages, or time-stamped probe data packets in existing communication mechanisms. By sending probe information to the link peer and receiving the return response, corresponding link interaction records are formed. During the probe process, each sending and receiving behavior is recorded, including the sending time, the response return time, and the interaction status. The records are organized into single link interaction record entries. Subsequently, according to the link type to which the interaction record belongs, the record generated by the primary transmission link is assigned a primary link identifier, and the record generated by the backup transmission link is assigned a backup link identifier. Combined with the unified time base provided by the time synchronization module, a corresponding collection time stamp is written for each link interaction record, resulting in a set of link interaction records with link identifiers and time information.
[0077] Furthermore, the obtained link interaction record set is subjected to time-series analysis. Specifically, firstly, the link interaction records corresponding to the primary transmission link and the backup transmission link are extracted according to the link identifier, and the link interaction records are sorted by time according to the acquisition time stamp. Then, the time interval and interaction state change between two adjacent link interaction records are used as the basis for division. When the time interval between adjacent records does not exceed the preset continuous threshold and the interaction state is consistent, they are classified into the same continuous segment. When the time interval exceeds the threshold or the interaction state changes, it is used as the starting point of a new segment, thereby dividing the link interaction records into multiple time-continuous link performance segments. After the division is completed, each link performance segment is written with a segment number according to its appearance order in the corresponding link, and the duration interval mark is determined according to the acquisition time stamp of the first and last link interaction records in the segment. At the same time, the corresponding status mark is written according to the overall status characteristics of the link interaction records in the segment (such as continuous response, intermittent response, or no response, etc.). Finally, a set of link performance segments containing segment number, duration interval mark, and status mark is formed.
[0078] Furthermore, the link performance segments generated from the primary and backup transmission links through pre-period sampling, carrying the original acquisition time stamps and the unique identifiers of the corresponding links, are used as input processing objects. The implementable link performance segments are the smallest data units obtained by sampling at a fixed sampling period, containing five core performance parameters: one-way transmission delay, end-to-end packet loss rate, available bandwidth, bit error rate, and channel signal strength. The primary transmission link uses a fixed sampling period of 100ms, and the backup transmission link uses a fixed sampling period of 500ms. All original acquisition time stamps are generated based on BeiDou-3 satellite timing with an accuracy of 1 millisecond. First, the performance segments from the primary and backup transmission links are extracted separately. The original acquisition timestamps corresponding to the full link performance segments of the transmission link are obtained by using the clock synchronization calibration algorithm of the existing IEEE 1588PTP precision time protocol. The BeiDou time service system in UTC+8 time zone is used as the unified time reference to eliminate the inherent clock offset and transmission path delay deviation between the main and backup link acquisition terminals, which is no more than 10ms. Linear mapping and rounding processing is performed on all original acquisition timestamps to generate 64-bit unsigned integer format rounded timestamps that correspond one-to-one with each link performance segment. Then, the rounded timestamps of the main and backup links and their corresponding link performance segments are arranged in ascending order of the rounded timestamps to form the main link rounded timestamp sequence and the backup link rounded timestamp sequence.
[0079] After time-stamping is completed, based on the global start and end timestamps of the two sets of time-stamped sequences, continuous non-overlapping time intervals are divided according to a preset fixed window length of 1 second, forming multiple consecutive time windows with no time gaps. Each time window corresponds to a unique window start timetamp, window end timetamp, and 8-byte window identifier. The window identifier is generated by combining the window start timetamp and window sequence number. Then, the time-stamped sequences of the primary and backup links are traversed, and all link performance segments whose time-stamped sequences fall within the left-closed and right-open interval of [window start timetamp, window end timetamp) are assigned to the window segment set of the corresponding window of the primary transmission link and the window segment set of the corresponding window of the backup transmission link, respectively. The link performance segments in each window segment set are pre-sorted in ascending order of the time-stamped sequence.
[0080] After completing the collection of segments for the entire time window, within each independent time window, the existing time series nearest neighbor pairing algorithm is used. Based on the order of the time scale adjustment, a segment-by-segment one-to-one pairing is performed between the window segment set of the primary transmission link and the window segment set of the backup transmission link. Specifically, based on the link performance segments in the primary link window segment set arranged in ascending order, each primary link performance segment is traversed sequentially. In the backup link window segment set within the same window, the segment with the smallest absolute value of the difference between its adjusted time scale and the adjusted time scale of the primary segment, and whose difference does not exceed 50ms, is found. For backup link performance segments with a set pairing threshold, pairing of single segment combinations is completed. The pairing threshold is set at 1 / 20 of the preset window length to ensure the timing consistency of paired segments. In scenarios where the number of segments in the primary and backup link window segment sets is inconsistent within the same time window, after completing the pairing of matchable segments, the pairing operation within the same window is immediately stopped, and all segment combinations that have completed pairing are retained. At the same time, all link performance segments that have not completed pairing within the window, along with their settling timestamp, link identifier, and window identifier, are written into the cross-window pairing sequence in ascending order of settling timestamp.
[0081] Finally, for unpaired segments within the sequence, in ascending order of the adjusted time scale, the corresponding link performance segments with an adjusted time scale difference not exceeding 1.5 times the preset window length and meeting the pairing threshold requirements are searched for in adjacent subsequent time windows of the same type of unpaired segments and completed for supplementary pairing. The paired segment combinations are synchronously associated with their original window identifiers. Then, the paired segment combinations within each time window, together with the paired segment combinations corresponding to that window, are organized into the link comparison segment group corresponding to that window. At the same time, a unique window identifier is written for each link comparison segment group, and a unique pairing order identifier in 16-bit unsigned integer format is assigned to each paired segment combination within the group according to the order of the adjusted time scale. Finally, a link comparison segment group sequence is formed with full time-series continuity, one-to-one correspondence between primary and backup link performance segments, and complete time alignment. Each link comparison segment group can be uniquely traced through the window identifier and the pairing order identifier.
[0082] Furthermore, the input object is a group of link comparison segments that are generated, are sequentially continuous, and carry unique window identifiers, pairing order identifiers, and unique identifiers for primary and backup links. Each pairing segment combination within each link comparison segment group contains a link performance segment corresponding to the primary and backup transmission links. Each link performance segment carries a 1-byte predefined segment status flag, a settling time stamp, a pairing order identifier, and core performance parameters. The segment status flag uses a fixed enumeration encoding: 0x00 indicates a normal valid segment, 0x01 indicates a parameter exceeding the limit abnormal segment, 0x02 indicates a timing missing segment, and 0x03 indicates a verification failure invalid segment. The core performance parameters include one-way transmission delay, end-to-end... Five evaluation indicators for water conservancy transmission scenarios—packet loss rate, available bandwidth, bit error rate, and channel signal strength—are used. First, all link comparison segments are traversed. Based on the link identifier field, each pairing segment combination is split and extracted. All link performance segments belonging to the main transmission link are completely extracted and sorted in ascending order by window identifier and then by pairing order identifier within the same window to form the main link segment set. Simultaneously, all link performance segments belonging to the backup transmission links are completely extracted and sorted using the same sorting rules as the main links to form the backup link segment set. Each link performance segment in both sets retains complete window identifier, pairing order identifier, segment status marker, settling time stamp, and core performance parameters.
[0083] After constructing the primary and backup link segment sets, window merging and status tag group generation operations are performed on both sets. Specifically, using an 8-byte window identifier as the unique aggregation key, an existing unencrypted hash aggregation algorithm is used to merge all link performance segments corresponding to the same window identifier into the same window group. The link performance segments within each window group are strictly arranged in ascending order according to the pairing order identifier, and this arrangement order is completely consistent with the order of the reorganization timestamps. Then, for each window group, the segment status tags of each link performance segment are read sequentially according to the segment arrangement order. The enumeration codes are sequentially combined into a 1-byte binary array matching the number of segments to generate the link status tag group corresponding to the window. Each link status tag group is synchronously bound to the window identifier, the window start reorganization timestamp, and the window end reorganization timestamp of the corresponding window. After all windows of the primary and backup links have completed the above operations, a complete set of primary link status tag groups and a complete set of backup link status tag groups corresponding to each window are generated.
[0084] After generating the link status tag groups, based on the link status tag groups corresponding to each window and the core parameters of the link performance segments within the corresponding window group, the link health indicators for each window of the primary transmission link and backup transmission link are calculated. Specifically, for a single link window group within a single window, invalid segments with a segment status tag of 0x03 that failed verification are first removed. The arithmetic mean of the five types of core performance parameters for the remaining valid segments is calculated to obtain the window average performance parameter set for that link within that window. Then, a threshold range predefined for the water conservancy industry transmission scenario is used to... The existing min-max normalization algorithm is used to unify the dimensions of each parameter. For negative indicators such as one-way transmission delay, end-to-end packet loss rate, and bit error rate (which indicate better link performance with smaller values), reverse min-max normalization is used. For positive indicators such as available bandwidth and channel signal strength (which indicate better link performance with larger values), forward min-max normalization is used. Then, weighted coefficients, pre-calculated using the existing entropy weight method and adapted to the water conservancy engineering data transmission scenario, are used to weight and sum the normalized parameters to obtain a value in the range of 0-100. The basic health score is weighted by the following coefficients in descending order of importance: end-to-end packet loss rate 0.35, one-way transmission delay 0.25, available bandwidth 0.2, bit error rate 0.1, and channel signal strength 0.1. A penalty coefficient is then calculated based on the link state tag group corresponding to the window. The penalty coefficient is 1.0 when the window contains 100% valid segments and no abnormal segments; 0.8 when the abnormal segment percentage is less than 20%; 0.6 when the abnormal segment percentage exceeds 20% or the missing segment percentage exceeds 10%; and 0.5 when the entire window contains no valid segments. 0. Multiply the basic health score by the penalty coefficient to obtain the final link health index of the link corresponding to the window. After the full window calculation is completed, the link health indices of all windows of the main transmission link are arranged in ascending order of time according to the window identifier to form the main link health index sequence. At the same time, the link health indices of all windows of the backup transmission link are arranged according to the same rules to form the backup link health index sequence. Each link health index in the two sequences is bound to the window identifier, link status flag group and window average performance parameter set of the corresponding window.
[0085] Furthermore, during the min-max normalization process, the upper and lower bounds of each link performance parameter are obtained through statistical analysis of historical link operation data. The upper bound corresponds to the optimal reference value of the link performance, and the lower bound corresponds to the lowest acceptable threshold of the link performance. In practical applications, the stable range of each parameter can be determined by statistical analysis of the link performance data collected over a period of time, and this range can be used as the basis for normalization.
[0086] Finally, the sequence association identifier writing operation is completed. For the main link health indicator sequence and the backup link health indicator sequence, each link health indicator in the sequence is bound to the corresponding window identifier at the field level and written into the window identifier field with a fixed offset in the indicator data structure. This ensures that each health indicator can be uniquely traced to the corresponding link comparison segment group and link performance segment through the window identifier. At the same time, the global start and global end time stamps covered by the two health indicator sequences are determined respectively, and a 64-bit unsigned integer time association identifier is generated. The high 32 bits of this identifier are written into the global start time stamp and the low 32 bits are written into the global end time stamp. The time association identifier is written into the fixed field of the sequence header of the corresponding health indicator sequence. At the same time, a corresponding single-window time association sub-identifier is written for each link health indicator in the sequence. This sub-identifier is composed of the start and end time stamps of the corresponding window. Finally, the main link health indicator sequence and the backup link health indicator sequence carrying the complete window identifier association relationship, the global time association identifier, and the single-window time association sub-identifier are generated.
[0087] Furthermore, firstly, the global time association identifiers of the primary transmission link health indicator sequence and the backup transmission link health indicator sequence are parsed, and the global start and global end time scales covered by the sequence are extracted. Simultaneously, the single-window time association sub-identifier corresponding to each link health indicator within the sequence is parsed to lock the precise left-closed, right-open time interval corresponding to each link health indicator. Then, using an existing time interval matching algorithm, the entire set of water conservancy project data is traversed, and the collection time scale corresponding to each piece of water conservancy project data is extracted. Water conservancy project data whose collection time scale falls into the corresponding time interval are associated with the corresponding time periods in the primary transmission link health indicator sequence and the backup transmission link health indicator sequence, respectively. The health indicators are used to form multiple data time period association groups. Each data time period association group contains a unique start and end time stamp of the association period, a subset of the main link health indicators within the period, a subset of the backup link health indicators, and a subset of the total water conservancy project data within the period. At the same time, priority identifiers are written to the data time period association groups based on the timeliness mark of the water conservancy project data. Among them, the association group corresponding to emergency alarm type project data with a timeliness mark of 0 is marked as high priority, the association group corresponding to real-time monitoring type project data with a timeliness mark of 1 is marked as medium priority, and the association group corresponding to non-real-time type project data with a timeliness mark of 2 is marked as low priority.
[0088] After completing the construction of the data time period association group, based on the association time period boundary of the data time period association group, the health index sequence of the main transmission link and the health index sequence of the backup transmission link are divided into continuous segments without overlap or gap. Specifically, taking the association time period corresponding to the data time period association group as the unique division unit, the health indexes of the main transmission link within the same association time period are merged into a single main link segment index group, and the health indexes of the backup transmission link within the same association time period are merged into a single backup link segment index group. Each segment index group is synchronously bound to the water conservancy project data subset and priority identifier within the corresponding data time period association group. Then, according to the ascending order of the starting time scale of all association time periods, a unique 32-bit unsigned integer segment order identifier is assigned to each continuously divided segment to ensure that the incrementing order of the segment order identifier is completely consistent with the time flow order. At the same time, the time sequence verification of adjacent segments is completed to ensure that the end time scale of the adjacent segment is completely coincident with the start time scale of the next segment, without time overlap or time gap.
[0089] After completing the segment division and order identifier writing, the system sequentially traverses all segment indicator groups of the primary and backup transmission links according to the ascending order of the segment order identifiers. First, it uses the existing least squares linear fitting algorithm to calculate the segment statistical characteristics of the link health indicators within each segment indicator group, including the arithmetic mean, maximum, minimum, trend slope, and standard deviation of the segment health indicators. Then, it extracts the indicator change characteristics between the previous and current segments for both the primary and backup transmission links. The characteristics define and distinguish three types of change relationships: Among them, the continuation relationship is that the signs of the health trend slopes of adjacent segments are consistent, the absolute value of the slope difference does not exceed the preset 10% trend continuation threshold, and the absolute value of the segment volatility difference does not exceed 5%, indicating that the link health change trend remains stable and continuous; the reversal relationship is that the signs of the health trend slopes of adjacent segments reverse, and the absolute value of the slope difference exceeds the 20% trend change threshold, or the average health value of the segment increases or decreases by more than 20% compared with the previous segment, indicating that the link health trend has undergone a fundamental reversal, either positive or negative.
[0090] Furthermore, the trend slope is obtained by linearly fitting multiple consecutive link health index points within the segment using the least squares method. The independent variable of the fitting is the time series index or the normalized time scale, and the dependent variable is the corresponding link health index value. The volatility is characterized by the standard deviation of the link health index within the segment, which is used to reflect the stability of the link status.
[0091] Preferably, each segment contains link health index data for at least N consecutive time windows, where N is an integer greater than or equal to 5 to ensure the stability of statistical features; when the segment length is less than the preset minimum number of windows, it is supplemented by merging with adjacent segments or extending the window range.
[0092] The alternation relationship is that the health trend slopes of the primary transmission link segment indicator group and the backup transmission link segment indicator group corresponding to the same segment sequence identifier are opposite, or the average health values of the primary and backup links are reversed in order of high and low, indicating that the health status of the primary and backup links is relatively alternating. The alternation relationship of adjacent segments of the primary transmission link, the alternation relationship of adjacent segments of the backup transmission link, and the alternation relationship of the same segment of the primary and backup links corresponding to each associated time period are combined to form a segment change relationship set corresponding to the associated time period. After the full segment traversal is completed, a complete set of segment change relationship sets covering the entire time series is generated.
[0093] Finally, based on the complete set of segment change relationships, combined with the priority identifier of the corresponding segment and the data type of water conservancy engineering information, the cut-out decision segment of the main transmission link and the access decision segment of the backup transmission link are determined respectively. Specifically, when the segment change relationship set of the corresponding segment of the main transmission link shows two consecutive negative transition relationships, and the average health of the current segment is lower than the preset cut-out threshold of the corresponding priority (the cut-out threshold for high priority association group is 70, for medium priority is 60, and for low priority is 40), or when the main transmission link shows three consecutive negative continuation relationships, the cumulative decrease in health exceeds 30%, and the segment volatility exceeds the instability threshold of 15%, the current segment is marked as the cut-out decision segment of the main transmission link. At the same time, for backup transmission links with the same segment order identifier and the same association time period as the cut-out decision segment, the cut-out decision segment is marked as the cut-out decision segment of the main transmission link. For a transmission link segment, when the segment change relationship of the segment shows a positive continuation relationship between two consecutive segments, the average health of the segment is higher than the access threshold preset for the corresponding priority (where the access threshold for high priority association group is 85, for medium priority is 75, and for low priority is 60), and the segment volatility is lower than the stability threshold of 8%, the segment is marked as the access judgment segment for the backup transmission link. Finally, the handover triggering conditions, health thresholds, trend judgment rules, and priority constraints of the corresponding water conservancy project data corresponding to the handover judgment segment are combined with the access triggering conditions, health thresholds, stability judgment rules, time sequence matching requirements of the same segment, and the continuous three-window secondary verification rules for preventing accidental handover to generate a link switching criterion that fully matches the timeliness requirements and transmission needs of the current water conservancy project data.
[0094] It should be noted that the specific values of the data were set by those skilled in the art based on experimental or actual water conservancy data.
[0095] Step S3: When the main transmission link meets the link switching criteria, the transmission of the current work status data frames in the current transmission queue is not interrupted. Instead, the frames are synchronously transmitted on the backup transmission link. When the takeover conditions are met, the system switches to the backup transmission link to transmit the work status data frames.
[0096] Furthermore, the system reads the current pending and transmitted work status data frames in real time by periodically polling the transmission queue or by triggering events, and determines the corresponding transmission period based on the sequence marker and acquisition time stamp carried in each work status data frame. Subsequently, the transmission period is matched one by one with each judgment segment in the link switching criterion, wherein the link switching criterion can be pre-identified according to time segment or sequence segment. When it is detected that the current transmission period enters the handover judgment segment of the main transmission link, the work status data frames in the transmission queue that have not yet been transmitted are identified, specifically including the pending frames that have not yet been read by the main transmission link and the in-transit frames that have entered the transmission process but have not yet received complete acknowledgment feedback. The frames are then filtered and sorted according to their sequence markers, and the work status data frames that meet the conditions are extracted and combined into a continuous frame set. At the same time, the corresponding start sequence marker and end sequence marker are attached to the frame set to form a frame group to be taken over for link takeover processing.
[0097] Furthermore, after forming the frame group to be taken over, the read pointer and transmission order of the current transmission queue of the main transmission link are maintained unchanged, so that the transmission process of the frame group to be taken over on the main transmission link continues to proceed in the original order. At the same time, the frame group to be taken over is traversed sequentially according to its order mark in the transmission queue, and its corresponding data content and additional mark information are copied frame by frame to generate a mirror transmission sequence consistent with the original transmission order. The original order mark, associated segment identifier and link mapping field are retained for each data frame in the mirror transmission sequence. Subsequently, a waiting segment corresponding to the main transmission queue is established on the backup transmission link side. The mirror transmission sequence is written into the waiting segment according to the order mark, and the starting order position and length information of the segment are recorded. This allows the backup transmission link to send the mirror transmission sequence in the same order as the main transmission link in the subsequent scheduling process, so as to obtain the backup link waiting data sequence corresponding to the main link transmission process.
[0098] Furthermore, after completing the mirror transmission sequence construction in step S302, by maintaining the original transmission scheduling mechanism of the main transmission link, the main transmission link transmits the work status data frames frame by frame according to the order markers in the transmission queue. At the same time, an independent transmission scheduling process is enabled on the backup transmission link side, and the corresponding work status data frames are transmitted frame by frame according to the order markers in the mirror transmission sequence, thereby forming parallel transmission of the main and backup links in the same order dimension. During the transmission process, the transmission behavior of each work status data frame on the main transmission link and the backup transmission link is recorded separately. When a data frame is read and sent by the link transmission scheduling module, a corresponding transmission carry identifier is written to indicate that the data frame at that order position has entered the transmission process. At the same time, through the confirmation information or link response signal returned by the receiving end, an arrival feedback identifier is written to the transmitted data frame to indicate the reception status of the data frame on the corresponding link. The above transmission carry identifier and arrival feedback identifier are both recorded in association according to the order markers, forming a dual-link transmission status record of the main transmission link and the backup transmission link for work status data frames at the same order position.
[0099] It should be noted that the arrival feedback identifier is generated based on the acknowledgment response returned by the receiving end. The acknowledgment response is implemented using an acknowledgment reply message or an acknowledgment mechanism based on the transmission protocol.
[0100] Furthermore, after forming the dual-link transmission status record of the main transmission link and the backup transmission link, the transmission carry identifier and the arrival feedback identifier are first matched according to the sequence mark. The range of the work status data frames that have been transmitted and received feedback in the backup transmission link is compared frame by frame to determine the covered interval of the frame group to be taken over by the backup transmission link, and this interval is mapped to the access progress. Then, the access progress is compared with the access determination segment in the link switching criterion. When it is determined that the backup transmission link is currently in the access determination segment, it is further determined whether its covered sequence position has reached the transmission continuation position of the main transmission link in the current transmission queue, that is, the backup transmission link has completed the transmission and confirmation of the continuous segment in the frame group to be taken over. After the above conditions are met, the writing of new work status data frames into the transmission buffer corresponding to the main transmission link is stopped. At the same time, the subsequent work status data frames that have not yet entered the transmission process in the transmission queue are migrated to the waiting segment corresponding to the backup transmission link according to their sequence mark, and the backup transmission link continues to transmit in the original order, thereby completing the switching of the transmission path and obtaining the subsequent data transmission sequence executed by the backup transmission link.
[0101] like Figure 2As shown, the dual-link synchronous transmission and automatic switching process revolves around the coordinated operation of the transmission queue, the primary transmission link, and the backup transmission link. First, in the queue reading and judgment phase, the transmission queue is scanned in real time to identify the current data frames in the transmission process. Based on the link switching criteria, it is determined whether the primary transmission link has entered the handover judgment phase. When the conditions are met, in the waiting-to-be-taken-frames extraction phase, consecutive data frames that have not yet been transmitted are extracted from the transmission queue and formed into a waiting-to-be-taken-frames group according to their sequence markers. Subsequently, in the mirror sequence generation and writing to the backup link phase, while maintaining the original transmission order of the primary transmission link, the waiting-to-be-taken-frames group is copied in the same order to generate a mirror transmission sequence, which is then written to the waiting-to-be-transmitted segment of the backup transmission link. After entering the dual-link synchronous transmission phase, the primary transmission link continues to transmit the original queue data frames, while the backup transmission link transmits the corresponding data frames in the mirror sequence in parallel. Simultaneously, the carry flag and arrival feedback flag are recorded for each sequence position data frame, forming a status record table to describe the transmission and reception status of the two links at the same sequence position. Finally, during the access determination and handover phase, the access progress of the frame group to be taken over is calculated based on the arrival feedback of the backup transmission link. When the progress reaches the continuation position of the transmission queue and meets the access determination conditions, the subsequent data writing to the main transmission link is stopped, and the subsequent data to be sent is switched to the backup transmission link to continue sending, thereby completing the smooth transition from the main link to the backup link.
[0102] It should be noted that ① indicates that the main link has entered the handover decision segment and the frame group to be taken over is extracted; ② indicates that the main link order is maintained, a mirror sequence is generated, and written to the backup link segment; ③ indicates that the two links are sent synchronously; ④ indicates that the backup link access progress is calculated and it is determined whether the connection position has been reached; ⑤ indicates that the main link writing is stopped and the backup link continues to send. The formula for calculating the access progress is: Access progress = Number of confirmed same-order frames / Total number of frames in the frame group to be taken over × 100%. The number of confirmed same-order frames refers to the number of work status data frames that have been sent on the backup transmission link and returned confirmation feedback from the receiving end. The access decision segment and the backup link segment are different colors. The green segment in the access decision segment contains the text of the backup link access decision segment, and the other green parts are backup link frames.
[0103] Example 2
[0104] Please see Figure 3 Another embodiment of the present invention provides: a dual-link automatic switching and transmission system for water conservancy engineering data, comprising: a data processing module, a switching criterion generation module, and a switching transmission module;
[0105] The data processing module is used to collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate project data frames, and write them into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks.
[0106] The switching criterion generation module is used to monitor the primary transmission link and the backup transmission link in real time, obtain link performance parameters and form a link health index, and dynamically generate a link switching criterion based on the link health index and the timeliness requirements of data services.
[0107] The switching transmission module is used to transmit the current work status data frames in the current transmission queue without interrupting the transmission of the main transmission link when the link switching criteria are met, and to transmit them synchronously on the backup transmission link. When the takeover conditions are met, the module switches to the backup transmission link to transmit the work status data frames.
[0108] The switching criterion generation module includes: a performance acquisition unit, a health indicator generation unit, and a switching criterion generation unit;
[0109] The performance acquisition unit divides the link interaction record based on time continuity, generates link performance segments, and writes a segment number, a duration interval marker, and a status marker to each link performance segment to form a set of link performance segments.
[0110] The health indicator generation unit generates link health indicator sequences for the main transmission link and the backup transmission link, respectively, based on the link comparison segment group.
[0111] The switching criterion generation unit is used to associate the link health index sequence with water conservancy project data, divide the link health index sequence into segments according to the time association identifier, and generate link switching criteria based on the index change relationship of each segment.
[0112] In addition, the parts of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of the corresponding technical solutions in the prior art have not been described in detail, so as to avoid excessive elaboration.
[0113] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the invention. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for automatic switching and transmission of hydraulic engineering data via dual links, characterized in that, include: Collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate project data frames, and write them into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks. The primary and backup transmission links are monitored in real time to obtain link performance parameters and form link health indicators. Based on the link health indicators and data service timeliness requirements, link switching criteria are dynamically generated. When the main transmission link meets the link switching criteria, the transmission of the current engineering data frames in the transmission queue is not interrupted. Instead, they are transmitted synchronously on the backup transmission link. When the takeover conditions are met, the system switches to the backup transmission link to transmit engineering data frames.
2. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 1, characterized in that, The process of collecting water conservancy project data, establishing a primary transmission link and a backup transmission link, atomically encapsulating the water conservancy project data to generate project data frames, and writing them into a transmission queue includes: Collect water conservancy project data and assign a corresponding data source identifier and collection time stamp to each piece of water conservancy project data; The collected water conservancy engineering data is split into multiple indivisible atomic data units; According to the data source identifier, collection time stamp and service priority, the atomic data units are sequenced, and a sequence mark, category mark and time mark are written to each atomic data unit in sequence. Affixed association segment identifiers are added to atomic data units that are related to each other to form a candidate transmission sequence. Establish a set of link identifiers for the primary transmission link and the backup transmission link, write each atomic data unit in the candidate transmission sequence into the corresponding link mapping field, and encapsulate it into a work status data frame; The construction data frame is written into the transmission queue according to the timeliness mark and associated segment identifier of the construction data frame.
3. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 2, characterized in that, The process of establishing a set of link identifiers for the primary and backup transmission links, writing each atomic data unit in the candidate transmission sequence into its corresponding link mapping field, and encapsulating it into a work status data frame includes: Assign link identifiers to the primary transmission link and the backup transmission link respectively, and generate a set of link identifiers containing the primary link identifier and the backup link identifier; Based on the category label, time stamp label, and associated segment identifier of the atomic data unit, determine its link affiliation and write each atomic data unit into the corresponding link mapping field; The sequence marker, category marker, time stamp marker, associated segment identifier, link mapping field, and data content are combined and arranged to form a frame data sequence to be encapsulated; The frame data sequence is encapsulated according to a preset field arrangement order, and fields with the same associated segment identifier are combined to generate a work situation data frame, thus obtaining a work situation data frame sequence.
4. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 1, characterized in that, The process of real-time monitoring of the primary and backup transmission links, acquiring link performance parameters and forming link health indicators, and dynamically generating link switching criteria based on the link health indicators and data service timeliness requirements, includes: According to the preset monitoring cycle, the main transmission link and the backup transmission link are detected and triggered respectively, the link interaction records are obtained, and the link identifier and collection time stamp are assigned; The link interaction records are divided based on time continuity to generate link performance segments. Each link performance segment is then written with a segment number, a duration interval marker, and a status marker to form a set of link performance segments. Based on the acquisition time stamp, the link performance segments within the corresponding time intervals of the main transmission link and the backup transmission link are aligned to construct a link comparison segment group under the same time window; Based on the link comparison segment group, the link health index sequence corresponding to the main transmission link and the backup transmission link is generated respectively, and a time association identifier is written for each link health index sequence. The link health index sequence is associated with water conservancy project data. The link health index sequence is divided into segments according to the time association identifier. Link switching criteria are generated based on the index change relationship of each segment. The link switching criteria include link cut-out conditions and link access conditions.
5. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 4, characterized in that, Based on the acquisition time stamp, the link performance segments within the corresponding time intervals of the primary and backup transmission links are aligned to construct a link comparison segment group under the same time window, including: The acquisition time stamps corresponding to each link performance segment of the main transmission link and the backup transmission link are extracted respectively, and the acquisition time stamps are rectified according to a unified time series reference to generate a rectified time stamp sequence that corresponds one-to-one with each link performance segment. Based on the adjusted time stamp sequence, the link performance segments of the main transmission link and the backup transmission link are divided into time intervals according to a preset window length to form multiple time windows that are connected end to end. Within each time window, the window segment set of the primary transmission link and the window segment set of the backup transmission link are paired segment by segment according to the order of the time scale. For link performance segments with inconsistent numbers within the same time window, the segment combination that has been paired first is retained, and the unpaired segments are written into the cross-window pairing sequence. The segments that are paired within each time window and the segments that are added to the paired sequences across the window are combined into a link comparison segment group.
6. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 5, characterized in that, Based on the link comparison segment group, link health index sequences corresponding to the primary transmission link and the backup transmission link are generated respectively, and time-related identifiers are written for each link health index sequence, including: The link performance segments belonging to the main transmission link in each link comparison segment group are extracted to form the main link segment set, and the link performance segments belonging to the backup transmission link are extracted to form the backup link segment set. The primary link segment set and the backup link segment set are merged according to the window identifier, and the corresponding link status label group is generated according to the order of each link performance segment in the corresponding window and the segment status label. Based on the link status tag group corresponding to each window, the main link health index of the main transmission link and the backup link health index of the backup transmission link are generated respectively, and arranged in order according to the window identifiers to form the main link health index sequence and the backup link health index sequence. The generated primary link health indicator sequence and backup link health indicator sequence are associated with their corresponding window identifiers and written to the system. Time association identifiers are also written to each link health indicator sequence according to the time scale range.
7. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 6, characterized in that, The link health index sequence is correlated with water conservancy engineering data. The link health index sequence is divided into segments according to time association identifiers, and link switching criteria are generated based on the index change relationships of each segment, including: Based on time-related identifiers, water conservancy project data are associated with corresponding time periods in the main transmission link health index sequence and the backup transmission link health index sequence, forming data time period association groups; Based on the data time period association group, the health index sequence of the main transmission link and the health index sequence of the backup transmission link are divided into continuous segments. The health indexes of the links in the same associated time period are merged into the same segment index group, and a segment order identifier is written for each segment index group. According to the segment sequence identifier, extract the continuity, transition and alternation relationships of each segment index group of the main transmission link and the backup transmission link between adjacent segments to form a segment change relationship set; Based on the segment change relationship set, the cut-out decision segment of the main transmission link and the access decision segment of the backup transmission link are determined, and the cut-out decision segment and the access decision segment are combined to generate the link switching criteria corresponding to the current water conservancy project data.
8. The method for automatic switching and transmission of hydraulic engineering data via dual links as described in claim 1, characterized in that, When the primary transmission link meets the link switching criteria, the transmission of the current engineering data frames in the transmission queue is not interrupted. Instead, they are synchronously transmitted on the backup transmission link. When the takeover conditions are met, the system switches to the backup transmission link to transmit the engineering data frames. This includes: The system reads the current transmission queue of work status data frames in real time and matches the transmission time period corresponding to the work status data frames with the link switching criteria. When it is determined that the main transmission link enters the handover judgment segment, the system extracts the work status data frames that have not yet been transmitted in the current transmission queue and forms a frame group to be taken over. The original transmission order of the frame group to be taken over is kept unchanged on the main transmission link. At the same time, a corresponding mirror transmission sequence is generated according to the arrangement order of the frame group to be taken over in the current transmission queue, and the mirror transmission sequence is written into the waiting segment corresponding to the backup transmission link. The main transmission link is controlled to continue sending the current work status data frames in the sending queue, and the backup transmission link is controlled to synchronously send the corresponding work status data frames according to the mirrored sending sequence. During the synchronous sending process, the carry flag and arrival feedback flag of the work status data frames in the same sequence position of the main transmission link and the backup transmission link are recorded respectively. Based on the transmission carry flag and arrival feedback flag, the access progress of the backup transmission link to the frame group to be taken over is determined. When the backup transmission link enters the access determination segment and its access progress corresponds to the continuation position of the current transmission queue, the writing of subsequent work status data frames to the main transmission link is stopped, and the subsequent work status data frames to be sent are transferred to the backup transmission link to continue sending.
9. A dual-link automatic switching and transmission system for hydraulic engineering data, used to implement the dual-link automatic switching and transmission method for hydraulic engineering data as described in any one of claims 1-8, characterized in that, include: Data processing module, switching criterion generation module, and switching transmission module; The data processing module is used to collect water conservancy project data, establish a main transmission link and a backup transmission link, atomically encapsulate the water conservancy project data, generate project data frames, and write them into the transmission queue. The water conservancy project data includes water level, rainfall, flow rate, gate status, video screenshots, and alarm events. The two links are heterogeneous networks. The switching criterion generation module is used to monitor the primary transmission link and the backup transmission link in real time, obtain link performance parameters and form a link health index, and dynamically generate a link switching criterion based on the link health index and the timeliness requirements of data services. The switching transmission module is used to transmit the current work status data frames in the current transmission queue without interrupting the transmission of the main transmission link when the link switching criteria are met, and to transmit them synchronously on the backup transmission link. When the takeover conditions are met, the module switches to the backup transmission link to transmit the work status data frames.
10. The automatic switching and transmission system for dual-link hydraulic engineering data as described in claim 9, characterized in that, The switching criterion generation module includes: a performance acquisition unit, a health indicator generation unit, and a switching criterion generation unit; The performance acquisition unit divides the link interaction record based on time continuity, generates link performance segments, and writes a segment number, a duration interval marker, and a status marker to each link performance segment to form a set of link performance segments. The health indicator generation unit generates link health indicator sequences for the main transmission link and the backup transmission link, respectively, based on the link comparison segment group. The switching criterion generation unit is used to associate the link health index sequence with water conservancy project data, divide the link health index sequence into segments according to the time association identifier, and generate link switching criteria based on the index change relationship of each segment.