CN118260168A - Data acquisition method, computer program product, equipment and computer medium - Google Patents

Data acquisition method, computer program product, equipment and computer medium Download PDF

Info

Publication number
CN118260168A
CN118260168A CN202410693332.6A CN202410693332A CN118260168A CN 118260168 A CN118260168 A CN 118260168A CN 202410693332 A CN202410693332 A CN 202410693332A CN 118260168 A CN118260168 A CN 118260168A
Authority
CN
China
Prior art keywords
real
data
target object
value
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410693332.6A
Other languages
Chinese (zh)
Inventor
武警贺
闫冬冬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltd filed Critical Inspur Jinan data Technology Co ltd
Publication of CN118260168A publication Critical patent/CN118260168A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a data acquisition method, a computer program product, equipment and a computer medium, which relate to the technical field of resource monitoring and acquire real-time acquisition data of a target object; acquiring historical acquisition data of a target object; detecting the fluctuation degree and the data pressure of a target object according to the real-time acquisition data and the historical acquisition data; responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency; responding to the condition that the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, and acquiring data of the target object according to the second frequency; wherein the first frequency is higher than the second frequency. More data can be acquired when the data pressure exceeds a first preset value, so that the condition of the target object can be accurately analyzed, and less data can be acquired only when the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, thereby realizing the balance between accuracy and resource consumption.

Description

Data acquisition method, computer program product, equipment and computer medium
Technical Field
The present invention relates to the field of resource monitoring technology, and more particularly, to a data acquisition method, a computer program product, an electronic device, and a computer readable storage medium.
Background
In the application of the cloud platform, in order to know the running conditions of various resources in the cloud platform, data in the cloud platform need to be collected for monitoring, analysis and the like. However, as the scale of the cloud platform increases, the variety and the number of resources of the cloud platform also increase, and the acquired data volume also increases, which brings pressure to the storage of the cloud platform, but if the acquired data volume is reduced, the problem that effective data cannot be acquired and accurate monitoring of the cloud platform cannot be performed occurs.
In summary, how to balance the accuracy of data acquisition and the resource consumption is a problem to be solved by those skilled in the art.
Disclosure of Invention
The invention aims to provide a data acquisition method which can solve the technical problem of balancing the accuracy and the effectiveness of data acquisition to a certain extent. The invention also provides a computer program product, electronic equipment and a computer readable storage medium.
In order to achieve the above object, the present invention provides the following technical solutions:
in a first aspect, a data acquisition method is provided, including:
acquiring real-time acquisition data of a target object;
Acquiring historical acquisition data of the target object;
Detecting the fluctuation degree and the data pressure of the target object according to the real-time acquired data and the historical acquired data;
Responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency;
Responding to the data pressure not exceeding the first preset value and the fluctuation degree representing that the target object is in an idle state, and acquiring data of the target object according to a second frequency;
wherein the first frequency is higher than the second frequency.
In another aspect, detecting a degree of fluctuation of the target object based on the real-time collected data and the historical collected data includes:
counting a first real-time number of times that the target object is continuously kept unchanged 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, wherein the second real-time number represents the real-time number of the target object with the growth rate continuously kept unchanged;
and determining the first real-time number and the second real-time number as the fluctuation degree.
In another aspect, counting a second real-time number of times of the target object based on the real-time collected data and the historical collected data includes:
determining the last acquired data of the real-time acquired data from the historical acquired data;
determining the real-time change rate of the target object according to the real-time acquired data and the last acquired data;
Determining each historical change rate of the target object according to the historical acquisition data;
And counting the second real-time times of the target object according to the real-time change rate and the historical change rate.
In another aspect, before detecting the fluctuation degree and the data pressure of the target object according to the real-time collected data and the historical collected data, the method further includes:
Acquiring a state label of the target object, wherein the state label is used for representing the idle state of the target object or the type of the idle state entered;
acquiring a data record value and a change rate record value of the target object;
Analyzing whether the fluctuation degree represents that the target object is in an idle state comprises the following steps:
and 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 fluctuation degree.
On the other hand, after analyzing whether the target object is in an idle state according to the status tag, the data record value, the change rate record value and the fluctuation degree, the method further comprises:
and judging whether to store the target object in a lasting mode according to the state label, the first real-time times and the second real-time times.
On the other hand, analyzing whether the target object is in an idle state according to the status tag, the data record value, the change rate record value and the fluctuation degree includes:
detecting whether the real-time change rate is larger than a second preset value or not in response to the state label representing that the target object does not enter an idle state before;
If the real-time change rate is smaller than or equal to the second preset value, increasing the value of the first real-time number by 1, and resetting the value of the second real-time number;
if the real-time change rate is larger than the second preset value, calculating a first absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the first absolute value is larger than a third preset value;
if the first absolute value is smaller than or equal to the third preset value, resetting the value of the first real-time number, and increasing the value of the second real-time number by 1;
if the first absolute value is larger than the third preset value, resetting the value of the second real-time number, updating the real-time collected data to the data record value, and updating the real-time change rate to the change rate record value;
If the first real-time number is greater than or equal to a first numerical value, updating the state label to represent that the target object has entered a constant value idle state;
and if the second real-time number is greater than or equal to a second numerical value, updating the state label to represent that the target object has entered a linear growth idle state.
On the other hand, analyzing whether the target object is in an idle state according to the status tag, the data record value, the change rate record value and the fluctuation degree includes:
Detecting whether the real-time change rate is larger than a fourth preset value or not in response to the state label representing that the target object has entered a constant value idle state;
If the real-time change rate is smaller than or equal to the fourth preset value, increasing the value of the first real-time times by 1, and keeping the state label, the data record value and the change rate record value unchanged;
If the real-time change rate is larger than the fourth preset value, updating the real-time collected data to the data record value, updating the real-time change rate to the change rate record value, and updating the state label to represent that the target object does not enter an idle state before.
On the other hand, analyzing whether the target object is in an idle state according to the status tag, the data record value, the change rate record value and the fluctuation degree includes:
Responding to the state label to represent that the target object has entered a linear growth idle state, calculating a second absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the second absolute value is larger than a fifth preset value;
if the second absolute value is smaller than or equal to the fifth preset value, increasing the value of the second real-time number by 1, and keeping the state label, the data record value and the change rate record value unchanged;
If the second absolute value is larger than the fifth preset value, updating the real-time collected data to the data record value, updating the real-time change rate to the change rate record value, and updating the state label to represent that the target object does not enter an idle state before.
In another aspect, data acquisition is performed on the target object at a second frequency, including:
Determining a second frequency according to the first real-time number and a minimum sampling interval in response to the state tag characterizing that the target object has entered a constant value idle state;
And acquiring data of the target object according to the second frequency.
In another aspect, data acquisition is performed on the target object at a second frequency, including:
determining a second frequency according to the second real-time times and a minimum sampling interval in response to the state label characterizing that the target object has entered a linearly increasing idle state;
And acquiring data of the target object according to the second frequency.
On the other hand, judging whether to perform persistent storage on the target object according to the status tag, the first real-time number and the second real-time number, including:
Determining to persist the state label in response to the state label characterizing that the target object has entered a constant value idle state and the first real-time number is equal to a third value;
And in response to the state label representing that the target object has entered a linear growth idle state and the second real-time number is equal to a fourth value, performing persistent storage on the state label.
On the other hand, judging whether to perform persistent storage on the target object according to the status tag, the first real-time number and the second real-time number, including:
Responding to the state label to represent that the target object has entered a constant value idle state and the first real-time number is greater than the third numerical value, and not performing persistent storage on the target object;
And if the state label indicates that the target object has entered a linear growth idle state and the second real-time number is greater than the fourth value, not performing persistent storage on the target object.
On the other hand, judging whether to perform persistent storage on the target object according to the status tag, the first real-time number and the second real-time number, including:
In response to the state tag characterizing that the target object has entered a constant value idle state and the first real-time number is less than the third value, persisting the real-time collected data;
And in response to the state label representing that the target object has entered a linear growth idle state and the second real-time number is smaller than a fourth value, performing persistent storage on the real-time acquired data.
In a second aspect, there is provided a computer program product comprising computer programs/instructions which when executed by a processor implement the steps of the data acquisition method as described in any of the above.
In a third aspect, there is provided an electronic device comprising:
A memory for storing a computer program;
A processor for implementing the steps of any of the data acquisition methods described above when executing the computer program.
In a fourth aspect, there is provided a computer readable storage medium having stored therein a computer program which, when executed by a processor, implements the steps of a data acquisition method as described in any of the above.
The invention provides a data acquisition method, which is used for acquiring real-time acquisition data of a target object; acquiring historical acquisition data of a target object; detecting the fluctuation degree and the data pressure of a target object according to the real-time acquisition data and the historical acquisition data; responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency; responding to the condition that the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, and acquiring data of the target object according to the second frequency; wherein the first frequency is higher than the second frequency. The beneficial effects of the invention are as follows: according to the real-time data acquisition and the historical data acquisition of the target object, the fluctuation degree and the data pressure of the target object are analyzed, and because the set first frequency is higher than the second frequency, more data can be acquired when the data pressure exceeds a first preset value and the target object is subjected to data acquisition through the first frequency, so that the condition of the target object is accurately analyzed, the accuracy of data acquisition is ensured, and when the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, less data can only be acquired when the target object is subjected to data acquisition through the second frequency, the acquisition pressure and the storage pressure are conveniently relieved, the resource consumption of the data acquisition is reduced, and finally the balance between the accuracy of the data acquisition and the resource consumption is realized. The corresponding technical problems are also solved by the computer program product, the electronic equipment and the computer readable storage medium.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a data acquisition method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data acquisition system in practical application;
Fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention;
Fig. 4 is another schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In an application scene of the cloud platform, in order to know the running condition of various resources in the platform, the fault cause of the equipment is analyzed, operation and maintenance personnel and the like can check time sequence monitoring data of various index items of the resource equipment, for example, by checking performance data recorded at various time points in a near-period time, the running rule of the equipment is researched, and the operation rule is combined with the service requirement of the equipment, so that the alternation planning of various resource equipment in the cloud platform is formulated. However, as the scale of the cloud platform increases, the types and the number of the managed resources are increased, and meanwhile, the monitored index item objects are doubled, so that a massive monitoring index is periodically sampled, which is a test on the performance load of the memory IO (Input/Output) of the cloud platform, if the original monitoring sampling load of the system is maintained, the sampling frequency needs to be reduced, but the sampling accuracy is reduced, and how to balance and control the monitoring sampling accuracy and the performance load has become a focus of wide attention in the industry. The data acquisition scheme provided by the invention can balance the accuracy of data acquisition and the resource consumption.
Referring to fig. 1, fig. 1 is a flowchart of a data acquisition method according to an embodiment of the present invention.
The data acquisition method provided by the embodiment of the invention can comprise the following steps:
Step S101: acquiring real-time acquisition data of a target object.
Step S102: historical acquisition data of the target object is acquired.
In practical application, the real-time acquisition data and the historical acquisition data of the target object can be acquired first, the real-time acquisition data can be data obtained after the target object is acquired at the current moment, the historical acquisition data can be data obtained after the target object is acquired before the current moment, and the real-time acquisition data, the number and the type of the historical acquisition data and the like can be determined according to application scenes.
It should be noted that, the target object refers to an object that is collected and can be flexibly determined according to an application scenario, for example, the target object may be a CPU (Central Processing Unit ) usage rate, a memory usage rate, and the like of the cloud platform.
Step S103: and detecting the fluctuation degree and the data pressure of the target object according to the real-time acquisition data and the historical acquisition data.
In practical application, the real-time acquisition data and the historical acquisition data are acquired according to the acquisition time, and the acquisition time has a sequence, so the real-time acquisition data and the historical acquisition data can be regarded as time sequence data, and the change condition of the target object along with time is hidden in the real-time acquisition data and the historical acquisition data. In addition, considering that the time sequence performance data of the target object often has certain regularity, if the memory utilization rate of the host keeps a certain fixed value unchanged for a long time, the CPU utilization rate fluctuates slightly up and down around a certain value for a long time, and considering that the application value of the part with more intense fluctuation and the part with overlarge numerical pressure in the time sequence data is more and the user attention is higher, the scheme comprehensively considers the fluctuation degree of the time sequence data and the numerical value and controls the acquisition frequency of the target object.
In practical application, the fluctuation degree of the object can be reflected in consideration of the data change condition, so that in the process of detecting the fluctuation degree of the target object according to the real-time collected data and the historical collected data, the fluctuation degree can be determined by counting the data change condition, for example, the first real-time number of times that the target object is continuously kept unchanged can be counted according to the real-time collected data and the historical collected data; counting second real-time times of the target object according to the real-time collected data and the historical collected data, wherein the second real-time times represent real-time times of continuously keeping the growth rate of the target object unchanged; the first real-time number and the second real-time number are determined as the degree of fluctuation. The process can be known that, because the first real-time number reflects the number of times that the target object is continuously kept unchanged, and the target object is continuously kept unchanged, the first real-time number can reflect whether the target object is stable or not, and correspondingly, because the second real-time number represents the number of times that the growth rate of the target object is continuously kept unchanged, and the growth rate of the target object is continuously kept unchanged, the second real-time number can also reflect whether the target object is in a special stable state, and therefore, if the first real-time number and the second real-time number are taken as fluctuation degrees, whether the target object is fluctuated or not can be accurately analyzed from whether the target object is in the stable state or not, and the first real-time number and the second real-time number are only specific numerical values, the analysis efficiency of the fluctuation degrees can be ensured to a certain extent.
In a specific application scene, the data change rate is required to be analyzed in consideration of the determination of the second real-time number, so that the last acquired data of the real-time acquired data can be determined in the historical acquired data in the process of counting the second real-time number of the target object according to the real-time acquired data and the historical acquired data; determining the real-time change rate of the target object according to the real-time acquired data and the last acquired data; determining each historical change rate of the target object according to the historical acquisition data; and counting the second real-time times of the target object according to the real-time change rate and the historical change rate.
Step S104: and responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency.
Step S105: responding to the condition that the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, and acquiring data of the target object according to the second frequency; wherein the first frequency is higher than the first frequency.
In practical application, the fluctuation degree and the data pressure of the target object can be detected, the acquisition frequency of the target object can be controlled according to the fluctuation degree and the data pressure, specifically, when the data pressure exceeds a first preset value, the target object can be considered to be in a special condition, at the moment, data acquisition is needed to be carried out on the target object as much as possible so as to accurately analyze the target object later, namely, the data acquisition can be carried out on the target object according to a higher first frequency, the first preset value can be determined according to an application scene, for example, when the data pressure is a performance value of the target object, the first preset value can be a certain value which can be reached by the performance, and the like; and when the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, the target object can be considered to have no special condition, and at the moment, the data acquisition can be performed on the target object according to the lower second frequency so as to avoid excessive resource consumption in data acquisition. That is, for the part with lower fluctuation degree and smaller numerical value in the time series data, the acquisition frequency should be reduced, and for the part with severe fluctuation and larger numerical value, the acquisition frequency should be accelerated, but considering that the value priority of the numerical value of the time series data is higher than the fluctuation degree, that is, the acquisition frequency can be adjusted according to the fluctuation degree only under the premise that the numerical value is lower than a certain degree, once the data of the target object exceeds the preset threshold value, the fluctuation degree judging logic should be closed to forcedly sample according to the fastest acquisition frequency, and in addition, the time series data can be regarded as a low fluctuation type if the constant value and the stable growth rate are kept to be changed, and the acquisition frequency can be reduced to sample.
It should be noted that, considering that there are minimum and maximum values of the interval of data acquisition, that is, there are maximum and minimum values of the frequency of data acquisition, the first frequency may be determined according to the maximum frequency value of data acquisition, for example, the first frequency may be set to be the maximum frequency value, or the current frequency of real-time data acquisition may be increased to obtain the first frequency; correspondingly, the second frequency can be determined according to the minimum frequency value of the data acquisition, for example, the second frequency can be set as the minimum frequency value, and the second frequency can be obtained by reducing the current frequency of the real-time acquired data.
In practical application, when the target object is acquired, the target object may be in an idle state, which affects a data acquisition strategy of the target object, for example, when the target object is in a severe fluctuation, the acquisition frequency of the target object is not suitable for suddenly reducing, so in order to ensure the accuracy of data acquisition, a state label of the target object can be acquired before the fluctuation degree and the data pressure of the target object are detected according to the real-time acquired data and the historical acquired data, the state label is used for representing the type of the target object which does not enter the idle state or has entered the idle state, a data record value and a change rate record value of the target object are acquired, the data record value is used for recording the latest acquired data of the target object, and the change rate record value is used for recording the latest change rate value of the target object; correspondingly, in the process of analyzing whether the fluctuation degree represents that the target object is in the idle state, whether the target object is in the idle state can be analyzed according to the state label, the data record value, the change rate record value and the fluctuation degree.
In a specific application scene, in the process of analyzing whether a target object is in an idle state according to a state label, a data record value, a change rate record value and a fluctuation degree, if the state label indicates that the target object does not enter the idle state before, detecting whether the real-time change rate is larger than a second preset value; if the real-time change rate is smaller than or equal to a second preset value, increasing the value of the first real-time times by 1, and resetting the value of the second real-time times; if the real-time change rate is larger than the second preset value, calculating a first absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the first absolute value is larger than a third preset value; if the first absolute value is smaller than or equal to a third preset value, resetting the value of the first real-time number, and increasing the value of the second real-time number by 1; if the first absolute value is larger than the third preset value, resetting the value of the second real-time times, updating the real-time acquisition data into a data record value, and updating the real-time change rate into a change rate record value; if the first real-time number is greater than or equal to the first numerical value, updating the state label to represent 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 numerical value, updating the state label to represent that the target object has entered a linear growth idle state.
Correspondingly, if the state label represents 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 smaller than or equal to a fourth preset value, increasing the value of the first real-time times by 1, and keeping the state label, the data record value and the change rate record value unchanged; if the real-time change rate is larger than the fourth preset value, updating the real-time collected data into a data record value, updating the real-time change rate into a change rate record value, and updating the state label into a state representing that the target object does not enter an idle state before. Correspondingly, if the state label represents that the target object has entered a linear growth idle state, calculating a second absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the second absolute value is larger than a fifth preset value; if the second absolute value is smaller than or equal to a fifth preset value, increasing the value of the second real-time times by 1, and keeping the state label, the data record value and the change rate record value unchanged; if the second absolute value is larger than the fifth preset value, updating the real-time collected data into a data record value, updating the real-time change rate into a change rate record value, and updating the state label into a state representing that the target object does not enter an idle state before.
Therefore, the invention limits the conversion process of the target object among states, and the target object can be slowly converted from one state to the other state by updating and comparing the preset value, the data record value, the change rate record value and the like, so that the condition that the acquisition frequency of the target object is not matched with the state of the target object caused by suddenly converting the state of the target object into the other state can be avoided, and the accuracy of data acquisition can be ensured. It should be noted that, the maximum value that can be achieved may be set for the first real-time number and the second real-time number, so as to avoid the error in the scheme caused by the wireless increase of the first real-time number and the second real-time number, and in addition, the preset values such as the second preset value may be the same or different.
To facilitate understanding of the state transition process of the target object, assuming that Data is used to represent a Data record value, rate is used to represent a change Rate record value, dataNum is used to represent a first real-time number, rateNum is used to represent a second real-time number, a variable Tag is used to record whether the target object has entered an idle state and an idle state type Tag, tag=0 is used to represent that the target object has not previously entered an idle state, tag=1 is used to represent that the target object has previously entered a constant value idle state, tag=2 is used to represent that the target object has previously entered a linearly increasing idle state, the state Tag update process of the target object may be: in the first group of cases, if the current tag=0, dataNum = DataNum +1 when |Rate0| is less than or equal to 0.1%, rateNum=0 when |Rate0| is more than 0.1%, if |Rate-Rate0| is less than or equal to 0.1%, rate0 represents the real-time change Rate, dataNum =0, rateNum= RateNum +1, if |Rate-Rate0| > 0.1%, rateNum =0, the variables are assigned, data=Data 0, rate=Rate 0, finally if DataNum is more than or equal to 3, tag=1, if RateNum is more than or equal to 3, tag=2; in the second case, if the current tag=1, dataNum = DataNum +1 when |Rate0| is less than or equal to 0.1%, the remaining variables remain the same, and when |Rate0| > 0.1%, the variables are assigned, data=Dat0, rate=Rate 0, tag=0; in a third scenario, if the current tag=2, rateNum = RateNum +1 when |rate-Rate0| is less than or equal to 0.1%, the remaining variables remain the same, and when |rate-Rate0| > 0.1%, the variables are assigned, data=data0, rate=rate 0, tag=0.
In a specific application scenario, in the process of collecting data of a target object according to a second frequency, responding to a state label to represent that the target object has entered a constant value idle state, the second frequency can be determined according to a first real-time number and a minimum sampling interval, for example, a product value of the minimum sampling interval and the first real-time number can be used as a sampling interval corresponding to the second frequency, and the second frequency can be determined according to the sampling interval; and then data acquisition is carried out on the target object according to the second frequency. Correspondingly, if the state label represents that the target object has entered a linear growth idle state, determining a second frequency according to the second real-time times and the minimum sampling interval, for example, taking the product value of the minimum sampling interval and the second real-time times as the sampling interval corresponding to the second frequency and determining the second frequency according to the sampling interval; and acquiring data of the target object according to the second frequency.
According to the method and the device, when the target object is in the idle state, the first real-time frequency or the second real-time frequency can be flexibly applied to determine the second frequency according to the specific idle type of the state label, 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 the resource consumption of data acquisition can be accurately controlled.
In practical application, after 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 fluctuation degree, considering that the disk performance is required to be consumed when the collected data is stored, in order to save the disk performance as much as possible, whether the target object is stored in a lasting manner can be judged according to the state label, 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 may be determined to persist the state tag; and in response to the state label representing that the target object has entered a linearly increasing idle state and the second real-time number is equal to the fourth value, performing persistent storage on the state label. Responding to the state label to represent that the target object has entered a constant value idle state and the first real-time number is greater than a third value, and not performing persistent storage on the target object; and if the state label indicates that the target object has entered a linear growth idle state and the second real-time number is greater than the fourth value, not performing persistent storage on the target object. Responding to the state label to represent that the target object has entered a constant value idle state and the first real-time number is smaller than a third value, and performing persistent storage on the real-time acquired data; and in response to the state label representing that the target object has entered a linear growth idle state and the second real-time number is smaller than the fourth numerical value, performing persistent storage on the real-time acquired data.
Therefore, the real-time collected data or the state label can be subjected to persistent storage according to the situation, the target object can not be subjected to persistent storage, an extreme storage mode of persistent storage of all the collected data is avoided, and the disk performance can be saved.
In addition, in a specific application scene, one of the data stored in a persistence mode is a real acquired data value, the other is an idle state label, the data is distributed in a general case, the real acquired data is always continuously recorded at a minimum sampling interval, and the idle state label is followed by a blank interval.
In order to facilitate understanding of the data persistence scheme of the present invention, assuming that the third value, the fourth data, etc. are the same, when tag=1 and DataNum =3 or tag=2 and RateNum =3, the Tag label may be stored in a persistence manner; when tag=1 and DataNum > 3 or tag=2 and RateNum > 3, then any data is persisted; and the other scenes are used for carrying out persistent storage on the real-time acquired data.
In practical application, considering that a user needs to check the acquired data of the target object when analyzing the target object, the corresponding data of the target object stored in a persistence manner can be displayed, for example, the data of the target object stored in a persistence manner is displayed to a client in a form of a curve chart, blank data after the state label is automatically filled in a display interface according to a minimum sampling interval and a state label type, for example, the state label is 1, blank data exists in the period of time when the state label is changed, and at the moment, the state label can be displayed at the corresponding acquisition time of the display interface according to the minimum sampling interval, and of course, the last acquired data before the state label can be directly displayed. Therefore, the corresponding data of the target object can be correspondingly displayed on the display interface according to the minimum adoption interval, the collected data can be displayed, the state label can be displayed, the user and the like can accurately identify the collected data needing to be focused, and the viewing experience of the user on the collected data is improved.
The invention provides a data acquisition method, which is used for acquiring real-time acquisition data of a target object; acquiring historical acquisition data of a target object; detecting the fluctuation degree and the data pressure of a target object according to the real-time acquisition data and the historical acquisition data; responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency; responding to the condition that the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, and acquiring data of the target object according to the second frequency; wherein the first frequency is higher than the second frequency. The beneficial effects of the invention are as follows: according to the real-time data acquisition and the historical data acquisition of the target object, the fluctuation degree and the data pressure of the target object are analyzed, and because the set first frequency is higher than the second frequency, more data can be acquired when the data pressure exceeds a first preset value and the target object is subjected to data acquisition through the first frequency, so that the condition of the target object is accurately analyzed, the accuracy of data acquisition is ensured, and when the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, less data can only be acquired when the target object is subjected to data acquisition through the second frequency, the acquisition pressure and the storage pressure are conveniently relieved, the resource consumption of the data acquisition is reduced, and finally the balance between the accuracy of the data acquisition and the resource consumption is realized.
On the basis of the above embodiment, the embodiment of the present invention further provides a data acquisition system, which may include:
the first acquisition module is used for acquiring real-time acquisition data of the target object;
the second acquisition module is used for acquiring historical acquisition data of the target object;
The first detection module is used for detecting the fluctuation degree and the data pressure of the target object according to the real-time collected data and the historical collected data;
The first control module is used for responding to the data pressure exceeding a first preset value and collecting data of the target object according to a first frequency; responding to the condition that the data pressure does not exceed the first preset value and the fluctuation degree represents that the target object is in an idle state, and acquiring data of the target object according to the second frequency; wherein the first frequency is higher than the first frequency.
In practical application, in consideration of that acquired data needs to be stored in a memory and then persisted to a disk in the data acquisition process, the architecture of the data acquisition system of the present invention may be determined according to a specific application scenario, for example, as shown in fig. 2, the architecture includes a target monitoring item, a timing query device, a pressure threshold value research device, an idle tag matching device, a time sequence data storage device, and a terminal interface display device, where each device is described as follows:
the target monitoring item is a target object corresponding to the resource, and the type can be a performance index item;
The timing inquiry device defaults to inquire the target monitoring item according to the minimum sampling interval T, the Data0 inquired by the sampling, the Data1 inquired by the last sampling, the change Rate Rate 0= (Data 0-Data 1)/Data 1 is 100%, and Data0 and Rate0 are temporarily cached in a memory to wait for being transmitted into the idle tag matching device and the pressure threshold value judging device;
Five variables Data, rate, dataNum, rateNum and tags are set in the idle Tag matching device, all the initial values of the variables are defaults to 0, and the five variables are analyzed and updated;
The idle Tag matching device interacts with the time sequence data storage device after each round of polling flow, and if tag=1 and DataNum =3 or tag=2 and RateNum =3, the corresponding Tag is transmitted to the time sequence data storage device and stored; if tag=1 and DataNum > 3 or tag=2 and RateNum > 3, no data is pushed to the time sequential data storage device; the other scenes transmit Data to the time sequence Data storage device and store the Data and the corresponding time stamp in a lasting mode;
The idle Tag matching device interacts with the timing query device after each round of polling flow, if tag=0, the timing query device performs query tasks according to a minimum sampling interval T after the timing query device, if tag=1, the timing query device performs query tasks according to a sampling interval DataNum x T after the timing query device, if tag=2, the timing query device performs query tasks according to a sampling interval RateNum x T after the timing query device, and the minimum sampling frequency, that is, the maximum sampling interval, can be set, for example, the maximum sampling interval cannot exceed 10 x T;
The timing inquiry device pushes data to the pressure threshold value studying and judging device after acquiring the performance data of the monitoring index items, the pressure threshold value studying and judging device presets the pressure threshold value of each monitoring index item, the device can be manually configured according to service requirements, if the numerical value is found to exceed the pressure threshold value, the idle label matching device is immediately closed, the device can be started again until the data value transmitted by the index item is lower than the pressure threshold value, and the timing inquiry device performs timing inquiry tasks according to the minimum sampling interval T during the closing period of the idle label matching device;
the data format recorded by the time sequence data storage device is divided into two types, wherein one type is a real performance data value, and the other type is an idle tag symbol;
And the terminal interface display device displays the data in the time sequence data storage device to a client in the form of a curve chart, wherein a blank part behind the idle tag symbol is automatically filled in the terminal according to the tag type.
The invention also provides electronic equipment and a computer readable storage medium, which have the corresponding effects of the data acquisition method provided by the embodiment of the invention. Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the invention.
An electronic device provided in an embodiment of the present invention includes a memory 201 and a processor 202, where the memory 201 stores a computer program, and the processor 202 implements the steps of the data acquisition method described in any of the embodiments above when executing the computer program.
Referring to fig. 4, another electronic device provided in an embodiment of the present invention may further include: an input port 203 connected to the processor 202 for transmitting an externally input command to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing communication between the electronic device and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication means adopted by the communication module 205 include, but are not limited to, 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, bluetooth low energy communication technology, ieee802.11s based communication technology.
The embodiment of the invention provides a computer readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of the data acquisition method described in any embodiment are implemented.
The computer readable storage medium to which the present invention relates includes random access Memory (Random Access Memory, RAM), memory, read-Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM (Compact Disc Read-Only Memory), or any other form of storage medium known in the art.
A computer program product according to an embodiment of the present invention comprises a computer program/instruction which, when executed by a processor, implements the steps of the data acquisition method as described in any of the embodiments above.
The description of the related parts in the data acquisition system, the electronic device, the computer program product and the computer readable storage medium provided in the embodiments of the present invention refers to the detailed description of the corresponding parts in the data acquisition method provided in the embodiments of the present invention, and will not be repeated here. In addition, the parts of the above technical solutions provided in the embodiments of the present invention, which are consistent with the implementation principles of the corresponding technical solutions in the prior art, are not described in detail, so that redundant descriptions are avoided.
It is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (16)

1. A method of data acquisition, comprising:
acquiring real-time acquisition data of a target object;
Acquiring historical acquisition data of the target object;
Detecting the fluctuation degree and the data pressure of the target object according to the real-time acquired data and the historical acquired data;
Responding to the data pressure exceeding a first preset value, and acquiring data of the target object according to a first frequency;
Responding to the data pressure not exceeding the first preset value and the fluctuation degree representing that the target object is in an idle state, and acquiring data of the target object according to a second frequency;
wherein the first frequency is higher than the first frequency.
2. The data acquisition method according to claim 1, wherein detecting the degree of fluctuation of the target object from the real-time acquisition data and the history acquisition data comprises:
counting a first real-time number of times that the target object is continuously kept unchanged 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, wherein the second real-time number represents the real-time number of the target object with the growth rate continuously kept unchanged;
and determining the first real-time number and the second real-time number as the fluctuation degree.
3. The data acquisition method of claim 2, wherein counting the second real-time number of the target object based on the real-time acquisition data and the historical acquisition data comprises:
determining the last acquired data of the real-time acquired data from the historical acquired data;
determining the real-time change rate of the target object according to the real-time acquired data and the last acquired data;
Determining each historical change rate of the target object according to the historical acquisition data;
And counting the second real-time times of the target object according to the real-time change rate and the historical change rate.
4.A data acquisition method according to claim 3, further comprising, before detecting the degree of fluctuation and the data pressure of the target object from the real-time acquisition data and the history acquisition data:
Acquiring a state label of the target object, wherein the state label is used for representing the idle state of the target object or the type of the idle state entered;
acquiring a data record value and a change rate record value of the target object;
Analyzing whether the fluctuation degree represents that the target object is in an idle state comprises the following steps:
and 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 fluctuation degree.
5. The data collection method according to claim 4, wherein after analyzing whether the target object is in an idle state based on the status flag, the data record value, the change rate record value, and the fluctuation degree, further comprising:
and judging whether to store the target object in a lasting mode according to the state label, the first real-time times and the second real-time times.
6. The data collection method according to claim 5, wherein analyzing whether the target object is in an idle state based on the status tag, the data record value, the change rate record value, and the fluctuation degree comprises:
detecting whether the real-time change rate is larger than a second preset value or not in response to the state label representing that the target object does not enter an idle state before;
If the real-time change rate is smaller than or equal to the second preset value, increasing the value of the first real-time number by 1, and resetting the value of the second real-time number;
if the real-time change rate is larger than the second preset value, calculating a first absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the first absolute value is larger than a third preset value;
if the first absolute value is smaller than or equal to the third preset value, resetting the value of the first real-time number, and increasing the value of the second real-time number by 1;
if the first absolute value is larger than the third preset value, resetting the value of the second real-time number, updating the real-time collected data to the data record value, and updating the real-time change rate to the change rate record value;
If the first real-time number is greater than or equal to a first numerical value, updating the state label to represent that the target object has entered a constant value idle state;
and if the second real-time number is greater than or equal to a second numerical value, updating the state label to represent that the target object has entered a linear growth idle state.
7. The data collection method according to claim 6, wherein analyzing whether the target object is in an idle state based on the status tag, the data record value, the change rate record value, and the fluctuation degree comprises:
Detecting whether the real-time change rate is larger than a fourth preset value or not in response to the state label representing that the target object has entered a constant value idle state;
If the real-time change rate is smaller than or equal to the fourth preset value, increasing the value of the first real-time times by 1, and keeping the state label, the data record value and the change rate record value unchanged;
If the real-time change rate is larger than the fourth preset value, updating the real-time collected data to the data record value, updating the real-time change rate to the change rate record value, and updating the state label to represent that the target object does not enter an idle state before.
8. The data acquisition method of claim 7, wherein analyzing whether the target object is in an idle state based on the status tag, the data record value, the rate of change record value, and the degree of fluctuation comprises:
Responding to the state label to represent that the target object has entered a linear growth idle state, calculating a second absolute value of a difference value between the real-time change rate and the change rate record value, and detecting whether the second absolute value is larger than a fifth preset value;
if the second absolute value is smaller than or equal to the fifth preset value, increasing the value of the second real-time number by 1, and keeping the state label, the data record value and the change rate record value unchanged;
If the second absolute value is larger than the fifth preset value, updating the real-time collected data to the data record value, updating the real-time change rate to the change rate record value, and updating the state label to represent that the target object does not enter an idle state before.
9. The data acquisition method of claim 8, wherein data acquisition of the target object at a second frequency comprises:
Determining a second frequency according to the first real-time number and a minimum sampling interval in response to the state tag characterizing that the target object has entered a constant value idle state;
And acquiring data of the target object according to the second frequency.
10. The data acquisition method of claim 8, wherein data acquisition of the target object at a second frequency comprises:
determining a second frequency according to the second real-time times and a minimum sampling interval in response to the state label characterizing that the target object has entered a linearly increasing idle state;
And acquiring data of the target object according to the second frequency.
11. The data collection method according to claim 8, wherein determining whether to persist the target object based on the status tag, the first real-time number and the second real-time number comprises:
Determining to persist the state label in response to the state label characterizing that the target object has entered a constant value idle state and the first real-time number is equal to a third value;
And in response to the state label representing that the target object has entered a linear growth idle state and the second real-time number is equal to a fourth value, performing persistent storage on the state label.
12. The data collection method according to claim 11, wherein determining whether to persist the target object based on the status tag, the first real-time number and the second real-time number comprises:
Responding to the state label to represent that the target object has entered a constant value idle state and the first real-time number is greater than the third numerical value, and not performing persistent storage on the target object;
And if the state label indicates that the target object has entered a linear growth idle state and the second real-time number is greater than the fourth value, not performing persistent storage on the target object.
13. The data collection method according to claim 12, wherein determining whether to persist the target object based on the status tag, the first real-time number and the second real-time number comprises:
In response to the state tag characterizing that the target object has entered a constant value idle state and the first real-time number is less than the third value, persisting the real-time collected data;
And in response to the state label representing that the target object has entered a linear growth idle state and the second real-time number is smaller than a fourth value, performing persistent storage on the real-time acquired data.
14. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the data acquisition method of any one of claims 1 to 13.
15. An electronic device, comprising:
A memory for storing a computer program;
a processor for implementing the steps of the data acquisition method according to any one of claims 1 to 13 when executing said computer program.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, implements the steps of the data acquisition method according to any one of claims 1 to 13.
CN202410693332.6A 2024-05-31 Data acquisition method, computer program product, equipment and computer medium Pending CN118260168A (en)

Publications (1)

Publication Number Publication Date
CN118260168A true CN118260168A (en) 2024-06-28

Family

ID=

Similar Documents

Publication Publication Date Title
CN116866095B (en) Industrial router with touch panel and standby control method thereof
CN113837596B (en) Fault determination method and device, electronic equipment and storage medium
CN110727572A (en) Buried point data processing method, device, equipment and storage medium
CN112800061B (en) Data storage method, device, server and storage medium
CN117057720B (en) Commodity storage management system based on Internet
KR20210127735A (en) Battery Residual Value Determination System
CN111222790B (en) Method, device and equipment for predicting risk event occurrence probability and storage medium
JP5283143B1 (en) Operation status diagnosis device, operation status diagnosis method, and operation status diagnosis program for diagnosing operation status for equipment and facilities
CN110990235A (en) Performance data management method, device, equipment and medium of heterogeneous storage equipment
CN113487086A (en) Method and device for predicting remaining service life of equipment, computer equipment and medium
CN118260168A (en) Data acquisition method, computer program product, equipment and computer medium
CN111190790A (en) Cloud computing cluster monitoring method and system based on peak prediction
CN115545452A (en) Operation and maintenance method, operation and maintenance system, equipment and storage medium
CN113919783A (en) Inventory early warning method, device and system, storage medium and electronic equipment
CN114884813A (en) Network architecture determination method and device, electronic equipment and storage medium
CN113129473B (en) Data acquisition method, device and system
CN114004138A (en) Building monitoring method and system based on big data artificial intelligence and storage medium
CN115292146B (en) System capacity estimation method, system, equipment and storage medium
CN110647533A (en) Data monitoring method, system and storage medium for structure monitoring system
US9148357B2 (en) System and method for object abstraction and logging
CN114817641B (en) Industrial data acquisition method and device and electronic equipment
CN116743618B (en) Data acquisition and analysis method, equipment and medium of station remote equipment
CN117076277A (en) Equipment service quality quantification method, device, equipment and medium
CN107358031B (en) Client health degree determination method and device
CN116361136A (en) Method, device, equipment and storage medium for predicting server performance data

Legal Events

Date Code Title Description
PB01 Publication