Edge gateway data acquisition frequency adaptive adjustment method

CN122932896APending Publication Date: 2026-10-16SHANGHAI DONGSHANG INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611042040.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0004]本发明旨在至少在一定程度上解决现有技术中的技术问题之一,通过收集边缘网关采集的数据,并进行数据预处理,得到网关历史采集数据;并进行窗口变化分析,获取当前的窗口大小,得到当前窗口信息;基于当前窗口信息,利用边缘网关在当前窗口采集的数据进行频率调节分析,得到调节指标信息;并获取数据采集频率,并自适应调节数据采集频率;以解决现有的边缘网关采集频率调节技术在利用滑动窗口对采集频率进行自适应调节时,采用固定长度的滑动窗口,容易造成采样冗余或不足,无法在全工况范围内达到采集精度与资源消耗的平衡的问题

Benefits of technology

[0015]本发明的有益效果:本发明通过收集边缘网关采集的数据,并进行数据预处理,得到网关历史采集数据;根据网关历史采集数据进行窗口变化分析,获取当前的窗口大小,得到当前窗口信息;基于当前窗口信息,利用边缘网关在当前窗口采集的数据进行频率调节分析,得到调节指标信息;根据调节指标信息获取数据采集频率,并自适应调节边缘网关的数据采集频率;在利用滑动窗口对采集频率进行自适应调节时,可以根据采集的数据情况动态调整滑动窗口的大小,减小采样冗余和采样不足的晴天,在全工况范围内实现采集精度与资源消耗的平衡;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122932896A_ABST
    Figure CN122932896A_ABST
Patent Text Reader

Abstract

The application discloses an edge gateway data acquisition frequency self-adaptive adjustment method, relates to the technical field of edge gateway acquisition frequency adjustment, and comprises the following steps: collecting data acquired by an edge gateway, and performing data preprocessing to obtain gateway historical acquisition data; performing window change analysis according to the gateway historical acquisition data, acquiring a current window size, and obtaining current window information; performing frequency adjustment analysis on data acquired by the edge gateway in the current window based on the current window information to obtain adjustment index information; acquiring a data acquisition frequency according to the adjustment index information, and self-adaptively adjusting the data acquisition frequency of the edge gateway; and the application is used for solving the problem that, when the existing edge gateway acquisition frequency adjustment technology utilizes a sliding window to self-adaptively adjust the acquisition frequency, a fixed-length sliding window is adopted, sampling redundancy or deficiency is easily caused, and the balance between acquisition precision and resource consumption cannot be achieved in a full-working-condition range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of edge gateway acquisition frequency adjustment technology, specifically to an adaptive adjustment method for edge gateway data acquisition frequency. Background Technology

[0002] Edge gateway data acquisition frequency adjustment technology uses multi-dimensional information such as the fluctuation characteristics of acquired data, device operating conditions, gateway resource load, and network status as the basis for judgment. Under the strict constraints of ensuring the accuracy of data required by the business, the integrity of key features, and the detectability of anomalies, it dynamically adjusts the time interval for the gateway to read data from downstream terminal devices, ultimately achieving optimized resource allocation of acquisition computing power, local storage, uplink bandwidth, and terminal power consumption.

[0003] Existing edge gateway sampling frequency adjustment technologies often use a fixed-length sliding window to adaptively adjust the sampling frequency. This window is used to calculate metrics such as variance, standard deviation, or information entropy in real time to quantify data fluctuations and map them to the sampling frequency. Higher fluctuations result in higher sampling frequencies, and vice versa. While this can reduce redundant sampling and bandwidth consumption to some extent, the length of the sliding window is usually set manually based on experience, making it prone to being too large or too small. Using a small fixed window increases sensitivity to transient interference and fluctuations; transient interferences such as electromagnetic interference and sensor contact jitter are easily misinterpreted as operational fluctuations, leading to frequent and meaningless switching of the sampling frequency. This increases computational overhead and causes sampling redundancy. Using a large fixed window further complicates matters. While fixed-size windows offer improved anti-interference capabilities, they also exhibit a lag in responding to sudden changes in operating conditions. When fluctuations occur, a sufficient number of samples are required to identify these changes, making it difficult to promptly increase the acquisition frequency. This can lead to the loss of critical process data and reduce the detection accuracy and real-time response of abnormal fluctuations. Even for the same type of data, different operating conditions can result in different fluctuation characteristics. Fixed windows cannot adapt to data with alternating fluctuation characteristics and cannot achieve a balance between acquisition accuracy and resource consumption across the entire operating range. Therefore, existing edge gateway acquisition frequency adjustment technologies, when using sliding windows for adaptive frequency adjustment, employ fixed-length sliding windows, which can easily lead to sampling redundancy or insufficiency, failing to achieve a balance between acquisition accuracy and resource consumption across the entire operating range. Summary of the Invention

[0004] This invention aims to at least partially solve one of the technical problems in the prior art. It collects data from an edge gateway, performs data preprocessing to obtain historical gateway data, analyzes window changes to obtain the current window size, and acquires current window information. Based on this current window information, it uses data collected by the edge gateway within the current window to perform frequency adjustment analysis, obtaining adjustment index information. It also acquires the data acquisition frequency and adaptively adjusts it. This addresses the problem that existing edge gateway frequency adjustment technologies, when using a fixed-length sliding window for adaptive frequency adjustment, easily cause sampling redundancy or insufficiency, failing to achieve a balance between acquisition accuracy and resource consumption across the entire operating range.

[0005] To achieve the above objectives, this application provides an adaptive adjustment method for edge gateway data acquisition frequency, comprising the following steps: Collect data gathered by the edge gateway and perform data preprocessing to obtain historical data collected by the gateway; Analyze window changes based on historical data collected from the gateway to obtain the current window size and information. Based on the current window information, frequency regulation analysis is performed using data collected by the edge gateway in the current window to obtain regulation index information; The data collection frequency is obtained based on the adjustment index information, and the data collection frequency of the edge gateway is adaptively adjusted.

[0006] Further, collecting data from the edge gateway and performing data preprocessing to obtain historical gateway data includes the following sub-steps: Any edge gateway to be adjusted is denoted as the first edge gateway, and any type of data collected by the first edge gateway is denoted as the first type of data. Based on the range of the first type of data collected by the first edge gateway, a reasonable range for the first type of data is set; denoted as the first reasonable range [Ymi, Ymx]; the first type of data collected by the first edge gateway that is not within the first reasonable range is recorded as erroneous data.

[0007] Furthermore, collecting data from the edge gateway and performing data preprocessing to obtain historical gateway data includes the following sub-steps: Collect the first type of data collected by the first edge gateway and arrange it according to the collection time; and determine whether the first type of data is erroneous each time it is collected, based on the first reasonable range; if it is erroneous data, it is discarded, and if it is not erroneous data, it is retained. Continuously collect normal first-type data collected by the first edge gateway to obtain the gateway's historical data collection data of first-type data.

[0008] Further, window change analysis is performed based on historical gateway collected data to obtain the current window size, and obtaining the current window information includes the following sub-steps: The historical gateway collected data is recorded as a collected data sequence; the window size range of the sliding window is set as [Nmi, Nmx], with the unit being the number of samples, which is recorded as the reasonable window range; and the adjustment step size of the sliding window is set as nw; The latest k1 sliding windows are recorded as recent windows; any one of the recent windows is recorded as a first window, and the first window is evenly divided into a front part and a rear part, which are respectively recorded as a front section and a rear section; where k1 is a set number; Based on the collected data sequence, the standard deviations of the first type of data in the front section and the rear section are respectively calculated, which are sequentially recorded as QB and HB; and min(QB, HB) / max(QB, HB) is calculated and recorded as the fluctuation uniformity AU of the first window.

[0009] Further, window change analysis is performed based on historical gateway collected data to obtain the current window size, and obtaining the current window information further includes the following sub-steps: The unit time change rate corresponding to any two adjacent first type of data in the first window is calculated, and the maximum unit time change rate is obtained and recorded as the maximum change rate AR of the first window; The size of the first window is recorded as AN, AN, AU and AR are recorded as the index information of the first window, and the index information of all recent windows is obtained repeatedly; The initial reference of the fluctuation uniformity is set as UC; the mean value of the fluctuation uniformity of all recent windows is calculated and recorded as the evaluation uniformity PU; (1-k2)×UOL+k2×PU is calculated and recorded as the current uniformity reference UE; where UOL is the uniformity reference used last time, and k2 is a set coefficient.

[0010] Further, window change analysis is performed based on historical gateway collected data to obtain the current window size, and obtaining the current window information further includes the following sub-steps: If the fluctuation uniformity of all recent windows is higher than the current uniformity reference UE, it is determined that a continuous steady state is satisfied; if the fluctuation uniformity of the latest recent window is less than 0.8×UE, or the maximum change rate of the latest recent window is greater than ER, it is determined that a sudden fluctuation change is satisfied; otherwise, it is determined that normal fluctuation is satisfied; The size of the latest recent window is obtained and recorded as NL; if the continuous steady state is satisfied and NL<Nmx, NL+nw is calculated, min(NL+nw, Nmx) is taken as the current window size DN, which is marked as the current window information; If normal fluctuation is satisfied, NL is recorded as the current window size DN, which is marked as the current window information; For a case that satisfies a fluctuation abrupt change, the fluctuation uniformity of the most recent short-term window is denoted as GU, and if 0.3×UE<GU, NL-nw is calculated, max(NL-nw, Nmi) is taken as the current window size DN, which is marked as current window information; If GU≤0.3×UE or the maximum change rate of the most recent short-term window is greater than ER, Nmi is taken as the current window size DN, which is marked as current window information.

[0011] Further, based on the current window information, frequency adjustment analysis is performed using the data collected by the edge gateway in the current window, and obtaining the adjustment indicator information includes the following sub-steps: Based on the collected data sequence, with the latest collected first-type data as the end point, a partial sequence with a length of DN is intercepted and recorded as the current collection window; The standard deviation of the first-type data in the current collection window is calculated and denoted as XB, and XB / (Ymx-Ymi) is calculated and denoted as the current relative fluctuation coefficient SA.

[0012] Further, based on the current window information, frequency adjustment analysis is performed using the data collected by the edge gateway in the current window, and obtaining the adjustment indicator information further includes the following sub-steps: Using the least squares method, unary linear fitting is performed on the first-type data in the current collection window in chronological order to obtain a corresponding fitted trend line; the residual of each piece of first-type data in the current collection window relative to the fitted trend line is calculated, the standard deviation of all residuals is calculated and denoted as CB, and CB / XB is calculated and denoted as the current predictability factor RA; SA×(1+k3×RA) is calculated and denoted as F0, max(EF, 1) is denoted as the comprehensive adjustment indicator EF, which is marked as adjustment indicator information, where k3 is a set correction coefficient.

[0013] Further, based on the current window information, the data collection frequency is acquired according to the adjustment indicator information, and adaptively adjusting the data collection frequency of the edge gateway includes the following sub-steps: The minimum time interval and the maximum time interval for collecting the first-type data are set, which are sequentially denoted as tn and tm; tn+(tm-tn)×(1-EF) is calculated e , which is denoted as the initial theoretical interval TC, where e is a set curvature adjustment coefficient; The smoothing coefficient is set to J0, and the value range of J0 is set to [Jmi, Jmx]; J0 is calculated, where J0=Jmi+(Jmx-Jmi)×[(Nmx-DN) / (Nmx-Nmi)]; J0×TC+(1-J0)×TL is calculated and denoted as the final collection time interval TW, where TL is the collection time interval used for the most recent collection.

[0014] Further, obtaining the data acquisition frequency according to the adjustment index information and adaptively adjusting the data acquisition frequency of the edge gateway further comprises the following sub-steps: If TW<tn, then set TW=tn; if TW>tm, then set TW=tm; otherwise, no adjustment is made. After completion, convert TW to the acquisition frequency, which is recorded as the current data acquisition frequency DF; For the first edge gateway, adjust the current acquisition frequency of the first type of data by the first edge gateway to DF, and continue to collect the first type of data based on the data acquisition frequency DF.

[0015] Beneficial effects of the present invention: The present invention collects the data collected by the edge gateway and performs data preprocessing to obtain historical gateway collection data; performs window change analysis according to the historical gateway collection data to obtain the current window size and obtain current window information; based on the current window information, performs frequency adjustment analysis using the data collected by the edge gateway in the current window to obtain adjustment index information; obtains the data acquisition frequency according to the adjustment index information, and adaptively adjusts the data acquisition frequency of the edge gateway; when adaptively adjusting the acquisition frequency by using the sliding window, the size of the sliding window can be dynamically adjusted according to the collected data situation, reducing the phenomena of sampling redundancy and insufficient sampling, and realizing the balance between acquisition accuracy and resource consumption in the full working condition range; The present invention performs window change analysis on the historical gateway collection data, and adaptively adjusts the size of the sliding window in combination with the fluctuation uniformity and the maximum change rate, so that the window can be dynamically adapted according to the data fluctuation state, thereby improving the ability to identify instantaneous interference and sudden working condition changes; further, a comprehensive adjustment index is constructed based on the relative fluctuation coefficient and the predictability factor of the data in the current window, so that the acquisition frequency adjustment takes into account both the data fluctuation characteristics and the change trend, and improves the accuracy and stability of the frequency adjustment; then the minimum time interval, the maximum time interval and the smoothing coefficient are combined to constrain and smooth the acquisition time interval, so as to avoid drastic fluctuations in the acquisition frequency, thereby realizing fine and adaptive adjustment of the data acquisition frequency of the edge gateway, reducing sampling redundancy and resource consumption, and simultaneously improving the ability to capture abnormal data in the full working condition range. Brief Description of the Drawings

[0016] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of the non-limiting embodiments with reference to the following accompanying drawings: Figure 1 is a step flowchart of the method of the present invention; Figure 2 is a flowchart for obtaining the current window size according to the present invention; Figure 3 is a schematic structural diagram of an electronic device of the present invention. Detailed Implementation

[0017] To make the technical means, creative features, objectives and effects of this invention easier to understand, the invention will be further described below in conjunction with specific embodiments.

[0018] Example 1, please refer to Figure 1 As shown, the present invention provides an adaptive adjustment method for edge gateway data acquisition frequency, comprising the following steps: Step S1: Collect data gathered by the edge gateway and perform data preprocessing to obtain historical data collected by the gateway; Step S1 includes the following sub-steps: Step S101: Any edge gateway to be adjusted is designated as the first edge gateway, and any type of data collected by the first edge gateway is designated as the first type of data. Step S102: Based on the range of the first type of data collected by the first edge gateway, set a reasonable range for the first type of data; denoted as the first reasonable range [Ymi, Ymx]; record the first type of data collected by the first edge gateway that is not within the first reasonable range as erroneous data, that is, establish data boundaries based on its own physical range or operating condition range to distinguish between normal data and abnormal data; avoid obviously erroneous data from being mixed into subsequent samples.

[0019] Step S103: Collect the first type of data collected by the first edge gateway and arrange it according to the collection time; and determine whether the first type of data is erroneous each time it is collected, based on the first reasonable range; if it is erroneous data, it is discarded, and if it is not erroneous data, it is retained; to ensure that the data entering the subsequent processing stream is all normally collected data. Step S104: Continuously collect normal first-type data collected by the first edge gateway to obtain the gateway's historical data of the first-type data; In actual implementation, the data acquisition frequency of the edge gateway refers to the time interval at which the gateway reads data from downstream terminal devices, usually expressed in Hertz (Hz), i.e., times per second. The core logic of using a sliding window to adaptively adjust the acquisition frequency is to quantify the intensity of data fluctuations in real time through a sliding window of a certain length, continuously mapping the fluctuation index to the acquisition interval. Unlike threshold-triggered adjustment, this method can achieve stepless smooth adjustment without obvious threshold boundaries. While ensuring data validity, it can minimize invalid sampling and reduce gateway computing power and bandwidth overhead. The sliding step size of the sliding window can be set as needed.

[0020] Step S2 involves analyzing window changes based on historical data collected from the gateway to obtain the current window size and thus the current window information. Step S2 includes the following sub-steps: For step S201, please refer to... Figure 2As shown, the historical data collected by the gateway is recorded as a data collection sequence; the window size range of the sliding window is set to [Nmi, Nmx], which is the upper and lower limits of the window length, in units of the number of samples, and is recorded as the reasonable range of the window; and the adjustment step size of the sliding window is set to nw; [Nmi, Nmx] can be set according to the actual application scenario. In this embodiment, [Nmi, Nmx] is [5, 25]; nw=2 can be set flexibly; nw is used to avoid frequent and large changes in the window, making the adaptive adjustment more stable; Step S202: The most recent k1 sliding windows are denoted as recent windows; any recent window is denoted as the first window, and the first window is evenly divided into two parts, denoted as the front part and the back part respectively; where k1 is the number set; in this implementation, k1=8, which can be set flexibly, generally [5, 20]. k1 should not be too large, otherwise the working condition response will be delayed due to the long evaluation cycle. Step S203: Based on the collected data sequence, calculate the standard deviation of the first type of data in the front and back parts respectively, and denot it as QB and HB respectively; and calculate min(QB, HB) / max(QB, HB), denoted as the fluctuation uniformity AU of the first window; The closer the fluctuation uniformity AU is to 1, the more consistent the fluctuation intensity of the first and second halves is, the stable operating conditions within the window, the good adaptability of the current window size, and even the potential for further enlargement; the smaller the AU is, the greater the difference in fluctuation between the first and second halves is, the window likely includes the operating condition switching point, and the window size is too large, which may cause the changes to be smoothed out, so the window needs to be reduced. For example, the first type of data is the equipment temperature, the first window size is 10, and the data in the window is [25.1, 25.0, 25.2, 25.1, 25.0, 25.1, 25.2, 25.0, 25.1, 25.2], in °C; then the standard deviation of the first part is QB=0.084, the standard deviation of the second part is HB=0.084, and then min(QB,HB) / max(QB,HB)=0.084 / 0.084=1.00.

[0021] Step S204: Calculate the rate of change per unit time for any two adjacent data of the first type within the first window, i.e., the absolute difference between the two data divided by the time interval; and obtain the maximum rate of change per unit time, denoted as the maximum rate of change AR of the first window; Maximum rate of change (AR) is used to capture sudden abnormal fluctuations; it can identify signals of sudden changes in operating conditions, avoiding the problem of insufficient sensitivity to sudden changes when relying solely on overall indicators such as standard deviation, thereby enabling window adjustment to respond promptly to rapid changes in data and reducing the omission of key fluctuations. Step S205: Denote the size of the first window as AN, and denote AN, AU and AR as the indicator information of the first window. Repeatedly obtain the indicator information of all recent windows. Step S206, set the initial reference of the fluctuation uniformity as UC; calculate the mean value of the fluctuation uniformity of all recent windows, which is recorded as evaluation uniformity PU; calculate (1-k2)×UOL + k2×PU, which is recorded as the current uniformity reference UE; where UOL is the last used uniformity reference, and k2 is a set coefficient; in this embodiment, UC=0.8, generally in the range of [0.7, 0.9], k2=0.25, generally in the range of [0.2, 0.3], both can be flexibly set; k2 is used to control the update speed of UE: the smaller the value, the higher the weight of the old reference, the gentler the update, and the stronger the stability; the larger the value, the higher the weight of new data, and the faster the update speed; When the first-type gateway just starts to collect the first-type data, there are not enough accumulated samples to support analysis, so UC can be continuously used as the uniformity reference UE. When enough samples are accumulated, the uniformity reference UE can realize smooth iteration, change with the change of data, and form a dynamically updated uniformity reference UE, so that the judgment criteria not only retain historical stability, but also can reflect the change of current data features, avoid insufficient adaptability caused by long-term fixed thresholds, thereby improving the continuity and robustness of window state classification; For example, UOL=0.8, PU=0.963, then the current uniformity reference UE=(1-k2)×UOL+k2×PU=0.841.

[0022] Step S207, if the fluctuation uniformity of all recent windows is higher than the current uniformity reference UE, it is determined that continuous steady state is satisfied; if the fluctuation uniformity of the latest recent window is less than 0.8×UE, or the maximum change rate of the latest recent window is greater than ER, it is determined that sudden fluctuation change is satisfied; otherwise, it is determined that normal fluctuation is satisfied; that is, when the data is stable, the window can be appropriately enlarged to reduce sampling redundancy; when there is normal fluctuation, the window is kept stable, and when there is a sudden change, the window is adjusted and reduced in time to improve the ability to capture abnormal sudden changes; Step S208, obtain the size of the latest recent window, which is recorded as NL; if continuous steady state is satisfied and NL<Nmx, calculate NL+nw, take min(NL+nw, Nmx) as the current window size DN, and mark it as the current window information; when in continuous steady state, the window can be gradually enlarged to reduce sampling redundancy and resource consumption; Step S209, if normal fluctuation is satisfied, record NL as the current window size DN, and mark it as the current window information; keeping the window unchanged during normal fluctuation can avoid meaningless repeated changes, and improve the stability of window control and resource utilization efficiency.

[0023] In step S210, for a situation that satisfies a fluctuation mutation, the fluctuation uniformity of the most recent short-term window is denoted as GU. If 0.3×UE < GU, NL-nw is calculated, the maximum value of (NL-nw, Nmi) is taken as the current window size DN, which is marked as current window information; 0.3 is a set coefficient that can be flexibly adjusted; That is, the data has a slight mutation, corresponding to scenarios of mild working condition fluctuation and slow process adjustment. Slightly shrinking the window can improve the response speed, and there is no need to shrink it to the minimum all at once, so as to avoid over-adjustment and give consideration to both adjustment stability and response sensitivity; In step S211, if GU ≤ 0.3×UE or the maximum change rate of the most recent short-term window is greater than ER, Nmi is taken as the current window size DN, which is marked as current window information; That is, the data has a sharp mutation; corresponding to scenarios of sharp working condition mutation and abnormal equipment failure, the window is directly adjusted to the minimum size to maximize the response speed, prioritize ensuring the time resolution of transient data, and fully capture the details of fault development; In the actual implementation process, indicators such as fluctuation uniformity and maximum change rate are used, combined with a dynamic uniformity reference for classification, and finally the window size DN is determined adaptively; compared with a fixed sliding window, it can not only avoid the over-sensitivity or insensitivity problems caused by the fixed window, but also dynamically adjust the window size with the change of data state, providing a more accurate and stable analysis basis for subsequent frequency adjustment.

[0024] In step S3, based on the current window information, the edge gateway is used to perform frequency adjustment analysis on the data collected in the current window to obtain adjustment index information; step S3 includes the following sub-steps: In step S301, based on the collected data sequence, with the latest collected first-type data as the end point, a partial sequence with a length of DN is intercepted and denoted as the current collection window; In step S302, the standard deviation of the first-type data in the current collection window is calculated and denoted as XB, and XB / (Ymx-Ymi) is calculated and denoted as the current relative fluctuation coefficient SA; the closer SA is to 1, the more intense the data fluctuation is, and the higher the overall information density included; For example, the equipment temperatures in the current collection window are [50.2, 51.0, 51.8, 52.5, 53.1, 53.9, 54.7, 55.5, 56.2, 57.0], the unit is °C, and the standard deviation is 2.18; the first reasonable range [Ymi, Ymx] is [-20°C, 100°C], then the relative fluctuation coefficient SA = XB / (Ymx-Ymi) = 0.018.

[0025] Step S303: Using the least squares method, perform a univariate linear fit on the first type of data in the current acquisition window according to the time order to obtain the corresponding fitting trend line; calculate the residual of each first type of data in the current acquisition window relative to the fitting trend line, and calculate the standard deviation of all residuals, denoted as CB; calculate CB / XB, denoted as the current prediction factor RA; the reason for using univariate linear fitting is that the computing power of the edge gateway is generally not high. If the computing power is sufficient, nonlinear fitting can also be used according to the actual application scenario. The predictability factor RA is used to measure the predictability of data and quantifies the proportion of random and uncontrollable components in fluctuations. When RA is close to 0, it means that the data fluctuations are almost all from deterministic trend changes and are highly regular. Even if the sampling frequency is reduced, the data process can be accurately restored through trend fitting. When RA is close to 1, it means that the fluctuations are mainly random and have no clear pattern. High-density sampling is necessary to capture the true changes. For example, if the standard deviation of the residuals is CB=0.11 and XB=2.18, then the predictability factor RA=CB / XB=0.051.

[0026] Step S304: Calculate SA×(1+k3×RA), denoted as F0, and denote max(EF,1) as the comprehensive adjustment index EF, marked as the adjustment index information. Here, k3 is the set correction coefficient; in this embodiment, k3=0.5, generally [0.4, 0.6]. k3 represents the amplification factor of random fluctuation on information density. The larger the value, the stronger the influence of data regularity on the collection interval. The comprehensive adjustment index EF is the ultimate core indicator for measuring the required sampling frequency of data. The higher the value, the shorter the corresponding sampling interval. For example, if SA=0.018 and RA=CB / XB=0.051, then F0=SA×(1+k3×RA)=0.018; that is, the comprehensive adjustment index EF=0.018. In practice, traditional sampling frequency adjustment relies solely on fluctuations such as standard deviation and variance within a window, which has inherent limitations: data exhibiting linear changes under the same fluctuation amplitude, such as uniform heating, has low information density, and the process can be accurately reconstructed through fitting even with extended sampling intervals; however, random and irregular fluctuation data has high information density, requiring high-density sampling to avoid feature loss; mapping solely based on fluctuation amplitudes such as standard deviation and variance can easily lead to a large amount of redundant sampling in regular scenarios and data distortion in random scenarios.

[0027] Step S4 involves obtaining the data acquisition frequency based on the adjustment index information and adaptively adjusting the data acquisition frequency of the edge gateway. Step S4 includes the following sub-steps: Step S401: set the minimum time interval and the maximum time interval for collecting the first type of data, which are denoted as tn and tm in sequence; define the upper and lower limits of the data collection frequency; calculate tn+(tm-tn)×(1-EF) e , which is denoted as the initial theoretical interval TC, where e is a set curvature adjustment coefficient; in this embodiment, tn=, tm=3s, tm=30s; e=1.5, which is usually set to [1.2, 1.8]; it controls the bending degree of the power function mapping, and a larger value leads to a more significant effect of extending the interval in the data steady state; For example, if EF=0.018, the initial theoretical interval TC=tn+(tm-tn)×(1-EF) e =29s.

[0028] Step S402: set the smoothing coefficient as J0, and set the value range of J0 as [Jmi, Jmx]; calculate J0, where J0=Jmi+(Jmx-Jmi)×[(Nmx-DN) / (Nmx-Nmi)]; in this embodiment, [Jmi, Jmx] is [0.3, 0.8], which can be flexibly set; the larger the smoothing coefficient J0 is, the higher the weight of the newly calculated theoretical interval is, and the faster the adjustment response is; the smaller the value is, the higher the weight of the historical interval is, and the more stable the adjustment is; When the sliding window slides point by point, there will be slight random fluctuations in the statistics. If the initial theoretical interval TC is directly used as the final interval, the collection frequency will frequently jump in small amplitudes, which not only increases the system scheduling overhead, but also is not conducive to stable collection. The smoothing coefficient can avoid the jump caused by the frequency adjustment completely relying on a single calculation result, make the adjustment of the collection interval more stable and continuous, and meanwhile link the window size with the time interval adjustment, so as to further improve the self-adaptive capability of the collection frequency adjustment; Step S403: calculate J0×TC+(1-J0)×TL, which is denoted as the final collection time interval TW, where TL is the collection time interval used in the latest collection, that is, the collection interval actually executed most recently before; For example, [Nmi, Nmx] is [5, 25], DN=10, then J0=Jmi+(Jmx-Jmi)×[(Nmx-DN) / (Nmx-Nmi)]=0.675; TL=27s; then the final collection time interval TW=J0×TC+(1-J0)×TL=0.675×29+(1-0.675)×27=28s.

[0029] Step S404: if TW<tn, set TW=tn; if TW>tm, set TW=tm; otherwise, no adjustment is made. After completion, convert TW into the collection frequency, which is denoted as the current data collection frequency DF; boundary constraint is performed on the final collection time interval TW to ensure that it always falls within the preset range; Step S405: For the first edge gateway, adjust the current collection frequency of the first type of data collected by the first edge gateway to DF, and continue to collect the first type of data based on the data collection frequency DF; In practical implementation, a predictability factor is introduced as a correction dimension based on the relative fluctuation coefficient to comprehensively evaluate the effective information density of the data. At the same time, it is linked with the size of the outer dynamic window to adaptively match and adjust the sensitivity. Finally, the acquisition interval is obtained through nonlinear mapping. This can achieve the effect of longer intervals for more stable and regular data, and shorter intervals for more volatile and random data, thus better balancing acquisition efficiency, anomaly detection capability, and resource utilization.

[0030] Example 2, please refer to Figure 3 As shown, Figure 3 A schematic diagram of an electronic device is provided, which may include a processor, a communication interface, a memory, and a communication bus. The processor, communication interface, and memory communicate with each other via the communication bus. The memory stores computer-readable instructions, and the processor can call these instructions. When the processor executes a computer-readable instruction, it performs steps as described in an edge gateway data acquisition frequency adaptive adjustment method to achieve the following functions: collecting data acquired by the edge gateway and performing data preprocessing to obtain historical acquisition data; performing window change analysis based on the historical acquisition data to obtain the current window size and current window information; performing frequency adjustment analysis using data acquired by the edge gateway within the current window based on the current window information to obtain adjustment index information; and obtaining the data acquisition frequency based on the adjustment index information and adaptively adjusting the edge gateway's data acquisition frequency.

[0031] Furthermore, when the logical instructions in the aforementioned memory can be implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0032] Example 3: This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it performs the steps of an edge gateway data acquisition frequency adaptive adjustment method to achieve the following functions: collecting data acquired by the edge gateway and performing data preprocessing to obtain historical acquisition data of the gateway; performing window change analysis based on the historical acquisition data of the gateway to obtain the current window size and obtain current window information; performing frequency adjustment analysis based on the current window information using the data acquired by the edge gateway in the current window to obtain adjustment index information; obtaining the data acquisition frequency based on the adjustment index information and adaptively adjusting the data acquisition frequency of the edge gateway.

[0033] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in the block. Figure 1 The function specified in one or more boxes.

[0034] The above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and are not intended to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, 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 the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the claims.

Claims

1. A method for adaptively adjusting the data acquisition frequency of an edge gateway, characterized in that, Includes the following steps: Collect data gathered by the edge gateway and perform data preprocessing to obtain historical data collected by the gateway; Analyze window changes based on historical data collected from the gateway to obtain the current window size and information. Based on the current window information, frequency regulation analysis is performed using data collected by the edge gateway in the current window to obtain regulation index information; The data collection frequency is obtained based on the adjustment index information, and the data collection frequency of the edge gateway is adaptively adjusted.

2. The edge gateway data acquisition frequency adaptive adjustment method according to claim 1, characterized in that, Collecting data from the edge gateway and performing data preprocessing to obtain historical gateway data includes the following sub-steps: Any edge gateway to be adjusted is denoted as the first edge gateway, and any type of data collected by the first edge gateway is denoted as the first type of data. Based on the range of the first type of data collected by the first edge gateway, a reasonable range for the first type of data is set; denoted as the first reasonable range [Ymi, Ymx]; the first type of data collected by the first edge gateway that is not within the first reasonable range is recorded as erroneous data.

3. The edge gateway data acquisition frequency adaptive adjustment method according to claim 2, characterized in that, Collecting data from the edge gateway and performing data preprocessing to obtain historical gateway data also includes the following sub-steps: Collect the first type of data collected by the first edge gateway, arrange it according to the collection time; and determine whether the first type of data is erroneous each time it is collected, based on the first reasonable range. If the data is incorrect, discard it; otherwise, retain it. Continuously collect normal first-type data collected by the first edge gateway to obtain the gateway's historical data collection data of first-type data.

4. The edge gateway data acquisition frequency adaptive adjustment method according to claim 3, characterized in that, Based on historical data collected from the gateway, window change analysis is performed to obtain the current window size and current window information, including the following sub-steps: Record the historical data collected by the gateway as a data collection sequence; set the window size range of the sliding window to [Nmi, Nmx], with the unit being the number of samples, and record it as the reasonable range of the window; and set the adjustment step size of the sliding window to nw; The most recent k1 sliding windows are denoted as recent windows; any recent window is denoted as the first window, and the first window is evenly divided into two parts, denoted as the front part and the back part respectively; Where k1 is the number of settings; Based on the collected data sequence, calculate the standard deviation of the first type of data in the front and back parts respectively, and denote them as QB and HB respectively; and calculate min(QB, HB) / max(QB, HB), which is denoted as the fluctuation uniformity AU of the first window.

5. The edge gateway data acquisition frequency adaptive adjustment method according to claim 4, characterized in that, Analyzing window changes based on historical gateway data to obtain the current window size and information includes the following sub-steps: Calculate the rate of change per unit time for any two adjacent data of the first type within the first window, and obtain the largest rate of change per unit time, which is denoted as the maximum rate of change AR of the first window; Let AN denote the size of the first window, and let AN, AU, and AR denote the indicator information of the first window. Repeatedly obtain the indicator information of all recent windows. Set the initial benchmark for fluctuation uniformity as UC; Calculate the mean value of the fluctuation uniformity of all recent windows, which is recorded as evaluation uniformity PU; calculate (1-k2)×UOL+k2×PU, which is recorded as the current uniformity reference UE; where UOL is the last used uniformity reference, and k2 is a set coefficient.

6. The edge gateway data acquisition frequency adaptive adjustment method according to claim 5, characterized in that, Perform window change analysis based on the historical collected data of the gateway to obtain the current window size, and obtaining the current window information further includes the following sub-steps: If the fluctuation uniformity of all recent windows is higher than the current uniformity reference UE, it is determined that continuous steady state is satisfied; if the fluctuation uniformity of the most recent window is less than 0.8×UE, or the maximum change rate of the most recent window is greater than ER, it is determined that fluctuation abrupt change is satisfied; Otherwise, it is determined that normal fluctuation is satisfied; Obtain the size of the most recent window, which is recorded as NL; if continuous steady state is satisfied and NL<Nmx, calculate NL+nw, take min(NL+nw, Nmx) as the current window size DN, and mark it as the current window information; If normal fluctuation is satisfied, record NL as the current window size DN, and mark it as the current window information; For the case where fluctuation abrupt change is satisfied, record the fluctuation uniformity of the most recent window as GU; if 0.3×UE<GU, calculate NL-nw, take max(NL-nw, Nmi) as the current window size DN, and mark it as the current window information; If GU≤0.3×UE or the maximum change rate of the most recent window is greater than ER, take Nmi as the current window size DN, and mark it as the current window information.

7. The edge gateway data acquisition frequency adaptive adjustment method according to claim 6, characterized in that, Based on the current window information, perform frequency adjustment analysis using the data collected by the edge gateway in the current window, and obtaining adjustment index information includes the following sub-steps: Based on the collected data sequence, take the latest collected first-type data as the end point, intercept a partial sequence with a length of DN, which is recorded as the current collection window; Calculate the standard deviation of the first-type data in the current collection window, which is recorded as XB, and calculate XB / (Ymx-Ymi), which is recorded as the current relative fluctuation coefficient SA.

8. The edge gateway data acquisition frequency adaptive adjustment method according to claim 7, characterized in that, Based on the current window information, perform frequency adjustment analysis using the data collected by the edge gateway in the current window, and obtaining adjustment index information further includes the following sub-steps: Use the least square method to perform unary linear fitting on the first-type data in the current collection window in chronological order to obtain the corresponding fitting trend line; calculate the residual of each first-type data in the current collection window relative to the fitting trend line, calculate the standard deviation of all residuals, which is recorded as CB, and calculate CB / XB, which is recorded as the current predictability factor RA; Calculate SA×(1+k3×RA), which is recorded as F0, and record max(EF, 1) as the comprehensive adjustment index EF, which is marked as adjustment index information, where k3 is a set correction coefficient.

9. The edge gateway data acquisition frequency adaptive adjustment method according to claim 8, characterized in that, Based on the current window information, obtain the data collection frequency according to the adjustment index information, and adaptively adjust the data collection frequency of the edge gateway, which includes the following sub-steps: Set the minimum and maximum time intervals for collecting the first type of data, denoted as tn and tm respectively; calculate tn + (tm - tn) × (1 - EF). e , denoted as the initial theoretical interval TC, where e is the set curvature adjustment coefficient; Set the smoothing coefficient as J0, and set the value range of J0 as [Jmi, Jmx]; calculate J0, where J0=Jmi+(Jmx-Jmi)×[(Nmx-DN) / (Nmx-Nmi)]; Calculate J0×TC+(1-J0)×TL, which is recorded as the final acquisition time interval TW, where TL is the acquisition time interval used in the most recent acquisition.

10. The edge gateway data acquisition frequency adaptive adjustment method according to claim 9, characterized in that, Obtaining the data acquisition frequency according to the adjustment index information, and adaptively adjusting the data acquisition frequency of the edge gateway further comprises the following sub-steps: If TW<tn, let TW=tn; if TW>tm, let TW=tm; Otherwise, no adjustment is made, and after completion, TW is converted into an acquisition frequency, which is recorded as the current data acquisition frequency DF; For the first edge gateway, adjust the current acquisition frequency of the first type of data by the first edge gateway to DF, and continue to acquire the first type of data based on the data acquisition frequency DF.