Electric power Internet of Things minute-level data acquisition method based on hierarchical time synchronization
Through hierarchical time synchronization and dynamic channel management, the problems of insufficient clock synchronization and channel resource conflict in the power Internet of Things system are solved, and accurate data acquisition and real-time transmission of terminal devices are realized.
Patent Information
- Application Number
- CN202510618202.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-14
- Publication Date
- 2025-08-12
AI Technical Summary
In the existing power Internet of Things systems, the clock synchronization accuracy of terminal devices is insufficient, resulting in misalignment of data acquisition timing, and the fixed-cycle polling mechanism cannot effectively deal with emergencies, resulting in loss or delay in key data, affecting the real-time and accuracy of minute-level acquisition.
The hierarchical time synchronization strategy is adopted to achieve accurate time synchronization and data priority transmission of terminal equipment through collaborative calibration and dynamic adjustment of channel time slot bandwidth through master-slave nodes, and combined with the priority evaluation model of voltage mutation rate and emergency event level.
The compression of clock deviation between devices is realized, the competition for channel resources is eliminated, the time reference consistency and real-time nature of data acquisition is ensured, and the deployment needs of complex power line environments are adapted.
Smart Images

Figure CN120474657A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of electric power Internet of Things, and specifically relates to a minute-level data collection method for electric power Internet of Things based on hierarchical time synchronization. Background Art
[0002] As the power Internet of Things (IoT) evolves toward refined monitoring, minute-level data collection has become a key technical requirement for distribution network status perception, fault warning, and energy efficiency optimization. Compared to the traditional 15-minute data collection mechanism, minute-level data collection can more accurately capture transient characteristics such as voltage fluctuations and load mutations, providing data support for real-time decision-making. However, existing technologies still have significant drawbacks in practical applications:
[0003] Current systems primarily rely on the NTP / PTP protocols for time synchronization, but these protocols require devices with a complete operating system and have high network bandwidth requirements. However, most power IoT terminals are low-cost embedded devices. Their limited hardware resources and complex power line communication environments result in generally inadequate clock synchronization accuracy. This inconsistency in time bases can cause misalignment in the timing of data collected by different nodes. Especially in densely populated areas, minute-level calibration errors can accumulate and amplify, severely impacting the accuracy of data analysis.
[0004] Furthermore, fixed-period polling mechanisms face severe channel resource conflicts in minute-level data collection scenarios. When a large number of terminal devices trigger data uploads on a minute-by-minute basis, competition for time slots in the HPLC channel can lead to loss or delay of critical data. While existing solutions attempt to mitigate conflicts through static time slot allocation, they lack the ability to dynamically respond to unexpected conditions (such as short circuits) and are unable to prioritize the transmission of high-value data in emergency situations, hindering the full real-time advantage of minute-level data collection. Summary of the Invention
[0005] Purpose of the invention: The technical problem to be solved by the present invention is to address the deficiencies of the existing technology and provide a method for minute-level data collection of the power Internet of Things based on hierarchical time synchronization. The method is implemented based on the power Internet of Things system, which includes a master station, a concentrator, a collector, and a terminal device. The terminal device and the collector are connected via RS-485, the collector and the concentrator are connected via high-speed power line carrier communication (HPLC), and the concentrator and the master station are connected via 4G. The concentrator is the master node and the collector is the slave node. There are N slave nodes, where N is a natural number.
[0006] The time synchronization strategy of the master node includes the following steps:
[0007] Step a1: The master node periodically sends a message containing a timestamp to the master station, and the master station extracts the clock parameters by decoding the timestamp field in the message;
[0008] In step a2, the master station initiates active clock data polling for the preset nodes and newly connected nodes. For nodes that fail to be polled, the system automatically generates a clock synchronization exception log and files the ID of the device (electricity meter, sensor, etc.) that failed to be polled into the clock synchronization failure list.
[0009] In step a3, the system analyzes the collected clock data and calculates the clock deviation between the master station and the concentrator. If the deviation exceeds a threshold, the device is placed on a calibration list. Based on the power system's requirements for time synchronization accuracy, the threshold is set at 150ms, which can meet the power system's business needs.
[0010] In step a4, the system extracts device information from the calibration list and sends a time calibration instruction. It then parses the time calibration result returned by the concentrator. If the calibration is successful, an exception log is generated if the device triggers calibration requirements for two consecutive days. If the calibration fails, the number of failures is accumulated. When the number of failures reaches a threshold (usually 3 times), an exception log is automatically generated.
[0011] The time synchronization strategy for slave nodes includes the following steps:
[0012] In step b1, the system uses the master node's clock as the master clock and monitors the clocks of each node through the high-speed power line carrier communication (HPLC) broadcast channel to obtain the time deviation of each slave node;
[0013] In step b2, the system monitors the clock frequency of each slave node based on the master node clock (NTB_CCO) and obtains the frequency deviation of the node clock;
[0014] In step b3, the system calculates the time deviation required for synchronization of each step within a cycle based on the clock frequency, and calculates the clock frequency that needs to be adjusted for each step;
[0015] In step b4, the system changes the temperature compensation coefficient of the slave node to adjust the slave node clock frequency, and finally achieves accurate synchronization of the slave node clock with the master node clock, and obtains the calibrated local clock t current ;
[0016] The method comprises the following steps:
[0017] Step 1: Divide the HPLC channel into time synchronization slots and data upload slots. By monitoring the number of active network nodes, data cache capacity, and channel congestion status in real time, dynamically adjust the bandwidth ratio of the time synchronization slots and data upload slots.
[0018] Step 2: Based on the master node's high-precision clock source, clock deviation compensation is completed through two-way message exchange between the master and slave nodes, establishing a unified minute-level time frame for the entire network. Each minute is divided into 60 fixed-length time slots, with the start time of each time slot corresponding to the whole second of the standard clock. The master node periodically broadcasts a calibration signal to eliminate the accumulated clock error between terminal devices. A unique time slot offset parameter is then generated for each terminal device. The base offset is first calculated based on the terminal's unique identification code, and then a random decimal within a preset range is added to form the final trigger time offset value.
[0019] Step 3: Based on the calibrated local clock of the terminal device and the allocated offset parameters, the precise acquisition trigger time is calculated. When the predetermined time slot is reached, the data is automatically sampled instantaneously. The acquisition timestamp, device ID, and data value are bound and encapsulated into a structured message, which is transmitted through the pre-allocated channel resources.
[0020] Step 4: Build a priority evaluation model based on voltage mutation rate and emergency event level, calculate data collection priority in real time, and perform corresponding operations according to different priorities.
[0021] Step 1 includes the following steps:
[0022] Step 1.1: Define the total time slot of the HPLC channel as T total , T total Divided into time synchronization time slots T s1 and data upload time slot T s2 , the initial allocation ratio is T s1 :T s2 =1:5;
[0023] Step 1.2: Real-time monitoring of network load parameters, including the current number of active nodes N active and the concentrator cache queue depth Q buffer ;
[0024] Step 1.3, dynamically adjust the data upload time slot:
[0025]
[0026] T' s1 =T total -T' s2 ,
[0027] where T' s1 is the adjusted time synchronization slot, T' s2is the adjusted data upload time slot. λ is the channel load balancing factor, which defaults to 0.8. This value is an empirical value obtained through laboratory simulation. In a typical HPLC network environment, 0.8 can effectively balance channel load sensitivity and system robustness, avoiding overly aggressive adjustments when λ is too high or delayed resource response when λ is too low. γ is the load attenuation coefficient, which defaults to 0.05. It uses an exponential function to balance the nonlinear impact of load growth on time slot compression, avoiding channel congestion while maintaining the stability of minute-level acquisition.
[0028] Step 2 includes the following steps:
[0029] Step 2.1, based on the local clock t calibrated in step b4 current , the time axis is divided into independent minute periods, each period is divided into 60 time slots, and the starting point of each time slot is determined by the following formula:
[0030]
[0031] Where n=0,1,…,59,S n Indicates the starting seconds of the nth time slot, is the floor function;
[0032] When the time slot starts at a moment that has already passed the current minute cycle, the device will realign to the new start time in the next minute cycle, ensuring that the trigger time is always in the future:
[0033]
[0034] where S' n Indicates the adjusted starting seconds of the nth time slot;
[0035] In step 2.2, the time slot offset δ of each terminal device is generated by the unique identification code DeviceID, and the formula is:
[0036] δ=(DeviceID mod60)+0.1×Rand(0,9),
[0037] The modulo operation mod60 evenly distributes the devices to 60 time slots, and Rand(0,9) is used to generate random decimals from 0 to 9;
[0038] Step 2.3, when network delay D is detected avg When the time is greater than 200ms, the elastic time slot mechanism is triggered to adjust the time slot length:
[0039]
[0040] Where ΔT represents the time slot adjustment amount;
[0041] Adjusted time slot length T slot becomes:
[0042] T slot =1.0+ΔT.
[0043] Step 3 includes the following steps:
[0044] Step 3.1, based on the time slot offset δ and the local clock t calibrated in step b4 current , determine the acquisition trigger time t trigger :
[0045]
[0046] Among them, the master-slave clock deviation compensation Δt comp =μ(t master -t current ), μ is the adjustment factor for master-slave clock deviation compensation, t master Master node clock;
[0047] When the trigger time is earlier than the local clock, the system automatically postpones the trigger time to the same offset position in the next complete cycle to perform the acquisition task. The formula is:
[0048]
[0049] where t' trigger Indicates the triggering moment of periodic offset acquisition;
[0050] Step 3.2, at t' trigger Trigger the data collection task of the terminal device at all times;
[0051] In step 3.3, the acquisition timestamp, device ID, and data value are bound and encapsulated into a binary data frame.
[0052] In step 3.3, the structure of the data frame is defined as:
[0053] Frame=0xAA55||t stamp ||DeviceID||U k ,I k ||CRC16,
[0054] Among them, Frame represents the data frame, 0xAA55 represents the frame header, t stamp Indicates the timestamp, U k Indicates the voltage value collected for the kth time, I k It represents the current value collected for the kth time, and CRC16 represents the check code. After the encapsulation is completed, the data is transmitted through the pre-allocated channel resources.
[0055] Step 4 includes the following steps:
[0056] Step 4.1: Construct the following priority assessment model based on voltage mutation and emergency event level:
[0057]
[0058] Among them, Priority represents the priority, α is the voltage mutation weight coefficient, V t Indicates the voltage measurement value at the current moment, V t-1 Indicates the voltage value of the last acquisition cycle, V base is the rated voltage of the equipment, β is the emergency event weight, T emergency For emergency level;
[0059] The voltage mutation weight coefficient α and emergency event weight β are constructed respectively through sliding window statistics and equipment health factors. The specific formulas are as follows:
[0060]
[0061]
[0062] Where σ is the standard deviation of voltage mutation, V k represents the voltage value of the kth cycle in the window, u represents the average voltage in the window, η represents the equipment health factor, and θ represents the cumulative number of equipment failures;
[0063] Step 4.2: When an emergency occurs, the basic emergency level E and the cumulative number of equipment failures θ jointly determine the final emergency level T emergency :
[0064]
[0065] In step 4.3, the collection density is dynamically adjusted according to the priority. When Priority ≥ 0.8, the collection frequency is 10 seconds / time, and adjacent idle time slots are preempted; when 0.5 ≤ Priority < 0.8, the collection frequency is 30 seconds / time, and the time slots remain originally allocated; when Priority < 0.5, the collection frequency is 60 seconds / time, and the time slots are merged into full-minute slots.
[0066] In step 4.2, the basic emergency level E is calculated by the following steps:
[0067] Step 4.2.1: quantify the impact of voltage fluctuations by calculating the relative amplitude of voltage changes in adjacent cycles. The absolute difference between the current voltage value and the voltage value in the previous cycle is divided by the rated voltage to ensure that the voltage changes of different devices are comparable. The voltage mutation weight term is expressed as Where k1 represents the voltage mutation weight coefficient;
[0068] Step 4.2.2: The severity of the current anomaly is measured by the ratio of the absolute deviation between the current and the rated current to the rated current. The larger the current deviation, the higher the emergency level. The current anomaly weight is expressed as Where k2 represents the current abnormality weight coefficient, I rated Indicates the rated current, ΔI indicates the absolute deviation between the current and the rated value;
[0069] Step 4.2.3: quantify the degree of temperature deviation from the normal state by the ratio of the difference between the current temperature and the normal operating temperature to the allowable temperature rise range. The closer the temperature is to the maximum threshold, the higher the risk. The temperature anomaly weight item is expressed as Where k3 represents the temperature anomaly weight coefficient, T current Indicates the current device temperature, T normal Indicates normal operating temperature, T max Indicates the maximum allowable temperature;
[0070] In step 4.2.4, the weighted sum of voltage, current, and temperature is compressed to the range of 0 to 1 using the sigmoid function.
[0071] In step 4.2.4, the weighted sum of voltage, current, and temperature is compressed to the range of 0 to 1 using the sigmoid function using the following formula:
[0072]
[0073] The present invention also provides an electronic device, comprising a processor and a memory, wherein the memory stores program code, and when the program code is executed by the processor, the processor executes the steps of the method.
[0074] The present invention also provides a storage medium storing a computer program or instruction, which executes the steps of the method when the computer program or instruction is run on a computer.
[0075] Beneficial effects: 1. The master-slave node collaborative calibration strategy reduces the clock deviation between devices to ±0.15 seconds per day, ensuring the consistency of the time base at every minute of collection;
[0076] 2. The random time slot offset allocation mechanism based on the unique device identifier effectively disperses the data upload time of densely populated terminals, eliminating the channel resource competition caused by traditional full-second triggering;
[0077] 3. A dynamic priority model that links voltage mutation rate with event level enables proactive preemptive transmission of fault signature data within a single acquisition cycle.
[0078] 4. The hierarchical synchronization strategy is suitable for low-cost embedded terminals, does not rely on GNSS modules or high-bandwidth communication resources, and meets the deployment requirements of complex power line environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0079] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments, and the above and / or other advantages of the present invention will become more apparent.
[0080] Figure 1 It is a system architecture diagram.
[0081] Figure 2 It is a hierarchical time synchronization flowchart.
[0082] Figure 3 This is a flowchart of the minute-level data collection solution.
[0083] Figure 4 This is a schematic diagram of the HPLC channel time slot division.
[0084] Figure 5 It is a time slot division flowchart.
[0085] Figure 6 It is a data collection flow chart.
[0086] Figure 7 It is a data collection flow chart based on priority. DETAILED DESCRIPTION
[0087] The embodiment of the present invention provides a method for collecting minute-level data of the power Internet of Things based on hierarchical time synchronization. The method is implemented based on the power Internet of Things system. The power Internet of Things system includes a master station, a concentrator, a collector and a terminal device. The terminal device and the collector are connected via RS-485, the collector and the concentrator are connected via high-speed power line carrier communication HPLC, and the concentrator and the master station are connected via 4G. The concentrator is the master node and the collector is the slave node. The system architecture is as follows: Figure 1 There are N slave nodes, where N is a natural number.
[0088] The hierarchical time synchronization strategy process is as follows Figure 2 shown.
[0089] The master node time synchronization strategy is as follows:
[0090] Step a1: The master node periodically sends a message containing a timestamp to the master station, and the master station extracts the clock parameters by decoding the timestamp field in the message;
[0091] In step a2, the master station initiates active clock data polling for the preset nodes and newly connected nodes. For nodes that fail to be polled, the system automatically generates a clock synchronization exception log and files the IDs of the devices such as meters and sensors that failed to be polled into the clock synchronization failure list.
[0092] In step a3, the system analyzes the collected clock data and calculates the clock deviation between the master station and the concentrator. If the deviation exceeds a threshold, the meters, sensors, and other devices exceeding the threshold are added to the calibration list. Based on the power system's requirements for time synchronization accuracy, the threshold is set to 150ms, which can meet the business needs of the power system.
[0093] In step a4, the system extracts device information from the calibration list and sends a time calibration instruction, then parses the time calibration result returned by the concentrator. If the calibration is successful, if the device triggers the calibration requirement for two consecutive days, an exception log is generated; if the calibration fails, the number of failures is accumulated, and an exception log is automatically generated after reaching the threshold of three times.
[0094] The slave node time synchronization strategy is as follows:
[0095] In step b1, the system uses the master node's clock as the master clock and monitors the clocks of each node through the high-speed power line carrier communication (HPLC) broadcast channel to obtain the time deviation of each slave node;
[0096] In step b2, the system monitors the clock frequency of each slave node based on the master node clock (NTB_CCO) and obtains the frequency deviation of the node clock;
[0097] In step b3, the system calculates the time deviation required for synchronization of each step within a cycle based on the clock frequency, and calculates the clock frequency that needs to be adjusted for each step;
[0098] In step b4, the system changes the temperature compensation coefficient of the slave node to adjust the slave node clock frequency, ultimately achieving accurate synchronization between the slave node clock and the master node clock.
[0099] The process of minute-level data collection solution based on hierarchical time synchronization strategy is as follows: Figure 3 As shown, the steps are as follows:
[0100] Step 1: Divide the HPLC channel into time synchronization time slots and data upload time slots. By monitoring the number of active network nodes, data cache capacity, and channel congestion status in real time, the bandwidth ratio of the two types of time slots is dynamically adjusted.
[0101] Step 2: Based on the high-precision clock source of the master node, clock deviation compensation is completed through two-way message interaction between the master and slave nodes to establish a unified minute-level time frame for the entire network. Each minute is divided into 60 time slots of fixed length. The starting time of each time slot strictly corresponds to the whole second of the standard clock. The master node periodically broadcasts a calibration signal to eliminate the accumulated clock error between terminal devices. A unique time slot offset parameter is then generated for each terminal device. The base offset is first calculated based on the terminal's unique identification code, and then a random decimal within a preset range is superimposed to form the final trigger time offset value.
[0102] Step 3: Based on the calibrated local clock of the terminal device and the allocated offset parameters, the precise acquisition trigger time is calculated. When the predetermined time slot is reached, the data is automatically sampled instantaneously. The acquisition timestamp, device ID, and data value are bound and encapsulated into a structured message, which is transmitted through the pre-allocated channel resources.
[0103] Step 4: Build a priority evaluation model based on voltage mutation rate and emergency event level, calculate data collection priority in real time, and perform corresponding operations according to different priorities.
[0104] This solution system includes 1 master station, 15 concentrators, 120 collectors and 2000 terminal devices (smart meters and temperature sensors). The implementation process of this method is now explained with specific parameters:
[0105] In step 1, the HPLC time slot allocation diagram is as follows Figure 4 As shown, the following steps are included:
[0106] Step 1.1, define the total time slot T of the HPLC channel total is 1 second, which is divided into time synchronization slots T s1 and data upload time slot T s2 , the initial allocation ratio is T s1 :T s2 =1:5. The initial ratio is set to 1:5 because the time synchronization instructions are relatively short and do not require too many time slots, while the data upload time slot accounts for a large proportion to reserve resources to meet the needs of regular data transmission. s1 = 0.167 seconds, T s2 = 0.833 seconds;
[0107] Step 1.2: Real-time monitoring of network load parameters, the current number of active nodes (the number of nodes that need to upload data) N active =60, concentrator cache queue depth (number of unprocessed packets) Q buffer =30;
[0108] Step 1.3, dynamically adjust the data upload time slot, where T' s2is the adjusted data upload time slot. λ is the channel load balancing factor, with a default value of 0.8. This value is an empirical value obtained through laboratory simulation. In a typical HPLC network environment, 0.8 can effectively balance channel load sensitivity and system robustness, avoiding overly aggressive adjustments when λ is too high or delayed resource response when λ is too low. γ is the load attenuation coefficient, with a default value of 0.05. It uses an exponential function to balance the nonlinear impact of load growth on time slot compression, avoiding channel congestion while maintaining the stability of minute-level acquisition.
[0109]
[0110] T' s1 =T total -T' s2 =1-0.764=0.236,
[0111] where T' s1 This is the adjusted time synchronization slot.
[0112] This step compresses the data upload time slot from a fixed 0.833 seconds to 0.764 seconds by dynamically adjusting the HPLC channel time slot allocation, solving the problems of low channel utilization and high packet loss rate in fixed time slots under burst traffic.
[0113] In step 2, the time slot division flow chart is as follows Figure 5 As shown, the following steps are included:
[0114] Step 2.1, the calibrated local clock t current = 12352.3 seconds, the time axis is divided into independent minute periods, each period is divided into 60 time slots, and the starting point of each time slot is determined by the following formula.
[0115]
[0116] Where n=0,1,…,59,S n Indicates the starting seconds of the nth time slot, For a floor function, when the time slot starts at a moment that has already passed the current minute cycle, the device will realign to the new start moment in the next minute cycle to ensure that the trigger moment is always in the future.
[0117]
[0118] where S' n Indicates the adjusted starting seconds of the nth time slot.
[0119] For example, the starting time of the 33rd time slot is 12332 seconds, which is less than 12352.3 seconds of the local clock, so S' n It is 12392 seconds.
[0120] In step 2.2, to avoid channel conflicts, the time slot offset δ of each terminal device is generated by its unique identification code DeviceID. The DeviceID is 2024050112, and the formula is:
[0121] δ=(DeviceID mod60)+0.1×Rand(0,9)=(2024050112mod60)+0.1×5=32.5,
[0122] The modular operation evenly distributes devices to 60 time slots, and Rand(0,9) generates random decimals from 0 to 9. This introduction of random decimals avoids channel conflicts caused by multiple terminal devices triggering acquisition in the same second-level time slot.
[0123] Step 2.3, in the electric power Internet of Things scenario, time synchronization instructions and periodic data reporting are sensitive to delay. 200ms is the critical point to ensure the second-level response of terminal devices within the time slot. Exceeding this value will cause the accumulation of time synchronization errors and affect the global scheduling. The terminal reported data is lost due to channel congestion. When the network delay D is detected, avg When the time is greater than 200ms, the elastic time slot mechanism is triggered to adjust the time slot length. avg =300ms:
[0124]
[0125] Where ΔT represents the time slot adjustment amount.
[0126] Adjusted time slot length T slot becomes:
[0127] T slot =1.0+ΔT=1.0+0.5=1.5,
[0128] This step generates a unique time slot offset through DeviceID and introduces a random decimal. Combined with a flexible time slot adjustment mechanism, it solves the problems of high channel conflict rate and error accumulation under traditional second-level synchronization, and achieves precise millisecond-level triggering and dynamic fault tolerance.
[0129] In step 3, the data collection process is as follows Figure 6 As shown, the following steps are included:
[0130] Step 3.1, based on the allocated offset δ and the calibrated local clock t current , determine the acquisition trigger time t trigger :
[0131]
[0132] The master-slave clock deviation compensation Δt comp =μ(t master -t current )=0.9×0.1=0.09, the adjustment factor μ of the master-slave clock deviation compensation is 0.9, and the master node clock t master is 12352.4;
[0133] When the trigger time is earlier than the local clock, the system automatically postpones the time to the same offset position in the next complete cycle to perform the acquisition task.
[0134]
[0135] where t' trigger Indicates the periodic offset acquisition trigger moment.
[0136] Because t trigger =12332.59<12352.3, so t' trigger =12332.59+60=12392.59;
[0137] Step 3.2, at t' trigger Trigger the data collection task of the terminal device at all times;
[0138] Step 3.3: Bind and encapsulate the acquisition timestamp, device ID, and data value into a binary data frame. The structure is defined as follows:
[0139] Frame=0xAA55||t stamp ||DeviceID||U k ,I k ||CRC16,
[0140] Among them, Frame represents the data frame, 0xAA55 represents the frame header, t stamp Indicates timestamp, DeviceID indicates device ID, U k Indicates the voltage value collected for the Kth time, I k It represents the current value collected for the Kth time, and CRC16 represents the check code.
[0141] After encapsulation is completed, data is transmitted through pre-allocated channel resources.
[0142] In step 4, the priority-based data collection process is as follows Figure 7 As shown, the following steps are included:
[0143] Step 4.1: Construct a priority calculation formula based on voltage mutation and emergency level:
[0144]
[0145] Among them, Priority represents the priority, α is the voltage mutation weight coefficient, and the current voltage measurement value V t =223.5V, the voltage value of the previous acquisition cycle V t-1 =218.0V, rated voltage of the equipment V base =220V, β is the emergency weight, T emergency is the emergency level (normalized value from 0 to 1).
[0146] The α coefficient and β coefficient are constructed by sliding window statistics and device health factors respectively. The specific formulas are as follows:
[0147]
[0148] Where σ is the standard deviation of voltage mutation, V k Indicates the voltage value of the kth cycle in the window, which are 219.8V, 220.2V and 218.0V respectively, and the average value of the window voltage The cumulative number of equipment failures θ = 15 times, the equipment health factor
[0149] Step 4.2, define T emergency Assignment quantification formula, when an emergency occurs, the basic emergency level E and the cumulative number of equipment failures θ jointly determine the final emergency level. Current current I t =32A, rated current I rated =30A, current temperature T current =85℃, normal temperature T normal =70℃, maximum allowable temperature T max =90℃, weight coefficients k1=1.2, k2=0.8, k3=0.5
[0150] Voltage mutation term:
[0151] Current mutation term:
[0152] Temperature mutation term:
[0153] Basic emergency level:
[0154]
[0155] Final emergency level:
[0156] Step 4.3, Priority:
[0157]
[0158] Because Priority = 0.3793 < 0.5, the collection frequency is reduced to 60 seconds / time and merged into the full-minute slot to save channel resources.
[0159] By quantifying voltage, current, temperature mutations and equipment health, a dynamic priority formula is constructed to solve the problems of misjudgment of emergency events and waste of resources under traditional fixed thresholds, achieve precise triggering and acquisition frequency grading, and effectively improve resource utilization.
[0160] The present invention provides a method for minute-level data collection for the power Internet of Things (IoT) based on hierarchical time synchronization. While there are numerous methods and approaches for implementing this technical solution, the foregoing description is merely a preferred embodiment of the present invention. It should be noted that those skilled in the art may make improvements and modifications without departing from the principles of the present invention, and such improvements and modifications are also within the scope of protection of the present invention. Any components not specified in this embodiment may be implemented using existing technologies.
Claims
1. A method for collecting minute-level data of the power Internet of Things based on hierarchical time synchronization, characterized in that: The method is implemented based on an electric power Internet of Things system, which includes a master station, a concentrator, a collector, and a terminal device. The terminal device and the collector are connected via RS-485, the collector and the concentrator are connected via high-speed power line carrier communication (HPLC), and the concentrator and the master station are connected via 4G. The concentrator is a master node and the collector is a slave node. There are N slave nodes, where N is a natural number. The time synchronization strategy for the master node includes the following steps: Step a1: The master node periodically sends a message containing a timestamp to the master station, and the master station extracts the clock parameters by decoding the timestamp field in the message; In step a2, the master station initiates active clock data polling for the preset nodes and newly connected nodes. For nodes that fail to be polled, the system automatically generates a clock synchronization exception log and files the ID of the device that failed to be polled into the clock synchronization failure list. In step a3, the system analyzes the collected clock data and calculates the clock deviation between the master station and the concentrator. If the deviation exceeds the threshold, the device is included in the calibration list according to the power system's requirements for time synchronization accuracy; In step a4, the system extracts device information from the calibration list and sends a time calibration instruction. It then parses the time calibration result returned by the concentrator. If the calibration is successful, an exception log is generated if the device triggers calibration requirements for two consecutive days. If the calibration fails, the number of failures is accumulated. When the number of failures reaches a threshold, an exception log is automatically generated. The time synchronization strategy for slave nodes includes the following steps: In step b1, the system uses the master node's clock as the master clock and monitors the clocks of each node through the high-speed power line carrier communication (HPLC) broadcast channel to obtain the time deviation of each slave node; Step b2: The system monitors the clock frequency of each slave node based on the master node clock and obtains the frequency deviation of the node clock; In step b3, the system calculates the time deviation required for synchronization of each step within a cycle based on the clock frequency, and calculates the clock frequency that needs to be adjusted for each step; In step b4, the system changes the temperature compensation coefficient of the slave node to adjust the slave node clock frequency, and finally achieves accurate synchronization of the slave node clock with the master node clock, and obtains the calibrated local clock t current ; The method comprises the following steps: Step 1: Divide the HPLC channel into time synchronization slots and data upload slots. By monitoring the number of active network nodes, data cache capacity, and channel congestion status in real time, dynamically adjust the bandwidth ratio of the time synchronization slots and data upload slots. Step 2: Based on the master node's high-precision clock source, clock deviation compensation is completed through bidirectional message exchange between the master and slave nodes, establishing a unified minute-level time frame for the entire network. Each minute is divided into 60 fixed-length time slots, with the start of each time slot corresponding to the whole second of the standard clock. A calibration signal is periodically broadcast via the master node to eliminate the accumulated clock errors between terminal devices. A unique time slot offset parameter is then generated for each terminal device. A base offset is calculated based on the terminal's unique identification code, and then a random decimal within a preset range is added to form the final trigger time offset value. Step 3: Based on the calibrated local clock of the terminal device and the allocated offset parameters, the precise acquisition trigger time is calculated. When the predetermined time slot is reached, the data is automatically sampled instantaneously. The acquisition timestamp, device ID, and data value are bound and encapsulated into a structured message, which is transmitted through the pre-allocated channel resources. Step 4: Build a priority evaluation model based on voltage mutation rate and emergency event level, calculate data collection priority in real time, and perform corresponding operations according to different priorities.
2. The method according to claim 1, characterized in that Step 1 includes the following steps: Step 1.1: Define the total time slot of the HPLC channel as T total , T total Divided into time synchronization time slots T s1 and data upload time slot T s2 , the initial allocation ratio is T s1 :T s2 =1:5; Step 1.2: Real-time monitoring of network load parameters, including the current number of active nodes N active and the concentrator cache queue depth Q buffer ; Step 1.3, dynamically adjust the data upload time slot: T’ s1 =T total -T’ s2 , where T' s1 is the adjusted time synchronization slot, T' s2 is the adjusted data upload time slot, λ is the channel load balancing factor, and γ is the load attenuation coefficient.
3. The method according to claim 2, characterized in that Step 2 includes the following steps: Step 2.1, based on the local clock t calibrated in step b4 current , the time axis is divided into independent minute periods, each period is divided into 60 time slots, and the starting point of each time slot is determined by the following formula: Where n=0,1,…,59,S n Indicates the starting seconds of the nth time slot, is the floor function; When the time slot starts at a moment that has already passed the current minute cycle, the device will realign to the new start moment in the next minute cycle, ensuring that the trigger moment is always in the future: where S' n Indicates the adjusted starting seconds of the nth time slot; In step 2.2, the time slot offset δ of each terminal device is generated by the unique identification code DeviceID, and the formula is: δ=(DeviceID mod60)+0.1×Rand(0,9), The modulo operation mod60 evenly distributes the devices to 60 time slots, and Rand(0,9) is used to generate random decimals from 0 to 9; Step 2.3, when network delay D is detected avg When the time is greater than 200ms, the elastic time slot mechanism is triggered to adjust the time slot length: Where ΔT represents the time slot adjustment amount; Adjusted time slot length T slot becomes: T slot =1.0+ΔT。 4. The method according to claim 3, characterized in that Step 3 includes the following steps: Step 3.1, based on the time slot offset δ and the local clock t calibrated in step b4 current , determine the acquisition trigger time t trigger : Among them, the master-slave clock deviation compensation Δt comp =μ(t master -t current ), μ is the adjustment factor for master-slave clock deviation compensation, t master Master node clock; When the trigger time is earlier than the local clock, the system automatically postpones the trigger time to the same offset position in the next complete cycle to perform the acquisition task. The formula is: where t' trigger Indicates the triggering moment of periodic offset acquisition; Step 3.2, at t' trigger Trigger the data collection task of the terminal device at all times; In step 3.3, the acquisition timestamp, device ID, and data value are bound and encapsulated into a binary data frame.
5. The method according to claim 4, characterized in that In step 3.3, the structure of the data frame is defined as: Frame=0xAA55||t stamp ||DeviceID||U k ,I k ||CRC16, Among them, Frame represents the data frame, 0xAA55 represents the frame header, t stamp Indicates the timestamp, U k Indicates the voltage value collected for the kth time, I k It represents the current value collected for the kth time, and CRC16 represents the check code. After the encapsulation is completed, the data is transmitted through the pre-allocated channel resources.
6. The method according to claim 5, characterized in that Step 4 includes the following steps: Step 4.1: Construct the following priority assessment model based on voltage mutation and emergency event level: Among them, Priority represents the priority, α is the voltage mutation weight coefficient, V t Indicates the voltage measurement value at the current moment, V t-1 Indicates the voltage value of the last acquisition cycle, V base is the rated voltage of the equipment, β is the emergency event weight, T emergency For emergency level; The voltage mutation weight coefficient α and emergency event weight β are constructed respectively through sliding window statistics and equipment health factors. The specific formulas are as follows: Where σ is the standard deviation of voltage mutation, V k represents the voltage value of the kth cycle in the window, u represents the average voltage in the window, η represents the equipment health factor, and θ represents the cumulative number of equipment failures; Step 4.2: When an emergency occurs, the basic emergency level E and the cumulative number of equipment failures θ jointly determine the final emergency level T emergency : In step 4.3, the collection density is dynamically adjusted according to the priority. When Priority ≥ 0.8, the collection frequency is 10 seconds / time, and adjacent idle time slots are preempted; when 0.5 ≤ Priority < 0.8, the collection frequency is 30 seconds / time, and the time slots remain originally allocated; when Priority < 0.5, the collection frequency is 60 seconds / time, and the time slots are merged into full-minute slots.
7. The method according to claim 6, characterized in that In step 4.2, the basic emergency level E is calculated by the following steps: Step 4.2.1: quantify the impact of voltage fluctuations by calculating the relative amplitude of voltage changes in adjacent cycles. The absolute difference between the current voltage value and the voltage value in the previous cycle is divided by the rated voltage to ensure that the voltage changes of different devices are comparable. The voltage mutation weight term is expressed as Where k1 represents the voltage mutation weight coefficient; Step 4.2.2: The severity of the current anomaly is measured by the ratio of the absolute deviation between the current and the rated current to the rated current. The larger the current deviation, the higher the emergency level. The current anomaly weight is expressed as Where k2 represents the current abnormality weight coefficient, I rated Indicates the rated current, ΔI indicates the absolute deviation between the current and the rated value; Step 4.2.3: quantify the degree of temperature deviation from the normal state by the ratio of the difference between the current temperature and the normal operating temperature to the allowable temperature rise range. The closer the temperature is to the maximum threshold, the higher the risk. The temperature anomaly weight item is expressed as Where k3 represents the temperature anomaly weight coefficient, T current Indicates the current device temperature, T normal Indicates normal operating temperature, T max Indicates the maximum allowable temperature; In step 4.2.4, the weighted sum of voltage, current, and temperature is compressed to the range of 0 to 1 using the sigmoid function.
8. The method according to claim 7, characterized in that In step 4.2.4, the weighted sum of voltage, current, and temperature is compressed to the range of 0 to 1 using the sigmoid function using the following formula:
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 8.
10. A storage medium, characterized in that: A computer program or instruction is stored, and when the computer program or instruction is run on a computer, the steps of the method according to any one of claims 1 to 8 are executed.
Citation Information
Cited By
Wireless communication control method and system
CN121262536A
Sensor data acquisition method
CN121547747A