A power distribution network digital twin data transmission method and system
By using state latching and interval numbering mechanisms at the edge gateway, the problem of data discontinuity caused by link interruption and data packet loss in the digital twin data transmission of the distribution network is solved, realizing the integrity and reliability of the data sequence and ensuring the stable operation of the digital twin model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LIXINGKAI (BEIJING) ENERGY SYST TECH CO LTD
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-26
AI Technical Summary
The data transmission of digital twins in existing distribution networks is susceptible to link interruptions and network fluctuations, resulting in data packet loss or interruption. It is difficult to maintain the structural integrity and time-series traceability of data sequences, and there is a lack of effective mechanisms for identifying and handling abnormal sections.
A state latch + interval number + sequence identifier reconstruction mechanism is introduced on the edge gateway side. By inserting the running state latch flag and outputting the most recent valid state, combined with the frame-by-frame progressive writing of the loop counter register area and the sequence identifier field, the ordered identification and precise positioning of the data sequence are realized, ensuring the integrity and reliability of the data sequence.
In scenarios of link interruption or data packet loss, it maintains the structural integrity and temporal traceability of the data sequence, avoids the state break of the digital twin model, improves the reliability of data reconstruction and system stability, and achieves seamless connection between abnormal segments and real-time data.
Smart Images

Figure CN122293733A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data transmission technology, and in particular to a method and system for digital twin data transmission in power distribution networks. Background Technology
[0002] As a crucial component of the power system, the distribution network is becoming increasingly complex in its operation due to the widespread integration of distributed power sources, energy storage devices, and load terminals. Digital twin technology is gradually being used to achieve real-time mapping and dynamic analysis of the distribution network. However, digital twin models rely heavily on the continuity and consistency of underlying data transmission, and existing data transmission methods still have shortcomings in practical applications.
[0003] In existing technologies, the operational data acquired by the acquisition terminal is uploaded to the main station server via the communication network. However, during the transmission process, it is easily affected by factors such as link interruption and network fluctuations, resulting in data packet loss or interruption, which causes the digital twin model to have discontinuous state. At the same time, there is a lack of effective identification and processing mechanisms for abnormal transmission segments, making it difficult for the receiving end to accurately identify abnormal segments and reconstruct continuous state. Summary of the Invention
[0004] Therefore, it is necessary to provide a digital twin data transmission method and system for power distribution networks to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above objectives, a digital twin data transmission method for a distribution network is provided. The distribution network includes distributed power sources, energy storage devices, and load terminals. The distributed power sources, energy storage devices, and load terminals are electrically connected to a data acquisition terminal. The data acquisition terminal is connected to an edge gateway via a communication interface. The edge gateway is connected to a master server via a communication network. The method includes the following steps: Step S1: Set up data acquisition terminals on each physical device side of the distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; Step S2: The edge gateway performs time alignment, reduction conversion, and anomaly removal on the data to form a data stream with a unified format; Step S3: Based on the distribution network topology, perform node binding and path marking on the data flow to generate a data sequence corresponding to the digital twin model; Step S4: When a link interruption or data packet loss is detected, insert a running status latch mark into the corresponding node data frame on the edge gateway side, output the most recent valid status, and number the latch interval. Step S5: Divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; Step S6: The master station server parses the received data, identifies the state latch mark, performs state continuation processing on the corresponding segment, and updates it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.
[0006] This invention provides a distribution network digital twin data transmission system for executing the distribution network digital twin data transmission method described above. The distribution network digital twin data transmission system includes: The data acquisition module is used to set up acquisition terminals on the side of each physical device in the power distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; The data preprocessing module is used by the edge gateway to perform time alignment, reduction transformation and anomaly removal on the data to form a data stream in a unified format; The topology mapping module is used to bind nodes and mark paths for data streams based on the distribution network topology, generating data sequences that correspond to the digital twin model. The status latch module is used to insert a running status latch mark into the corresponding node data frame on the edge gateway side when a link interruption or data packet loss is detected, and output the most recent valid status and number the latch interval. The packet sending module is used to divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; The synchronization processing module is used by the master station server to parse the received data, perform state continuation processing on the corresponding segment after identifying the state latch mark, and update it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.
[0007] The beneficial effects of this invention lie in the introduction of a collaborative mechanism of "state latching + section numbering + sequence identifier reconstruction" at the edge gateway side, enabling the distribution network to maintain the structural integrity and temporal traceability of the data sequence even in scenarios of link interruption or data packet loss. Specifically, by inserting operating state latching markers into abnormal sections and continuously outputting latched data frames, the problem of state breakage in the digital twin model due to data loss in traditional solutions is avoided. Furthermore, by combining the cyclic counting register area and the frame-by-frame progressive writing of the sequence identifier field, ordered identification and precise positioning of data within the latched section are achieved. Finally, through the combined encoding of section boundary identifiers and count values, and the final frame solidification... The mechanism ensures that the latched interval has complete closure characteristics, thereby guaranteeing that the receiving end can accurately identify the segment range and perform state continuation processing. In addition, the rollback identification mechanism constructed by the rollback trigger flag bit and cross-frame mirror bit effectively solves the order ambiguity problem in the case of count overflow, improving the reliability of data reconstruction. After the link is restored, the seamless connection between abnormal segments and real-time data is achieved by locking the position of the integrated flag segment and continuing to attach the copy of the interval end flag. Overall, it significantly improves the continuity, integrity and robustness of the digital twin data transmission of the distribution network, and enhances the system's stable operation capability and engineering application value in complex communication environments. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the steps of a digital twin data transmission method for a power distribution network. Figure 2 for Figure 1 A detailed flowchart illustrating the implementation steps of step S4. Figure 3 This is a hardware connection diagram of a digital twin data transmission method for a power distribution network according to this application; Figure 4 This is a schematic diagram illustrating the timing continuity detection of a digital twin data transmission method for a distribution network according to this application; The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0009] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0010] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0011] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0012] To achieve the above objectives, please refer to Figures 1 to 4 A method for transmitting digital twin data in a power distribution network, wherein the power distribution network includes distributed power sources, energy storage devices, and load terminals, the distributed power sources, energy storage devices, and load terminals being electrically connected to a data acquisition terminal, the data acquisition terminal being connected to an edge gateway via a communication interface, and the edge gateway being connected to a master station server via a communication network, the method comprising the following steps: Step S1: Set up data acquisition terminals on each physical device side of the distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; Step S2: The edge gateway performs time alignment, reduction conversion, and anomaly removal on the data to form a data stream with a unified format; Step S3: Based on the distribution network topology, perform node binding and path marking on the data flow to generate a data sequence corresponding to the digital twin model; Step S4: When a link interruption or data packet loss is detected, insert a running status latch mark into the corresponding node data frame on the edge gateway side, output the most recent valid status, and number the latch interval. Step S5: Divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; Step S6: The master station server parses the received data, identifies the state latch mark, performs state continuation processing on the corresponding segment, and updates it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.
[0013] In one embodiment, reference may be made to Figure 3Taking a power distribution network in an industrial park as an example, this network includes one main busbar and two branch busbars, connecting a total of eight devices. These include three photovoltaic power generation devices (D1-D3, rated power 100kW), two energy storage devices (D4 and D5, charging / discharging power ±50kW), and three load terminals (D6-D8). Each device is connected to a data acquisition terminal, which collects voltage, current, active power, and switch status at a sampling period of one second and generates timestamped data frames, such as at a certain sampling moment. The data uploaded by device D1 is as follows: voltage 380V, current 52A, active power 19.8kW, and switch status is closed. After CRC verification, the data is uploaded to the edge gateway via the Modbus protocol.
[0014] On the edge gateway side, data uploaded by each data collection terminal is processed uniformly. For example, at a given time... Data timestamps are as follows: D1 is 1000ms, D2 is 1080ms, and D3 is 950ms. Alignment is performed using a ±100ms time window, grouping all data into the same time slice. For missing data (e.g., D4 not uploaded), data from the previous time slot is used for compensation. Simultaneously, anomaly detection is performed. For example, if the power of load device D6 suddenly increases from 10kW to 50kW, exceeding its rated power of 20kW by 1.2 times, it is considered an anomaly and corrected to approximately 12kW using interpolation from adjacent time points. After processing, the data is uniformly converted to a standard structure, and nodes are bound according to topological relationships. For example, D1 and D2 are mapped to node N1, and D3 is mapped to node N2, with path markers added (e.g., N1→N2→N3), generating a data sequence consistent with the digital twin model.
[0015] When the system reaches time... During this period, if the energy storage device D4 fails to upload data for three consecutive sampling cycles, the communication link is considered interrupted. At this time, the edge gateway reads the most recent valid power value of D4 at time t1 (e.g., -20kW, indicating charging status), inserts a latch marker into subsequent data frames, continuously outputs this value, and generates a latch interval number (e.g., L20240301N4) to identify this abnormal time period. During data transmission, real-time data (e.g., D1, D2) is sent first, while data with latch markers is sent as a second-priority packet, ensuring that critical operational data arrives at the main station first.
[0016] After receiving data, the master server parses it. For example, upon receiving D4 data with a latching flag, it identifies that the data is in a latched state. Therefore, in the digital twin model, its power remains unchanged at -20kW and is marked as "latched operation." When communication resumes (e.g., ...), ... After data is re-uploaded at time D4 (-10kW), the main station server overwrites it with the new data. The data is latched during the process, and the latch markers are cleared, thereby restoring the digital twin model to its real operating state.
[0017] As an example of the present invention, reference is made to Figure 2 As shown, step S4 in this example includes: Step S41: Perform time sequence continuity detection on the data frames of each node in the edge gateway. When the interval between adjacent data frames exceeds a preset threshold, it is determined that the link is interrupted or the data is lost. Step S42: For the determined node, read its most recent valid data frame, write the running status latch flag into the valid data frame, and generate a latch data frame; Step S43: During the period of link failure, continuously output latched data frames according to the original transmission cycle, and record and number the start and end positions of the continuously output latch intervals. Step S44: When the link is restored, stop outputting latched data frames and resume sending real-time acquired data, while retaining the latch interval number for the receiving end to identify the segment.
[0018] In one embodiment, the description will still focus on the aforementioned industrial park power distribution network, while references can be made to... Figure 4 This focuses on the handling process of energy storage device D4 (corresponding to node N4) in the event of communication failure. The system sampling period is 1 second, meaning that under normal circumstances, one frame of data is generated and sent every 1 second.
[0019] In step S41, the edge gateway performs temporal continuity detection on the data frames of node N4. Specifically, the edge gateway records the timestamp of each frame of data, for example, at time [time value missing]. (Timestamp 1000ms) D4 data successfully received. (2000ms) and If no corresponding data frame is received within 3000ms, the interval between adjacent valid data frames is calculated to be 3 seconds. When this interval exceeds a preset threshold (e.g., set to 2 seconds, i.e., 2 sampling periods), it is determined that the node has experienced a link interruption or data packet loss. In this example, the link anomaly of N4 is determined to be established at time t3.
[0020] In step S42, latching is performed on node N4. Specifically, the edge gateway reads its most recent valid data frame (i.e., ... The data frame contains real-time data, such as power P = -20kW and voltage 380V. A latch flag field, for example, "lock_flag=1", is added to this data frame, along with a latch number field (e.g., "lock_id=L20240301N4"), thus generating a latch data frame. This data frame maintains its original content. It shows the operating status at any given time, but already has a clear latching identifier.
[0021] In step S43, during the duration of the link anomaly (e.g. During the specified time period, the edge gateway continuously outputs the latched data frames according to the original transmission cycle (1 second), that is, during... At all times, latched data with a power of -20kW is transmitted, while maintaining the same latch number "L20240301N4". During this process, the edge gateway records the start and end positions of the latch interval, for example, recording the start time as... (2000ms), the termination time is not yet determined, forming a latch interval record structure: "L20240301N4: [2000ms, —]".
[0022] In step S44, when the communication link recovers at time t5 and receives D4 real-time data again (e.g., power updated to -10kW), the edge gateway immediately stops outputting latched data frames and switches to sending real-time acquired data. Simultaneously, the latch interval termination time is recorded as... (4000ms), thus forming a complete interval identifier: "L20240301N4: [2000ms, 4000ms]". This latch interval number and its time range are sent to the main station server along with the data for subsequent segment identification and status recovery processing.
[0023] Preferably, step S43 includes: A circular counting register is established within the edge gateway for latched data frames, where the count is automatically incremented each time a latched data frame is output. Reserve an identifier field in the latched data frame, write the current count value into the identifier field, so that each latched data frame carries order information; When it is detected that the continuous output of latched data frames reaches an integer multiple of the preset transmission cycle, a segment boundary identifier is embedded in the corresponding latched data frame to indicate the stage division of the latching interval; Before the link is restored, the final count value of the counting register area and the segment boundary identifier are fixed into the latched data of the last frame to form complete latched interval number information.
[0024] In one embodiment, taking the aforementioned industrial park power distribution network as an example, regarding energy storage device D4 (node N4) in... The process of link interruption during a certain period is explained in detail, focusing on the implementation of step S43. The system transmission period is 1 second, and the preset transmission beat is 5 frames (i.e., every 5 seconds is a stage segmentation unit).
[0025] First, a cycle counting register is established within the edge gateway for latched data frames. In specific implementations, when... When the latching state begins, the count value of the initial counter register is initialized to 0; each time a latched data frame is output (e.g., ... …), which triggers the counter value to increment by 1. For example, in The counter value is 1 when the first frame of latched data is output. At time 2, The time interval is 3, and so on. This counting register uses a circular counting method, for example, the maximum count value is set to 255, and after exceeding it, it wraps back to 0.
[0026] Subsequently, an identifier field is reserved in each latched data frame, and the current count value is written into it. In the specific implementation, a "seq_id" field is added to the data frame structure, for example, in... Write seq_id=1 into the output latched data frame. Write seq_id=2, in Write seq_id=3 to give each frame of latched data a clear sequence identifier, making it easier for the receiving end to restore the sequence.
[0027] Next, when the continuous output of latched data frames reaches an integer multiple of the preset transmission cycle, a segment boundary flag is embedded in the corresponding data frame. In this embodiment, the preset cycle is 5 frames, so when the count value reaches 5, 10, 15, etc., "boundary_flag=1" is written to the corresponding frame. For example, if the link abnormality continues until... At that time, a segment boundary identifier is embedded in the latched data of the 5th frame (seq_id=5) to indicate the end of a phase of the latched interval and to provide a basis for subsequent segment division.
[0028] Finally, before the link is restored, the latched interval is fully identified and fixed. or Before the link is restored, the edge gateway writes the final count value of the counting register (e.g., final seq_id=4 or 6) and the most recently occurring segment boundary identifier into the last frame latch data. For example, it adds the fields "final_seq=4" and "boundary_flag=0 or 1" to the last frame to form complete latch interval number information (e.g., L20240301N4-Seq4). This last frame data is sent to the master server along with the restored normal data.
[0029] Preferably, an identifier field is reserved in the latched data frame, and the current count value is written into the identifier field, so that each latched data frame carries order information including: In the data frame structure of the edge gateway, a fixed number of bits are allocated as a sequence identifier field, and the position of this field is kept consistent in the data frames of each node. When generating a latched data frame, the current count value in the cycle count register is written to the sequence identifier field by bit mapping; During continuous output, the sequence identifier field is written frame by frame, so that a monotonically changing identifier sequence is formed between adjacent latched data frames; When the count value reaches the upper limit of the field's range, a rollback write is performed on the sequence identifier field, and a rollback indicator bit is appended to the rollback start frame.
[0030] In one embodiment, taking the aforementioned industrial park power distribution network as an example, regarding energy storage device D4 (node N4) during link anomalies (e.g.) The process of continuously outputting latched data frames is described in detail, with a specific explanation of the "sequence identifier field writing mechanism". The system adopts a fixed-length data frame structure with a total length of 32 bytes. Bytes 28 and 29 (16 bits in total) are reserved as the sequence identifier field SEQ, and the first bit of the 30th byte is used as the wrap-back indicator bit WRAP. The positions of the above fields are consistent in all node data frames.
[0031] First, the data frame structure is divided into fields on the edge gateway side. The SEQ field is fixedly mapped to a 16-bit unsigned integer, representing a range of 0 to 65535. When the latch state is triggered (e.g., at time t2), the current count value of the loop counter register is initialized to 1, and this count value is written to the SEQ field in binary form. For example, in... In the latched data frame generated at each time step, SEQ=0000 0000 0000 0001 (i.e., decimal 1), and the WRAP bit is 0.
[0032] Subsequently, frame-by-frame incremental writing is performed during the continuous output of latched data frames. For example, in In the next frame of latched data output at each time step, the count value is incremented to 2 and written to the SEQ field (0000 0000 0000 0010); Write SEQ=3 at time, SEQ=4 is written at all times, thus forming a continuously monotonically increasing sequence of identifiers. The receiving end can use this field to determine the order of data frames and whether there are any lost frames (such as SEQ changing more than 1).
[0033] When the count value reaches the upper limit of the field's range (e.g., SEQ=65535), rollback processing is performed when the next frame is output. In a specific implementation, SEQ is reset to 0, and the WRAP indicator bit is set to 1 in that frame. For example, the rollback start frame is written as SEQ=0000 0000 0000 0000, WRAP=1, to indicate to the receiver that this frame is the start of the sequence rollback. In subsequent frames (e.g., SEQ=1, 2, 3), the WRAP bit is restored to 0, thereby maintaining the normal incrementing sequence.
[0034] Preferably, when the count value reaches the upper limit of the field representation range, a rollback write is performed on the sequence identifier field, and a rollback indicator bit is added to the rollback start frame. Specifically: One bit is reserved in the sequence identifier field as a rollback trigger identifier bit, and it forms a combined encoding structure with the count value bit field; When the count value increases to the frame before the field limit, the rollback trigger flag is first flipped from the initial state, so that the frame becomes a rollback preview frame. When writing the count value back in the next frame, keep the flip state of the back roll trigger flag unchanged so that the receiving end can identify the back roll start point by the combination relationship of the flag bits of the previous and next frames. Within a few frames after the rollback is completed, the rollback trigger flag is restored to its initial state to obtain a set of discernible rollback flag windows.
[0035] In one embodiment, taking the continuous output of latched data frames by energy storage device D4 (node N4) in the aforementioned industrial park distribution network during a link anomaly as an example, the "rewind write mechanism" of the sequence identifier field is specifically explained. The sequence identifier field SEQ in the system data frame occupies 16 bits, of which the highest bit (bit 15) is reserved as the rollback trigger flag FLAG, and the remaining 15 bits (bit 0 to bit 14) are used as the count value field COUNT. Therefore, the SEQ field as a whole adopts a combined encoding structure of "FLAG+COUNT", where the value range of COUNT is 0 to 32767, and the initial state of FLAG is 0.
[0036] During normal incrementing, for example, when COUNT increases from 1 to 32765, FLAG remains at 0, corresponding to SEQ fields in the data frame as: 0|00000000000001, 0|111111111111101, etc. When the count value is about to reach the upper limit (i.e., current frame COUNT=32766), the edge gateway first flips the rollback trigger flag, setting FLAG from 0 to 1, while COUNT remains at its current value of 32766, thus generating a "rollback warning frame," for example, SEQ encoded as: 1|111111111111110. This frame is used to notify the receiver in advance that count rollback is about to occur.
[0037] In the next frame (i.e., the rewind frame after COUNT should have incremented to 32767), a count value rewind write operation is performed, resetting COUNT to 0 while keeping the FLAG bit unchanged (still 1), thus forming the rewind start frame, for example, SEQ encoded as: 1|000000000000000. The receiving end can accurately identify the frame as the rewind start point by detecting that "the FLAG in the previous frame was flipped and COUNT was close to the upper limit, and the COUNT in the next frame was zeroed and the FLAG remained flipped".
[0038] Within several frames after the rollback is completed (e.g., the next 3 frames, i.e., COUNT=1, 2, 3), the edge gateway continues to maintain FLAG=1, making SEQ sequentially: 1|000000000000001, 1|000000000000010, 1|000000000000011, thus forming a continuous rollback identifier window. Subsequently, in the 4th frame (e.g., COUNT=4), FLAG is restored to the initial state of 0, making SEQ change to: 0|000000000000100, indicating that the rollback process has ended and the normal incrementing state has resumed.
[0039] Preferably, when performing count value rollback writing in the next frame, the toggling state of the rollback trigger flag remains unchanged, so that the receiving end can identify the rollback start point through the combination relationship of the flag bits of the previous and next frames, including: The identifier field value of the rollback preview frame is cached in the edge gateway, and an association mapping relationship with the next frame is established; When generating a rollback frame, the count value is reset and written to the count field of the sequence identifier field, while keeping the rollback trigger identifier bit in a flip state unchanged; The mirror bits of the previous frame identifier field are appended to the rollback frame to form cross-frame comparison information pairs; The receiving end can determine the rollback start point and complete the sequence reconstruction by combining and verifying the identification field and mirror bits of the rollback frame with the previous frame.
[0040] In one embodiment, taking the continuous output of latched data frames by energy storage device D4 (node N4) in the aforementioned industrial park distribution network during a link anomaly as an example, the specific implementation of "identifying the rollback start point through the combination relationship of two consecutive frames" will be explained. The sequence identifier field SEQ in the system adopts a 16-bit encoding structure, where bit 15 is the rollback trigger flag, bits 0 to 14 are the count fields COUNT, and an additional 1 byte (8 bits) is reserved in the data frame as the "mirror bit field MIR" to store the mapping value of the identifier information of the previous frame.
[0041] First, on the edge gateway side, when it detects that the count value is about to reach the upper limit (e.g., COUNT=32766), a rollback preview frame is generated, and the SEQ field of this frame (e.g., FLAG=1, COUNT=32766) is cached in the local register. At the same time, an association mapping relationship between this frame and the next frame is established. For example, it is recorded as: Prev_SEQ = (FLAG=1, COUNT=32766), which is used when subsequent rollback frames are generated.
[0042] Subsequently, when generating the next frame (i.e., the rollback frame), the COUNT field is written back (reset to 0), while the FLAG bit remains unchanged (still 1), thus forming SEQ = (FLAG=1, COUNT=0). Based on this, the SEQ field of the previous frame is compressed and mapped (e.g., taking its lower 8 bits or performing an XOR operation to generate 8 bits), and written to the mirror bit field MIR of the current frame. For example, it can be set as follows: MIR = COUNT_prev&0xFF (that is, take the lower 8 bits of COUNT from the previous frame), then MIR=0xFE (corresponding to the lower 8 bits of 32766) in the current wrap-around frame.
[0043] Furthermore, during data transmission, the receiving end simultaneously receives two frames of data: a rollback preview frame and a rollback frame. For example: In the previous frame, SEQ = (1, 32766), MIR was empty; The current frame is SEQ = (1, 0), MIR = 0xFE.
[0044] The receiving end identifies the rollback start point using the following combination of verification rules: 1) Detect that the FLAG in both frames before and after is in a flipped state (FLAG=1); 2) Detect a sudden change in COUNT from near its upper limit to 0; 3) Match the current frame's MIR with the lower bits of the previous frame's COUNT (e.g., MIR=0xFE corresponds to the lower 8 bits of the previous frame's COUNT). When all three conditions are met, the current frame can be determined as the "rewind start frame", and the sequence reconstruction can be completed accordingly. For example, the subsequent COUNTs can be re-attached to the end of the original sequence in an ascending sequence.
[0045] Preferably, before link recovery, the final count value of the counting register area and the segment boundary identifier are fixed together in the last frame latch data, including: Before the link is restored, the link restoration trigger signal is monitored in the edge gateway, and the count value of the current counting register is locked when restoration is detected; When generating the last frame latch data, the count value is written to the preset interval termination field, and the segment boundary identifier is written at the corresponding position. The count value and the segment boundary identifier are combined and encoded to form an integrated identifier segment, which is then written into the latched data of the last frame.
[0046] In one embodiment, the energy storage device D4 (node N4) in the aforementioned industrial park distribution network is still used. Taking a link interruption and entry into latching state as an example, the specific implementation of "fixing interval termination information in the last frame latched data" is explained. The system transmission period is 1 second, and the counting register area increments by frame during the latching period.
[0047] First, before the link is restored, the edge gateway continuously monitors the communication status. In practice, it determines whether the link has been restored by using heartbeat signals or data reception status. For example, when a valid data frame (e.g., power -10kW) from D4 is received again at time t7, the link restoration trigger is determined to be successful. Upon detecting this restoration trigger signal, the edge gateway immediately locks the current count value in the counting register, for example, if the count has accumulated to 5 (indicating that 5 consecutive latched data frames have been output), and caches this count value as the "termination count value".
[0048] Subsequently, during the generation of the last frame latch data (i.e. The last frame of latched data at the specified time is used to write the locked count value into the preset interval termination field. For example, if 2 bytes are reserved in the data frame structure as the "end_seq" field, then end_seq=5 is written into the last frame. At the same time, a segment boundary flag is written at the corresponding position, for example, setting "boundary_flag=1" to indicate that this frame is the end boundary frame of the latched interval.
[0049] Furthermore, the count value and the segment boundary marker are combined and encoded to form an integrated identifier segment. In a specific implementation, a fixed format concatenation method can be used. For example, the 16-bit identifier segment structure can be defined as follows: the highest bit is the boundary marker bit (1 bit), and the remaining 15 bits are the count value. Then, boundary_flag=1 and end_seq=5 are combined and encoded as: 1|000000000000101, and written into a designated field of the last frame latched data. This combined identifier segment contains both interval termination information and interval length information, giving it complete expressive capabilities.
[0050] During data transmission, the latched data of the last frame (with a combined identifier segment) is sent to the master server before the recovered real-time data. When parsing, the receiving end can determine the end position and duration (e.g., 5 frames) of the latched interval by identifying the combined identifier segment, and then combine it with the starting number (e.g., L20240301N4) to complete the reconstruction and verification of the entire latched interval.
[0051] Preferably, after combining and encoding the count value and the segment boundary identifier to form an integrated identifier segment and writing it into the last frame latch data, the method further includes: The integrated identifier segment is locked in position to keep its field position in the latched data of the last frame fixed. The encoding result of the integrated identifier segment is synchronously written to the local cache of the edge gateway to obtain a copy of the interval end identifier; After the link is restored, the real-time data transmission status is obtained, a copy of the interval end identifier is extracted and modified according to the real-time data transmission and appended to the data stream to form the connection identifier between the preceding and following segments.
[0052] In one embodiment, the energy storage device D4 (node N4) in the aforementioned industrial park distribution network is still used. A link interruption occurred during this period, and Taking real-time communication recovery as an example, the "integrated identifier segment subsequent processing mechanism" will be explained in detail. The system has already latched data in the last frame ( The integrated identifier segment is generated in the ), for example, using a 16-bit encoding structure: the highest bit is the segment boundary identifier (1 bit), and the remaining 15 bits are the count value (such as 5 frames), and the encoding result is "1|000000000000101".
[0053] First, when generating the latched data for the final frame, the position of the integrated identifier segment is locked. In specific implementations, a fixed field offset position (e.g., bytes 30-31) is predefined in the data frame structure as the "interval end identifier field END_FLAG," and this field position remains unchanged regardless of the node or data frame type. When generating the last frame latch data, the aforementioned integrated identifier segment is written into this fixed field, so that the receiving end can directly locate the end identifier of the interval without dynamic lookup during parsing.
[0054] Subsequently, the integrated identifier segment is synchronously written to the local buffer on the edge gateway side. In the specific implementation, when generating the last frame, the encoded result (e.g., 0x8005, corresponding to "1|000000000000101") is written to the internal buffer register of the edge gateway and associated with the node ID (N4) to form a copy of the interval end identifier, for example, recorded as: "N4 → END_FLAG = 0x8005". This copy is used for subsequent data connection processing after the link is restored.
[0055] When the link is Once the time is restored, the edge gateway resumes transmitting real-time acquisition data (e.g., D4's current power is -10kW). When transmitting the first frame of real-time data, it retrieves a copy of the corresponding node's interval end flag (0x8005) from the local buffer and extends the data frame structure according to the real-time transmission status, appending the flag to the real-time data frame. For example, a "link_flag" field can be added to the real-time data frame, with 0x8005 appended to this field, so that the frame carries both "real-time data + interval end flag".
[0056] Through this additional mechanism, when parsing the first frame of real-time data after recovery, the receiving end can obtain the end information of the previous latch interval and logically connect it with the previously received latched data. For example, this can be used to confirm that the latch interval length is 5 frames, and then... Section and Subsequent real-time data is then continuously spliced together to avoid segment breaks or ambiguity in parsing.
[0057] After completing the above additional transmission (e.g., only in the first 1-2 frames after recovery), the edge gateway can clear the interval end marker copy in the buffer and restore the normal data transmission state.
[0058] Preferably, locking the position of the integrated identifier segment to keep its field position in the latched data of the last frame includes: In the edge gateway, a last frame data structure template is predefined, and a fixed field range for the integrated identifier segment is defined in the last frame data structure template; The integrated identifier segment is written into a fixed field range according to the last frame data structure template, and an overwrite write is performed on this range; Position verification is performed on fixed field ranges, and the field order and length of the fixed field ranges remain unchanged, so that the field position of the integrated identifier segment in the latched data of the last frame remains fixed.
[0059] In one embodiment, taking the processing of the last frame data of energy storage device D4 (node N4) in the aforementioned industrial park power distribution network after the link is interrupted and it enters the latching state as an example, the "integrated identifier segment position locking mechanism" will be specifically explained. The system specifies that the total length of the latched data frame is 32 bytes, of which bytes 30 to 31 (a total of 16 bits) are reserved as the writing interval for the integrated identifier segment.
[0060] First, a last frame data structure template is predefined in the edge gateway. In practice, a unified data frame template is established during the gateway initialization phase. For example, it might define: bytes 1-2 as the device ID, bytes 3-10 as the timestamp, bytes 11-26 as the measurement data area, bytes 27-29 as the status identifier area, and bytes 30-31 as the interval end identifier area (i.e., the fixed field range of the integrated identifier segment). This template remains unchanged during system operation and is uniformly applied to all nodes.
[0061] Subsequently, when generating the last frame latch data (e.g., at time t6), the integrated identifier segment is written into a fixed field range according to the above template. In the specific implementation, the combined encoding result (e.g., 0x8005) is directly written into bytes 30-31, and an overwrite writing method is used, that is, regardless of the original content of the field, it is completely replaced with the current encoding result, thereby avoiding residual data from affecting parsing.
[0062] Next, position verification is performed on the fixed field range. In practice, the edge gateway performs a field consistency check before the data frame is sent, such as checking whether there is an offset in bytes 30-31, whether the length is 2 bytes, and whether the field order is correct. If an abnormal field position is detected (such as offset to byte 29 or a change in length), a reconstruction mechanism is triggered, and the data frame fields are rearranged according to a preset template before being sent.
[0063] By following the steps above, the integrated identifier segment is always written to a fixed position (bytes 30-31), and the field length and order remain unchanged. This allows the receiving end to directly locate the identifier segment when parsing data, without the need for dynamic matching of field positions, thus improving parsing efficiency and stability.
[0064] Of particular importance, step S3 includes: Load the distribution network topology table into the edge gateway and establish the correspondence between node identifiers and device addresses; The received data stream is parsed frame by frame, the source device identifier is extracted and mapped to the corresponding topology node to complete the node binding; Based on the connection relationships in the topology table, generate path identifier codes for each node's data and write them into preset fields in the data frame; The data frames are rearranged according to the path identifier code to form a continuous sequence of data on the same topological path, so as to generate a data sequence corresponding to the digital twin model.
[0065] In one embodiment, the 0.4kV distribution network of the aforementioned industrial park is used as an example for illustration. The distribution network topology is as follows: the main bus node N0 is connected to two branches, where branch one is N0→N1→N3→N5 (corresponding to devices D1, D4, and D6), and branch two is N0→N2→N4→N7 (corresponding to devices D2, D5, and D8). A topology table is pre-loaded in the edge gateway, storing node relationships in a table structure, including node number, parent node, child node, and corresponding device address (e.g., D1 corresponds to N1, D4 corresponds to N3, etc.), thereby establishing a one-to-one mapping relationship between "node identifier and device address".
[0066] During data reception, the edge gateway parses the data stream uploaded by the acquisition terminal frame by frame. For example, if a data frame (containing device ID=D4, voltage, current, etc.) is received from device D4 at a certain moment, the gateway first extracts the device identifier D4 and binds it to the topology node N3 according to the mapping table, thus completing the node binding process. For data from multiple devices received at the same time (such as D1, D2, and D4), they are all mapped to the corresponding nodes (N1, N2, and N3) in this way, so that the original device data has a unified node identification system.
[0067] Subsequently, based on the connection relationships in the topology table, path identification codes are generated for each node's data. In specific implementations, a "node concatenation encoding" method can be used. For example, for node N3, whose path is N0→N1→N3, a path identification code "0-1-3" is generated; for node N7, a path identification code "0-2-4-7" is generated. This path identification code is written into a preset field of the data frame (e.g., bytes 27-29) in string or compressed encoding form, so that each frame of data carries explicit topology path information.
[0068] Based on this, the edge gateway rearranges the data frames according to the path identifier code. For example, if the data frames received in a certain sampling period are in the order of [D4 (N3), D2 (N2), D1 (N1), D8 (N7)], then after being sorted according to the path identifier code, they are adjusted to: [D1 (N1, path 0-1), D4 (N3, path 0-1-3), D2 (N2, path 0-2), D8 (N7, path 0-2-4-7)], so that the data on the same topology path (such as 0-1-3) form a continuous sequence.
[0069] Of particular importance is the rearrangement of data frames according to path identifier codes, so that data on the same topological path forms a continuous sequence, thereby generating a data sequence corresponding to the digital twin model, including: In the edge gateway, multiple buffer queues are established based on the path identifier code, and the received data frames are written into the corresponding buffer queues according to the path identifier code. Assign round-robin scheduling sequence numbers to each cache queue and form a cyclic scheduling sequence; The buffer queues are selected sequentially according to the cyclic scheduling sequence for reading data frames. When there are data frames in the buffer queue, the data frames in the buffer queue are read and output continuously. When the buffer queue is empty, skip the buffer queue and select the next buffer queue according to the round-robin scheduling sequence to continue output, so that data frames corresponding to the same path identifier code are kept in a concentrated output during the round-robin scheduling process.
[0070] In one embodiment, the industrial park power distribution network described above is still used as an example. Assume that three typical path identifiers are generated based on the topology: path P1 (0-1-3, corresponding to nodes N1 and N3), path P2 (0-2-4, corresponding to nodes N2 and N4), and path P3 (0-2-4-7, corresponding to node N7). Multiple buffer queues are established in the edge gateway based on these path identifiers, for example, queues Q1, Q2, and Q3, and the received data frames are written to the corresponding queues according to their path identifiers. For example, if the received data frames in a certain sampling period are in the order D4 (path P1), D2 (path P2), D1 (path P1), and D8 (path P3), then they are written as follows: Q1={D4, D1}, Q2={D2}, and Q3={D8}.
[0071] Subsequently, round-robin scheduling sequence numbers are assigned to each buffer queue, for example, setting the scheduling order to Q1→Q2→Q3, and a cyclic scheduling sequence is constructed. In actual operation, this sequence is executed cyclically in a fixed order, without changing with the data reception status of a single session, thereby ensuring the stability and predictability of the scheduling process.
[0072] During the data output phase, the edge gateway sequentially selects and reads from the buffer queues according to the aforementioned cyclic scheduling sequence. When scheduling to Q1, if a data frame is detected in Q1, all data frames in that queue are read and output continuously, for example, D4 and D1 are output sequentially, so that the data corresponding to path P1 forms a continuous output segment; then scheduling to Q2 outputs D2; then scheduling to Q3 outputs D8. If a queue is empty in a certain round of scheduling (for example, no data in the next cycle Q2), that queue is skipped directly, and scheduling continues to the next queue Q3.
[0073] Through the aforementioned round-robin scheduling mechanism, without altering the overall data flow periodicity, data frames with the same path identifier code are kept concentrated and continuous during output. For example, data from path P1 is always output in a "group" format without being interrupted by data from other paths. The resulting data sequence is structurally consistent with the topological paths in the digital twin model, enabling the master station to directly reconstruct network data relationships according to the paths during parsing, thereby improving model mapping efficiency and data consistency. Those skilled in the art can directly implement data rearrangement logic based on this queue partitioning and round-robin scheduling method.
[0074] This invention provides a distribution network digital twin data transmission system for executing the distribution network digital twin data transmission method described above. The distribution network digital twin data transmission system includes: The data acquisition module is used to set up acquisition terminals on the side of each physical device in the power distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; The data preprocessing module is used by the edge gateway to perform time alignment, reduction transformation and anomaly removal on the data to form a data stream in a unified format; The topology mapping module is used to bind nodes and mark paths for data streams based on the distribution network topology, generating data sequences that correspond to the digital twin model. The status latch module is used to insert a running status latch mark into the corresponding node data frame on the edge gateway side when a link interruption or data packet loss is detected, and output the most recent valid status and number the latch interval. The packet sending module is used to divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; The synchronization processing module is used by the master station server to parse the received data, perform state continuation processing on the corresponding segment after identifying the state latch mark, and update it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.
[0075] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.
[0076] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A method for transmitting digital twin data in a distribution network, characterized in that, The distribution network includes distributed power sources, energy storage devices, and load terminals. The distributed power sources, energy storage devices, and load terminals are electrically connected to a data acquisition terminal. The data acquisition terminal is connected to an edge gateway via a communication interface. The edge gateway is connected to a main station server via a communication network. The method includes the following steps: Step S1: Set up data acquisition terminals on each physical device side of the distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; Step S2: The edge gateway performs time alignment, reduction conversion, and anomaly removal on the data to form a data stream with a unified format; Step S3: Based on the distribution network topology, perform node binding and path marking on the data flow to generate a data sequence corresponding to the digital twin model; Step S4: When a link interruption or data packet loss is detected, insert a running status latch mark into the corresponding node data frame on the edge gateway side, output the most recent valid status, and number the latch interval. Step S5: Divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; Step S6: The master station server parses the received data, identifies the state latch mark, performs state continuation processing on the corresponding segment, and updates it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.
2. The distribution network digital twin data transmission method according to claim 1, characterized in that, Step S4 includes the following steps: Step S41: Perform time sequence continuity detection on the data frames of each node in the edge gateway. When the interval between adjacent data frames exceeds a preset threshold, it is determined that the link is interrupted or the data is lost. Step S42: For the determined node, read its most recent valid data frame, write the running status latch flag into the valid data frame, and generate a latch data frame; Step S43: During the period of link failure, continuously output latched data frames according to the original transmission cycle, and record and number the start and end positions of the continuously output latch intervals. Step S44: When the link is restored, stop outputting latched data frames and resume sending real-time acquired data, while retaining the latch interval number for the receiving end to identify the segment.
3. The distribution network digital twin data transmission method according to claim 2, characterized in that, Step S43 includes: A circular counting register is established within the edge gateway for latched data frames, where the count is automatically incremented each time a latched data frame is output. Reserve an identifier field in the latched data frame, write the current count value into the identifier field, so that each latched data frame carries order information; When it is detected that the continuous output of latched data frames reaches an integer multiple of the preset transmission cycle, a segment boundary identifier is embedded in the corresponding latched data frame to indicate the stage division of the latching interval; Before the link is restored, the final count value of the counting register area and the segment boundary identifier are fixed into the latched data of the last frame to form complete latched interval number information.
4. The distribution network digital twin data transmission method according to claim 3, characterized in that, An identifier field is reserved in the latched data frame, and the current count value is written into this identifier field, so that each latched data frame carries order information including: In the data frame structure of the edge gateway, a fixed number of bits are allocated as a sequence identifier field, and the position of this field is kept consistent in the data frames of each node. When generating a latched data frame, the current count value in the cycle count register is written to the sequence identifier field by bit mapping; During continuous output, the sequence identifier field is written frame by frame, so that a monotonically changing identifier sequence is formed between adjacent latched data frames; When the count value reaches the upper limit of the field's range, a rollback write is performed on the sequence identifier field, and a rollback indicator bit is appended to the rollback start frame.
5. The distribution network digital twin data transmission method according to claim 4, characterized in that, When the count value reaches the upper limit of the field's range, a rollback write is performed on the sequence identifier field, and a rollback indicator bit is appended to the rollback start frame. Specifically: One bit is reserved in the sequence identifier field as a rollback trigger identifier bit, and it forms a combined encoding structure with the count value bit field; When the count value increases to the frame before the field limit, the rollback trigger flag is first flipped from the initial state, so that the frame becomes a rollback preview frame. When writing the count value back in the next frame, keep the flip state of the back roll trigger flag unchanged so that the receiving end can identify the back roll start point by the combination relationship of the flag bits of the previous and next frames. Within a few frames after the rollback is completed, the rollback trigger flag is restored to its initial state to obtain a set of discernible rollback flag windows.
6. The method for transmitting digital twin data in a distribution network according to claim 5, characterized in that, When writing the count value back in the next frame, the toggling state of the back-wrap trigger flag remains unchanged, so that the receiving end can identify the back-wrap start point through the combination relationship of the flag bits of the previous and next frames, including: The identifier field value of the rollback preview frame is cached in the edge gateway, and an association mapping relationship with the next frame is established; When generating a rollback frame, the count value is reset and written to the count field of the sequence identifier field, while keeping the rollback trigger identifier bit in a flip state unchanged; The mirror bits of the previous frame identifier field are appended to the rollback frame to form cross-frame comparison information pairs; The receiving end can determine the rollback start point and complete the sequence reconstruction by combining and verifying the identification field and mirror bits of the rollback frame with the previous frame.
7. The method for digital twin data transmission in a distribution network according to claim 2, characterized in that, Before the link is restored, the final count value of the counting register and the segment boundary identifier are fixed together in the last frame latch data, including: Before the link is restored, the link restoration trigger signal is monitored in the edge gateway, and the count value of the current counting register is locked when restoration is detected; When generating the last frame latch data, the count value is written to the preset interval termination field, and the segment boundary identifier is written at the corresponding position. The count value and the segment boundary identifier are combined and encoded to form an integrated identifier segment, which is then written into the latched data of the last frame.
8. The method for digital twin data transmission in a distribution network according to claim 7, characterized in that, After combining and encoding the count value and the segment boundary identifier to form an integrated identifier segment, which is then written into the latched data of the last frame, the following steps are also included: The integrated identifier segment is locked in position to keep its field position in the latched data of the last frame fixed. The encoding result of the integrated identifier segment is synchronously written to the local cache of the edge gateway to obtain a copy of the interval end identifier; After the link is restored, the real-time data transmission status is obtained, a copy of the interval end identifier is extracted and modified according to the real-time data transmission and appended to the data stream to form the connection identifier between the preceding and following segments.
9. The method for transmitting digital twin data in a distribution network according to claim 8, characterized in that, Position locking of the integrated identifier segment to keep its field position fixed in the latched data of the last frame includes: In the edge gateway, a last frame data structure template is predefined, and a fixed field range for the integrated identifier segment is defined in the last frame data structure template; The integrated identifier segment is written into a fixed field range according to the last frame data structure template, and an overwrite write is performed on this range; Position verification is performed on fixed field ranges, and the field order and length of the fixed field ranges remain unchanged, so that the field position of the integrated identifier segment in the latched data of the last frame remains fixed.
10. A digital twin data transmission system for a power distribution network, characterized in that, For executing the distribution network digital twin data transmission method as described in claim 1, the distribution network digital twin data transmission system includes: The data acquisition module is used to set up acquisition terminals on the side of each physical device in the power distribution network to collect data on voltage, current, power and switching quantities and upload them to the edge gateway; The data preprocessing module is used by the edge gateway to perform time alignment, reduction transformation and anomaly removal on the data to form a data stream in a unified format; The topology mapping module is used to bind nodes and mark paths for data streams based on the distribution network topology, generating data sequences that correspond to the digital twin model. The status latch module is used to insert a running status latch mark into the corresponding node data frame on the edge gateway side when a link interruption or data packet loss is detected, and output the most recent valid status and number the latch interval. The packet sending module is used to divide the data sequence into packets based on the numbered latch intervals and send them to the main station server according to priority; The synchronization processing module is used by the master station server to parse the received data, perform state continuation processing on the corresponding segment after identifying the state latch mark, and update it with the new sampled data after the link is restored, thus completing the data synchronization of the digital twin model.