A method for isolating abnormal writes to a ring buffer based on an operations and maintenance platform

By using the cycle-end interruption latency difference calculation and isolation zone writing method supported by the operation and maintenance platform, the data overwriting problem of the circular buffer during abnormal writing is solved, and abnormal writing is accurately identified and isolated before it is full, thus ensuring data integrity.

CN123068321APending Publication Date: 2026-11-10浙江微特电子信息有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611576839.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-13
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

When the write rate is inconsistent, the circular buffer is prone to data overwriting or dropping. Existing detection methods are unable to identify abnormal writes in a timely and accurate manner before it is full, resulting in the loss of effective data.

Method used

With the support of the operation and maintenance platform, the write volume is calculated by using the interrupt delay difference at the end of the cycle, and an abnormal flag is built into the continuous over-limit and judgment window. Subsequent data blocks are written to the isolation area, and the read pointer continues to read unread data. The isolation area is used for cyclic overwrite writing.

Benefits of technology

It effectively reduces the distortion of write volume statistics caused by load fluctuations, ensures accurate identification of abnormal writes before the write volume is full, avoids loss of valid data, and automatically resumes writing after the abnormality disappears, reducing misjudgment and data loss.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123068321A_ABST
    Figure CN123068321A_ABST
Patent Text Reader

Abstract

This application discloses a method for isolating abnormal writes to a circular buffer based on an operation and maintenance platform, relating to the field of data processing technology. The method includes: writing interrupted data blocks into a circular buffer; at the end of each sampling period, obtaining the write amount by the period increment of the cumulative write offset of the write pointer, and obtaining the period-end interrupt delay by the difference between the period-end time and the interrupt trigger timestamp of the earliest unwritten data block; converting the write amount into a calibrated write amount based on the difference in period-end interrupt delays between adjacent sampling periods and including it in the effective period; when the calibrated write amount continuously exceeds the write amount tolerance in the local baseline and write evidence appears in the judgment window, setting an abnormal write flag, and switching the write target of subsequent data blocks to an isolation area not read by the read pointer, while the read pointer continues to read unread data; the initial value of the local baseline is issued by the operation and maintenance platform. This application has the advantages of reducing the interference of interrupt delay fluctuations on the judgment and allowing cached data to be read during the isolation period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method for isolating abnormal writes to a ring buffer based on an operation and maintenance platform. Background Technology

[0002] The computing node receives data through peripherals such as data acquisition cards and serial ports. Each time a piece of data is delivered by the peripheral, an interrupt is triggered. The driver writes the data block to a circular buffer during the interrupt handling, and the processing process reads it out at its own pace. The write and read rates are inconsistent, and the circular buffer is used to absorb this difference. When the access device fails, the link is disrupted, or external traffic is amplified, the amount of data entering the buffer may far exceed the configured input rate in a short period of time, i.e., abnormal write.

[0003] The circular buffer has a limited capacity, and the time from the start of an abnormal write to filling it is often only on the order of milliseconds. After it is full, subsequent data either overwrites valid data that has not yet been read, or is discarded in its entirety, resulting in gaps in the data retrieved by the processing process. Judgment and handling must be done before it becomes full. Current practices generally include four approaches: overwriting, discarding, or blocking data when the occupancy rate exceeds the high watermark; limiting and discarding data when the write rate or its rate of change exceeds a threshold; clearing the buffer or realigning read / write pointers after overflow; and determining the appropriate approach based on the degree of deviation after each node learns its baseline.

[0004] All four paths face the same contradiction: judgment must be made before the buffer is full, but the judgment criteria become distorted with fluctuations in node load, making it difficult to achieve both timeliness and reliability. Write volume is statistically analyzed based on the time data blocks are written to the buffer, but the interval between the arrival of a data block and its writing includes the delayed execution time of interrupt handling. The second half of interrupt handling is scheduled along with normal tasks, and this timeframe lengthens as load increases and shortens as load decreases. The arrival time corresponding to the same statistical period varies, resulting in artificially low or high write volumes. To suppress such false positives, the threshold is relaxed or the judgment period is lengthened, but abnormal writes are only detected after several more periods, by which time the buffer is often full and unread data has been overwritten. Conversely, tightening the threshold and shortening the period leads to frequent false positives and rate limiting or data dropping for normal business operations.

[0005] The other three paths also fall at the two ends of this contradiction: high occupancy levels merge the cumulative amounts of writes and reads into the same difference, the temporary slow read process and the continuous injection from peripherals trigger the same action, and the valid data cached before the exception is damaged; after overflow, the reset pushes the judgment to after it is full, and the valid readable data is also invalidated; each node learns the baseline, but there is no baseline available during the learning period, and the slowly rising abnormal writes are gradually absorbed into the baseline. Summary of the Invention

[0006] In order to detect abnormal writes before the circular buffer is full and to ensure that the criteria are not distorted by fluctuations in the compute node load, this application provides a method for isolating abnormal writes to the circular buffer based on an operation and maintenance platform.

[0007] This application provides a ring buffer abnormal write isolation method based on an operation and maintenance platform, which adopts the following technical solution: A method for isolating abnormal writes to a ring buffer based on an operations and maintenance platform includes: S1. Write the interrupted data block into the circular buffer; S2. At the end of each sampling period, the period increment of the cumulative write offset of the write pointer is used as the write amount, and the difference between the end of the period and the earliest interrupt trigger timestamp of the data block that has not yet been written is used as the interrupt delay at the end of the period. If there is no data block that has not yet been written, it is zero. S3. The difference between the current and previous sampling period's end-of-period interruption delay is used as the end-of-period delay difference. For sampling periods where the absolute value of the end-of-period delay difference does not exceed a preset delay difference ratio of the period duration and is less than the period duration, the write amount is converted into the calibrated write amount and included in the effective period according to the ratio of the period duration to the difference between the period duration and the end-of-period delay difference. S4. Use the increment of the write amount after calibration of adjacent valid cycles as the write amount change value; S5. In response to the fact that the effective period of the write volume exceeding the initial value of the local baseline issued by the operation and maintenance platform after calibration reaches a preset number of consecutive periods, and write evidence appears in the judgment window formed by each effective period that exceeds the limit and the immediately preceding effective period, the abnormal write flag is set, wherein the write evidence includes the case where the change value of the write volume exceeds the change value tolerance of the local baseline. S6. In response to the abnormal write flag being set, the write target of subsequent data blocks is switched to the isolation area that the read pointer does not read, and the write is cyclically overwritten in at least part of the isolation area. The read pointer reads the data blocks that have not been read from the circular buffer.

[0008] By adopting the above technical solution, the write volume and the interruption delay at the end of the cycle are taken from the same sampling period. Therefore, the write volume statistically based on the write time can be converted into the calibrated write volume based on the arrival time using the difference in the delay at the end of the cycle. When the arrival rate is approximately stable, the delayed write caused by load fluctuations and backlog make-up writes no longer manifest as sudden drops or increases in the write volume. On this basis, the AND gate setting flag for continuous over-limit and write evidence appearing in the judgment window ensures that single-cycle jitter is insufficient to trigger processing. After setting, only the write target of subsequent data blocks is changed, and the unread data is still read by the read pointer, isolating and not affecting the cached valid data.

[0009] Optionally, in S4, half of the sum of the absolute values ​​of the differences in the proportions of each length interval of the data block length distribution relative to the baseline block length distribution in the local baseline within the effective period is used as the block length distribution deviation. The write verification also includes the case where the number of data blocks within the effective period is not less than the preset minimum number of blocks and the block length distribution deviation exceeds the preset deviation threshold.

[0010] By adopting the above technical solution, the deviation of the block length distribution from the baseline is measured by half of the sum of the absolute values ​​of the differences in the proportions of each length interval, and the number of data blocks is required to reach a preset minimum number of blocks before it is considered as evidence. This allows the impact of changes in block length to be independently verified, while avoiding fluctuations in deviation under small sample sizes.

[0011] Optionally, the upper limit of the input rate of the data block is greater than the read rate of the read pointer; The cycle duration and the preset number of consecutive cycles are determined as follows: The write-full time is obtained by dividing the capacity of the circular buffer by the difference between the upper limit of the input rate and the read rate. The product of the cycle duration and the preset number of consecutive cycles shall not exceed the product of the full writing time and the preset full writing percentage.

[0012] By adopting the above technical solution, the write-full time is obtained by the ratio of the remaining writable capacity to the net input rate, and the product of its constraint period duration and the preset number of consecutive periods is used to control the time required for continuous over-limit within the preset percentage of the write-full time, leaving a margin for subsequent sampling and switching.

[0013] Optionally, step S3 includes sub-steps S31 to S32: S31. For sampling periods where the absolute value of the end-of-cycle delay difference exceeds the preset delay difference ratio of the cycle duration, the sampling period is merged one by one with the subsequent adjacent sampling periods where the absolute value of the end-of-cycle delay difference also exceeds the preset delay difference ratio of the cycle duration to form a merging window. The difference between the end-of-cycle interruption delay at the beginning and end of the merging window is used as the window delay difference. The merging continues until the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration of the merging window, or until the window duration reaches the product of the full write time and the preset full write ratio. S32. In response to the fact that the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration, the sum of the write amounts of each sampling period in the merged window is calculated according to the ratio of the window duration to the difference between the window duration and the window delay difference, and then divided by the number of sampling periods included in the merged window, as the calibrated write amount of each sampling period in the merged window, and each sampling period is included in the effective period.

[0014] By adopting the above technical solution, adjacent periods with the same excessive delay difference are merged into a window. The difference between the first and last delays of the window is uniformly converted and then evenly distributed back to each sampling period. This ensures that no empty window occurs when invalid periods are connected, and the merged calibration quantity can still be compared and counted period by period.

[0015] Optionally, the preset delay difference ratio and the period duration are further adjusted according to the following verification operations: A sampling period is set as a verification period at every preset verification interval, and the interrupt trigger timestamp of each data block received within the verification period is recorded; After all the data blocks received within the verification period have been written, the total number of bytes of the data blocks belonging to the verification period according to the interrupt trigger timestamp is taken as the arrival amount. For the verification period that is the valid period and the arrival amount is greater than zero, the ratio of the arrival amount to the difference between the calibration amount and the amount written after calibration in the verification period relative to the arrival amount is taken as the relative residual. In response to the number of relative residuals reaching a preset statistical number, the quantile value of the most recent preset statistical number of relative residuals at a preset quantile level is used as the residual quantile value. In response to the residual quantile value exceeding a preset residual upper limit, the preset delay difference ratio is reduced by a preset proportional step. In response to the fact that the preset delay difference ratio has decreased to the preset lower limit and the residual quantile value still exceeds the preset residual upper limit, the period duration is increased within the range that the product of the period duration and the preset number of consecutive periods does not exceed the product of the write-full time and the preset write-full percentage.

[0016] By adopting the above technical solution, the arrival amount obtained by the interruption trigger timestamp is used to verify the conversion result. The residual quantile value is used to tighten the preset delay difference ratio and the period duration is lengthened when necessary, so that the conversion threshold is automatically adjusted according to the measured deviation.

[0017] Optionally, the writing evidence further includes residuals increasing in the same direction, and S5 includes sub-steps S51 to S53: S51. The effective period during which the written amount exceeds the written amount tolerance after calibration is recorded as the trigger period, the next sampling period of the trigger period is set as the sampling period, and the interrupt trigger timestamp of each data block received within the sampling period is recorded. S52. After all the data blocks received within the sampling period have been written, the total number of bytes of the data blocks belonging to the sampling period according to the interrupt trigger timestamp is used as the arrival amount. In response to the sampling period being the effective period, the calibration residual is obtained by subtracting the calibration write amount of the sampling period from the arrival amount. S53. In response to the calibration residual being greater than a preset lower limit of residual and the delay difference at the end of the sampling period being greater than zero, the increase of the residual in the same direction is counted as writing evidence within the judgment window of the trigger period.

[0018] By adopting the above technical solution, the next cycle is immediately set as the sampling cycle after the effective cycle exceeds the limit. When the calibration residual is positive and the delay difference at the end of the cycle increases in the same direction, it serves as evidence, thus providing evidence that the sudden increase is distributed and the block length remains unchanged.

[0019] Optionally, in step S6, the breakpoint position of the write pointer in the circular buffer is also recorded; Following step S6, the following recovery operation is also performed: In response to the fact that the amount of writing after calibration does not exceed the writing limit and no writing evidence appears within several consecutive preset reset cycles of the effective period, isolation recovery is performed. The isolation recovery includes resetting the abnormal writing flag, switching the writing target of the writing pointer back to the circular buffer and continuing to write from the breakpoint position, and erasing the isolation area.

[0020] By adopting the above technical solution, the recovery condition is that the reset cycle has not exceeded the limit and no evidence has appeared for several consecutive preset effective cycles. The write pointer returns to the breakpoint to continue writing and erase the isolation area, so that the isolation is automatically released after the abnormality disappears, without the need for external instructions.

[0021] Optional, also includes: In response to the satisfaction of the deceleration trigger condition, the input source for generating the data block is switched from interrupt mode to polling mode at a preset polling interval, and the polled data block received by polling is written into the isolation area. The polled data block is not considered as the data block that has not yet been written. The deceleration trigger condition includes the duration of the abnormal write flag being set exceeding the preset deceleration duration. During the polling reception period of the input source, the input source is restored to interrupt mode to receive one sampling period every preset detection interval. In response to the sampling period being included in the effective period, the sampling period is used as the detection period. In response to the fact that the post-calibration write volume exceeds the write volume tolerance for a consecutive preset number of detection cycles, the preset detection interval is doubled until the preset detection interval upper limit is reached. While the input source is in polling reception, the execution of the isolation recovery must also satisfy that the post-calibration write volume of the most recent probe cycle does not exceed the write volume tolerance.

[0022] By adopting the above technical solution, after a continuous timeout due to an anomaly, the input source is changed to receive data at a preset polling interval, and recovery is attempted periodically with a probe cycle. If continuous probes still exceed the limit, the probe interval is doubled, thus controlling the interruption overhead during an interruption storm.

[0023] Optionally, the local baseline is based on the grouped baseline issued by the operation and maintenance platform as the initial value. The grouped baseline is obtained by the operation and maintenance platform grouping computing nodes according to input interface type and configured input rate level, and taking the median of each local baseline uploaded by each computing node in the same group. The method further includes: The local baseline is updated only during the effective period when the abnormal write flag is not set and the post-calibration write volume does not exceed the write volume tolerance. Upload the local baseline to the operation and maintenance platform; In response to receiving the group baseline issued by the operation and maintenance platform when the deviation between the local baseline and the group baseline exceeds a preset drift threshold, the local baseline is reset with the group baseline.

[0024] By adopting the above technical solution, the local baseline is initialized with the median of the baselines uploaded by each node in the same group, and is only updated by the valid period that is not set and does not exceed the limit. When the deviation exceeds the limit, the platform issues a reset, so that newly connected nodes have no blind spots in their own period, and the baseline is reset after drifting exceeds the threshold.

[0025] Optionally, the isolation area includes a head reservation segment and a tail loop segment. In S6, after switching the write target, the first few preset reservation blocks of the data blocks are written to the head reservation segment without being overwritten, and the data blocks received thereafter are cyclically overwritten and written in the tail loop segment. The method further includes: The length distribution of data blocks within the header reserved segment is reported to the operation and maintenance platform as the reserved segment block length distribution. The system receives an anomaly fingerprint from the operation and maintenance platform. The anomaly fingerprint is the length distribution obtained by taking the average value of each item in the reserved segment block length distribution when the number of computing nodes in the same group whose differences between the reserved segment block length distributions are lower than a preset aggregation threshold is not less than a preset number of nodes. The preset number of consecutive cycles is determined in the following manner: If the difference between the data block length distribution within the effective period and the abnormal fingerprint is less than a preset matching threshold, the preset number of consecutive periods is 1; otherwise, it is the preset number of normal periods.

[0026] By adopting the above technical solution, the block length distribution of the reserved segment at the head of the isolation zone is used to form an abnormal fingerprint. When the node's distribution in this period matches the fingerprint, the preset number of consecutive periods is merged into one period, so that the impacts that have already occurred in the same group can be detected more quickly.

[0027] Optionally, the rate reduction trigger condition further includes merging limit, wherein merging limit is defined as follows: during the period when the abnormal write flag is set, if there is a sampling period in which the absolute value of the end-of-cycle delay difference exceeds the preset delay difference ratio of the period duration, and when the sampling period is merged with subsequent adjacent sampling periods one by one into a preset merging length of sampling periods, the absolute value of the difference between the end-of-cycle interrupt delay at the beginning and end of the merged time period still exceeds the preset delay difference ratio of the duration of the merged time period.

[0028] By adopting the above technical solution, the failure to meet the standard after merging the invalid period to a preset length is used as the trigger condition for speed reduction, so that nodes that are determined to have been invalid for a long time will switch to polling reception in advance.

[0029] Optionally, the data block carries a source identifier, and the write volume and the calibrated write volume of each source within the effective period are counted according to the source identifier, with each source sharing the same conversion ratio; the increment of the calibrated write volume of each source relative to the previous effective period is used as the source increment, and the source whose source increment accounts for more than a preset share threshold of the sum of the source increments of all sources is identified as a differential mode impact source; in response to the abnormal write flag being set and the existence of the differential mode impact source, the write target of the subsequent data block of the differential mode impact source is switched to the isolation area, and the data blocks of sources other than the differential mode impact source continue to be written to the circular buffer; in response to the abnormal write flag being set and the absence of the differential mode impact source, the write target of the subsequent data block of each source is switched to the isolation area.

[0030] By adopting the above technical solution, differential mode and common mode impulses are distinguished by source identifier and only sources with excessive share are isolated, so that other input sources sharing the same buffer are not affected.

[0031] Optionally, the difference between the last valid period and the first valid period among the most recent preset cumulative periods is used as the cumulative increment value. The write evidence also includes the situation where the cumulative increment value exceeds the preset cumulative tolerance within the determination window.

[0032] By adopting the above technical solution, the cumulative increment of the amount written after calibration within the window is used as supplementary evidence, so that the slow-rising impact no longer bypasses the single-cycle change value tolerance.

[0033] Optionally, the system receives the target group baseline and effective time issued by the operation and maintenance platform as the plan changes, and resets the local baseline with the target group baseline upon reaching the effective time. If the difference between the data block length distribution and the abnormal fingerprint within the effective period is lower than a preset matching threshold, the effective period must also be within a preset pause duration from the effective time.

[0034] By adopting the above technical solution, the abnormal fingerprint will not be shortened during the preset pause period after the planned change takes effect, so that the distribution changes caused by the configuration adjustment will not be regarded as known shocks.

[0035] Optionally, when continuing to write from the breakpoint position during the isolation recovery, an isolation gap marker block is first written. The isolation gap marker block records the setting and resetting times of the abnormal write flag, the number of data blocks in the isolation area, and the total number of bytes.

[0036] By adopting the above technical solution, an isolation gap marker block recording the start and end times and quantity of isolation is written at the breakpoint, enabling the processing process to distinguish whether the void is caused by isolation or other reasons.

[0037] In summary, this application includes at least one of the following beneficial technical effects: 1. Convert the write volume into a quantity based on the arrival time by the difference between the interrupt delays at the end of adjacent cycles. Then, use continuous over-limit and window-based corroboration to reduce the statistical distortion introduced by load fluctuations and determine the write volume before the buffer is full within the budgeted rate upper limit.

[0038] 2. After setting the bit, the subsequent data blocks are only rewritten to the isolation area that the read pointer does not read and are overwritten in a loop. Unread data in the buffer is read out as usual. After the exception disappears, the writing resumes from the breakpoint. Neither isolation nor recovery will lose the valid data that has been cached.

[0039] 3. The sampling period is constrained by the full time, the interrupted judgment is restored by merging the window, the residual and block length deviation are supplemented by the evidence, and the cold start and slow drift gap of the single node self-learning baseline is supplemented by the platform grouping baseline and abnormal fingerprint. Attached Figure Description

[0040] Figure 1 This is a schematic diagram of the application environment for the ring buffer abnormal write isolation method based on the operation and maintenance platform in one embodiment of this application.

[0041] Figure 2 This is a flowchart of an abnormal write isolation method for a ring buffer based on an operation and maintenance platform in one embodiment of this application.

[0042] Figure 3 This is a schematic diagram showing the correspondence between the arrival time and the writing time of a data block in one embodiment of this application.

[0043] Figure 4 This is a schematic diagram of the circular buffer and isolation area before and after target switching in one embodiment of this application. Detailed Implementation

[0044] The present application will be further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the application and are not intended to limit the scope of the application.

[0045] This application discloses a method for isolating abnormal writes to a ring buffer based on an operation and maintenance platform. This method measures the write volume and the interruption delay at the end of the cycle on the computing node side according to the sampling period. The write volume, statistically calculated based on the write time, is converted to the volume calculated based on the arrival time using the difference in interruption delay at the end of adjacent cycles. Abnormal writes are then jointly determined by consecutive exceedances and write evidence within the judgment window. Once the determination is successful, subsequent data blocks are rewritten to an isolation area not read by the read side, while data not yet read from the ring buffer is read normally. On the operation and maintenance platform side, group baselines are issued according to the aggregation cycle and reset when the local baseline drifts. The following provides a detailed description of the technical terminology, application environment, overall method flow, recovery and deceleration processing, platform-side baseline, and fingerprinting. The following first explains several technical terms involved in the embodiments of this application.

[0046] A circular buffer is a contiguous storage area in the memory of a compute node. On the write side, data blocks are written to it in the order they arrive, and on the read side, they are read from it according to the processing rhythm. The circular buffer is equipped with write pointers and read pointers. The write pointer points to the starting position of the next write operation, and the read pointer points to the starting position of the next read operation. After advancing to the end of the area, both pointers wrap around to the beginning of the area and continue advancing.

[0047] The cumulative write offset is the total number of bytes written since the write pointer started. The cumulative write offset and the physical position of the write pointer within the circular buffer are two separate quantities: the physical position returns to zero with pointer wrapping, while the cumulative write offset only increases and never decreases, and it does not distinguish between the circular buffer and the isolation zone as the write target. The increment of the cumulative write offset within the sampling period is used as the write amount, ensuring continuous comparability during pointer wrapping and write target switching.

[0048] End-of-cycle interrupt latency is the difference between the end of the sampling period and the interrupt trigger timestamp of the earliest data block among the data blocks that have not yet been written at that moment. The interrupt trigger timestamp is recorded by the interrupt service entry point when the peripheral device triggers an interrupt, for example, by taking the system monotonic clock value read by the interrupt service entry point, or by taking the timestamp assigned to the data block by the acquisition card hardware. If there are no data blocks that have not yet been written at the end of the sampling period, the end-of-cycle interrupt latency is zero. The end-of-cycle interrupt latency measures the backlog of data blocks from their arrival to their writing. In one example, with a sampling period of 20 ms, it is approximately 0.5 ms under normal load, but can reach more than 10 ms under increased load.

[0049] The period-end delay difference is the difference between the period-end interrupt delay of the current sampling period and the period-end interrupt delay of the previous sampling period, denoted as . . The positive and negative values ​​indicate whether the backlog has worsened or eased compared to the previous cycle.

[0050] The effective period is a sampling period in which the absolute value of the latency difference at the end of the period does not exceed the product of the period duration and the preset latency difference ratio, and the latency difference at the end of the period is less than the period duration. The preset latency difference ratio is less than 1, and in one example, it is 0.5, corresponding to a 20 ms sampling period, which is 10 ms. Sampling periods whose absolute value of the latency difference exceeds this threshold are not included in the effective period, and their write volume is not included in subsequent judgments; the handling of such sampling periods is explained in the section on merging windows below.

[0051] The write volume after calibration is the write volume obtained by converting the write volume statistically based on the write time to the write volume measured based on the arrival time. The formula and conversion basis are explained in the following description of S3.

[0052] The write volume change value is the difference between the calibrated write volumes of two adjacent valid cycles, used to characterize short-term surges in input.

[0053] Block length distribution deviation is the distance between the data block length distribution and the baseline block length distribution within the current effective period. The data block length distribution is obtained by statistically analyzing the proportion of data blocks in each preset length interval. The baseline block length distribution is the distribution with the same name recorded in the local baseline during normal operation. The block length distribution deviation is taken as half the sum of the absolute values ​​of the differences between the proportions of the two distributions in each length interval, and the value is between 0 and 1.

[0054] The local baseline is a set of reference values ​​used by this compute node to determine abnormal writes. It includes write volume tolerance, change value tolerance, and baseline block length distribution. The initial value of the local baseline is issued by the operations and maintenance platform, and is subsequently updated only within a valid period for nodes whose abnormal write flag is not set and whose write volume after calibration does not exceed the write volume tolerance. The grouped baseline is obtained by taking the median of the local baselines uploaded by each compute node in the same group, grouped by input interface type and configured input rate level. It is used as the initial value and reset value for the local baseline during drift.

[0055] The decision window and write verification are two complementary concepts in the set determination. The decision window consists of each valid cycle that continuously exceeds the write tolerance and the immediately preceding valid cycle; the write verification is an open set of cases, including cases where the write change value exceeds the change value tolerance. In the embodiments below, it also includes cases such as block length distribution deviation exceeding the limit, calibration residual and cycle end delay difference increasing in the same direction.

[0056] An isolation region is a separate storage area from the circular buffer, which is not accessed by the read pointer. It is used to receive data blocks written after a data is set. An isolation region can be written in its entirety in a circular fashion, or it can be divided into a header reserved segment and a tail circular segment.

[0057] The application environment of this method is described below. (Refer to...) Figure 1 This method is applied to a data acquisition system consisting of an operations and maintenance platform and multiple computing nodes it manages. In one example, the operations and maintenance platform manages 200 edge computing gateways. Each gateway receives sampled data blocks via an interrupt-driven PCIe data acquisition card. The interrupt thread writes the data blocks to a circular buffer within the driver, and the analysis process reads them for further processing. Gateways are grouped into node groups according to their acquisition card model and configured acquisition rate. Normal input consists of 16 channels, each at 250 kS / s, with each sample being 2 bytes, totaling approximately 8 MB / s. The circular buffer capacity is 16 MB, the isolation zone capacity is 4 MB, and the analysis process's readout capability is approximately 10 MB / s. The computing nodes and the operations and maintenance platform operate on two timescales: the computing nodes perform real-time determination and isolation at a 20 ms sampling period, while the operations and maintenance platform distributes baselines, receives reports, and corrects drift at a 5-minute aggregation period, without participating in real-time determination.

[0058] The overall process of this method is explained in detail below. (Refer to...) Figure 2 This method includes steps S1 to S6.

[0059] S1. Write the interrupted data block into the circular buffer.

[0060] In the implementation, each time a peripheral device delivers a data block, an interrupt is triggered. The upper half of the interrupt handling records the interrupt trigger timestamp and registers the data blocks to be written. The lower half, within the interrupt thread, writes the data blocks to the circular buffer in arrival order and advances the write pointer. The analysis process advances the read pointer to read data blocks according to its own processing capacity, unconstrained by the write-side rhythm. For example, in the above example, under normal input, approximately 11 data blocks, totaling about 160 kB, are written per sampling cycle, and the read-side reads at a capacity of approximately 10 MB / s, keeping the amount of unread data in the circular buffer at a low level.

[0061] S2. At the end of each sampling period, the period increment of the cumulative write offset of the write pointer is used as the write amount, and the difference between the end of the period and the earliest interrupt trigger timestamp of the data block that has not yet been written is used as the interrupt delay at the end of the period. If there is no data block that has not yet been written, the delay is zero.

[0062] S2 is the measurement step, which outputs the write amount and the interrupt latency at the end of each sampling period. In the specific implementation, S2 includes sub-steps S21 to S23.

[0063] S21. At the beginning of each sampling period, record the cumulative write offset of the write pointer. At the end of the period, read the offset again and take the difference as the write amount for this period. Since the cumulative write offset does not return to zero with wrap-around and does not distinguish between write targets, this difference holds true for both the period when the pointer wraps around and the period when the write target has switched to the isolation zone. Therefore, the write amount is continuously comparable throughout the entire determination process. For example, if the cumulative write offset is 3840 kB at the beginning of a period and 4000 kB at the end, then the write amount for this period is 160 kB.

[0064] S22. Maintain a register table at the interrupt service entry point for data blocks that have not yet been written. Each time an interrupt is triggered, register the interrupt trigger timestamp of the newly arrived data block into the table. Once a data block is written, remove it from the table. The register table is maintained in ascending order of timestamps, with the earliest block at the top for direct retrieval at the end of the cycle, avoiding a full table scan.

[0065] S23. At the end of the sampling period, the interrupt trigger timestamp in the register header is subtracted from the end time of the period to obtain the end-of-period interrupt delay for this period; if the register is empty, it means that all data blocks arriving by the end of the period have been written, and the end-of-period interrupt delay is zero. For example, the end time of the period is... The header timestamp is If the delay is ms, then the interrupt delay at the end of this cycle is 0.5 ms.

[0066] It is important to note that the write volume and the interrupt latency at the end of the cycle are taken from the same sampling period, so the conversion below can therefore be completed within the cycle. Another measurement method is to assign each data block to its arrival cycle according to the interrupt trigger timestamp and accumulate them to obtain the arrival volume. However, this requires reserving a timestamp and length for each data block on the interrupt path. In scenarios with tens of thousands of interrupts per second, the overhead is concentrated in the interrupt path. Therefore, this method is only used as needed for verification and sampling.

[0067] S3. The difference between the current and previous sampling period's end-of-period interruption delay is used as the end-of-period delay difference. For sampling periods where the absolute value of the end-of-period delay difference does not exceed the preset delay difference ratio of the period duration and is less than the period duration, the write volume is converted into the calibrated write volume and included in the effective period according to the ratio of the period duration to the difference between the period duration and the end-of-period delay difference.

[0068] S3 takes the pair of values ​​given by S2 and converts the write volume counted by write time into a volume counted by arrival time. (See reference...) Figure 3 In practice, the data blocks written in the current cycle are not necessarily the data blocks that arrive in the current cycle: if there is still a backlog at the end of the previous cycle, the backlogged data blocks are written first in the current cycle; if there is a new backlog at the end of the current cycle, these data blocks are postponed to the next cycle. The net effect of writing and postponing is precisely characterized by the difference in the degree of backlog at the end of two adjacent cycles, i.e., the cycle-end delay difference. The arrival time length corresponding to the data blocks written this period is therefore [length missing]. ,in The period duration is used as the basis for calculating the write volume. The write volume during this period is then proportionally restored to the period duration to obtain the calibrated write volume. ,in This represents the amount of data written in this cycle.

[0069] This conversion assumes that the arrival rate is approximately stable within this period. When this assumption holds true, the conversion result is the equivalent amount of input during the arrival period corresponding to this cycle, converted to a cycle length. When the arrival rate fluctuates significantly within the cycle, a deviation will appear between the conversion result and the actual arrival amount. This deviation is verified by the quantile value in the following check operation and can be used to tighten the preset delay difference ratio. Alternatively, it can be checked cycle by cycle according to the measured arrival amount during the sampling period. Therefore, this method reduces the distortion introduced by node load fluctuations through statistics based on write time, rather than eliminating all statistical biases.

[0070] For example, in the above example, the node load briefly increases, and the end-of-cycle interrupt delays of the last five consecutive sampling cycles are 0.5 ms, 6.5 ms, 12.5 ms, 6.5 ms, and 0.5 ms, respectively, while the peripheral input remains at 8 MB / s. The end-of-cycle delay differences of the last four cycles are as follows: ms ms ms The corresponding arrival time lengths are 14 ms, 14 ms, 26 ms, and 26 ms, respectively, and the write volumes calculated by the write time are 112 kB, 112 kB, 208 kB, and 208 kB, respectively. If judged directly by this write volume, the latter two cycles consecutively exceed the 190 kB write volume tolerance, and the write volume change value in the first cycle is 96 kB, exceeding the 36 kB change value tolerance. When the preset consecutive cycle number is 2, this will be judged as an abnormal write. After conversion using the above formula, the calibrated write volume for all four cycles is 160 kB, for example... kB, the difference in the amount of writes after calibration between adjacent valid periods is 0, which does not meet the set condition. Therefore, a statistical rise and fall caused purely by scheduling jitter is not read as a write anomaly.

[0071] The cycle duration and the preset number of consecutive cycles are not arbitrary. In some embodiments, the upper limit of the input rate of the data block is greater than the read rate of the read pointer. The cycle duration and the preset number of consecutive cycles are determined as follows: the write-full time is obtained by dividing the capacity of the circular buffer by the difference between the upper limit of the input rate and the read rate; the product of the cycle duration and the preset number of consecutive cycles does not exceed the product of the write-full time and the preset write-full percentage. The preset number of consecutive cycles is the number of cycles used in S5 below to determine when there is a continuous over-limit.

[0072] The upper limit of the input rate here is taken as the upper bound of the rate under abnormal input, not the configured rate level: the input rate of abnormal writes is inherently higher than the configured level, and using the level value as a budget would overestimate the available time. The upper bound is taken based on the physical bandwidth of the interface link. For example, if the physical bandwidth of the acquisition card link is 100 MB / s, the read capability is 10 MB / s, and the ring buffer capacity is 16 MB, then the write-to-full time is... When the preset write-full percentage is 0.4, the product of the cycle duration and the preset number of consecutive cycles does not exceed 71 ms. The product of the aforementioned 20 ms cycle duration and the preset number of consecutive cycles (2) is 40 ms, which satisfies the constraint. The normal case of a nearly empty buffer is calculated based on the capacity. In other embodiments, the write-full time is calculated based on the remaining writable capacity starting from the current cycle. For example, when the remaining writable capacity is 14 MB, the write-full time is approximately 0.156 s. The constraint is tightened accordingly, and the case where the buffer is partially occupied is also included in the budget.

[0073] After the judgment is made, processing is required. The longest response time for the entire link is not limited to the continuous judgment segment: sampling alignment takes up to 20 ms per cycle, continuous judgment takes 40 ms, on-demand sampling takes another 20 ms per cycle, and the switching itself takes less than milliseconds, totaling approximately 81 ms, which is less than the 178 ms write time, leaving more than half of the margin. It should be noted that this budget is a guarantee made based on the upper bound during the design: if the actual input rate is higher than the upper bound, or if the buffer is already heavily occupied, continuous judgment may not be completed before the write is full. This segment is covered by a protection level, and this protection is not contingent on the validity of the judgment; the rules for this are explained below.

[0074] Sampling periods whose absolute value of the end-of-period delay difference exceeds a threshold are not included in the valid period. In situations where high loads and shocks occur simultaneously, such sampling periods may appear consecutively, resulting in a gap in the determination process. In some embodiments, S3 includes sub-steps S31 to S32: S31. For sampling periods where the absolute value of the delay difference at the end of the period exceeds a preset delay difference ratio of the period duration, merge the sampling period with subsequent adjacent sampling periods where the absolute value of the delay difference at the end of the period also exceeds the preset delay difference ratio of the period duration to form a merging window. Use the difference between the interruption delay at the end of the period at the beginning and end of the merging window as the window delay difference. Merge until the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration of the merging window, or until the window duration reaches the product of the full writing time and the preset full writing ratio.

[0075] S32. In response to the fact that the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration, the sum of the write amount of each sampling period in the merged window is calculated according to the ratio of the window duration to the difference between the window duration and the window delay difference. Then, it is divided by the number of sampling periods included in the merged window to obtain the calibrated write amount of each sampling period in the merged window, and each sampling period is included in the effective period.

[0076] The rationale for merging is that a large delay difference in a single cycle only indicates severe scheduling jitter in that particular instance. By merging several adjacent cycles with similarly severe jitter, the difference in backlog at the beginning and end often falls back to a manageable range. Here, the end-of-cycle interruption delays at the beginning and end of the merging window are taken from the start and end times of the merging window, respectively. The start time of the merging window is the same as the end time of the previous sampling cycle. For example, if the end-of-cycle interruption delays of four adjacent sampling cycles are 12 ms, 24 ms, 2 ms, and 0.6 ms respectively, the difference in end-of-cycle delays of the last three cycles is... ms ms The two periods have an absolute delay difference exceeding 10 ms and do not enter the effective period. They are merged into a single window with a duration of 40 ms. The interrupt delay at the end of the first period of the window is 12 ms, and at the end of the window it is 2 ms. The window delay difference is... The absolute value of ms does not exceed the product of 40 ms and 0.5. The sum of the write volume in two cycles within the window is 420 kB, which is converted to The calibrated write volume for each sampling period is 168 kB, divided by the two sampling periods contained in the window. The two sampling periods then enter the valid period for subsequent comparison and counting. If the product of the window duration (write full time) and the preset write full percentage still does not meet the conversion condition, merging stops, and the write volume during this period is not included in the judgment. The abnormal write flag and the continuous over-limit count remain at their original values, and the node remeasures in the next sampling period. At this time, the flag is not yet set, and the speed reduction measures described below for the setting period are not applicable. The node continues to operate under the following protection level.

[0077] In some embodiments, after each advance of the write pointer, the remaining writable space in the circular buffer is checked. If the remaining writable space is lower than a preset protection level, the write target is directly switched to the isolation area and an abnormal write flag is set. Subsequently, the recovery determination is performed according to the normal path. This check is independent of whether the determination is valid: regardless of whether the sampling period is included in the valid period, whether it is in the merging window or in the waiting period of the sampling inspection, as long as the remaining writable space reaches the protection level, the switch is made. The three cases of continuous invalid period, low remaining capacity, and input rate exceeding the budget upper limit are covered by the same fallback rule.

[0078] The protection level should not be lower than the amount of data that may be written from the time it is touched until the write target completes the switch. Taking the check immediately after each advance of the write pointer as an example, this period does not exceed the writing of one data block and one switch. Based on a maximum block size of 64 kB and a switch time in milliseconds, a protection level of 1 MB provides ample margin. If the check is changed to the end of each sampling period, the protection level should be the product of the maximum net growth rate and the period duration, i.e., not lower than 1.8 MB. For example, with 0.9 MB of remaining writable space, an input speed of 40 MB / s, and a read speed of 10 MB / s, the buffer should be at... The data is filled after s, earlier than the 40 ms required for two consecutive sampling periods; at this time, the remaining writable space is below the 1 MB protection level, and the write target has been switched before it is filled, so the unread data is not overwritten.

[0079] The preset delay difference ratio used in the conversion formula is not fixed. In some embodiments, the preset delay difference ratio and the period duration are further adjusted according to the following verification operation: a sampling period is set as the verification period every preset verification interval, and the interrupt trigger timestamp of each data block received within the verification period is recorded; After all data blocks received during the verification period are written, the total number of bytes of data blocks belonging to the verification period according to the interrupt trigger timestamp is used as the arrival amount. For verification periods that are valid and have an arrival amount greater than zero, the ratio of the difference between the arrival amount and the calibrated write amount of the verification period to the arrival amount is used as the relative residual. In response to the number of relative residuals reaching the preset number of statistics, the quantile value of the most recent preset number of relative residuals at the preset quantile level is used as the residual quantile value. In response to the residual quantile value exceeding the preset residual upper limit, the preset delay difference ratio is reduced by a preset proportional step. In response to the fact that the preset delay difference ratio has decreased to the preset lower limit and the residual quantile value still exceeds the preset residual upper limit, the cycle duration is increased within the range that the product of the cycle duration and the preset number of consecutive cycles does not exceed the product of the write-full time and the preset write-full percentage.

[0080] The verification operation reconciles the converted results with the actual measurements from the previous block-by-block statistical analysis. For example, if the preset verification interval is 100 sampling periods, and the calibrated write volume for a certain verification period is 168 kB and the arrival volume is 176 kB, the relative residual is... Approximately 4.5%; with a preset statistical count of 50 and a preset quantile level of 0.9, the 90th percentile of the most recent 50 relative residuals is 4.8%, which does not exceed the preset upper limit of 8% for residuals, so the parameters remain unchanged. When this quantile value rises to 9%, the preset delay difference ratio is reduced from 0.5 to 0.45 by a preset ratio step size of 0.05; if the quantile value is still high even after being reduced to the preset lower limit of 0.3, the period duration is increased from 20 ms to 30 ms, and the product of this and the preset consecutive period number of 2 (60 ms) is still within the constraint of 71 ms.

[0081] Once the cycle duration changes, the quantities measured by the cycle are no longer comparable to those before the change. Therefore, the local baseline and historical comparison quantities must be converted synchronously. In specific implementation, the write tolerance, change tolerance, and average values ​​in the local baseline are recorded per unit duration. During comparison, they are converted to the quantities of the current cycle based on the current cycle duration. When the cycle duration increases from 20 ms to 30 ms, the write tolerance of 190 kB and the change tolerance of 36 kB are correspondingly converted to 285 kB and 54 kB, respectively. The normal input write volume under the new cycle is 240 kB, which is still within the tolerance and will not be judged as abnormal due to the longer cycle. The accumulated historical statistics continue to participate after being converted according to the ratio of the old and new cycle durations. The continuous over-limit count and judgment window are cleared in the cycle in which the conversion occurs, and they do not participate in the judgment and baseline update to avoid the quantities before and after the conversion falling into the same comparison. The local baseline uploaded to the operation and maintenance platform is also recorded in terms of unit duration. The platform aggregates and distributes the data according to this standard. After receiving the data, the node converts it back according to its current cycle duration, so that nodes in the same group with different sampling cycle values ​​can still be compared.

[0082] The check tightens the threshold only when the residual quantile is too high, addressing the case of a low conversion. When the conversion is too high, the relative residual is negative. For example, if the arrival amount is 160 kB and the written amount after calibration is 208 kB, the relative residual is negative, and its absolute value is approximately 30%, which does not trigger the aforementioned adjustment. In some embodiments, the absolute value of the relative residual is taken before calculating the quantile, or a preset negative upper limit for the residual is set, so that the threshold tightening is also triggered when the conversion is too high, and deviations on both sides are included in the check.

[0083] The above describes one implementation method when the latency difference at the end of a cycle is too large, namely, merging the data into a window and then uniformly calculating the latency difference. In other embodiments, merging can be omitted, and the sampling cycle with the large latency difference can be skipped directly. Instead, the cumulative write volume of the first sampling cycle that meets the condition is calculated based on the cumulative duration of the two cycles. This alternative method simplifies implementation by coarsening the calculation granularity, and it also belongs to the implementation method of converting the write volume into a measurement based on the arrival time.

[0084] S4. Use the increment of the write amount after calibration of adjacent valid cycles as the write amount change value.

[0085] The write volume change value characterizes a short-term surge in input. In the specific implementation, the write volume change value peaks on the valid cycle where the input jumps from the normal level. If the input remains high thereafter, the write volume after calibration in two adjacent valid cycles tends to be equal, and the write volume change value falls back to near zero. For example, if the calibrated write volume is 160 kB under normal input, and it rises to 800 kB in a certain valid cycle due to a peripheral malfunction, then the write volume change value for that cycle is 640 kB, far exceeding the 36 kB change tolerance. When the calibrated write volume in the next valid cycle is still 800 kB, its write volume change value is 0.

[0086] In some embodiments, in S4, half of the sum of the absolute values ​​of the differences in the proportions of each length interval of the data block length distribution relative to the baseline block length distribution in the local baseline within the effective period is also used as the block length distribution deviation; the writing evidence also includes the case where the number of data blocks within the effective period is not less than the preset minimum number of blocks and the block length distribution deviation exceeds the preset deviation threshold.

[0087] The block length distribution deviation provides further evidence from the composition of data blocks. In specific implementations, the length range is divided according to the block length configuration of the acquisition card, for example, into four ranges: less than 4 kB, 4 kB to 16 kB, 16 kB to 32 kB, and 32 kB to 64 kB. During normal operation, the proportion of data blocks in each range is approximately 10%, 60%, 25%, and 5%, respectively. This proportion is recorded as the baseline block length distribution in the local baseline. When the peripheral firmware fails and data is continuously transmitted in full-length 64 kB blocks, the number of data blocks increases to approximately 21 within a certain effective period. The proportions of each range become approximately 5%, 31%, 13%, and 50%, respectively. The block length distribution deviation is half the sum of the absolute values ​​of the differences in the proportions of each range, i.e. The effective period exceeds the preset deviation threshold of 0.3, thus providing evidence from the block length side.

[0088] Having at least a preset minimum number of data blocks is a prerequisite for calculating the block length distribution deviation. The sample size for the percentage statistics is the number of data blocks in the current period. If the number is too small, the percentage will fluctuate significantly regardless of which interval a single data block falls into, rendering the block length distribution deviation meaningless. For example, if the preset minimum number of blocks is 5, and a period only has 2 data blocks, both of which are above 32 kB, the percentages for each interval would be 0%, 0%, 0%, and 100%, resulting in a block length distribution deviation of 0.95, which does not reflect the true change in the input composition. Therefore, effective periods with insufficient blocks are not supported by the block length distribution deviation.

[0089] In other embodiments, the difference between the calibrated write volume of the last valid cycle and the first valid cycle out of the most recent preset cumulative cycles is used as the cumulative increment value. Write verification also includes situations where the cumulative increment value exceeds the preset cumulative tolerance within the determination window. This method is aimed at inputs that slowly increase over multiple cycles: the write volume change value at each step is within the tolerance, but the cumulative value has increased significantly. For example, when the preset cumulative cycle number is 8 and the preset cumulative tolerance is 100 kB, an increase from 160 kB to 280 kB within eight valid cycles is counted as one verification.

[0090] S5. In response to the fact that the effective period of the write volume exceeding the initial value of the local baseline issued by the operation and maintenance platform reaches the preset number of consecutive periods, and the write evidence appears in the judgment window formed by each of the consecutively exceeding effective periods and the immediately preceding effective period, the abnormal write flag is set. The write evidence includes the situation where the change value of the write volume exceeds the change value tolerance in the local baseline.

[0091] In the specific implementation, the count of consecutive out-of-limit events only advances within valid periods; invalid periods are neither advanced nor reset. The decision window consists of each valid period of consecutive out-of-limit events and the immediately preceding valid period, including the moment the jump occurs, because the jump itself often falls between the first out-of-limit period and the period preceding it. In one example, the write tolerance is taken as the average write volume in the local baseline plus three times the dispersion, i.e. kB, the tolerance for changes is taken as 3 times the dispersion of the changes in the written amount, i.e., 36 kB. The other preset thresholds, including the thresholds for deviation, residual, cumulative, drift, aggregation and matching, can be set by taking the high quantile value of the distribution of the corresponding statistics during normal operation and leaving a margin after the node or the same group of nodes has been running normally for a period of time. The values ​​in the examples below are given in this way.

[0092] For example, in the above case, the acquisition card firmware malfunctioned, continuously sending full-length data blocks of 64kB outside of normal output starting from a certain sampling period, with the input speed increasing from 8 MB / s to 40 MB / s. The post-calibration write volume in the previous valid period before the malfunction was 160 kB, within the limit. The post-calibration write volume in the first valid period was 800 kB, exceeding the 190 kB write volume tolerance, with a write volume change of 640 kB, exceeding the 36 kB change tolerance, and a block length distribution deviation of 0.45, exceeding the preset deviation threshold of 0.3. The post-calibration write volume in the second valid period was still 800 kB, continuing to exceed the limit, but the write volume change returned to 0, and the block length distribution deviation remained at 0.45. At this point, the effective period of continuous over-limit reaches the preset number of consecutive periods of 2. The judgment window consists of these two effective periods and the previous effective period that did not exceed the limit. Within the window, there are both over-limit write volume changes and over-limit block length distribution deviations. When both conditions of S5 are met simultaneously, the abnormal write flag is set at the end of the second effective period, that is, 40 ms from the start of the impact.

[0093] In some embodiments, writing corroboration further includes residuals increasing in the same direction, and S5 includes sub-steps S51 to S53: S51. Record the effective period when the written amount exceeds the write amount tolerance after calibration as the trigger period, set the next sampling period of the trigger period as the sampling period, and record the interrupt trigger timestamp of each data block received within the sampling period.

[0094] S52. After all data blocks received within the sampling period are written, the total number of bytes of data blocks belonging to the sampling period according to the interrupt trigger timestamp is used as the arrival amount. In response to the sampling period being a valid period, the calibration residual is obtained by subtracting the calibration write amount of the sampling period from the arrival amount.

[0095] S53. In response to the calibration residual being greater than the preset lower limit of residual and the delay difference at the end of the sampling period being greater than zero, the residual increasing in the same direction is counted as evidence of writing within the judgment window of the trigger period.

[0096] The mechanism underlying the simultaneous increase in residuals is as follows: the conversion formula restores the write volume based on a constant rate during the arrival period. However, when the input is climbing, the segment delayed to the next cycle for writing happens to be the segment with a higher rate, thus the conversion result is lower, and the calibration residual obtained by subtracting the calibration write volume from the arrival volume is positive. Simultaneously, the climbing input exacerbates the backlog, and the end-of-cycle latency difference in the sampling cycle is also positive. The fact that both are positive in the same direction indicates that the input itself is increasing, rather than statistical fluctuations caused by node load variations, which only cause the residual to oscillate around zero. For example, after the trigger cycle occurs, the end-of-cycle latency difference in the sampling cycle is... The amount written after calibration is 800 kB, while the amount received according to the interrupt trigger timestamp is 900 kB. The calibration residual is 100 kB, which exceeds the preset residual lower limit of 50 kB. Therefore, this sampling period provides evidence for the judgment window in which the trigger period is located.

[0097] Therefore, the write evidence constitutes an open set of scenarios: exceeding the limit of the write amount change value corresponds to a sudden jump, exceeding the limit of the block length distribution deviation corresponds to a change in the data block composition, increasing the residual in the same direction corresponds to the input being climbed, and exceeding the limit of the cumulative increment value corresponds to a slow rise over multiple cycles; if any of these scenarios occurs within the judgment window, the evidence condition of S5 is satisfied.

[0098] S6. In response to the abnormal write flag being set, the write target of subsequent data blocks is switched to the isolation area that the read pointer does not read, and the write is cyclically overwritten in at least part of the isolation area. The read pointer reads the data blocks that have not been read from the circular buffer.

[0099] S6 is the processing stage. (Refer to...) Figure 4In the specific implementation, after the bit is set, the write target of the write pointer changes from the circular buffer to the isolation zone. Subsequent data blocks are written to the isolation zone in arrival order, and once the isolation zone is full, it cyclically overwrites the earliest written data block from the beginning of the isolation zone. The circular buffer no longer receives new data from the moment the bit is set, and the read pointer continues to read unread data blocks according to the analysis process's rhythm until it catches up with the write position at the moment the bit was set. The switch only changes the write destination and does not modify the existing data in the circular buffer; valid data cached before the impact begins is still delivered to the analysis process as usual. For example, in the above example, the input increases to 40 MB / s, and the read capability is 10 MB / s, a net increase of approximately 30 MB / s. From the start of the impact to the bit being set, the duration is 40 ms. During this time, the circular buffer only occupies about 1.2 MB more, leaving about 0.5 s of margin before reaching its 16 MB capacity. After the switch, regardless of the duration of the impact, the circular buffer's occupancy no longer increases, and the isolation zone cyclically overwrites within its 4 MB capacity.

[0100] In some embodiments, S6 also records the breakpoint position of the write pointer in the circular buffer. The breakpoint position is the physical position of the write pointer in the circular buffer when the switch occurs, so that writing can continue from that position after the exception disappears. Its value is independent of the cumulative write offset, so pointer wrapping does not affect its recording.

[0101] In some embodiments, the isolation region includes a head reservation segment and a tail circular segment. In S6, after switching the write target, the first few preset reserved data blocks received are written to the head reservation segment without being overwritten. Subsequent data blocks are then cyclically overwritten within the tail circular segment. The head reservation segment retains the data blocks from the initial impact segment, i.e., the moment the input composition changes; the tail circular segment retains the most recent data blocks for observing the current impact pattern. For example, if the isolation region capacity is 4 MB, the preset reserved block count is 16, and a full-length data block of 64 kB is used, the head reservation segment occupies 1 MB, and the remaining 3 MB is used for cyclic overwriting within the tail circular segment.

[0102] In other embodiments, when the data block carries a source identifier, the write volume and post-calibration write volume of each source within the valid period are calculated separately according to the source identifier. All sources share the same conversion ratio, and the increment of the post-calibration write volume of each source relative to the previous valid period is used as the source increment. Let the first... The source increment of each source is The sum of the increments of each source is Its share is The source whose share exceeds the preset share threshold is designated as the differential mode impact source. When the threshold is set, only the subsequent data blocks of the differential mode impact source are switched to the isolation area, while the data blocks of other sources continue to be written to the circular buffer. When there is no differential mode impact source, the subsequent data blocks of each source are switched to the isolation area together. The observation point for the share is the first valid period exceeding the limit within the judgment window, that is, the period in which the input jump occurs: when the input remains high thereafter, the increments of each source fall back to near zero. If the share is calculated at that time, it will result in division by zero. Therefore, the share is calculated based on the source increment of that triggering period. If the sum of the source increments is not positive, differential mode judgment is not performed, and the entire area is switched. In this mode, the write pointer of the circular buffer does not switch the write target. The data blocks of other sources advance the write pointer as usual. Therefore, when the isolation is restored, the data blocks of the differential mode impact source continue to be written from the current write pointer position of the circular buffer, without going back to the breakpoint position, so as not to overwrite the data blocks written by other sources during the isolation period. This alternative refines the granularity of isolation from the whole region to the source, at the cost of needing to resolve the source identifier on the interrupt path, while still achieving the goal of separating abnormal writes from normal data.

[0103] In other embodiments, when writing continues from the breakpoint during isolation recovery, an isolation gap marker block is first written. This block records the set and reset times of the abnormal write flag, the number of data blocks within the isolation area, and the total number of bytes. When the analysis process reads the isolation gap marker block, it can determine that subsequent data is separated from previous data by an isolation period, thus attributing data gaps to isolation processing and avoiding confusion with other causes such as packet loss or retransmission.

[0104] The following explains the recovery process after the abnormal write disappears and the deceleration process during the impact.

[0105] In some embodiments, after S6, the following recovery operation is also performed: in response to the fact that the amount of writing after calibration has not exceeded the writing tolerance and no writing evidence has appeared within several valid cycles of a consecutive preset reset cycle, isolation recovery is performed. Isolation recovery includes resetting the abnormal write flag, switching the write target of the write pointer back to the circular buffer and continuing to write from the breakpoint position, and erasing the isolation area.

[0106] The recovery conditions are stricter than the set conditions, requiring that several consecutive preset reset cycles be neither exceeded nor supported by any evidence. For example, if the preset reset cycle count is 50, corresponding to a cycle length of 20 ms (1 s), the input must return to normal levels for 1 s before recovery, to avoid repeated switching during the intervals between impacts. The erase isolation area is completed during the recovery action, ensuring that the next set starts from an empty isolation area, and the header reserved segment always retains the starting segment of the most recent impact. When isolation recovery is performed during polling reception of the input source, in addition to resetting the flag, switching back to the write target, and erasing the isolation area, the input source is also synchronously restored to interrupt mode reception, so that the reception mode and the write target return to normal, rather than remaining in polling reception.

[0107] In some embodiments, the method further includes: in response to the rate reduction triggering condition being met, switching the input source that generates the data block from interrupt mode reception to polling reception at a preset polling interval, and writing the polled data block received in the polling interval into the isolation area, wherein the polled data block is not considered as a data block that has not yet been written, wherein the rate reduction triggering condition includes the duration for which the abnormal write flag is set exceeding the preset rate reduction duration; during the period when the input source is in polling reception, restoring the input source to interrupt mode reception for one sampling period every preset probe interval, and using the sampling period as the probe period in response to the sampling period being included in the valid period; in response to the fact that the written amount after calibration for a preset number of consecutive probe periods exceeds the write amount tolerance, doubling the preset probe interval until the upper limit of the preset probe interval is reached; during the period when the input source is in polling reception, the execution of isolation recovery must also satisfy that the written amount after calibration in the most recent probe period does not exceed the write amount tolerance.

[0108] During a sustained surge, peripherals still trigger interrupts at a rate of one interrupt per data block, with interrupt overhead increasing synchronously with the input rate. Switching to polling reception disables interrupts, and the driver actively retrieves data at fixed intervals, making the overhead tied to the polling interval. For example, if the preset deceleration duration is 2 seconds and the preset polling interval is 2 ms, then after 2 seconds of setting, polling begins, retrieving data 500 times per second. Polled data blocks are not entered into the register of data blocks not yet written; therefore, the interrupt delay at the end of the polling period is treated as zero in an empty register, and the calculation formula still works as normal. Probing is used to determine when interrupt reception can resume: for example, if the preset probe interval is 50 sampling periods, interrupt reception resumes every 1 second for one sampling period. This period is included in the valid period as the probe period, and the calibrated write amount is used to determine if the input has fallen back. If the limit is still exceeded after 3 consecutive probe periods, the probe interval is increased from 50 sampling periods to 100, up to the preset probe interval limit of 400 sampling periods, ensuring that a prolonged surge does not turn the probe itself into a new source of overhead.

[0109] In other embodiments, the rate-reduction trigger condition also includes a merge limit exceeding condition. The merge limit exceeding condition occurs when, during the period when the abnormal write flag is set, the absolute value of the end-of-cycle latency difference exceeds a preset latency difference ratio of the cycle length for a given sampling period, and when this sampling period is merged with subsequent adjacent sampling periods one by one into a preset merge length of sampling periods, the absolute value of the difference between the end-of-cycle interrupt latency at the beginning and end of the merged time period still exceeds a preset latency difference ratio of the merged time period. This situation indicates that the determination has failed for a considerable period of time; switching to polling early can suppress the interrupt overhead before the determination recovers.

[0110] The following section explains baseline management and anomaly fingerprinting on the operations and maintenance platform side.

[0111] In some embodiments, the local baseline is based on the grouped baseline issued by the operation and maintenance platform. The grouped baseline is obtained by the operation and maintenance platform grouping the computing nodes according to the input interface type and the configured input rate level, and taking the median of each local baseline uploaded by each computing node in the same group. This method also includes updating the local baseline only during the effective period when the abnormal write flag is not set and the write volume after calibration does not exceed the write volume tolerance; Upload the local baseline to the operations and maintenance platform; In response to receiving a group baseline from the operations and maintenance platform when the deviation between the local baseline and the group baseline exceeds a preset drift threshold, the local baseline is reset using the group baseline.

[0112] Both keys in the grouping point to comparability: if the interface type is the same, the data block length composition and interruption rhythm are similar; if the rate level is the same, the write volume is comparable. The median is taken for each item instead of the mean to prevent individual drifting nodes from skewing the entire baseline. Taking the median for each item is suitable for scalars such as write volume tolerance and change value tolerance. The baseline block length distribution is a distribution composed of the proportions of each length interval. After taking the median for each item, the sum of the proportions of each interval may not be 1. Therefore, after taking the median, each item is divided by the sum of the medians of each interval for normalization, so that the baseline block length distribution in the grouped baseline is still a distribution. When the sum of the medians of each interval is zero, for example, if the distributions of the nodes in the same group are concentrated in different intervals, the baseline block length distribution in the grouped baseline is not updated in this aggregation cycle; the value obtained by taking the median and normalization in the previous aggregation cycle is used. If this situation occurs in the first aggregation cycle, this item is not issued temporarily until the sum of the medians of each interval is not zero. Updating the local baseline only within valid periods that are not set and do not exceed limits blocks another path: updates within periods exceeding limits will gradually raise the tolerance, causing the judgment to fail. For example, if a device connected to a gateway is tampered with, its output increases by about 5% every 10 minutes, with each step changing by about 8 to 12 kB, all within the 36 kB change tolerance. The block length distribution also remains unchanged, so it is never set, and the local baseline gradually moves up with normal updates. After about 90 minutes, the average local write volume rises to about 248 kB, with a deviation of about 55% from the 160 kB group baseline, exceeding the preset drift threshold of 50%. The operations and maintenance platform detects this deviation during the aggregation period comparison and issues a group baseline reset for the node's local baseline. After the reset, the node's write volume around 248 kB continuously exceeds the 190 kB write volume tolerance. These periods no longer participate in the local baseline update, and the tolerance is not raised again. The node is set when the input suddenly increases again.

[0113] In some embodiments, the method further includes: reporting the length distribution of data blocks within the header reserved segment to the operation and maintenance platform as the reserved segment block length distribution; Receive the abnormal fingerprint issued by the operation and maintenance platform. The abnormal fingerprint is the length distribution obtained by taking the average value of each item of the retained segment block length distribution when the number of computing nodes in the same group and within the same aggregation cycle is not less than the preset number of nodes. The preset number of consecutive cycles is determined as follows: if the difference between the data block length distribution and the abnormal fingerprint within the valid cycle is less than the preset matching threshold, the preset number of consecutive cycles is 1; otherwise, it is the preset number of normal cycles.

[0114] The abnormal fingerprint uses a byproduct of isolation processing: the header reserved segment already contains data blocks of the initial impact segment, and their length distribution is reported without the need for a separate acquisition channel. Fingerprint generation has two thresholds: multiple nodes in the same group report similar distributions within the same aggregation cycle, and the number of such nodes reaches a preset number, thus distinguishing the occasional occurrence of a single node from the spread of a type of impact within the group. For example, with a preset aggregation threshold of 0.15 and a preset number of nodes of 5, if 7 gateways in the same group report reserved segment block length distributions with pairwise differences of less than 0.15 within a certain aggregation cycle, the platform will generate an abnormal fingerprint by averaging these 7 distributions and distribute it within the group. When the difference between a node's data block length distribution and the fingerprint in this cycle is less than a preset matching threshold of 0.2, the preset number of consecutive cycles is set to 1 cycle, and the judgment latency is shortened from 40 ms to 20 ms; otherwise, the preset normal number of cycles of 2 cycles is still used.

[0115] In other embodiments, the system receives the target group baseline and effective time from the operations and maintenance platform as the plan changes. Upon reaching the effective time, it resets the local baseline using the target group baseline. If the difference between the data block length distribution and the abnormal fingerprint within the effective period is less than a preset matching threshold, the effective period must also not be within a preset pause duration from the effective time. Plan changes can cause an overall change in the length of data blocks, which may be similar in distribution to shocks. Fast fingerprint judgment during a pause period can avoid treating planned changes as known shocks.

[0116] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application, and should all be included within the protection scope of this application.

Claims

1. A method for isolating abnormal writes to a ring buffer based on an operation and maintenance platform, characterized in that, include: S1. Write the interrupted data block into the circular buffer; S2. At the end of each sampling period, the period increment of the cumulative write offset of the write pointer is used as the write amount, and the difference between the end of the period and the earliest interrupt trigger timestamp of the data block that has not yet been written is used as the interrupt delay at the end of the period. If there is no data block that has not yet been written, it is zero. S3. The difference between the current and previous sampling period's end-of-period interruption delay is used as the end-of-period delay difference. For sampling periods where the absolute value of the end-of-period delay difference does not exceed a preset delay difference ratio of the period duration and is less than the period duration, the write amount is converted into the calibrated write amount and included in the effective period according to the ratio of the period duration to the difference between the period duration and the end-of-period delay difference. S4. Use the increment of the write amount after calibration of adjacent valid cycles as the write amount change value; S5. In response to the fact that the effective period of the write volume exceeding the initial value of the local baseline issued by the operation and maintenance platform after calibration reaches a preset number of consecutive periods, and write evidence appears in the judgment window formed by each effective period that exceeds the limit and the immediately preceding effective period, the abnormal write flag is set, wherein the write evidence includes the case where the change value of the write volume exceeds the change value tolerance of the local baseline. S6. In response to the abnormal write flag being set, the write target of subsequent data blocks is switched to the isolation area that the read pointer does not read, and the write is cyclically overwritten in at least part of the isolation area. The read pointer reads the data blocks that have not been read from the circular buffer.

2. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 1, characterized in that, In S4, half of the sum of the absolute values ​​of the differences in the proportions of each length interval of the data block length distribution relative to the baseline block length distribution in the local baseline within the effective period is also used as the block length distribution deviation. The write verification also includes the case where the number of data blocks within the effective period is not less than the preset minimum number of blocks and the block length distribution deviation exceeds the preset deviation threshold.

3. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 1, characterized in that, The upper limit of the input rate of the data block is greater than the read rate of the read pointer; The cycle duration and the preset number of consecutive cycles are determined as follows: The write-full time is obtained by dividing the capacity of the circular buffer by the difference between the upper limit of the input rate and the read rate. The product of the cycle duration and the preset number of consecutive cycles shall not exceed the product of the full writing time and the preset full writing percentage.

4. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 3, characterized in that, S3 includes the following sub-steps: S31. For sampling periods where the absolute value of the end-of-cycle delay difference exceeds the preset delay difference ratio of the cycle duration, the sampling period is merged one by one with the subsequent adjacent sampling periods where the absolute value of the end-of-cycle delay difference also exceeds the preset delay difference ratio of the cycle duration to form a merging window. The difference between the end-of-cycle interruption delay at the beginning and end of the merging window is used as the window delay difference. The merging continues until the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration of the merging window, or until the window duration reaches the product of the full write time and the preset full write ratio. S32. In response to the fact that the absolute value of the window delay difference does not exceed the preset delay difference ratio of the window duration, the sum of the write amounts of each sampling period in the merged window is calculated according to the ratio of the window duration to the difference between the window duration and the window delay difference, and then divided by the number of sampling periods included in the merged window, as the calibrated write amount of each sampling period in the merged window, and each sampling period is included in the effective period.

5. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 4, characterized in that, The preset delay difference ratio and the period duration are further adjusted according to the following verification operations: A sampling period is set as a verification period at every preset verification interval, and the interrupt trigger timestamp of each data block received within the verification period is recorded; After all the data blocks received within the verification period have been written, the total number of bytes of the data blocks belonging to the verification period according to the interrupt trigger timestamp is taken as the arrival amount. For the verification period that is the valid period and the arrival amount is greater than zero, the ratio of the arrival amount to the difference between the calibration amount and the amount written after calibration in the verification period relative to the arrival amount is taken as the relative residual. In response to the number of relative residuals reaching a preset statistical number, the quantile value of the most recent preset statistical number of relative residuals at a preset quantile level is used as the residual quantile value. In response to the residual quantile value exceeding a preset residual upper limit, the preset delay difference ratio is reduced by a preset proportional step. In response to the fact that the preset delay difference ratio has decreased to the preset lower limit and the residual quantile value still exceeds the preset residual upper limit, the period duration is increased within the range that the product of the period duration and the preset number of consecutive periods does not exceed the product of the write-full time and the preset write-full percentage.

6. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 1, characterized in that, The writing of corroboration also includes residuals increasing in the same direction, and S5 includes the following sub-steps: S51. The effective period during which the written amount exceeds the written amount tolerance after calibration is recorded as the trigger period, the next sampling period of the trigger period is set as the sampling period, and the interrupt trigger timestamp of each data block received within the sampling period is recorded. S52. After all the data blocks received within the sampling period have been written, the total number of bytes of the data blocks belonging to the sampling period according to the interrupt trigger timestamp is used as the arrival amount. In response to the sampling period being the effective period, the calibration residual is obtained by subtracting the calibration write amount of the sampling period from the arrival amount. S53. In response to the calibration residual being greater than a preset lower limit of residual and the end-of-cycle delay difference of the sampling period being greater than zero, the increase of the residual in the same direction is counted as writing evidence within the judgment window of the trigger period.

7. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 1, characterized in that, In step S6, the breakpoint position of the write pointer in the circular buffer is also recorded; Following step S6, the following recovery operation is also performed: In response to the fact that the amount of writing after calibration does not exceed the writing limit and no writing evidence appears within several consecutive preset reset cycles of the effective period, isolation recovery is performed. The isolation recovery includes resetting the abnormal writing flag, switching the writing target of the writing pointer back to the circular buffer and continuing to write from the breakpoint position, and erasing the isolation area.

8. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 7, characterized in that, Also includes: In response to the satisfaction of the deceleration trigger condition, the input source for generating the data block is switched from interrupt mode to polling mode at a preset polling interval, and the polled data block received by polling is written into the isolation area. The polled data block is not considered as the data block that has not yet been written. The deceleration trigger condition includes the duration of the abnormal write flag being set exceeding the preset deceleration duration. During the polling reception period of the input source, the input source is restored to interrupt mode to receive one sampling period every preset detection interval. In response to the sampling period being included in the effective period, the sampling period is used as the detection period. In response to the fact that the post-calibration write volume exceeds the write volume tolerance for a consecutive preset number of detection cycles, the preset detection interval is doubled until the preset detection interval upper limit is reached. While the input source is in polling reception, the execution of the isolation recovery must also satisfy that the post-calibration write volume of the most recent probe cycle does not exceed the write volume tolerance.

9. The abnormal write isolation method for a ring buffer based on an operation and maintenance platform according to claim 1, characterized in that, The local baseline is based on the grouped baseline issued by the operation and maintenance platform. The grouped baseline is obtained by the operation and maintenance platform grouping computing nodes according to input interface type and configured input rate level, and taking the median of each local baseline uploaded by each computing node in the same group. The method further includes: The local baseline is updated only during the effective period when the abnormal write flag is not set and the post-calibration write volume does not exceed the write volume tolerance. Upload the local baseline to the operation and maintenance platform; In response to receiving the group baseline issued by the operation and maintenance platform when the deviation between the local baseline and the group baseline exceeds a preset drift threshold, the local baseline is reset with the group baseline.

10. The method for isolating abnormal writes to a ring buffer based on an operation and maintenance platform according to claim 9, characterized in that, The isolation area includes a head reservation section and a tail loop section. In S6, after switching the write target, the first few preset reservation blocks of the data blocks are written to the head reservation section without being overwritten. The data blocks received thereafter are cyclically overwritten and written in the tail loop section. The method further includes: The length distribution of data blocks within the header reserved segment is reported to the operation and maintenance platform as the reserved segment block length distribution. The system receives an anomaly fingerprint from the operation and maintenance platform. The anomaly fingerprint is the length distribution obtained by taking the average value of each item in the reserved segment block length distribution when the number of computing nodes in the same group whose differences between the reserved segment block length distributions are lower than a preset aggregation threshold is not less than a preset number of nodes. The preset number of consecutive cycles is determined in the following manner: If the difference between the data block length distribution within the effective period and the abnormal fingerprint is less than a preset matching threshold, the preset number of consecutive periods is 1; otherwise, it is the preset number of normal periods.