SATA (Serial Advanced Technology Attachment) bus anomaly detection method, system and device for local cache of edge gateway

By acquiring the timing offset characteristics and statistical distribution characteristics of the SATA bus, integrating and calculating the bus health status and generating a collaborative protection strategy, the problem of disconnected detection between the link establishment stage and the data transmission stage in the existing technology is solved, realizing early protection of critical data cached by the edge gateway and accurate adaptation to business requirements.

CN121967273AInactive Publication Date: 2026-05-01BEIJING BZD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BZD TECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-05-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In existing technologies, in edge gateway local caching scenarios, the anomaly detection during the link establishment phase and the error characteristics during the data transmission phase of the SATA bus cannot be effectively correlated and analyzed, making it difficult to achieve early warning of bus anomalies and thus failing to protect critical data in a timely manner.

Method used

By acquiring the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase, the bus health is calculated, weights are dynamically allocated, a set of collaborative protection strategies is generated, and the dynamic changes in bus health are monitored in real time to trigger local strategy replanning to ensure the protection of highly important data.

Benefits of technology

It enables early detection of the health status of the SATA bus, can capture abnormal signals when there is slight degradation at the physical layer, dynamically adjust protection strategies, and ensure that critical data receives a higher level of protection when the bus is abnormal, thus avoiding data loss due to faults.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967273A_ABST
    Figure CN121967273A_ABST
Patent Text Reader

Abstract

The invention discloses an SATA (Serial Advanced Technology Attachment) bus anomaly detection method, system and device for local cache of an edge gateway, and relates to the technical field of edge computing and bus detection. According to the SATA bus anomaly detection method for the local cache of the edge gateway, the time sequence offset characteristic in the SATA bus link establishment stage and the statistical distribution characteristic in the data transmission stage are obtained, the health degree is calculated in a fusion mode and filtered, the protection priority is determined in combination with the data importance level and the service load, the cache writing strategy is matched, and the SATA bus anomaly detection method for the local cache of the edge gateway is achieved. According to the method, the characteristics of the SATA bus link establishment stage and the data transmission stage are obtained, a related model is constructed, the bus health degree is calculated in a fusion mode, and the adaptive cache protection strategy is matched, so that the safety of the SATA bus link establishment and data transmission stage is improved, and the safety of the SATA bus link establishment and data transmission stage is improved. Accurate detection of bus abnormity is realized, and security of local cache data of the edge gateway is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Method, system, and device for SATA bus anomaly detection for local caching in edge gateways Technical Field

[0001] This invention relates to the field of edge computing and bus detection technology, specifically to a method, system, and device for detecting SATA bus anomalies in local caching of edge gateways. Background Technology

[0002] With the rapid development of edge computing technology, edge gateways, as the core devices of edge nodes, are widely used in industrial control and data acquisition scenarios. Their local cache is used to store key information such as industrial control commands and sensor data.

[0003] The SATA bus, a commonly used transmission link for local caching in edge gateways, enables high-speed data transmission through relevant protocols and is a core component ensuring the normal operation of the local cache. Edge gateway deployment environments are complex, and factors such as temperature variations and power supply fluctuations can affect the SATA bus signal quality. The stable operation of the bus directly impacts the integrity and availability of local cached data, thus affecting the normal operation of the entire edge computing system. Currently, the SATA bus is widely used in edge gateway local caching scenarios, and related bus transmission and detection technologies are continuously evolving.

[0004] The limitations of existing technologies include at least the following problems: For anomaly detection of the SATA bus, the link establishment phase and the data transmission phase are usually treated as independent links and judged based on the indicators of only a single phase.

[0005] However, in the actual operation of edge gateways, there is a clear causal relationship between these two stages: the timing characteristics such as pulse width offset and pulse edge jitter in the link establishment stage directly reflect the signal quality degradation of the physical layer. This degradation will accumulate and eventually manifest as an increase in the CRC error rate and frame loss fluctuations in the data transmission stage. The fragmented detection of existing technologies means that the small offsets that occur in the link establishment stage are often ignored by the system as normal fluctuations because they are not correlated with the error distribution in the transmission stage. An alarm is only triggered when the error rate in the transmission stage continues to soar. At this time, the bus is already close to the failure edge, and the protection strategy can only be passively activated after the error occurs. As a result, the critical data in the edge gateway cache is exposed to a high-risk state before the bus actually fails, making it difficult to obtain timely and effective early protection. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides a method, system, and device for detecting SATA bus anomalies in edge gateway local caches. This solves the problem in existing technologies where the lack of correlation analysis between degradation signals during link establishment and error characteristics during data transmission makes it difficult to achieve early warning of bus anomalies, thus hindering effective protection of critical data in edge gateway caches before a failure occurs.

[0007] To achieve the above objectives, the present invention provides the following technical solution: a SATA bus anomaly detection method for local caching of an edge gateway, comprising the following steps: acquiring the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase, wherein the timing offset characteristics include pulse width offset and pulse edge jitter value, and the statistical distribution characteristics include CRC error frequency and distribution variance of frame loss errors; dynamically allocating corresponding weights according to the timing offset characteristics and statistical distribution characteristics, calculating the bus health, and performing filtering processing; acquiring the importance level and real-time service load status of the current cached data of the edge gateway, and determining the data protection priority corresponding to different health intervals according to the importance level and service load status; matching corresponding cache write strategies for different health intervals according to the bus health and data protection priority; detecting whether there is a conflict in storage resource occupation between the cache write strategies corresponding to different health intervals, and if there is a conflict, adjusting the conflict strategy parameters according to preset rules to generate a collaborative protection strategy set; monitoring the dynamic changes of bus health in real time, and when the health is detected to decrease by more than a preset mutation threshold within a preset short period of time, triggering local policy replanning for the affected data, and prioritizing the protection strategy for high-importance data in the replanning.

[0008] Furthermore, the specific steps for obtaining the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase are as follows: When the SATA bus link begins to be established, the pulse capture module built into the edge gateway is activated to collect the physical layer handshake pulse signal in real time; the collected physical layer handshake pulse signal is analyzed to extract the pulse width offset and pulse edge jitter value, forming the timing offset characteristics of the SATA bus during the link establishment phase; after the SATA bus enters the data transmission phase, the error statistics module built into the edge gateway is activated to record CRC errors and frame loss errors during the link layer transmission process in real time; the recorded CRC errors and frame loss errors are statistically analyzed to calculate the frequency of CRC errors and the variance of the distribution of frame loss errors, forming the statistical distribution characteristics of the SATA bus during the data transmission phase.

[0009] Furthermore, the specific steps for calculating the bus health are as follows: input the timing offset features into the preset physical layer degradation model and output the physical layer anomaly index; input the statistical distribution features into the preset link layer error model and output the link layer anomaly index; use an improved weighted fusion algorithm to perform weighted fusion of the physical layer anomaly index and the link layer anomaly index to obtain the bus health.

[0010] Furthermore, the specific steps for constructing the physical layer degradation model are as follows: Collect timing offset characteristics of the SATA bus link establishment phase under standard operating conditions before the edge gateway leaves the factory, as a baseline timing feature set; collect timing offset characteristics of the SATA bus link establishment phase during the edge gateway aging test, as a degradation timing feature set; extract the statistical mean of pulse width offset and the statistical root mean square of pulse edge jitter values ​​from the baseline timing feature set, as physical layer health baseline values; extract the statistical mean of pulse width offset and the statistical root mean square of pulse edge jitter values ​​from the degradation timing feature set, as physical layer degradation reference values; and construct a linear mapping relationship between pulse width offset, pulse edge jitter values, and physical layer anomaly index, using the physical layer health baseline value and the physical layer degradation reference value as boundaries.

[0011] Furthermore, the specific steps for constructing the link layer error model are as follows: collect the time series of link layer error events during SATA bus data transmission, and record the timestamps of each CRC error and frame loss error; calculate the time interval between two adjacent error events to generate an error interval sequence; use maximum likelihood estimation to fit the error interval sequence with a mixed exponential distribution to obtain the error occurrence rate during high error rate periods, the error occurrence rate during low error rate periods, and the proportion of high error rate periods, and calculate the link layer anomaly index.

[0012] Furthermore, the specific steps for weighted fusion of the physical layer anomaly index and the link layer anomaly index are as follows: Historical data of the physical layer anomaly index and the link layer anomaly index are obtained; the prediction lead time of the physical layer anomaly index for bus failures and the prediction lead time of the link layer anomaly index for bus failures are calculated; an improved weighted fusion algorithm is used, combining the ratio of their prediction lead times, to calculate the early warning sensitivity of the physical layer anomaly index and the criterion accuracy of the link layer anomaly index respectively, and the weights corresponding to the physical layer anomaly index and the link layer anomaly index are dynamically allocated; the physical layer anomaly index and the link layer anomaly index are quantized separately, and weighted summation is performed using their respective weights to obtain the fused bus health score; the bus health scores obtained from multiple consecutive calculations are subjected to exponential smoothing to obtain the smoothed bus health score.

[0013] Furthermore, the specific steps for determining the data protection priority corresponding to different health intervals are as follows: Classify cached data into critical data, important data, and ordinary data according to their importance level; classify real-time business load status into high load, medium load, and low load; preset a priority decision table, where each combination of importance level and business load status corresponds to a priority score; calculate the weighted average priority score based on the proportion of each type of data in the current cached data, and use this score as the data protection priority corresponding to the current health interval.

[0014] Further, the specific steps for adjusting the conflict policy parameters to generate a collaborative protection policy set are as follows: Obtain the cache write policy matching each health interval, and extract the preset I / O bandwidth usage and cache space usage for each policy; add the I / O bandwidth usage of each policy to obtain the total I / O usage, and add the cache space usage of each policy to obtain the total cache usage; when the total I / O usage exceeds the currently available I / O bandwidth of the edge gateway, reduce the I / O bandwidth usage of the corresponding policy in order of data protection priority from low to high; when the total cache usage exceeds the currently available cache space of the edge gateway, reduce the cache space usage of the corresponding policy in order of data protection priority from low to high; recombine the adjusted policy parameters to generate a collaborative protection policy set.

[0015] A SATA bus anomaly detection system for edge gateway local caching includes: a feature acquisition module, used to acquire timing offset characteristics of the SATA bus during the link establishment phase and statistical distribution characteristics during the data transmission phase; the timing offset characteristics include pulse width offset and pulse edge jitter value; the statistical distribution characteristics include CRC error frequency and distribution variance of frame loss errors; a health calculation module, used to dynamically allocate corresponding weights based on the timing offset characteristics and statistical distribution characteristics, fuse and calculate the bus health, and perform filtering processing; and a priority determination module, used to acquire the importance level and real-time service load status of the current cached data of the edge gateway, and determine the priority based on the importance level and service load status. The system defines data protection priorities for different health ranges; a policy matching module matches corresponding cache write policies for different health ranges based on bus health and data protection priorities; a conflict coordination module detects whether there are conflicts in storage resource usage between cache write policies corresponding to different health ranges. If conflicts exist, it adjusts the conflict policy parameters according to preset rules to generate a set of coordinated protection policies; and a monitoring and replanning module monitors the dynamic changes in bus health in real time. When the health level drops by more than a preset mutation threshold within a preset short period, it triggers local policy replanning for the affected data and prioritizes the protection policies for highly important data during the replanning process.

[0016] A SATA bus anomaly detection device for local caching of edge gateways includes: a feature acquisition unit, used to acquire timing offset features of the SATA bus during the link establishment phase and statistical distribution features during the data transmission phase; the timing offset features include pulse width offset and pulse edge jitter value; the statistical distribution features include CRC error frequency and distribution variance of frame loss errors; a health calculation unit, used to dynamically allocate corresponding weights based on the timing offset features and statistical distribution features, fuse and calculate the bus health, and perform filtering processing; and a priority determination unit, used to acquire the importance level of the current cached data of the edge gateway and the real-time service load status, and determine the priority based on the importance level and service load status. The system defines data protection priorities for different health intervals; a policy matching unit matches corresponding cache write policies for different health intervals based on bus health and data protection priorities; a conflict coordination unit detects whether there are conflicts in storage resource usage between cache write policies corresponding to different health intervals, and if conflicts exist, adjusts the conflict policy parameters according to preset rules to generate a set of coordinated protection policies; and a monitoring and replanning unit monitors the dynamic changes in bus health in real time. When the health level is detected to have decreased by more than a preset mutation threshold within a preset short period of time, it triggers local policy replanning for the affected data, and prioritizes the protection policies for highly important data during the replanning process.

[0017] The present invention has the following beneficial effects:

[0018] (1) The SATA bus anomaly detection method for local caching of edge gateways obtains the timing offset characteristics of the link establishment stage and the statistical distribution characteristics of the data transmission stage, and calculates the bus health by fusing them together. In the link establishment stage, the physical layer handshake pulse signal is collected by the pulse capture module built into the edge gateway, and the pulse width offset and pulse edge jitter value are extracted, so as to directly reflect the early degradation of the physical layer signal quality. In the data transmission stage, CRC error and frame loss error are recorded by the error statistics module. The calculated CRC error frequency and the distribution variance of frame loss error are the final manifestation of this degradation. Existing technologies usually separate the monitoring of these two stages, which leads to the small offset in the link establishment stage being ignored. The alarm is only triggered when the error rate soars in the transmission stage. At this time, the bus is close to failure. This method performs correlation analysis on the two types of features, combines the anomaly index output by the physical layer degradation model and the link layer error model, and dynamically allocates weights to calculate the bus health. This process can capture the abnormal signal when the physical layer has slight degradation, realize the early perception of the bus health status, and gain advance for subsequent protection strategies, avoiding passive response only after the fault occurs.

[0019] (2) The SATA bus anomaly detection method for local caching of edge gateways determines the data protection priority corresponding to different health intervals by obtaining the importance level of cached data and the real-time business load status, and matches the differentiated cache writing strategy accordingly. The data cached by the edge gateway includes different types such as industrial control instructions and sensor acquisition data, and their importance varies significantly. At the same time, the CPU and I / O load of the gateway also changes dynamically over time. This method first divides the cached data into three categories according to importance: critical, important, and ordinary, and divides the business load into three states: high, medium, and low. By pre-setting a priority decision table and combining the proportion of each type of data, a weighted average priority score is calculated to determine the protection priority of the corresponding health interval. Existing technologies use fixed protection strategies, which are difficult to adapt to such business differences and load fluctuations, resulting in insufficient protection of critical data under high load and excessive resource consumption under low load. This method dynamically adjusts the protection priority according to the data importance and load status, so that critical data always receives a higher level of protection when the bus is abnormal, while avoiding non-core data from occupying limited resources, and achieving precise matching between protection effect and business needs.

[0020] (3) The SATA bus anomaly detection method for local caching of edge gateways detects the conflict in storage resource occupation of cache write strategies corresponding to different health intervals, adjusts the conflict parameters according to preset rules to generate a set of collaborative protection strategies, and triggers local strategy replanning when the health suddenly drops. The write strategies matched by different health intervals have different occupation of I / O bandwidth and cache space. When multiple intervals are active at the same time, resource contention is likely to occur, making it difficult for the strategy to be effectively executed. This method first extracts the I / O bandwidth and cache space occupation of each strategy, calculates the total occupation, and when it exceeds the available resources, adjusts the occupation parameters of the corresponding strategy from low to high according to the protection priority to ensure that high priority data always obtains the necessary protection resources. At the same time, it monitors the dynamic changes of bus health in real time. When it is detected that the health drops by more than the mutation threshold within a preset short period of time, it can quickly locate the affected data and start local replanning. In the replanning process, high-importance data is given priority to avoid the computational overhead and response delay caused by global strategy adjustment, and ensure that core business data is not lost in the event of a sudden anomaly.

[0021] Of course, any product implementing this invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0022] Figure 1 is a flowchart of the SATA bus anomaly detection method for local caching of edge gateways according to the present invention.

[0023] Figure 2 is a block diagram of the SATA bus anomaly detection system for local caching of edge gateways according to the present invention.

[0024] Figure 3 is a block diagram of the SATA bus anomaly detection device for local caching of edge gateways according to the present invention. Detailed Implementation

[0025] Please refer to Figure 1. This embodiment of the invention provides a technical solution: a SATA bus anomaly detection method for local caching of an edge gateway, comprising the following steps: obtaining the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase. The timing offset characteristics include pulse width offset and pulse edge jitter value, and the statistical distribution characteristics include the frequency of CRC errors and the distribution variance of frame loss errors. Based on the timing offset characteristics and statistical distribution characteristics, corresponding weights are dynamically allocated, the bus health is calculated, and filtering is performed. The importance level and real-time service load status of the current cached data of the edge gateway are obtained, and the data protection priority corresponding to different health intervals is determined based on the importance level and service load status. Based on the bus health and data protection priority, corresponding cache write strategies are matched for different health intervals. Detection is performed to determine whether there is a conflict in storage resource usage between the cache write strategies corresponding to different health intervals. If a conflict exists, the conflict strategy parameters are adjusted according to preset rules to generate a collaborative protection strategy set. Real-time monitoring of the dynamic changes in bus health is conducted. When the health is detected to decrease by more than a preset mutation threshold within a preset short period, a local strategy replanning for the affected data is triggered, and the protection strategy for high-importance data is prioritized during the replanning.

[0026] The preset short duration ranges from 50ms to 200ms, and can be adjusted according to the service response latency requirements of the edge gateway. For example, it can be set to 50ms for industrial control edge gateways and 200ms for ordinary data acquisition edge gateways.

[0027] The preset mutation threshold is set based on historical health data of the edge gateway's SATA bus, specifically 30% to 50% of the average health value over the past 30 days. The past 30 days is the unified health data collection period, and the calculation formula is as follows:

[0028] ;

[0029] in, This is the statistical average of the bus health status over the past 30 days. This is the threshold coefficient, with a value ranging from 0.3 to 0.5;

[0030] For example: if the average health of the bus over the past 30 days is 85, then the mutation threshold can be set to 85 × 0.4 = 34. That is, when the health drops by more than 34 within a preset short period of time, a local strategy replanning will be triggered.

[0031] The filtering process employs an exponential smoothing filtering algorithm to eliminate instantaneous fluctuations in bus health status and ensure the stability of health status data.

[0032] Specifically, the steps to obtain the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase are as follows:

[0033] When the SATA bus link is established, the pulse capture module built into the edge gateway is activated to collect physical layer handshake pulse signals in real time. Specifically:

[0034] The pulse capture module uses a high-speed analog-to-digital converter chip (such as AD9220), with a sampling frequency of 100MHz and a sampling duration of the complete cycle of SATA bus link establishment (usually 10ms~50ms). The acquired physical layer handshake pulse signal is a differential signal with an amplitude range of 0.8V~1.2V.

[0035] For example, when the SATA bus initiates the link establishment process, the pulse capture module starts synchronously, continuously acquiring differential pulse signals within 50ms, recording the rising edge, falling edge time and amplitude of each pulse, ensuring that the acquired signal covers the entire handshake process without signal loss;

[0036] The acquired physical layer handshake pulse signals are analyzed to extract the pulse width offset and pulse edge jitter value, forming the timing offset characteristics of the SATA bus during the link establishment phase, specifically as follows:

[0037] The threshold comparison method is used to analyze pulse signals. The threshold is set to 1.0V (i.e., a pulse amplitude exceeding 1.0V is considered a valid pulse). The pulse width is the time interval between the rising and falling edges of a valid pulse. The pulse width offset is the difference between the actual acquired pulse width and the standard pulse width. The calculation formula is as follows:

[0038] ;

[0039] in, This is the actual pulse width. The standard handshake pulse width for the SATA bus (default is 10ns).

[0040] Pulse edge jitter is the maximum deviation between the rising (or falling) edge of each pulse in the same pulse sequence and the standard time. The calculation formula is:

[0041] ;

[0042] in, (n is the number of handshake pulses collected). Let i be the actual edge time of the i-th pulse. For standard time;

[0043] For example: if 10 handshake pulses are collected, and the actual pulse widths are 10.2ns, 9.8ns, and 10.1ns respectively, while the standard width is 10ns, then the corresponding pulse width offsets are 0.2ns, -0.2ns, and 0.1ns respectively.

[0044] The deviations between the actual and standard times of each pulse rise edge are 0.1ns, -0.1ns, 0.08ns, and -0.09ns, respectively. The deviations of the remaining 6 pulses are all within ±0.05ns, so the pulse edge jitter value is 0.1ns.

[0045] Once the SATA bus enters the data transmission phase, the error statistics module built into the edge gateway is activated to record CRC errors and frame loss errors during the link layer transmission process in real time. Specifically:

[0046] The error statistics module is electrically connected to the SATA bus link layer controller (such as the AHCI controller). It records error events using an interrupt-triggered method with a recording period of 1ms. Each record includes the error type (CRC error / frame loss error), the time of error occurrence, and the corresponding data frame identifier.

[0047] The CRC error determination criteria are as follows:

[0048] After the data frame transmission is completed, if the CRC check value calculated by the receiving end is inconsistent with the CRC check value attached by the sending end, it is determined to be a CRC error.

[0049] The criteria for determining frame loss errors are as follows:

[0050] If the sending end does not receive an acknowledgment signal from the receiving end within the preset acknowledgment time (50μs) after sending a data frame, and still does not receive an acknowledgment after retransmitting twice, it is determined to be a frame loss error;

[0051] For example, within a 1ms recording period, the error statistics module detects 3 CRC errors and 1 frame loss error, and records the occurrence time of each error (e.g., CRC errors occur at 100.1ms, 100.3ms, and 100.6ms, and a frame loss error occurs at 100.8ms) and the corresponding data frame identifiers (e.g., Frame_001, Frame_003, Frame_005, and Frame_007).

[0052] Statistical analysis was performed on the recorded CRC errors and frame loss errors to calculate the frequency of CRC errors and the variance of frame loss errors, thus forming the statistical distribution characteristics of the SATA bus during the data transmission phase. Specifically:

[0053] CRC error frequency is the number of CRC errors per unit time, calculated using the following formula:

[0054] ;

[0055] in, This represents the total number of CRC errors within a statistical period T, where T is set to 10 seconds.

[0056] For example: If 20 CRC errors are recorded within 10 seconds;

[0057] Therefore, the CRC error frequency is 20 / 10 = 2 times / s;

[0058] The variance of the frame loss error distribution is used to characterize the discreteness of the occurrence of frame loss errors, and the calculation formula is as follows:

[0059] ;

[0060] in, This is the number of frame loss errors within a statistical period T. The time when the j-th frame loss error occurs. The statistical mean of the times when m frame loss errors occur;

[0061] For example: If four frame loss errors occur within 10 seconds, at times of 2.1s, 4.2s, 6.3s, and 8.4s respectively, their statistical mean is:

[0062] ;

[0063] Distribution variance:

[0064] .

[0065] In this implementation scheme, the pulse capture module and the error statistics module work together to fully cover the entire process of the SATA bus from link establishment to data transmission. During the link establishment phase, handshake pulse signals are acquired at a sampling frequency of 100MHz to accurately measure pulse width offset and edge jitter value, capturing subtle changes in physical layer signal quality. During the data transmission phase, CRC errors and frame loss errors are recorded using an interrupt-triggered method. The link layer operating status is quantified through frequency statistics and distribution variance calculation. The methods for acquiring feature data in the two phases are independent yet interconnected, ensuring the accuracy of capturing early degradation signals of the physical layer and providing a quantitative basis for the accumulation of link layer anomalies, thus laying a reliable data foundation for the subsequent fusion analysis of the two types of features.

[0066] Specifically, the steps for integrating the health status of the computing bus are as follows:

[0067] The temporal offset features are input into a pre-defined physical layer degradation model, and the physical layer anomaly index is output, which is as follows:

[0068] The physical layer degradation model is a linear mapping model, with the pulse width offset as the input. and pulse edge jitter value The output is the physical layer anomaly index. The mapping formula is:

[0069] ;

[0070] in, , These are model coefficients, calibrated based on aging test data from the edge gateway's SATA bus. , , The value ranges from 0 to 1. The larger the value, the more severe the physical layer degradation and the higher the degree of anomaly.

[0071] For example: if the pulse width offset at a certain moment pulse edge jitter value Then the physical layer anomaly index is:

[0072] ;

[0073] This indicates a minor anomaly at the physical layer.

[0074] The statistical distribution characteristics are input into a pre-defined link-layer error model, and the output is a link-layer anomaly index, which is as follows:

[0075] The link-layer error model is a quantization model based on error distribution, with CRC error frequency as the input. Distribution variance of frame loss error The output is the link layer anomaly index. The calculation process is as follows:

[0076] The input features are normalized using the following formula:

[0077] ;

[0078] ;

[0079] in, , times / s, , ;

[0080] The link-layer anomaly index is obtained by weighted summation, using the following formula:

[0081] ;

[0082] in, The value ranges from 0 to 1, and a larger value indicates a more severe link layer anomaly.

[0083] For example: if the CRC error frequency Variance of frame loss error distribution per second After normalization:

[0084] ;

[0085] ;

[0086] Link layer anomaly index:

[0087] ;

[0088] This indicates a minor anomaly at the link layer;

[0089] An improved weighted fusion algorithm is used to weight and fuse the physical layer anomaly index and the link layer anomaly index to obtain the bus health score, specifically as follows:

[0090] The improved weighted fusion algorithm dynamically assigns weights based on the predictive effectiveness of the anomaly index to calculate the physical layer anomaly index. and link layer anomaly index The prediction confidence level is calculated using the following formula:

[0091] ;

[0092] ;

[0093] in, , These are the standard deviation and mean of the physical layer anomaly index over the last 100 times. , These are the standard deviation and mean of the link-layer anomaly index for the past 100 times;

[0094] Weights are assigned based on the prediction confidence level, and the weight calculation formula is as follows:

[0095] ;

[0096] ;

[0097] in, The weights for the physical layer anomaly index. The weights of the link layer anomaly index are: ;

[0098] The bus health score is obtained by weighted summation. The formula is:

[0099] ;

[0100] in, The value ranges from 0 to 1. The larger the value, the better the bus health status; the smaller the value, the higher the degree of bus abnormality.

[0101] For example: if the average of the physical layer anomaly index over the last 100 times... Standard deviation ;

[0102] but ;

[0103] The average of the link layer anomaly indexes over the past 100 times Standard deviation ;

[0104] but ;

[0105] Weight ;

[0106] Weight ;

[0107] If the current , Then the bus health status is:

[0108] ;

[0109] This indicates that the bus is in good health.

[0110] The specific steps for constructing a physical layer degradation model are as follows:

[0111] The timing offset characteristics of the edge gateway during the SATA bus link establishment phase under standard operating conditions before it leaves the factory are collected as a baseline timing feature set, which is as follows:

[0112] The standard operating conditions are set as follows: temperature 25℃±2℃, relative humidity 50%±5%, power supply voltage 12V±0.5V, and 1000 samples are collected. Each sample is the pulse width offset during the SATA bus link establishment phase. and pulse edge jitter value ( All acquired temporal offset features satisfy the following:

[0113] , ;

[0114] These 1000 sets of time series offset features were organized into a baseline time series feature set:

[0115] ;

[0116] For example: one set of benchmark time series features is , The other group is , All of them meet the timing requirements under standard operating conditions;

[0117] Timing offset characteristics during the SATA bus link establishment phase of the edge gateway aging test are collected as a degradation timing feature set, specifically:

[0118] The aging test adopted a high-temperature aging method, with a test temperature of 60℃ and a test duration of 1000 hours. Timing offset characteristics were collected every 10 hours, for a total of 100 sets. The pulse width offset was collected for each set. and pulse edge jitter value ( As aging time increases, the deviation of the time-series offset features gradually increases, and the final acquired time-series offset features satisfy:

[0119] , ;

[0120] These 100 sets of temporal offset features are organized into a degenerate temporal feature set:

[0121] ;

[0122] For example: A set of time-series features collected after 100 hours of aging is as follows:

[0123] ;

[0124] ;

[0125] A set of time-series features collected after 1000 hours of aging are as follows:

[0126] ;

[0127] ;

[0128] It reflects the degradation trend of time sequence offset with aging;

[0129] The statistical mean of pulse width offset and the root mean square of pulse edge jitter value are extracted from the baseline timing feature set and used as the physical layer health baseline value. Specifically:

[0130] The formula for calculating the statistical mean of pulse width offset is:

[0131] ;

[0132] The formula for calculating the root mean square of pulse edge jitter is:

[0133] ;

[0134] Physical layer health baseline value ;

[0135] For example: By calculating 1000 sets of baseline time series features, we obtain:

[0136] ;

[0137] ;

[0138] That is, the physical layer health baseline value is (0.06ns, 0.05ns);

[0139] The statistical mean of pulse width offset and the root mean square of pulse edge jitter value are extracted from the degradation time sequence feature set and used as physical layer degradation reference values. Specifically:

[0140] The formula for calculating the statistical mean of pulse width offset is:

[0141] ;

[0142] The formula for calculating the root mean square of pulse edge jitter is:

[0143] ;

[0144] Physical layer degradation reference value ;

[0145] For example: By calculating 100 sets of degenerate time series features, we obtain:

[0146] ;

[0147] ;

[0148] That is, the physical layer degradation reference values ​​are (0.45ns, 0.42ns);

[0149] Using the physical layer health baseline and physical layer degradation reference values ​​as boundaries, a linear mapping relationship is constructed between the pulse width offset and the pulse edge jitter value to the physical layer anomaly index, specifically as follows:

[0150] Determine the physical layer anomaly index The boundary value, when the time series offset feature equals the health baseline value. hour, (No abnormalities);

[0151] When the time offset feature equals the degenerate reference value hour, (Serious abnormality);

[0152] The linear mapping relationship is constructed as follows:

[0153] ;

[0154] in, , The weighting coefficients are determined based on aging test data. , ,and , These are the calibration coefficients for the same set of aging tests;

[0155] For example: substitute the health baseline value (0.06ns, 0.05ns) and the degradation reference value (0.45ns, 0.42ns);

[0156] when , hour;

[0157] The numerator is (0.3-0.06)×0.6+(0.2-0.05)×0.4=0.144+0.06=0.204;

[0158] The denominator is (0.45-0.06)×0.6+(0.42-0.05)×0.4=0.234+0.148=0.382;

[0159] therefore This indicates a moderate anomaly at the physical layer.

[0160] The specific steps for constructing a link-layer error model are as follows:

[0161] The time series of link layer error events during SATA bus data transmission is collected, and the timestamps of each CRC error and frame loss error are recorded. Specifically:

[0162] The data collection period was set to 24 hours, with 30 sets of samples collected (i.e., continuous collection for 30 days). Error events were collected each day during the 8 hours of normal SATA bus operation. The timestamp format for each error event was "year-month-day hour:minute:second.millisecond", with a timestamp precision of 1ms. The daily error events were sorted by their occurrence time to form a daily error time series.

[0163] ;

[0164] in, (d is the number of days for data collection) The total number of error events on day d. This is the timestamp of the m-th error event on day d;

[0165] For example: The erroneous time series for day 1 is:

[0166] ;

[0167] These correspond to the occurrence times of the three error events, with the first two being CRC errors and the third being a frame loss error.

[0168] Calculate the time interval between two consecutive error events to generate an error interval sequence, specifically as follows:

[0169] For daily error time series The formula for calculating the time interval between two consecutive error events is:

[0170] ;

[0171] in, All daily error intervals are compiled to generate a total error interval sequence:

[0172] ;

[0173] The unit of time interval is ms;

[0174] For example: In the error time series of day 1, the time intervals between two adjacent errors are as follows:

[0175] ;

[0176] ;

[0177] These two time intervals are included in the total error interval sequence;

[0178] Maximum likelihood estimation is used to fit a mixed exponential distribution to the error interval sequence, obtaining the error rate during high error rate periods, the error rate during low error rate periods, and the proportion of high error rate periods. The link layer anomaly index is then calculated, specifically as follows:

[0179] The probability density function of the mixed exponential distribution is:

[0180] ;

[0181] in, The percentage of periods with high error rates ( ), Error rate during periods of high error rate (unit: 1 / ms). The error rate during periods of low error rate (unit: 1 / ms), and ;

[0182] The maximum likelihood estimation method is used to estimate the error interval sequence. For the sample, solve for the parameters , , The likelihood function is:

[0183] ;

[0184] in, Given the length of the error interval sequence, take the logarithm of the likelihood function and differentiate it. Set the derivative to 0 and solve for the parameter values.

[0185] For example: After fitting using maximum likelihood estimation, we obtain:

[0186] (High error rate periods account for 30%)

[0187] 1 / ms (5 × 10^{-5} errors occur every ms during periods of high error rate);

[0188] 1 / ms (1×10^{-5} errors occur every ms during low error rate periods);

[0189] Link layer anomaly index The calculation formula is:

[0190] ;

[0191] in, 1 / ms 1 / ms is the preset maximum occurrence rate threshold. Substituting the parameters, we get... This indicates a moderate anomaly at the link layer.

[0192] The specific steps for weighted fusion of physical layer anomaly indices and link layer anomaly indices are as follows:

[0193] Historical data on the physical layer anomaly index and the link layer anomaly index are obtained. The prediction lead time for bus failures based on the physical layer anomaly index and the link layer anomaly index are calculated. Specifically:

[0194] Historical data collection period is 30 days, with 100 sets of physical layer anomaly indices collected daily. and link layer anomaly index ( (A total of 3000 sets of data) records the occurrence times of three bus failures in history. , , ;

[0195] Lead time of prediction of physical layer anomaly index The difference between the time of the fault occurrence and the time when the physical layer anomaly index first exceeds the warning threshold (preset to 0.6) is calculated using the following formula:

[0196] ;

[0197] in, This is the moment when the physical layer anomaly index first exceeds 0.6 before the q-th failure;

[0198] Lead time of prediction for link layer anomaly index The calculation method and Consistent, the formula is:

[0199] ;

[0200] in, This is the moment when the link layer anomaly index first exceeds 0.6 before the q-th failure;

[0201] For example: If three faults occur at times t1=100h, t2=200h, and t3=300h, respectively, the corresponding physical layer warning times are 98h, 197h, and 296h, and the link layer warning times are 95h, 195h, and 294h, then:

[0202] ;

[0203] ;

[0204] An improved weighted fusion algorithm is adopted, combining the ratio of the prediction lead time of the two to calculate the early warning sensitivity of the physical layer anomaly index and the criterion accuracy of the link layer anomaly index, respectively. The weights corresponding to the physical layer anomaly index and the link layer anomaly index are dynamically allocated, specifically as follows:

[0205] Early warning sensitivity The calculation formula for the (physical layer) is:

[0206] ;

[0207] Criterion accuracy The calculation formula for the (link layer) is:

[0208] ;

[0209] The weighting follows the principle of "the longer the prediction lead time, the greater the weight," with the physical layer anomaly index having the following weights. Weight of the link layer anomaly index ;

[0210] in, The normalization coefficient is... ,make sure ;

[0211] For example: Substitution , ,get:

[0212] ;

[0213] ;

[0214] ;

[0215] therefore , That is, the link layer anomaly index has a higher weight because it has a longer prediction lead time and a better early warning effect;

[0216] The physical layer anomaly index and the link layer anomaly index are quantified separately, and then weighted and summed according to their respective weights to obtain the fused bus health score, which is as follows:

[0217] The quantization process uses a normalization method to convert the physical layer anomaly index. and link layer anomaly index Normalize to the [0,1] interval using the following formula:

[0218] ;

[0219] ;

[0220] in, , , , (because , The value is already in the [0,1] interval, so the value remains unchanged after normalization.

[0221] The weighted summation formula is:

[0222] ;

[0223] in, This is the original bus health value after merging, ranging from [0,1]. A larger value indicates a more severe bus abnormality. ;

[0224] For example: if the current , , , ;

[0225] but This indicates a slight to moderate anomaly in the bus;

[0226] The bus health scores obtained from multiple consecutive calculations are exponentially smoothed to obtain the smoothed bus health score, which is as follows:

[0227] Using a single exponential smoothing algorithm, the calculation formula is as follows:

[0228] ;

[0229] in, The bus health status after the k-th smoothing is... This is the original value of the bus health status calculated in the kth iteration. The bus health status after the (k-1)th smoothing is... This is a smoothing coefficient, ranging from 0.1 to 0.3. Considering the low computing power characteristics of edge gateways, let... ;

[0230] initial value (The original value from the first calculation);

[0231] For example: If the initial health values ​​for 5 consecutive times are 0.464, 0.48, 0.45, 0.47, and 0.49 respectively, the initial value... ;

[0232] but ;

[0233] ;

[0234] ;

[0235] ;

[0236] The smoothed health status fluctuations are significantly reduced, better reflecting the true health status of the bus.

[0237] In this implementation scheme, the accurate quantification of the SATA bus health status is achieved through the construction and coordination of the physical layer degradation model and the link layer error model. The physical layer degradation model takes pulse width offset and pulse edge jitter as inputs and outputs a physical layer anomaly index using a linear mapping, which can capture the early degradation of physical layer signal quality. The link layer error model fits the error interval sequence with a mixed exponential distribution and outputs a link layer anomaly index, reflecting the cumulative effect of link layer errors. The prediction confidence of the two types of anomaly indices is dynamically weighted and fused, so that the one with more stable prediction effect receives higher weight, avoiding the bias caused by fixed weights. The fused health status is then subjected to exponential smoothing, effectively filtering out instantaneous fluctuation interference, making the health status curve smoother and more realistically reflecting the changes in bus status.

[0238] Specifically, the steps to determine the data protection priority corresponding to different health status intervals are as follows:

[0239] The cached data is categorized into critical data, important data, and ordinary data based on their importance level, as follows:

[0240] Critical data is defined as the core business data of the edge gateway, including industrial control commands, equipment operating parameters, security authentication information, etc. The loss or damage of such data will lead to the interruption of edge gateway services and equipment failure.

[0241] For example, in industrial scenarios, the command data for edge gateways to control robot operation (such as "start robot" and "adjust running speed to 5m / s") and the temperature threshold parameters of equipment (such as "alarm temperature ≥80℃") are all critical data; important data is defined as core business-related data, including real-time data collected by sensors and business logs (non-core), etc. The loss of such data will affect the accuracy of business analysis, but will not cause business interruption;

[0242] For example, in an environmental monitoring edge gateway, the ambient temperature data collected by the temperature sensor every 10 seconds and the ordinary logs of the device operation (such as "the device started normally") are both important data; ordinary data is defined as non-core, recoverable data, including temporary cached files, redundant backup data (non-critical), etc. The loss of this type of data can be quickly recovered through other channels without affecting the normal operation of the business.

[0243] For example, web page files temporarily cached by the edge gateway and ordinary log backups that are repeatedly stored are all ordinary data; the three types of data are divided using a labeling method, with key data labeled "Key", important data labeled "Important", and ordinary data labeled "Normal". The edge gateway caching system can quickly identify the importance level of data through labels;

[0244] The real-time service load status is divided into high load, medium load, and low load, as follows:

[0245] Using the edge gateway's CPU utilization, memory utilization, and I / O bandwidth utilization as the three metrics for load evaluation, the load evaluation formula is set as follows:

[0246] ;

[0247] in, CPU utilization (0~1) This represents memory usage (0~1). The coefficient represents the I / O bandwidth utilization rate (0~1), and is set based on the weight of the impact of edge gateway resource usage on cache writes (CPU has the greatest impact, followed by memory and I / O).

[0248] High load judgment criteria are This means that the CPU, memory, and I / O bandwidth utilization rates are all high, and the edge gateway's processing capacity is close to saturation.

[0249] For example: CPU utilization 85%, memory utilization 80%, I / O bandwidth utilization 75%;

[0250] but This is determined to be a high load.

[0251] The criteria for determining medium load are In other words, the edge gateway has moderate processing capacity and no obvious load pressure.

[0252] For example: CPU utilization 60%, memory utilization 55%, I / O bandwidth utilization 50%;

[0253] but It is determined to be a medium load;

[0254] Low load judgment criteria are This means that the edge gateway has sufficient processing capacity and low load pressure;

[0255] For example: CPU utilization 30%, memory utilization 25%, I / O bandwidth utilization 20%;

[0256] but It is determined to be under low load;

[0257] A preset priority decision table is used. Each combination of importance level and business load status in the decision table corresponds to a priority score, specifically:

[0258] The priority score ranges from 1 to 10, with higher scores indicating higher data protection priority.

[0259] The decision table is shown below:

[0260] Table 1, Examples of Decision Representations

[0261] Data Importance Level\Business Load Status High Load Medium Load Low Load Critical Data 10 points 10 points 10 points Important Data 8 points 9 points 9 points Ordinary Data 5 points 6 points 7 points surface

[0262] For example: critical data has a priority score of 10 (highest priority) under any load condition; important data has a score of 8 under high load and 9 under medium and low load.

[0263] Ordinary data scores 5 points under high load, 6 points under medium load, and 7 points under low load, which conforms to the principle of "prioritizing the protection of core data and focusing more on core data as the load increases";

[0264] Based on the proportion of each type of data in the current cached data, a weighted average priority score is calculated, which serves as the data protection priority corresponding to the current health range. Specifically:

[0265] Suppose that the proportion of key data in the current cached data is . The proportion of important data is The proportion of ordinary data is ,and ;

[0266] The priority scores for each type of data are as follows: (Key data) (Important data) (Ordinary data);

[0267] The formula for calculating the weighted average priority score is:

[0268] ;

[0269] This refers to the data protection priority corresponding to the current health level range; the higher the score, the higher the protection priority.

[0270] For example: The current edge gateway is under medium load, and the proportion of critical data in the cached data is... Percentage of important data Proportion of ordinary data The corresponding priority scores are as follows: , , ;

[0271] The weighted average priority score is then:

[0272] point;

[0273] This is classified as a high protection priority, and subsequent cache write strategies must prioritize the security of critical and important data.

[0274] If the current load is high, the proportion of normal data Key data percentage Percentage of important data The corresponding score is , , ;

[0275] but point;

[0276] It was determined to be of medium to high protection priority, prioritizing the protection of critical data while also taking into account important data.

[0277] In this implementation plan, cached data is divided into three levels: critical data, important data, and ordinary data. A tagging method is used for rapid identification, enabling the edge gateway to accurately distinguish the value differences of different data in business operations. Simultaneously, CPU utilization, memory utilization, and I / O bandwidth utilization are used as evaluation indicators. A load evaluation coefficient is obtained through weighted calculation, classifying real-time business load status into high, medium, and low levels. This quantifies the resource strain on the edge gateway at different times. Based on this, a priority decision table is preset to match corresponding priority scores for combinations of different importance levels and load statuses. Then, combined with the actual proportion of each type of data in the current cache, a weighted average priority score is calculated as the final basis for data protection priority. This process transforms vague business requirements into calculable priority indicators, allowing protection strategies to dynamically adjust according to data importance and load status. This ensures that critical data receives priority protection during bus anomalies, while preventing non-core data from excessively consuming protection resources during periods of resource scarcity.

[0278] Specifically, the steps for adjusting the conflict strategy parameters to generate a collaborative protection strategy set are as follows:

[0279] Obtain the cache write strategy matching each health interval, and extract the preset I / O bandwidth usage and cache space usage for each strategy, specifically as follows:

[0280] Divide the bus health status into intervals, with 3 preset health intervals, namely the health interval ( ), sub-health zone ( ), abnormal intervals ( Each range matches a corresponding cache write strategy:

[0281] The healthy zone adopts a "high-speed write + dual backup" strategy (strategy 1), with preset I / O bandwidth usage. Cache space usage ;

[0282] The sub-healthy range adopts a "uniform speed write + single backup" strategy (strategy 2), with preset I / O bandwidth usage. Cache space usage ;

[0283] The abnormal interval adopts a "low-speed write + core backup" strategy (strategy 3), with preset I / O bandwidth usage. Cache space usage ;

[0284] The cache controller of the edge gateway retrieves the presets of the three policies in real time. (I / O bandwidth) and (Cache space) parameters form a policy resource usage table;

[0285] For example: Strategy 1 , This means that when the strategy is running, it uses 200MB of I / O bandwidth per second and 4GB of cache space for data writing and backup.

[0286] The total I / O usage is obtained by summing the I / O bandwidth usage of each strategy, and the total cache usage is obtained by summing the cache space usage of each strategy. Specifically:

[0287] The formula for calculating total I / O usage is:

[0288] ;

[0289] The formula for calculating total cache usage is:

[0290] ;

[0291] For example, substituting the parameters of the three strategies above, we get:

[0292] ;

[0293] ;

[0294] Meanwhile, the available I / O bandwidth is obtained through the resource monitoring module of the edge gateway. and available cache space Assuming the current , If so, it can be preliminarily determined that there is a resource conflict;

[0295] When the total I / O usage exceeds the currently available I / O bandwidth of the edge gateway, the I / O bandwidth usage of the corresponding policy is reduced sequentially from low to high according to the data protection priority. Specifically:

[0296] Conflict determination criteria are The rule has been adjusted to "the lower the protection priority, the higher the bandwidth reduction percentage," with the default reduction percentage being:

[0297] The strategy for ordinary data (low priority) is reduced by 40%, the strategy for important data (medium priority) is reduced by 20%, and the strategy for critical data (high priority) is not reduced.

[0298] The calculation formula is ;

[0299] in, This refers to the adjusted I / O bandwidth usage. To reduce the proportion (low priority) Medium priority High priority );

[0300] For example: There is an I / O bandwidth conflict;

[0301] Strategy 1 (corresponding to high-priority data) remains unchanged. ;

[0302] Strategy 2 (corresponding to medium priority data) is reduced by 20%. ;

[0303] Strategy 3 (for low-priority data) reduces by 40%. ;

[0304] Adjusted total I / O utilization It still slightly exceeds the available bandwidth, so the bandwidth of Strategy 3 is reduced again to 20MB / s;

[0305] final Matching available bandwidth;

[0306] When the total cache usage exceeds the currently available cache space of the edge gateway, the cache space usage of the corresponding policies is reduced sequentially in ascending order of data protection priority, as follows:

[0307] Conflict determination criteria are The adjustment rules are consistent with the I / O bandwidth adjustment: low-priority policies reduce cache space by 40%, medium-priority policies reduce it by 20%, and high-priority policies do not reduce it.

[0308] The calculation formula is , The value is the same as that for bandwidth adjustment;

[0309] For example: There is a cache space conflict;

[0310] Strategy 1 remains unchanged. ;

[0311] Strategy 2 reduces by 20%. ;

[0312] Strategy 3 reduces by 40%. ;

[0313] Adjusted total cache usage Slightly exceeding the available space, the cache space for Strategy 3 is reduced again to 0.4GB;

[0314] final Matches available cache space;

[0315] The adjusted strategy parameters are then recombined to generate a collaborative protection strategy set, which is as follows:

[0316] The collaborative protection strategy set is Each strategy parameter corresponds to the original health range, and new strategy coordination rules are added to ensure a smooth transition of strategy parameters when switching between different health ranges, avoiding sudden changes in resource consumption.

[0317] For example:

[0318] The adjusted strategy set is ;

[0319] The collaboration rules are as follows:

[0320] When the bus health status changes from the sub-healthy range (0.5≤H<0.8) to the healthy range (H≥0.8), strategy 2 gradually switches to strategy 1, I / O bandwidth gradually increases from 80MB / s to 200MB / s, cache space gradually increases from 1.6GB to 4GB, and the switching time is set to 1s to avoid service lag caused by sudden changes in bandwidth and cache space.

[0321] When switching from the sub-healthy range to the abnormal range (H<0.5), strategy 2 is gradually switched to strategy 3, and the parameters are gradually reduced to ensure that data protection is not interrupted.

[0322] In this implementation, bus health is divided into three intervals: healthy, sub-healthy, and abnormal. Differentiated write strategies are matched to each interval, and the I / O bandwidth and cache space usage of each strategy are pre-set, making the resource requirements under different health states clear and quantifiable. When multiple strategies are active simultaneously, by calculating the total resource usage and comparing it with the currently available resources, conflicts in I / O bandwidth or cache space can be accurately identified. When a conflict occurs, the resource usage of the corresponding strategies is adjusted sequentially according to the data protection priority from low to high. The higher the priority of the strategy, the smaller the resource reduction ratio or even no reduction, ensuring that critical data can still receive necessary protection when resources are scarce. The adjusted strategy parameters are recombined to generate a collaborative protection strategy set. At the same time, strategy collaboration rules are introduced to achieve a smooth transition of resource usage when switching between different health intervals, avoiding business interruption or protection interruption due to sudden changes in strategy parameters. This mechanism enables the reasonable allocation of limited storage resources when multiple strategies are implemented in parallel, ensuring the protection needs of high-priority data while avoiding strategy failure due to resource contention.

[0323] Please refer to Figure 2. This embodiment of the invention provides a technical solution: a SATA bus anomaly detection system for local caching of an edge gateway, comprising: a feature acquisition module, used to acquire the timing offset features of the SATA bus during the link establishment phase and the statistical distribution features during the data transmission phase; the timing offset features include pulse width offset and pulse edge jitter value; the statistical distribution features include CRC error frequency and the distribution variance of frame loss errors; a health calculation module, used to dynamically allocate corresponding weights based on the timing offset features and statistical distribution features, fuse and calculate the bus health, and perform filtering processing; and a priority determination module, used to acquire the importance level and real-time service load status of the currently cached data of the edge gateway, and determine the priority based on importance. The system comprises four modules: a bus health level and a business load status module to determine the data protection priority for different health ranges; a policy matching module to match corresponding cache write policies for different health ranges based on bus health and data protection priority; a conflict coordination module to detect whether there are conflicts in storage resource usage between cache write policies corresponding to different health ranges, and if conflicts exist, to adjust the conflict policy parameters according to preset rules to generate a set of coordinated protection policies; and a monitoring and replanning module to monitor the dynamic changes in bus health in real time, and to trigger local policy replanning for the affected data when the health level drops by more than a preset mutation threshold within a preset short period of time, prioritizing the protection policies for high-importance data in the replanning.

[0324] The modules are electrically connected through the internal bus of the edge gateway (such as the PCIe bus), with a data transmission rate of no less than 100MB / s, which can ensure that the collaborative response latency of each module does not exceed 50ms.

[0325] The feature acquisition module has a built-in pulse capture unit and an error statistics unit, which correspond to the physical layer and link layer of the SATA bus, respectively. The pulse capture unit uses a high-speed ADC chip (such as AD9220), and the error statistics unit is directly connected to the SATA link layer controller (AHCI controller).

[0326] The health calculation module has a built-in embedded processor (such as ARM Cortex-A7) to quickly execute the weighted fusion algorithm and the exponential smoothing filter algorithm, ensuring that the health calculation cycle does not exceed 1ms;

[0327] The monitoring replanning module has a built-in timer and threshold comparator. The timer is used to set a preset short duration, and the threshold comparator is used to compare the decline in health with the mutation threshold in real time. When the triggering condition is met, a replanning instruction is immediately sent to the policy matching module and the conflict coordination module to ensure that local policy replanning starts within 10ms.

[0328] Each module supports hot-swapping, facilitating future maintenance and upgrades, and has a self-diagnostic function. When a module fails, it automatically sends an alarm signal to the main control module of the edge gateway to ensure stable system operation.

[0329] Please refer to Figure 3. This embodiment of the invention provides a technical solution: a SATA bus anomaly detection device for local caching of an edge gateway, comprising: a feature acquisition unit, used to acquire timing offset features of the SATA bus during the link establishment phase and statistical distribution features during the data transmission phase; the timing offset features include pulse width offset and pulse edge jitter value; the statistical distribution features include CRC error frequency and the distribution variance of frame loss errors; a health calculation unit, used to dynamically allocate corresponding weights based on the timing offset features and statistical distribution features, fuse and calculate the bus health, and perform filtering processing; and a priority determination unit, used to acquire the importance level of the currently cached data of the edge gateway and the real-time service load status, and determine the priority based on importance. The system comprises four modules: a bus health level and a business load status, which determine the data protection priority for different health ranges; a policy matching unit, which matches corresponding cache write policies for different health ranges based on bus health and data protection priority; a conflict coordination unit, which detects whether there are conflicts in storage resource usage between cache write policies corresponding to different health ranges, and if conflicts exist, adjusts the conflict policy parameters according to preset rules to generate a set of coordinated protection policies; and a monitoring and replanning unit, which monitors the dynamic changes in bus health in real time, and triggers local policy replanning for the affected data when the health level drops by more than a preset mutation threshold within a preset short period of time, prioritizing the protection policies for high-importance data in the replanning process.

[0330] The device adopts a modular hardware design and is integrated on the main board of the edge gateway. Its overall size is 50mm×30mm×5mm, which is compatible with the installation space of mainstream edge gateways.

[0331] The feature acquisition unit includes a differential signal acquisition interface and an error signal detection interface. The differential signal acquisition interface is used to connect to the physical layer interface of the SATA bus and acquire handshake pulse signals. The error signal detection interface is used to connect to the SATA link layer controller and acquire CRC error and frame loss error signals.

[0332] The health calculation unit uses an FPGA chip (such as Xilinx Spartan-7) to implement a weighted fusion algorithm through hardware logic, which improves the calculation efficiency by more than 50% compared with the software implementation, ensuring the real-time performance of health calculation.

[0333] The priority determination unit interfaces with the cache management unit of the edge gateway to obtain key data tags (Key), important data (Important), normal data (Normal), and business load data (CPU, memory, I / O utilization) of cached data in real time.

[0334] The strategy matching unit and the conflict coordination unit are integrated into the same microcontroller (such as STM32F407) to achieve coordinated control of strategy matching and conflict adjustment;

[0335] The monitoring and replanning unit has a built-in watchdog circuit to monitor the validity of health data and avoid false triggering caused by abnormal data.

[0336] The device is powered by 3.3V, operates at a current of no more than 500mA, has low power consumption, is compatible with the low power consumption requirements of edge gateways, and has anti-electromagnetic interference capabilities, enabling it to work stably in harsh industrial environments.

[0337] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0338] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for detecting SATA bus anomalies in local caching of an edge gateway, characterized in that, Includes the following steps: The timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase are obtained. The timing offset characteristics include pulse width offset and pulse edge jitter value, and the statistical distribution characteristics include CRC error frequency and distribution variance of frame loss error. The corresponding weights are dynamically allocated based on the timing offset characteristics and statistical distribution characteristics, the bus health is calculated by fusion, and filtering is performed. Obtain the importance level and real-time business load status of the current cached data of the edge gateway, and determine the data protection priority corresponding to different health intervals based on the importance level and business load status; Based on bus health and data protection priority, match corresponding cache write strategies for different health ranges; Detect whether there is a conflict in storage resource usage between cache write strategies corresponding to different health ranges. If there is a conflict, adjust the conflict strategy parameters according to preset rules and generate a set of collaborative protection strategies. The system monitors the dynamic changes in bus health in real time. When the health level drops by more than a preset mutation threshold within a preset short period of time, it triggers a local policy replanning for the affected data and prioritizes the protection policy for highly important data during the replanning.

2. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 1, characterized in that, The specific steps for obtaining the timing offset characteristics of the SATA bus during the link establishment phase and the statistical distribution characteristics during the data transmission phase are as follows: When the SATA bus link begins to be established, the pulse capture module built into the edge gateway is activated to collect the physical layer handshake pulse signal in real time; the collected physical layer handshake pulse signal is analyzed to extract the pulse width offset and pulse edge jitter value, forming the timing offset characteristics of the SATA bus during the link establishment phase; after the SATA bus enters the data transmission phase, the error statistics module built into the edge gateway is activated to record CRC errors and frame loss errors during the link layer transmission process in real time; Statistical analysis is performed on the recorded CRC errors and frame loss errors to calculate the frequency of CRC errors and the variance of the distribution of frame loss errors, thus forming the statistical distribution characteristics of the SATA bus during the data transmission phase.

3. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 1, characterized in that, The specific steps for calculating the bus health are as follows: input the timing offset features into the preset physical layer degradation model and output the physical layer anomaly index; input the statistical distribution features into the preset link layer error model and output the link layer anomaly index; use an improved weighted fusion algorithm to perform weighted fusion of the physical layer anomaly index and the link layer anomaly index to obtain the bus health.

4. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 3, characterized in that, The specific steps for constructing the physical layer degradation model are as follows: Collect the timing offset characteristics of the SATA bus link establishment stage under standard operating conditions before the edge gateway leaves the factory, as the baseline timing feature set; collect the timing offset characteristics of the SATA bus link establishment stage during the edge gateway aging test, as the degradation timing feature set; The statistical mean of pulse width offset and the root mean square of pulse edge jitter value in the baseline timing feature set are extracted as physical layer health baseline values. The statistical mean of pulse width offset and the root mean square of pulse edge jitter value are extracted from the degradation time sequence feature set and used as physical layer degradation reference values. Using the physical layer health baseline and physical layer degradation reference values ​​as boundaries, a linear mapping relationship is constructed between the pulse width offset and the pulse edge jitter value and the physical layer anomaly index.

5. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 3, characterized in that, The specific steps for constructing the link layer error model are as follows: Collect the time series of link layer error events during SATA bus data transmission, and record the timestamps of each CRC error and frame loss error; calculate the time interval between two adjacent error events to generate an error interval sequence; Maximum likelihood estimation is used to fit the error interval sequence to a mixed exponential distribution to obtain the error rate during high error rate periods, the error rate during low error rate periods, and the proportion of high error rate periods, and the link layer anomaly index is calculated.

6. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 3, characterized in that, The specific steps for weighted fusion of the physical layer anomaly index and the link layer anomaly index are as follows: obtain historical data of the physical layer anomaly index and the link layer anomaly index, calculate the prediction lead time of the physical layer anomaly index for bus failure, and the prediction lead time of the link layer anomaly index for bus failure; use an improved weighted fusion algorithm, combine the ratio of the prediction lead times of the two, calculate the early warning sensitivity of the physical layer anomaly index and the criterion accuracy of the link layer anomaly index respectively, and dynamically allocate the weights corresponding to the physical layer anomaly index and the link layer anomaly index respectively. The physical layer anomaly index and the link layer anomaly index are quantified separately, and then weighted and summed according to their respective weights to obtain the fused bus health score. The bus health scores obtained from multiple consecutive calculations are then exponentially smoothed to obtain the smoothed bus health score.

7. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 1, characterized in that, The specific steps for determining the data protection priority corresponding to different health levels are as follows: classify cached data into critical data, important data, and ordinary data according to their importance level; classify real-time business load status into high load, medium load, and low load; A priority decision table is preset, and each combination of importance level and business load status in the decision table corresponds to a priority score; based on the proportion of each type of data in the current cached data, a weighted average priority score is calculated as the data protection priority corresponding to the current health range.

8. The SATA bus anomaly detection method for local caching in an edge gateway according to claim 1, characterized in that, The specific steps for adjusting conflict policy parameters to generate a collaborative protection policy set are as follows: Obtain the cache write policy matching each health interval, and extract the preset I / O bandwidth usage and cache space usage for each policy; add the I / O bandwidth usage of each policy to obtain the total I / O usage, and add the cache space usage of each policy to obtain the total cache usage; when the total I / O usage exceeds the currently available I / O bandwidth of the edge gateway, reduce the I / O bandwidth usage of the corresponding policy in order of data protection priority from low to high; when the total cache usage exceeds the currently available cache space of the edge gateway, reduce the cache space usage of the corresponding policy in order of data protection priority from low to high. The adjusted strategy parameters are recombined to generate a set of collaborative protection strategies.

9. A SATA bus anomaly detection system for edge gateway local caching, employing the SATA bus anomaly detection method for edge gateway local caching as described in any one of claims 1-8, characterized in that, include: The feature acquisition module is used to acquire the timing offset features of the SATA bus during the link establishment phase and the statistical distribution features during the data transmission phase. The timing offset features include pulse width offset and pulse edge jitter value, and the statistical distribution features include CRC error frequency and distribution variance of frame loss error. The health calculation module is used to dynamically allocate corresponding weights based on time-series offset characteristics and statistical distribution characteristics, fuse and calculate the bus health, and perform filtering processing. The priority determination module is used to obtain the importance level and real-time business load status of the current cached data of the edge gateway, and determine the data protection priority corresponding to different health intervals based on the importance level and business load status. The strategy matching module is used to match corresponding cache write strategies for different health ranges based on bus health and data protection priority. The conflict coordination module is used to detect whether there are conflicts in storage resource usage between cache write strategies corresponding to different health ranges. If there are conflicts, the conflict strategy parameters are adjusted according to preset rules to generate a set of coordinated protection strategies. The monitoring and replanning module is used to monitor the dynamic changes in bus health in real time. When the health level is detected to drop by more than the preset mutation threshold within a preset short period of time, the local strategy replanning of the affected data is triggered, and the protection strategy of high-importance data is prioritized in the replanning.

10. A SATA bus anomaly detection device for edge gateway local cache, employing the SATA bus anomaly detection method for edge gateway local cache according to any one of claims 1-8, characterized in that, include: The feature acquisition unit is used to acquire the timing offset features of the SATA bus during the link establishment phase and the statistical distribution features during the data transmission phase. The timing offset features include pulse width offset and pulse edge jitter value, and the statistical distribution features include CRC error frequency and distribution variance of frame loss error. The health calculation unit is used to dynamically allocate corresponding weights based on time-series offset characteristics and statistical distribution characteristics, fuse and calculate the bus health, and perform filtering processing. The priority determination unit is used to obtain the importance level and real-time business load status of the current cached data of the edge gateway, and determine the data protection priority corresponding to different health intervals based on the importance level and business load status. The policy matching unit is used to match the corresponding cache write policy for different health ranges based on bus health and data protection priority. The conflict coordination unit is used to detect whether there is a conflict in storage resource usage between cache write strategies corresponding to different health ranges. If a conflict exists, the conflict strategy parameters are adjusted according to preset rules to generate a set of coordinated protection strategies. The monitoring and replanning unit is used to monitor the dynamic changes in bus health in real time. When the health level is detected to drop by more than the preset mutation threshold within a preset short period of time, the local strategy replanning of the affected data is triggered, and the protection strategy of high-importance data is prioritized in the replanning.