Phase jump detection and correction method and device, equipment and storage medium
Through sliding window feature extraction and random forest classification methods, the threshold dependence and misjudgment problems in phase jump detection are solved, and higher detection accuracy and adaptability are achieved, which is suitable for density correction of the fully superconducting tokamak nuclear fusion experimental device.
Patent Information
- Application Number
- CN202510440553.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-11
AI Technical Summary
In the prior art, the phase jump detection method relies on manual threshold setting, lacks adaptability, and is easily misjudged when noise or outliers exist, resulting in inaccurate density correction, unable to be applied to different data sets or experimental environments, and ignores the local continuity of time series.
Sliding window feature extraction and random forest classification methods are used to mark the jump points through sliding mean difference and maximum value difference features, and the random forest classification model is trained, and the phase jump is corrected by the accumulation method until it returns to stability.
It improves the accuracy and noise immunity of detection, reduces the misjudgment rate, enhances the adaptability and real-timeness of the method, and can perform density phase jump correction faster.
Smart Images

Figure CN120296580A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of phase jump retrieval, and specifically relates to a method, device, equipment and storage medium for phase jump detection and correction. Background Art
[0002] The problem of phase jump may occur when the Experimental Advanced Superconducting Tokamak (EAST) conducts density measurement.
[0003] In the prior art, backward difference can be used to determine whether the values of two adjacent points are greater than a threshold, and the points greater than the threshold (i.e., jump points) are used for density correction. The selection of the threshold needs to be experimentally determined manually for many times. Since there are at most 20 phase jumps on the POINT interferometer, a target value is sequentially added to each jump point, and then backward difference is performed again and compared with the threshold.
[0004] The traditional backward difference method needs to determine the optimal threshold through multiple manual experiments. The selection of the threshold is greatly affected by human factors, and it is difficult to be applicable to different data sets or different experimental environments, lacking self - adaptability. When there is noise or outliers in the data, the simple difference method may misjudge the jump points, resulting in inaccurate density correction and thus affecting the overall signal recovery effect. The backward difference method only considers the change between two adjacent points and ignores the local continuity of time - series data, which may lead to insufficient ability to identify complex phase jump patterns. Summary of the Invention
[0005] To solve the above - mentioned technical problems, the present invention provides a method, device, equipment and storage medium for phase jump detection and correction, which can perform density phase jump correction and calculation faster.
[0006] To solve the above - mentioned technical problems, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides a method for phase jump detection and correction, including:
[0008] Obtain the detection signal and reference signal of a polarization interferometer, inversely solve the density during plasma operation according to the phase difference between the detection signal and the reference signal, and obtain the time - series voltage data corresponding to the phase difference. The voltage data includes a timestamp and phase information;
[0009] Set the sliding window size W, and extract the sliding mean difference and sliding maximum - minimum difference of the voltage data within the window as features, where the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum - minimum difference is the difference between the maximum and minimum values of the voltage data within the window;
[0010] Annotate the jump points of the time - series voltage data to form a binary - classification label dataset. Use the time - series voltage data and the features as inputs, and the labels of the jump points as outputs to train a random forest classification model;
[0011] Optimize the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth;
[0012] Use the trained random forest classification model to predict the jump points, and correct the phase of the jump points through the accumulation method until the phase returns to stability.
[0013] In one embodiment, the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window, specifically including:
[0014] The sliding mean difference MMD is:
[0015]
[0016] V i is the i - th voltage data within the window, and V mean is the mean of the voltage data within the window.
[0017] In one embodiment, the sliding maximum - minimum difference is the difference between the maximum and minimum values of the voltage data within the window, specifically including:
[0018] The sliding maximum - minimum difference MMDiff is:
[0019] MMDiff=max(V1,V2,...,V W ) - min(V1,V2,...,V W );
[0020] V W is the W - th voltage data within the window.
[0021] In one embodiment, the correction of the phase of the jump point through the accumulation method specifically includes:
[0022] When a jump point is detected, correct it by adding a fixed compensation amount to the phase value of the jump point;
[0023] Perform phase - jump detection on the corrected phase again. If there is still a jump, repeat the accumulation until the jump disappears or the maximum accumulation times are reached; if the jump point still exists after reaching the maximum accumulation times, use the mean of the previous B data to interpolate and replace the phase value of the jump point.
[0024] In one embodiment, the annotation of the jump points of the time - series voltage data to form a binary - classification label dataset specifically includes:
[0025] If the difference between the current voltage data and the adjacent voltage data exceeds a preset threshold, the current voltage data is marked as a jump point; otherwise, the current voltage data is marked as a normal point.
[0026] In a second aspect, the present invention provides a phase jump detection and correction device, including:
[0027] A signal processing module: obtaining a detection signal and a reference signal of a polarization interferometer, inversely solving the density during plasma operation according to the phase difference between the detection signal and the reference signal, and obtaining time series voltage data corresponding to the phase difference, where the voltage data includes a timestamp and phase information;
[0028] A feature extraction module: setting a sliding window size W, and extracting the sliding mean difference and the sliding maximum-minimum difference of the voltage data within the window as features, where the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window;
[0029] A model training module: labeling the jump points of the time series voltage data to form a binary classification label dataset, using the time series voltage data and the features as inputs and the labels of the jump points as outputs to train a random forest classification model; optimizing the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth;
[0030] A phase correction module: using the trained random forest classification model to predict jump points, and correcting the phase of the jump points by the cumulative addition method until the phase returns to stability.
[0031] In one embodiment, the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window, specifically including:
[0032] The sliding mean difference MMD is:
[0033]
[0034] V i is the i-th voltage data within the window, and V mean is the mean of the voltage data within the window.
[0035] In one embodiment, the sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window, specifically including:
[0036] The sliding maximum-minimum difference MMDiff is:
[0037] MMDiff = max(V1, V2,..., V W ) - min(V1, V2,..., V W );
[0038] V W is the Wth voltage data within the window.
[0039] In a third aspect, the present invention provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in any one of the embodiments of the first aspect are implemented.
[0041] Compared with the prior art, the beneficial technical effects of the present invention are as follows:
[0042] The present invention uses a method based on sliding window feature extraction and random forest classification for phase jump detection. Compared with the prior art, the present invention has significant advantages in terms of detection accuracy, anti-noise performance, real-time performance, adaptability, etc. The specific analysis is as follows:
[0043] By using a sliding window, the changes of multiple data points can be considered simultaneously, making the detection more robust;
[0044] By using two features of sliding mean difference and maximum-minimum difference, the signal changes can be described more comprehensively, improving the classification accuracy;
[0045] Combined with machine learning (random forest), the law of jumps can be learned from historical data, significantly reducing the misjudgment rate. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 is the flowchart of the method in the embodiment of the present invention.
[0047] Figure 2 is the schematic diagram of the model training process in the embodiment of the present invention.
[0048] Figure 3 is the schematic diagram of the phase jump phenomenon.
[0049] Figure 4 is the schematic diagram of the process for jump point prediction and phase prediction in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0050] A preferred embodiment of the present invention will be described in detail below with reference to the accompanying drawings.
[0051] As Figure 1 shown, the present invention provides a method for phase jump detection and correction, including the following steps:
[0052] S1. Obtain the detection signal and reference signal of the polarization interferometer, inversely solve the density during plasma operation based on the phase difference between the detection signal and the reference signal, and obtain the time-series voltage data corresponding to the phase difference. The voltage data includes timestamps and phase information;
[0053] S2. Set the sliding window size W, and extract the sliding mean difference and sliding maximum-minimum difference of the voltage data within the window as features. Among them, the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window;
[0054] S3. Mark the jump points of the time-series voltage data to form a binary classification label dataset. Use the time-series voltage data and the features as inputs and the labels of the jump points as outputs to train a random forest classification model;
[0055] S4. Optimize the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth;
[0056] S5. Use the trained random forest classification model to predict the jump points, and correct the phase of the jump points by the accumulation method until the phase returns to stability.
[0057] The present invention uses a machine learning algorithm to predict the jump points, and introduces a sliding window. The features extracted within an entire window are used as an overall feature, which can ensure the local continuity of the time series. Moreover, compared with deep learning, the traditional machine learning classification algorithm has a lower time complexity and can perform density phase jump correction and calculation faster. The sliding window size used in the present invention can be freely set when training the model, which can fully retain the continuity of the time series and the threshold is obtained after model training, without the need for manual experiments to determine the threshold.
[0058] As Figure 2 shown, after the present invention obtains the detection signal (after passing through the plasma) and the reference signal (not passing through the plasma) in the reference channel and detection channel of the polarization interferometer respectively, and collects them through a lock-in amplifier and uses a high-speed analog-to-digital converter, there will be a phase difference between the detection signal and the reference signal. The electron density can be inversely solved through this phase difference. However, when using the atan2 function to unwrap the phase, phase jumps will occur, as Figure 3 shown. Therefore, it is necessary to correct the phase after the jump. The present invention mainly uses the random forest algorithm to predict the phase jump points, and then uses the accumulation method to correct the jumped phase.
[0059] In one embodiment, the sliding mean difference in step S2 is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window, specifically including:
[0060] The sliding mean difference MMD is as follows:
[0061]
[0062] V i is the i-th voltage data within the window, and V mean is the mean value of the voltage data within the window.
[0063] In one embodiment, the sliding maximum-minimum difference in step S2 is the difference between the maximum and minimum values of the voltage data within the window, specifically including:
[0064] The sliding maximum-minimum difference MMDiff is as follows:
[0065] MMDiff = max(V1, V2,..., V W ) - min(V1, V2,..., V W );
[0066] V W is the W-th voltage data within the window.
[0067] When W = 2, the sliding maximum-minimum difference MMDiff is the backward difference:
[0068] MMDiff = |V i - V i-1 |.
[0069] In one embodiment, the step of annotating the jump points of the time series voltage data in step S3 to form a binary classification label dataset specifically includes:
[0070] If the difference between the current voltage data and the adjacent voltage data exceeds a preset threshold, the current voltage data is marked as a jump point; otherwise, the current voltage data is marked as a normal point.
[0071] Mark the jump points in the data, that is, the positions where the phase changes significantly, to form the binary classification labels for supervised learning: Class 1 (jump point): the phase suddenly changes at a certain time point; Class 0 (normal point): the phase is stable and there is no mutation. Use the collected time series data, the sliding window features as the input, and the jump point labels as the output.
[0072] After training, in order to test the transfer ability of the current model, the accuracy rate during the remaining adjacent discharge periods is tested as an evaluation, and grid search is used to find the best parameters in the random forest algorithm.
[0073] In one embodiment, the step of correcting the jump point phase by the accumulation method in step S5 specifically includes:
[0074] When a jump point is detected, it is corrected by accumulating a fixed compensation amount on the phase value of the jump point;
[0075] Perform phase jump detection on the corrected phase again. If there is still a jump, repeat the accumulation until the jump disappears or the maximum accumulation times are reached; if the jump point still exists after reaching the maximum accumulation times, use the mean value of the previous B data to interpolate and replace the phase value of the jump point.
[0076] After predicting the phase jump point, use the accumulation method for alignment and unpacking. On the Experimental Advanced Superconducting Tokamak (EAST), during one discharge process, there are at most 20 jumps. After predicting the jump point, perform accumulation for alignment. If it is still a jump point after accumulation, continue to accumulate. If it is a normal point after accumulation, restore it to the correct electron density. For details, see Figure 4 .
[0077] In the technical solution for implementing phase jump detection, in addition to "sliding window feature extraction + random forest classification", there are some other feasible alternative solutions that can also achieve a similar detection purpose. For example:
[0078] (1) Time series prediction methods based on deep learning (LSTM / Transformer):
[0079] This method does not require manual feature annotation and can model long-term dependencies. Compared with the sliding window, LSTM / Transformer can remember the change patterns on a longer time scale, which helps to detect complex signal jumps. However, it has a large amount of computation, is difficult to apply in real time, requires GPU computing resources, and has poor real-time performance. And its interpretability is poor, and it is difficult to intuitively understand how the model judges the jump point.
[0080] (2) Statistical methods (Kalman filter / wavelet transform):
[0081] Use the Kalman filter to smooth the signal and calculate whether the residual of the phase change exceeds the set threshold to detect the jump point. Use wavelet transform to perform multi-scale analysis on the signal and detect jumps in different frequency ranges.
[0082] (3) Change point detection based on Bayesian inference:
[0083] Use Bayesian statistical methods to calculate the probability that the current data point is a change point based on historical data. If the change point probability exceeds a certain threshold, it is judged as a jump point.
[0084] It should be understood that although the steps in the flowchart of the accompanying drawings of the specification are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the sequence indicated by the arrows. Unless there is a clear description in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings of the specification may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0085] Based on the description of the above method embodiments, the present disclosure also provides a phase jump detection and correction device. The device can be a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiments of this specification and combines the necessary implementation hardware. Based on the same inventive concept, the devices in one or more embodiments provided by the embodiments of the present disclosure are as described in the following embodiments. Since the implementation solutions for the device to solve problems are similar to those of the method, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the foregoing method, and the repeated parts will not be described again. As used hereinafter, the term "module" or "modular" can be a combination of software and / or hardware capable of realizing a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0086] The present invention also provides a phase jump detection and correction device, including:
[0087] A signal processing module: obtaining the detection signal and the reference signal of a polarization interferometer, inversely solving the density during plasma operation according to the phase difference between the detection signal and the reference signal, and obtaining the time series voltage data corresponding to the phase difference, where the voltage data includes a time stamp and phase information;
[0088] A feature extraction module: setting the sliding window size W, and extracting the sliding mean difference and the sliding maximum-minimum difference of the voltage data within the window as features, where the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum-minimum difference is the difference between the maximum value and the minimum value of the voltage data within the window;
[0089] A model training module: labeling the jump points of the time series voltage data to form a binary classification label data set, using the time series voltage data and the features as inputs and the labels of the jump points as outputs to train a random forest classification model; optimizing the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth;
[0090] Phase correction module: Use the trained random forest classification model to predict the jump points, and correct the phase of the jump points by the accumulation method until the phase returns to stability.
[0091] In one embodiment, the moving average difference in the feature extraction module is the mean absolute deviation of each voltage data within the window from the mean of the voltage data within the window, specifically including:
[0092] The moving average difference MMD is:
[0093]
[0094] V i is the i-th voltage data within the window, and V mean is the mean of the voltage data within the window.
[0095] In one embodiment, the moving maximum-minimum difference in the feature extraction module is the difference between the maximum and minimum values of the voltage data within the window, specifically including:
[0096] The moving maximum-minimum difference MMDiff is:
[0097] MMDiff = max(V1, V2,..., V W ) - min(V1, V2,..., V W );
[0098] V W is the W-th voltage data within the window.
[0099] In one embodiment, the present invention also provides a computer device, which may be a server. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store the data used in the above method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the above method is implemented.
[0100] In an exemplary embodiment, the present invention also provides a computer-readable storage medium including instructions, such as a memory including instructions, and the above instructions can be executed by a processor to complete the above method. The storage medium may be a computer-readable storage medium. For example, the computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0101] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-described exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, in any aspect, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be embraced within the present invention, and any reference signs in the claims should not be regarded as limiting the claims involved.
[0102] In addition, it should be understood that although this specification is described according to embodiments, not every embodiment only contains an independent technical solution. This narrative way of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A phase jump detection and correction method, characterized in that Including: Obtain the detection signal and reference signal of the polarization interferometer, inversely solve the density during the operation of the plasma according to the phase difference between the detection signal and the reference signal, and obtain the time-series voltage data corresponding to the phase difference. The voltage data includes a timestamp and phase information; Set the sliding window size W, and extract the sliding mean difference and sliding maximum-minimum difference of the voltage data within the window as features. Among them, the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window; Label the jump points of the time-series voltage data to form a binary classification label dataset. Use the time-series voltage data and the features as inputs and the labels of the jump points as outputs to train a random forest classification model; Optimize the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth; Use the trained random forest classification model to predict the jump points, and correct the phase of the jump points by the cumulative method until the phase returns to stability.
2. The phase jump detection and correction method according to claim 1, wherein The sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window, specifically including: The sliding mean difference MMD is: V i is the i-th voltage data within the window, V mean is the average value of the voltage data within the window.
3. A phase jump detection and correction method according to claim 1, characterized in that The sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window, specifically including: The sliding maximum-minimum difference MMDiff is: MMDiff = max(V1, V2,..., V W ) - min(V1, V2,..., V W ); V W is the Wth voltage data within the window.
4. A phase jump detection and correction method according to claim 1, characterized in that The correction of the phase of the jump points by the cumulative method specifically includes: When a jump point is detected, correct it by accumulating a fixed compensation amount on the phase value of the jump point; Perform phase jump detection on the corrected phase again. If there is still a jump, repeat the accumulation until the jump disappears or the maximum accumulation times is reached; if the jump point still exists after reaching the maximum accumulation times, use the mean of the first B data to interpolate and replace the phase value of the jump point.
5. A phase jump detection and correction method according to claim 1, characterized in that The labeling of the jump points of the time-series voltage data to form a binary classification label dataset specifically includes: If the difference between the current voltage data and the adjacent voltage data exceeds a preset threshold, mark the current voltage data as a jump point, otherwise mark the current voltage data as a normal point.
6. A phase jump detection and correction device, characterized in that, Including: Signal processing module: Obtain the detection signal and reference signal of the polarization interferometer, inversely solve the density during the operation of the plasma according to the phase difference between the detection signal and the reference signal, and obtain the time-series voltage data corresponding to the phase difference. The voltage data includes a timestamp and phase information; Feature extraction module: Set the sliding window size W, and extract the sliding mean difference and sliding maximum-minimum difference of the voltage data within the window as features. Among them, the sliding mean difference is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window; the sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window; Model training module: Label the jump points of the time-series voltage data to form a binary classification label dataset. Use the time-series voltage data and the features as inputs and the labels of the jump points as outputs to train a random forest classification model; Optimize the parameters of the random forest classification model through grid search, including the number of classification trees and the maximum depth; Phase correction module: Use the trained random forest classification model to predict the jump points, and correct the phase of the jump points by the cumulative method until the phase returns to stability.
7. The phase jump detection and correction device according to claim 6, characterized in that The sliding mean deviation is the mean of the absolute deviations of each voltage data within the window from the mean of the voltage data within the window, specifically including: The sliding mean deviation MMD is: V i is the i-th voltage data within the window, V mean is the average value of the voltage data within the window.
8. A phase jump detection and correction device according to claim 6, characterized in that The sliding maximum-minimum difference is the difference between the maximum and minimum values of the voltage data within the window, specifically including: The sliding maximum-minimum difference MMDiff is: MMDiff = max(V1, V2,..., V W ) - min(V1, V2,..., V W ); V W is the Wth voltage data within the window.
9. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method described in any one of claims 1 to 5.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method described in any one of claims 1 to 5.