Data acquisition method and apparatus
Patent Information
- Application Number
- CN202511499838.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-17
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]在通过上述任一方式进行数据采集时,存在无法兼顾通信效率与服务器资源的缺陷,从而存在动态适配效果差的问题
[0049]第五方面,本申请提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如第一方面任一项所述的方法。
Smart Images

Figure CN122600983A_ABST
Abstract
Description
Technical Field
[0001] This application relates to industrial Internet of Things (IoT) technology, and more particularly to a data acquisition method and device. Background Technology
[0002] In industrial production and intelligent manufacturing scenarios, the operating status of industrial equipment relies on real-time data of multiple variables such as temperature, pressure, speed, and voltage. By collecting data on these variables, core needs such as equipment status monitoring, fault warning, and production process optimization can be achieved.
[0003] In known technologies, data acquisition of variables from industrial equipment typically employs two fixed modes: one is a fixed-frequency, periodic acquisition mode, where the equipment is actively polled at preset time intervals to obtain variable values, maintaining a fixed acquisition frequency regardless of whether the variable values change significantly. The other is a subscription-based acquisition mode based on a fixed threshold, where a fixed trigger threshold is pre-set for the variable; when the variable value exceeds the threshold range, the equipment actively pushes data, and if the value does not exceed the threshold, no data is transmitted.
[0004] When collecting data using any of the above methods, there is a drawback that communication efficiency and server resources cannot be balanced, resulting in poor dynamic adaptation. Summary of the Invention
[0005] This application provides a data acquisition method and device to improve the effectiveness of dynamically adjusting sampling strategies.
[0006] Firstly, this application provides a data acquisition method, the method comprising:
[0007] For any variable to be collected, obtain the current time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected; wherein, the time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be collected within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy;
[0008] Based on the current value of the variable to be collected, as well as the time-domain analysis benchmark and the frequency-domain analysis benchmark, a target sampling strategy is determined, and the target sampling strategy is executed to collect data from the variable to be collected.
[0009] In one possible implementation, the time-domain analysis benchmark includes a first threshold; obtaining the current time-domain characteristics of the variable to be collected includes:
[0010] Based on the historical variable value sequence, determine the mean and standard deviation of the change of the variable to be collected within the preset sliding window;
[0011] Based on the mean of the change and the standard deviation of the change, the first threshold includes a basic threshold and an emergency threshold; wherein the emergency threshold is greater than the basic threshold.
[0012] And / or, the time-domain analysis benchmark includes a second threshold; obtaining the current time-domain characteristics of the variable to be collected includes:
[0013] Based on the historical variable value sequence, determine the coefficient of variation of the variable to be collected within the preset sliding window;
[0014] Based on the coefficient of variation and the current system load factor, the second threshold includes a high volatility threshold and a low volatility threshold; wherein the system load factor is obtained based on at least one of the central processing unit CPU utilization, memory utilization, and network bandwidth utilization.
[0015] In one possible implementation, determining the second threshold, including a high volatility threshold and a low volatility threshold, based on the coefficient of variation and the current system load factor, includes:
[0016] Based on the coefficient of variation of a preset number of preset sliding windows prior to the current moment, determine the current data stability factor of the variable to be collected;
[0017] Based on the data stability factor and the system load factor, the second threshold includes a high volatility threshold and a low volatility threshold.
[0018] In one possible implementation, determining the target sampling strategy based on the current value of the variable to be collected, and the time-domain analysis benchmark and the frequency-domain analysis benchmark, includes:
[0019] The time-domain analysis results are obtained by analyzing the values of the variables based on the aforementioned time-domain analysis benchmark.
[0020] The frequency domain analysis results are obtained by analyzing the variable values based on the frequency domain analysis benchmark.
[0021] Based on the time-domain analysis results and the frequency-domain analysis results, the target sampling strategy is obtained.
[0022] In one possible implementation, the step of analyzing the variable values based on the time-domain analysis benchmark to obtain the time-domain analysis result includes:
[0023] Based on the basic threshold and emergency threshold included in the first threshold, the values of the variable are analyzed to obtain the first analysis result;
[0024] Based on the high volatility threshold and low volatility threshold included in the second threshold, the values of the variable are analyzed to obtain the second analysis result;
[0025] Based on the first analysis result and the second analysis result, the time domain analysis result is determined; the time domain analysis result is used to indicate whether to increase or decrease the sampling frequency.
[0026] In one possible implementation, determining the time-domain analysis result based on the first analysis result and the second analysis result includes:
[0027] If the first analysis result indicates that emergency sampling needs to be performed, then the time domain analysis result is determined to indicate that the sampling frequency needs to be increased and emergency sampling needs to be performed.
[0028] If the first analysis result does not indicate that emergency sampling is required, but the second analysis result indicates that the sampling frequency needs to be increased, then the time-domain analysis result is determined to indicate that the sampling frequency needs to be increased.
[0029] If the first analysis result does not indicate that emergency sampling is required, and the second analysis result indicates that the sampling frequency needs to be reduced, then the time-domain analysis result is determined to indicate that the sampling frequency needs to be reduced.
[0030] Otherwise, the time-domain analysis result is determined to maintain the current sampling frequency.
[0031] In one possible implementation, the frequency domain analysis benchmark includes a preset high-frequency energy proportion threshold and a preset main frequency range; the step of analyzing the variable values based on the frequency domain analysis benchmark to obtain the frequency domain analysis results includes:
[0032] Obtain the spectral characteristics of the variable values; the spectral characteristics include high-frequency energy and the distribution of the main frequency band.
[0033] The frequency domain analysis results are obtained by analyzing the high-frequency energy and main frequency band distribution based on the frequency domain analysis benchmark; the frequency domain analysis results are used to indicate whether to increase or decrease the sampling frequency.
[0034] In one possible implementation, obtaining the target sampling strategy based on the time-domain analysis results and the frequency-domain analysis results includes:
[0035] If the first preset condition is met, the target sampling strategy is determined to be a fast subscription mode; the first preset condition includes any one of the following: the frequency domain analysis result indicates that the sampling frequency needs to be increased, and the time domain analysis result indicates that the sampling frequency needs to be increased; the time domain analysis result indicates that emergency sampling needs to be performed;
[0036] If neither the frequency domain analysis result nor the time domain analysis result satisfies the first preset condition, but satisfies the second preset condition, then the target sampling strategy is determined to be a normal subscription mode; wherein, the second preset condition is: the frequency domain analysis result indicates that there is no need to increase the sampling frequency, and the time domain analysis result indicates that the sampling frequency needs to be increased;
[0037] If the frequency domain analysis result and the time domain analysis result do not satisfy the first preset condition or the second preset condition, but satisfy the third preset condition, then the target sampling strategy is determined to be a slow polling mode; wherein, the third preset condition is: the frequency domain analysis result indicates that the sampling frequency needs to be reduced, and the time domain analysis result indicates that the sampling frequency needs to be reduced;
[0038] Otherwise, the target sampling strategy is determined to be the normal polling mode.
[0039] In one possible implementation, the method further includes:
[0040] When the target sampling strategy is a subscription-based collection strategy, the coefficient of variation of the variable to be collected is obtained for a preset number of preset sliding windows before the current time.
[0041] Based on the mean of each of the aforementioned coefficients of variation and the preset coefficient, the dead zone value under the subscription-based collection strategy is determined.
[0042] Secondly, this application provides a data acquisition device, the device comprising:
[0043] The acquisition module is used to acquire the current time-domain analysis benchmark and frequency-domain analysis benchmark of any variable to be acquired; wherein, the time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be acquired within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy;
[0044] The acquisition module is used to determine a target sampling strategy based on the current value of the variable to be acquired, as well as the time-domain analysis benchmark and the frequency-domain analysis benchmark, and execute the target sampling strategy to acquire the variable to be acquired.
[0045] Thirdly, this application provides an electronic device, including a processor and a memory communicatively connected to the processor;
[0046] The memory stores computer-executed instructions;
[0047] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.
[0048] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0049] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method as described in any of the first aspects.
[0050] This application provides a data acquisition method and device. The method is used to acquire various variables to be acquired from each industrial device. Specifically, for any variable to be acquired, its current time-domain analysis benchmark and frequency-domain analysis benchmark are first obtained. Then, based on the current variable value, the time-domain analysis benchmark, and the frequency-domain analysis benchmark, a target sampling strategy is determined. Finally, data acquisition of the variable is performed according to the target sampling strategy. In this process, both the time-domain fluctuation characteristics and frequency-domain component characteristics of the data are considered simultaneously. Furthermore, since the time-domain analysis benchmark is determined based on the historical variable value sequence of the variable within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy, the analysis benchmarks can be dynamically adjusted according to the evolution of data characteristics and system state. This allows for matching the most suitable sampling strategy to each variable at each moment, achieving a balance between communication efficiency and server resources, thereby effectively improving the dynamic adaptation effect. Attached Figure Description
[0051] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0052] Figure 1 An application scenario diagram of a data acquisition method provided in an embodiment of this application;
[0053] Figure 2 A flowchart illustrating a data acquisition method provided in this application embodiment. Figure 1 ;
[0054] Figure 3 A flowchart illustrating a data acquisition method provided in this application embodiment. Figure 2 ;
[0055] Figure 4 This is a schematic diagram of the structure of a data acquisition device provided in an embodiment of this application;
[0056] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0057] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0058] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0059] In industrial production and intelligent manufacturing scenarios, the operating status of industrial equipment (such as machine tools, sensors, controllers, etc.) depends on real-time data support from multiple variables to be collected, such as temperature, pressure, speed, and voltage. By collecting data on these variables, core needs such as equipment status monitoring, fault warning, and production process optimization can be achieved.
[0060] With the increasing number of industrial devices and the increasing complexity of variable types, the core objective of industrial data acquisition system design is to efficiently and accurately complete data acquisition based on the dynamic characteristics of different variables to be collected, avoid redundant transmission and resource waste, and ensure the real-time nature of key data.
[0061] Currently known data acquisition methods mostly employ either periodic acquisition or subscription-based acquisition. Periodic acquisition involves actively polling industrial equipment at preset time intervals to obtain the values of the variables to be collected, maintaining a fixed acquisition frequency regardless of whether the variable values change significantly. Subscription-based acquisition involves pre-setting a fixed trigger threshold for the variables to be collected. When the variable value exceeds this threshold, the industrial equipment actively pushes data; otherwise, no data is transmitted.
[0062] In the above process, when using a fixed-period data collection mode, if the variable values are stable and data collection continues, it will cause redundant consumption of communication bandwidth and server resources. If the variable values fluctuate frequently, key data may be missed due to insufficient fixed frequency. When using a subscription-based data collection mode, the fixed threshold cannot adapt to the dynamic fluctuation pattern of the variable. If the threshold is too high, it is easy to miss small key changes. If the threshold is too low, it will cause frequent pushes, leading to a sudden increase in server load. Thus, both have the defects of not being able to balance communication efficiency and server resources, resulting in poor dynamic adaptation in the data collection process.
[0063] In addition, existing technologies allow engineers to manually assign acquisition strategies to each variable to be collected, but this requires high maintenance costs and is difficult to handle dynamically changing industrial scenarios. Therefore, there is an urgent need for a data acquisition method that can balance communication efficiency and server resources during data acquisition to improve dynamic adaptation.
[0064] This application provides a data acquisition method and apparatus to solve the aforementioned problems. Specifically, the method of this application proposes, for any variable to be acquired, to obtain its current time-domain analysis benchmark and frequency-domain analysis benchmark, and to analyze the current variable value of the variable to be acquired in order to determine the required target sampling strategy, and to perform data acquisition of the variable to be acquired according to the target sampling strategy. The time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be acquired within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy.
[0065] It is understood that the method of this application is applicable to any scenario that requires data collection of the device's variables, for example, Figure 1 This application provides an example of a data acquisition method, such as... Figure 1 As shown, the method of this application can be used in vehicle production scenarios to collect data on variables to be collected from industrial equipment such as welding robots and stamping equipment, and is executed by an industrial data acquisition server deployed in the workshop.
[0066] Specifically, in vehicle production scenarios, it is necessary to monitor the variables to be collected for each piece of industrial equipment to ensure vehicle production quality. For example, data collection is required for variables such as welding current and welding head position of welding robots to monitor the stability of the welding process and avoid quality problems such as incomplete welds and missing welds caused by abnormal current; data collection is required for variables such as pressure value and die displacement of stamping equipment to ensure the forming accuracy of stamped parts and prevent equipment failures caused by pressure overload; data collection is required for variables such as bolt torque of the robotic arm at the final assembly station to ensure the tightness of component assembly and compliance with vehicle safety standards.
[0067] Based on the method of this application, for the welding current of a welding robot, the industrial data acquisition server first determines the time-domain analysis benchmark based on the historical current fluctuation sequence within a preset sliding window, and then determines the frequency-domain analysis benchmark in conjunction with the current sampling strategy. Further, based on the time-domain and frequency-domain analysis benchmarks, the current current value is analyzed to determine the target sampling strategy for the welding current. Similarly, other variables to be acquired by the welding robot, as well as variables to be acquired by other industrial equipment, are all acquired using the same method.
[0068] The method in this application is based on dynamic adjustment of dual time and frequency domain benchmarks. It avoids the problems of redundant transmission when the welding current is stable and insufficient acquisition when the stamping pressure changes suddenly, which are caused by fixed period acquisition. It also solves the defects of fixed threshold subscription mode in that it cannot adapt to the dynamic characteristics of variables. Ultimately, while ensuring the real-time performance of key data of various industrial equipment, it reduces the occupation of workshop network bandwidth and server resource consumption, and realizes dynamic adaptation and efficiency balance of data acquisition in vehicle production scenarios.
[0069] It is understood that industrial data acquisition servers can also be deployed in the cloud. Besides being executed by an industrial data acquisition server, the method of this application can also be executed directly by the controller of industrial equipment, or by devices with data processing and communication capabilities such as field industrial gateways and edge computing terminals. This embodiment does not limit this. In addition to the aforementioned vehicle production scenario, the method of this application can also be applied to scenarios involving data acquisition, such as battery production and energy storage systems. This embodiment also does not limit this.
[0070] Furthermore, it should be understood that the method of this application can be implemented based on any communication architecture that supports variable sampling frequency, such as the OPC UA communication architecture, and this application does not limit it to this. When based on the OPC UA communication architecture, if it is a fixed-period acquisition, the data acquisition system actively requests data from the OPC UA server at fixed intervals; if it is a subscription acquisition, based on the event-driven mechanism of OPC UA, the server actively pushes data when the data changes.
[0071] The following detailed description, with reference to the accompanying drawings and using an electronic device as the execution subject, outlines some implementation methods of the data acquisition method of this application. Where the embodiments do not conflict, the following embodiments and features thereof can be combined with each other.
[0072] This application provides a data acquisition method. Figure 2 A flowchart illustrating a data acquisition method provided in this application embodiment. Figure 1 ,like Figure 2 As shown in the embodiments of this application, a data acquisition method includes the following:
[0073] S201, for any variable to be collected, obtain the current time domain analysis benchmark and frequency domain analysis benchmark of the variable to be collected.
[0074] The time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be collected within a preset sliding window, while the frequency-domain analysis benchmark is determined based on the current sampling strategy.
[0075] In this embodiment, the variable to be collected specifically refers to the parameters of industrial equipment that need to be monitored in the applied industrial scenario, such as the welding current of a welding robot in the aforementioned vehicle production scenario. For any variable to be collected from any industrial equipment that needs to be monitored in the scenario, the electronic device acquires the current time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected.
[0076] In this embodiment, the preset sliding window is determined based on the current time. The electronic device determines the preset sliding window using a preset window length n and the current time. In this embodiment, the time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected are consistent with the evaluation period of the sliding window statistics, that is, updated once after every n / 2 collections. Each update is recalculated based on the latest complete historical variable value sequence within the preset sliding window and the current sampling strategy to ensure the accuracy and timeliness of the benchmark. In practical applications, an independent update period can also be set according to the characteristics of the variable to be collected. For example, the update interval can be shortened to n / 4 collections for high-frequency fluctuating variables and extended to n collections for low-frequency stable variables, or the update frequency can be dynamically adjusted according to the system load. This embodiment does not limit this.
[0077] It should be understood that historical variable value sequences can reflect the dynamic changes of the variable to be collected, such as normal fluctuation range, trend characteristics, and frequency of abrupt changes. By statistically analyzing historical data within a preset sliding window, a time-domain analysis benchmark adapted to the characteristics of the variable to be collected can be constructed. For example, if the historical current value within the preset sliding window is consistently stable between 100-120A and the maximum fluctuation does not exceed 5A, this range and fluctuation threshold can be used as the current time-domain analysis benchmark. Based on this, when the current value of the variable to be collected approaches or exceeds this time-domain analysis benchmark, it indicates that the variable to be collected may have entered an abnormal fluctuation state, and it is necessary to adjust the sampling strategy to capture key changes. When the current variable value is within the range of the time-domain analysis benchmark, the sampling frequency can be maintained or reduced to reduce resource consumption.
[0078] It should be understood that the current sampling strategy directly affects the ability to resolve the frequency domain characteristics of variables. The frequency domain analysis benchmark needs to match the current sampling frequency to accurately identify the effective frequency components in the signal. For example, if the current sampling frequency is 100Hz, the frequency domain analysis benchmark can be set to effectively identify signal components below 50Hz (derived from the Nyquist sampling theorem to avoid spectral aliasing). When the frequency domain analysis finds high-frequency components in the signal exceeding the current benchmark (such as 60Hz fluctuations), it indicates that the current sampling frequency may be insufficient, and the strategy needs to be adjusted by increasing the sampling frequency to fully capture the high-frequency characteristics. If the signal's frequency domain characteristics are always within the benchmark range, high-frequency sampling is unnecessary, thus avoiding resource waste.
[0079] Therefore, in this embodiment, the electronic device needs to first obtain the current time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected, so as to be used in the subsequent analysis and decision-making process.
[0080] In this embodiment, the time-domain analysis benchmark includes a first threshold and a second threshold. Specifically, the first threshold includes a basic threshold and an emergency threshold, obtained through the following process: based on the historical variable value sequence, the mean and standard deviation of the change of the variable to be collected within a preset sliding window are determined; based on the mean and standard deviation of the change, the basic threshold and emergency threshold included in the first threshold are determined; wherein, the emergency threshold is greater than the basic threshold.
[0081] More specifically, the electronic device first calculates multiple changes within a preset sliding window, specifically by subtracting the variable values corresponding to two adjacent data points to obtain the corresponding changes. Then, the electronic device averages these multiple changes, specifically by summing the multiple changes and then dividing the sum by the number of data points to obtain the average. Finally, the electronic device substitutes the multiple changes and the average into the standard deviation formula to obtain the standard deviation.
[0082] Furthermore, in this embodiment, the electronic device determines a base threshold based on μ±2σ and an emergency threshold based on μ±3kσ. Here, μ represents the mean of the change, σ represents the standard deviation of the change, and k is an adjustment coefficient greater than 1, used to amplify the influence weight of the standard deviation of the change, thus further expanding the range of the emergency threshold. It should be understood that both the base threshold and the emergency threshold are used to indicate a range.
[0083] Based on this, a tiered early warning and response mechanism can be constructed. The basic threshold is based on statistical principles, and its range can cover approximately 95% of normal data fluctuations. When the change in a variable value exceeds this range but remains within the emergency threshold, it indicates that the data is abnormal and requires increased attention. At this point, the sampling strategy can be adjusted to a higher sampling frequency mode. The emergency threshold further expands the range through the coefficient k, enabling the capture of extremely rare but significant drastic changes, such as instantaneous sensor failures or precursors to sudden equipment downtime. Once the change in a variable value exceeds the emergency threshold, it signifies an emergency event, requiring a switch to a higher frequency sampling mode to capture all fault details.
[0084] The aforementioned first threshold enables the system to distinguish the severity of anomalies and adopt corresponding resource allocation strategies, thereby achieving an optimal balance between resource efficiency and monitoring assurance. It should be understood that the basic threshold and the emergency threshold can also be determined using other calculation methods or combinations, such as based on different confidence intervals (e.g., μ±1.5σ and μ±4σ), based on absolute value quantiles (e.g., the 90th and 99th quantiles of historical changes), or by introducing other dynamic weighting factors. The key is to ensure that the absolute value of the emergency threshold is greater than the absolute value of the basic threshold, thus establishing different sensitivity response levels for data changes. This embodiment does not impose any limitations on this.
[0085] In this embodiment, the second threshold includes a high volatility threshold and a low volatility threshold, which are obtained through the following process: based on the historical variable value sequence, the coefficient of variation of the variable to be collected within a preset sliding window is determined; based on the coefficient of variation and the current system load factor, the high volatility threshold and the low volatility threshold included in the second threshold are determined; wherein, the system load factor is obtained based on at least one of the central processing unit CPU utilization, memory utilization, and network bandwidth utilization.
[0086] More specifically, in this embodiment, the electronic device also performs calculations based on the historical variable value sequence corresponding to the current time's preset sliding window. The electronic device calculates the coefficient of variation based on the historical variable value sequence by first obtaining the mean and standard deviation of the corresponding change based on the historical variable value sequence, and then substituting the mean and standard deviation of the change into... The coefficient of variation is obtained. It should be understood that the coefficient of variation is an indicator of relative dispersion, used to compare the volatility of datasets with different dimensions or means. The greater the volatility, the faster the data collection should be.
[0087] Subsequently, since system resources are the physical foundation for real-time data acquisition, their availability directly affects the feasibility and scope of sampling strategy adjustments. If the sampling strategy is determined solely based on the coefficient of variation, forcibly increasing the sampling frequency under high system load may lead to server overload, potentially causing a global degradation or interruption of the data acquisition service. Therefore, the electronic device further combines the coefficient of variation and the system load factor to determine the second threshold.
[0088] In this embodiment, the electronic device calculates the system load factor based on CPU utilization, memory usage, and network bandwidth usage. Specifically, the electronic device normalizes each indicator, mapping each of the aforementioned indicators to the range of [0, 1]. For example, it normalizes by dividing the CPU utilization by 100%. Finally, it performs a weighted summation of the normalized indicators to obtain the system load factor.
[0089] Furthermore, the electronic device determines a second threshold, including a high volatility threshold and a low volatility threshold, based on the coefficient of variation and the system load factor. Specifically, in this embodiment, when the system load factor is high, the volatility threshold should be appropriately increased (i.e., the threshold for determining high volatility should be raised) to suppress excessive triggering of high-frequency sampling even under resource constraints. Conversely, when the system load factor is low, the volatility threshold can be appropriately decreased, allowing the system to respond more sensitively to subtle changes in data. By comprehensively calculating the coefficient of variation and the system load factor (e.g., multiplying or weighting), a second threshold matching the current system state can be dynamically calculated.
[0090] It should be understood that in practical applications, electronic devices may calculate the system load factor based solely on CPU utilization, memory usage, and network bandwidth usage, or based on any two of these, or based on other performance indicators. This embodiment does not limit this.
[0091] In this embodiment, the electronic device specifically determines the current data stability factor of the variable to be collected based on the coefficient of variation of a preset number of preset sliding windows before the current time; and determines the second threshold, including the high fluctuation threshold and the low fluctuation threshold, based on the data stability factor and the system load factor.
[0092] More specifically, the electronic device first obtains the coefficients of variation for a preset number of preset sliding windows prior to the current time, and calculates the mean and standard deviation of the preset number of coefficients of variation. Then, by substituting the mean and standard deviation of the coefficients of variation into: The data stability magnitude is obtained, and then normalized to obtain the data stability factor. Here, stability represents the magnitude of data stability, std(CVhistory) represents the difference between the labeled coefficients of variation, and mean(CVhistory) represents the mean of the coefficients of variation.
[0093] It should be understood that the data stability factor is a quantitative indicator. The larger the value, the more stable and predictable the fluctuation pattern of the variable in recent history; the smaller the value, the more disordered the fluctuation pattern and the higher the uncertainty.
[0094] It should be understood that the data stability factor, compared to the coefficient of variation at a single point, can more comprehensively reflect the long-term behavioral characteristics of a variable. Therefore, introducing the data stability factor when determining the second threshold allows the threshold setting to consider not only instantaneous fluctuations but also the long-term volatility characteristics of the variable. For example, for a variable that is unstable in the long term, even a slight increase in its instantaneous fluctuations may require sufficient attention.
[0095] In this embodiment, after obtaining the data stability factor and system load factor, the electronic device uses a scaling factor to further obtain the high volatility threshold and low volatility threshold. Specifically, the first scaling factor and system load factor are substituted into: This yields the high volatility threshold. Here, SystemLoadFactor represents the system load factor, FastK represents the first scaling factor, and FastThreshold represents the high volatility threshold. Substituting the second scaling factor and the data stability factor into the equation: The low volatility threshold is obtained. Here, SlowThreshold represents the low volatility threshold, SlowK represents the second scaling factor, and DataStability represents the data stability factor.
[0096] In this embodiment, the first scaling factor and the second scaling factor are fixed empirical coefficients preset based on the characteristics of industrial scenarios and the needs of variable monitoring. The value range is usually 0.1-0.5. The specific values of the first scaling factor and the second scaling factor can be flexibly adjusted according to the sensitivity difference of the variables to be collected. For example, for key variables such as welding current, the first scaling factor can be set to 0.5 to enhance the impact of system load on high fluctuation thresholds. For non-key variables such as ambient temperature, the second scaling factor can be set to 0.1 to reduce the interference of stability factors on low fluctuation thresholds.
[0097] By setting the first scaling factor and the second scaling factor, the influence of the system load factor on the high volatility threshold and the influence weight of the data stability factor on the low volatility threshold can be precisely controlled. This avoids excessive threshold deviation caused by the excessive influence of a single factor, and ensures that the second threshold can adapt to the system resource status and conform to the long-term fluctuation pattern of the variable, thereby achieving fine-grained and controllable threshold adjustment.
[0098] It should be understood that in practical applications, the high volatility threshold can be obtained by directly multiplying the system load factor by the mean coefficient of variation and then adding the result to the mean coefficient of variation, or by directly multiplying the data stability factor by the mean coefficient of variation and then subtracting the result from the mean coefficient of variation, without introducing an additional scaling factor. Alternatively, the scaling factor can be set to other values according to the needs of the scenario, as long as the second threshold can be dynamically adapted through the system load factor and the data stability factor. This embodiment does not impose any limitations on this.
[0099] In this embodiment, the time-domain analysis benchmark includes a first threshold and a second threshold. When analyzing the variable values of the variable to be collected based on the time-domain analysis benchmark, a comprehensive judgment can be made from three dimensions: instantaneous change amplitude, long-term fluctuation characteristics, and real-time system load. This allows for more refined, robust, and globally relevant sampling strategy decisions. It should be understood that in practical applications, the analysis can also be based solely on either the first or second threshold, as long as the core objective of dynamically adjusting the sampling strategy according to data changes to balance communication efficiency and resource consumption is achieved. This embodiment does not limit this approach.
[0100] In this embodiment, the frequency domain analysis benchmark includes a preset high-frequency energy proportion threshold and a preset main frequency range, both obtained through the current sampling strategy of the variable to be collected. This embodiment configures corresponding preset high-frequency energy proportion thresholds and preset main frequency ranges for different sampling strategies. The electronic device obtains the corresponding preset high-frequency energy proportion threshold and preset main frequency range according to the current sampling strategy. Specifically, the upper limit of the preset main frequency range is determined by the sampling frequency in the current sampling strategy. In this embodiment, based on the Nyquist sampling theorem, its upper limit is set to half of the current sampling frequency. The preset high-frequency energy proportion threshold is used to measure the proportion of energy carried by frequency components in the signal power spectrum that are higher than a certain percentage (e.g., higher than 70%) of the upper limit of the preset main frequency range. This threshold is also negatively correlated with the current sampling frequency; the higher the sampling frequency, the more lenient the threshold can be set to avoid overreacting to non-critical high-frequency noise.
[0101] More specifically, the electronic device first performs a Fast Fourier Transform (FFT) on a sequence of historical variable values within a preset sliding window to obtain the power spectrum of that sequence. Then, the electronic device calculates the energy falling into different frequency bands within the power spectrum. A preset primary frequency range is used to determine whether the main components of the signal are effectively covered by the current sampling strategy. If most of the energy in the power spectrum is concentrated within this range, it indicates that the current sampling frequency is sufficient to characterize the main features of the signal. A preset high-frequency energy proportion threshold is used to diagnose whether there are significant high-frequency details in the signal that are difficult to capture completely at the current sampling frequency. If the calculated high-frequency energy proportion exceeds this threshold, it indicates high signal complexity and a risk of aliasing, requiring the sampling strategy to be adjusted to a higher sampling frequency.
[0102] It should be understood that the core purpose of dynamically binding the frequency domain analysis benchmark with the current sampling strategy is to establish an adaptive capability-demand matching diagnostic mechanism. This mechanism can not only determine the absolute frequency domain characteristics of the signal, but also diagnose whether there is a gap between the existing sampling capability (determined by the current sampling strategy) and the actual signal requirements, thus providing a direct and objective frequency domain basis for adjusting the sampling strategy.
[0103] For example, if the current sampling strategy is low-speed polling (sampling frequency 10Hz), the preset main frequency range is 0-5Hz. When frequency domain analysis finds that the signal has significant energy at 3-4Hz, it is still within the capture range, and the system can maintain the status quo. However, when significant energy is found at 6Hz (exceeding the upper limit of 5Hz), it is immediately determined that the current sampling capability is insufficient, and it is necessary to switch to high-speed polling or subscription mode.
[0104] It is understood that the specific calculation methods for the aforementioned high-frequency energy proportion threshold and main frequency range (such as setting it to 1 / 2 of the sampling frequency or other proportions) are not fixed. In practical applications, adaptive adjustments can be made according to different industrial scenarios and signal characteristics. For example, for scenarios known to be rich in specific high-frequency noise, a band-stop filter can be set and the judgment logic of the frequency domain reference can be adjusted accordingly. As long as the determination of the frequency domain analysis reference is related to the current sampling strategy and used to evaluate the current strategy's ability to capture the frequency domain characteristics of the signal, this embodiment does not impose any limitations on this.
[0105] S202, based on the current variable value of the variable to be collected, as well as the time domain analysis benchmark and frequency domain analysis benchmark, determine the target sampling strategy and execute the target sampling strategy to collect the variable to be collected.
[0106] In this embodiment, the electronic device analyzes the current time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected, and determines the target sampling strategy based on the analysis results. Specifically, in this embodiment, the electronic device compares the current variable value with the first threshold and the second threshold indicated by the time-domain analysis benchmark, and compares it with the preset high-frequency energy proportion threshold and the preset main frequency range indicated by the frequency-domain analysis benchmark to obtain the analysis results.
[0107] It should be understood that the analysis results obtained above are used to indicate whether the fluctuation state, abnormality level and frequency domain characteristics of the current variable values are suitable for the current sampling capabilities. Based on the analysis results, the target sampling strategy required can be determined, and data collection of the variables to be collected can be performed in accordance with the target sampling strategy.
[0108] In this embodiment, the electronic device has four preset acquisition strategies: fast subscription mode, normal subscription mode, normal polling mode, and slow polling mode. The fast subscription mode indicates subscription-based acquisition at a first-level sampling frequency, the normal subscription mode indicates subscription-based acquisition at a second-level sampling frequency, the normal polling mode indicates periodic acquisition at a third-level sampling frequency, and the slow polling mode indicates periodic acquisition at a fourth-level sampling frequency. The first-level sampling frequency is the highest, and the fourth-level sampling frequency is the lowest. Based on this, the electronic device specifically determines the target acquisition strategy from these four preset acquisition strategies based on the analysis results.
[0109] As a preferred example, when the target sampling strategy is a subscription-based collection strategy, the coefficient of variation of the variable to be collected is obtained for a preset number of preset sliding windows before the current time; based on the mean of each coefficient of variation and the preset coefficient, the dead zone value under the subscription-based collection strategy is determined.
[0110] Specifically, the electronic device calculates the mean of a preset number of coefficients of variation, multiplies this mean by a preset coefficient (e.g., 0.5), and obtains the dead zone value. For example, if the mean coefficient of variation is 8% and the preset coefficient is 0.5, then the dead zone value is 4%. When the change in the variable value does not exceed the dead zone value, data reporting is not triggered; data is only reported according to the subscription frequency when the change exceeds the dead zone value.
[0111] By enabling the dead zone value to be dynamically adjusted according to the historical fluctuation characteristics of the variable to be collected, a smaller dead zone value can be set for long-term stable variables, thereby capturing effective changes more sensitively; a larger dead zone value can be set for high-frequency fluctuating variables, avoiding frequent reporting caused by small fluctuations near the threshold. This further reduces invalid data transmission and lowers network bandwidth consumption while ensuring that key data is not lost.
[0112] As a preferred example, electronic devices incorporate a hysteresis mechanism during sampling strategy switching. Specifically, when a variable value moves from the normal range into the abnormal range, a threshold for triggering an increase in the sampling frequency is set as the first standard; conversely, when the variable value returns from the abnormal range to the normal range, a threshold for triggering a decrease in the sampling frequency is set as the second standard, which is more stringent than the first standard (e.g., requiring a longer period of sustained stability or smaller fluctuations when returning to the normal range). For instance, when a variable value exceeds a basic threshold, the sampling frequency is immediately increased, but it is only reduced after three consecutive sampling cycles of stabilization within 80% of the basic threshold. This mechanism avoids frequent sampling strategy switching caused by small oscillations in variable values around the threshold, ensuring system stability.
[0113] It should be understood that in practical applications, the selection is not limited to the four preset acquisition strategies. Instead, the sampling frequency can be dynamically calculated based on the difference between the variable value and each threshold. For example, when the variable value exceeds the basic threshold by 10%, the sampling frequency is increased to 1.5 times the basic frequency; when the exceedance reaches 20%, it is increased to 2 times the basic frequency; if the emergency threshold is exceeded, it is directly increased to the highest frequency. Conversely, when the variable value is only slightly below the low fluctuation threshold, the sampling frequency is appropriately reduced; when the magnitude is large, the frequency is further reduced. This adaptive adjustment method based on the degree of deviation makes the change in sampling frequency more closely match the actual fluctuation intensity of the variable, avoiding abrupt changes in strategy switching, and further improving the flexibility of data acquisition and the accuracy of resource utilization. This embodiment does not limit this aspect.
[0114] Furthermore, in practical applications, the electronic device can also accept a user-specified data collection method for each variable to be collected. The user executes the data collection method and determines the specified duration. Within the specified duration, the electronic device does not adaptively update the data collection strategy for these variables.
[0115] In the method provided in this embodiment, for any variable to be collected, the time domain analysis benchmark determined based on the historical variable value sequence within a preset sliding window and the frequency domain analysis benchmark determined based on the current sampling strategy are first obtained. Then, combined with the current variable value of the variable to be collected, the target sampling strategy is determined and executed after comprehensive analysis to complete the data collection of the variable.
[0116] The method described in this embodiment effectively solves the problem that fixed-period or fixed-threshold subscription-based data acquisition cannot balance communication efficiency and server resource consumption. This method adapts to the dynamic fluctuation patterns of variables through time-domain analysis, reducing the sampling frequency to minimize resource consumption when variables are stable and increasing the frequency to ensure data real-time performance when variables fluctuate. It also matches the current sampling capability to a frequency-domain analysis benchmark, avoiding spectral aliasing or missed sampling of high-frequency components. Ultimately, it achieves dynamic adaptation of the sampling strategy for each variable under different states, effectively balancing communication efficiency and server resource consumption, and improving the accuracy and resource utilization of industrial data acquisition.
[0117] This application also provides a method embodiment for detailing how to determine the target sampling strategy. Figure 3 A flowchart illustrating a data acquisition method provided in this application embodiment. Figure 2 ,like Figure 3 As shown, the method in this embodiment includes:
[0118] S301, based on the time domain analysis baseline, analyze the variable values to obtain the time domain analysis results.
[0119] In this embodiment, the electronic device analyzes the variable values based on a first threshold, including a basic threshold and an emergency threshold, to obtain a first analysis result; it analyzes the variable values based on a second threshold, including a high fluctuation threshold and a low fluctuation threshold, to obtain a second analysis result; and it determines a time-domain analysis result based on the first and second analysis results; the time-domain analysis result is used to indicate whether to increase or decrease the sampling frequency.
[0120] Specifically, the electronic device compares the current variable value with a baseline threshold and an emergency threshold. If the current variable value exceeds the emergency threshold, the first analysis result indicates that emergency sampling is required, and the sampling frequency needs to be significantly increased. If the current variable value exceeds the baseline threshold but does not exceed the emergency threshold, the first analysis result indicates that the sampling frequency needs to be increased, but emergency sampling is not required. If the current variable value is within the baseline threshold, the first analysis result indicates that the sampling frequency does not need to be adjusted, or the current frequency can be maintained.
[0121] The electronic device compares the current variable value with high and low volatility thresholds. If the current variable value exceeds the high volatility threshold, a second analysis result is determined to indicate that the sampling frequency needs to be increased to capture high-frequency fluctuations. If the current variable value is below the low volatility threshold, the second analysis result is determined to indicate that the sampling frequency needs to be decreased to reduce resource waste. If the current variable value is between the high and low volatility thresholds, the second analysis result is determined to indicate that no adjustment to the sampling frequency is needed.
[0122] Furthermore, if the first analysis result indicates that emergency sampling needs to be performed, then the time-domain analysis result is determined to be that the sampling frequency needs to be increased and emergency sampling needs to be performed; if the first analysis result does not indicate that emergency sampling needs to be performed, but the second analysis result indicates that the sampling frequency needs to be increased, then the time-domain analysis result is determined to be that the sampling frequency needs to be increased; if the first analysis result does not indicate that emergency sampling needs to be performed, but the second analysis result indicates that the sampling frequency needs to be decreased, then the time-domain analysis result is determined to be that the sampling frequency needs to be decreased; otherwise, the time-domain analysis result is determined to be to maintain the current sampling frequency.
[0123] Specifically, if the first analysis result is "the current variable value exceeds the emergency threshold range," regardless of the second analysis result, the first analysis result will take precedence, and the time-domain analysis result will be set to "the sampling frequency needs to be increased and emergency sampling should be performed," for example, directly switching to the highest level of fast subscription mode. If the first analysis result is "exceeding the basic threshold but not exceeding the emergency threshold," and the second analysis result is "exceeding the high volatility threshold," then the time-domain analysis result will still be "the sampling frequency needs to be increased," and the normal subscription mode can be switched to. If the first analysis result is "within the basic threshold," and the second analysis result is "below the low volatility threshold," then the time-domain analysis result will be "the sampling frequency needs to be reduced," and the slow polling mode can be switched to. If the first analysis result is "within the basic threshold," and the second analysis result is "between the high and low volatility thresholds," then the time-domain analysis result will be "maintain the current sampling frequency," for example, maintaining the normal polling mode unchanged.
[0124] The above settings enable multi-dimensional and hierarchical analysis of variable value fluctuations. A first threshold captures instantaneous anomalies, while a second threshold balances long-term fluctuation characteristics and system load, ensuring that time-domain analysis results accurately reflect the true state of the variables. Simultaneously, clear priority rules (e.g., prioritizing emergency sampling) and specific strategy mapping relationships make sampling frequency adjustments more targeted and operable. This avoids misadjustments caused by a single threshold (e.g., excessively increasing the frequency based solely on short-term fluctuations) and allows for rapid response to critical anomalies (e.g., triggering the highest level of sampling at the emergency threshold). Ultimately, while ensuring the integrity and timeliness of data collection, it minimizes unnecessary resource consumption, achieving dynamic optimization of the sampling strategy and efficient allocation of system resources.
[0125] S302, based on the value of the frequency domain analysis benchmark, obtain the frequency domain analysis results.
[0126] In this embodiment, the spectral characteristics of the variable values are obtained; the spectral characteristics include high-frequency energy and main frequency band distribution; the high-frequency energy and main frequency band distribution are analyzed based on the frequency domain analysis benchmark to obtain the frequency domain analysis results; the frequency domain analysis results are used to indicate whether to increase or decrease the sampling frequency.
[0127] Specifically, the electronic device first performs a Fourier transform on the currently acquired variable values, converting the time-domain signal into a frequency-domain signal. It then extracts the proportion of high-frequency energy (such as the upper half of a preset main frequency range) to the total signal energy as a high-frequency energy feature, and identifies the main frequency range where signal energy is concentrated as the main frequency band distribution feature. Subsequently, it compares the high-frequency energy with a preset high-frequency energy proportion threshold, and compares the main frequency band distribution with a preset main frequency range.
[0128] More specifically, if the proportion of high-frequency energy exceeds a preset high-frequency energy proportion threshold, or if the distribution of the main frequency band exceeds a preset main frequency range (e.g., a significant energy component higher than the preset highest frequency appears), then the frequency domain analysis result indicates that the sampling frequency needs to be increased to adapt to the high-frequency characteristics. If the proportion of high-frequency energy is lower than the preset high-frequency energy proportion threshold and the distribution of the main frequency band is entirely within the preset main frequency range, then the frequency domain analysis result indicates that the sampling frequency can be reduced to save resources. If the proportion of high-frequency energy fluctuates slightly around the preset threshold and the distribution of the main frequency band does not exceed the range, then the frequency domain analysis result indicates that the current sampling frequency should be maintained.
[0129] In the above process, frequency domain analysis can accurately identify hidden high-frequency fluctuations in variable values, avoiding high-frequency information loss or spectral aliasing caused by insufficient sampling frequency. Simultaneously, by combining a preset high-frequency energy proportion threshold and a preset main frequency range, the sampling frequency adjustment can both match the actual frequency characteristics of the signal and avoid unnecessary high-frequency sampling of stable low-frequency signals. This ensures the accuracy of frequency domain analysis while further optimizing system resource allocation and improving the scientific rigor and efficiency of data acquisition.
[0130] S303, based on the time domain analysis results and frequency domain analysis results, obtains the target sampling strategy.
[0131] In this embodiment, the electronic device is preset with a first preset condition, a second preset condition, and a third preset condition. The first preset condition includes any one of the following: both the frequency domain analysis result and the time domain analysis result indicate a need to increase the sampling frequency; or the time domain analysis result indicates a need to perform emergency sampling. The second preset condition is: both the frequency domain analysis result and the time domain analysis result indicate a need to increase the sampling frequency. The third preset condition is: both the frequency domain analysis result and the time domain analysis result indicate a need to decrease the sampling frequency.
[0132] Based on this setting, the electronic device determines the target sampling strategy by comparing the time-domain analysis results and the frequency-domain analysis results, and then determining whether both meet preset conditions. Specifically, if the first preset condition is met, the target sampling strategy is determined to be a fast subscription mode; if neither the frequency-domain analysis results nor the time-domain analysis results meet the first preset condition, but meet the second preset condition, the target sampling strategy is determined to be a normal subscription mode; if neither the frequency-domain analysis results nor the time-domain analysis results meet the first preset condition nor the second preset condition, but meet the third preset condition, the target sampling strategy is determined to be a slow polling mode. Otherwise, the target sampling strategy is determined to be a normal polling mode.
[0133] In the above process, by setting a first preset condition to prioritize scenarios requiring emergency sampling and frequency increases in two dimensions, the highest-level sampling strategy can be quickly invoked under critical abnormal conditions to ensure data integrity. Then, through a second preset condition, a third preset condition, and a fallback rule (otherwise), precise matching of sampling strategies under different scenarios is achieved. This layered and clear judgment logic not only provides a clear basis for strategy selection, avoiding subjective judgment errors, but also maximizes the balance between the timeliness and accuracy of data collection and system resource consumption, ensuring that the target sampling strategy always adapts to the actual state of the variables and the system's resource capacity.
[0134] The method provided in this embodiment combines time-domain analysis results with frequency-domain analysis results, and clarifies the judgment logic of both in the form of preset conditions. This allows the determination of the target sampling strategy to simultaneously cover the time-domain fluctuation state and frequency-domain feature adaptability of the variable to be collected, avoiding strategy bias caused by single-dimensional analysis. For example, if the sampling frequency is increased only based on the time-domain results, it may ignore the situation where the signal in the frequency domain is still within the effective acquisition range, resulting in wasted resources. If the frequency is decreased only based on the frequency-domain results, it may miss abnormal fluctuations of the variable in the time domain.
[0135] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0136] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0137] The above embodiments introduce a data acquisition method from the perspective of process flow. The following embodiments introduce a data acquisition device from the perspective of virtual module or virtual unit. For details, please refer to the following embodiments.
[0138] This application also provides a data acquisition device for implementing the methods described in the above method embodiments. Figure 4 This is a schematic diagram of the structure of a data acquisition device provided in an embodiment of this application, as shown below. Figure 4 As shown, in this embodiment, the data acquisition device may include:
[0139] The acquisition module 41 is used to acquire the current time-domain analysis benchmark and frequency-domain analysis benchmark of any variable to be acquired; wherein, the time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be acquired within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy;
[0140] The acquisition module 42 is used to determine the target sampling strategy based on the current value of the variable to be acquired, as well as the time domain analysis benchmark and the frequency domain analysis benchmark, and to execute the target sampling strategy to acquire the variable to be acquired.
[0141] In one possible implementation of this application embodiment, the time-domain analysis benchmark includes a first threshold; the acquisition module 41 is specifically used for:
[0142] Based on the historical variable value sequence, determine the mean and standard deviation of the change of the variable to be collected within a preset sliding window;
[0143] Based on the mean and standard deviation of the change, the first threshold is determined to include a basic threshold and an emergency threshold; wherein the emergency threshold is greater than the basic threshold.
[0144] And / or, the time-domain analysis benchmark includes a second threshold; the acquisition module 41 is specifically used for:
[0145] Based on the historical variable value sequence, determine the coefficient of variation of the variable to be collected within a preset sliding window;
[0146] Based on the coefficient of variation and the current system load factor, the second threshold is determined to include a high volatility threshold and a low volatility threshold; wherein, the system load factor is obtained based on at least one of the central processing unit CPU utilization, memory utilization, and network bandwidth utilization.
[0147] In one possible implementation of this application embodiment, the acquisition module 41 is specifically used for:
[0148] Based on the coefficient of variation of a preset number of preset sliding windows prior to the current time, determine the current data stability factor of the variable to be collected;
[0149] Based on the data stability factor and the system load factor, the second threshold is determined to include a high volatility threshold and a low volatility threshold.
[0150] In one possible implementation of this application embodiment, the acquisition module 42 is specifically used for:
[0151] Based on the time-domain analysis baseline, the variable values are analyzed to obtain the time-domain analysis results;
[0152] Based on the frequency domain analysis benchmark, the variable values are analyzed to obtain the frequency domain analysis results;
[0153] Based on the time-domain analysis results and frequency-domain analysis results, the target sampling strategy is obtained.
[0154] In one possible implementation of this application embodiment, the acquisition module 42 is specifically used for:
[0155] Based on the basic threshold and emergency threshold included in the first threshold, the variable values are analyzed to obtain the first analysis result;
[0156] Based on the high volatility threshold and low volatility threshold included in the second threshold, the variable values are analyzed to obtain the second analysis results;
[0157] Based on the results of the first and second analyses, the time-domain analysis results are determined; the time-domain analysis results are used to indicate whether to increase or decrease the sampling frequency.
[0158] In one possible implementation of this application embodiment, the acquisition module 42 is specifically used for:
[0159] If the first analysis result indicates that emergency sampling is required, then the time domain analysis result is determined to be that the sampling frequency needs to be increased and emergency sampling needs to be performed.
[0160] If the first analysis result does not indicate that emergency sampling is required, but the second analysis result indicates that the sampling frequency needs to be increased, then the time domain analysis result is determined to indicate that the sampling frequency needs to be increased.
[0161] If the first analysis result does not indicate that emergency sampling is required, and the second analysis result indicates that the sampling frequency needs to be reduced, then the time domain analysis result is determined to indicate that the sampling frequency needs to be reduced.
[0162] Otherwise, the time-domain analysis result is determined to maintain the current sampling frequency.
[0163] In one possible implementation of this application embodiment, the frequency domain analysis benchmark includes a preset high-frequency energy proportion threshold and a preset main frequency range; the acquisition module 42 is specifically used for:
[0164] Obtain the spectral characteristics of the variable values; spectral characteristics include high-frequency energy and the distribution of the main frequency band.
[0165] Based on the frequency domain analysis benchmark, the high-frequency energy and main frequency band distribution are analyzed to obtain the frequency domain analysis results; the frequency domain analysis results are used to indicate whether to increase or decrease the sampling frequency.
[0166] In one possible implementation of this application embodiment, the acquisition module 42 is specifically used for:
[0167] If the first preset condition is met, the target sampling strategy is determined to be the fast subscription mode; the first preset condition includes any one of the following: the frequency domain analysis result indicates that the sampling frequency needs to be increased, and the time domain analysis result indicates that the sampling frequency needs to be increased; the time domain analysis result indicates that emergency sampling needs to be performed.
[0168] If neither the frequency domain analysis result nor the time domain analysis result meets the first preset condition, but meets the second preset condition, then the target sampling strategy is determined to be the normal subscription mode; wherein, the second preset condition is: the frequency domain analysis result indicates that there is no need to increase the sampling frequency, and the time domain analysis result indicates that the sampling frequency needs to be increased;
[0169] If the frequency domain analysis results and the time domain analysis results do not meet either the first or the second preset condition, but meet the third preset condition, then the target sampling strategy is determined to be the slow polling mode; wherein, the third preset condition is: the frequency domain analysis results indicate that the sampling frequency needs to be reduced, and the time domain analysis results indicate that the sampling frequency needs to be reduced.
[0170] Otherwise, the target sampling strategy is determined to be the normal polling mode.
[0171] In one possible implementation of this application embodiment, the acquisition module 42 is further used for:
[0172] When the target sampling strategy is a subscription-based collection strategy, obtain the coefficient of variation of the variable to be collected for a preset number of preset sliding windows before the current time.
[0173] Based on the mean of each coefficient of variation and the preset coefficient, the dead zone value under the subscription-based data collection strategy is determined.
[0174] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0175] This application provides an electronic device. Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 5 As shown, Figure 5 The illustrated electronic device includes at least one processor 51 and a memory 52. The processor 51 and the memory 52 are connected, for example, via a bus 53. Optionally, the electronic device may also include a transceiver 54. It should be noted that in practical applications, the transceiver 54 is not limited to one, and the structure of this electronic device does not constitute a limitation on the embodiments of this application.
[0176] Processor 51 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 51 may also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0177] Bus 53 may include a pathway for transmitting information between the aforementioned components. Bus 53 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Bus 53 may be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0178] The memory 52 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0179] The memory 52 is used to store computer instructions for executing the present application's solution, and its execution is controlled by the processor 51. The processor 51 is used to execute the computer instructions stored in the memory 52 to implement the content shown in the foregoing method embodiments.
[0180] This application also provides a computer-readable storage medium, which may include various media capable of storing program code, such as a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk. Specifically, the computer-readable storage medium stores computer instructions, which are used to implement the methods in the above embodiments.
[0181] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the technical solution of the above method embodiments. Its implementation principle and technical effects are similar, and will not be repeated here.
[0182] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0183] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0184] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data acquisition method, characterized in that, The method includes: For any variable to be collected, obtain the current time-domain analysis benchmark and frequency-domain analysis benchmark of the variable to be collected; wherein, the time-domain analysis benchmark is determined based on the historical variable value sequence of the variable to be collected within a preset sliding window, and the frequency-domain analysis benchmark is determined based on the current sampling strategy; Based on the current value of the variable to be collected, as well as the time-domain analysis benchmark and the frequency-domain analysis benchmark, a target sampling strategy is determined, and the target sampling strategy is executed to collect data from the variable to be collected.
2. The method according to claim 1, characterized in that, The time-domain analysis benchmark includes a first threshold; Obtaining the current time-domain features of the variable to be collected includes: Based on the historical variable value sequence, determine the mean and standard deviation of the change of the variable to be collected within the preset sliding window; Based on the mean of the change and the standard deviation of the change, the first threshold includes a basic threshold and an emergency threshold; wherein the emergency threshold is greater than the basic threshold. And / or, the time-domain analysis benchmark includes a second threshold; obtaining the current time-domain characteristics of the variable to be collected includes: Based on the historical variable value sequence, determine the coefficient of variation of the variable to be collected within the preset sliding window; Based on the coefficient of variation and the current system load factor, the second threshold includes a high volatility threshold and a low volatility threshold; wherein the system load factor is obtained based on at least one of the central processing unit CPU utilization, memory utilization, and network bandwidth utilization.
3. The method according to claim 2, characterized in that, The determination of the second threshold based on the coefficient of variation and the current system load factor includes a high volatility threshold and a low volatility threshold, comprising: Based on the coefficient of variation of a preset number of preset sliding windows prior to the current moment, determine the current data stability factor of the variable to be collected; Based on the data stability factor and the system load factor, the second threshold includes a high volatility threshold and a low volatility threshold.
4. The method according to claim 2 or 3, characterized in that, The step of determining the target sampling strategy based on the current value of the variable to be collected, the time-domain analysis benchmark, and the frequency-domain analysis benchmark includes: The time-domain analysis results are obtained by analyzing the values of the variables based on the aforementioned time-domain analysis benchmark. The frequency domain analysis results are obtained by analyzing the variable values based on the frequency domain analysis benchmark. Based on the time-domain analysis results and the frequency-domain analysis results, the target sampling strategy is obtained.
5. The method according to claim 4, characterized in that, The process of analyzing the variable values based on the time-domain analysis benchmark to obtain time-domain analysis results includes: Based on the basic threshold and emergency threshold included in the first threshold, the values of the variable are analyzed to obtain the first analysis result; Based on the high volatility threshold and low volatility threshold included in the second threshold, the values of the variable are analyzed to obtain the second analysis result; Based on the first analysis result and the second analysis result, the time domain analysis result is determined; the time domain analysis result is used to indicate whether to increase or decrease the sampling frequency.
6. The method according to claim 5, characterized in that, The step of determining the time-domain analysis result based on the first analysis result and the second analysis result includes: If the first analysis result indicates that emergency sampling needs to be performed, then the time domain analysis result is determined to indicate that the sampling frequency needs to be increased and emergency sampling needs to be performed. If the first analysis result does not indicate that emergency sampling is required, but the second analysis result indicates that the sampling frequency needs to be increased, then the time-domain analysis result is determined to indicate that the sampling frequency needs to be increased. If the first analysis result does not indicate that emergency sampling is required, and the second analysis result indicates that the sampling frequency needs to be reduced, then the time domain analysis result is determined to indicate that the sampling frequency needs to be reduced. Otherwise, the time-domain analysis result is determined to maintain the current sampling frequency.
7. The method according to claim 4, characterized in that, The frequency domain analysis benchmark includes a preset high-frequency energy proportion threshold and a preset main frequency range; the process of analyzing the variable values based on the frequency domain analysis benchmark to obtain frequency domain analysis results includes: Obtain the spectral characteristics of the variable values; the spectral characteristics include high-frequency energy and the distribution of the main frequency band. The frequency domain analysis results are obtained by analyzing the high-frequency energy and main frequency band distribution based on the frequency domain analysis benchmark; the frequency domain analysis results are used to indicate whether to increase or decrease the sampling frequency.
8. The method according to claim 4, characterized in that, The process of obtaining the target sampling strategy based on the time-domain analysis results and the frequency-domain analysis results includes: If the first preset condition is met, the target sampling strategy is determined to be a fast subscription mode; the first preset condition includes any one of the following: the frequency domain analysis result indicates that the sampling frequency needs to be increased, and the time domain analysis result indicates that the sampling frequency needs to be increased; the time domain analysis result indicates that emergency sampling needs to be performed; If neither the frequency domain analysis result nor the time domain analysis result satisfies the first preset condition, but satisfies the second preset condition, then the target sampling strategy is determined to be a normal subscription mode; wherein, the second preset condition is: the frequency domain analysis result indicates that there is no need to increase the sampling frequency, and the time domain analysis result indicates that the sampling frequency needs to be increased; If the frequency domain analysis result and the time domain analysis result do not satisfy the first preset condition or the second preset condition, but satisfy the third preset condition, then the target sampling strategy is determined to be a slow polling mode; wherein, the third preset condition is: the frequency domain analysis result indicates that the sampling frequency needs to be reduced, and the time domain analysis result indicates that the sampling frequency needs to be reduced; Otherwise, the target sampling strategy is determined to be the normal polling mode.
9. The method according to claim 8, characterized in that, The method further includes: When the target sampling strategy is a subscription-based collection strategy, the coefficient of variation of the variable to be collected is obtained for a preset number of preset sliding windows before the current time. Based on the mean of each of the aforementioned coefficients of variation and the preset coefficient, the dead zone value under the subscription-based collection strategy is determined.
10. An electronic device, characterized in that, The electronic device includes a processor and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 9.