Method, device, equipment and storage medium for calculating equipment operation time
By removing abnormal time points in the equipment operation data sequence, the problem of the inability to process non-normally distributed data in the existing technology is solved, and accurate statistics of equipment operation time are achieved.
Patent Information
- Application Number
- CN202210080749.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-01-24
AI Technical Summary
The existing technology cannot accurately process non-normally distributed time interval data when counting equipment running time, resulting in low statistical accuracy.
By determining the operating data sequence and time series of the equipment, removing abnormal time points, and then obtaining time interval data close to a normal distribution, the mean and standard deviation are used to determine the power-on and off moments, thereby accurately calculating the operating time of the equipment.
It improves the statistical accuracy of equipment running time and ensures accuracy in the case of non-normally distributed data.
Smart Images

Figure CN114547000B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of equipment management, and in particular to a method, apparatus, device and storage medium for calculating equipment operating time. Background Art
[0002] In industrial equipment management, in order to determine the operating status of the equipment, it is usually necessary to count the operating time of the equipment.
[0003] In related technologies, the operating time of a device is generally counted through time series data sent back by the device sensor. Specifically, the time intervals of all adjacent data points are counted, the mean and standard deviation of all time intervals are determined, the power on and off time of the device is determined based on the mean and standard deviation, and the operating time of the device is determined based on the power on and off time. This method is only applicable to time interval data with a normal distribution. If the time interval data does not conform to the normal distribution, the operating time of the device cannot be accurately counted by this method, resulting in low accuracy in counting the operating time of the device. Summary of the invention
[0004] The present application relates to a method, apparatus, device and storage medium for calculating the operating time of a device, which improves the accuracy of statistically analyzing the operating time of the device.
[0005] In a first aspect, an embodiment of the present application provides a method for calculating the running time of a device, including:
[0006] Determine an operation data sequence and a first time sequence of a first device, wherein the first time sequence includes a plurality of collection moments, and the operation data sequence includes operation data collected at the plurality of collection moments;
[0007] According to the operation data sequence and the first time sequence, determining abnormal time in the first time sequence, and removing the abnormal time from the first time sequence to obtain a second time sequence;
[0008] Determine a startup time and a shutdown time of the first device according to the second time series;
[0009] An operating time of the first device is determined according to the power-on time and the power-off time.
[0010] In a possible implementation, determining the abnormal time in the first time series according to the operation data series and the first time series includes:
[0011] Determining the number of abnormal points according to the operation data series and the first time series;
[0012] If the number of abnormal points is less than a first threshold, determining the abnormal time in the first time series according to the operation data series;
[0013] If the number of abnormal points is greater than or equal to the first threshold, the abnormal time is determined in the first time series according to the first time series.
[0014] In a possible implementation, determining the number of abnormal points according to the operation data series and the first time series includes:
[0015] Determine, in the first operating data, first mutation sequence numbers corresponding to a plurality of mutation operating data according to a difference between every two operating data in the operating data sequence, wherein the first mutation sequence number is a sequence number of the mutation operating data in the operating data sequence;
[0016] Determine, in the first time series, second mutation serial numbers corresponding to a plurality of mutation times according to a time difference between every two times in the first time series, where the second mutation serial numbers are serial numbers of the mutation times in the first time series;
[0017] A union of the first mutation serial number and the second mutation serial number is obtained, and the number of mutation serial numbers included in the union is determined as the number of abnormal points.
[0018] In a possible implementation, determining the abnormal time in the first time series according to the operation data sequence includes:
[0019] Obtaining a K-order difference of each operation data in the operation data sequence, where K is an integer greater than or equal to 1;
[0020] Determining a plurality of abnormal times to be selected in the first time series according to K-order differences of each operation data in the operation data series;
[0021] Obtaining the interference degree of each selected abnormal time on the operation data sequence;
[0022] The abnormal time is determined from the plurality of abnormal times to be selected according to the interference degree of each abnormal time to the operation data sequence.
[0023] In a possible implementation manner, for any one of the to-be-selected abnormal time, obtaining the interference degree of the to-be-selected abnormal time on the running data sequence includes:
[0024] Determine a first subsequence and a second subsequence in the operation data sequence, the abnormal time to be selected is the first operation data in the first subsequence, and the abnormal time to be selected is the last operation data in the second subsequence;
[0025] Determine a first interference degree of the to-be-selected abnormal time on the first subsequence according to a difference between the to-be-selected abnormal time and other times in the first subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the first subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0026] Determine a second interference degree of the to-be-selected abnormal time on the second subsequence according to a difference between the to-be-selected abnormal time and other times in the second subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the second subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0027] If the first interference level and the second interference level are both greater than or equal to an interference level threshold, it is determined that the interference level of the selected abnormal time on the operation data sequence is greater than or equal to the interference level threshold.
[0028] In a possible implementation, determining the abnormal time in the first time series according to the first time series includes:
[0029] Obtaining a local anomaly factor at each time in the first time series;
[0030] The time when the local abnormality factor is greater than 1 is determined as the abnormal time.
[0031] In a possible implementation manner, determining the startup time and shutdown time of the first device according to the second time series includes:
[0032] Obtaining the time difference between each time in the second time series to obtain a time difference series;
[0033] Obtaining the mean and standard deviation of the time difference series;
[0034] The power-on time and the power-off time are determined according to the mean value and the standard deviation.
[0035] In a second aspect, an embodiment of the present application provides a device for calculating the running time of a device, including: a first determination module, a second determination module, a third determination module and a fourth determination module, wherein:
[0036] The first determination module is used to determine an operation data sequence and a first time sequence of a first device, wherein the first time sequence includes a plurality of collection moments, and the operation data sequence includes operation data collected at the plurality of collection moments;
[0037] The second determination module is used to determine the abnormal time in the first time series according to the operation data series and the first time series, and remove the abnormal time from the first time series to obtain a second time series;
[0038] The third determination module is used to determine the startup time and shutdown time of the first device according to the second time series;
[0039] The fourth determination module is used to determine the operating time of the first device according to the power-on time and the power-off time.
[0040] In a possible implementation manner, the second determining module is specifically configured to:
[0041] Determining the number of abnormal points according to the operation data series and the first time series;
[0042] If the number of abnormal points is less than a first threshold, determining the abnormal time in the first time series according to the operation data series;
[0043] If the number of abnormal points is greater than or equal to the first threshold, the abnormal time is determined in the first time series according to the first time series.
[0044] In a possible implementation manner, the second determining module is specifically configured to:
[0045] Determine, in the first operating data, first mutation sequence numbers corresponding to a plurality of mutation operating data according to a difference between every two operating data in the operating data sequence, wherein the first mutation sequence number is a sequence number of the mutation operating data in the operating data sequence;
[0046] Determine, in the first time series, second mutation serial numbers corresponding to a plurality of mutation times according to a time difference between every two times in the first time series, where the second mutation serial numbers are serial numbers of the mutation times in the first time series;
[0047] Obtain a union of the first mutation number and the second mutation number, and determine the number of mutation numbers included in the union as the number of abnormal points
[0048] In a possible implementation manner, the second determining module is specifically configured to:
[0049] Obtaining a K-order difference of each operation data in the operation data sequence, where K is an integer greater than or equal to 1;
[0050] Determining a plurality of abnormal times to be selected in the first time series according to K-order differences of each operation data in the operation data series;
[0051] Obtaining the interference degree of each selected abnormal time on the operation data sequence;
[0052] The abnormal time is determined from the plurality of abnormal times to be selected according to the interference degree of each abnormal time to the operation data sequence.
[0053] In a possible implementation manner, the second determining module is specifically configured to:
[0054] Determine a first subsequence and a second subsequence in the operation data sequence, the abnormal time to be selected is the first operation data in the first subsequence, and the abnormal time to be selected is the last operation data in the second subsequence;
[0055] Determine a first interference degree of the to-be-selected abnormal time on the first subsequence according to a difference between the to-be-selected abnormal time and other times in the first subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the first subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0056] Determine a second interference degree of the to-be-selected abnormal time on the second subsequence according to a difference between the to-be-selected abnormal time and other times in the second subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the second subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0057] If the first interference level and the second interference level are both greater than or equal to an interference level threshold, it is determined that the interference level of the selected abnormal time on the operation data sequence is greater than or equal to the interference level threshold.
[0058] In a possible implementation manner, the second determining module is specifically configured to:
[0059] Obtaining a local anomaly factor at each time in the first time series;
[0060] The time when the local abnormality factor is greater than 1 is determined as the abnormal time.
[0061] In a possible implementation manner, the third determining module is specifically configured to:
[0062] Obtaining the time difference between each time in the second time series to obtain a time difference series;
[0063] Obtaining the mean and standard deviation of the time difference series;
[0064] The power-on time and the power-off time are determined according to the mean value and the standard deviation.
[0065] In a third aspect, an embodiment of the present application provides a device for calculating device operation time, including: a processor, a memory,
[0066] The memory stores computer-executable instructions;
[0067] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the method for calculating the device operating time as described in the first aspect.
[0068] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed by a processor, they are used to implement the method for calculating the device operating time described in the first aspect.
[0069] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method for calculating the device running time described in the first aspect.
[0070] The embodiment of the present application provides a method, apparatus, device and storage medium for calculating the operation time of a device. The method first determines the operation data sequence and the first time sequence of the first device, wherein the first time sequence includes multiple acquisition moments, and the operation data sequence includes operation data acquired at multiple acquisition moments; based on the operation data sequence and the first time sequence, the abnormal time is determined in the first time sequence, and the abnormal time is removed from the first time sequence to obtain a second time sequence; based on the second time sequence, the power-on time and the power-off time of the first device are determined; based on the power-on time and the power-off time, the operation time of the first device is determined. By removing the abnormal time points in the time series, the time interval data of the time series is made close to the normal distribution, thereby improving the accuracy of determining the power-on and power-off time of the device using the mean and standard deviation, and the operation time of the device can be accurately inferred based on the accurate power-on and power-off time points. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0072] Figure 2 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 1 ;
[0073] Figure 3 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 2 ;
[0074] Figure 4 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 3 ;
[0075] Figure 5 A schematic diagram of the structure of a device for calculating the running time of a device provided in an embodiment of the present application;
[0076] Figure 6 A schematic diagram of the structure of a device for calculating the device operating time provided in an embodiment of the present application. DETAILED DESCRIPTION
[0077] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0078] For ease of understanding, the following Figure 1 , the application scenarios to which the embodiments of the present application are applicable are described.
[0079] Figure 1 This is a schematic diagram of an application scenario provided by the embodiment of this application. Figure 1 , including a management device 101 and multiple industrial devices 102. The industrial devices 102 can send time data and operation data to the management device 101, and the management device 101 can receive and analyze the time data and operation data sent by the industrial devices 102 to determine whether the industrial devices are operating normally and determine the operating time of the industrial devices.
[0080] In related technologies, management equipment counts the time intervals of all adjacent time series data points, determines the mean and standard deviation of all time intervals, and then determines the equipment's operating time based on the mean and standard deviation. This method is only applicable to normally distributed time interval data. In production scenarios, due to unexpected shutdowns, automatic restarts, and noise around the power-on and power-off times of equipment, the time interval data deviates seriously from the normal distribution. This method cannot accurately count the equipment's operating time, resulting in low accuracy in counting equipment's operating time.
[0081] In order to solve the above technical problems, an embodiment of the present application provides a method for calculating the operating time of a device. The method removes abnormal points in the time series so that the time interval data of the time series is close to a normal distribution, thereby improving the accuracy of determining the power on and off time points of the device using the mean and standard deviation. The operating time of the device can be accurately inferred based on the accurate power on and off time points.
[0082] The technical solution shown in the present application is described in detail below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.
[0083] Figure 2 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 1 . See Figure 2 , the method may include:
[0084] S201. Determine an operation data sequence and a first time sequence of a first device.
[0085] The execution subject of the embodiment of the present application may be a terminal device, or a device operation time calculation device set in the terminal device, and the device operation time calculation device may be implemented by software or by a combination of software and hardware. Figure 1 The management device 101 in.
[0086] The first time series may include multiple acquisition moments, and the first time series may be a timestamp series.
[0087] The operating data sequence may include operating data collected at multiple collection times.
[0088] For example, the first time series may be T(t1, t2, t3, ..., t N ), the running data sequence can be Y(y1,y2,y3,……,y N ), where y1 is the data collected at time t1, y2 is the data collected at time t2, y3 is the data collected at time t3, and so on. N Yes N Data collected at all times.
[0089] For example, when the first device is a vehicle, the operating data may be the vehicle mileage or the vehicle speed.
[0090] S202: Determine abnormal time in the first time series according to the operation data series and the first time series, and remove the abnormal time in the first time series to obtain a second time series.
[0091] The abnormal time in the first time series can be determined according to the running data series and the first time series in the following manner:
[0092] Determine the number of abnormal points according to the operating data sequence and the first time series; if the number of abnormal points is less than a first threshold, determine the abnormal time in the first time series according to the operating data sequence; if the number of abnormal points is greater than or equal to the first threshold, determine the abnormal time in the first time series according to the first time series.
[0093] The first threshold may be the percentage of the number of abnormal points to all data points. For example, the first threshold may be 3%. If the number of data points in the running data sequence is 100, when the number of abnormal points is less than 3, the abnormal time is determined in the first time series according to the running data sequence; when the number of abnormal points is greater than or equal to 3, the abnormal time is determined in the first time series according to the first time series.
[0094] The number of outliers can be determined based on the running data series and the first time series in the following way:
[0095] According to the difference between every two running data in the running data sequence, first mutation sequence numbers corresponding to multiple mutation running data are determined in the first running data, and the first mutation sequence number is the sequence number of the mutation running data in the running data sequence; according to the time difference between every two times in the first time series, second mutation sequence numbers corresponding to multiple mutation times are determined in the first time series, and the second mutation sequence number is the sequence number of the mutation time in the first time series; the union of the first mutation sequence number and the second mutation sequence number is obtained, and the number of mutation sequence numbers included in the union is determined as the number of abnormal points.
[0096] For example, the ADWIN algorithm can be used to obtain abnormal points in the operation data sequence and the first time series. If the first mutation number corresponding to the operation data sequence is (1, 3, 7, 12), and the second mutation number corresponding to the first time series is (1, 5, 7, 12), then the abnormal point can be determined to be (1, 3, 5, 7, 12), and the number of abnormal points is 5.
[0097] S203: Determine a power-on time and a power-off time of the first device according to the second time sequence.
[0098] The power-on time and power-off time of the first device may be determined according to the second time series in the following manner:
[0099] Obtain the time difference between each time in the second time series to obtain a time difference series; obtain the mean and standard deviation of the time difference series; and determine the power-on time and the power-off time according to the mean and the standard deviation.
[0100] For example, the second time series is T = (t1, t2, t3, ..., tN ), time difference series δ(t2-t1, t3-t2, …, t N -t N-1 ), let the mean of the time difference series be μ(δ) and the standard deviation be σ(δ), then the power-on time and power-off time can be determined by formula 1.
[0101]
[0102] Here, K is a constant greater than 0, for example, K may be 3.
[0103] S204: Determine the operating time of the first device according to the power-on time and the power-off time.
[0104] The operation time of the first device may be determined according to the power-on time and the power-off time in the following manner: a plurality of power-on time periods are determined according to the power-on time and the power-off time, and the operation time of the first device is determined according to the plurality of power-on time periods.
[0105] For example, the second time series is (10min, 80min, 130min, 150min), where 80min and 150min are shutdown times, and 10min and 130min are startup times. The startup time is 70min and 20min, and the operation time of the first device is determined to be 70+20=90min based on the time.
[0106] exist Figure 2 In the embodiment shown, the operation data sequence and the first time sequence of the first device are first determined, the first time sequence includes multiple acquisition moments, and the operation data sequence includes operation data acquired at multiple acquisition moments; based on the operation data sequence and the first time sequence, the abnormal time is determined in the first time sequence, and the abnormal time is removed from the first time sequence to obtain a second time sequence; based on the second time sequence, the power-on time and the power-off time of the first device are determined; based on the power-on time and the power-off time, the operation duration of the first device is determined. By removing the abnormal time points in the time sequence, the time interval data of the time sequence is made close to the normal distribution, thereby improving the accuracy of determining the power-on and power-off time points of the device using the mean and standard deviation, and the operation duration of the device can be accurately inferred based on the accurate power-on and power-off time points.
[0107] exist Figure 2 Based on the embodiment shown, when the selected data sequence is different, the method of determining the abnormal time in the first time sequence is also different. The following describes in detail the method of determining the abnormal time in the first time sequence for different data sequences.
[0108] Figure 3 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 2 . See Figure 3 , determining the abnormal time in the first time series according to the operation data series, the method may include:
[0109] S301. Determine an operation data sequence and a first time sequence of a first device.
[0110] It should be noted that the execution process of S301 can refer to the execution process of S201, which will not be described in detail here.
[0111] S302: Determine the number of abnormal points according to the operation data sequence and the first time series.
[0112] It should be noted that the execution process of S302 can refer to the execution process of S202, which will not be repeated here.
[0113] S303: If the number of abnormal points is less than the first threshold, obtain the K-order difference of each operation data in the operation data sequence.
[0114] K is an integer greater than or equal to 1.
[0115] The purpose of taking the k-th order difference is to ensure a detectable and stable time series near the on-off state, so the value of k is determined by the properties of the data.
[0116] For example, if the operating data is mileage, then its K-order difference is the second-order difference, and its second-order difference represents the acceleration during driving, which is a stationary time series; if the operating data is speed data, then its K-order difference is the first-order difference, and its second-order difference represents the acceleration during driving, which is a stationary time series.
[0117] If the running data sequence is Y(y1,y2,y3,……,y N ), then the corresponding first-order difference sequence is △(Y)=(y2-y1,y3-y2,……,y N -y N-1 ), the corresponding second-order difference sequence △ 2 (Y) is the first-order difference of the first-order difference sequence, △ 2 (Y)=(y3-2y2+y1,y4-2y3+y2,……,y N -2y N-1 +y N-2 ).
[0118] S304: Determine a plurality of abnormal times to be selected in the first time series according to the K-order difference of each operation data in the operation data series.
[0119] First, according to the K-order difference of each operation data in the operation data sequence, the candidate abnormal data points in the operation data sequence are determined, and then according to the time corresponding to the candidate abnormal data points, multiple candidate abnormal times are determined in the first time series.
[0120] For ease of understanding, the corresponding relationship between the running data series and the first time series is explained below through Table 1:
[0121] Table 1
[0122] Operational data First time <![CDATA[y1]]> <![CDATA[t1]]> <![CDATA[y2]]> <![CDATA[t2]]> <![CDATA[y3]]> <![CDATA[t3]]> <![CDATA[y4]]> <![CDATA[t4]]>
[0123] If y3 is determined as the abnormal data to be selected through the K-order difference of each operating data, then t3 is the abnormal time point to be selected.
[0124] For the startup process, the operating data increases from 0, and the points with negative values in the K-order difference of the operating data can be determined as the abnormal data points to be selected, and the points in the first time series corresponding to the abnormal data points to be selected can be determined as the abnormal time to be selected; for the shutdown process, the operating data decreases from the maximum to 0, and the points with positive values in the K-order difference of the operating data can be determined as the abnormal data points to be selected, and the points in the first time series corresponding to the abnormal data points to be selected can be determined as the abnormal time to be selected.
[0125] In order to accurately determine the abnormal time, the time points near the abnormal time to be selected may also be marked as the abnormal time to be selected. For example, the three time points subsequent to the abnormal time to be selected may all be recorded as the abnormal time to be selected.
[0126] S305: Obtain the interference degree of each candidate abnormal time on the running data sequence.
[0127] For any abnormal time to be selected, the interference degree of the abnormal time to the running data sequence can be obtained in the following way:
[0128] A first subsequence and a second subsequence are determined in the operation data sequence, the abnormal time to be selected is the first operation data in the first subsequence, and the abnormal time to be selected is the last operation data in the second subsequence.
[0129] A first interference degree of the to-be-selected abnormal time on the first subsequence is determined according to a difference between the to-be-selected abnormal time and other times in the first subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the first subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time.
[0130] A second interference degree of the to-be-selected abnormal time on the second subsequence is determined according to a difference between the to-be-selected abnormal time and other times in the second subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the second subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time.
[0131] If the first interference level and the second interference level are both greater than or equal to an interference level threshold, it is determined that the interference level of the selected abnormal time on the operation data sequence is greater than or equal to the interference level threshold.
[0132] The number of data in the first subsequence and the second subsequence may be the same, and the number of data may be set to 10.
[0133] The interference threshold can be set to 0.5.
[0134] For example, in the running data sequence, 6 is the abnormal time point to be selected, and its corresponding first subsequence is (6, 8, 9, 10), and the second subsequence is (1, 3, 5, 6); according to formula 2, the first interference degree d1=0.3 of the 6 pairs of first subsequences and the second interference degree d2=0.43 of the 6 pairs of second subsequences are calculated respectively.
[0135]
[0136] Among them, y i represents the abnormal time to be selected, avg represents the average of the values in the set, W\y i Indicates that the subsequence is excluding y i For all points other than , max means taking the maximum value in the set.
[0137] S306: Determine an abnormal time from a plurality of abnormal times to be selected according to the interference degree of each abnormal time to be selected on the running data sequence.
[0138] The abnormal time can be determined from multiple candidate times according to the interference degree of each candidate abnormal time on the running data sequence in the following manner:
[0139] If the first interference degree d1 and the second interference degree d2 corresponding to the abnormal time to be selected are both greater than or equal to the interference degree threshold, the abnormal time to be selected can be determined as the abnormal time.
[0140] If d1≥interference threshold>d2, or d2≥interference threshold>d1, or both d1 and d2 are less than the interference threshold, then the abnormal time to be selected is the normal time. S307: Remove the abnormal time from the first time series to obtain a second time series.
[0141] For example, if the first time series T is (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10 ), where the abnormal time is t4, then the second time series T' is (t1, t2, t3, t5, t6, t7, t8, t9, t 10 ).
[0142] S308: Determine a power-on time and a power-off time of the first device according to the second time sequence.
[0143] It should be noted that the execution process of S308 can refer to the execution process of S203, which will not be described in detail here.
[0144] S309: Determine the operating time of the first device according to the power-on time and the power-off time.
[0145] It should be noted that the execution process of S309 can refer to the execution process of S204, which will not be described in detail here.
[0146] exist Figure 3 In the embodiment shown, the operation data sequence and the first time sequence of the first device are first determined; the number of abnormal points is determined according to the operation data sequence and the first time sequence; if the number of abnormal points is less than the first threshold, the K-order difference of each operation data in the operation data sequence is obtained; according to the K-order difference of each operation data in the operation data sequence, multiple candidate abnormal times are determined in the first time sequence; the interference degree of each candidate abnormal time on the operation data sequence is obtained; according to the interference degree of each candidate abnormal time on the operation data sequence, the abnormal time is determined from multiple candidate abnormal times; the abnormal time is removed from the first time sequence to obtain a second time sequence; the power-on time and the power-off time of the first device are determined according to the second time sequence; according to the power-on time and the power-off time, the operation duration of the first device is determined. The potential abnormal time is first determined by the K-order difference of the operation data, and then the abnormal time is determined in the potential abnormal time according to the interference degree, thereby improving the accuracy of determining the abnormal time; by removing the abnormal time points in the time series, the time interval data of the time series satisfies the normal distribution, thereby improving the accuracy of determining the power-on and power-off time points of the device by using the mean and standard deviation, and the operation duration of the device can be accurately inferred according to the accurate power-on and power-off time points.
[0147] Figure 4 A schematic diagram of a method for calculating the device operation time provided in an embodiment of the present application Figure 3 . See Figure 4 , determining an abnormal time in a first time series according to the first time series, the method comprising:
[0148] S401. Determine an operation data sequence and a first time sequence of a first device.
[0149] It should be noted that the execution process of S401 can refer to the execution process of S201, and will not be repeated here.
[0150] S402: Determine the number of abnormal points according to the operation data sequence and the first time series.
[0151] It should be noted that the execution process of S402 can refer to the execution process of S202, which will not be described in detail here.
[0152] S403: If the number of abnormal points is greater than or equal to the first threshold, obtain the local abnormal factor of each time in the first time series.
[0153] The local outlier factor is calculated by the local outlier factor (LOF) algorithm, as follows:
[0154] The local anomaly factor is equal to the average of the ratios of the local reachability density of other points within the kth distance of point p to the local reachability density of point p.
[0155] Among them, the kth distance represents the distance between the kth closest point and point p among the points closest to the data point p.
[0156] The local reachability density of point p is the reciprocal of the average reachable distance from other points in the kth neighborhood of point p to point p.
[0157] The kth neighborhood of point p: the area whose distance to point p is less than the kth distance.
[0158] The kth reachable distance from point o to point p is max{kth distance of point o, the actual distance between point o and point p}.
[0159] S404: Determine the time when the local abnormality factor is greater than 1 as the abnormal time.
[0160] S405: Remove abnormal time from the first time series to obtain a second time series.
[0161] It should be noted that the execution process of S405 can refer to the execution process of S307, which will not be described in detail here.
[0162] S406: Determine a power-on time and a power-off time of the first device according to the second time sequence.
[0163] It should be noted that the execution process of S406 can refer to the execution process of S203, which will not be described in detail here.
[0164] S407: Determine the operating time of the first device according to the power-on time and the power-off time.
[0165] It should be noted that the execution process of S407 can refer to the execution process of S204, which will not be described in detail here.
[0166] exist Figure 4 In the embodiment shown, the operation data sequence and the first time sequence of the first device are first determined; the number of abnormal points is determined based on the operation data sequence and the first time sequence; if the number of abnormal points is greater than or equal to the first threshold, the local abnormal factor of each time in the first time sequence is obtained; the time when the local abnormal factor is greater than 1 is determined as the abnormal time; the power-on time and the power-off time of the first device are determined based on the second time sequence; the operation time of the first device is determined based on the power-on time and the power-off time. By removing the abnormal time points in the time sequence, the time interval data of the time sequence is made close to the normal distribution, thereby improving the accuracy of determining the power-on and power-off time points of the device using the mean and standard deviation, and the operation time of the device can be accurately inferred based on the accurate power-on and power-off time points.
[0167] Figure 5 This is a schematic diagram of a device for calculating the running time of a device provided in an embodiment of the present application. Figure 5 The device 10 for calculating the device operation time includes a first determining module 11, a second determining module 12, a third determining module 13 and a fourth determining module 14, wherein:
[0168] The first determining module 11 is used to determine an operation data sequence and a first time sequence of a first device, wherein the first time sequence includes a plurality of collection moments, and the operation data sequence includes operation data collected at the plurality of collection moments;
[0169] The second determination module 12 is used to determine the abnormal time in the first time series according to the operation data series and the first time series, and remove the abnormal time from the first time series to obtain a second time series;
[0170] The third determination module 13 is used to determine the startup time and shutdown time of the first device according to the second time series;
[0171] The fourth determining module 14 is used to determine the operating time of the first device according to the power-on time and the power-off time.
[0172] In a possible implementation manner, the second determining module 12 is specifically configured to:
[0173] Determining the number of abnormal points according to the operation data series and the first time series;
[0174] If the number of abnormal points is less than a first threshold, determining the abnormal time in the first time series according to the operation data series;
[0175] If the number of abnormal points is greater than or equal to the first threshold, the abnormal time is determined in the first time series according to the first time series.
[0176] In a possible implementation manner, the second determining module 12 is specifically configured to:
[0177] Determine, in the first operating data, first mutation sequence numbers corresponding to a plurality of mutation operating data according to a difference between every two operating data in the operating data sequence, wherein the first mutation sequence number is a sequence number of the mutation operating data in the operating data sequence;
[0178] Determine, in the first time series, second mutation serial numbers corresponding to a plurality of mutation times according to a time difference between every two times in the first time series, where the second mutation serial numbers are serial numbers of the mutation times in the first time series;
[0179] Obtain a union of the first mutation number and the second mutation number, and determine the number of mutation numbers included in the union as the number of abnormal points
[0180] In a possible implementation manner, the second determining module 12 is specifically configured to:
[0181] Obtaining a K-order difference of each operation data in the operation data sequence, where K is an integer greater than or equal to 1;
[0182] Determining a plurality of abnormal times to be selected in the first time series according to K-order differences of each operation data in the operation data series;
[0183] Obtaining the interference degree of each selected abnormal time on the operation data sequence;
[0184] The abnormal time is determined from the plurality of abnormal times to be selected according to the interference degree of each abnormal time to the operation data sequence.
[0185] In a possible implementation manner, the second determining module 12 is specifically configured to:
[0186] Determine a first subsequence and a second subsequence in the operation data sequence, the abnormal time to be selected is the first operation data in the first subsequence, and the abnormal time to be selected is the last operation data in the second subsequence;
[0187] Determine a first interference degree of the to-be-selected abnormal time on the first subsequence according to a difference between the to-be-selected abnormal time and other times in the first subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the first subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0188] Determine a second interference degree of the to-be-selected abnormal time on the second subsequence according to a difference between the to-be-selected abnormal time and other times in the second subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the second subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time;
[0189] If the first interference level and the second interference level are both greater than or equal to an interference level threshold, it is determined that the interference level of the selected abnormal time on the operation data sequence is greater than or equal to the interference level threshold.
[0190] In a possible implementation manner, the second determining module 12 is specifically configured to:
[0191] Obtaining a local anomaly factor at each time in the first time series;
[0192] The time when the local abnormality factor is greater than 1 is determined as the abnormal time.
[0193] In a possible implementation manner, the third determining module 13 is specifically configured to:
[0194] Obtaining the time difference between each time in the second time series to obtain a time difference series;
[0195] Obtaining the mean and standard deviation of the time difference series;
[0196] The power-on time and the power-off time are determined according to the mean value and the standard deviation.
[0197] The device 10 for calculating the device operating time provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0198] Figure 6 A schematic diagram of a device for calculating the device running time provided in an embodiment of the present application. Figure 6 The computing device 20 for computing the device operation time may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.
[0199] The memory 21 is used to store program instructions;
[0200] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the device operating time calculation device 20 to execute the above-mentioned device operating time calculation method.
[0201] Figure 6 The computing device for the device running time shown in the embodiment can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0202] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned method for calculating the operating time of a device.
[0203] The embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the method for calculating the operating time of the above-mentioned device.
[0204] The above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other to form a technical solution.
[0205] In addition, although each operation is described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or to be performed in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the application. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0206] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for calculating the running time of a device, characterized in that: include: Determine an operation data sequence and a first time sequence of a first device, wherein the first time sequence includes a plurality of collection moments, and the operation data sequence includes operation data collected at the plurality of collection moments; Determining the number of abnormal points according to the operation data series and the first time series; If the number of abnormal points is less than the first threshold, obtaining the K-order difference of each operation data in the operation data sequence, where K is an integer greater than or equal to 1; Determining a plurality of abnormal times to be selected in the first time series according to the K-order difference of each operation data in the operation data series; For any abnormal time to be selected, a first subsequence and a second subsequence are determined in the operation data sequence, the abnormal time to be selected is the first operation data in the first subsequence, and the abnormal time to be selected is the last operation data in the second subsequence; Determine a first interference degree of the to-be-selected abnormal time on the first subsequence according to a difference between the to-be-selected abnormal time and other times in the first subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the first subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time; Determine a second interference degree of the to-be-selected abnormal time on the second subsequence according to a difference between the to-be-selected abnormal time and other times in the second subsequence except the to-be-selected abnormal time, and a maximum value between an average value of other times in the second subsequence except the to-be-selected abnormal time and the to-be-selected abnormal time; If the first interference degree and the second interference degree are both greater than or equal to an interference degree threshold, determining that the interference degree of the selected abnormal time to the operation data sequence is greater than or equal to the interference degree threshold; Determining an abnormal time from among the plurality of abnormal times to be selected according to the interference degree of each abnormal time to the operation data sequence; Removing the abnormal time from the first time series to obtain a second time series; Determine a startup time and a shutdown time of the first device according to the second time series; An operating time of the first device is determined according to the power-on time and the power-off time.
2. The method according to claim 1, characterized in that Determining the number of abnormal points according to the operation data sequence and the first time series includes: Determine, according to the difference between every two running data in the running data sequence, first mutation sequence numbers corresponding to a plurality of mutation running data in the running data sequence, wherein the first mutation sequence number is a sequence number of the mutation running data in the running data sequence; Determine, in the first time series, second mutation serial numbers corresponding to a plurality of mutation times according to a time difference between every two times in the first time series, where the second mutation serial numbers are serial numbers of the mutation times in the first time series; A union of the first mutation number and the second mutation number is obtained, and the number of mutation numbers included in the union is determined as the number of abnormal points.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If the number of abnormal points is greater than or equal to the first threshold, the abnormal time is determined in the first time series according to the first time series.
4. The method according to claim 3, characterized in that Determining the abnormal time in the first time series according to the first time series includes: Obtaining a local anomaly factor at each time in the first time series; The time when the local abnormality factor is greater than 1 is determined as the abnormal time.
5. The method according to any one of claims 1 to 4, characterized in that: Determining a startup time and a shutdown time of the first device according to the second time series includes: Obtaining the time difference between each time in the second time series to obtain a time difference series; Obtaining the mean and standard deviation of the time difference series; The power-on time and the power-off time are determined according to the mean value and the standard deviation.
6. A device for calculating the operating time of a device, characterized in that: include: A first determining module, a second determining module, a third determining module and a fourth determining module, wherein: The first determination module is used to determine an operation data sequence and a first time sequence of a first device, wherein the first time sequence includes a plurality of collection moments, and the operation data sequence includes operation data collected at the plurality of collection moments; The second determination module is used to determine the number of abnormal points according to the operation data sequence and the first time series; if the number of abnormal points is less than a first threshold, obtain the K-order difference of each operation data in the operation data sequence, where K is an integer greater than or equal to 1; determine multiple candidate abnormal times in the first time series according to the K-order difference of each operation data in the operation data sequence; for any candidate abnormal time, determine a first subsequence and a second subsequence in the operation data sequence, the candidate abnormal time is the first operation data in the first subsequence, and the candidate abnormal time is the last operation data in the second subsequence; according to the difference between the candidate abnormal time and other times in the first subsequence except the candidate abnormal time, and the average of other times in the first subsequence except the candidate abnormal time The method comprises the following steps: determining a first interference degree of the selected abnormal time on the first subsequence according to the maximum value between the selected abnormal time and the selected abnormal time; determining a second interference degree of the selected abnormal time on the second subsequence according to the difference between the selected abnormal time and other times in the second subsequence except the selected abnormal time, and the maximum value between the average value of other times in the second subsequence except the selected abnormal time and the selected abnormal time; if both the first interference degree and the second interference degree are greater than or equal to the interference degree threshold, determining that the interference degree of the selected abnormal time on the running data sequence is greater than or equal to the interference degree threshold; determining an abnormal time from the multiple selected abnormal times according to the interference degree of each selected abnormal time on the running data sequence; and removing the abnormal time from the first time series to obtain a second time series; The third determination module is used to determine the startup time and shutdown time of the first device according to the second time series; The fourth determination module is used to determine the operating time of the first device according to the power-on time and the power-off time.
7. A device for calculating the device operation time, characterized in that: include: Processor, memory, The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the method for calculating the device operating time according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for calculating the device operating time described in any one of claims 1 to 5.
