A processing method for time series data based on radians
By converting the time series of spacecraft measurement and control data into a radian sequence, compressing and augmenting, and using dynamic time regularization algorithm to perform similarity measurement, the problem of traditional methods being unable to deal with asynchronous time series and low computing efficiency is solved, and efficient and real-time similarity measurement is achieved.
Patent Information
- Application Number
- CN202310143225.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-08
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2043-02-08
AI Technical Summary
The traditional European distance similarity measurement method cannot handle the problem of different historical data and real-time data sampling points and data lengths. Although the DTW algorithm can solve this problem, it cannot meet the real-time requirements of measurement and control data processing due to its high time complexity.
A time series data processing method based on radians is proposed. By converting real-time time series and historical time series into radians, it is compressed and expanded, and the optimal path is determined using dynamic time regularization algorithm to generate target radians to achieve similarity measurement.
Without reducing the accuracy, the calculation rate of the DTW algorithm is significantly improved, the real-time requirements of measurement and control data processing are met, and asynchronous measurement is implemented, solving the problem of insufficient measurement results caused by time series stretching offset.
Smart Images

Figure CN116361355B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data processing, and in particular, to a method for processing time series data based on radians. Background Art
[0002] Spacecraft TT&C data is an important basis for the ground control system to judge the operating state of the spacecraft and ensure the on-orbit reliability and safe and reliable operation of the spacecraft. Most TT&C data changes over time. By using data mining methods to analyze time series data, the dynamic characteristics in TT&C data can be captured. The TT&C data in similar mission models has extremely strong correlations. By using time series similarity measurement methods, the real-time data and historical data in TT&C data can be compared, and then on the basis of effectively detecting anomalies, the system state can be diagnosed in real time, which can help to control the spacecraft safely in time and reduce the damage caused by faults.
[0003] The traditional Euclidean distance similarity measurement method requires the complete matching of time series, and cannot handle the problems of different sampling points and data lengths between historical data and real-time data, and cannot realize the asynchronous correlation comparison of time series. The currently commonly used DTW algorithm has the characteristic of strong robustness to time series offset. Although it can solve the above problems, because this method finds the optimal path based on dynamic programming, the time complexity is very high and cannot meet the real-time requirements of TT&C data processing. Improving the calculation rate of DTW without reducing the accuracy is a problem to be solved at present. Summary of the Invention
[0004] In view of this, the purpose of the present application is to provide a method for processing time series data based on radians to improve the calculation rate of DTW without reducing the accuracy.
[0005] In a first aspect, the present application provides a method for processing time series data based on radians. The method includes: Step 1, respectively obtaining a real-time time series and a historical time series generated by a target spacecraft. Each time series includes a plurality of data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of target parameters when the target spacecraft executes tasks; Step 2, for each of the real-time time series and the historical time series, traversing and calculating the radian values between adjacent data variables in the time series to convert the real-time time series into a real-time radian series and the historical time series into a historical radian series; Step 3, compressing the real-time radian series to generate a real-time compressed radian series, and compressing the historical radian series to generate a historical compressed radian series; Step 4, based on the dynamic time warping algorithm, determining the best path between the real-time compressed radian series and the historical compressed radian series, and the best path is used to indicate the best matching relationship between each moment in the real-time compressed radian series and the historical compressed radian series; Step 5, based on the best path, simultaneously expanding the real-time compressed radian series and the historical compressed radian series to correspondingly generate a real-time target radian series and a historical target radian series, and the lengths of the real-time target radian series and the historical target radian series are equal; Step 6, calculating the similarity between the real-time target radian series and multiple historical target radian series, and determining at least one historical target radian series that matches the real-time target radian series for analyzing the target parameters of the target spacecraft.
[0006] Preferably, in Step 3, each radian series is compressed in the following manner: sequentially calculating the difference between adjacent radian values according to the acquisition time, and accumulating and summing the differences; when the cumulative radian difference is greater than a preset value, recording the time corresponding to the most recently accumulated difference and its corresponding radian value, clearing the current cumulative radian difference, and restarting the accumulation and summation from the next difference until all differences are traversed; recording the last time in the time series and its corresponding radian value, and taking all the recorded times and their corresponding radian values as the corresponding compressed radian series.
[0007] Preferably, in step five, the following method is used for expansion to generate a real-time target radian sequence and a historical target radian sequence: According to the acquisition times corresponding to the real-time compressed radian sequence and the historical compressed radian sequence in the optimal path, a real-time time sequence and a historical time sequence are respectively constructed; the real-time time sequence and the historical time sequence are traversed simultaneously. For two adjacent first acquisition times in the real-time time sequence and two corresponding adjacent second acquisition times in the historical time sequence in the same order, it is determined whether the expansion condition is satisfied. If the expansion condition is satisfied, an equal number of missing times are filled simultaneously between the two adjacent first acquisition times and the two adjacent second acquisition times; for each time in the real-time time sequence and the historical time sequence, based on the corresponding real-time radian sequence or historical radian sequence, the corresponding radian value is determined and associated to generate a real-time target radian sequence and a historical target radian sequence.
[0008] Preferably, the following method is used to determine whether the expansion condition is satisfied: Determine whether the difference between two adjacent first acquisition times is greater than 1, and determine whether the difference between two adjacent second acquisition times is greater than 1; if it is determined that at least one of the differences is greater than 1, it is determined that the expansion condition is satisfied; if it is determined that all differences are not greater than 1, it is determined that the expansion condition is not satisfied.
[0009] Preferably, after it is determined that the expansion condition is satisfied, the following method is used to determine the number of missing times: Compare the difference between two adjacent first acquisition times with the difference between two adjacent second acquisition times; if the difference between two adjacent first acquisition times is greater than the difference between two adjacent second acquisition times, subtract 1 from the difference between two adjacent first acquisition times as the number of missing times, otherwise, subtract 1 from the difference between two adjacent second acquisition times as the number of missing times.
[0010] Preferably, after the expansion condition is satisfied, the following method is used to fill in the missing times: Take the two adjacent acquisition times with the larger difference between the two adjacent first acquisition times and the two adjacent second acquisition times as the first target acquisition time pair, and the other two adjacent acquisition times as the second target acquisition time pair. For the first target acquisition time pair, fill in the missing times in the order of increasing acquisition time; for the second target acquisition time pair, determine whether the difference between the two acquisition times in the second target acquisition time pair is less than the difference between the two acquisition times in the first target acquisition time pair. If so, first fill in the preset missing times in the order of increasing acquisition time, and then fill in the remaining missing times by copying. If not, fill in all the missing times in the order of increasing acquisition time.
[0011] Preferably, in step two, for each time series, the radian value between adjacent data variables in the time series is calculated in the following manner: respectively determine the first data variable and the second data variable adjacent in time in the time series, where the time corresponding to the second data variable is after the time corresponding to the first data variable; calculate the difference between the second data variable and the first data variable; calculate the value of the arctangent function corresponding to the difference as the radian value between the second data variable and the first data variable.
[0012] In a second aspect, the present application provides a processing device for time series data based on radians. The device includes:
[0013] An acquisition module, configured to respectively acquire a real-time time series and a historical time series generated by a target spacecraft. Each time series includes a plurality of data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of target parameters when the target spacecraft executes tasks;
[0014] A conversion module, configured to traverse and calculate the radian value between adjacent data variables in each of the real-time time series and the historical time series, so as to convert the real-time time series into a real-time radian sequence and the historical time series into a historical radian sequence;
[0015] A compression module, configured to compress the real-time radian sequence to generate a real-time compressed radian sequence, and compress the historical radian sequence to generate a historical compressed radian sequence;
[0016] A matching module, configured to determine the best path between the real-time compressed radian sequence and the historical compressed radian sequence based on the dynamic time warping algorithm, and the best path is used to indicate the best matching relationship between each moment in the real-time compressed radian sequence and the historical compressed radian sequence;
[0017] An expansion module, configured to simultaneously expand the real-time compressed radian sequence and the historical compressed radian sequence based on the best path to correspondingly generate a real-time target radian sequence and a historical target radian sequence, and the lengths of the real-time target radian sequence and the historical target radian sequence are equal;
[0018] An output module, configured to calculate the similarity between the real-time target radian sequence and multiple historical target radian sequences, and determine at least one historical target radian sequence that matches the real-time target radian sequence for analyzing the target parameters of the target spacecraft.
[0019] In a third aspect, the present application also provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the above-described method for processing time series data based on radians are performed.
[0020] In a fourth aspect, the present application also provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the above-described method for processing time series data based on radians are performed.
[0021] The processing of time series data based on radians provided by the present application converts the original data into radian time series data that can better reflect the data characteristics, compresses the time series using the cumulative radian difference, reduces the data dimension, and significantly reduces the subsequent operation time while ensuring the measurement accuracy, reduces the consumption of system resources, and improves the efficiency of similarity measurement. Then, the time dynamic programming algorithm is used to find the optimal matching path for the dimensionality-reduced time series data, and an improved moment alignment method is proposed to fill in the missing moments of the compressed sequence according to this path, so that the lengths of the compressed sequences are equal, and a fast and efficient radian distance calculation is performed. At the same time, since the path found by using dynamic time warping breaks through the real-time limit, compared with the original sequence, the matching relationship of the sequence filled in based on this path is more reasonable, and asynchronous measurement can be achieved, solving the problem that the measurement result is not accurate enough due to the stretching and offset of the time series.
[0022] To make the above objects, features, and advantages of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, provides a detailed description as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.
[0024] Figure 1 It is a flowchart of a method for processing time series data based on radians provided by an embodiment of the present application;
[0025] Figure 2 It is a flowchart of steps for calculating radian values provided by an embodiment of the present application;
[0026] Figure 3 It is a flowchart of calibrating software refresh provided by an embodiment of the present application;
[0027] Figure 4 It is a schematic structural diagram of a processing device for time series data based on radian provided by an embodiment of the present application;
[0028] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Specific embodiments
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Usually, the components of the embodiments of the present application described and illustrated herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by those skilled in the art without creative efforts belongs to the scope of protection of the present application.
[0030] First, the applicable application scenarios of the present application are introduced. The present application can be applied to the measurement of the similarity between measurement and control time series data in space launch measurement and control data mining.
[0031] To solve the problems that the traditional Euclidean distance is not suitable for processing unequal-length time series data, cannot achieve asynchronous measurement, and the traditional DTW algorithm has too slow operation speed and is not suitable for real-time similarity measurement, a time series similarity measurement method based on radian DTW distance is proposed in the present application.
[0032] Please refer to Figure 1 , Figure 1 It is a flowchart of a processing method for time series data based on radian provided by an embodiment of the present application, Figure 3 It is a flowchart of calibrating software refresh provided by an embodiment of the present application. As shown in Figure 1 , the processing method for time series data based on radian provided by the embodiment of the present application includes:
[0033] S101. Obtain the real-time time series and historical time series generated by the target spacecraft respectively. Each time series includes multiple data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of the target parameters when the target spacecraft executes tasks.
[0034] In this step, the historical time series is the typical telemetry data generated during the target test tasks that the target spacecraft has already executed. This part of the data is saved in the historical database and can be directly retrieved. The real-time time series, on the other hand, comes from the real-time telemetry data generated when the target spacecraft executes the same target test task. In actual application scenarios, the number of data in the historical time series is usually much larger than that in the real-time time series. Specifically, the time series is extracted in the following way:
[0035] Segment the historical telemetry data or real-time telemetry data according to the periodic characteristics of the telemetry data to obtain a set of time series S = {S 1 , S 2 , S 3 , S 4 ,…, S n}, where n is the number of segmented data, and S i = {(s 1,i , t 1,i ), (s 2,i , t 2,i ), (s 3,i , t 3,i ),…, (s j,i , t j,i ), where s is the data variable, t is the time, i = 1, 2, 3,…, n, and j is the length of the time.
[0036] S102. For each time series in the real-time time series and the historical time series, traverse and calculate the radian value between adjacent data variables in the time series to convert the real-time time series into a real-time radian series and the historical time series into a historical radian series.
[0037] In this step, whether it is the real-time time series or the historical time series, it is necessary to calculate the radian value between two adjacent data variables. As Figure 2 shown, Figure 2 is a flowchart of a step for calculating the radian value provided by the application embodiment. Specifically, the radian value between adjacent data variables in the time series is calculated in the following way;
[0038] S1020. Respectively determine the first data variable and the second data variable adjacent in time in the time series, where the time corresponding to the second data variable is after the time corresponding to the first data variable.
[0039] S1022. Calculate the difference between the second data variable and the first data variable.
[0040] S1023. Calculate the value of the arctangent function corresponding to the difference as the radian value between the second data variable and the first data variable.
[0041] Taking the real-time time series as an example, the real-time time series
[0042]
[0043] First, normalize x 1,1 = 100, x 2,1 = 80, x 3,1 = 100, x 4,1 = 90, x 5,1 = 95. After normalization, we get x 1,1 = 1, x 2,1 = 0.80, x 3,1 = 1, x 4,1 = 0.90, x 5,1 = 0.95. Then calculate the radian value a 2,1 = 0.80 between x 1,1 and x 1,1 = 1, and calculate the radian value a 3,1 between x 2,1 and x 2,1 , and so on.
[0044] Among them, the radian value is calculated by the following formula:
[0045] a i,j-1 = arctan(x i,j - x i,j-1 ), i ∈ [1, n - 1].
[0046] S103. Compress the real-time radian sequence to generate a real-time compressed radian sequence, and compress the historical radian sequence to generate a historical compressed radian sequence.
[0047] Among them, the time series is compressed in the following way:
[0048] Calculate the difference between adjacent radian values in sequence according to the acquisition time, and accumulate and sum the differences. When the cumulative radian difference is greater than the preset value, record the time corresponding to the most recently accumulated difference and its corresponding radian value, clear the current cumulative radian difference, and start accumulating and summing from the next difference until all differences are traversed. Record the last time in the time series and its corresponding radian value, and take all the recorded times and their corresponding radian values as the corresponding compressed radian sequence. For any real-time time series X i or historical time series Y k , a sequence set A i or A k expressed in radian values can be obtained. Exemplarily, the above real-time time series X 1Then a corresponding third target time series can be formed and represented as A 1 =={(a 1,1 , t 1,1 ), (a 2,1 , t 2,1 ), (a 3,1 , t 3,1 ), (a 4,1 , t 4,1 )}.
[0049] Calculate the differences between adjacent radian values in sequence according to the time sequence.
[0050] Taking A 1 as an example, calculate a' 1 = a 2,1 - a 1,1 , a' 2 = a 3,1 - a 2,1 , a' 3 = a 4,1 - a 3,1 , a' 4 = a 5,1 - a 4,1 .
[0051] When the cumulative radian difference exceeds the preset value, record the time corresponding to the last accumulated difference and its corresponding radian value, clear the current cumulative radian difference, and start a new cumulative summation based on the next difference until all differences are traversed; record the last time and radian value of the time series, and all the records together form a new time series after compression processing.
[0052] Taking A 1 as an example, perform cumulative summation on a' i . Each time an addition is made, compare the cumulative radian difference with the preset threshold. For example, when a' 1 + a' 2 is greater than the preset value, record the time t 3,1 corresponding to a 3,1 , and start a new cumulative summation from a' 3 . When a' 3 is greater than the preset value, record the time t 4,1 corresponding to a 4,1 , and so on. Finally, obtain the compressed radian sequence A' 1 =={(a 1,1 , t 1,1 ), (a 3,1 , t 3,1 ), (a 4,1 , t 4,1 ), (a 5,1 , t5,1 )}。
[0053] After step S102, the compressed real-time radian sequence can be expressed as A′ = {A′ 1 , A′ 2 , A′ 3 , A′ 4 ,..., A′ n}, and the compressed historical radian sequence can be expressed as B′ = {B′ 1 , B′ 2 , B′ 3 , B′ 4 ,..., B′ m}.
[0054] In step S103, for each A′ n and a B′ m , the optimal path between the two time series is calculated through the DTW (Dynamic Time Warping) algorithm. The steps for calculating the optimal path based on the DTW algorithm, taking A′ 1 = {(a 1,1 , t 1,1 ), (a 3,1 , t 3,1 ), (a 4,1 , t 4,1 ), (a 5,1 , t 5,1 )}, B′ 1 = {(b 1,1 , t 1,1 ), (b 3,1 , t 3,1 ), (b 5,1 , t 5,1 )} as an example, calculate the Euclidean distance between each data variable a 1 in A′ i,1 and each data variable b 1 in B′ k,1 . Furthermore, obtain all the alignment paths P = {P 1 , P 2 , P 3 , P 4 ,......, P l}, where l is the length of the alignment path, max(i + k) ≤ l ≤ i + k + 1, P l = (t i,1 , t k,1 ). One of each coordinate in the path here comes from the moment in A′ 1 , and the other in each coordinate comes from B′ 1The moments in it. The best path here is the path that minimizes the cumulative distance value between the two sequences, which can be expressed as:
[0055]
[0056] There are already many introductions in the prior art about the steps of calculating the best path based on DTW here, so it will not be elaborated.
[0057] S104. Based on the dynamic time warping algorithm, determine the best path between the real-time compressed radian sequence and the historical compressed radian sequence. The best path is used to indicate the best matching relationship between each moment in the real-time compressed radian sequence and the historical compressed radian sequence.
[0058] S105. Based on the best path, expand the real-time compressed radian sequence and the historical compressed radian sequence simultaneously to correspondingly generate a real-time target radian sequence and a historical target radian sequence. The lengths of the real-time target radian sequence and the historical target radian sequence are equal.
[0059] Specifically, the best path includes multiple coordinate points. The abscissa of each coordinate point is a first acquisition moment in the real-time time series, and the ordinate of each coordinate point is a second acquisition moment in the historical time series. The following method is used for expansion to generate the real-time target time series and the historical target time series:
[0060] (1) According to the multiple coordinate points of the best path, determine all the first acquisition moments and arrange them in the path order, and determine all the second acquisition moments and arrange them in the path order.
[0061] Here, the moments belonging to their respective sequences in the alignment path need to be taken out separately. The lengths of the two sequences taken out are the same, and the constituent elements are pairwise aligned.
[0062] Exemplarily, assume that the optimal path obtained based on the DTW calculation is (1, 1), (1, 2), (2, 3), (3, 3), (4, 4), (5, 5). Sequences are established as shown in Table 1 below:
[0063] 1 1 2 3 4 5 1 2 3 3 4 5
[0064] (2) The following method is used for expansion:
[0065] Traverse the real-time time series and the historical time series simultaneously. For two adjacent first acquisition times in the real-time time series and the corresponding two adjacent second acquisition times in the historical time series in the same order, first determine whether the expansion condition is satisfied; if the expansion condition is satisfied, fill in an equal number of missing times between the two adjacent first acquisition times and between the two adjacent second acquisition times simultaneously. Determine whether the expansion condition is satisfied according to the difference between the two adjacent first acquisition times and the difference between the two adjacent second acquisition times. If it is determined that the expansion condition is satisfied, fill in an equal number of missing times between the two adjacent first acquisition times and between the two adjacent second acquisition times simultaneously; for each time in the real-time time series and the historical time series, based on its corresponding real-time radian sequence or historical radian sequence, determine the radian value corresponding to this time and associate it to generate a real-time target radian sequence and a historical target radian sequence.
[0066] Specifically, determine whether the expansion condition is satisfied in the following way:
[0067] Determine whether the magnitude of the difference between two adjacent first acquisition times is greater than 1, and determine whether the difference between two adjacent second acquisition times is greater than 1;
[0068] If it is determined that at least one of the differences is greater than 1, it is determined that the expansion condition is satisfied;
[0069] If it is determined that all differences are not greater than 1, it is determined that the expansion condition is not satisfied. After it is determined that the expansion condition is satisfied, determine the number of missing times in the following way: compare the magnitude of the difference between two adjacent first acquisition times and the difference between two adjacent second acquisition times; if the difference between two adjacent first acquisition times is greater than the difference between two adjacent second acquisition times, subtract 1 from the difference between two adjacent first acquisition times as the number of missing times.
[0070] Taking the two rows of sequences in the above table as an example, the numbers in the table represent the labels of the times in the compressed set, and the corresponding times should be Table 2 below:
[0071] 1 1 5 6 8 9 1 4 5 5 7 8
[0072] The above Table 2 can be correspondingly converted to
[0073]
[0074]
[0075] At this time, each sequence is not continuous. In order to improve the utilization rate of the original information to ensure the calculation accuracy, expansion is required.
[0076] The first two columns in Table 2, where 1 - 1 = 0 (0 ≤ 1) in the first row and 4 - 1 = 3 (3 > 1) in the second row. Then, it is necessary to insert the missing time moments 2 and 3 between 4 and 1 in the second row, and fill in 1 between 1 and 1 in the first row. At this time, the following Table 3 is obtained:
[0077] 1 1 1 1 5 6 8 9 1 2 3 4 5 5 7 8
[0078] The original third column and the second column, that is, the fifth column and the fourth column in Table 3. According to the same filling method, the following Table 4 can be obtained:
[0079] 1 1 1 1 2 3 4 5 6 8 9 1 2 3 4 4 4 4 5 5 7 8
[0080] And so on, the following Table 5 can be obtained:
[0081] 1 1 1 1 2 3 4 5 6 7 8 9 1 2 3 4 4 4 4 5 5 6 7 8
[0082] According to the above Table 5, the following can be correspondingly obtained
[0083]
[0084]
[0085] Here, A″ 1 is the expanded real-time target radian sequence, and B″ 1 is the expanded historical target radian sequence. The number of binary tuples of the two is aligned.
[0086] S106. Calculate the similarity between the real-time target radian sequence and multiple historical target radian sequences, and determine at least one historical target radian sequence that matches the real-time target radian sequence for analyzing the target parameters of the target spacecraft.
[0087] The similarity between the real-time target radian sequence and the historical target radian sequence here can be obtained by calculating the Euclidean distance between the sequences to obtain the corresponding Euclidean distance value. For each real-time target radian sequence, based on the Euclidean distance values between the real-time target radian sequence and each historical target radian sequence, they are sorted from small to large. One or several of the previous historical target radian sequences can be used as the historical target radian sequences that are most similar to the real-time target radian sequence.
[0088] For example, for A″ 1 , the DTW distances between it and A″ 1 are arranged from small to large as B″ 1 , B″ 9 , B″ 5 and so on.
[0089] The data processing method provided by the embodiments of the present application first converts the original data into radian time series data that can better reflect the data characteristics; then uses the cumulative radian difference to compress the time series, reducing the data dimension, greatly reducing the subsequent operation time while ensuring the measurement accuracy, reducing the consumption of system resources, and improving the efficiency of similarity measurement. Next, the time dynamic programming algorithm is used to find the optimal matching path for the dimension-reduced time series data, and an improved moment alignment method is proposed to fill in the missing moments of the compressed sequence according to this path, so that the lengths of the compressed sequences are equal, and a fast and efficient radian distance calculation can be performed. At the same time, since the path found by using dynamic time warping breaks through the real-time limit, compared with the original sequence, the sequence matching relationship obtained by filling in based on this path is more reasonable, and asynchronous measurement can be realized, solving the problem that the measurement result is not accurate enough due to the stretching and offset of the time series.
[0090] As Figure 3 shown, in an embodiment of the present application, the above data processing method can be executed through a calibration program, referring to steps S101 to S106, and the selected sequences are associated or marked to help analyze the real-time measurement and control data.
[0091] Based on the same inventive concept, an apparatus for processing radian-based time series data corresponding to the processing of radian-based time series data is also provided in the embodiments of the present application. Since the principle of solving problems by the apparatus in the embodiments of the present application is similar to the above-mentioned processing method of radian-based time series data in the embodiments of the present application, the implementation of the apparatus can refer to the implementation of the method, and the repeated parts will not be described again.
[0092] Please refer to Figure 4 , Figure 4 which is a schematic structural diagram of an apparatus for processing radian-based time series data provided by an embodiment of the present application. As Figure 4 shown in
[0093] An acquisition module 410, configured to respectively acquire a real-time time series and a historical time series generated by a target spacecraft. Each time series includes a plurality of data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of target parameters when the target spacecraft executes tasks;
[0094] A conversion module 420, configured to traverse and calculate the radian values between adjacent data variables in each of the real-time time series and the historical time series, so as to convert the real-time time series into a real-time radian series and convert the historical time series into a historical radian series;
[0095] A compression module 430, configured to compress a real-time radian sequence to generate a real-time compressed radian sequence, and compress a historical radian sequence to generate a historical compressed radian sequence;
[0096] A matching module 440, configured to determine an optimal path between the real-time compressed radian sequence and the historical compressed radian sequence based on the dynamic time warping algorithm, where the optimal path is used to indicate the optimal matching relationship between each moment in the real-time compressed radian sequence and the historical compressed radian sequence;
[0097] An expansion module 450, configured to expand the real-time compressed radian sequence and the historical compressed radian sequence simultaneously based on the optimal path to correspondingly generate a real-time target radian sequence and a historical target radian sequence, where the lengths of the real-time target radian sequence and the historical target radian sequence are equal;
[0098] An output module 460, configured to calculate the similarity between the real-time target radian sequence and multiple historical target radian sequences, and determine at least one historical target radian sequence that matches the real-time target radian sequence for analyzing the target parameters of the target spacecraft.
[0099] In a preferred embodiment, the compression module 430 compresses each radian sequence in the following manner: calculate the difference between adjacent radian values in sequence according to the acquisition time, and accumulate the differences; when the accumulated radian difference is greater than a preset value, record the time corresponding to the most recently accumulated difference and its corresponding radian value, clear the current accumulated radian difference, and start accumulating the differences again from the next difference until all differences are traversed; record the last time in the time series and its corresponding radian value, and use all the recorded times and their corresponding radian values as the corresponding compressed radian sequence.
[0100] In a preferred embodiment, the expansion module 450 expands in the following manner to generate a real-time target radian sequence and a historical target radian sequence:
[0101] Construct a real-time time series and a historical time series respectively according to the acquisition times corresponding to the real-time compressed radian sequence and the historical compressed radian sequence in the optimal path; traverse the real-time time series and the historical time series simultaneously. For two adjacent first acquisition times in the real-time time series and two corresponding adjacent second acquisition times in the historical time series in the same order, first determine whether the expansion condition is satisfied. If the expansion condition is satisfied, fill in an equal number of missing times between the two adjacent first acquisition times and the two adjacent second acquisition times; for each time in the real-time time series and the historical time series, determine the radian value corresponding to this time and associate it based on the real-time radian sequence or the historical radian sequence to generate a real-time target radian sequence and a historical target radian sequence.
[0102] In a preferred embodiment, the expansion module 450 determines whether the expansion condition is met in the following manner: determining whether the magnitude of the difference between two adjacent first acquisition times is greater than 1, and determining whether the difference between two adjacent second acquisition times is greater than 1; if it is determined that at least one of the differences is greater than 1, it is determined that the expansion condition is met; if it is determined that all differences are not greater than 1, it is determined that the expansion condition is not met.
[0103] In a preferred embodiment, after the expansion module 450 determines that the expansion condition is met, it determines the number of missing times in the following manner: comparing the magnitude of the difference between two adjacent first acquisition times with the magnitude of the difference between two adjacent second acquisition times; if the difference between two adjacent first acquisition times is greater than the difference between two adjacent second acquisition times, subtracting 1 from the difference between two adjacent first acquisition times as the number of missing times, otherwise, subtracting 1 from the difference between two adjacent second acquisition times as the number of missing times.
[0104] In a preferred embodiment, after the expansion condition is met, the expansion module 450 fills the missing times in the following manner: taking the two adjacent acquisition times with the larger difference among the two adjacent first acquisition times and the two adjacent second acquisition times as the first target acquisition time pair, and the other two adjacent acquisition times as the second target acquisition time pair; for the first target acquisition time pair, filling the missing times in an increasing order of acquisition times; for the second target acquisition time pair, determining whether the difference between the two acquisition times in the second target acquisition time pair is less than the difference between the two acquisition times in the first target acquisition time pair, if so, first filling the preset missing times in an increasing order of acquisition times, and then filling the remaining missing times by copying, if not, filling all the missing times in an increasing order of acquisition times.
[0105] In a preferred embodiment, for each time series, the conversion module 420 calculates the radian value between adjacent data variables in the time series in the following manner: respectively determining the first data variable and the second data variable adjacent in time in the time series, where the time corresponding to the second data variable is after the time corresponding to the first data variable; calculating the difference between the second data variable and the first data variable; calculating the value of the arctangent function corresponding to the difference as the radian value between the second data variable and the first data variable.
[0106] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 5 shown in
[0107] The memory 520 stores machine-readable instructions executable by the processor 510. When the electronic device 500 runs, the processor 510 communicates with the memory 520 via a bus 530. When the machine-readable instructions are executed by the processor 510, the steps of the method for processing radian-based time series data in the method embodiment as described above can be executed. For the specific implementation manners, reference can be made to the method embodiment and will not be elaborated herein. Figure 1 shown in the method embodiment, and the specific implementation manners can be referred to the method embodiment and will not be elaborated herein.
[0108] The embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the method for processing radian-based time series data in the method embodiment as described above can be executed. For the specific implementation manners, reference can be made to the method embodiment and will not be elaborated herein. Figure 1 shown in the method embodiment, and the specific implementation manners can be referred to the method embodiment and will not be elaborated herein.
[0109] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0110] In several embodiments provided by the present application, the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there can be other division manners in actual implementation. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some communication interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.
[0111] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0112] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0113] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this 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 for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0114] Finally, it should be noted that the above-mentioned embodiments are only specific implementation manners of the present application, used to illustrate the technical solutions of the present application, rather than limiting them. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by the present application can still modify the technical solutions described in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method for processing time series data based on radians, characterized in that, the method includes: Step 1: Obtain the real-time time series and historical time series generated by the target spacecraft respectively. Each time series includes a plurality of data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of the target parameters when the target spacecraft executes tasks; Step 2: For each of the real-time time series and the historical time series, traverse and calculate the radian values between adjacent data variables in the time series to convert the real-time time series into a real-time radian sequence and the historical time series into a historical radian sequence; Step 3: Compress the real-time radian sequence to generate a real-time compressed radian sequence, and compress the historical radian sequence to generate a historical compressed radian sequence; Step 4: Based on the dynamic time warping algorithm, determine the optimal path between the real-time compressed radian sequence and the historical compressed radian sequence. The optimal path is used to indicate the optimal matching relationship between each moment in the real-time compressed radian sequence and the historical compressed radian sequence; Step 5: Based on the optimal path in Step 4, expand the real-time compressed radian sequence and the historical compressed radian sequence simultaneously to correspondingly generate a real-time target radian sequence and a historical target radian sequence. The lengths of the real-time target radian sequence and the historical target radian sequence are equal; Step 6: Calculate the similarity between the real-time target radian sequence and multiple historical target radian sequences, and determine at least one historical target radian sequence that matches the real-time target radian sequence for analyzing the target parameters of the target spacecraft.
2. The method according to claim 1, characterized in that, in Step 3, each radian sequence is compressed in the following manner: Calculate the difference between adjacent radian values in sequence according to the acquisition time, and accumulate and sum the differences; When the cumulative radian difference is greater than the preset value, record the moment corresponding to the most recently accumulated difference and its corresponding radian value, clear the current cumulative radian difference, and start accumulating and summing again from the next difference until all differences are traversed; Record the last moment in the time series and its corresponding radian value, and use all the recorded moments and their corresponding radian values as the corresponding compressed radian sequence.
3. The method according to claim 1, characterized in that, in Step 5, the following method is used for expansion to generate a real-time target radian sequence and a historical target radian sequence: Construct a real-time moment sequence and a historical moment sequence respectively according to the acquisition moments corresponding to the real-time compressed radian sequence and the historical compressed radian sequence in the optimal path; Traverse the real-time moment sequence and the historical moment sequence simultaneously. For two adjacent first acquisition moments in the real-time moment sequence and the corresponding two adjacent second acquisition moments in the historical moment sequence in the same order, determine whether the expansion condition is satisfied; If the expansion condition is satisfied, an equal number of missing moments are filled simultaneously between two adjacent first acquisition moments and two adjacent second acquisition moments; for each moment in the real-time moment sequence and the historical moment sequence, based on its corresponding real-time radian sequence or historical radian sequence, the radian value corresponding to this moment is determined and associated to generate a real-time target radian sequence and a historical target radian sequence.
4. The method according to claim 3, wherein, the determination of whether the expansion condition is satisfied is performed in the following manner: determine whether the difference between two adjacent first acquisition moments is greater than 1, and determine whether the difference between two adjacent second acquisition moments is greater than 1; if it is determined that at least one of the differences is greater than 1, then it is determined that the expansion condition is satisfied; if it is determined that all differences are not greater than 1, then it is determined that the expansion condition is not satisfied.
5. The method according to claim 3, wherein, after it is determined that the expansion condition is satisfied, the number of the missing moments is determined in the following manner: compare the size of the difference between two adjacent first acquisition moments and the difference between two adjacent second acquisition moments; if the difference between two adjacent first acquisition moments is greater than the difference between two adjacent second acquisition moments, then subtract 1 from the difference between two adjacent first acquisition moments as the number of the missing moments, otherwise, subtract 1 from the difference between two adjacent second acquisition moments as the number of the missing moments.
6. The method according to claim 3, wherein, after the expansion condition is satisfied, the missing moments are filled in the following manner: regard the two adjacent acquisition moments with a larger difference among the two adjacent first acquisition moments and the two adjacent second acquisition moments as the first target acquisition moment pair, and regard the other two adjacent acquisition moments as the second target acquisition moment pair; for the first target acquisition moment pair, fill the missing moments in the increasing order of the acquisition moments; for the second target acquisition moment pair, determine whether the difference between the two acquisition moments in the second target acquisition moment pair is less than the difference between the two acquisition moments in the first target acquisition moment pair. If so, first fill the preset missing moments in the increasing order of the acquisition moments, and then fill the remaining missing moments in a copied manner. If not, fill all the missing moments in the increasing order of the acquisition moments.
7. The method according to claim 1, wherein, in step two, for each time sequence, the radian value between adjacent data variables in this time sequence is calculated in the following manner: respectively determine the first data variable and the second data variable adjacent in time in this time sequence, wherein the moment corresponding to the second data variable is after the moment corresponding to the first data variable; calculate the difference between the second data variable and the first data variable; calculate the value of the arctangent function corresponding to the difference as the radian value between the second data variable and the first data variable.
8. A processing device for time sequence data based on radians, wherein, the device includes: An acquisition module, configured to acquire a real-time time series and a historical time series generated by a target spacecraft respectively. Each time series includes a plurality of data variables arranged in the acquisition time sequence, and the data variables are used to indicate the parameter values of target parameters when the target spacecraft executes tasks; A conversion module, configured to traverse and calculate the radian values between adjacent data variables in each of the real-time time series and the historical time series, so as to convert the real-time time series into a real-time radian series and the historical time series into a historical radian series; A compression module, configured to compress the real-time radian series to generate a real-time compressed radian series, and compress the historical radian series to generate a historical compressed radian series; A matching module, configured to determine an optimal path between the real-time compressed radian series and the historical compressed radian series based on the dynamic time warping algorithm, and the optimal path is used to indicate the optimal matching relationship between each moment in the real-time compressed radian series and the historical compressed radian series; An expansion module, configured to expand the real-time compressed radian series and the historical compressed radian series simultaneously based on the optimal path, so as to correspondingly generate a real-time target radian series and a historical target radian series, and the lengths of the real-time target radian series and the historical target radian series are equal; An output module, configured to calculate the similarity between the real-time target radian series and a plurality of the historical target radian series, and determine at least one historical target radian series that matches the real-time target radian series, so as to analyze the target parameters of the target spacecraft.
9. An electronic device, characterized in that, it includes: A processor, a memory and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus, and the processor executes the machine-readable instructions to perform the steps of the processing method for radian-based time series data according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is run by a processor, it performs the steps of the processing method for radian-based time series data according to any one of claims 1 to 7.