A time synchronization data processing method of a photovoltaic protocol converter
By establishing multi-level reference time and estimating device clock offset, the problem of time asynchrony between devices in photovoltaic power plants is solved, achieving time synchronization and accurate alignment of multi-source data, and improving the accuracy of data analysis and operation evaluation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANDONG DEYUAN ELECTRICITY TECH CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-07-14
AI Technical Summary
The time offset and asynchrony of data from different devices in a photovoltaic power plant due to differences in time source, time synchronization accuracy, and communication delay can affect the accuracy of data analysis and the operation assessment of the photovoltaic power plant.
By establishing multi-level reference time, estimating device clock time offset, and compensating for communication link delay, the corrected timestamp is calculated, and time window reconstruction and data rearrangement are performed to achieve time synchronization of multi-source data.
It achieves alignment of multi-source data under a unified time base, improves the accuracy of data analysis and the reliability of photovoltaic power plant operation assessment, and adapts to weak grid and grid outage environments.
Smart Images

Figure SMS_1 
Figure SMS_5 
Figure SMS_10
Abstract
Description
Technical Field
[0001] This invention relates to the field of data communication processing technology, specifically to a time synchronization data processing method for a photovoltaic protocol converter. Background Technology
[0002] As the scale of photovoltaic power generation systems continues to expand, photovoltaic power plants typically deploy a large number of different types of equipment, such as photovoltaic inverters, electricity meters, energy storage devices, meteorological monitoring equipment, and various environmental monitoring devices. These devices upload operational data to a monitoring system or energy management system (EMS) via communication networks to monitor and manage the operational status of the photovoltaic power plant.
[0003] In practical engineering applications, due to the differences in communication protocols used by equipment from different manufacturers, photovoltaic power plants typically use photovoltaic protocol converters to parse and convert the communication protocols of various devices, enabling data from different devices to be uniformly accessed by the monitoring system or upper-level management system. Photovoltaic protocol converters are usually responsible for functions such as device communication connection, protocol parsing, data acquisition, and data forwarding, and are a crucial node in the data communication system of a photovoltaic power plant.
[0004] However, in the data acquisition and communication process of existing photovoltaic power plants, data from different devices are often marked by their respective internal clocks or different time sources. For example, some devices use their internal clocks to generate data timestamps, some devices synchronize time through network time protocols, while others only have their timestamps generated by communication devices during data acquisition. Due to differences in the time sources, time synchronization accuracy, and communication delays of each device, data from different devices exhibits a certain degree of time offset or time asynchrony.
[0005] In the process of photovoltaic power plant operation monitoring, power analysis, and energy dispatch, the system often needs to jointly analyze data from multiple devices, such as comprehensively calculating inverter output power, electricity meter readings, and meteorological radiation data. When there are deviations in the time dimension of data from various devices, it may lead to inaccurate data alignment, thereby affecting the accuracy of data analysis results and even adversely affecting photovoltaic power plant operation assessment and control strategies. Summary of the Invention
[0006] To address the aforementioned problems, this invention provides a time synchronization data processing method for a photovoltaic protocol converter, comprising: Multi-source device data acquisition and raw data recording and encapsulation; Time information identification and standardization are performed on the time information in the original data records; Establish multi-level reference time; Extract the device clock time from the device time field, compare it with the timestamp received by the converter and historical offset records, and estimate the offset of the device clock time. For different communication protocols and link types, estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter, and determine the communication link delay compensation. Based on the offset estimation of device clock time and communication link delay compensation, calculate the corrected timestamp for each original data record; The photovoltaic protocol converter arranges the device data in the order of reception, and reconstructs the time window and rearranges the data based on the corrected timestamps in the original data records. The data packets aggregated by the time window are encapsulated according to the target protocol and uploaded, and time-related extended fields are added to the output data.
[0007] The original data record includes at least the device unique identifier, protocol type, original message byte sequence, parsed data key-value pairs, device time field, converter receive timestamp, polling start time, polling end time, communication link type, and data quality flag.
[0008] The specific operation of identifying and standardizing the time information in the original data records is as follows: Decode the time fields of different protocols according to the device template configuration; Perform a time validity pre-check on the extracted device time field, including range check, jump check, accuracy check and stationary check; All times that pass the time validity pre-check are uniformly converted to UTC time, represented as a 64-bit integer, and a UTC microsecond representation field of the device time is added to the original data record.
[0009] The establishment of multi-level reference time specifically includes: The priority of reference time sources is determined as follows: GPS / BeiDou hardware time synchronization > NTP / PTP network time synchronization > standard time issued by the host system > local system clock of the converter. For reference time quality assessment, a maintenance quality state machine is established for each reference time source. The structure fields of the maintenance quality state machine include record source type, last synchronization time, synchronization quality score, estimated drift amount, and available status. For each raw data record entering the processing pipeline, a reference time snapshot is read from the currently active reference time source to generate the corresponding reference time.
[0010] The offset estimation includes static offset and dynamic offset.
[0011] The specific operation of estimating the offset of the device clock time is as follows: For devices with a usable device time field, the instantaneous offset is calculated based on the device clock time and the converter's received timestamp, using the following formula: In the formula, For device clock time, To receive timestamps, This is the estimated link delay. The instantaneous offset is filtered using an exponentially weighted moving average to obtain the smoothed offset: in, This is a smoothing coefficient, with a value ranging from 0.05 to 0.2. Take the most recent N offset samples ,in, For sample time points, a linear model is fitted using the least squares method. , b The initial offset is used to obtain the device clock drift rate. k ; For devices without a device time field, the current offset is estimated using a historical drift model; Based on the smoothed offset from the filtered output or the current offset estimated by the historical drift model, the static offset of devices with and without a device time field is determined respectively; the dynamic offset is calculated by the drift rate and the time interval; and the total estimated offset is calculated based on the static offset and the dynamic offset.
[0012] The calculation of the corrected timestamp for each original data record includes: Based on the standardized time information in the original data records, the device time field of available devices is corrected according to offset estimation and communication link delay compensation. The formula is as follows: in, Indicates the corrected timestamp; This field represents the UTC microsecond representation. Indicates the smooth offset; This represents the estimated link delay. Time correction is performed on devices without a device time field based on the converter's received timestamp and reference time. The formula is as follows: in, Indicates the corrected timestamp; Indicates single-link delay; This is the opposite of the reference time.
[0013] The specific operation of reconstructing the time window and rearranging the data based on the corrected timestamps in the original data records is as follows: Construct time windows with three modes: fixed window, sliding window, and event-triggered window, and configure the window size and step size for each mode. Set the window waiting time and close the window when the window wait time expires; support three processing methods for late data: discarding, revising the history window, and reporting independent patch frames. For multiple raw data records of the same device within the same window, data aggregation within the window is performed. The aggregation methods include latest value priority, time-weighted average, and full retention. Data is supplemented for devices that have missing data when the window is closed.
[0014] The time-related extended fields include the original device timestamp, the corrected timestamp, the reference time source type, the device clock estimate offset, the device clock drift rate, the link delay, the time reliability score, the time window ID, the data filling type, and the correction algorithm version number.
[0015] A time synchronization data processing system for a photovoltaic protocol converter, which implements the time synchronization data processing method for the photovoltaic protocol converter described above, includes: The data input module is used for data acquisition from multiple sources and for recording and encapsulating raw data. The time recognition module is used to identify and standardize the time information in the raw data records. The reference time module is used to establish multi-level reference times. The time offset estimation module is used to extract the device clock time from the device time field, and estimate the offset of the device clock time by comparing it with the timestamp received by the converter and historical offset records. The link delay compensation module is used to estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter for different communication protocols and link types, and to determine the communication link delay compensation. The time correction module is used to calculate the corrected timestamp for each original data record based on the offset estimation of the device clock time and the communication link delay compensation. The time correction module is also used to reconstruct the time window and rearrange the data based on the corrected timestamps in the original data records, according to the device data arranged by the photovoltaic protocol converter in the order of reception. The output module is used to encapsulate the data packets aggregated by the time window according to the target protocol and upload them, and adds time-related extended fields to the output data.
[0016] This invention provides a time synchronization data processing method for photovoltaic protocol converters, which has the following advantages over existing technologies: Separate modeling and independent compensation of time skew and link delay: The device clock skew and communication transmission delay are modeled separately. The device clock skew is tracked by EWMA filtering and drift rate estimation, and the link delay is estimated by RTT measurement or historical statistics. Finally, the two are superimposed and corrected, which can more accurately restore the actual time of data occurrence, rather than just correcting the device clock error.
[0017] Dynamic offset prediction based on drift rate linear regression: It not only filters the current observed offset, but also estimates the device clock drift rate by performing linear regression on the historical offset sequence. During the period when the device timestamp is unavailable, it uses the drift rate model to predict the current offset, avoiding degradation to a zero compensation state and improving the robustness of the system.
[0018] Multi-source data time alignment under a unified time benchmark: A time window reconstruction mechanism is introduced to classify data from different devices into a unified time window according to the corrected timestamp, thereby achieving true alignment of multi-source data on the time axis.
[0019] Multi-level reference time source automatic switching and quality assessment mechanism: This solution is designed with an automatic switching mechanism for reference time sources covering four priorities: GPS / BeiDou → NTP / PTP → upper-level system distribution → local clock. The quality status of each source is maintained, and the source is automatically downgraded when the high-precision source is unavailable. The drift model is used to mitigate the loss of accuracy, adapting to the actual deployment environment of photovoltaic power plants with weak grids and grid outages.
[0020] Full equipment type coverage: For devices without a time field, such as combiner boxes, the estimated time of data occurrence without a time field is reconstructed by halving the RTT, correcting the link type, and deducting the device processing delay, thus achieving effective time correction support for devices without a timestamp. Detailed Implementation
[0021] Exemplary embodiments of this disclosure will now be described in more detail.
[0022] Example 1 This embodiment provides a time synchronization data processing method for a photovoltaic protocol converter. An independent time synchronization correction processing layer is set up after the data access and parsing module and before the uplink data encapsulation module of the photovoltaic protocol converter. Based on this time synchronization correction processing layer, the method specifically includes: Step 1: Data acquisition from multiple sources and recording and encapsulation of raw data; The photovoltaic protocol converter polls or listens to the raw message stream of each device according to the device configuration table. After completing the protocol parsing, it encapsulates each piece of raw data into a structured raw data record (RawRecord).
[0023] The original data record includes at least the device unique identifier, protocol type, original message byte sequence, parsed data key-value pairs, device time field, converter receive timestamp, polling start time, polling end time, communication link type, and data quality flag.
[0024] For devices without a device time field, the device time field in the original data record is marked as NULL. The photovoltaic protocol converter will reconstruct the device time field of the device based on the converter's received timestamp and delay estimate. The delay estimate is calculated based on the polling start time and polling end time.
[0025] Step 2: Identify and standardize the time information in the original data records. The specific operation is as follows: S2.1 Decode the time fields of different protocols according to the device template configuration; The device template configuration includes: Modbus devices: Time is usually stored in the form of registers, and common encoding methods include Unix timestamps, BCD encoding, and split registers.
[0026] IEC 104 equipment: Time stamps use the CP56Time2a format.
[0027] MQTT devices: The time field format is ISO 8601 string or Unix timestamp.
[0028] S2.2 Perform a time validity pre-check on the extracted device time field, including: Range check: Determine whether it falls within a reasonable time range; if it does not, it is considered abnormal. Jump check: Determine whether the time difference with the previous record on the same device exceeds the threshold. If it does, it is judged as abnormal and marked as a time jump. Accuracy check: Determine whether the time accuracy is consistent with the protocol declaration. If not, downgrade its time reliability. Static check: If the device time field of N consecutive records is exactly the same, it is considered an anomaly.
[0029] For abnormal timestamps, mark the device time field as NULL and treat it as a device without a device time field; and record the abnormal flag, and subsequent processes will treat it as a device without a timestamp.
[0030] S2.3. Convert all times that pass the time validity pre-check to UTC time, represented by a 64-bit integer, and add a UTC microsecond representation field for device time to the original data record.
[0031] Step 3: Establish multi-level reference time, which specifically includes: S3.1 Determine the priority of the reference time source, wherein the priority order is GPS / BeiDou hardware time synchronization > NTP / PTP network time synchronization > standard time issued by the host system > local system clock of the converter.
[0032] S3.2 Reference time quality assessment: A maintenance quality state machine is established for each reference time source. The structure fields of the maintenance quality state machine include record source type, last synchronization time, synchronization quality score, estimated drift amount, and availability status. S3.3 For each raw data record entering the processing pipeline, read a reference time snapshot from the currently active reference time source and generate the corresponding reference time; When each RawRecord enters the processing pipeline, a reference time snapshot (ref_time_snapshot_us) is read from the currently active reference time source. This snapshot represents the system's perception of the actual current time when processing that data, i.e., the reference time, calculated as follows: ref_time_snapshot_us=local_clock_us+ref_to_local_offset Here, ref_to_local_offset represents the time difference between the local system clock and the currently active reference time source.
[0033] Step 4: Extract the device clock time from the device time field, compare it with the timestamp received by the converter and the historical offset record, and estimate the offset of the device clock time. The systematic difference between the device clock time and the reference time includes static offset and dynamic offset. The static offset is the initial time synchronization error of the device clock; the dynamic offset is the amount of clock drift that accumulates over time.
[0034] The specific steps for estimating the device clock time offset are as follows: S4.1 For devices with available device time fields, calculate the instantaneous offset based on the device clock time and the converter's received timestamp, using the following formula: In the formula, For device clock time, To receive timestamps, This is the estimated link delay.
[0035] S4.2. The instantaneous offset is filtered using an exponentially weighted moving average to obtain the smoothed offset: in, This is a smoothing coefficient, with a value ranging from 0.05 to 0.2.
[0036] S4.3, Take the N most recent offset samples ,in, For sample time points, a linear model is fitted using the least squares method. , b The initial offset is used to obtain the device clock drift rate. k ; S4.4 For devices without a device time field, the current offset is estimated using the historical drift model, and the formula is as follows: In addition, for devices that have never had an offset sample, the offset is initialized to 0.
[0037] S4.5. Based on the smoothed offset of the filtered output or the current offset estimated by the historical drift model, determine the static offset of the device with or without the device time field; calculate the dynamic offset by the drift rate and the time interval; and calculate the total estimated offset based on the static offset and the dynamic offset.
[0038] S5. For different communication protocols and link types, estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter, and determine the communication link delay compensation, specifically including: S5.1 For request-response protocol devices, latency estimation is based on polling round-trip time: For request-response protocols such as Modbus, the total round-trip time for each poll can be directly measured as follows: In the formula, Indicates the polling end time; Indicates the polling start time.
[0039] The estimated link delay is determined based on the total round-trip time: in, To handle device delays.
[0040] S5.2 For devices with active reporting protocols, collect historical link delay data for each device and estimate the delay based on the historical statistics; For proactive reporting protocols like MQTT, where devices actively push data, round-trip time cannot be directly measured. Latency estimation is performed by analyzing historical link latency data from the devices. The single-link delay is calculated based on the converter's received timestamp and the device clock offset: Among them, T rx Receive timestamps for the converter.
[0041] Based on the sliding window statistics of the most recent 100 link delay historical data, the median is determined as the delay compensation value.
[0042] Step 6: Based on the device clock time offset estimation and communication link delay compensation, calculate the corrected timestamp for each original data record; Based on the standardized time information in the original data records, the device time field of available devices is corrected according to offset estimation and communication link delay compensation. The formula is as follows: in, Indicates the corrected timestamp; This field represents the UTC microsecond representation. Indicates the smooth offset; This represents the estimated link delay.
[0043] Time correction is performed on devices without a device time field based on the converter's received timestamp and reference time. The formula is as follows: in, Indicates the corrected timestamp; Indicates single-link delay; This is the opposite of the reference time.
[0044] Step 7: Reconstruct the time window and rearrange the data based on the corrected timestamps in the original data records, according to the device data arranged by the photovoltaic protocol converter in the order of reception. The specific operation is as follows: S7.1 Construct a time window with three modes: fixed window, sliding window, and event-triggered window, and configure the window size and step size for each mode of time window respectively; S7.2 Set the window waiting time and close the window after the window wait time expires; support three processing methods for late data: discarding, revising the history window, and reporting independent patch frames. For data whose corrected timestamp `corrected_ts_us` has fallen into a closed window (i.e., late data), the following processing options can be selected: Discard mode: Discard directly and log the information. The revision mode appends late data to the historical window record, triggering a revision of the aggregation results for that window; In the independent frame mode, late data is reported as a separate patch frame, and the host system decides whether to include it in the calculation.
[0045] S7.3. For multiple original data records from the same device within the same window, perform in-window data aggregation, wherein the aggregation method includes: Latest value priority: Take the record with the largest corrected timestamp corrected_ts_us within the window; Time-weighted average: Calculates the mean of numerical data by interpolation over time; Full Retention: Retain all data points in the window record, and output them all after adding timestamps.
[0046] S7.4. For devices with missing data when the window is closed, perform data completion, wherein the completion method includes: Null flag: Mark missing fields as DATA_MISSING and do not perform calculations; Historical value filling: Fill with the most recent valid value of the device, marked as FILLED_BY_HISTORY; Linear interpolation fill: If there are values in both the front and back windows, linear interpolation estimation is used and marked as INTERPOLATED.
[0047] Step 8: Encapsulate the data packets aggregated by the time window according to the target protocol and upload them, adding time-related extended fields to the output data.
[0048] The time-related extended fields include the original device timestamp, the corrected timestamp, the reference time source type, the device clock estimate offset, the device clock drift rate, the link delay, the time reliability score, the time window ID, the data filling type, and the correction algorithm version number.
[0049] Furthermore, the time synchronization correction processing layer of the photovoltaic protocol converter in this embodiment also includes a time synchronization data processing system, comprising: The data input module is used for data acquisition from multiple sources and for recording and encapsulating raw data. The time recognition module is used to identify and standardize the time information in the raw data records. The reference time module is used to establish multi-level reference times. The time offset estimation module is used to extract the device clock time from the device time field, and estimate the offset of the device clock time by comparing it with the timestamp received by the converter and historical offset records. The link delay compensation module is used to estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter for different communication protocols and link types, and to determine the communication link delay compensation. The time correction module is used to calculate the corrected timestamp for each original data record based on the offset estimation of the device clock time and the communication link delay compensation. The time correction module is also used to reconstruct the time window and rearrange the data based on the corrected timestamps in the original data records, according to the device data arranged by the photovoltaic protocol converter in the order of reception. The output module is used to encapsulate the data packets aggregated by the time window according to the target protocol and upload them, and adds time-related extended fields to the output data.
Claims
1. A time synchronization data processing method for a photovoltaic protocol converter, characterized in that, include: Multi-source device data acquisition and raw data recording and encapsulation; Time information identification and standardization are performed on the time information in the original data records; Establish multi-level reference time; Extract the device clock time from the device time field, compare it with the timestamp received by the converter and historical offset records, and estimate the offset of the device clock time. For different communication protocols and link types, estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter, and determine the communication link delay compensation. Based on the offset estimation of device clock time and communication link delay compensation, calculate the corrected timestamp for each original data record; The photovoltaic protocol converter arranges the device data in the order of reception, and reconstructs the time window and rearranges the data based on the corrected timestamps in the original data records. The data packets aggregated by the time window are encapsulated according to the target protocol and uploaded, and time-related extended fields are added to the output data.
2. The time synchronization data processing method according to claim 1, characterized in that, The original data record includes at least the device unique identifier, protocol type, original message byte sequence, parsed data key-value pairs, device time field, converter receive timestamp, polling start time, polling end time, communication link type, and data quality flag.
3. The time synchronization data processing method according to claim 1, characterized in that, The specific operation of identifying and standardizing the time information in the original data records is as follows: Decode the time fields of different protocols according to the device template configuration; Perform a time validity pre-check on the extracted device time field, including range check, jump check, accuracy check and stationary check; All times that pass the time validity pre-check are uniformly converted to UTC time, represented as a 64-bit integer, and a UTC microsecond representation field of the device time is added to the original data record.
4. The time synchronization data processing method according to claim 1, characterized in that, The establishment of multi-level reference time specifically includes: The priority of reference time sources is determined as follows: GPS / BeiDou hardware time synchronization > NTP / PTP network time synchronization > standard time issued by the host system > local system clock of the converter. For reference time quality assessment, a maintenance quality state machine is established for each reference time source. The structure fields of the maintenance quality state machine include record source type, last synchronization time, synchronization quality score, estimated drift amount, and available status. For each raw data record entering the processing pipeline, a reference time snapshot is read from the currently active reference time source to generate the corresponding reference time.
5. The time synchronization data processing method according to claim 1, characterized in that, The offset estimation includes static offset and dynamic offset.
6. The time synchronization data processing method according to claim 5, characterized in that, The specific operation of estimating the offset of the device clock time is as follows: For devices with a usable device time field, the instantaneous offset is calculated based on the device clock time and the converter's received timestamp, using the following formula: In the formula, For device clock time, To receive timestamps, This is the estimated link delay. The instantaneous offset is filtered using an exponentially weighted moving average to obtain the smoothed offset: in, This is a smoothing coefficient, with a value ranging from 0.05 to 0.
2. Take the most recent N offset samples ,in, For sample time points, a linear model is fitted using the least squares method. , b The initial offset is used to obtain the device clock drift rate. k ; For devices without a device time field, the current offset is estimated using a historical drift model; Based on the smoothed offset from the filtered output or the current offset estimated by the historical drift model, the static offset of devices with and without a device time field is determined respectively; the dynamic offset is calculated by the drift rate and the time interval; and the total estimated offset is calculated based on the static offset and the dynamic offset.
7. The time synchronization data processing method according to claim 1, characterized in that, The calculation of the corrected timestamp for each original data record includes: Based on the standardized time information in the original data records, the device time field of available devices is corrected according to offset estimation and communication link delay compensation. The formula is as follows: in, Indicates the corrected timestamp; This field represents the UTC microsecond representation. Indicates the smooth offset; This represents the estimated link delay. Time correction is performed on devices without a device time field based on the converter's received timestamp and reference time. The formula is as follows: in, Indicates the corrected timestamp; Indicates single-link delay; This is the opposite of the reference time.
8. The time synchronization data processing method according to claim 1, characterized in that, The specific operation of reconstructing the time window and rearranging the data based on the corrected timestamps in the original data records is as follows: Construct time windows with three modes: fixed window, sliding window, and event-triggered window, and configure the window size and step size for each mode. Set the window waiting time and close the window when the window wait time expires; support three processing methods for late data: discarding, revising the history window, and reporting independent patch frames. For multiple raw data records of the same device within the same window, data aggregation within the window is performed. The aggregation methods include latest value priority, time-weighted average, and full retention. Data is supplemented for devices that have missing data when the window is closed.
9. The time synchronization data processing method according to claim 1, characterized in that, The time-related extended fields include the original device timestamp, the corrected timestamp, the reference time source type, the device clock estimate offset, the device clock drift rate, the link delay, the time reliability score, the time window ID, the data filling type, and the correction algorithm version number.
10. A time synchronization data processing system for a photovoltaic protocol converter that implements the time synchronization data processing method for a photovoltaic protocol converter according to claim 1, characterized in that, include: The data input module is used for data acquisition from multiple sources and for recording and encapsulating raw data. The time recognition module is used to identify and standardize the time information in the raw data records. The reference time module is used to establish multi-level reference times. The time offset estimation module is used to extract the device clock time from the device time field, and estimate the offset of the device clock time by comparing it with the timestamp received by the converter and historical offset records. The link delay compensation module is used to estimate the one-way transmission delay from data generation by the device to reception by the photovoltaic protocol converter for different communication protocols and link types, and to determine the communication link delay compensation. The time correction module is used to calculate the corrected timestamp for each original data record based on the offset estimation of the device clock time and the communication link delay compensation. The time correction module is also used to reconstruct the time window and rearrange the data based on the corrected timestamps in the original data records, according to the device data arranged by the photovoltaic protocol converter in the order of reception. The output module is used to encapsulate the data packets aggregated by the time window according to the target protocol and upload them, and adds time-related extended fields to the output data.