Time sequence data processing method and device, electronic equipment and storage medium
By correcting the counter values and increment values of time series data, the data sequence is repaired in the case of data transmission delay, solving the problem of data storage reliability and cost, and avoiding the simultaneous transformation of the sender and receiver.
Patent Information
- Application Number
- CN202411005655.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-07-25
AI Technical Summary
During the data transmission process, network fluctuations cause delays in the arrival of time-series data, causing the data order to be reversed. Existing technologies such as TCP's ACK mechanism and sliding time window scheme require the modification of both the sender and the receiver at the same time. The cost is high and it is difficult to ensure data storage. Reduce data repair costs while maintaining reliability.
By obtaining the counter value and increment value of the time series data and performing correction processing to determine the new increment value, the data sequence can be quickly repaired and the simultaneous transformation of the sender and receiver can be avoided.
While ensuring the reliability of data storage results, it reduces the cost of data repair and avoids the high-cost need to transform the sender and receiver at the same time.
Smart Images

Figure CN118673013A
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a time series data processing method, device, electronic device and storage medium. Background Art
[0002] In some specific scenarios in the field of observability, monitoring systems (such as Prometheus) need to use remote write to forward the collected data to other components so that other components can perform secondary processing and storage on the data. However, in the process of forwarding data, if the network is volatile, there may be a delay when the data reaches the next component (for example, the order of two adjacent data is reversed).
[0003] In order to ensure data reliability, the Transmission Control Protocol (TCP) proposes a technical solution that can use the message acknowledgment (ACK) mechanism and the sliding time window to ensure that all TCP messages that eventually arrive can be assembled and unpacked in a consistent order. However, this method requires the data sender and the data receiver to be modified at the same time, which makes the implementation cost high.
[0004] Therefore, when an electronic device detects that there is a delay in the received timing data, how to reduce the cost of data repair while ensuring the reliability of the data storage results becomes an urgent problem to be solved. Summary of the invention
[0005] The embodiments of the present application provide a time series data processing method, device, electronic device and storage medium, which can not only ensure the reliability of data storage results but also reduce the cost of data repair when there is a delay in the received time series data.
[0006] In a first aspect, an embodiment of the present application provides a time series data processing method, the method comprising:
[0007] In the case where a delay is detected in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0008] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0009] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0010] In one of the embodiments, the existing incremental value is corrected according to the first counter value and the second counter value to obtain a new incremental value corresponding to the previous time series data, including: determining a first difference between the first counter value and the second counter value; using the first difference to replace the existing incremental value to obtain a new incremental value corresponding to the previous time series data.
[0011] In one of the embodiments, the incremental value corresponding to the current time series data is determined based on the existing incremental value and the new incremental value corresponding to the previous time series data, including: determining the second difference between the existing incremental value and the new incremental value corresponding to the previous time series data; and using the second difference as the incremental value corresponding to the current time series data.
[0012] In one of the embodiments, after correcting the existing incremental value according to the first counter value and the second counter value to obtain a new incremental value corresponding to the previous time series data, the method also includes: storing the new incremental value in association with the timestamp corresponding to the previous time series data and the first counter value.
[0013] In one of the embodiments, after determining the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, the method further includes: storing the timestamp, the second counter value and the incremental value corresponding to the current time series data in an associated manner.
[0014] In one of the embodiments, the method further includes: when receiving current time series data, obtaining a timestamp corresponding to the current time series data and a timestamp corresponding to previous time series data; when it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, determining that there is a delay in the current time series data.
[0015] In a second aspect, an embodiment of the present application provides a time series data processing device, the device comprising:
[0016] An acquisition module, configured to acquire, when detecting that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data; the existing incremental value indicates a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0017] A processing module, configured to perform correction processing on the existing increment value according to the first counter value and the second counter value, so as to obtain a new increment value corresponding to the previous time series data;
[0018] The determination module is used to determine the incremental value corresponding to the current time series data according to the existing incremental value and the new incremental value corresponding to the previous time series data.
[0019] In a third aspect, the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0020] When it is detected that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents the amount of change of the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0021] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0022] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0023] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0024] When it is detected that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents the amount of change of the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0025] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0026] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0027] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0028] When it is detected that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents the amount of change of the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0029] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0030] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0031] The above-mentioned time series data processing method, device, electronic device and storage medium, the electronic device can obtain the first counter value corresponding to the previous time series data, the existing incremental value corresponding to the previous time series data, and the second counter value corresponding to the current time series data when detecting that the received current time series data has a delay; wherein the existing incremental value represents the change amount of the second counter value of the previous time series data relative to the counter value of the previous time series data of the previous time series data; then, according to the first counter value and the second counter value, the existing incremental value is corrected to obtain the new incremental value corresponding to the previous time series data; finally, according to the existing incremental value and the new incremental value corresponding to the previous time series data, the incremental value corresponding to the current time series data is determined. With this method, the electronic device can realize the rapid repair of the sequence of the current time series data and the previous time series data based on the incremental value corresponding to the current time series data. In this way, on the one hand, when data is stored, the reliability of the data storage result can be guaranteed, and on the other hand, compared with the method of ensuring data reliability through the ACK mechanism and the sliding time window technology, there is no need to transform the data sender and the data receiver at the same time, thereby reducing the cost of data repair. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0033] Figure 1 This is a schematic diagram of an application scenario of a time series data processing method provided in an embodiment of the present application;
[0034] Figure 2 It is a flowchart of a time series data processing method provided in an embodiment of the present application;
[0035] Figure 3 It is a flowchart of another time series data processing method provided in an embodiment of the present application;
[0036] Figure 4 It is a structural schematic diagram of a time series data processing device provided in an embodiment of the present application;
[0037] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] See also Figure 1 , Figure 1 Schematic diagram of an application scenario of a time series data processing method provided in an embodiment of the present application. Figure 1 As shown, the application scenario includes a first electronic device 101 and a second electronic device 102 ( Figure 1 In the figure, the second electronic device 102 is taken as an example that the second electronic device 102 is a network camera. The first electronic device 101 and the second electronic device 102 perform data transmission via a network.
[0040] The second electronic device 102 may obtain multiple time series data, and perform incremental processing on the time series of each time series data (the time series is a counter type) to obtain an incremental value corresponding to each time series data. Then, the multiple time series data and the related information of each time series data are sent to the first electronic device 101.
[0041] Exemplarily, the original sequence and incremental sequence of the time series data acquired by the second electronic device 102 may be as shown in Table 1 below.
[0042] Table 1 The original sequence and incremental sequence table of the time series data acquired by the second electronic device 102
[0043]
[0044] Assume that when the second electronic device 102 is transmitting time series data to the first electronic device 101, network jitter occurs around 2024-05-01 12:01:00, resulting in the original sequence and incremental sequence of the time series data received by the first electronic device 101 as shown in Table 2 below.
[0045] Table 2 The original sequence and incremental sequence of the time series data received by the first electronic device 101
[0046]
[0047] As can be seen from Table 2, the order of the time series data corresponding to 2024-05-01 12:02:00 and the time series data corresponding to 2024-05-01 12:01:00 is reversed, the incremental value of the time series data corresponding to 2024-05-01 12:01:00 is discarded, and the time series data corresponding to 2024-05-01 12:02:00 obtains an incorrect incremental value. In this case, the first electronic device 101 can obtain the first counter value corresponding to the previous time series data, the existing incremental value corresponding to the previous time series data, and the second counter value corresponding to the current time series data; wherein the existing incremental value represents the change amount of the second counter value of the previous time series data relative to the counter value of the previous time series data of the previous time series data; then, according to the first counter value and the second counter value, the existing incremental value is corrected to obtain a new incremental value corresponding to the previous time series data; finally, according to the existing incremental value and the new incremental value corresponding to the previous time series data, the incremental value corresponding to the current time series data is determined. By adopting this method, the electronic device can quickly repair the order of the current time series data and the previous time series data based on the incremental value corresponding to the current time series data. In this way, on the one hand, the reliability of the data storage results can be guaranteed when the data is stored, and on the other hand, compared with the method of ensuring data reliability through the ACK mechanism and the sliding time window technology, there is no need to transform the data sender and the data receiver at the same time, thereby reducing the cost of data repair.
[0048] Optionally, the first electronic device 101 may include but is not limited to a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart watch, a smart TV, a smart car terminal, etc., which is not limited here.
[0049] Optionally, the second electronic device 102 may be a network camera, a video recorder, etc., which is not limited here.
[0050] The time series data processing method provided in the embodiment of the present application is described in detail below.
[0051] See also Figure 2 , Figure 2 is a flow chart of a method for processing time series data provided by an embodiment of the present application. The method can be performed by an electronic device (for example, Figure 1 The first electronic device 101 in the embodiment is executed. Figure 2 As shown, the time series data processing method may include but is not limited to the following steps:
[0052] S201. When it is detected that there is a delay in the received current time series data, obtain a first counter value corresponding to the previous time series data of the current time series data, an existing increment value corresponding to the previous time series data, and a second counter value corresponding to the current time series data.
[0053] The existing incremental value represents the change in the second counter value of the previous time series data relative to the counter value of the previous time series data.
[0054] For example, referring to Table 2, assuming that the previous time series data is the time series data corresponding to the timestamp 2024-05-01 12:02:00, and the previous time series data of the previous time series data is the time series data corresponding to the timestamp 2024-05-01 12:00:00, then the existing incremental value of the time series data corresponding to 2024-05-01 12:02:00 is the change of the counter value 10002 of the time series data corresponding to 2024-05-01 12:02:00 relative to the counter value 10000 of the time series data corresponding to 2024-05-01 12:00:00, which is 10002-10000=2.
[0055] In an optional embodiment, the electronic device may also obtain the timestamp corresponding to the current time series data and the timestamp corresponding to the previous time series data when receiving the current time series data; and when it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, it is determined that there is a delay in the current time series data.
[0056] For example, assuming that after receiving the current time series data, the electronic device obtains the timestamp of the current time series data as 2024-05-01 12:01:00, and the timestamp of the previous time series data is 2024-05-01 12:02:00, then the electronic device can determine that 2024-05-01 12:02:00 is later than 2024-05-01 12:01:00. In this case, the electronic device can determine that there is a delay in the current time series data.
[0057] S202: According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data.
[0058] In an optional implementation, after step S202, the electronic device may store a new incremental value (or actual incremental value) corresponding to the previous time series data in association with a timestamp corresponding to the previous time series data and a first counter value corresponding to the previous time series data.
[0059] S203: Determine the incremental value corresponding to the current time series data according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0060] In an optional implementation, after step S203, the electronic device may further store the timestamp, the second counter value, and the increment value corresponding to the current time series data in an associated manner.
[0061] In an embodiment of the present application, when the electronic device detects that there is a delay in the received current time series data, it can determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, thereby being able to quickly repair the order of the current time series data and the previous time series data based on the incremental value corresponding to the current time series data. In this way, on the one hand, when storing data, the reliability of the data storage result can be guaranteed, and on the other hand, compared with the method of ensuring data reliability through the ACK mechanism and the sliding time window technology, there is no need to modify the data sender and the data receiver at the same time, thereby reducing the cost of data repair.
[0062] See also Figure 3 , Figure 3 FIG. 1 is a flow chart of another method for processing time series data provided in an embodiment of the present application. Figure 2 Compared with the time series data processing method shown in Figure 3 The method shown specifically describes how the electronic device corrects the existing incremental value according to the first counter value and the second counter value to obtain the new incremental value corresponding to the previous time series data, and how to determine the incremental value corresponding to the current time series data according to the existing incremental value and the new incremental value corresponding to the previous time series data. Figure 3 As shown, the time series data processing method may include but is not limited to the following steps:
[0063] S301. When current time series data is received, obtain a timestamp corresponding to the current time series data and a timestamp corresponding to the previous time series data of the current time series data.
[0064] In an optional implementation, before step S201, when the electronic device receives the previous time series data of the current time series data, it can associate and store the first counter value corresponding to the previous time series data, the existing increment value corresponding to the previous time series data, and the timestamp corresponding to the previous time series data. In this way, it is beneficial for the electronic device to directly obtain relevant data when it detects that the received current time series data is delayed.
[0065] Exemplarily, the relevant information of the last time series data stored by the electronic device may be as shown in Table 3 below.
[0066] Table 3 Related information table of the previous time series data
[0067]
[0068] S302. When it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, obtain a first counter value corresponding to the previous time series data, an existing increment value corresponding to the previous time series data, and a second counter value corresponding to the current time series data.
[0069] The existing incremental value represents the change in the second counter value of the previous time series data relative to the counter value of the previous time series data.
[0070] Exemplarily, assume that the relevant information of the current timing data received by the electronic device is shown in Table 4 below.
[0071] Table 4. Related information of current time series data
[0072]
[0073] Combining Table 3 and Table 4, the electronic device can determine that t2 (i.e., 2024-05-01 12:02:00) is later than t1 (i.e., 2024-05-01 12:01:00). In this case, the electronic device can obtain the counter value v1 (i.e., 10002) corresponding to the previous time series data, the existing incremental value d11 (i.e., 2) corresponding to the previous time series data, and the counter value v2 (i.e., 10001) corresponding to the current time series data.
[0074] S303: Determine a first difference between the first counter value and the second counter value, and use the first difference to replace the existing increment value to obtain a new increment value corresponding to the previous time series data.
[0075] Exemplarily, continuing with the previous example, the electronic device may first determine that the difference between v1 (i.e., 10002) and v2 (i.e., 10001) is d12 = v1-v2 = 10002-10001 = 1. Then, the electronic device may use d12 (i.e., 1) to replace the existing incremental value d11 (i.e., 2) to obtain a new incremental value (i.e., d12) 1 corresponding to the previous time series data.
[0076] S304: Determine a second difference between the existing incremental value corresponding to the previous time series data and the new incremental value, and use the second difference as the incremental value corresponding to the current time series data.
[0077] Exemplarily, following the previous example, the electronic device may determine the difference between the existing incremental value 2 corresponding to the previous time series data and the new incremental value 1, that is, 2-1=1, and then use 1 as the incremental value corresponding to the current time series data. In other words, the incremental value d2 corresponding to the current time series data in Table 2 is 1.
[0078] In an embodiment of the present application, when the electronic device detects that there is a delay in the received current time series data, it can determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, thereby being able to quickly repair the order of the current time series data and the previous time series data based on the incremental value corresponding to the current time series data. In this way, on the one hand, when storing data, the reliability of the data storage result can be guaranteed, and on the other hand, compared with the method of ensuring data reliability through the ACK mechanism and the sliding time window technology, there is no need to modify the data sender and the data receiver at the same time, thereby reducing the cost of data repair.
[0079] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0080] Based on the same inventive concept, the embodiment of the present application also provides a time series data processing device for implementing the time series data processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more time series data processing device embodiments provided below can refer to the limitations of the time series data processing method above, and will not be repeated here.
[0081] See also Figure 4 , Figure 4 Schematic diagram of a time series data processing device provided in an embodiment of the present application. Figure 4 As shown, the time series data processing device may include but is not limited to: an acquisition module 401, a processing module 402, and a determination module 403. Among them:
[0082] The acquisition module 401 is used to acquire, when it is detected that the received current time series data has a delay, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data; the existing incremental value indicates a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0083] A processing module 402 is used to modify the existing increment value according to the first counter value and the second counter value to obtain a new increment value corresponding to the previous time series data;
[0084] The determination module 403 is used to determine the incremental value corresponding to the current time series data according to the existing incremental value and the new incremental value corresponding to the previous time series data.
[0085] In one embodiment, when the processing module 402 is used to correct the existing incremental value according to the first counter value and the second counter value to obtain a new incremental value corresponding to the previous time series data, it is specifically used to: determine the first difference between the first counter value and the second counter value; use the first difference to replace the existing incremental value to obtain a new incremental value corresponding to the previous time series data.
[0086] In one embodiment, when the determination module 403 is used to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, it is specifically used to: determine the second difference between the existing incremental value and the new incremental value corresponding to the previous time series data; and use the second difference as the incremental value corresponding to the current time series data.
[0087] In one embodiment, the device further includes a storage module. The storage module is used to associate and store the new incremental value with the timestamp and the first counter value corresponding to the previous time series data after the processing module 402 corrects the existing incremental value according to the first counter value and the second counter value to obtain the new incremental value corresponding to the previous time series data.
[0088] In one embodiment, the storage module is also used to associate and store the timestamp, second counter value and incremental value corresponding to the current time series data after the determination module 403 determines the incremental value corresponding to the current time series data based on the existing incremental value and new incremental value corresponding to the previous time series data.
[0089] In one embodiment, the acquisition module 401 is also used to obtain the timestamp corresponding to the current time series data and the timestamp corresponding to the previous time series data when the current time series data is received; the determination module 403 is also used to determine that there is a delay in the current time series data when it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data.
[0090] In an exemplary embodiment, the present application embodiment provides an electronic device, which may be a terminal device, and its internal structure diagram may be as follows: Figure 5 As shown. The electronic device includes a processor, a memory, an input / output interface, a communication interface and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface and the input device are connected to the system bus via the input / output interface. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the electronic device is used to exchange information between the processor and an external device. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, it is implemented Figure 2 or Figure 3 The time series data processing method shown. The display unit of the electronic device is used to form a visually visible picture, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad provided on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0091] Those skilled in the art will understand that Figure 5 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0092] In an exemplary embodiment, the present application provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0093] In the case where a delay is detected in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0094] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0095] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0096] In one embodiment, when a processor executes a computer program to correct an existing incremental value based on a first counter value and a second counter value to obtain a new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining a first difference between the first counter value and the second counter value; and replacing the existing incremental value using the first difference to obtain a new incremental value corresponding to the previous time series data.
[0097] In one embodiment, when a processor executes a computer program to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining the second difference between the existing incremental value and the new incremental value corresponding to the previous time series data; and using the second difference as the incremental value corresponding to the current time series data.
[0098] In one embodiment, the processor executes a computer program to correct the existing incremental value according to the first counter value and the second counter value, and after obtaining the new incremental value corresponding to the previous time series data, further implements the following steps: the new incremental value is associated with the timestamp corresponding to the previous time series data and the first counter value and stored.
[0099] In one embodiment, after the processor executes a computer program to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, it also implements the following steps: the timestamp, the second counter value and the incremental value corresponding to the current time series data are stored in an associated manner.
[0100] In one embodiment, the processor also implements the following steps when executing the computer program: when receiving current time series data, obtaining the timestamp corresponding to the current time series data and the timestamp corresponding to the previous time series data; when determining that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, determining that there is a delay in the current time series data.
[0101] In an exemplary embodiment, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0102] In the case where a delay is detected in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0103] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0104] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0105] In one embodiment, when a computer program is executed by a processor to correct an existing incremental value based on a first counter value and a second counter value to obtain a new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining a first difference between the first counter value and the second counter value; and replacing the existing incremental value using the first difference to obtain a new incremental value corresponding to the previous time series data.
[0106] In one embodiment, when a computer program is executed by a processor to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining the second difference between the existing incremental value and the new incremental value corresponding to the previous time series data; and using the second difference as the incremental value corresponding to the current time series data.
[0107] In one embodiment, a computer program is executed by a processor to correct an existing incremental value according to a first counter value and a second counter value, and after obtaining a new incremental value corresponding to the previous time series data, the following steps are also implemented: the new incremental value is stored in association with the timestamp and the first counter value corresponding to the previous time series data.
[0108] In one embodiment, the computer program is executed by a processor to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, and then implement the following steps: the timestamp, the second counter value and the incremental value corresponding to the current time series data are stored in an associated manner.
[0109] In one embodiment, the computer program executed by the processor also implements the following steps: when current time series data is received, obtain the timestamp corresponding to the current time series data and the timestamp corresponding to the previous time series data; when it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, determine that there is a delay in the current time series data.
[0110] In an exemplary embodiment, the present application provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0111] In the case where a delay is detected in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents a change in the second counter value of the previous time series data relative to the counter value of the previous time series data;
[0112] According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data;
[0113] The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
[0114] In one embodiment, when a computer program is executed by a processor to correct an existing incremental value based on a first counter value and a second counter value to obtain a new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining a first difference between the first counter value and the second counter value; and replacing the existing incremental value using the first difference to obtain a new incremental value corresponding to the previous time series data.
[0115] In one embodiment, when a computer program is executed by a processor to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, the following steps are specifically implemented: determining the second difference between the existing incremental value and the new incremental value corresponding to the previous time series data; and using the second difference as the incremental value corresponding to the current time series data.
[0116] In one embodiment, a computer program is executed by a processor to correct an existing incremental value according to a first counter value and a second counter value, and after obtaining a new incremental value corresponding to the previous time series data, the following steps are also implemented: the new incremental value is stored in association with the timestamp and the first counter value corresponding to the previous time series data.
[0117] In one embodiment, the computer program is executed by a processor to determine the incremental value corresponding to the current time series data based on the existing incremental value and the new incremental value corresponding to the previous time series data, and then implement the following steps: the timestamp, the second counter value and the incremental value corresponding to the current time series data are stored in an associated manner.
[0118] In one embodiment, the computer program executed by the processor also implements the following steps: when current time series data is received, obtain the timestamp corresponding to the current time series data and the timestamp corresponding to the previous time series data; when it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, determine that there is a delay in the current time series data.
[0119] It should be noted that the data involved in this application (including but not limited to the previous time series data, current time series data, etc.) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0120] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0121] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0122] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A time series data processing method, characterized in that: The method comprises: In the case where it is detected that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data are obtained; the existing incremental value represents the amount of change of the second counter value of the previous time series data relative to the counter value of the previous time series data of the previous time series data; According to the first counter value and the second counter value, the existing increment value is corrected to obtain a new increment value corresponding to the previous time series data; The incremental value corresponding to the current time series data is determined according to the existing incremental value corresponding to the previous time series data and the new incremental value.
2. The method according to claim 1, characterized in that The correcting the existing increment value according to the first counter value and the second counter value to obtain a new increment value corresponding to the previous time series data includes: determining a first difference between the first counter value and the second counter value; The existing incremental value is replaced by using the first difference value to obtain a new incremental value corresponding to the previous time series data.
3. The method according to claim 1, characterized in that The determining, according to the existing incremental value and the new incremental value corresponding to the previous time series data, the incremental value corresponding to the current time series data includes: Determine a second difference between the existing incremental value corresponding to the previous time series data and the new incremental value; The second difference is used as the incremental value corresponding to the current time series data.
4. The method according to any one of claims 1 to 3, characterized in that: After the existing increment value is corrected according to the first counter value and the second counter value to obtain a new increment value corresponding to the previous time series data, the method further includes: The new increment value is associated with the timestamp corresponding to the previous time series data and the first counter value and stored.
5. The method according to any one of claims 1 to 3, characterized in that: After determining the incremental value corresponding to the current time series data according to the existing incremental value and the new incremental value corresponding to the previous time series data, the method further includes: The timestamp corresponding to the current time series data, the second counter value, and the increment value are stored in association.
6. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the current time series data is received, obtaining a timestamp corresponding to the current time series data and a timestamp corresponding to the previous time series data; When it is determined that the timestamp corresponding to the current time series data is later than the timestamp corresponding to the previous time series data, it is determined that there is a delay in the current time series data.
7. A time series data processing device, characterized in that: The device comprises: An acquisition module, configured to acquire, when detecting that there is a delay in the received current time series data, a first counter value corresponding to the previous time series data of the current time series data, an existing incremental value corresponding to the previous time series data, and a second counter value corresponding to the current time series data; the existing incremental value represents a change in the second counter value of the previous time series data relative to the counter value of the previous time series data; A processing module, configured to perform correction processing on the existing increment value according to the first counter value and the second counter value, so as to obtain a new increment value corresponding to the previous time series data; A determination module is used to determine the incremental value corresponding to the current time series data according to the existing incremental value corresponding to the previous time series data and the new incremental value.
8. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Time series data storage method and device, computer equipment and storage medium
CN110633277A
Data synchronization method and system
CN112527910A
Out-of-order processing method and device for time series data
CN118227597A
Multivariate network structure anomaly detector
US20200244673A1
