A data collection method, computer program product, device and computer medium

By adjusting the data collection frequency according to the data pressure and fluctuation degree in the cloud platform, the problem of data collection resource consumption and accuracy balance in the cloud platform is solved, and efficient data collection and storage are achieved.

CN118260168BActive Publication Date: 2024-08-23JINAN INSPUR DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410693332.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-31
Publication Date
2024-08-23
Estimated Expiration
2044-05-31

AI Technical Summary

Technical Problem

In cloud platforms, as the scale and resource types increase, the amount of data collected increases, resulting in increased storage pressure. How to balance the accuracy of data collection and resource consumption has become an urgent problem to be solved.

Method used

By obtaining the real-time and historical data of the target object, detect its degree of fluctuation and data pressure, and adjust the collection frequency according to the preset value. High-frequency collection is used when the data pressure is high or fluctuations are severe, and low-frequency collection is used when the fluctuations are small or in an idle state. To ensure the accuracy of data collection and balance of resource consumption.

Benefits of technology

It achieves a balance between data pressure and resource consumption, ensures the accuracy of data collection, and reduces the resource consumption of collection and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118260168B
    Figure CN118260168B
Patent Text Reader

Abstract

The present invention discloses a data acquisition method, a computer program product, a device and a computer medium, which relate to the field of resource monitoring technology, and obtain real-time acquisition data of a target object; obtain historical acquisition data of a target object; detect the fluctuation degree and data pressure of the target object according to the real-time acquisition data and the historical acquisition data; in response to the data pressure exceeding a first preset value, data is collected from the target object at a first frequency; in response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, data is collected from the target object at a second frequency; wherein the first frequency is higher than the second frequency. When the data pressure exceeds the first preset value, more data can be collected, which is convenient for accurately analyzing the situation of the target object, while when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, only less data can be collected, achieving a balance between accuracy and resource consumption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of resource monitoring, and more specifically, to a data collection method, a computer program product, an electronic device and a computer-readable storage medium. Background Art

[0002] In the application of cloud platforms, in order to understand the operating status of various resources in the cloud platform, it is necessary to collect data in the cloud platform for monitoring, analysis, etc. However, as the scale of the cloud platform increases, the types and number of resources in the cloud platform also increase, and the amount of collected data also increases, which puts pressure on the storage of the cloud platform. However, if the amount of collected data is reduced, there will be problems such as failure to collect effective data and failure to accurately monitor the cloud platform.

[0003] In summary, how to balance the accuracy of data collection and resource consumption is an urgent problem to be solved by those skilled in the art. Summary of the invention

[0004] The purpose of the present invention is to provide a data collection method, which can solve the technical problem of how to balance the accuracy and effectiveness of data collection to a certain extent. The present invention also provides a computer program product, an electronic device and a computer-readable storage medium.

[0005] In order to achieve the above object, the present invention provides the following technical solutions:

[0006] In a first aspect, a data collection method is provided, comprising:

[0007] Obtain real-time collected data of the target object;

[0008] Acquire historical collection data of the target object;

[0009] Detecting the fluctuation degree and data pressure of the target object according to the real-time collected data and the historical collected data;

[0010] In response to the data pressure exceeding a first preset value, collecting data from the target object at a first frequency;

[0011] In response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, collecting data from the target object at a second frequency;

[0012] The first frequency is higher than the second frequency.

[0013] On the other hand, detecting the fluctuation degree of the target object according to the real-time collected data and the historical collected data includes:

[0014] Counting a first real-time number of times that the target object remains unchanged continuously according to the real-time collected data and the historical collected data;

[0015] Counting a second real-time number of the target object according to the real-time collected data and the historical collected data, the second real-time number indicating the real-time number of times the growth rate of the target object remains unchanged continuously;

[0016] The first real-time number and the second real-time number are determined as the fluctuation degree.

[0017] On the other hand, counting a second real-time number of the target object according to the real-time collected data and the historical collected data includes:

[0018] Determining the last collected data of the real-time collected data from the historical collected data;

[0019] Determine the real-time change rate of the target object according to the real-time collected data and the last collected data;

[0020] Determine each historical change rate of the target object according to the historical collection data;

[0021] The second real-time number of the target object is counted according to the real-time change rate and the historical change rate.

[0022] On the other hand, before detecting the fluctuation degree and data pressure of the target object according to the real-time collected data and the historical collected data, the method further includes:

[0023] Acquire a state tag of the target object, where the state tag is used to indicate whether the target object has not entered an idle state or has entered an idle state type;

[0024] Obtaining data record values ​​and change rate record values ​​of the target object;

[0025] Analyzing whether the fluctuation level indicates that the target object is in an idle state includes:

[0026] Whether the target object is in an idle state is analyzed according to the state tag, the data record value, the change rate record value and the fluctuation degree.

[0027] On the other hand, after analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree, the method further includes:

[0028] Whether to persistently store the target object is determined according to the status tag, the first real-time number, and the second real-time number.

[0029] On the other hand, analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes:

[0030] In response to the state tag indicating that the target object has not previously entered an idle state, detecting whether the real-time change rate is greater than a second preset value;

[0031] If the real-time change rate is less than or equal to the second preset value, the value of the first real-time number is increased by 1, and the value of the second real-time number is cleared;

[0032] If the real-time change rate is greater than the second preset value, calculating a first absolute value of a difference between the real-time change rate and the change rate record value, and detecting whether the first absolute value is greater than a third preset value;

[0033] If the first absolute value is less than or equal to the third preset value, the value of the first real-time number is cleared to zero, and the value of the second real-time number is increased by 1;

[0034] If the first absolute value is greater than the third preset value, the value of the second real-time number is cleared to zero, the real-time collected data is updated to the data record value, and the real-time change rate is updated to the change rate record value;

[0035] If the first real-time number is greater than or equal to a first value, updating the state tag to indicate that the target object has entered a constant value idle state;

[0036] If the second real-time number is greater than or equal to a second value, the state tag is updated to indicate that the target object has entered a linearly increasing idle state.

[0037] On the other hand, analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes:

[0038] In response to the state tag indicating that the target object has entered a constant value idle state, detecting whether the real-time change rate is greater than a fourth preset value;

[0039] If the real-time change rate is less than or equal to the fourth preset value, the value of the first real-time number is increased by 1, and the state tag, the data record value and the change rate record value are kept unchanged;

[0040] If the real-time change rate is greater than the fourth preset value, the real-time collected data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered the idle state before.

[0041] On the other hand, analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes:

[0042] In response to the state tag indicating that the target object has entered a linear growth idle state, calculating a second absolute value of a difference between the real-time change rate and the change rate record value, and detecting whether the second absolute value is greater than a fifth preset value;

[0043] If the second absolute value is less than or equal to the fifth preset value, the value of the second real-time number is increased by 1, and the state tag, the data record value and the change rate record value are kept unchanged;

[0044] If the second absolute value is greater than the fifth preset value, the real-time collected data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered the idle state before.

[0045] On the other hand, collecting data from the target object according to the second frequency includes:

[0046] In response to the state tag indicating that the target object has entered a constant value idle state, determining a second frequency according to the first real-time number and a minimum sampling interval;

[0047] Data is collected on the target object according to the second frequency.

[0048] On the other hand, collecting data from the target object according to the second frequency includes:

[0049] In response to the state tag indicating that the target object has entered a linearly increasing idle state, determining a second frequency according to the second real-time number and a minimum sampling interval;

[0050] Data is collected on the target object according to the second frequency.

[0051] On the other hand, judging whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes:

[0052] In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is equal to a third value, determining to persistently store the state tag;

[0053] In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is equal to a fourth value, the state tag is persistently stored.

[0054] On the other hand, judging whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes:

[0055] In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is greater than the third value, not persistently storing the target object;

[0056] In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is greater than the fourth value, the target object is not persistently stored.

[0057] On the other hand, judging whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes:

[0058] In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is less than the third value, persistently storing the real-time collected data;

[0059] In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is less than a fourth value, the real-time collected data is persistently stored.

[0060] In a second aspect, a computer program product is provided, comprising a computer program / instruction, which implements the steps of any of the above-mentioned data acquisition methods when executed by a processor.

[0061] According to a third aspect, an electronic device is provided, including:

[0062] Memory for storing computer programs;

[0063] A processor is used to implement the steps of any of the above data acquisition methods when executing the computer program.

[0064] In a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the steps of any of the above data acquisition methods are implemented.

[0065] The present invention provides a data collection method, which obtains real-time collection data of a target object; obtains historical collection data of the target object; detects the fluctuation degree and data pressure of the target object according to the real-time collection data and the historical collection data; in response to the data pressure exceeding a first preset value, collects data from the target object according to a first frequency; in response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, collects data from the target object according to a second frequency; wherein the first frequency is higher than the second frequency. The present invention has the beneficial effect of analyzing the fluctuation degree and data pressure of the target object according to the real-time collection data and the historical collection data of the target object, and since the first frequency is set to be higher than the second frequency, more data can be collected when the data pressure exceeds the first preset value through the first frequency when the data pressure is collected from the target object, which is convenient for accurately analyzing the situation of the target object and ensuring the accuracy of data collection, while when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, only less data can be collected when the data is collected from the target object through the second frequency when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, which is convenient for alleviating the collection pressure and storage pressure, reducing the resource consumption of data collection, and finally achieving a balance between the accuracy and resource consumption of data collection. A computer program product, electronic device and computer-readable storage medium provided by the present invention also solve corresponding technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0067] Figure 1 A flow chart of a data collection method provided by an embodiment of the present invention;

[0068] Figure 2 It is a structural diagram of the data acquisition system in practical applications;

[0069] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;

[0070] Figure 4 Another structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0072] In the application scenario of the cloud platform, in order to understand the operating status of various resources in the platform and analyze the causes of equipment failure, operation and maintenance personnel will check the time-series monitoring data of various indicators of the resource equipment, such as by checking the performance data recorded at various time points in recent periods, studying the operating rules of the equipment, and combining their own business needs, so as to formulate the replacement plan of various types of resource equipment in the cloud platform. However, as the scale of the cloud platform increases, the types and quantities of resources it manages also increase. At the same time, the objects of monitored indicators will also double. Regular sampling of massive monitoring indicators is a test for the memory IO (Input / Output) performance load of the cloud platform. If the original monitoring sampling load of the system is maintained, the sampling frequency needs to be reduced, but this also reduces the accuracy of sampling. How to balance the accuracy of monitoring sampling and performance load has become a focus of widespread attention in the industry. The data collection scheme provided by the present invention can balance the accuracy of data collection and resource consumption.

[0073] See also Figure 1 , Figure 1 The present invention provides a flowchart of a data collection method.

[0074] A data collection method provided by an embodiment of the present invention may include the following steps:

[0075] Step S101: Acquire real-time collected data of a target object.

[0076] Step S102: Acquire historical collection data of the target object.

[0077] In actual applications, you can first obtain real-time collection data and historical collection data of the target object. The real-time collection data can be the data obtained after collecting data on the target object at the current moment, and the historical collection data can be the data obtained after collecting data on the target object before the current moment. The quantity and type of real-time collection data and historical collection data can be determined according to the application scenario.

[0078] It should be noted that the target object refers to the object being collected, which can be flexibly determined according to the application scenario. For example, the target object can be the CPU (Central Processing Unit) usage rate, memory usage rate, etc. of the cloud platform.

[0079] Step S103: Detect the fluctuation degree and data pressure of the target object according to the real-time collected data and the historical collected data.

[0080] In practical applications, since real-time and historical data are obtained based on the data collected at the time of collection, and the collection time has a sequence, real-time and historical data can be regarded as time series data. Therefore, the changes of the target object over time are hidden in the real-time and historical data. In addition, considering that the time series performance data of the target object often has a certain regularity, such as the host's memory usage rate will remain at a fixed value for a long time, and the CPU usage rate will fluctuate slightly around a certain value for a long time, and considering that the parts of the time series data that fluctuate more violently and the parts with excessive numerical pressure have greater application value and higher user attention, this solution comprehensively considers the fluctuation degree of the time series data and the value size to control the collection frequency of the target object.

[0081] In practical applications, considering that data changes can reflect the degree of fluctuation of an object, in the process of detecting the degree of fluctuation of a target object according to real-time collected data and historical collected data, the degree of fluctuation can be determined by calculating data changes, for example, the first real-time number of times the target object remains unchanged continuously can be counted according to real-time collected data and historical collected data; the second real-time number of times the target object remains unchanged continuously can be counted according to real-time collected data and historical collected data, and the second real-time number represents the real-time number of times the growth rate of the target object remains unchanged continuously; the first real-time number and the second real-time number are determined as the degree of fluctuation. From this process, it can be seen that since the first real-time number reflects the number of times the target object remains unchanged continuously, and the target object remains unchanged continuously means that the target object is in a stable state, the first real-time number can reflect whether the target object is stable or not, and correspondingly, since the second real-time number represents the number of times the growth rate of the target object remains unchanged continuously, and the growth rate of the target object remains unchanged continuously can also reflect that the target object is in a special stable state, the second real-time number can reflect whether the target object is in a special stable state, so if the first real-time number and the second real-time number are used as the degree of fluctuation, the fluctuation of the target object can be accurately analyzed from whether the target object is in a stable state in the future, and the first real-time number and the second real-time number are only specific values, which can guarantee the analysis efficiency of the degree of fluctuation to a certain extent.

[0082] In specific application scenarios, considering that the determination of the second real-time number requires analysis of the data change rate, in the process of counting the second real-time number of the target object based on the real-time collected data and the historical collected data, the previous collected data of the real-time collected data can be determined in the historical collected data; the real-time change rate of the target object is determined based on the real-time collected data and the previous collected data; the various historical change rates of the target object are determined based on the historical collected data; and the second real-time number of the target object is counted based on the real-time change rate and the historical change rate.

[0083] Step S104: in response to the data pressure exceeding the first preset value, data collection is performed on the target object at a first frequency.

[0084] Step S105: In response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, data collection is performed on the target object at a second frequency; wherein the first frequency is higher than the first frequency.

[0085] In actual applications, the fluctuation degree and data pressure of the target object can be detected and the collection frequency of the target object can be controlled accordingly. Specifically, when the data pressure exceeds a first preset value, it can be considered that the target object is in a special situation. At this time, it is necessary to collect data from the target object as much as possible in order to accurately analyze the target object later. That is, data can be collected from the target object at a higher first frequency. The first preset value can be determined according to the application scenario. For example, when the data pressure is the performance value of the target object, the first preset value can be a certain value that the performance can reach; when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, it can be considered that the target object has no special situation. At this time, data can be collected from the target object at a lower second frequency to avoid consuming too many resources for data collection. That is, the collection frequency should be reduced for the part of the time series data with low volatility and small values, and the collection frequency should be accelerated for the part with violent fluctuations and large values. However, considering that the value priority of the value of the time series data is higher than the volatility, that is, only when the value is below a certain level, can we consider adjusting the collection frequency according to the volatility. Once it is found that the data of the target object exceeds the preset threshold, the volatility analysis logic should be turned off and the sampling should be forced to be performed at the fastest collection frequency. In addition, if the time series data maintains a constant value and a stable growth rate, it can be regarded as a low volatility type and the collection frequency can be reduced for sampling.

[0086] It should be noted that, considering that there is a minimum value and a maximum value for the data collection interval, that is, there is a maximum value and a minimum value for the data collection frequency, the first frequency can be determined according to the maximum frequency value of the data collection. For example, the first frequency can be set to the maximum frequency value. Of course, the current frequency of the real-time data collection can also be increased to obtain the first frequency, etc. Correspondingly, the second frequency can be determined according to the minimum frequency value of the data collection. For example, the second frequency can be set to the minimum frequency value. Of course, the current frequency of the real-time data collection can also be reduced to obtain the second frequency, etc.

[0087] In actual applications, when collecting data from a target object, the target object may already be in an idle state. This state will affect the subsequent data collection strategy for the target object. For example, when the target object is in a state of drastic fluctuations, it is not appropriate to suddenly reduce the collection frequency of the target object. Therefore, in order to ensure the accuracy of data collection, before detecting the degree of fluctuation and data pressure of the target object based on real-time collection data and historical collection data, the state label of the target object can also be obtained. The state label is used to characterize whether the target object has not entered an idle state or has entered an idle state type, and the data record value and change rate record value of the target object are obtained. The data record value is used to record the latest collection data of the target object, and the change rate record value is used to record the latest change rate value of the target object. Accordingly, in the process of analyzing whether the degree of fluctuation indicates that the target object is in an idle state, whether the target object is in an idle state can be analyzed based on the state label, data record value, change rate record value and degree of fluctuation.

[0088] In a specific application scenario, in the process of analyzing whether the target object is in an idle state according to the state label, the data record value, the change rate record value and the degree of fluctuation, in response to the state label indicating that the target object has not entered the idle state before, it is detected whether the real-time change rate is greater than the second preset value; if the real-time change rate is less than or equal to the second preset value, the value of the first real-time number is increased by 1, and the value of the second real-time number is cleared; if the real-time change rate is greater than the second preset value, the first absolute value of the difference between the real-time change rate and the change rate record value is calculated, and it is detected whether the first absolute value is greater than the third preset value; if the first absolute value is less than or equal to the third preset value, the value of the first real-time number is cleared, and the value of the second real-time number is increased by 1; if the first absolute value is greater than the third preset value, the value of the second real-time number is cleared, the real-time collected data is updated to the data record value, and the real-time change rate is updated to the change rate record value; if the first real-time number is greater than or equal to the first value, the state label is updated to indicate that the target object has entered a constant value idle state; if the second real-time number is greater than or equal to the second value, the state label is updated to indicate that the target object has entered a linear growth idle state.

[0089] Correspondingly, in response to the state tag indicating that the target object has entered a constant value idle state, it is detected whether the real-time change rate is greater than a fourth preset value; if the real-time change rate is less than or equal to the fourth preset value, the value of the first real-time number is increased by 1, and the state tag, the data record value, and the change rate record value are kept unchanged; if the real-time change rate is greater than the fourth preset value, the real-time acquisition data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered an idle state before. Correspondingly, in response to the state tag indicating that the target object has entered a linear growth idle state, the second absolute value of the difference between the real-time change rate and the change rate record value is calculated, and it is detected whether the second absolute value is greater than a fifth preset value; if the second absolute value is less than or equal to the fifth preset value, the value of the second real-time number is increased by 1, and the state tag, the data record value, and the change rate record value are kept unchanged; if the second absolute value is greater than the fifth preset value, the real-time acquisition data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered an idle state before.

[0090] In this way, the present invention restricts the conversion process of the target object between various states, and enables the target object to slowly change from one state to another by updating and comparing the preset value, data recording value, change rate recording value, etc., thereby avoiding the mismatch between the acquisition frequency and the state of the target object caused by the sudden change of the target object from one state to another, and ensuring the accuracy of data collection. It should be noted that the maximum value that can be reached can be set for the first real-time number and the second real-time number to avoid the first real-time number and the second real-time number from increasing unnecessarily and causing errors in this solution. In addition, the preset values ​​such as the second preset value can be the same or different.

[0091] In order to facilitate the understanding of the state transition process of the target object, it is assumed that Data represents the data record value, Rate represents the change rate record value, DataNum represents the first real-time number, RateNum represents the second real-time number, and the variable Tag is used to record whether the target object has entered the idle state and the idle state type label. Tag=0 indicates that the target object has not entered the idle state before, Tag=1 indicates that the target object has entered the constant value idle state before, and Tag=2 ​​indicates that the target object has entered the linear growth idle state before. The state label update process of the target object can be: In the first group of cases, if the current Tag=0, when |Rate0|≤0.1%, DataNum=DataNum+1, RateNum=0, when |Rate0|>0.1%, if |Rate-Rate0|≤0.1%, Rate0 represents the real-time change rate, DataNum=0, RateNum=Rat eNum+1, if |Rate-Rate0|>0.1%, RateNum=0, assign values ​​to variables, Data=Data0, Rate=Rate0, and finally if DataNum≥3, Tag=1, if RateNum≥3, Tag=2; in the second case, if the current Tag=1, when |Rate0|≤0.1%, DataNum=DataNum+1, the other variables remain the same, when |Rate0|>0.1%, assign values ​​to variables, Data=Data0, Rate=Rate0, Tag=0; in the third scenario, if the current Tag=2, when |Rate-Rate0|≤0.1%, RateNum=RateNum+1, the other variables remain the same, when |Rate-Rate0|>0.1%, assign values ​​to variables, Data=Data0, Rate=Rate0, Tag=0.

[0092] In a specific application scenario, during the process of collecting data from the target object at the second frequency, in response to the state tag indicating that the target object has entered a constant value idle state, the second frequency can be determined based on the first real-time number and the minimum sampling interval, for example, the product value of the minimum sampling interval and the first real-time number can be used as the sampling interval corresponding to the second frequency and the second frequency can be determined accordingly; then, data is collected from the target object at the second frequency. Correspondingly, in response to the state tag indicating that the target object has entered a linearly increasing idle state, the second frequency is determined based on the second real-time number and the minimum sampling interval, for example, the product value of the minimum sampling interval and the second real-time number can be used as the sampling interval corresponding to the second frequency and the second frequency can be determined accordingly; data is collected from the target object at the second frequency.

[0093] From this process, it can be seen that when the target object is in an idle state, the present invention can flexibly apply the first real-time number or the second real-time number to determine the second frequency according to the specific idle type of the status tag, so that the second frequency can be matched with the specific idle type of the target object, the accuracy of the second frequency can be improved, and then the resource consumption of data collection can be more accurately controlled.

[0094] In practical applications, after analyzing whether the target object is in an idle state according to the state tag, data record value, change rate record value and fluctuation degree, considering that the storage of the collected data requires the consumption of disk performance, in order to save disk performance as much as possible, it can be determined whether to perform persistent storage of the target object according to the state tag, the first real-time number and the second real-time number. Specifically, in response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is equal to the third value, it can be determined that the state tag is persistently stored; in response to the state tag indicating that the target object has entered a linear growth idle state and the second real-time number is equal to the fourth value, the state tag is persistently stored. In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is greater than the third value, the target object is not persistently stored; in response to the state tag indicating that the target object has entered a linear growth idle state and the second real-time number is greater than the fourth value, the target object is not persistently stored. In response to the status tag indicating that the target object has entered a constant value idle state and the first real-time number is less than the third value, the real-time collected data is persistently stored; in response to the status tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is less than the fourth value, the real-time collected data is persistently stored.

[0095] In this way, the real-time collected data or status tags can be persistently stored according to different situations, or the target object can be not persistently stored, thus avoiding the extreme storage method of persistently storing all collected data and saving disk performance.

[0096] In addition, in specific application scenarios, the data stored persistently is either real collected data values ​​or idle state tags. In general, the real collected data is often recorded continuously at the minimum sampling interval, and there is a blank interval after the idle state tag. At this time, since the target object is in a low volatility state for a long time, after pushing the idle state tag once, if the target object is stable and does not change, no more data will be pushed to further reduce the disk IO load.

[0097] To facilitate understanding of the data persistence solution of the present invention, assuming that the third value, the fourth data and other values ​​are the same, when Tag=1 and DataNum=3 or Tag=2 ​​and RateNum=3, the Tag label can be persistently stored; when Tag=1 and DataNum>3 or Tag=2 ​​and RateNum>3, any data can be persistently stored; in other scenarios, real-time collected data can be persistently stored.

[0098] In actual applications, considering that users need to view the collected data of the target object when analyzing the target object, the corresponding data of the persistently stored target object can also be displayed, such as displaying the data of the persistently stored target object to customers in the form of a curve chart, and the blank data after the status label is automatically filled in the display interface according to the minimum sampling interval and the status label type. For example, when the status label is 1, there will be blank data during the period when the status label changes. At this time, the status label can be displayed at the corresponding collection time of the display interface according to the minimum sampling interval. Of course, the last collected data before the status label can also be directly displayed. In this way, the corresponding data of the target object can be displayed on the display interface according to the minimum sampling interval, and both the collected data and the status label can be displayed, which is convenient for users to accurately identify the collected data they need to pay attention to, and improve the user's viewing experience of the collected data.

[0099] The present invention provides a data collection method, which obtains real-time collection data of a target object; obtains historical collection data of the target object; detects the fluctuation degree and data pressure of the target object according to the real-time collection data and the historical collection data; in response to the data pressure exceeding a first preset value, collects data from the target object according to a first frequency; in response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, collects data from the target object according to a second frequency; wherein the first frequency is higher than the second frequency. The present invention has the beneficial effect of analyzing the fluctuation degree and data pressure of the target object according to the real-time collection data and the historical collection data of the target object, and since the first frequency is set to be higher than the second frequency, more data can be collected when the data pressure exceeds the first preset value through the first frequency when the data pressure is collected from the target object, which is convenient for accurately analyzing the situation of the target object and ensuring the accuracy of data collection, while when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, only less data can be collected when the data is collected from the target object through the second frequency when the data pressure does not exceed the first preset value and the fluctuation degree indicates that the target object is in an idle state, which is convenient for alleviating the collection pressure and storage pressure, reducing the resource consumption of data collection, and finally achieving a balance between the accuracy and resource consumption of data collection.

[0100] Based on the above embodiment, the embodiment of the present invention further provides a data acquisition system, which may include:

[0101] A first acquisition module is used to acquire real-time collected data of a target object;

[0102] The second acquisition module is used to acquire the historical collection data of the target object;

[0103] A first detection module is used to detect the fluctuation degree and data pressure of the target object based on the real-time collected data and the historical collected data;

[0104] The first control module is used to collect data from the target object at a first frequency in response to data pressure exceeding a first preset value; in response to data pressure not exceeding the first preset value and the degree of fluctuation indicating that the target object is in an idle state, collect data from the target object at a second frequency; wherein the first frequency is higher than the second frequency.

[0105] In practical applications, considering that in the data collection process, the collected data needs to be stored in the memory first and then persisted to the disk, the architecture of the data collection system of the present invention can be determined according to the specific application scenario, for example, Figure 2 As shown, it includes target monitoring items, timing query devices, pressure threshold analysis devices, idle tag matching devices, time series data storage devices, and terminal interface display devices. The description of each device is as follows:

[0106] The target monitoring item is the target object of the corresponding resource, and the type can be a performance indicator item;

[0107] By default, the scheduled query device queries the target monitoring item according to the minimum sampling interval T. The data Data0 queried in this sampling and the data Data1 queried in the last sampling have a change rate Rate0=(Data0-Data1) / Data1*100%, and Data0 and Rate0 are temporarily cached in the memory, waiting to be transmitted to the idle tag matching device and the pressure threshold analysis device;

[0108] Five variables Data, Rate, DataNum, RateNum and Tag are set in the idle tag matching device. The initial values ​​of all variables are 0 by default. These five variables are analyzed and updated;

[0109] The idle tag matching device interacts with the time series data storage device after each polling process. If Tag=1 and DataNum=3 or Tag=2 ​​and RateNum=3, the corresponding Tag tag is transmitted to the time series data storage device and saved; if Tag=1 and DataNum>3 or Tag=2 ​​and RateNum>3, data is not pushed to the time series data storage device; in other scenarios, Data data and corresponding timestamps are transmitted to the time series data storage device for persistent storage;

[0110] The idle tag matching device interacts with the timing query device after each polling process. If Tag=0, the timing query device then performs a query task according to the minimum sampling interval T. If Tag=1, the timing query device then performs a query task according to the sampling interval DataNum*T. If Tag=2, the timing query device then performs a query task according to the sampling interval RateNum*T. The minimum sampling frequency, that is, the maximum sampling interval, can be set. For example, the maximum sampling interval cannot exceed 10*T, etc.

[0111] After the timing query device obtains the performance data of the monitoring index item, it will push the data to the pressure threshold analysis device. The pressure threshold analysis device presets the pressure threshold for each monitoring index item and can be manually configured according to business needs. If it is found that the value exceeds the pressure threshold, the idle tag matching device will be immediately shut down until the data value transmitted by the index item is lower than the pressure threshold before it can be started again. During the period when the idle tag matching device is shut down, the timing query device performs the timing query task according to the minimum sampling interval T;

[0112] There are two data formats recorded by the time series data storage device: one is the real performance data value, and the other is the idle tag symbol;

[0113] The terminal interface display device displays the data in the time series data storage device to the customer in the form of a curve chart, wherein the blank part after the idle label symbol is automatically filled in the terminal according to the label type.

[0114] The present invention also provides an electronic device and a computer-readable storage medium, both of which have the corresponding effects of the data collection method provided in the embodiment of the present invention. Figure 3 , Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention.

[0115] An electronic device provided by an embodiment of the present invention includes a memory 201 and a processor 202. The memory 201 stores a computer program. When the processor 202 executes the computer program, the steps of the data acquisition method described in any of the above embodiments are implemented.

[0116] See also Figure 4 Another electronic device provided in an embodiment of the present invention may also include: an input port 203 connected to the processor 202, used to transmit commands input from the outside to the processor 202; a display unit 204 connected to the processor 202, used to display the processing results of the processor 202 to the outside; a communication module 205 connected to the processor 202, used to realize communication between the electronic device and the outside. The display unit 204 can be a display panel, a laser scanning display, etc.; the communication method adopted by the communication module 205 includes but is not limited to mobile high-definition link technology (Mobile High-Definition Link, MHL), Universal Serial Bus (Universal Serial Bus, USB), High-Definition Multimedia Interface (High-Definition Multimedia Interface, HDMI), wireless connection: wireless fidelity technology (WIreless Fidelity, WiFi), Bluetooth communication technology, low-power Bluetooth communication technology, and communication technology based on IEEE802.11s.

[0117] An embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of the data acquisition method described in any of the above embodiments are implemented.

[0118] The computer-readable storage medium involved in the present invention includes random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the technical field.

[0119] A computer program product provided by an embodiment of the present invention includes a computer program / instruction, and when the computer program / instruction is executed by a processor, the steps of the data acquisition method described in any of the above embodiments are implemented.

[0120] For the description of the relevant parts of a data acquisition system, an electronic device, a computer program product, and a computer-readable storage medium provided by an embodiment of the present invention, please refer to the detailed description of the corresponding parts in a data acquisition method provided by an embodiment of the present invention, which will not be repeated here. In addition, the parts of the above technical solutions provided by the embodiments of the present invention that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive elaboration.

[0121] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0122] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data collection method, characterized in that: include: Obtain real-time collected data of the target object; Acquire historical collection data of the target object; Detecting the fluctuation degree and data pressure of the target object according to the real-time collected data and the historical collected data; In response to the data pressure exceeding a first preset value, collecting data from the target object at a first frequency; In response to the data pressure not exceeding the first preset value and the fluctuation degree indicating that the target object is in an idle state, collecting data from the target object at a second frequency; wherein the first frequency is higher than the second frequency; Wherein, detecting the fluctuation degree of the target object according to the real-time collected data and the historical collected data includes: Counting a first real-time number of times that the target object remains unchanged continuously according to the real-time collected data and the historical collected data; Counting a second real-time number of the target object according to the real-time collected data and the historical collected data, the second real-time number indicating the real-time number of times the growth rate of the target object remains unchanged continuously; determining the first real-time number and the second real-time number as the fluctuation degree; The step of analyzing whether the fluctuation degree indicates that the target object is in an idle state includes: Analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree; the state tag is used to characterize whether the target object has not entered the idle state or the type of idle state it has entered; Wherein, analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes: In response to the state tag indicating that the target object has not previously entered an idle state, detecting whether a real-time change rate of the target object is greater than a second preset value; If the real-time change rate is less than or equal to the second preset value, the value of the first real-time number is increased by 1, and the value of the second real-time number is cleared; If the real-time change rate is greater than the second preset value, calculating a first absolute value of a difference between the real-time change rate and a recorded value of the change rate, and detecting whether the first absolute value is greater than a third preset value; If the first absolute value is less than or equal to the third preset value, the value of the first real-time number is cleared to zero, and the value of the second real-time number is increased by 1; If the first absolute value is greater than the third preset value, clearing the value of the second real-time number; If the first real-time number is greater than or equal to a first value, updating the state tag to indicate that the target object has entered a constant value idle state; If the second real-time number is greater than or equal to a second value, the state tag is updated to indicate that the target object has entered a linearly increasing idle state.

2. The data collection method according to claim 1, characterized in that: Counting a second real-time number of the target object according to the real-time collected data and the historical collected data includes: Determining the last collected data of the real-time collected data from the historical collected data; Determine the real-time change rate of the target object according to the real-time collected data and the last collected data; Determine each historical change rate of the target object according to the historical collection data; The second real-time number of the target object is counted according to the real-time change rate and the historical change rate.

3. The data collection method according to claim 2, characterized in that: Before detecting the fluctuation degree and data pressure of the target object according to the real-time collected data and the historical collected data, the method further includes: Obtaining the status tag of the target object; The data record value and the change rate record value of the target object are obtained.

4. The data collection method according to claim 3, characterized in that: After analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree, the method further includes: Whether to persistently store the target object is determined according to the status tag, the first real-time number, and the second real-time number.

5. The data collection method according to claim 4, characterized in that: After clearing the value of the second real-time number, the method further includes: Updating the real-time collected data to the data record value; The real-time change rate is updated to the change rate record value.

6. The data collection method according to claim 5, characterized in that: Analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes: In response to the state tag indicating that the target object has entered a constant value idle state, detecting whether the real-time change rate is greater than a fourth preset value; If the real-time change rate is less than or equal to the fourth preset value, the value of the first real-time number is increased by 1, and the state tag, the data record value and the change rate record value are kept unchanged; If the real-time change rate is greater than the fourth preset value, the real-time collected data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered the idle state before.

7. The data collection method according to claim 6, characterized in that: Analyzing whether the target object is in an idle state according to the state tag, the data record value, the change rate record value and the fluctuation degree includes: In response to the state tag indicating that the target object has entered a linear growth idle state, calculating a second absolute value of a difference between the real-time change rate and the change rate record value, and detecting whether the second absolute value is greater than a fifth preset value; If the second absolute value is less than or equal to the fifth preset value, the value of the second real-time number is increased by 1, and the state tag, the data record value and the change rate record value are kept unchanged; If the second absolute value is greater than the fifth preset value, the real-time collected data is updated to the data record value, the real-time change rate is updated to the change rate record value, and the state tag is updated to indicate that the target object has not entered the idle state before.

8. The data collection method according to claim 7, characterized in that: Collecting data from the target object according to the second frequency includes: In response to the state tag indicating that the target object has entered a constant value idle state, determining a second frequency according to the first real-time number and a minimum sampling interval; Data is collected on the target object according to the second frequency.

9. The data collection method according to claim 7, characterized in that: Collecting data from the target object according to the second frequency includes: In response to the state tag indicating that the target object has entered a linearly increasing idle state, determining a second frequency according to the second real-time number and a minimum sampling interval; Data is collected on the target object according to the second frequency.

10. The data collection method according to claim 7, characterized in that: Determining whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes: In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is equal to a third value, determining to persistently store the state tag; In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is equal to a fourth value, the state tag is persistently stored.

11. The data collection method according to claim 10, characterized in that: Determining whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes: In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is greater than the third value, not persistently storing the target object; In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is greater than the fourth value, the target object is not persistently stored.

12. The data collection method according to claim 11, characterized in that: Determining whether to perform persistent storage on the target object according to the state tag, the first real-time number, and the second real-time number includes: In response to the state tag indicating that the target object has entered a constant value idle state and the first real-time number is less than the third value, persistently storing the real-time collected data; In response to the state tag indicating that the target object has entered a linearly increasing idle state and the second real-time number is less than a fourth value, the real-time collected data is persistently stored.

13. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the data collection method according to any one of claims 1 to 12 are implemented.

14. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data acquisition method according to any one of claims 1 to 12 when executing the computer program.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data acquisition method according to any one of claims 1 to 12 are implemented.