Oscilloscope synchronization method, system, and medium for multi-machine converters
By using an NTP time synchronization server and a time synchronization processing module, and by synchronizing local counters with satellite pulse signals and using common multiple division to determine the data, the problem of data asynchrony in new energy multi-machine converter systems is solved. This achieves alignment of timestamps and sampling cluster periods among multiple converters, ensuring the synchronous display of waveform data.
Patent Information
- Application Number
- CN202511469176.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-15
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-10-15
AI Technical Summary
In new energy multi-machine converter systems, there is no synchronous signal transmission between converters that cross geographical boundaries, and there is a lack of a unified clock synchronization system. This results in inconsistent local time bases for each converter, asynchronous control interruption and sampling cluster window timing, and makes it impossible to achieve synchronous display of data between multiple converters.
The system employs a Network Time Protocol (NTP) time synchronization server and a time synchronization processing module. It synchronizes a local second counter using satellite pulse signals, periodically collects oscilloscope data and calculates timestamps, and uses common multiples to determine the relationship between the synchronization source period and the local counter. This ensures the framing and uploading of sample cluster data frames, thereby achieving timestamp and sample cluster period alignment between each converter.
It enables data synchronization and display among multiple converters, ensuring that the local timestamps of each converter are accurately synchronized to the same time base, eliminating transmission delays and timing differences, and achieving unified display of waveform data.
Smart Images

Figure CN120956741B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of oscilloscope technology, and in particular to an oscilloscope synchronization method, system, and medium for multi-machine converters. Background Technology
[0002] In a multi-converter system for new energy, remote monitoring software sends oscilloscope channel IDs to the MCUs (microcontroller units) of each converter controller. The MCUs then look up the corresponding variable addresses based on the channel IDs and sample the values. The sampled data is framed and uploaded to the monitoring software for waveform display. However, the following issues prevent the synchronous display of data between multiple converters:
[0003] 1. There is no synchronous signal transmission between converters across geographical boundaries;
[0004] 2. The lack of a unified clock synchronization system among the various converters leads to inconsistent local time bases for the converters;
[0005] 3. The timing of oscilloscope frame data transmission to the monitoring software varies depending on the converter;
[0006] 4. The control interrupts of each converter are generated by its own crystal oscillator and timer. The control interrupts of the MCUs between the converters are asynchronous, so the trigger sampling time is also asynchronous.
[0007] 5. The sampling cluster window timing of each converter is based on its own timer, so they are asynchronous with each other.
[0008] Therefore, in new energy multi-converter systems, the lack of a unified synchronization mechanism and cross-regional transmission constraints in existing technologies leads to the inability to display data synchronously among multiple converters. Summary of the Invention
[0009] This invention provides an oscilloscope synchronization method, system, and medium for multiple converters, aiming to solve the problem of data not being displayed synchronously between multiple converters.
[0010] In a first aspect, embodiments of the present invention provide an oscilloscope synchronization method for multiple converters. The method is applied to an oscilloscope system comprising multiple converters, each converter including a Network Time Protocol (NTP) time synchronization server and a time synchronization processing module. Each converter is communicatively connected to a remote monitoring module via a switch. The method includes:
[0011] The NTP time synchronization server receives pulse signals from satellites and forwards them to the time synchronization processing module;
[0012] Using the pulse signal as a synchronization source, the time processing module synchronizes the local second counter based on the synchronization source.
[0013] The time synchronization module periodically acquires variable data from the oscilloscope within the sampling cluster period to obtain sampling cluster data, and acquires a local timestamp when acquiring variable data for the first time within the current sampling cluster period; wherein, the local timestamp includes the count value of the local second counter and the count value of the local microsecond counter;
[0014] Each time the time synchronization processing module receives a synchronization source, it calculates the product of the synchronization source period and the local second counter count value, and determines whether the product is divisible by a common multiple to obtain the judgment result; wherein, the common multiple is obtained based on the synchronization source period, the local microsecond counter period, and the sampling cluster period;
[0015] If the judgment result is negative, then after the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period;
[0016] If the judgment result is yes, then the local microsecond counter and the sampling cluster timer are cleared and the counting starts again. After the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period.
[0017] The data frame is uploaded to the remote monitoring module so that the remote monitoring module can restore the data frame into waveform data based on the local timestamp.
[0018] Secondly, embodiments of the present invention also provide an oscilloscope system, wherein the oscilloscope system applies the oscilloscope synchronization method for multi-converter as described in the first aspect, the oscilloscope system includes multiple converters, each converter includes an NTP time synchronization server and a time synchronization processing module, and each converter communicates with a remote monitoring module through a switch; wherein the time synchronization server establishes a remote communication connection with a time synchronization satellite based on a satellite communication link.
[0019] Thirdly, embodiments of the present invention also provide an oscilloscope system, the oscilloscope system including an NTP time synchronization server and a time synchronization processing module configured in each converter; the NTP time synchronization server includes a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; the time synchronization processing module includes a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; when the first processor executes the first computer program and the second processor executes the second computer program, they jointly implement the oscilloscope synchronization method for multi-converter converters as described in the first aspect.
[0020] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, can implement the oscilloscope synchronization method for multi-machine converters described in the first aspect.
[0021] This invention provides an oscilloscope synchronization method, system, and medium for multiple converters. The method is applied to an oscilloscope system comprising multiple converters, each converter including an NTP time synchronization server and a time synchronization processing module. Each converter communicates with a remote monitoring module via a switch. The method includes: the NTP time synchronization server receiving pulse signals from a satellite and forwarding them to the time synchronization processing module; using the pulse signals as a synchronization source, the time synchronization processing module synchronizing a local second counter based on the synchronization source; the time synchronization processing module periodically acquiring variable data from the oscilloscope within a sampling cluster period to obtain sampling cluster data, and acquiring a local timestamp upon the first acquisition of variable data within the current sampling cluster period; wherein the local timestamp includes the count value of the local second counter and the count value of the local microsecond counter; and the time synchronization processing module calculating the synchronization source period and the local second counter each time a synchronization source is received. The product of the count values is used to determine if it is divisible by a common multiple, thus obtaining a judgment result. This common multiple is based on the synchronization source period, the local microsecond counter period, and the sampling cluster period. If the judgment result is negative, after the current sampling cluster period ends, the sampled cluster data within the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period. If the judgment result is positive, the local microsecond counter and the sampling cluster timer are cleared and counting restarts. After the current sampling cluster period ends, the sampled cluster data within the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period. The data frame is then uploaded to the remote monitoring module so that the remote monitoring module can reconstruct waveform data from the data frame based on the local timestamp. This invention aligns the local timestamps and sampling cluster periods of each converter by using a unified synchronization source trigger point. It solves the synchronization problem of signals with different periods (synchronization source period, local timestamp period, and sampling cluster period) by using a common multiple, thereby achieving periodic synchronization of multiple converters and ensuring that the local timestamps of each converter are accurately synchronized to the same time reference. Attached Figure Description
[0022] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A flowchart illustrating the oscilloscope synchronization method for a multi-machine converter provided in an embodiment of the present invention;
[0024] Figure 2 A schematic diagram of an oscilloscope system provided in an embodiment of the present invention;
[0025] Figure 3 This is a schematic diagram of an oscilloscope system provided for another embodiment of the present invention. Detailed Implementation
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0028] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0029] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. Embodiments of this invention provide an oscilloscope synchronization method, system, and medium for multi-converter converters. The method is applied to an oscilloscope system comprising multiple converters, each converter including an NTP time synchronization server and a time synchronization processing module, and each converter communicating with a remote monitoring module via a switch.
[0030] Figure 1 This is a flowchart illustrating an oscilloscope synchronization method for a multi-machine converter provided in an embodiment of the present invention. The method includes steps S110-S170.
[0031] The S110 and NTP time synchronization servers receive pulse signals from satellites and forward them to the time synchronization processing module.
[0032] In this embodiment, the NTP time synchronization server receives pulse signals from the satellite and forwards them to the time synchronization processing module; wherein, the pulse signals include pulse per second (PPS) signals and time of day (TOD) signals.
[0033] In one embodiment, the time synchronization processing module further includes a backup synchronization source, which generates a backup synchronization pulse with the same period as the satellite's pulse signal. After the NTP time synchronization server receives the satellite's pulse signal and forwards it to the time synchronization processing module, the module further includes: each time the time synchronization processing module receives a pulse signal, it compares whether the pulse signal and the backup synchronization pulse are synchronized; if they are not synchronized, it controls the backup synchronization source to align the backup synchronization pulse with the pulse signal; if the time synchronization processing module detects that the satellite's pulse signal has disappeared, it uses the backup synchronization pulse as the synchronization source; when the time synchronization processing module detects that the satellite's pulse signal has recovered, it uses the satellite's pulse signal as the synchronization source.
[0034] In this embodiment, the time synchronization processing module further includes a backup synchronization source, which generates a backup synchronization pulse with the same period as the satellite's pulse signal. Each time a pulse signal is received, the time synchronization processing module compares the pulse signal with the backup synchronization pulse to see if they are synchronized. If they are not synchronized, the module controls the backup synchronization source to align the backup synchronization pulse with the pulse signal, ensuring that the backup synchronization pulse remains phase-locked with the satellite's pulse signal. If the time synchronization processing module detects that the satellite's pulse signal has disappeared, it uses the backup synchronization pulse as the synchronization source. When the time synchronization processing module detects that the satellite's pulse signal has recovered, it uses the satellite's pulse signal as the synchronization source, thereby ensuring that the synchronization of the multi-machine converter can still operate normally when the satellite's pulse signal disappears.
[0035] Specifically, the time synchronization module includes an FPGA and an MCU (see details). Figure 3 (or integrated into a single hardware implementation such as FPGA or MCU);
[0036] Example 1 (the time synchronization module only includes an FPGA): Each time the FPGA receives a pulse signal, it compares the pulse signal with the backup synchronization pulse to see if they are synchronized. If they are not synchronized, it controls the backup synchronization source to align the backup synchronization pulse with the pulse signal. If the FPGA detects that the satellite's pulse signal has disappeared, it uses the backup synchronization pulse as the synchronization source. When the FPGA detects that the satellite's pulse signal has recovered, it uses the satellite's pulse signal as the synchronization source, thereby ensuring that the synchronization of the multi-machine converter can still operate normally when the satellite's pulse signal disappears.
[0037] Example 2 (the time synchronization module only includes an MCU): Each time the MCU receives a pulse signal, it compares the pulse signal with the backup synchronization pulse to see if they are synchronized. If they are not synchronized, it controls the backup synchronization source to align the backup synchronization pulse with the pulse signal. If the MCU detects that the satellite's pulse signal has disappeared, it uses the backup synchronization pulse as the synchronization source. When the MCU detects that the satellite's pulse signal has recovered, it uses the satellite's pulse signal as the synchronization source, thereby ensuring that the synchronization of the multi-machine converter can still operate normally when the satellite's pulse signal disappears.
[0038] Example 3 (The time synchronization processing module includes FPGA and MCU): The FPGA is responsible for the processing and switching of the synchronization source, specifically including: when the FPGA receives a pulse signal each time, it compares whether the pulse signal is synchronized with the backup synchronization pulse; if they are not synchronized, it controls the backup synchronization source to align the backup synchronization pulse with the pulse signal; if the FPGA detects that the satellite's pulse signal has disappeared, it uses the backup synchronization pulse as the synchronization source; when the FPGA detects that the satellite's pulse signal has recovered, it uses the satellite's pulse signal as the synchronization source, thereby ensuring that the synchronization of the multi-machine converter can still operate normally when the satellite's pulse signal disappears.
[0039] S120. Using the pulse signal as a synchronization source, the time processing module synchronizes the local second counter based on the synchronization source.
[0040] In this embodiment, the pulse signal is used as a synchronization source, and the time processing module synchronizes the local second counter based on the synchronization source; wherein, the synchronization source sends a synchronization pulse once per second.
[0041] When the time synchronization module includes both an FPGA and an MCU, the FPGA is responsible for synchronizing the local second counter.
[0042] In one embodiment, the satellite's pulse signal includes a second pulse signal and a TOD signal; the time synchronization processing module synchronizes a local second counter based on a synchronization source, including: the time synchronization processing module parses the TOD signal to obtain a second field; takes the second field and synchronizes it to the local second counter; or converts the TOD signal into a total number of seconds; and synchronizes the total number of seconds to the local second counter.
[0043] In this embodiment, the pulse signal includes a pulse per second (PPS) signal and a time-to-date (TOD) signal. The time processing module parses the TOD signal to obtain the seconds field; takes the seconds field and synchronizes it to the local seconds counter; or converts the TOD signal into the total number of seconds; and synchronizes the total number of seconds to the local seconds counter.
[0044] Before executing the method of this invention, the oscilloscope system initialization configuration needs to be completed. Specifically, the remote monitoring module sends the channel ID to each converter while issuing the oscilloscope start command. After receiving the channel ID, the time synchronization module in the converter obtains the corresponding variable address by looking up a table and saves it to the channel address table to prepare for address mapping for subsequent data sampling operations.
[0045] S130 The time synchronization module periodically acquires variable data from the oscilloscope within the sampling cluster period to obtain sampling cluster data, and acquires a local timestamp when acquiring variable data for the first time within the current sampling cluster period; wherein, the local timestamp includes the count value of the local second counter and the count value of the local microsecond counter.
[0046] In this embodiment, when the time synchronization processing module only includes an FPGA, its function is integrated into a single hardware implementation of the FPGA; when the time synchronization processing module only includes an MCU, its function is integrated into a single hardware implementation of the MCU; when the time synchronization processing module includes both an FPGA and an MCU, the MCU performs periodic data acquisition within the sampling cluster period: in multiple control interrupts within the sampling cluster period, each time a control interrupt is triggered, the MCU synchronously reads the variable data in the oscilloscope to obtain the sampling cluster data; when the first control interrupt is triggered within the current sampling cluster period, the MCU reads the local timestamp synchronized by the FPGA. The local timestamp includes the count value of the local second counter and the count value of the local microsecond counter in the FPGA, and records the local timestamp as the timestamp of the sampling cluster period, which is used to mark the starting reference of the entire sampling cluster period.
[0047] The counting rules of the local microsecond counter are as follows: The local microsecond counter increments by 1 every 1 microsecond. If the local microsecond count reaches (10... 6 After -1), it will no longer increase and will maintain the current value; when the synchronization pulse arrives, the local microsecond counter will be cleared to zero and the second counter will be incremented by 1.
[0048] In one embodiment, the time synchronization module periodically acquires variable data from the oscilloscope within a sampling cluster period to obtain sampling cluster data. It also acquires a local timestamp when acquiring variable data for the first time within the current sampling cluster period. This includes: when the interrupt timer starts and the new sampling period crosses zero, the interrupt timer generates an interrupt control signal, triggering the time synchronization module to synchronously read the variable data of the included oscilloscope channels to obtain multi-channel sampling cluster data; wherein, the sampling cluster period includes multiple sampling periods; after completing the reading of the multi-channel sampling cluster data, the interrupt count value of the interrupt control counter is incremented by 1; it is determined whether the interrupt count value is 1; if the interrupt count value is 1, a local timestamp is recorded; wherein, the local timestamp is used to mark the generation time of the first sampling point within the current sampling cluster period; when the sampling cluster timer is cleared, the interrupt control counter is cleared.
[0049] In this embodiment, at the instant the interrupt timer completes counting of the previous sampling period and switches to the new sampling period (i.e., the "zero crossing"), the interrupt timer generates an interrupt control signal, triggering the timing processing module to synchronously read the variable data of all oscilloscope channels it contains, forming multi-channel sampling data. This sampling data accumulates continuously throughout the entire sampling cluster period, eventually forming the sampling cluster data of that sampling cluster period. After each reading of sampling data, the timing processing module increments the interrupt count value of the interrupt control counter by 1 to record the number of samples completed in the current sampling cluster period. Subsequently, it is determined whether the interrupt count value is 1: if it is 1, it indicates that this sampling is the first sampling in the current sampling cluster period. At this time, the local timestamp needs to be recorded synchronously (this timestamp consists of the count values of the local second counter and microsecond counter, used to mark the generation time of the first sampling point in the current sampling cluster period). When the sampling cluster period ends and the sampling cluster timer is cleared, the interrupt control counter is also cleared, and the counting of the number of samples in the next sampling cluster period starts again, ensuring that the first sample in each sampling cluster period can accurately record the corresponding local timestamp, thereby ensuring the accurate correlation between the sampling cluster data and the time base.
[0050] When the time synchronization module contains only an FPGA, its functions are integrated into a single FPGA hardware implementation; when the time synchronization module contains only an MCU, its functions are integrated into a single MCU hardware implementation; when the time synchronization module contains both an FPGA and an MCU, at the instant the MCU's interrupt timer completes counting of the previous sampling cycle and switches to the new sampling cycle (i.e., "zero crossing"), the interrupt timer will generate an interrupt control signal, triggering the MCU to synchronously read the variable data of all the oscilloscope channels it contains, forming multi-channel sampling data;
[0051] These sampled data accumulate continuously throughout the entire sampling cluster cycle, eventually forming the sampling cluster data for that cycle. After each complete reading of sampled data, the MCU increments the interrupt count value of the interrupt control counter by 1 to record the number of samples completed within the current sampling cluster cycle. Subsequently, it checks whether the interrupt count value is 1: if it is 1, it indicates that this sampling is the first sampling within the current sampling cluster cycle, and at this time, a local timestamp needs to be recorded synchronously (this timestamp consists of the count values of the FPGA's local second counter and microsecond counter, used to mark the generation time of the first sampling point within the current sampling cluster cycle). When the sampling cluster cycle ends and the sampling cluster timer is cleared, the interrupt count value of the interrupt control counter is also cleared, and the counting of the number of samples in the next sampling cluster cycle restarts, ensuring that the first sample in each sampling cluster cycle can accurately record the corresponding local timestamp, thereby ensuring the precise correlation between the sampling cluster data and the time base.
[0052] S140. Each time the synchronization processing module receives a synchronization source, it calculates the product of the synchronization source period and the local second counter count value, determines whether the product is divisible by a common multiple, and obtains the judgment result; wherein, the common multiple is obtained based on the synchronization source period, the local microsecond counter period, and the sampling cluster period.
[0053] In this embodiment, the time synchronization processing module calculates the product of the synchronization source period and the local second counter value each time it receives a synchronization source, and determines whether the product is divisible by a common multiple to obtain the judgment result. The common multiple is based on the synchronization source period, the local microsecond counter period, and the sampling cluster period. For example, when the synchronization source period is 1 second, the local timestamp period is 1 second, and the sampling cluster period is 12 milliseconds, the common multiple includes 3 seconds, 6 seconds, 9 seconds, etc., and one of the common multiples is used. In one example, the least common multiple, i.e., 3 seconds, is used.
[0054] When the time synchronization processing module contains only an FPGA, its functions are integrated into a single hardware implementation of the FPGA; when the time synchronization processing module contains only an MCU, its functions are integrated into a single hardware implementation of the MCU; when the time synchronization processing module contains both an FPGA and an MCU, each time a synchronization source is received, the MCU calculates the product of the synchronization source period and the local second counter count value, and determines whether the product is divisible by a common multiple.
[0055] S150. If the judgment result is negative, then after the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period.
[0056] In this embodiment, if the product of the synchronization source period and the local second counter count value cannot be divided by a common multiple, after the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period.
[0057] When the time synchronization processing module contains only an FPGA, its functions are integrated into a single hardware implementation of the FPGA; when the time synchronization processing module contains only an MCU, its functions are integrated into a single hardware implementation of the MCU; when the time synchronization processing module contains both an FPGA and an MCU, the MCU performs the data encapsulation and sampling cluster timer clearing operations.
[0058] S160. If the judgment result is yes, then the local microsecond counter and the sampling cluster timer are cleared and the counting starts again. After the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period.
[0059] In this embodiment, if the product of the synchronization source period and the local second counter count value can be divided by a common multiple, the time synchronization module will immediately clear the local microsecond counter and the sampling cluster timer and start counting again. After the current sampling cluster period ends, the sampling cluster data in the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period.
[0060] When the time synchronization module contains only an FPGA, its functions are integrated into a single hardware implementation of the FPGA; when the time synchronization module contains only an MCU, its functions are integrated into a single hardware implementation of the MCU; when the time synchronization module contains both an FPGA and an MCU, if the product of the synchronization source period and the local second counter count value can be divided by a common multiple, the local microsecond counter of the FPGA and the sampling cluster timer of the MCU are cleared and the counting starts again. After the current sampling cluster period ends, the MCU performs frame encapsulation processing on the sampling cluster data in the current sampling cluster period to obtain a data frame with the local timestamp, and clears the sampling cluster timer to start the next sampling cluster period.
[0061] In one embodiment, if the determination result is yes, then the local microsecond counter and the sampling cluster timer are cleared and restarted. After the current sampling cluster period ends, before performing frame encapsulation processing on the sampling cluster data within the current sampling cluster period to obtain a data frame with the local timestamp, the method further includes:
[0062] The system determines the relationship between the current sampling cluster period's accumulated sampling duration and the preset sampling duration. If the accumulated sampling duration of the current sampling cluster period is greater than or equal to the preset sampling duration, then based on the variable data from the last acquisition, a data supplementation operation is performed on the sampled cluster data of the current sampling cluster period to make up the data volume of the current sampling cluster period to the full data volume of the sampling cluster period, and then the current sampling cluster period ends. If the accumulated sampling duration of the current sampling cluster period is less than the preset sampling duration, then a data rounding operation is performed on the sampled cluster data of the current sampling cluster period, and the accumulated sampling duration is cleared to zero. The sampling cluster timer restarts the timing for the current sampling cluster period until the timing of the current sampling cluster period ends, and then the current sampling cluster period ends.
[0063] Alternatively, if the sampling duration of the current sampling cluster period is greater than or equal to the preset sampling duration, the current sampling cluster period is immediately terminated, and the variable data collected within the sampling duration is used as the sampling cluster data of the current sampling cluster period; if the sampling duration of the current sampling cluster period is less than the preset sampling duration, the sampling duration is cleared to zero, the current sampling cluster period is restarted, and the current sampling cluster period is terminated when the timing of the current sampling cluster period ends, and the variable data collected within the sampling duration and the variable data collected between the restart of the current sampling cluster period and the end of the timing are used as the sampling cluster data of the current sampling cluster period.
[0064] In this embodiment, the preset sampling duration can be set to 1 / 2 of the sampling cluster period. When the synchronization condition is met (i.e., the product of the synchronization source period and the local second counter count value is divisible by a common multiple), the time synchronization processing module needs to determine the relationship between the current sampling cluster period's sampled duration and the preset sampling duration, and process it in the following two ways:
[0065] The first processing method is as follows: If the sampling duration of the current sampling cluster period is greater than or equal to the preset sampling duration, then a data supplementation operation is performed based on the last collected variable data within the sampling cluster period. After supplementing the data volume of the current sampling cluster period to the data volume that should be in the complete sampling cluster period, the current sampling cluster period ends. If the current sampling duration is less than the preset sampling duration, then a data rounding operation is performed on the sampling cluster data of the current sampling cluster period, and the sampling duration is cleared to zero. The sampling cluster period restarts the timing until the timing reaches the complete sampling cluster period, thus ensuring the integrity of the period.
[0066] The second processing method is as follows: If the sampling duration of the current sampling cluster period is greater than or equal to the preset sampling duration, the current sampling cluster period is directly ended, and the collected variable data is used as the complete sampling cluster data of the sampling cluster period; if the current sampling duration is less than the preset sampling duration, the sampling duration is cleared to zero and the timing is restarted. After the timing restarts until the end of the complete sampling cluster period, the variable data collected before the timing restart (i.e., the variable data collected within the sampling duration) is combined with the variable data collected during the timing restart and used together as the sampling cluster data of the current sampling cluster period.
[0067] When the time synchronization module contains only an FPGA, its functions are integrated into a single hardware implementation on the FPGA; when the time synchronization module contains only an MCU, the sampled duration is obtained based on the sampling cluster timer of the MCU, and the MCU performs the data addition / removal processing.
[0068] In one embodiment, the data frame further includes a sampling cluster number; the sampling cluster data within the current sampling cluster period is framed, including: packaging the current sampling cluster number, the sampling cluster data within the current sampling cluster period, and the local timestamp to form a data frame;
[0069] If the judgment result is negative, the following steps are taken after the frame blocking process: increment the count value of the sampling cluster number by 1;
[0070] If the judgment result is yes, the process after frame sealing also includes: clearing the count value of the sampling cluster number to zero and recounting; uploading the data frame to the remote monitoring module so that the remote monitoring module can align the data frame according to the local timestamp and the sampling cluster number and restore it into waveform data.
[0071] In this embodiment, a complete data frame must include the current sampling cluster number, the sampling cluster data within the current sampling cluster period, and the corresponding local timestamp. The management rules for the sampling cluster number are as follows: If the product of the synchronization source period and the local second counter value cannot be divided by a common multiple (i.e., if the judgment result is negative), then after completing the framing process of the current sampling cluster data, the count value of the sampling cluster number is incremented by 1 to indicate the next sampling cluster period; if the product of the synchronization source period and the local second counter value can be divided by a common multiple (i.e., if the judgment result is positive), then after completing the framing process of the current sampling cluster data, the sampling cluster number is cleared to zero and counting restarts to ensure that the number reference at the synchronization trigger point is unified. After the data frame is uploaded to the remote monitoring module, the remote monitoring module can combine the local timestamp (local second counter and microsecond counter count values) and the sampling cluster number in the data frame to achieve precise alignment of the data frames of each converter through dual references, and finally restore the synchronized waveform data.
[0072] When the time synchronization module contains only an FPGA, its functions are integrated into a single FPGA hardware implementation. When the time synchronization module contains only an MCU, its functions are integrated into a single MCU hardware implementation. When the time synchronization module contains both an FPGA and an MCU, if the product of the synchronization source period and the local second counter count value cannot be divided by a common multiple (i.e., if the judgment result is negative), the MCU increments the count value of the sampling cluster number by 1 after completing the framing process of the current sampling cluster data to indicate the next sampling cluster period. If the product of the synchronization source period and the local second counter count value can be divided by a common multiple (i.e., if the judgment result is positive), the MCU clears the sampling cluster number to zero and restarts counting after completing the framing process of the current sampling cluster data, ensuring that the serial number reference at the synchronization trigger point is unified. After the MCU uploads the data frame to the remote monitoring module, the remote monitoring module can combine the local timestamp (local second counter and microsecond counter count values) and the sampling cluster number in the data frame to achieve precise alignment of the data frames of each converter through dual references, and finally restore the synchronized waveform data.
[0073] In one embodiment, the time synchronization module employs a double-buffer ping-pong operation on the sampled cluster data. The time synchronization module periodically acquires variable data from the oscilloscope within the sampled cluster period to obtain the sampled cluster data, including: storing the sampled cluster data acquired within the current sampled cluster period in the first buffer within the double buffer; after the current sampled cluster period ends, setting the logic state of the enable signal to valid; and uploading the data frame to the remote monitoring module, including: the time synchronization module uses a send function to detect the logic state of the enable signal in real time; if the logic state of the enable signal is valid, the time synchronization module packages the stored sampled cluster data in the first buffer within the double buffer into a data frame, and then uploads the data frame to the remote monitoring module via a switch; while the first buffer packages the stored sampled cluster data into a data frame, the second buffer within the double buffer stores the sampled cluster data acquired within the newly opened sampled cluster period; the first buffer and the second buffer are interchanged, and the above steps are executed cyclically.
[0074] In this embodiment, the time synchronization module uses a ping-pong operation with dual buffers to achieve continuous storage and uploading of sampled cluster data. The specific process is as follows: The dual buffers include a first buffer and a second buffer, which alternately handle data storage and processing. During the current sampling cluster period, the first buffer is specifically used to store all sampled cluster data collected within that period. After the current sampling cluster period ends, the time synchronization module sets the logic state of the "data transmission enable signal" to valid (e.g., set to 1) to trigger the data upload process. Specifically, the end of the sampling cluster period falls into two categories: If the judgment result is negative, the sampling cluster timer continues counting after receiving a synchronization source. When the counting ends (the current sampling cluster period ends), the time synchronization module sets the logic state of the "data transmission enable signal" to valid (e.g., set to 1). If the judgment result is positive, the sampling cluster timer is cleared and restarted after receiving a synchronization source. When the counting ends (the current sampling cluster period ends), the time synchronization module sets the logic state of the "data transmission enable signal" to valid (e.g., set to 1). When a cluster cycle ends, the time synchronization module sets the logic state of the "data transmission enable signal" to valid (e.g., set to 1). During data upload, the time synchronization module uses a transmission function to detect the logic state of the enable signal in real time. If the logic state of the enable signal is valid, the sampling cluster data stored in the first buffer is immediately framed, and the data frame is uploaded to the remote monitoring module through the switch. While the first buffer is framing and uploading data, the second buffer simultaneously begins to store the sampling cluster data collected in the newly started sampling cluster cycle, realizing parallel processing of data acquisition and uploading. When the new sampling cluster cycle ends, the roles of the first and second buffers are switched: the second buffer, which was originally used to store the data of the new sampling cluster cycle, is switched to undertake the task of framing and uploading data, and the first buffer, which originally completed the task of framing and uploading data, is switched to the buffer to store the data of the next new sampling cluster cycle, and the above operations are performed cyclically.
[0075] When the time synchronization module contains only an FPGA, its functions are integrated into a single hardware implementation of the FPGA; when the time synchronization module contains only an MCU, its functions are integrated into a single hardware implementation of the MCU; when the time synchronization module contains both an FPGA and an MCU, the MCU performs the role swapping between the first buffer and the second buffer.
[0076] S170. Upload the data frame to the remote monitoring module so that the remote monitoring module can restore the data frame into waveform data based on the local timestamp.
[0077] In this embodiment, the time synchronization module uploads the data frames (containing sample cluster data, local timestamps, and sample cluster sequence numbers) that have undergone frame encapsulation processing to the remote monitoring module via a switch. After receiving the data frames uploaded by each converter, the remote monitoring module aligns the sampling data of different converters according to the local timestamps recorded in the data frames (composed of the count values of local second counters and microsecond counters, marking the starting reference of the sampling cluster period). Specifically, the remote monitoring module parses the timestamps of each data frame to map the sampling cluster data of all converters onto a unified time reference, eliminating time offsets caused by transmission delays or local timing differences. Finally, the aligned sampling cluster data is restored to synchronized waveform data, realizing the synchronous display of waveforms among multiple converters.
[0078] In summary, the embodiments of the present invention align the local timestamps and sampling cluster periods of each converter by using a unified synchronization source trigger point, and solve the synchronization problem of signals with different periods (synchronization source period, local timestamp period and sampling cluster period) by using a common multiple, thereby achieving periodic synchronization of multiple converters and ensuring that the local timestamps of each converter are accurately synchronized to the same time reference.
[0079] Figure 2 This is a schematic diagram of an oscilloscope system provided in an embodiment of the present invention. Figure 2 As shown, the oscilloscope system is applied to the above-mentioned oscilloscope synchronization method for multiple converters. The oscilloscope system includes multiple converters, each of which includes an NTP time synchronization server and a time synchronization processing module. Each converter communicates with a remote monitoring module through a switch. The time synchronization server establishes a remote communication connection with the time synchronization satellite based on a satellite communication link.
[0080] In this embodiment, the NTP time synchronization server receives pulse signals from the satellite and forwards them to the time synchronization processing module. Using the pulse signals as a synchronization source, the time synchronization processing module synchronizes the local second counter based on the synchronization source. The time synchronization processing module periodically acquires variable data from the oscilloscope within the sampling cluster period to obtain sampling cluster data, and acquires a local timestamp when acquiring variable data for the first time within the current sampling cluster period. The local timestamp includes the count value of the local second counter and the count value of the local microsecond counter. Each time the time synchronization source is received, the time synchronization processing module calculates the product of the synchronization source period and the local second counter count value, determines whether the product is divisible by a common multiple, and obtains the determination result. The common multiple is based on the synchronization source period, the local microsecond counter period, and... The sampling cluster period is obtained; if the judgment result is negative, then after the current sampling cluster period ends, the sampling cluster data within the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period; if the judgment result is positive, then the local microsecond counter and the sampling cluster timer are cleared to restart counting. After the current sampling cluster period ends, the sampling cluster data within the current sampling cluster period is framed to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared to start the next sampling cluster period; the data frame is uploaded to the remote monitoring module so that the remote monitoring module can restore the data frame into waveform data according to the local timestamp. This embodiment of the invention aligns the local timestamps and sampling cluster periods of each converter by using a unified synchronization source trigger point, and uses a common multiple to solve the synchronization problem of different periodic signals (synchronization source period, local timestamp period, and sampling cluster period), achieving periodic synchronization of multiple converters and ensuring that the local timestamps of each converter are accurately synchronized to the same time reference. Furthermore, the time synchronization module includes an FPGA and an MCU, or is integrated into a single hardware implementation of an FPGA or an MCU.
[0081] This invention also provides an oscilloscope system, which includes an NTP time synchronization server and a time synchronization processing module configured in each converter; the NTP time synchronization server includes a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; the time synchronization processing module includes a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; when the first processor executes the first computer program and the second processor executes the second computer program, they jointly implement an oscilloscope synchronization method for multiple converters; wherein, both the first memory and the second memory include non-volatile storage media and internal memory.
[0082] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a first processor and a second processor to jointly execute an oscilloscope synchronization method for a multi-machine converter.
[0083] The first processor and the second processor provide computing and control capabilities to support the operation of the oscilloscope system; the first memory and the second memory provide an environment for the operation of computer programs in the corresponding non-volatile storage media. When the first computer program and the second computer program are executed by the first processor and the second processor together, an oscilloscope synchronization method for a multi-machine converter is realized.
[0084] It should be understood that, in the embodiments of the present invention, the first processor and the second processor may be a Central Processing Unit (CPU), or they may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0085] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions, is stored in a storage medium, and the storage medium is a computer-readable storage medium. The program instructions are executed by a processor in a computer system to implement the process steps of the embodiments of the above methods.
[0086] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0087] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is merely a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0088] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0089] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.
[0090] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. An oscilloscope synchronization method for a multi-machine converter, characterized by, The method is applied to an oscilloscope system, the oscilloscope system comprising a plurality of transducers, each of the transducers comprising an NTP time synchronization server and a time synchronization processing module, each of the transducers being in communication connection with a remote monitoring module through a switch, and the method comprising: The NTP time synchronization server receives a pulse signal of a satellite and forwards the pulse signal to the time synchronization processing module; The time synchronization processing module synchronizes a local second counter based on the pulse signal as a synchronization source; The time synchronization processing module periodically collects variable data of the oscilloscope in a sampling cluster period to obtain sampling cluster data and collects a local timestamp at a first time point of collecting the variable data in the current sampling cluster period; the local timestamp comprises a count value of the local second counter and a count value of a local microsecond counter; The time synchronization processing module calculates a product of a synchronization source period and the count value of the local second counter each time the synchronization source is received, judges whether the product can be divided by a common multiple, and obtains a judgment result; the common multiple is obtained based on the synchronization source period, the local microsecond counter period and the sampling cluster period; If the judgment result is no, the sampling cluster data in the current sampling cluster period is frame-processed after the current sampling cluster period ends to obtain a data frame with the local timestamp, and a sampling cluster timer is cleared and the next sampling cluster period is started; If the judgment result is yes, the local microsecond counter and the sampling cluster timer are cleared and restarted, the sampling cluster data in the current sampling cluster period is frame-processed after the current sampling cluster period ends to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared and the next sampling cluster period is started; The data frame is uploaded to the remote monitoring module, so that the remote monitoring module restores the data frame into waveform data according to the local timestamp.
2. The oscilloscope synchronization method of a multi-machine converter according to claim 1, characterized in that, The time synchronization processing module periodically collects variable data of the oscilloscope in a sampling cluster period to obtain sampling cluster data and collects a local timestamp at a first time point of collecting the variable data in the current sampling cluster period, comprising: When the interrupt timer starts a new sampling period and reaches a zero point, the interrupt timer generates an interrupt control signal to trigger the time synchronization processing module to synchronously read variable data of the channels of the oscilloscope contained therein to obtain multi-channel sampling cluster data; the sampling cluster period comprises a plurality of sampling periods; After the reading of the multi-channel sampling cluster data is completed, the interrupt control counter is incremented by 1; It is judged whether the interrupt count value is 1; If the interrupt count value is 1, a local timestamp is recorded; the local timestamp is used to mark the generation time of the first sampling point in the current sampling cluster period; When the sampling cluster timer is cleared, the interrupt control counter is cleared.
3. The oscilloscope synchronization method of claim 1, wherein, If the judgment result is yes, the local microsecond counter and the sampling cluster timer are cleared and restarted, the sampling cluster data in the current sampling cluster period is frame-processed after the current sampling cluster period ends to obtain a data frame with the local timestamp, and the sampling cluster timer is cleared and the next sampling cluster period is started, and before the frame processing of the sampling cluster data in the current sampling cluster period to obtain the data frame with the local timestamp, it further comprises: It is judged whether the sampled time length of the current sampling cluster period is related to a preset sampling time length; If the sampled time length of the current sampling cluster period is greater than or equal to the preset sampling time length, the sampling cluster data of the current sampling cluster period is supplemented based on the last collected variable data, the data amount of the current sampling cluster period is supplemented to the data amount of a complete sampling cluster period, and the current sampling cluster period is ended; If the sampled time length of the current sampling cluster period is less than the preset sampling time length, the sampling cluster data of the current sampling cluster period is discarded, and the sampled time length is cleared, and the sampling cluster timer re-ticks the current sampling cluster period until the current sampling cluster period is ended. Or, If the sampled time length of the current sampling cluster period is greater than or equal to the preset sampling time length, the current sampling cluster period is ended, and the variable data collected in the sampled time length is taken as the sampling cluster data of the current sampling cluster period; If the sampled time length of the current sampling cluster period is less than the preset sampling time length, the sampled time length is cleared, the current sampling cluster period is re-ticked, the current sampling cluster period is ended when the ticking of the current sampling cluster period is ended, and the variable data collected in the sampled time length and the variable data collected between the re-ticking of the current sampling cluster period and the ending of the ticking are taken as the sampling cluster data of the current sampling cluster period.
4. The oscilloscope synchronization method of a multi-machine converter according to claim 1, characterized by, The data frame further comprises a sampling cluster sequence number; The sampling cluster data in the current sampling cluster period is framed, comprising: The current sampling cluster sequence number, the sampling cluster data in the current sampling cluster period and a local timestamp are packaged to form a data frame; If the judgment result is no, after the framing, further comprising: The count value of the sampling cluster sequence number is increased by 1; If the judgment result is yes, after the framing, further comprising: The count value of the sampling cluster sequence number is cleared and re-counted; The data frame is uploaded to the remote monitoring module, so that the remote monitoring module aligns the data frame according to the local timestamp and the sampling cluster sequence number, and restores the waveform data.
5. The oscilloscope synchronization method of claim 4, wherein, The on-time processing module adopts a double-buffering ping-pong operation on the sampling cluster data; The on-time processing module periodically collects the variable data of the oscilloscope in the sampling cluster period to obtain the sampling cluster data, comprising: The first buffer in the double-buffering stores the sampling cluster data collected in the current sampling cluster period; After the current sampling cluster period is ended, the logic state of the enable signal is set as valid; The data frame is uploaded to the remote monitoring module, comprising: The on-time processing module detects the logic state of the enable signal in real time by using a sending function; If the logic state of the enable signal is valid, after the sampling cluster data stored in the first buffer in the double-buffering is packaged to form a data frame, the on-time processing module uploads the data frame to the remote monitoring module through a switch; The first buffer packages the sampling cluster data stored therein to form a data frame, and the second buffer in the double-buffering stores the sampling cluster data collected in the newly started sampling cluster period; The first buffer and the second buffer replace each other and cyclically execute the steps of detecting the logic state of the enable signal to storing the sampling cluster data collected in the newly started sampling cluster period.
6. The method of claim 1, wherein, The time synchronization processing module further comprises a backup synchronization source, which generates a backup synchronization pulse with the same period as the satellite pulse signal; The NTP time synchronization server receives the satellite pulse signal and forwards it to the time synchronization processing module, and further comprises: The time synchronization processing module compares whether the pulse signal and the backup synchronization pulse are synchronized at each time the pulse signal is received; If not, the backup synchronization source is controlled to align the backup synchronization pulse with the pulse signal; If the time synchronization processing module detects that the satellite pulse signal disappears, the backup synchronization pulse is used as the synchronization source; If the time synchronization processing module detects that the satellite pulse signal recovers, the satellite pulse signal is used as the synchronization source.
7. The method of claim 1, wherein, The satellite pulse signal comprises a second pulse signal and a time of day (TOD) signal; the time synchronization processing module synchronizes a local second counter based on the synchronization source, comprising: The time synchronization processing module parses the TOD signal to obtain a second field; The second field is synchronized to the local second counter; Or the TOD signal is converted into a total number of seconds; The total number of seconds is synchronized to the local second counter.
8. An oscilloscope system characterized by, The oscilloscope system applies the oscilloscope synchronization method of the multi-machine converter as claimed in any one of claims 1-7, and comprises a plurality of converters, each of which comprises an NTP time synchronization server and a time synchronization processing module, and each of which is in communication connection with a remote monitoring module through a switch; wherein the time synchronization server and the time service satellite are in remote communication connection based on a satellite communication link.
9. An oscilloscope system characterized by, The oscilloscope system comprises an NTP time synchronization server and a time synchronization processing module configured in each converter; The NTP time synchronization server comprises a first memory, a first processor, and a first computer program stored in the first memory and executable on the first processor; The time synchronization processing module comprises a second memory, a second processor, and a second computer program stored in the second memory and executable on the second processor; When the first processor executes the first computer program and the second processor executes the second computer program, the oscilloscope synchronization method of the multi-machine converter as claimed in any one of claims 1-7 is realized.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which comprises program instructions executable by the processor to realize the method as claimed in any one of claims 1-7.
Citation Information
Patent Citations
Converter and time hack method and system of converter
CN104734839A
KR20240086140A