Metering pump digital control instruction generation method
By segmenting and mapping residuals from historical snapshots and real-time operating data, the problem of command offset in the cloud-edge collaborative control chain of the metering pump digital control system after disaster recovery was solved, achieving alignment and consistency between cloud commands and on-site operating conditions.
Patent Information
- Application Number
- CN202511796208.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-02
- Publication Date
- 2026-03-13
AI Technical Summary
The existing digital control system for metering pumps lacks an effective judgment mechanism when cloud data is damaged or edge nodes are disconnected, resulting in a slow-accumulating and difficult-to-detect overall offset problem in the cloud-edge collaborative control chain after disaster recovery.
By segmenting the historical snapshot sampling sequence and performing a sliding scan on the real-time operating condition sampling sequence, a first baseline sequence and a second baseline sequence are generated. The baseline is then reconstructed by mapping the residual sequence to ensure that cloud commands are aligned with on-site operating conditions.
This solves the problem of command offset in the cloud-edge collaborative control chain after disaster recovery, ensuring that the generated control commands reflect the current operating conditions and achieving the stability and consistency of the cloud-edge collaborative system.
Smart Images

Figure CN121657540A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of digital control of metering pumps and cloud-edge collaborative data processing technology, and more specifically, to a method for generating digital control commands for metering pumps. Background Technology
[0002] In the existing digital control system for metering pumps, the cloud typically generates digital control commands for the next stage based on historical operating patterns, pump characteristic models, and production plans. Meanwhile, edge nodes rely on real-time data such as pressure fluctuations, pulse feedback, and flow changes to correct cloud commands on-site and execute them immediately. Since cloud data is mostly an abstract and macroscopic historical structure, while edge data is highly dependent on instantaneous operating conditions, there are inherent differences between the two sides in terms of information completeness, timeliness, and operating condition background. However, the current mainstream architecture does not establish any mechanism to identify or reconcile this inconsistency in understanding, which means that the cloud and edge may have different interpretations of the same operating condition from the very beginning. When data corruption or model distortion occurs in the cloud, or edge nodes experience a short-term loss of connection, the system usually relies on data disaster recovery mechanisms to roll back to a historical snapshot and use this snapshot as a baseline for generating new instructions to continue running. However, such snapshots only record the digital state, control parameters, and some intermediate quantities at that time, but do not retain the physical conditions and operating background that enabled these data to exist, such as the degree of pump wear, changes in pipeline resistance, valve response delays, and sudden changes in liquid properties. After disaster recovery, the cloud is actually re-deriving control instructions without the basis of the on-site environment, while the edge nodes execute these instructions based on the current real operating conditions. From the first step of system recovery, the cloud and the edge fall back into two completely different logical tracks. Therefore, the lack of an effective mechanism for judging whether disaster recovery snapshots are still suitable for the current operating conditions has led to the cloud continuing to generate new instructions based on the outdated control baseline after recovery. This has caused the cloud-edge collaborative control chain to slowly accumulate and become difficult to detect in a timely manner over a long period of time, which has become an urgent problem to be solved. Summary of the Invention
[0003] To overcome the aforementioned deficiencies of the prior art, embodiments of the present invention provide a method for generating digital control commands for metering pumps. This method involves performing segmented reconstruction of the historical snapshot structure and baseline extraction of the real-time operating conditions after data disaster recovery, generating a mapping residual sequence between the two baselines and writing it into the reconstruction. This enables the cloud to generate digital control commands based on the reconstructed baseline after on-site correction, thereby solving the problem of command offset in the cloud-edge collaborative system after disaster recovery.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for generating digital control commands for a metering pump, comprising: S1. Extract the historical snapshot sampling sequence from the cloud recovery operation, segment the historical snapshot sampling sequence according to the sampling time, identify the mutation interval according to the rate of change of the sampled value, split each segment into sub-segments according to the mutation interval, and connect all sub-segments in chronological order to form the first baseline sequence. S2. Collect real-time operating condition sampling sequences from edge nodes, perform sliding scans on the real-time operating condition sampling sequences in fixed windows, calculate the data gradient for each window to identify stable segments and disturbed segments, and splice the stable segments and disturbed segments in time order to form the second baseline sequence. S3. Perform segment-level correspondence matching between the first baseline sequence and the second baseline sequence. Calculate the numerical interval overlap for each pair of corresponding segments. Divide the difference between the overlapping intervals into multiple interval difference segments according to the interval boundaries. Connect all interval difference segments in the matching order to form a mapping residual sequence. S4. Write the mapped residual sequence into the corresponding sub-segment of the first baseline sequence, perform residual cancellation processing on the written sub-segment, and then rearrange all sub-segments according to the magnitude of the difference between the sub-segments after residual cancellation to generate the reconstructed baseline sequence. S5. The reconstructed baseline sequence is executed segment by segment, and numerical expansion and conversion are performed on each segment. The converted segments are connected in chronological order to form the target instruction sequence, and the target instruction sequence is executed by the edge nodes.
[0005] In a preferred embodiment, S1 further includes reading the sampled values and corresponding timestamps of the metering pump operation process from the data recovered from the cloud, arranging the sampled values and timestamps in the order of the timestamps to form a historical snapshot sampling sequence; Perform a difference operation on adjacent sampled values in the historical snapshot sampling sequence, divide the difference result by the time interval corresponding to the adjacent sampled values to obtain the sampled value change rate, and arrange the obtained sampled value change rates in chronological order to generate a sampled value change rate sequence; A comparison operation is performed between the rate of change of each sampled value in the sampled value change rate sequence and a preset rate of change threshold. Positions with absolute values greater than the rate of change threshold are identified as mutation positions, and positions with absolute values not greater than the rate of change threshold are identified as non-mutation positions. Mutation positions with adjacent distances less than a preset lower limit of interval are merged into mutation intervals. The historical snapshot sampling sequence is cut according to the start and end times of each mutation interval to form multiple sampling value segments. The number of sampling values in each sampling value segment is compared with a preset lower limit of sampling number. Sampling value segments with a number of sampling values greater than or equal to the lower limit of sampling number are marked as sub-segments, and sampling value segments with a number of sampling values less than the lower limit of sampling number are removed. Connect all segments in timestamp order to generate the first baseline sequence.
[0006] In a preferred embodiment, S2 further includes reading real-time operating condition sample values and corresponding timestamps from edge nodes, performing continuity verification on the read timestamps, performing merging processing on sample values with timestamp intervals lower than a preset lower limit, performing interpolation processing on sample values with timestamp intervals higher than a preset upper limit, and arranging the sample values after merging and interpolation processing in the order of timestamps to form a real-time operating condition sampling sequence. The real-time operating condition sampling sequence is divided into sliding segments with a fixed window length. The real-time operating condition sampling values in each sliding window are numbered sequentially according to the timestamp. The sampling values with adjacent numbers are subjected to a difference operation. The difference operation result is divided by the corresponding time interval to generate multiple data gradient values. The multiple data gradient values are arranged in order of number to form a window gradient sequence. After generating the window gradient sequence, the time intervals within the window are compared with the preset upper limit of the time interval: The positions where the time interval is greater than the preset upper limit of the time interval are marked as abnormal window positions, and the sampling value interval containing the abnormal window positions is interpolated again to correct the real-time operating condition sampling sequence. Positions with time intervals less than or equal to the preset upper limit of time intervals are marked as normal window positions, and the original data structure is maintained for the sampled value intervals corresponding to the normal window positions.
[0007] In a preferred embodiment, S2 further includes performing structural partitioning on the window gradient sequence according to the sign change of the data gradient values, connecting data gradient values with the same sign in numerical order to form gradient structure blocks, performing statistics on the absolute value of the data gradient values of each gradient structure block, and comparing the statistical results with a preset gradient threshold. When the statistical result is lower than or equal to the preset gradient threshold, the corresponding gradient structure block is identified as a stable segment; When the statistical result is higher than the preset gradient threshold, the corresponding gradient structure block is identified as a perturbation segment; The sampling value intervals containing the identified stable and perturbation segments are re-sliding and segmented to correct the window segmentation results of the window gradient sequence. The stable and perturbation segments obtained after correction are folded at the time stamp order. Stable segments with consecutive time stamps are merged, and perturbation segments with consecutive time stamps are merged. The merged stable segments and the merged perturbation segments are then connected in time stamp order to generate the second baseline sequence.
[0008] In a preferred embodiment, S3 further includes reading the timestamp range of each segment in the first baseline sequence and performing an interval intersection operation between the timestamp range of the segment and the timestamp range of the stable segment and the timestamp range of the perturbation segment in the second baseline sequence. The stable and perturbation segments with intersecting timestamp ranges are identified as target segments, and each sub-segment is paired with the corresponding target segment to form a set of corresponding segment pairs. For each corresponding segment pair in the corresponding segment pair set, read the numerical range of the sub-segment and the numerical range of the target segment respectively, and perform a comparison operation between the starting boundary of the numerical range of the sub-segment and the starting boundary of the numerical range of the target segment. When the starting boundary of the numerical range of a sub-segment is greater than the starting boundary of the numerical range of the target segment, the starting boundary of the numerical range of the sub-segment is determined as the starting boundary of the overlapping range. When the starting boundary of the numerical interval of a sub-segment is less than or equal to the starting boundary of the numerical interval of the target segment, the starting boundary of the numerical interval of the target segment is determined as the starting boundary of the overlapping interval.
[0009] In a preferred embodiment, step S3 further includes performing a comparison operation between the end boundary of the numerical range of the sub-segment and the end boundary of the numerical range of the target segment: When the ending boundary of the numerical range of a sub-segment is less than the ending boundary of the numerical range of the target segment, the ending boundary of the numerical range of the sub-segment is determined as the ending boundary of the overlapping range. When the end boundary of the numerical range of a sub-segment is greater than or equal to the end boundary of the numerical range of the target segment, the end boundary of the numerical range of the target segment is determined as the end boundary of the overlapping interval. Perform a comparison operation between the start boundary and the end boundary of the overlapping interval: When the starting boundary of the overlapping interval is less than the ending boundary of the overlapping interval, the numerical range of the overlapping interval is taken as the numerical interval overlap. When the starting boundary of the overlapping interval is greater than or equal to the ending boundary of the overlapping interval, the overlap of the numerical interval is set to zero. For each corresponding segment, the numerical range of the sub-segment and the numerical range of the target segment are respectively subjected to the difference operation with the overlapping interval to obtain the difference interval. Then, the difference interval is segmented according to the start and end boundaries to generate multiple interval difference segments. All interval difference segments are sequentially connected according to the time order of each corresponding segment pair in the corresponding segment pair set to form a mapping residual sequence.
[0010] In a preferred embodiment, S4 further includes sequentially reading interval difference segments in the mapped residual sequence and performing interval alignment determination between the timestamp range of each interval difference segment and the timestamp range of the corresponding sub-segment in the first baseline sequence. For interval difference segments that can form interval alignment relationships, record the correspondence between the interval boundary of the interval difference segment and the interval boundary of the corresponding sub-segment, generate a write influence map, and write the interval difference segment to the corresponding sub-segment according to the write influence map to form a set of written sub-segments. For each sub-segment in the set of sub-segments to be written, read the numerical range of the corresponding sub-segment before writing and the numerical range after writing, and perform differential processing according to the interval correspondence in the writing influence diagram. Write the numerical difference obtained by differential processing into the numerical range after writing to generate the sub-segment after residual cancellation. For each sub-segment after residual cancellation, read the numerical range after residual cancellation and the numerical range of the corresponding sub-segment before writing, perform statistical processing on the change of the interval boundary between the two and the numerical difference obtained by the difference processing, generate the sub-segment difference magnitude, and form a difference magnitude sequence of all sub-segments from low to high. All segments are rearranged according to the magnitude of difference, and the rearranged segments are then concatenated sequentially according to the timestamp order of the first baseline sequence to generate a reconstructed baseline sequence.
[0011] In a preferred embodiment, S5 further includes reading the sub-segments sequentially according to the timestamp order of the sub-segments in the reconstructed baseline sequence, connecting the read sub-segments sequentially in the reading order to form an instruction derivation chain, and recording the position of each sub-segment in the instruction derivation chain as the derivation position of that sub-segment. Read the numerical range of each sub-segment in the instruction derivation chain, and perform numerical expansion according to the derivation position of each sub-segment. Perform boundary-level expansion processing on the start and end boundaries of the numerical range according to the expansion amount corresponding to the derivation position. Write the expanded start and end boundaries into the corresponding sub-segments to form the expanded sub-segment set. Read the numerical range of each expanded sub-segment in the expanded sub-segment set, and perform numerical conversion according to the derivation position of each expanded sub-segment. Perform boundary-level conversion processing on the start and end boundaries of the expanded sub-segments according to the conversion factor corresponding to the derivation position. Write the converted start and end boundaries into the corresponding sub-segments to form the converted sub-segment set. The converted sub-segment sets are sequentially connected according to the timestamp order of the reconstructed baseline sequence to form a sub-segment reconstruction sequence. The sub-segment reconstruction sequences are then connected as a whole to generate a target instruction sequence, which is then sent to the edge nodes for execution.
[0012] The technical effects and advantages of this invention are as follows: This solution constructs a first baseline sequence and a second baseline sequence from historical snapshot sampling sequences and real-time operating condition sampling sequences, respectively, and reconstructs the first baseline sequence using a mapped residual sequence. This enables the command generation baseline after cloud recovery to be realigned with the current operating condition, fundamentally solving the command offset problem caused by cloud-edge cognitive split after disaster recovery. This solution identifies abrupt change intervals and segments historical snapshot samples to restore the originally macroscopic and abstract historical data into a first baseline sequence with boundary structure, enabling disaster recovery snapshots to express their internal change background in a structured way. This solution transforms the constantly changing field data into a second baseline sequence with continuous operating condition expression by performing window gradient analysis, gradient structure block division, and stable and disturbance segment identification on the real-time operating condition sampling sequence. This enables the field operating conditions to participate in the correction process of the cloud control command generation chain in a structured manner. This scheme generates a mapping residual sequence between two baselines and writes the interval difference segments into the corresponding sub-segments according to the influence map, so that the difference between the historical baseline and the real-time operating condition can be expressed in a traceable and offsetting way, providing a unified numerical basis for subsequent baseline rearrangement and instruction derivation chain. This solution reconstructs the baseline sequence by sorting and rearranging the segments after residual cancellation according to their magnitude of difference. This ensures that the derivation order of cloud control commands reflects the true sequence of changes in on-site operating conditions, guaranteeing the executable nature of the final generated target command sequence. Attached Figure Description
[0013] Figure 1 This is a flowchart of the method steps of the present invention. Detailed Implementation
[0014] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0015] Refer to the instruction manual appendix Figure 1 An embodiment of the present invention provides a method for generating digital control commands for a metering pump, comprising: S1. Extract the historical snapshot sampling sequence from the cloud recovery operation, segment the historical snapshot sampling sequence according to the sampling time, identify the mutation interval according to the rate of change of the sampled value, split each segment into sub-segments according to the mutation interval, and connect all sub-segments in chronological order to form the first baseline sequence. S2. Collect real-time operating condition sampling sequences from edge nodes, perform sliding scans on the real-time operating condition sampling sequences in fixed windows, calculate the data gradient for each window to identify stable segments and disturbed segments, and splice the stable segments and disturbed segments in time order to form the second baseline sequence. S3. Perform segment-level correspondence matching between the first baseline sequence and the second baseline sequence. Calculate the numerical interval overlap for each pair of corresponding segments. Divide the difference between the overlapping intervals into multiple interval difference segments according to the interval boundaries. Connect all interval difference segments in the matching order to form a mapping residual sequence. S4. Write the mapped residual sequence into the corresponding sub-segment of the first baseline sequence, perform residual cancellation processing on the written sub-segment, and then rearrange all sub-segments according to the magnitude of the difference between the sub-segments after residual cancellation to generate the reconstructed baseline sequence. S5. The reconstructed baseline sequence is executed segment by segment, and numerical expansion and conversion are performed on each segment. The converted segments are connected in chronological order to form the target instruction sequence, and the target instruction sequence is executed by the edge nodes.
[0016] S1 also includes reading the sampled values and corresponding timestamps of the metering pump operation process from the data recovered from the cloud, arranging the sampled values and timestamps in the order of timestamps to form a historical snapshot sampling sequence; Perform a difference operation on adjacent sampled values in the historical snapshot sampling sequence, divide the difference result by the time interval corresponding to the adjacent sampled values to obtain the sampled value change rate, and arrange the obtained sampled value change rates in chronological order to generate a sampled value change rate sequence; A comparison operation is performed between the rate of change of each sampled value in the sampled value change rate sequence and a preset rate of change threshold. Positions with absolute values greater than the rate of change threshold are identified as mutation positions, and positions with absolute values not greater than the rate of change threshold are identified as non-mutation positions. Mutation positions with adjacent distances less than a preset lower limit of interval are merged into mutation intervals. The historical snapshot sampling sequence is cut according to the start and end times of each mutation interval to form multiple sampling value segments. The number of sampling values in each sampling value segment is compared with a preset lower limit of sampling number. Sampling value segments with a number of sampling values greater than or equal to the lower limit of sampling number are marked as sub-segments, and sampling value segments with a number of sampling values less than the lower limit of sampling number are removed. Connect all segments in timestamp order to generate the first baseline sequence.
[0017] In S2, the process also includes reading real-time operating condition sample values and corresponding timestamps from edge nodes, performing continuity verification on the read timestamps, merging sample values with timestamp intervals lower than a preset lower limit, interpolating sample values with timestamp intervals higher than a preset upper limit, and arranging the merged and interpolated sample values in the order of timestamps to form a real-time operating condition sample sequence. The real-time operating condition sampling sequence is divided into sliding segments with a fixed window length. The real-time operating condition sampling values in each sliding window are numbered sequentially according to the timestamp. The sampling values with adjacent numbers are subjected to a difference operation. The difference operation result is divided by the corresponding time interval to generate multiple data gradient values. The multiple data gradient values are arranged in order of number to form a window gradient sequence. After generating the window gradient sequence, the time intervals within the window are compared with the preset upper limit of the time interval: The positions where the time interval is greater than the preset upper limit of the time interval are marked as abnormal window positions, and the sampling value interval containing the abnormal window positions is interpolated again to correct the real-time operating condition sampling sequence. Positions with time intervals less than or equal to the preset upper limit of time intervals are marked as normal window positions, and the original data structure is maintained for the sampled value intervals corresponding to the normal window positions.
[0018] S2 also includes structural partitioning of the window gradient sequence according to the sign change of the data gradient values, connecting data gradient values with the same sign in numerical order to form gradient structure blocks, performing statistics on the absolute value of the data gradient values of each gradient structure block, and comparing the statistical results with a preset gradient threshold. When the statistical result is lower than or equal to the preset gradient threshold, the corresponding gradient structure block is identified as a stable segment; When the statistical result is higher than the preset gradient threshold, the corresponding gradient structure block is identified as a perturbation segment; The sampling value intervals containing the identified stable and perturbation segments are re-sliding and segmented to correct the window segmentation results of the window gradient sequence. The stable and perturbation segments obtained after correction are folded at the time stamp order. Stable segments with consecutive time stamps are merged, and perturbation segments with consecutive time stamps are merged. The merged stable segments and the merged perturbation segments are then connected in time stamp order to generate the second baseline sequence.
[0019] S3 also includes reading the timestamp range of each segment in the first baseline sequence and performing an interval intersection operation between the timestamp range of the segment and the timestamp range of the stable segment and the timestamp range of the perturbation segment in the second baseline sequence. The stable and perturbation segments with intersecting timestamp ranges are identified as target segments, and each sub-segment is paired with the corresponding target segment to form a set of corresponding segment pairs. For each corresponding segment pair in the corresponding segment pair set, read the numerical range of the sub-segment and the numerical range of the target segment respectively, and perform a comparison operation between the starting boundary of the numerical range of the sub-segment and the starting boundary of the numerical range of the target segment. When the starting boundary of the numerical range of a sub-segment is greater than the starting boundary of the numerical range of the target segment, the starting boundary of the numerical range of the sub-segment is determined as the starting boundary of the overlapping range. When the starting boundary of the numerical interval of a sub-segment is less than or equal to the starting boundary of the numerical interval of the target segment, the starting boundary of the numerical interval of the target segment is determined as the starting boundary of the overlapping interval.
[0020] S3 also includes performing a comparison operation between the end boundary of the numerical range of the sub-segment and the end boundary of the numerical range of the target segment: When the ending boundary of the numerical range of a sub-segment is less than the ending boundary of the numerical range of the target segment, the ending boundary of the numerical range of the sub-segment is determined as the ending boundary of the overlapping range. When the end boundary of the numerical range of a sub-segment is greater than or equal to the end boundary of the numerical range of the target segment, the end boundary of the numerical range of the target segment is determined as the end boundary of the overlapping interval. Perform a comparison operation between the start boundary and the end boundary of the overlapping interval: When the starting boundary of the overlapping interval is less than the ending boundary of the overlapping interval, the numerical range of the overlapping interval is taken as the numerical interval overlap. When the starting boundary of the overlapping interval is greater than or equal to the ending boundary of the overlapping interval, the overlap of the numerical interval is set to zero. For each corresponding segment, the numerical range of the sub-segment and the numerical range of the target segment are respectively subjected to the difference operation with the overlapping interval to obtain the difference interval. Then, the difference interval is segmented according to the start and end boundaries to generate multiple interval difference segments. All interval difference segments are sequentially connected according to the time order of each corresponding segment pair in the corresponding segment pair set to form a mapping residual sequence.
[0021] In S4, the method also includes sequentially reading the interval difference segments in the mapped residual sequence and performing interval alignment determination between the timestamp range of each interval difference segment and the timestamp range of the corresponding sub-segment in the first baseline sequence. For interval difference segments that can form interval alignment relationships, record the correspondence between the interval boundary of the interval difference segment and the interval boundary of the corresponding sub-segment, generate a write influence map, and write the interval difference segment to the corresponding sub-segment according to the write influence map to form a set of written sub-segments. For each sub-segment in the set of sub-segments to be written, read the numerical range of the corresponding sub-segment before writing and the numerical range after writing, and perform differential processing according to the interval correspondence in the writing influence diagram. Write the numerical difference obtained by differential processing into the numerical range after writing to generate the sub-segment after residual cancellation. For each sub-segment after residual cancellation, read the numerical range after residual cancellation and the numerical range of the corresponding sub-segment before writing, perform statistical processing on the change of the interval boundary between the two and the numerical difference obtained by the difference processing, generate the sub-segment difference magnitude, and form a difference magnitude sequence of all sub-segments from low to high. All segments are rearranged according to the magnitude of difference, and the rearranged segments are then concatenated sequentially according to the timestamp order of the first baseline sequence to generate a reconstructed baseline sequence.
[0022] In S5, the sub-segments are read sequentially according to the timestamp order of the sub-segments in the reconstructed baseline sequence, the read sub-segments are connected sequentially in the reading order to form an instruction derivation chain, and the position of each sub-segment in the instruction derivation chain is recorded as the derivation position of that sub-segment. Read the numerical range of each sub-segment in the instruction derivation chain, and perform numerical expansion according to the derivation position of each sub-segment. Perform boundary-level expansion processing on the start and end boundaries of the numerical range according to the expansion amount corresponding to the derivation position. Write the expanded start and end boundaries into the corresponding sub-segments to form the expanded sub-segment set. Read the numerical range of each expanded sub-segment in the expanded sub-segment set, and perform numerical conversion according to the derivation position of each expanded sub-segment. Perform boundary-level conversion processing on the start and end boundaries of the expanded sub-segments according to the conversion factor corresponding to the derivation position. Write the converted start and end boundaries into the corresponding sub-segments to form the converted sub-segment set. The converted sub-segment sets are sequentially connected according to the timestamp order of the reconstructed baseline sequence to form a sub-segment reconstruction sequence. The sub-segment reconstruction sequences are then connected as a whole to generate a target instruction sequence, which is then sent to the edge nodes for execution.
[0023] This solution is based on an in-depth analysis of the structural deviation problem in the digital control chain of metering pumps in the existing cloud-edge collaborative system. In the existing architecture, the cloud and edge nodes maintain independent data chains: the cloud relies on historical operation records and model-derived control commands, while the edge nodes rely on field sampled values to execute real-time responses. The two are inherently different in their perception of operating conditions. Especially when the system fails, disconnects, lags, or the model fails, the cloud usually needs to rely on a data disaster recovery mechanism to roll back to a certain historical snapshot. However, the snapshot obtained after recovery only contains sampled values, parameters, and digital states, and does not include the actual operating conditions at that time. At the same time, the edge nodes continue to maintain real-time control based on the current pressure changes, flow feedback, and pulse signals. Because there is a structural difference between the snapshot restored by the cloud and the current operating conditions of the edge nodes, the two begin to run along different logical paths from the first step after disaster recovery, causing the entire cloud-edge collaborative system to gradually deviate. This solution enables the cloud to re-establish a consistent baseline of operating conditions with the edge nodes after disaster recovery by constructing a complete chain of historical snapshot structure reconstruction, on-site operating condition structuring, dual baseline alignment, difference extraction, residual writing, structure rearrangement, and final instruction derivation. This solution obtains historical snapshot sampling sequences from cloud recovery operations, sorts and performs adjacent difference processing on the sampled values and timestamps, and then combines the difference results with the sampling interval to convert them into the rate of change of sampled values. The rate of change is used to identify mutation locations, merge them to form mutation intervals, and then cut historical snapshots into intervals and select effective segments to form sub-segments based on the lower limit of the number of samples. All sub-segments are connected in chronological order to form the first baseline sequence. The first baseline sequence is a stable structure extracted from disaster recovery snapshots that can be used for comparison, so that the historical state recovered from the cloud has a structured expression. Subsequently, by performing timestamp continuity verification on the real-time operating condition sampling sequence of the edge nodes, data with intervals below the lower limit are merged, and data with intervals above the upper limit are interpolated to correct the irregularities in the operating condition data during field acquisition. Then, sliding segmentation is performed according to a fixed window, and the sampled values within the window are differentially processed to obtain the data gradient sequence. Gradient structure blocks are formed according to the sign change. Then, stable segments and disturbed segments are identified based on the absolute value of the gradient, and re-segmentation and segment-level folding are performed on the two respectively to finally form the second baseline sequence. The second baseline sequence represents the structured expression of the current field operating conditions of the edge nodes. Next, by performing timestamp interval intersection operations on the sub-segments, stable segments, and disturbed segments, a set of corresponding segment pairs is formed. Then, the overlapping intervals are calculated by comparing the start and end boundaries of each segment pair, and finally the difference between the overlapping intervals is obtained. The difference intervals are divided into multiple interval difference segments according to the boundaries, and then connected in chronological order to form a mapping residual sequence. The mapping residual sequence is essentially a structural difference mapping between the cloud baseline after data disaster recovery and the real-time field working condition baseline, preserving the position, width, and direction of the difference in the form of intervals. Next, an impact map is constructed and written through interval alignment determination. Then, differential processing is performed on the sub-segment numerical intervals according to the boundary correspondence in the impact map to generate sub-segments after residual cancellation. Subsequently, the boundary changes and numerical differences of the sub-segments after residual cancellation are read and statistically analyzed. The statistical results are used to form the sub-segment difference magnitude. Then, all sub-segments are rearranged according to the difference magnitude to finally obtain the reconstructed baseline sequence. At this time, the reconstructed baseline sequence is no longer a simple data disaster recovery snapshot, but a cloud effective baseline after on-site residual structure correction, which re-aligns the cloud and edge nodes structurally. This solution establishes an instruction derivation chain, then performs numerical expansion on the numerical range of each sub-segment according to the derivation position to obtain the expanded sub-segment; then performs numerical conversion on the boundary of the expanded sub-segment according to the derivation position to obtain the converted sub-segment set; the converted sub-segments are connected in timestamp order to form a sub-segment reconstruction sequence, and then connected to generate the target instruction sequence, which is executed by the edge node. This achieves instruction consistency of the cloud-edge collaborative system after data disaster recovery: the cloud will no longer generate control instructions based on historical snapshots detached from the site, but will execute derivation based on the reconstruction baseline obtained by historical structure and site residual correction, so that the cloud control logic after recovery is consistent with the site again; Therefore, this solution starts with the reconstruction of historical snapshots after data disaster recovery. Based on the segment-level correspondence between the first baseline sequence in the cloud and the second baseline sequence in the edge node, it establishes the difference expression between the historical structure and the real-time operating conditions by mapping the residual sequence. Then, it constructs the reconstructed baseline by writing the residual and rearranging the sub-segments. Finally, it completes the generation of the target command consistent with the field by using the command derivation chain, forming a complete and progressively iterative cloud-edge collaborative control chain. This enables the cloud to regain the ability to correspond to the real operating conditions after disaster recovery, ensuring the stability of digital control commands in long-term operation.
[0024] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating digital control commands for a metering pump, characterized in that, include: S1. Extract the historical snapshot sampling sequence from the cloud recovery operation, segment the historical snapshot sampling sequence according to the sampling time, identify the mutation interval according to the rate of change of the sampled value, split each segment into sub-segments according to the mutation interval, and connect all sub-segments in chronological order to form the first baseline sequence. S2. Collect real-time operating condition sampling sequences from edge nodes, perform sliding scans on the real-time operating condition sampling sequences in fixed windows, calculate the data gradient for each window to identify stable segments and disturbed segments, and splice the stable segments and disturbed segments in time order to form the second baseline sequence. S3. Perform segment-level correspondence matching between the first baseline sequence and the second baseline sequence. Calculate the numerical interval overlap for each pair of corresponding segments. Divide the difference between the overlapping intervals into multiple interval difference segments according to the interval boundaries. Connect all interval difference segments in the matching order to form a mapping residual sequence. S4. Write the mapped residual sequence into the corresponding sub-segment of the first baseline sequence, perform residual cancellation processing on the written sub-segment, and then rearrange all sub-segments according to the magnitude of the difference between the sub-segments after residual cancellation to generate the reconstructed baseline sequence. S5. The reconstructed baseline sequence is executed segment by segment, and numerical expansion and conversion are performed on each segment. The converted segments are connected in chronological order to form the target instruction sequence, and the target instruction sequence is executed by the edge nodes.
2. The method for generating digital control commands for a metering pump according to claim 1, characterized in that: S1 also includes reading the sampled values and corresponding timestamps of the metering pump operation process from the data recovered from the cloud, arranging the sampled values and timestamps in the order of timestamps to form a historical snapshot sampling sequence; Perform a difference operation on adjacent sampled values in the historical snapshot sampling sequence, divide the difference result by the time interval corresponding to the adjacent sampled values to obtain the sampled value change rate, and arrange the obtained sampled value change rates in chronological order to generate a sampled value change rate sequence; A comparison operation is performed between the rate of change of each sampled value in the sampled value change rate sequence and a preset rate of change threshold. Positions with an absolute value greater than the rate of change threshold are identified as mutation positions, and positions with an absolute value not greater than the rate of change threshold are identified as non-mutation positions. Mutation positions with an adjacent distance less than a preset lower limit of the interval are merged into mutation intervals. The historical snapshot sampling sequence is cut according to the start and end times of each mutation interval to form multiple sampling value segments. The number of sampling values in each sampling value segment is compared with a preset lower limit of sampling number. Sampling value segments with a number of sampling values greater than or equal to the lower limit of sampling number are marked as sub-segments, and sampling value segments with a number of sampling values less than the lower limit of sampling number are removed. Connect all segments in timestamp order to generate the first baseline sequence.
3. The method for generating digital control commands for a metering pump according to claim 2, characterized in that: In S2, the process also includes reading real-time operating condition sample values and corresponding timestamps from edge nodes, performing continuity verification on the read timestamps, merging sample values with timestamp intervals lower than a preset lower limit, interpolating sample values with timestamp intervals higher than a preset upper limit, and arranging the merged and interpolated sample values in the order of timestamps to form a real-time operating condition sample sequence. The real-time operating condition sampling sequence is divided into sliding segments with a fixed window length. The real-time operating condition sampling values in each sliding window are numbered sequentially according to the timestamp. The sampling values with adjacent numbers are subjected to a difference operation. The difference operation result is divided by the corresponding time interval to generate multiple data gradient values. The multiple data gradient values are arranged in order of number to form a window gradient sequence. After generating the window gradient sequence, the time intervals within the window are compared with the preset upper limit of the time interval: The positions where the time interval is greater than the preset upper limit of the time interval are marked as abnormal window positions, and the sampling value interval containing the abnormal window positions is interpolated again to correct the real-time operating condition sampling sequence. Positions with time intervals less than or equal to the preset upper limit of time intervals are marked as normal window positions, and the original data structure is maintained for the sampled value intervals corresponding to the normal window positions.
4. The method for generating digital control commands for a metering pump according to claim 3, characterized in that: S2 also includes structural partitioning of the window gradient sequence according to the sign change of the data gradient values, connecting data gradient values with the same sign in numerical order to form gradient structure blocks, performing statistics on the absolute value of the data gradient values of each gradient structure block, and comparing the statistical results with a preset gradient threshold. When the statistical result is lower than or equal to the preset gradient threshold, the corresponding gradient structure block is identified as a stable segment; When the statistical result is higher than the preset gradient threshold, the corresponding gradient structure block is identified as a perturbation segment; The sampling value intervals containing the identified stable and perturbation segments are re-sliding and segmented to correct the window segmentation results of the window gradient sequence. The stable and perturbation segments obtained after correction are folded at the time stamp order. Stable segments with consecutive time stamps are merged, and perturbation segments with consecutive time stamps are merged. The merged stable segments and the merged perturbation segments are then connected in time stamp order to generate the second baseline sequence.
5. The method for generating digital control commands for a metering pump according to claim 4, characterized in that: S3 also includes reading the timestamp range of each segment in the first baseline sequence and performing an interval intersection operation between the timestamp range of the segment and the timestamp range of the stable segment and the timestamp range of the perturbation segment in the second baseline sequence. The stable and perturbation segments with intersecting timestamp ranges are identified as target segments, and each sub-segment is paired with the corresponding target segment to form a set of corresponding segment pairs. For each corresponding segment pair in the corresponding segment pair set, read the numerical range of the sub-segment and the numerical range of the target segment respectively, and perform a comparison operation between the starting boundary of the numerical range of the sub-segment and the starting boundary of the numerical range of the target segment. When the starting boundary of the numerical range of a sub-segment is greater than the starting boundary of the numerical range of the target segment, the starting boundary of the numerical range of the sub-segment is determined as the starting boundary of the overlapping range. When the starting boundary of the numerical interval of a sub-segment is less than or equal to the starting boundary of the numerical interval of the target segment, the starting boundary of the numerical interval of the target segment is determined as the starting boundary of the overlapping interval.
6. The method for generating digital control commands for a metering pump according to claim 5, characterized in that: S3 also includes performing a comparison operation between the end boundary of the numerical range of the sub-segment and the end boundary of the numerical range of the target segment: When the ending boundary of the numerical range of a sub-segment is less than the ending boundary of the numerical range of the target segment, the ending boundary of the numerical range of the sub-segment is determined as the ending boundary of the overlapping range. When the end boundary of the numerical range of a sub-segment is greater than or equal to the end boundary of the numerical range of the target segment, the end boundary of the numerical range of the target segment is determined as the end boundary of the overlapping interval. Perform a comparison operation between the start boundary and the end boundary of the overlapping interval: When the starting boundary of the overlapping interval is less than the ending boundary of the overlapping interval, the numerical range of the overlapping interval is taken as the numerical interval overlap. When the starting boundary of the overlapping interval is greater than or equal to the ending boundary of the overlapping interval, the overlap of the numerical interval is set to zero. For each corresponding segment, the numerical range of the sub-segment and the numerical range of the target segment are respectively subjected to the difference operation with the overlapping interval to obtain the difference interval. Then, the difference interval is segmented according to the start and end boundaries to generate multiple interval difference segments. All interval difference segments are sequentially connected according to the time order of each corresponding segment pair in the corresponding segment pair set to form a mapping residual sequence.
7. The method for generating digital control commands for a metering pump according to claim 6, characterized in that: In S4, the method also includes sequentially reading the interval difference segments in the mapped residual sequence and performing interval alignment determination between the timestamp range of each interval difference segment and the timestamp range of the corresponding sub-segment in the first baseline sequence. For interval difference segments that can form interval alignment relationships, record the correspondence between the interval boundary of the interval difference segment and the interval boundary of the corresponding sub-segment, generate a write influence map, and write the interval difference segment to the corresponding sub-segment according to the write influence map to form a set of written sub-segments. For each sub-segment in the set of sub-segments to be written, read the numerical range of the corresponding sub-segment before writing and the numerical range after writing, and perform differential processing according to the interval correspondence in the writing influence diagram. Write the numerical difference obtained by differential processing into the numerical range after writing to generate the sub-segment after residual cancellation. For each sub-segment after residual cancellation, read the numerical range after residual cancellation and the numerical range of the corresponding sub-segment before writing, perform statistical processing on the change of the interval boundary between the two and the numerical difference obtained by the difference processing, generate the sub-segment difference magnitude, and form a difference magnitude sequence of all sub-segments from low to high. All segments are rearranged according to the magnitude of difference, and the rearranged segments are then concatenated sequentially according to the timestamp order of the first baseline sequence to generate a reconstructed baseline sequence.
8. The method for generating digital control commands for a metering pump according to claim 7, characterized in that: In S5, the sub-segments are read sequentially according to the timestamp order of the sub-segments in the reconstructed baseline sequence, the read sub-segments are connected sequentially in the reading order to form an instruction derivation chain, and the position of each sub-segment in the instruction derivation chain is recorded as the derivation position of that sub-segment. Read the numerical range of each sub-segment in the instruction derivation chain, and perform numerical expansion according to the derivation position of each sub-segment. Perform boundary-level expansion processing on the start and end boundaries of the numerical range according to the expansion amount corresponding to the derivation position. Write the expanded start and end boundaries into the corresponding sub-segments to form the expanded sub-segment set. Read the numerical range of each expanded sub-segment in the expanded sub-segment set, and perform numerical conversion according to the derivation position of each expanded sub-segment. Perform boundary-level conversion processing on the start and end boundaries of the expanded sub-segments according to the conversion factor corresponding to the derivation position. Write the converted start and end boundaries into the corresponding sub-segments to form the converted sub-segment set. The converted sub-segment sets are sequentially connected according to the timestamp order of the reconstructed baseline sequence to form a sub-segment reconstruction sequence. The sub-segment reconstruction sequences are then connected as a whole to generate a target instruction sequence, which is then sent to the edge nodes for execution.