Multi-channel time synchronization method and device, equipment and storage medium

By acquiring and judging the time data of multi-channel sampling equipment, the time synchronization compensation algorithm is used to solve the problem of time inconsistency in multi-channel sampling, and improve the real-time monitoring accuracy and efficiency of the power system.

CN118646529APending Publication Date: 2024-09-13YUNNAN POWER GRID CO LTD ELECTRIC POWER RES INST
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410715439.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-09-13

AI Technical Summary

Technical Problem

In the secondary equipment of the power system, the time delays of each channel are different during multi-channel sampling, resulting in time inconsistency, which reduces the efficiency of real-time monitoring and affects the monitoring and scheduling of line status by the distribution automation master station.

Method used

By obtaining the time data of each sampling channel, the sampling status is determined. If there is a delay status, the preset time synchronization compensation algorithm is used to perform multi-channel time synchronization processing to obtain the first sampling time of each channel.

Benefits of technology

It improves the synchronization of the target sampling time, reduces the inconsistency of the sampling time, and improves the accuracy of real-time detection and the efficiency of status monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118646529A
    Figure CN118646529A
Patent Text Reader

Abstract

The embodiment of the invention discloses a multi-channel time synchronization method and device, equipment and a storage medium. The method comprises the following steps: acquiring time data generated by each current sampling channel in each sampling link; judging the sampling states of the sampling channels according to the time data, and determining the current sampling state of each sampling channel; and if the target sampling channel of which the current sampling state is the delay state exists, performing multi-channel time synchronization processing by using a preset time synchronization compensation algorithm and the time data to obtain the first sampling time of each sampling channel. By means of the method, the situation that the sampling time between the sampling channels is not synchronous can be reduced, the accuracy of real-time detection is improved, and the efficiency of subsequent state monitoring and scheduling is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of time synchronization, and in particular to a multi-channel time synchronization method and a time synchronization device, equipment and storage medium. Background Art

[0002] The secondary equipment of the power system is used for real-time monitoring, evaluation and protection of the line operation status. Taking the distribution terminal as an example, it is necessary to collect the three-phase voltage and three-phase current of the distribution network line in real time online. That is, the secondary equipment of the power system often needs to have multi-channel data collection capabilities. Therefore, multi-channel data sampling chips are usually used in terminal design.

[0003] In engineering applications, there will be time delays in each channel during multi-channel sampling. The degree of delay may be different, resulting in time asynchrony. The time error between different channels reduces the efficiency of real-time monitoring of the terminal and affects the status monitoring and scheduling of the actual operating lines by the distribution automation master station.

[0004] Therefore, it is urgent to reduce the time asynchrony of multiple channels and improve the accuracy of real-time monitoring. Summary of the invention

[0005] The main purpose of the present invention is to provide a multi-channel time synchronization method and a time synchronization device, equipment and storage medium, which can solve the problem of multi-channel time asynchrony in the prior art.

[0006] To achieve the above object, the present invention provides a multi-channel time synchronization method in a first aspect, the method comprising:

[0007] Obtain the time data generated by each sampling channel in each sampling link;

[0008] Judging the sampling state of the sampling channels according to the time data, and determining the current sampling state of each sampling channel;

[0009] If there is a target sampling channel whose current sampling state is a delayed state, a multi-channel time synchronization process is performed using a preset time synchronization compensation algorithm and the time data to obtain a first sampling time for each of the sampling channels.

[0010] In a feasible implementation, the sampling link includes at least a first link of sampling triggering, and the time data includes at least a sampling triggering duration of the first link;

[0011] Then judging the sampling state of the sampling channels according to the time data to determine the current sampling state of each sampling channel includes:

[0012] If the sampling trigger duration is greater than a preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delay state.

[0013] In a feasible implementation, the sampling link further includes a second link of sampling response, and the time data further includes the sampling response duration of the second link;

[0014] Then judging the sampling state of the sampling channels according to the time data to determine the current sampling state of each sampling channel includes:

[0015] If the sampling response time is greater than a preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delay state.

[0016] In a feasible implementation, the time data also includes the sub-sampling triggering duration in the first stage and the sub-sampling response duration in the second stage of each data point collected in the current collection cycle;

[0017] Then the multi-channel time synchronization processing is performed using the preset time synchronization compensation algorithm and the time data to obtain the first sampling time of each sampling channel, including:

[0018] Determine the total number of data points collected in the current collection period;

[0019] Based on the total number, the sub-sampling trigger duration of each data point and a preset optimization algorithm, a first time compensation value is obtained; and based on the total number, the sub-sampling response duration of each data point and a preset optimization algorithm, a second time compensation value is obtained;

[0020] The first sampling time of each of the sampling channels is obtained according to the first time compensation value, the second time compensation value and a preset time synchronization compensation algorithm.

[0021] In a feasible implementation, the time synchronization compensation algorithm includes the following mathematical expression:

[0022]

[0023] Where M is the number of matrix rows, t (i) is the target sampling time of the i-th sampling channel; t pps(i) is the third timestamp when the pulse-per-second signal of the i-th sampling channel is sent, N is the total number of data points in the current sampling period, is the sub-sampling trigger duration of the nth data point of the i-th data acquisition channel, is the subsampling response time of the nth data point of the ith data acquisition channel.

[0024] In a feasible implementation, the method further includes:

[0025] If the current sampling states of the acquisition channels are all non-delayed states, the second sampling time of the acquisition channels is obtained based on the time data, and the step of obtaining the time data generated by the current sampling channels in each sampling link is returned to be executed.

[0026] In a feasible implementation, the step of obtaining the time data generated by each current sampling channel in each sampling link includes:

[0027] When receiving a second pulse signal, trigger each sampling channel to perform data sampling, and obtain a data sampling result returned by each sampling channel, wherein the data sampling result includes a first timestamp of the actual trigger and a second timestamp of the data output, and the second pulse signal carries a third timestamp when the second pulse signal is sent;

[0028] Determine the sampling triggering duration of the first link of each of the sampling channels based on the first timestamp and the third timestamp;

[0029] Based on the first timestamp and the second timestamp, a sampling response duration of the second link of each of the sampling channels is determined.

[0030] To achieve the above object, the second aspect of the present invention provides a multi-channel time synchronization device, the device comprising:

[0031] Data acquisition module: used to obtain the time data generated by each sampling channel in each sampling link;

[0032] A state judgment module is used to judge the sampling state of the sampling channel according to the time data, and determine the current sampling state of each sampling channel;

[0033] The time determination module is used to perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and the time data if there is a target sampling channel whose current sampling state is a delayed state, so as to obtain the first sampling time of each sampling channel.

[0034] To achieve the above-mentioned purpose, the third aspect of the present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the steps shown in the first aspect and any feasible implementation method.

[0035] To achieve the above-mentioned purpose, the fourth aspect of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps shown in the first aspect and any feasible implementation method.

[0036] The embodiments of the present invention have the following beneficial effects:

[0037] The present invention provides a multi-channel time synchronization method, the method comprising: obtaining the time data generated by each current sampling channel in each sampling link; judging the sampling state of the sampling channel according to the time data, and determining the current sampling state of each sampling channel; if there is a target sampling channel whose current sampling state is a delayed state, multi-channel time synchronization processing is performed using a preset time synchronization compensation algorithm and time data to obtain the first sampling time of each sampling channel. Through the above method, the sampling state can be judged in combination with the time data generated by each sampling channel in each sampling link, and the probability of the delayed state of the target sampling channel being discovered is increased. Then, when there is a target sampling channel in a delayed state, multi-channel time synchronization processing is performed using a preset time synchronization compensation algorithm and time data, so as to obtain the processed first sampling time, so that the target sampling time can be synchronized, the situation of sampling time asynchronism is reduced, the accuracy of real-time detection is improved, and the efficiency of subsequent state monitoring and scheduling is facilitated. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0039] in:

[0040] Figure 1 A flowchart of a multi-channel time synchronization method according to an embodiment of the present invention;

[0041] Figure 2 Another flow chart of a multi-channel time synchronization method according to an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of logic control of a multi-channel time synchronization method in an embodiment of the present invention;

[0043] Figure 4 is another flow chart of a multi-channel time synchronization method in an embodiment of the present invention;

[0044] Figure 5 It is a structural block diagram of a multi-channel time synchronization device in an embodiment of the present invention;

[0045] Figure 6 4 is a structural block diagram of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0047] See also Figure 1 , Figure 1 FIG. 1 is a flow chart of a multi-channel time synchronization method according to an embodiment of the present invention. Figure 1 The method shown can be applied to both a terminal and a server. The terminal can be a desktop terminal or a mobile terminal. The mobile terminal can be at least one of a mobile phone, a tablet computer, a laptop computer, etc. The server can be implemented by an independent server or a server cluster composed of multiple servers. This embodiment is described by applying to a terminal as an example. Figure 1 The method shown comprises the following steps:

[0048] It should be noted that when the present embodiment is applied to the technical field of power systems, the above-mentioned terminal may be a secondary device of the power system, and the secondary device of the power system often needs to have multi-channel data acquisition capabilities, that is, the ability to simultaneously collect multiple channels of data. The types of data collected by different channels may be the same or different, and are not limited here. The data types include three-phase voltage, three-phase current, zero-sequence voltage, zero-sequence current, and other types of vector data related to power operation, which can be selected according to actual needs and are not exhaustively listed here. For example, if eight types of data, "three-phase voltage, three-phase current, zero-sequence voltage, and zero-sequence current", are to be collected simultaneously, then eight sampling channels are required, that is, the number of multi-channel channels is eight.

[0049] Among them, each sampling channel is often composed of multiple sampling links in the data sampling process. Taking the multi-data acquisition channel of analog-to-digital conversion (hereinafter referred to as the multi-channel AD chip) as an example, if you want to start data acquisition, there will first be a first link of sampling triggering, notifying the multi-channel AD chip to start the acquisition work. Taking Beidou timing as an example, the Beidou timing module is connected to the terminal with a multi-channel AD chip through the UART serial port to output the PPS second pulse signal. For example, Beidou sends the time to the MCU of the terminal through the UART serial port. After PPS reaches this time, it will send a pulse, usually 1 pulse per second, and notify the multi-channel AD chip in this way that data acquisition can start; further, after completing the trigger, the multi-channel AD chip will start data acquisition, and then come to the next sampling link: the sampling response link, that is, the second link of the sampling response. It can be understood that each AD sampling channel in the multi-channel AD chip has a sampling response process from analog signal to digital signal, so as to complete data acquisition. Among them, the above two links are only given as examples and are not specifically limited. If the sampling accuracy of the data is higher, more sophisticated sampling links can also be set, such as adding filtering links, amplification links, etc. This application is not exhaustive here.

[0050] From the above examples, it can be seen that a complete sampling cycle involves a variety of sampling links, and there may be delays in each sampling link. For example, the conversion response time between different channels is different, and there is a delay between the sampling data input time and the sampling data output time, which is usually at the microsecond (μs) level. In the application scenario of high-speed information processing, the time error between different channels reduces the efficiency of real-time monitoring of the terminal and affects the status monitoring and scheduling of the actual operating lines by the distribution automation master station.

[0051] This application studies a high-precision multi-channel vector sampling data time synchronization method. Taking Beidou timing as an example, the PPS signal of the Beidou timing module is used as a benchmark for illustration. The vectorized data sampling time compensation algorithm of each channel is used to achieve absolute time synchronization between the data of each channel, thereby improving data processing efficiency and real-time performance of terminal online monitoring. Please refer to the following content for details.

[0052] 101. Obtain the time data generated by each current sampling channel in each sampling link;

[0053] It should be noted that the MCU can obtain the time data generated by each sampling channel in each sampling link in real time. The acquisition method includes but is not limited to the AD chip actively reporting or the MCU actively requesting to obtain data, etc., wherein the time data can reflect the time consumed by each sampling link, and the time data may include the time consumed by each link, and may also include the start time and end time of each link. Taking the sampling link including the above-mentioned first link and second link as an example, the time data may include the sampling trigger duration of the sampling trigger link and the sampling response duration of the sampling response link, and may also include the first timestamp that actually triggers each channel to start sampling, the second timestamp of data output, and the third timestamp when the sampling trigger signal is issued, wherein the time difference between the first timestamp and the second timestamp is equivalent to the sampling response duration, and the time difference between the second timestamp and the third timestamp is equivalent to the sampling trigger duration, wherein, when the sampling trigger signal is a pulse per second signal (PPS), the third timestamp is the PPS moment.

[0054] 102. Judging the sampling state of the sampling channel according to the time data, and determining the current sampling state of each sampling channel;

[0055] Furthermore, after obtaining the current time data, the sampling state of the sampling channel can be judged based on the time data to obtain the current sampling state of each sampling channel, where the sampling state is used to reflect whether there is a delay in the sampling of the sampling channel, and the sampling state includes a delayed state and a non-delayed state.

[0056] 103. If there is a target sampling channel whose current sampling state is a delayed state, perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and the time data to obtain a first sampling time of each of the sampling channels.

[0057] Furthermore, if the current sampling state of any channel is a delayed state, it means that there will be a time asynchronism problem between the channel and other channels. Therefore, if there is a target sampling channel whose current sampling state is delayed, the target sampling channel may be one or more. At this time, the preset time synchronization compensation algorithm and time data are used to perform multi-channel time synchronization processing to obtain the first sampling time of each sampling channel, wherein the first sampling time is the sampling time after time synchronization. After the multi-channel time synchronization processing, the first sampling time of each sampling channel is synchronized. It can be understood that the sampling time is a time interval, including the start and end of sampling. For example, taking the AD chip as an example, the sampling time can be the time required to convert the analog signal into a digital signal.

[0058] It is understandable that, in the real-time monitoring process, if the current sampling state of each acquisition channel is a non-delayed state, time synchronization is not required, and the second sampling time of each acquisition channel can be obtained based on each time data, and the step of obtaining the time data generated by each current sampling channel in each sampling link can be returned to execute. For example, the sampling response duration in the time data is used as the sampling time of each channel to obtain the second sampling time, or the time interval formed by the sampling start timestamp and end timestamp reported by each channel is directly used as the second sampling time, which is not limited here.

[0059] The present invention provides a multi-channel time synchronization method, the method comprising: obtaining the time data generated by each current sampling channel in each sampling link; judging the sampling state of the sampling channel according to the time data, and determining the current sampling state of each sampling channel; if there is a target sampling channel whose current sampling state is a delayed state, multi-channel time synchronization processing is performed using a preset time synchronization compensation algorithm and time data to obtain the first sampling time of each sampling channel. Through the above method, the sampling state can be judged in combination with the time data generated by each sampling channel in each sampling link, and the probability of the delayed state of the target sampling channel being discovered is increased. Then, when there is a target sampling channel in a delayed state, multi-channel time synchronization processing is performed using a preset time synchronization compensation algorithm and time data, so as to obtain the processed first sampling time, so that the target sampling time can be synchronized, the situation of sampling time asynchronism is reduced, the accuracy of real-time detection is improved, and the efficiency of subsequent state monitoring and scheduling is facilitated.

[0060] See also Figure 2 , Figure 2 FIG. 4 is another flow chart of a multi-channel time synchronization method according to an embodiment of the present invention. Figure 2 The method shown comprises the following steps:

[0061] 201. Obtain the time data generated by each current sampling channel in each sampling link;

[0062] It should be noted that step 201 and Figure 1 The contents of step 101 are similar, and are not described here to avoid repetition. Figure 1 The content of step 101 is shown.

[0063] In a feasible implementation, in order to further improve the time accuracy, the present application adopts Beidou timing to perform time synchronization with more accurate time. Therefore, step 201 may include the following steps A01 to A03:

[0064] A01. When receiving a second pulse signal, trigger each sampling channel to perform data sampling, and obtain the data sampling results returned by each sampling channel, wherein the data sampling results include a first timestamp of the actual trigger and a second timestamp of the data output, and the second pulse signal carries a third timestamp when the second pulse signal is sent;

[0065] A02. Determine the sampling trigger duration of the first link of each sampling channel based on the first timestamp and the third timestamp;

[0066] A03. Determine the sampling response duration of the second link of each sampling channel based on the first timestamp and the second timestamp.

[0067] It should be noted that when the MCU receives the pulse-per-second signal (PPS signal), it will trigger each AD chip to perform data sampling, and each sampling channel will report the data sampling results to the MCU in real time. The MCU can obtain the data sampling results returned by each sampling channel, and the data sampling results include sampling data and sampling time data, wherein the sampling time data may include the first timestamp of the actual trigger and the second timestamp of the data output, and the pulse-per-second signal carries the third timestamp when the pulse-per-second signal is sent. Further, the time data of each sampling link can be obtained based on each timestamp.

[0068] 202. If the sampling trigger duration is greater than a preset time difference threshold, determining that the current sampling state of the sampling channel is a delay state;

[0069] Furthermore, the sampling link at least includes a first link of sampling triggering, and the time data at least includes the sampling triggering duration t of the first link. chan Therefore, judging the sampling state of the sampling channel according to the time data and determining the current sampling state of each sampling channel may include the above step 202, that is, through the sampling triggering time t of the first link chan To determine the current sampling state, if the sampling trigger time t chan If the preset time difference threshold is greater than the preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delayed state. The preset time difference threshold can be 0 or the like, which can mark the time difference of the non-delayed state. For example, the third timestamp t pps Theoretically and actually triggered first timestamp t AS If the first link is not delayed, it can be determined whether the second link is delayed, and no matter which link is delayed, time synchronization will be performed through step 203.

[0070] In a feasible implementation, the sampling link also includes a second link of sampling response, and the time data also includes the sampling response duration of the second link; therefore, the sampling state of the sampling channel is judged according to the time data to determine the current sampling state of each sampling channel, and it can also include: B01, if the sampling response duration is greater than a preset time difference threshold, then determine that the current sampling state of the sampling channel is a delayed state.

[0071] Furthermore, the sampling link may further include a second link of sampling response, and the time data at least includes the sampling response time length t of the second link. res , t res It can be regarded as the sampling channel response time, which is the sampling response time t of the second link of step B01. res To determine the current sampling state, if the sampling response time t res If the time difference is greater than the preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delayed state. The preset time difference threshold can be 0 or the like, which can mark the time difference of the non-delayed state. For example, the preset time difference threshold is 0, and the sampling response time t res Theoretically, it should be zero. In engineering applications, AD multi-channel sampling has a response time difference from analog signal to digital signal. This response time difference is the actual sampling response time t res , and the conversion response time between different channels is different. There is a delay between the sampling data input time and the sampling data output time, usually at the μs level, which will cause the sampling response time t res is not 0, therefore, if the sampling response time t res If it is not zero, it means that there is a delay and it is necessary to execute step 203 to perform time synchronization.

[0072] Here’s how it works:

[0073] Assume that the PPS pulse time of the current Beidou timing module is t pps , the trigger time of AD sampling channel is t AS(i) , the output time of the AD sampling channel is t DS(i) , i is the current channel identifier, and T is the sampling period.

[0074] Sampling channel response time (Δt res(i) ) is shown in formula (1):

[0075] Δt res(i) =t DS(i) -t AS(i) (1)

[0076] In the formula, Δt res(i)is the AD vector sampling channel response time; t DS(i) is the digital signal output time of the AD sampling channel; t AS(i) It is the trigger time for AD vector sampling analog signal acquisition.

[0077] The vectorized multi-channel analog sampling trigger time error is shown in formula (2):

[0078] Δt chan(i) =t AS(i) -t pps (2)

[0079] In the formula, Δt chan(i) is the time error between the actual trigger time of the vectorized analog quantity and the Beidou timing PPS second pulse; t pps It is the second pulse time sent by the Beidou timing module (with an accuracy of ns).

[0080] In the above multi-channel vector sampling, in order to achieve absolute sampling time synchronization of each channel vector value, under ideal conditions: Δt res(i) =0,Δt chan(i) =0, but the AD sampling channel response time Δt res(i) Affected by the performance of the chip itself, it can be checked in the chip manual and is usually in the μs level.

[0081] Furthermore, the two links can be judged at the same time. If any judgment result of the same channel is a delayed state, step 203 will be executed to perform multi-channel time synchronization. The two links can also be judged in sequence. If there is a delay in any link, multi-channel synchronization will be performed. This application does not limit this.

[0082] 203. If there is a target sampling channel whose current sampling state is a delayed state, perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and the time data to obtain a first sampling time of each of the sampling channels.

[0083] It should be noted that step 203 and Figure 1 The contents of step 103 are similar, and are not described here to avoid repetition. Figure 1 The content of step 103 is shown.

[0084] In order to further improve the accuracy of multi-channel synchronization, multi-channel synchronization can also be performed in combination with the time information of each data point in the collected data, wherein the time data also includes the sub-sampling trigger duration of each data point collected in the current collection cycle in the first link and the sub-sampling response duration in the second link. Multi-channel time synchronization processing is performed using a preset time synchronization compensation algorithm and the time data to obtain the first sampling time of each sampling channel, including the following steps C01 to:

[0085] C01, determining the total number of data points collected in the current collection cycle;

[0086] C02, based on the total number, the sub-sampling trigger duration of each data point and a preset optimization algorithm, obtaining a first time compensation value; and based on the total number, the sub-sampling response duration of each data point and a preset optimization algorithm, obtaining a second time compensation value;

[0087] C03. Obtaining a first sampling time of each of the sampling channels according to the first time compensation value, the second time compensation value and a preset time synchronization compensation algorithm.

[0088] It should be noted that the total number N of data points n collected within the current collection period T is determined; based on the total number N and the sub-sampling trigger duration of each data point n and a preset optimization algorithm to obtain a first time compensation value; and a sub-sampling response time based on the total number N and each data point n and a preset optimization algorithm to obtain a second time compensation value; and according to the first time compensation value, the second time compensation value and the preset time synchronization compensation algorithm, obtain the first sampling time value of each sampling channel. Among them, the preset optimization algorithm is an average value algorithm, and the first time compensation value can be N sub-sampling trigger durations. The second time compensation value can be the average value of N sub-sampling response time. The average value of .

[0089] In a feasible implementation, the time synchronization compensation algorithm includes the following mathematical expression:

[0090]

[0091] Where M is the number of matrix rows, t (i) is the target sampling time of the i-th sampling channel; t pps(i) is the third timestamp when the pulse-per-second signal of the i-th sampling channel is sent, N is the total number of data points in the current sampling period, n=1,2,3,...,N, is the sub-sampling trigger duration of the nth data point of the i-th data acquisition channel, is the subsampling response time of the nth data point of the ith data acquisition channel.

[0092] The present invention provides a multi-channel time synchronization method and proposes a time synchronization algorithm for multi-channel vectorized sampling. The pps second pulse signal of the Beidou module is used as a module to align the analog quantity sampling time. The actual trigger sampling time error and the channel response time error of the channel are improved by a time compensation algorithm, so as to realize the absolute time synchronization of the sampling of the vector values ​​of each channel. The principle is simple and the precision is high.

[0093] See also Figure 3 , Figure 3 FIG. 1 is a logic control diagram of a multi-channel time synchronization method in an embodiment of the present invention. For further information, please refer to Figure 4 , Figure 4 is another flow chart of a multi-channel time synchronization method in an embodiment of the present invention, Figure 4 Can be seen as Figure 3 Schematic diagram of the flow chart corresponding to the logic control, Figure 4 include:

[0094] 401. Initialize sampling channel;

[0095] 402. Accept the PPS pulse and trigger analog quantity sampling;

[0096] 403. Determine the actual sampling trigger time t of the channel AS(i) ;

[0097] 404. Determine the sampling trigger duration Δt chan(i) Is it not equal to 0: Δt chan(i) ≠0? If yes, go to step 407, if no, go to step 405;

[0098] 405, AD sampling channel data output time t DS(i) ;

[0099] 406. Determine the sampling response time Δt res(i) Is it not equal to 0: Δt res(i) ≠0? If yes, go to step 407, if no, go to step 408;

[0100] 407. Execute a sampling time synchronization compensation algorithm, that is, use the above formula (3) to perform multi-channel time synchronization;

[0101] 408. Multi-channel vectorized sampling time synchronization.

[0102] The present invention provides a multi-channel time synchronization method and proposes a multi-channel vector sampling time synchronization algorithm, including: initializing the sampling channel; receiving the PPS second pulse to trigger analog quantity sampling; judging the actual channel sampling trigger time t AS(i) ; Determine the sampling trigger duration Δt chan(i)Is it not equal to 0? If so, execute the sampling time synchronization compensation algorithm, otherwise the AD sampling channel data output time t DS(i) ; Determine the sampling response time Δt res(i) Is it not equal to 0? If yes, the sampling time synchronization compensation algorithm is executed. If not, the multi-channel vectorized sampling time synchronization is performed, that is, the analog sampling time is aligned based on the pps pulse signal of the Beidou module. The actual trigger sampling time error and channel response time error of the channel are improved through the time compensation algorithm, and the absolute time synchronization of the sampling of each channel vector value is achieved. The principle is simple and the accuracy is high.

[0103] See also Figure 5 , Figure 5 FIG. 1 is a structural block diagram of a multi-channel time synchronization device according to an embodiment of the present invention. Figure 5 The device shown comprises the following steps:

[0104] Data acquisition module 501: used to acquire the time data generated by each current sampling channel in each sampling link;

[0105] The state judgment module 502 is used to judge the sampling state of the sampling channel according to the time data, and determine the current sampling state of each sampling channel;

[0106] The time determination module 503 is used to perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and the time data if there is a target sampling channel whose current sampling state is a delayed state, so as to obtain the first sampling time of each sampling channel.

[0107] It should be noted that Figure 5 The functions of each module in the device shown are Figure 1 The contents of each step in the method shown are similar, so they are not described here to avoid repetition. For details, please refer to Figure 1 The content of each step in the method shown.

[0108] The present invention provides a multi-channel time synchronization device, the device includes: a data acquisition module: used to acquire the time data generated by each current sampling channel in each sampling link; a state judgment module: used to judge the sampling state of the sampling channel according to the time data, and determine the current sampling state of each sampling channel; a time determination module: used to perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and time data if there is a target sampling channel whose current sampling state is a delayed state, and obtain the first sampling time of each sampling channel. Through the above device, the sampling state can be judged in combination with the time data generated by each sampling channel in each sampling link, and the probability of the delayed state of the target sampling channel being discovered is increased. Then, when there is a target sampling channel in a delayed state, the multi-channel time synchronization processing is performed using the preset time synchronization compensation algorithm and time data, so as to obtain the processed first sampling time, so that the target sampling time can be synchronized, the situation of sampling time asynchronism is reduced, the accuracy of real-time detection is improved, and the efficiency of subsequent state monitoring and scheduling is beneficial.

[0109] Figure 6 FIG. 1 shows an internal structure diagram of a computer device in an embodiment. The computer device may be a terminal or a server. Figure 6 As shown, the computer device includes a processor, a memory and a network interface connected via a system bus. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can implement the above method. Those skilled in the art can understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0110] In one embodiment, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps: Figure 1 , 2 , the steps of the method shown in 4.

[0111] In one embodiment, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the processor performs the following steps: Figure 1 , 2 , the steps of the method shown in 4.

[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0113] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0114] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A multi-channel time synchronization method, characterized in that: The method comprises: Obtain the time data generated by each sampling channel in each sampling link; Judging the sampling state of the sampling channels according to the time data, and determining the current sampling state of each sampling channel; If there is a target sampling channel whose current sampling state is a delayed state, a multi-channel time synchronization process is performed using a preset time synchronization compensation algorithm and the time data to obtain a first sampling time for each of the sampling channels.

2. The method according to claim 1, characterized in that: The sampling link at least includes a first link of sampling triggering, and the time data at least includes a sampling triggering duration of the first link; Then judging the sampling state of the sampling channels according to the time data to determine the current sampling state of each sampling channel includes: If the sampling trigger duration is greater than a preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delay state.

3. The method according to claim 2, characterized in that: The sampling link also includes a second link of sampling response, and the time data also includes the sampling response duration of the second link; Then judging the sampling state of the sampling channels according to the time data to determine the current sampling state of each sampling channel includes: If the sampling response time is greater than a preset time difference threshold, it is determined that the current sampling state of the sampling channel is a delay state.

4. The method according to claim 1, characterized in that: The time data also includes the sub-sampling triggering duration of each data point collected in the current collection cycle in the first link and the sub-sampling response duration in the second link; Then the multi-channel time synchronization processing is performed using the preset time synchronization compensation algorithm and the time data to obtain the first sampling time of each sampling channel, including: Determine the total number of data points collected in the current collection period; Based on the total number, the sub-sampling trigger duration of each data point and a preset optimization algorithm, a first time compensation value is obtained; and based on the total number, the sub-sampling response duration of each data point and a preset optimization algorithm, a second time compensation value is obtained; The first sampling time of each of the sampling channels is obtained according to the first time compensation value, the second time compensation value and a preset time synchronization compensation algorithm.

5. The method according to claim 4, characterized in that: The time synchronization compensation algorithm includes the following mathematical expression: Where M is the number of matrix rows, t (i) is the target sampling time of the i-th sampling channel; t pps (i) is the third timestamp when the pulse-per-second signal of the i-th sampling channel is sent, N is the total number of data points in the current sampling period, is the sub-sampling trigger duration of the nth data point of the i-th data acquisition channel, is the subsampling response time of the nth data point of the ith data acquisition channel.

6. The method according to claim 1, characterized in that: The method further comprises: If the current sampling states of the acquisition channels are all non-delayed states, the second sampling time of the acquisition channels is obtained based on the time data, and the step of obtaining the time data generated by the current sampling channels in each sampling link is returned to be executed.

7. The method according to claim 3, characterized in that: The obtaining of the time data generated by each current sampling channel in each sampling link includes: When receiving a second pulse signal, trigger each sampling channel to perform data sampling, and obtain a data sampling result returned by each sampling channel, wherein the data sampling result includes a first timestamp of the actual trigger and a second timestamp of the data output, and the second pulse signal carries a third timestamp when the second pulse signal is sent; Determine the sampling triggering duration of the first link of each of the sampling channels based on the first timestamp and the third timestamp; Based on the first timestamp and the second timestamp, a sampling response duration of the second link of each of the sampling channels is determined.

8. A multi-channel time synchronization device, characterized in that: The device comprises: Data acquisition module: used to obtain the time data generated by each sampling channel in each sampling link; A state judgment module is used to judge the sampling state of the sampling channel according to the time data, and determine the current sampling state of each sampling channel; The time determination module is used to perform multi-channel time synchronization processing using a preset time synchronization compensation algorithm and the time data if there is a target sampling channel whose current sampling state is a delayed state, so as to obtain the first sampling time of each sampling channel.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

10. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Multi-channel signal sampling synchronization method based on distributed signal transceiver

    CN120750505A