Time series data playback method and device, electronic equipment and storage medium

By dynamically adjusting the cache time window and timestamp update parameters, data breakage and resource occupation caused by fixed-size or fixed-time interval caches are solved, and the consistency, accuracy and efficient resource utilization of time series data playback in steel production scenarios are achieved.

CN119691032APending Publication Date: 2025-03-25CISDI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411741228.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-25

AI Technical Summary

Technical Problem

In the practical application scenarios of steel production, using data blocks of fixed size or fixed time intervals for cache may lead to data breakage and damage the coherence and accuracy of playback. It may also easily lead to excessive occupation or idleness of computing resources, affecting the stable operation and working efficiency of the system.

Method used

In response to the data playback request, the playback time, the playback start time, the playback end time and the cache time window information are obtained, and the cache time window information is set, and the cache time end point is determined based on the cache time window information, and the playback data grabbing step is performed. This step includes obtaining point data based on the start and end points, sorting and updating the timestamp, joining the data playback queue, performing loop until the grabbing is reached to the playback end time, and performing data playback according to the data playback queue.

Benefits of technology

Ensure the consistency and completeness of data playback, avoid information loss or inaccuracy caused by data segmentation, dynamic update of cache time window to adapt to changes in data volume, reduce excessive use or idle resources, improve the system's resource utilization and stability, and support customized playback of multiple data frequencies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691032A_ABST
    Figure CN119691032A_ABST
Patent Text Reader

Abstract

The invention provides a time series data playback method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining playback time, playback starting time and cache time window information, setting a cache time starting point, determining a cache time end point according to the cache time window information, and executing a playback data capturing step. Comprising the following steps: acquiring point location data based on a starting point and an ending point, obtaining a to-be-processed point location data set, sorting the to-be-processed point location data set according to a data acquisition timestamp, updating the timestamp, obtaining a current to-be-played-back data sequence, adding the current to-be-played-back data sequence into a data playback queue, circularly executing a playback data capturing step until the playback ending time is reached, and performing data playback on the current to-be-played-back data sequence. Performing data playback according to the data playback queue; according to the method and the device, the continuity and the integrity of data playback are ensured by dynamically adjusting the data acquisition timestamp, information loss or inaccuracy caused by data segmentation is avoided, then, the change of the data volume can be better adapted by dynamically updating the cache time window, and the resource utilization rate and the stability of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computers, and in particular to a time series data playback method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of information technology, the steel manufacturing industry is gradually transforming towards real-time data collection and analysis that relies on industrial automation equipment to achieve precise control and optimized management of production processes. This transformation requires that industrial control systems must be based on a deep understanding and effective use of massive equipment data to support system development, testing, and tuning. Given that directly using actual equipment for testing in a non-production environment will not only increase costs but may also reduce efficiency, simulation data generation technology has become an indispensable solution. However, due to the complexity and uncertainty of the steel manufacturing environment itself, it is often difficult to fully and accurately reflect the actual production situation by relying solely on simulation data, which brings additional difficulties to the performance evaluation of the system.

[0003] As an effective response strategy, data playback technology can capture and record the actual operating status of production equipment within a specific period of time, and reproduce the production process and various abnormal conditions that may be encountered in accordance with the original time series at different time points or environments. It greatly simplifies the complexity of system testing in the steel industry and improves the accuracy and efficiency of testing. In order to meet the needs of large-scale continuous playback of data, current technical solutions usually use two methods to handle data segmentation and preloading: the first is to cache according to a fixed file block size to ensure that the corresponding amount of data can be read from the storage medium at regular intervals during the playback process; the second is to organize the cache according to a fixed time interval, and extract data fragments of the same length each time the playback is performed.

[0004] However, in the actual application scenarios of steel production, the data from different monitoring points show obvious timing characteristics and frequency differences. Using fixed-size data blocks for caching may cause data discontinuity and destroy the continuity and accuracy of playback. At the same time, considering the cyclical changes in production activities, the amount of data generated within the same time span may vary significantly. Although the caching mechanism based on fixed time intervals can ensure the continuity of the data, it is also easy to cause excessive occupation or idleness of computing resources, which in turn affects the stable operation and work efficiency of the entire system. Summary of the invention

[0005] The purpose of the embodiments of the present invention is to provide a time series data playback method, device, electronic device and storage medium to solve the above technical problems.

[0006] The present invention provides a time series data playback method, the time series data playback method comprising: in response to a data playback request, obtaining playback time, playback start time, playback end time and cache time window information; setting the playback start time as the cache time start time, determining the cache time end time according to the cache time window information, and executing a playback data capture step; the playback data capture step comprises acquiring point data in a target database based on the cache time start time and the cache time end time to obtain a point data set to be processed, the point data comprising a data acquisition timestamp; performing a playback data capture step according to the data acquisition timestamp The point data in the point data set to be processed are sorted to obtain a sequence of playback data to be processed; the timestamp update parameters are determined according to the playback time and the playback start time, and the data acquisition timestamp of each point data in the playback data sequence to be processed is updated to obtain a current sequence of data to be played back, and the current sequence of data to be played back is added to a data playback queue; the cache time end point is determined as a new cache time start point, the cache time end point is determined according to the cache time window information, and the playback data capture step is executed cyclically until the playback end time is captured, and data is played back according to the data playback queue.

[0007] In one embodiment of the present invention, determining the cache time end point based on the cache time window information includes: if it is the first time to capture the playback data, the playback start time is set to the cache time start point, and the cache time end point is calculated using twice the cache time window length in the cache time window information; if it is a subsequent playback data capture, the playback start time is set to the cache time start point, and the cache time end point is calculated using the cache time window length in the cache time window information.

[0008] In one embodiment of the present invention, after adding the current data sequence to be replayed to the data playback queue, the time series data playback method also includes: obtaining the point data volume of the current data sequence to be replayed; if the point data volume of the current data sequence to be replayed does not fall within the preset cache capacity interval, obtaining the point data volume of each historical data sequence to be replayed in the data playback queue, and generating a point data volume sequence based on the point data volume of each historical data sequence to be replayed and the point data volume of the current data sequence to be replayed; determining a time window correction strategy according to the changing trend of the point data volume sequence, and correcting the cache time window duration according to the time window correction strategy, and updating the cache time window information with the corrected cache time window duration.

[0009] In one embodiment of the present invention, determining a time window correction strategy based on a changing trend of the point data volume sequence includes: classifying each point data volume in the point data volume sequence according to a preset data volume classification rule to obtain classification mark information of each point data volume, and sorting the classification mark information corresponding to each point data volume according to the order of the point data volume sequence to obtain a classification mark sequence; correcting the classification mark sequence according to a preset correction rule to obtain a classification mark correction queue, the classification mark correction queue including at least one marking element, and the marking element is used to characterize the classification mark information corresponding to the point data volume; matching the corresponding time window correction strategy in the preset strategy information according to the number and category of the marking elements in the classification mark correction queue, so as to correct the cache time window duration according to the time window correction strategy.

[0010] In one embodiment of the present invention, the classification tag sequence is modified according to a preset modification rule, including: if all tag elements in the classification tag sequence are the same, no modification is made, and the same tag elements include the same element category and element digital tag; if there are tag elements of different categories in the classification tag sequence, when tag elements of different categories appear, all tag elements before the tag elements of different categories are deleted, and the categories of the tag elements include less than the preset cache capacity interval category and more than the preset cache capacity interval category; if all the tag elements in the classification tag sequence are of the same category and the category of the tag element is less than the preset cache capacity interval, then the tag elements of different categories are deleted. If the digital mark of the element presents a non-strictly monotonically decreasing sequence and has no increasing inflection point, no correction is made. If the digital mark of the element presents a monotonically increasing sequence or an increasing inflection point appears after the non-strictly monotonically decreasing sequence, all the marked elements before the increasing element with the digital mark are deleted. If the classified marking sequence contains marked elements of the same category and the category of the marked elements is more than the preset cache capacity interval category, if the digital mark of the element presents a non-strictly monotonically increasing sequence and has no decreasing inflection point, no correction is made. If the digital mark of the element presents a monotonically decreasing sequence or a decreasing inflection point appears after the non-strictly monotonically increasing sequence, all the marked elements before the decreasing element with the digital mark are deleted.

[0011] In one embodiment of the present invention, after data playback is performed according to the data playback queue: if the data volume of the current playback data sent by the data playback queue during data playback exceeds the second preset data volume threshold, the time point is marked as a potential mutation node; the acquisition frequency period of the potential mutation node is calculated based on the current playback data and the records in the first mapping table; if the acquisition frequency period of the potential mutation node is greater than or equal to the preset mutation frequency threshold, the potential mutation node is confirmed to be a mutation node to be processed; the next cache time of the potential mutation node is determined according to the acquisition frequency period of the potential mutation node, and the point identifier of the mutation node to be processed is obtained, and the next cache time and the point identifier of the mutation node to be processed are encapsulated into a mutation target; the mutation object is stored in the mutation information storage area, so that the mutation node to be processed is separately replayed according to the mutation object.

[0012] In one embodiment of the present invention, the mutation information storage area includes a third mapping table, and storing the mutation object in the mutation information storage area to separately replay the mutation node to be processed according to the mutation object includes: storing the mutation objects in the third mapping table respectively; calling the mutation data playback tool to read the mutation node point data and replay it according to the next cache time series of the mutation object in the third mapping table; calculating the new next cache time according to the acquisition frequency period of the mutation object, and updating the third mapping table based on the new next cache time.

[0013] The embodiment of the present invention also provides a time series data playback device, the time series data playback device comprising: a playback information acquisition module, used to respond to a data playback request, obtain playback time, playback start time, cache time window information; a playback data capture module, used to set the playback start time to the cache time starting point, determine the cache time end point according to the cache time window information, and execute the playback data capture step; the playback data capture step comprises acquiring point data in the target database based on the cache time starting point and the cache time end point to obtain a point data set to be processed, the point data comprising a data acquisition timestamp; according to the data acquisition time The time stamp is used to sort the point data in the point data set to be processed to obtain a sequence of playback data to be processed; the timestamp update parameter is determined according to the playback time and the playback start time, and the data acquisition timestamp of each point data in the playback data sequence to be processed is updated to obtain a current sequence of data to be played back, and the current sequence of data to be played back is added to a data playback queue; a queue data playback module is used to determine the end point of the cache time as a new start point of the cache time, determine the end point of the cache time according to the cache time window information, and cyclically execute the playback data capture step until the playback end time is captured, and play back the data according to the data playback queue.

[0014] An embodiment of the present invention also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the timing data playback method as described in any one of the above embodiments.

[0015] An embodiment of the present invention further provides a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the time series data playback method as described in any one of the above embodiments.

[0016] The present invention provides a time series data playback method, device, electronic device and storage medium, which obtains playback time, playback start time, playback end time and cache time window information by responding to a data playback request, sets the cache time start point and determines the cache time end point according to the cache time window information, and executes the playback data capture step, including acquiring point data based on the start point and the end point to obtain a point data set to be processed, sorting the point data set to be processed according to the data acquisition timestamp, and updating the timestamp, obtaining the current data sequence to be played back and adding it to the data playback queue, and cyclically executing the playback data capture step until the playback result is captured. End time, and play back data according to the data playback queue; the application ensures the consistency and integrity of data playback by sorting point data based on timestamps and dynamically adjusting data acquisition timestamps, avoiding information loss or inaccuracy caused by data segmentation, and secondly, by dynamically updating the cache time window and determining the timestamp update parameters according to the playback time and the playback start time, it can better adapt to changes in data volume, reduce excessive occupation or idleness of resources, improve system resource utilization and stability, support customized playback of multiple data frequencies, and can be more widely applied to different types of steel production scenarios, thereby enhancing the practical value of the system.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;

[0020] Figure 2 is a flow chart of a time series data playback method shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a schematic diagram of playback data capture steps shown in an exemplary embodiment of the present application;

[0022] Figure 4 is a schematic diagram of a data playback queue shown in an exemplary embodiment of the present application;

[0023] Figure 5 is a schematic diagram of a time series data playback device shown in an exemplary embodiment of the present application;

[0024] Figure 6 It is a structural diagram of a computer system of an electronic device shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will describe the embodiments of the present invention with reference to the accompanying drawings and specific embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0026] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present invention in a schematic manner, and thus the illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0027] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.

[0028] The "and / or" mentioned in this application describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship.

[0029] Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.

[0030] Reference Figure 1 As shown, the system architecture may include a target database 110 and a computer device 120 . Among them, the computer device 120 obtains the playback time, playback start time, playback end time and cache time window information by responding to the data playback request; sets the playback start time as the cache time start time, determines the cache time end time according to the cache time window information, and executes the playback data capture step; the playback data capture step includes acquiring point data in the target database 110 based on the cache time start time and the cache time end time to obtain a point data set to be processed, and the point data includes a data acquisition timestamp; sorts the point data in the point data set to be processed according to the data acquisition timestamp to obtain a playback data sequence to be processed; determines the timestamp update parameter according to the playback time and the playback start time, and updates the data acquisition timestamp of each point data in the playback data sequence to be processed to obtain the current data sequence to be played back, and adds the current data sequence to be played back to the data playback queue; determines the cache time end time as the new cache time start time, determines the cache time end time according to the cache time window information, and loops to execute the playback data capture step until the playback end time is captured, and plays back the data according to the data playback queue. The above-mentioned computer device 120 can be at least one of a microcomputer, an embedded computer, a network computer, an industrial computer, etc.; the target database 110 is a time series database, including but not limited to IoTDB, InfluxDB and other databases.

[0031] Illustratively, the computer device 120 obtains the playback time, playback start time, playback end time, and cache time window information in response to the data playback request, sets the cache time start point, determines the cache time end point according to the cache time window information, and executes the playback data capture step, including acquiring point data in the target database 110 based on the start point and the end point to obtain a point data set to be processed, sorting the point data set to be processed according to the data acquisition timestamp, and updating the timestamp, obtaining the current data sequence to be played back and adding it to the data playback queue, and looping the playback data capture step until the playback end time is captured. , and replay the data according to the data replay queue; the application ensures the consistency and integrity of data replay by sorting point data based on timestamps and dynamically adjusting data acquisition timestamps, avoiding information loss or inaccuracy caused by data segmentation, and secondly, by dynamically updating the cache time window and determining the timestamp update parameters according to the replay time and the replay start time, it can better adapt to changes in data volume, reduce excessive occupation or idleness of resources, improve the resource utilization and stability of the system, support customized playback of multiple data frequencies, and can be more widely applied to different types of steel production scenarios, thereby enhancing the practical value of the system.

[0032] Figure 2 is a flowchart of a time series data playback method shown in an exemplary embodiment of the present application. The time series data playback method can be Figure 1 The implementation environment may be implemented in other implementation environments, and the above implementation environments are not specifically limited here. Figure 2 As shown, the flowchart of the time series data playback method includes at least steps S210 to S230, which are described in detail as follows:

[0033] In step S210, in response to a data playback request, playback time, playback start time, playback end time, and cache time window information are acquired.

[0034] In one embodiment of the present application, playback time refers to the timestamp used by the system to simulate the actual data acquisition time during the playback process. Specifically, playback time is to convert the original data acquisition time into a new timestamp so that the data can be played according to this new timestamp during the playback process. The cache time window information includes at least the duration parameter of the cache time window, and in some other embodiments, it may also include information such as the update record parameters of the cache time window. The playback start time and the playback end time refer to the time range of the entire data playback process. These two time points are used to define the start and end times of data playback to ensure that the system plays back data within a specified time range. The above data are based on the data playback setting parameters set by relevant technical personnel under the requirements of production plans and maintenance plans, and again do not limit the specific values ​​and sources of the above parameters.

[0035] In step S220, the playback start time is set as the buffer time start time, the buffer time end time is determined according to the buffer time window information, and the playback data capture step is performed.

[0036] In one embodiment of the present application, if the playback data is captured for the first time, the playback start time is set as the cache time start time, and the cache time end time is calculated as twice the cache time window length in the cache time window information; if the playback data is captured subsequently, the playback start time is set as the cache time start time, and the cache time end time is calculated as the cache time window length in the cache time window information. Among them, if the playback data is captured subsequently, the end time point after the last playback data capture is re-determined as the new cache time start time, that is, the end time point after the last playback data capture is determined as the playback start time.

[0037] In the embodiments of the present application, in some subsequent specific embodiments, the above cache time starting point is the time node of target data collection for data capture requirements, which is based on the current cache time node and corresponds to the collection time of the relevant target data in the historical data. The cache time node is the time node from the current loading of data in the time series database to the data playback queue of the playback device or apparatus. It should be noted that the above cache time starting point and cache time node are different time nodes, but there is data correlation between the playback data interval.

[0038] In one embodiment of the present application, the process of replaying the data capture step is shown in Figure 3 , Figure 3 FIG. 1 is a schematic diagram of a playback data capture step shown in an exemplary embodiment of the present application. Figure 3 As shown, the playback data capture step includes at least steps S221 to S223, which are described in detail as follows:

[0039] In step S221, point data is acquired in the target database based on the cache time start point and the cache time end point to obtain a point data set to be processed.

[0040] In one embodiment of the present application, the point data is generated by sensors, PLCs, RFIDs, etc. during the production process, covering various types of data such as equipment operation data, status data, process quality data, energy consumption data, etc., wherein the point is a unique identifier of a certain sensor, PLC, RFID collection point, such as a string ID, and the data can be a basic data type such as a numeric type, a character type, a Boolean type, etc.;

[0041] In this embodiment, the industrial system is responsible for collecting point data, and different points pull point data or receive actively reported data at their own frequencies, where the frequency units can be seconds, minutes, hours and days; the industrial system can be an industrial Internet platform, an industrial data acquisition platform, or other systems with acquisition capabilities; the point data collected by the industrial system is stored in a time series database, where the time series database can be IoTDB, InfluxDB, etc., and the embodiment of the present invention is not limited; the storage content of the point data includes at least: point identification, point data value, and acquisition timestamp, where the acquisition timestamp records the time when the industrial system receives the data; the collected point data includes preprocessing of the point data.

[0042] In a specific embodiment of the present application, the cache time starting point is equal to the time corresponding to the last acquisition timestamp of the cached data that has been read; the cache time end point is equal to the cache time starting point plus the cache time window; the cache time starting point and the cache time end point are used as time range query conditions, and the point data is used as the data item range query condition, and the point data within the cache time window is read from the time series database.

[0043] It should be noted that before playback, you need to determine the playback point set and acquisition time range. The playback time is the local time when playback starts. For example: the playback point set includes: ID1, ID2, ID3, the playback acquisition time range is from "2024.01.01 09:00:00" to "2024.02.01 09:00:00", the playback time is "2024.02.02 10:00:00", and the initial cache time window is 600 seconds; if it is the first time to read point data, before the playback time "2024.02.02 10:00:00", the read point identification range is ID1, ID2, ID3, the acquisition start time is "2024.01.01 09:00:00", that is, the timestamp, 1704042000000, and the end time is "2024.01.01 09:20:00", that is, the timestamp, the point data within the time range of 1704042000000+2*600000=1704043200000, and then set the cache time node equal to "2024.02.02 10:10:00" under the premise that the cache time window remains unchanged. The second data reading, after the cache time node "2024.02.02 10:10:00" arrives, the point identification range read from the time series database is ID1, ID2, ID3, the acquisition start time is "2024.01.01 09:20:00", that is, the timestamp, 1704043200000, the end time is "2024.01.01 09:30:00", that is, the timestamp, 1704042000000+600000=1704043800000, and then the cache time node is set to "2024.02.02 10:20:00". It should be noted that the first cache time node is in the case where the buffer window before the playback time remains unchanged: the nth cache time node is n*cache time window-cache time window.

[0044] In step S222, the point data in the to-be-processed point data set are sorted according to the data acquisition timestamp to obtain a to-be-processed playback data sequence.

[0045] In one embodiment of the present application, before sorting the point data in the to-be-processed point data set according to the data acquisition timestamp, the aforementioned read point data is first parsed, wherein the point data at least includes a point identifier, a point data value, and a data acquisition timestamp.

[0046] In one embodiment of the present application, the point data in the point data set to be processed are sorted according to the data acquisition timestamp. In the specific implementation process, an implementation method of this embodiment includes classifying the read point data according to the data acquisition timestamp, and encapsulating the point data with the same data acquisition timestamp into a data list, wherein the data list can be a data structure expressed in the form of a list such as an array, a linked list, a queue, etc., which is not limited by the embodiment of the present invention.

[0047] The following is an example: In this example, the playback point set includes point IDs ID1, ID2, and ID3. For these points, the system records several data objects, each of which contains at least three attributes: "point ID", "point data value", and "timestamp". The specific data objects are as follows:

[0048] {"Point ID":"ID1","Point data value":1002.32,"Timestamp":"1704042000000"}

[0049] {"Point ID":"ID1","Point data value":1006.12,"Timestamp":"170404201000"}

[0050] {"Point ID":"ID1","Point data value":1005.03,"Timestamp":"1704042002000"}

[0051] {"Point ID":"ID2","Point data value":56,"Timestamp":"1704042002000"}

[0052] {"Point ID":"ID3","Point data value":0,"Timestamp":"1704042001000"}

[0053] {"Point ID":"ID1","Point data value":1,"Timestamp":"1704042002000"}

[0054] The data objects are classified and aggregated according to timestamps. The results are as follows:

[0055] The data list for timestamp "1704042000000" is [{"ID1":1002.32}], the data list for timestamp "1704042001000" is [{"ID1":1006.12},{"ID3":0}], and the data list for timestamp "1704042002000" is [{"ID1":1},{"ID2":56}].

[0056] It should be noted that in the data list with the timestamp "1704042002000", although there are two data records about ID1, in the final aggregated data list, only the data value of the last record is retained, that is, {"ID1":1}. This is because the latter record overwrites the data value of the same point in the previous record.

[0057] In step S223, the timestamp update parameter is determined according to the playback time and the playback start time, and the data acquisition timestamp of each point data in the playback data sequence to be processed is updated to obtain the current data sequence to be played back, and the current data sequence to be played back is added to the data playback queue.

[0058] In one embodiment of the present application, an implementation method of determining the timestamp update parameter according to the playback time and the playback start time includes calculating the actual playback timestamp according to the data acquisition timestamp and the timestamp update parameter, specifically, the timestamp update parameter is equal to the time difference between the playback time and the playback start time, and the timestamp is converted for playback, and the playback data of the corresponding acquisition time can be obtained according to the current time. For example, if the playback time is "2024.02.02 10:00:00" and the playback acquisition start time is "2024.01.01 09:00:00", the playback time difference is calculated to be equal to 2768400 seconds, 1706810400000-1704042000000=2768400000, and the acquisition timestamp "1704042000000" is converted to the actual playback timestamp, that is, "1706810400000".

[0059] In one embodiment of the present application, before adding the current data sequence to be replayed to the data replay queue, the updated data acquisition timestamp of each point data in the current data sequence to be replayed and the encapsulated data list are encapsulated into a data instance, and the data instance is added to the data replay queue in chronological order. The data replay queue is a single-item circular queue connected end to end, which complies with the first-in-first-out rule. Please refer to Figure 4 As shown, Figure 4This is a schematic diagram of a data playback queue shown in an exemplary embodiment of the present application. After encapsulating data instance 1 as {"playbackTime":"1706810400000","data":"[{"ID1":1002.32}]"}, encapsulating data instance 2 as {"playbackTime":"1706810401000","data":"[{"ID1":1006.12},{"ID2":56},{"ID3":0}]"}, and data instance 3 as {"playbackTime":"1706810402000","data":"[{"ID1":1005.03},{"ID3":1}]"}, data instance 1, data instance 2, and data instance 3 are put into the queue from the tail pointer of the queue in sequence. Data instances enter the queue in the order of actual playback timestamps. The data that enters the queue first reaches the playback time first. The empty elements left after the data instance is sent will wait for the data to be played back later to be filled. In this way, a loop space can be used to achieve infinite advancement in the time series.

[0060] In one embodiment of the present application, after adding the current data sequence to be replayed to the data playback queue, the point data volume of the current data sequence to be replayed is obtained. If the point data volume of the current data sequence to be replayed does not fall within the preset cache capacity interval, the cache capacity should include a range interval. For example, if the appropriate capacity to maintain stable operation of the system is 200,000 point data objects, then the cache capacity of the data playback queue can be set to be 90% to 110% of the appropriate capacity of the system, that is, [180000, 220 000], the preset cache capacity interval is the interval of 90% to 110% of the system's suitable capacity, then the point data volume of each historical data sequence to be replayed in the data playback queue is obtained, and a point data volume sequence is generated based on the point data volume of each historical data sequence to be replayed and the point data volume of the current data sequence to be replayed, and the time window correction strategy is determined according to the change trend of the point data volume sequence, and the cache time window duration is corrected according to the time window correction strategy, and the cache time window information is updated with the corrected cache time window duration.

[0061] Specifically, this embodiment provides a method for dynamically adjusting the size of the cache time window during playback. Specifically, the method can intelligently adjust the size of the cache time window based on the relationship between the estimated amount of point data in the next round of cache time window and the set data playback queue cache capacity. When the estimated amount of point data is less than the minimum threshold of the data playback queue cache capacity, the system will increase the length of the cache time window according to a predetermined adjustment strategy to ensure that there is enough data to support the continuity and efficiency of the playback process. Conversely, if the estimated amount of point data exceeds the maximum threshold of the data playback queue cache capacity, the system will reduce the length of the cache time window accordingly to avoid memory overflow or performance degradation caused by excessive data volume. Once the new cache time window size is determined, the setting will automatically take effect at the next cache time node, thereby reading and processing point data that meets the requirements of the new cache time window. This method not only improves the flexibility and response speed of the system, but also effectively optimizes resource utilization.

[0062] In one embodiment of the present application, determining a time window correction strategy based on a changing trend of a point data volume sequence includes classifying each point data volume in the point data volume sequence according to a preset data volume classification rule to obtain classification mark information of each point data volume, and sorting the classification mark information corresponding to each point data volume according to the order of the point data volume sequence to obtain a classification mark sequence; correcting the classification mark sequence according to a preset correction rule to obtain a classification mark correction queue, the classification mark correction queue including at least one marking element, the marking element being used to characterize the classification mark information corresponding to the point data volume; matching the corresponding time window correction strategy in the preset strategy information according to the number and category of the marking elements in the classification mark correction queue to correct the cache time window duration according to the time window correction strategy.

[0063] In a specific embodiment, the marking element consists of an element category and an element digital tag, for example: ti, where t represents the element category, i represents the element digital tag, and the element digital tag of the marking element is used to characterize the size of the trend of the point data volume change.

[0064] In one embodiment of the present application, the classification tag sequence is corrected according to a preset correction rule, including not correcting if all tag elements in the classification tag sequence are the same, and the same tag elements include the same element category and element digital tag; if there are tag elements of different categories in the classification tag sequence, when tag elements of different categories appear, all tag elements before the tag elements of different categories are deleted, and the categories of the tag elements include less than the preset cache capacity interval category and more than the preset cache capacity interval category; if all the tag elements in the classification tag sequence are of the same category and the category of the tag element is less than the preset cache capacity interval, then the tag elements of different categories are deleted. If the digital mark of the element presents a non-strictly monotonically decreasing sequence and has no increasing inflection point, no correction is made. If the digital mark of the element presents a monotonically increasing sequence or an increasing inflection point appears after the non-strictly monotonically decreasing sequence, all the marked elements before the increasing digital mark element are deleted. If the classified marked sequence contains marked elements of the same category and the categories of the marked elements are more than the preset cache capacity interval categories, if the digital mark of the element presents a non-strictly monotonically increasing sequence and has no decreasing inflection point, no correction is made. If the digital mark of the element presents a monotonically decreasing sequence or a decreasing inflection point appears after the non-strictly monotonically increasing sequence, all the marked elements before the decreasing digital mark element are deleted.

[0065] Specifically, in a specific embodiment of the present application, the categories of marking elements are divided into two categories, aiming to accurately identify the point data according to the relationship between the amount of point data and the buffer capacity of the data playback queue.

[0066] For elements whose data volume is less than the data playback queue cache capacity: if the point data volume is less than 50% of the minimum data playback queue cache capacity, the marking element is set to a1; if the point data volume is greater than or equal to 50% of the minimum data playback queue cache capacity, but less than the minimum data playback queue cache capacity, the marking element is set to a2.

[0067] Elements with data volume greater than the data playback queue cache capacity: If the point data volume is greater than 200% of the maximum data playback queue cache capacity, the marking element is set to b2. If the point data volume is less than or equal to 200% of the maximum data playback queue cache capacity, but greater than the maximum data playback queue cache capacity, the marking element is set to b1.

[0068] If all the marking elements in the classification marking sequence are identical, no correction is made. The identical marking elements include identical element categories and element digital markings, including: if the digital markings of the classification marking sequence of all categories A present a non-strictly monotonically decreasing sequence, no correction is made; if the digital markings of the classification marking sequence of all categories B present a non-strictly monotonically increasing sequence, no correction is made.

[0069] If there are different categories of marking elements in the classification marking sequence, when different categories of marking elements appear, all marking elements before the different categories of marking elements are deleted. The categories of the marking elements include categories that are less than the preset cache capacity interval and categories that are more than the preset cache capacity interval. For example, [a1, b1], all marking elements before b1 are deleted and corrected to [b1].

[0070] If all the marked elements in the classified marking sequence are of the same category and the categories of the marked elements are less than the categories of the preset cache capacity interval, no correction is made when the digital mark of the element presents a non-strictly monotonically decreasing sequence and has no increasing inflection point. When the digital mark of the element presents a monotonically increasing sequence or an increasing inflection point appears after the non-strictly monotonically decreasing sequence, all marked elements before the increasing element of the digital mark are deleted; If all the marked elements in the classified marking sequence are of the same category and the categories of the marked elements are more than the categories of the preset cache capacity interval, no correction is made when the digital mark of the element presents a non-strictly monotonically increasing sequence and has no decreasing inflection point. When the digital mark of the element presents a monotonically decreasing sequence or a decreasing inflection point appears after the non-strictly monotonically increasing sequence, all marked elements before the decreasing element of the digital mark are deleted. If the digital marks of the classification mark sequence of all categories a present a monotonically increasing sequence, then delete all elements before the increasing digital mark element, for example, the classification mark sequence [a1, a2], then delete all the mark elements before a2, and the classification mark sequence is corrected to [a2]; if the digital marks of the classification mark sequence of all categories a present an increasing inflection point after a non-strictly monotonically decreasing sequence, then delete all the mark elements before the digital mark inflection point element, for example, the classification mark sequence [a2, a1, a1, a2], then the last a2 is the increasing inflection point of the sequence, then delete all the elements before a2, and the classification mark sequence is corrected to [a2] ; If the digital marks of a classification mark sequence consisting entirely of b categories present a monotonically decreasing sequence, then delete all elements before the decreasing digital mark element. For example, if the classification mark sequence is [b2,b1], then delete all elements before b1 and correct the classification mark sequence to [b1]; If the digital marks of a classification mark sequence consisting entirely of b categories present a decreasing inflection point after a non-strictly monotonically increasing sequence, then delete all elements before the digital mark inflection point element. For example, if the classification mark sequence is [b1,b1,b2,b1], then the last b1 is the decreasing inflection point of the sequence. Then delete all elements before b1 and correct the classification mark sequence to [b1].

[0071] In one embodiment of the present application, the cache time window duration is corrected according to the time window correction strategy, including matching the corresponding time window correction strategy in the preset strategy information according to the number and category of the marked elements in the classification mark correction queue. Specifically, if all element values ​​in the classification mark correction queue are a1 and the number of marked elements is greater than or equal to the preset correction element number threshold, it indicates that the point data volume has been continuously lower than 50% of the minimum cache capacity of the data playback queue. At this time, the cache time window should be significantly increased and adjusted to twice the current cache time window; when all element values ​​in the classification mark correction queue are a2 and the number of marked elements is greater than or equal to the preset correction element number threshold, it indicates that the point data volume has been continuously lower than the minimum cache capacity of the data playback queue. At this time, the cache time window is appropriately increased and adjusted to the current cache time window plus the first adjustment step. The specific value of the first adjustment step can be flexibly set according to the actual application scenario, and this embodiment does not impose specific restrictions on this. When all element values ​​in the classification mark correction queue are of category a, and the digital mark forms a non-strict monotonically decreasing sequence from 2 to 1, it indicates that the amount of point data has been continuously lower than the minimum value of the data playback queue cache capacity, and the amount of data shows a trend of continuous decrease. At this time, the cache time window is further increased and adjusted to the current cache time window plus the second adjustment step. The specific value of the second adjustment step also needs to be determined according to the actual situation. This embodiment does not make specific restrictions on this. The above-mentioned second adjustment step is less than or equal to the first adjustment step. When all element values ​​in the classification mark correction queue are b2 and the number of marked elements is greater than or equal to the preset correction element number threshold, it indicates that the amount of point data has continuously exceeded twice the maximum value of the data playback queue cache capacity. At this time, the cache time window should be significantly reduced and adjusted to half of the current cache time window. When all element values ​​in the classification mark correction queue are b1 and the number of marked elements is greater than or equal to the preset correction element number threshold, it indicates that the amount of point data has continuously exceeded the maximum value of the data playback queue cache capacity. At this time, the cache time window is moderately reduced and adjusted to the current cache time window minus the first adjustment step. When all element values ​​in the classification mark correction queue are of category b, and the digital mark forms a non-strictly monotonically increasing sequence from 1 to 2, it indicates that the amount of point data has continuously exceeded the maximum buffer capacity of the data playback queue, and the amount of data shows a trend of continuous growth. At this time, the buffer time window is further reduced and adjusted to the current buffer time window minus the second adjustment step.

[0072] In one embodiment of the present application, after the cache time window length is corrected according to the time window correction strategy, or the amount of point data is within the data playback queue cache capacity range, all data recorded in the classification mark correction queue should be deleted and the trend should be recalculated.

[0073] In another embodiment, the strategy for correcting the duration of the cache time window may be a historical year-on-year prediction strategy.

[0074] In a specific embodiment, the step of dynamically adjusting the cache time window includes sub-steps 1 to 5, which are specifically described as follows:

[0075] The first sub-step is to record the amount of point data and divide it into data blocks: record the amount of point data read in each cache time window that changes over time, and divide the data blocks in the time series with the minimum value of the cache time window as the granularity, and store them in the historical data list. For example, if the time period for reading data is "2024.02.02 11:00:00" to "2024.02.0211:20:00", the cache time window is 6 minutes, and the minimum value is 2 minutes, then the read data is divided into a data block every 2 minutes, and a total of 5 data blocks are obtained. Assuming that the data volume of each data block is 20,000, 50,000, and 30,000 respectively, then 20,000, 50,000, and 30,000 are recorded in the historical data list in sequence, and each data corresponds to a time period of 2 minutes granularity. Further, before executing the first sub-step, only the data of the most recent day in the historical data list can be retained. For the data before the timestamp after the cache time starting point minus 24 hours, it can be deleted before the data is stored.

[0076] The second sub-step is to calculate the first predicted growth amount: the first predicted growth amount is calculated based on the historical year-on-year data volume of the cache time window. The historical year-on-year data volume refers to the data volume of the same time period of the previous day corresponding to the current cache time window. For example, if the current cache time window is "2024.02.02 11:00:01" to "2024.02.0211:02:00", the historical year-on-year data volume is the sum of the data in the time period from "2024.02.01 11:00:00" to "2024.02.01 11:02:00" in the historical data list. Among them. The first predicted growth amount is defined as the growth ratio of the next cache time window to the current cache time window in terms of the historical year-on-year data volume. For example, if the historical year-on-year data volume corresponding to the current cache time window is y1, and the historical year-on-year data volume corresponding to the next cache time window is y2, then the first predicted growth amount calculation formula is: (y2-y1) / y1. In special cases, if the year-on-year start time or end time is within the minimum granularity time period of the historical data list, the historical year-on-year data volume is equal to the product of the average number per unit time and the proportion of the year-on-year time in the granularity time period. For example, if the cache time window is from 2024.02.02 11:11:01 to 2024.02.02 11:15:00, and the minimum unit time is 1 second, the data in the time period from 2024.02.01 11:10:01 to 2024.02.01 11:12:00 in the historical data list is r1, the data in the time period from 2024.02.01 11:12:01 to 2024.02.01 11:14:00 is r2, and the data in the time period from 2024.02.01 11:14:01 to 2024.02.01 11:16:00 is r3, then the formula for calculating the historical year-on-year data volume is: r1 / 120*60+r2+r3 / 120*60.

[0077] The third sub-step is to calculate the second predicted growth amount: the second predicted growth amount is calculated based on the historical month-on-month data volume and the month-on-month weight of the cache time window. The historical month-on-month data volume refers to the data volume of at least the previous same time period before the current cache time window. For example, if the current cache time window is "2024.02.02 11:00:01" to "2024.02.02 11:02:00", the historical month-on-month data volume is the sum of the data in the time period from "2024.02.0210:58:01" to "2024.02.02 11:00:00" in the historical data list.

[0078] It should be noted that the second predicted growth amount is defined as the weighted sum of the growth ratios of the next cache time window and the current cache time window in at least one historical month-on-month data volume. The month-on-month weight is the weight coefficient corresponding to the growth ratio in the historical month-on-month data volume, and its number is the same as the number of growth ratios in the historical month-on-month data volume. For example, if the historical year-on-year data volume corresponding to the current cache time window is q1, the previous historical year-on-year data volume is q2, the weight is w1, and the previous historical year-on-year data volume is q3, the weight is w2, then the second predicted growth amount calculation formula is: ((q1-q2) / q2)*w1+((q2-q3) / q3)*w2.

[0079] The fourth sub-step is to calculate the predicted data volume: based on the first predicted growth volume and the second predicted growth volume, combined with the first preset weight and the second preset weight, calculate the predicted data volume of the next cache time window. The formula for calculating the predicted data volume is: p1*((y2-y1) / y1)+p2*(((q1-q2) / q2)*w1+((q2-q3) / q3)*w2), where p1 and p2 are the first preset weight and the second preset weight, respectively.

[0080] The fifth sub-step is to adjust the cache time window: according to the predicted data volume of the next cache time window, the cache time window is dynamically adjusted according to the following rules:

[0081] If the predicted data volume is less than 50% of the minimum buffer capacity of the data playback queue, the buffer time window is adjusted to twice the original value.

[0082] If the predicted data volume is less than the minimum value of the data playback queue buffer capacity but not less than 50% thereof, the buffer time window is increased by a first adjustment step.

[0083] If the predicted data volume is greater than 200% of the maximum data playback queue cache capacity, the cache time window is adjusted to half of the original value.

[0084] If the predicted data volume is greater than the maximum buffer capacity of the data playback queue but does not exceed 200% thereof, the buffer time window is reduced by a first adjustment step.

[0085] In step S230, the cache time end is determined as the new cache time start, the cache time end is determined according to the cache time window information, and the playback data capture step is executed in a loop until the playback end time is captured, and data is played back according to the data playback queue.

[0086] When determining the cache time end point according to the cache time window information, if the cache time window remains unchanged, the next cache time node is set to: current cache time node + cache time window. If the cache time window changes, the next cache time node is set to: current cache time node + (cache time window before adjustment * 2 - cache time window after adjustment).

[0087] When data playback is performed according to the data playback queue, the data is played back according to the timer. The timer is a time pusher synchronized with the local time and is triggered based on the minimum acquisition frequency period of the playback point. The timer runs on an independent resource different from the previous steps. It can be a single thread or multiple threads, a single process or multiple processes, and the embodiment of the present invention does not limit it. For example: the minimum acquisition frequency period of the point is set to 1 second, so the timer is triggered once every 1 second. After each trigger, the system compares the actual playback time of the data instance pointed to by the head pointer of the data playback queue with the time when the timer is triggered. If the two match successfully, that is, the actual playback time is equal to the time when the current timer is triggered, indicating that this is the playback time of the data instance. At this time, the system takes out the data instance from the head of the data playback queue, packages it into a test message, and sends it to the industrial system under test to complete the real-time playback of the data instance.

[0088] In order to avoid the situation where the data instance exceeds the playback time but is not sent due to processing delays, when comparing with the timer trigger time, you can take several data instances in queue order for comparison. If the actual playback time of the data instance is less than or equal to the timer trigger time, they are all packaged and sent. Until the actual playback time of the data instance is greater than the timer trigger time, the comparison is stopped.

[0089] In one embodiment of the present application, after data playback is performed according to the data playback queue, if the amount of data of the current playback data sent by the data playback queue during data playback exceeds the second preset data amount threshold, the time point is marked as a potential mutation node, and the acquisition frequency cycle of the potential mutation node is calculated based on the current playback data and the record in the first mapping table. If the acquisition frequency cycle of the potential mutation node is greater than or equal to the preset mutation frequency threshold, the potential mutation node is confirmed to be a mutation node to be processed, and the next cache time of the potential mutation node is determined according to the acquisition frequency cycle of the potential mutation node, and the point identifier of the mutation node to be processed is obtained, and the next cache time and the point identifier of the mutation node to be processed are encapsulated into a mutation target; the mutation object is stored in the mutation information storage area, so as to perform a separate playback of the mutation node to be processed according to the mutation object. Among them, the point identifier and the sampling frequency are encapsulated into a mutation object, put into the mutation object list, which is the mutation object list mapping value, the next cache time is the mapping key of the mutation object list, and the next cache time is calculated as the current playback actual time + acquisition frequency cycle - timestamp update parameter.

[0090] In one embodiment of the present application, the mutation information storage area includes a third mapping table and a second mapping table.

[0091] Among them, the first mapping table is a key-value pair dictionary that records the mutation node information, the mapping key is the actual playback time of the mutation node, and the mapping value is a sample set of the point identifiers of the mutation node; the second mapping table is a key-value pair dictionary that records the mutation nodes that need to be removed when reading cached data, the mapping key is the next cache time of the mutation node, and the mapping value is a list of mutation objects; the third mapping table is a key-value pair dictionary that records the mutation nodes that need to be sent separately, the mapping key is the next cache time of the mutation node, and the mapping value is a list of mutation objects; the mutation objects include a sample set of point identifiers and a collection frequency period of the mutation nodes.

[0092] In one embodiment of the present application, the mutation object is stored in the mutation information storage area, and the mutation node to be processed is played back separately according to the mutation object, including: storing the mutation objects in a third mapping table respectively; calling the mutation data playback tool to read the mutation node point data and play it back according to the next cache time series of the mutation object in the third mapping table; calculating the new next cache time according to the acquisition frequency cycle of the mutation object, and updating the third mapping table based on the new next cache time, wherein the calculation method of the new next cache time is the current next cache time + the acquisition frequency cycle.

[0093] In a specific embodiment of the present application, the time nodes where the amount of point data suddenly increases and exceeds the threshold can also be automatically identified, and the mutation data playback tool can be used to replay the data separately, which is isolated from the main playback tool that performs adaptive adjustment of the cache time window and playback, so as to better utilize and allocate resources. Specifically, the process can be described by the following specific embodiments:

[0094] In this embodiment, the collected point data is first stored in a time series database; the data sources include data generated by sensors, PLCs, RFID and other equipment during the production process. The data types include numeric types (such as temperature), character types (such as status) and Boolean types (such as switch status); each data entry contains a point identifier, data value and collection timestamp, and is stored in a time series database such as IoTDB or InfluxDB. The illustrative example point identifier is Sensor1, the data value is 35.5, and the data collection timestamp is 2024-01-01 09:00:00.

[0095] Next, the main playback tool reads point data from the time series database that are collected within the cache time window according to the cache time node. The cache time node refers to the time point at which the system regularly reads data from the database, and the cache time window is the time range for each data read. For example, if the cache time node is 2024-02-02 10:00:00, the cache time window is 600 seconds (10 minutes), and the reading time range is 2024-02-01 10:00:00 to 2024-02-01 10:10:00.

[0096] Then, the system determines whether there is a mutation node. A mutation node refers to a node whose data volume suddenly increases. The second mapping table records the next cache time of the mutation node. If the next cache time in the second mapping table is included in the current cache time window, proceed to the next step, otherwise skip the mutation processing. For example: the second mapping table is {2024-02-01 10:05:00:[Mutation Object 1], 2024-02-01 10:15:00:[Mutation Object 2]}, and the current cache time window is 2024-02-0110:00:00 to 2024-02-01 10:10:00, where the result is that the next cache time in the second mapping table is included, that is, 2024-02-01 10:05:00, then the mutation node is removed, that is, the next collection time of the mutation node included in the cache time window is removed from the current cache time window. For example, if the current cache time window is from 2024-02-01 10:00:00 to 2024-02-01 10:10:00, then 2024-02-01 10:05:00 is removed, and new cache time windows are obtained as from 2024-02-01 10:00:00 to 2024-02-0110:04:59 and 2024-02-01 10:05:01 to 2024-02-01 10:10:00. Subsequently, the system calculates the new next cache time according to the collection frequency period of the mutation node, and updates the second mapping table. For example, the collection frequency cycle of mutation object 1 is 300 seconds, the current mutation node time is 2024-02-01 10:05:00, the new next cache time is 2024-02-01 10:05:00+300 seconds=2024-02-01 10:10:00, and the second mapping table is updated to {2024-02-01 10:10:00:[mutation object 1], 2024-02-01 10:15:00:[mutation object 2]}.

[0097] The system parses the read point data, classifies them by acquisition timestamp, and converts the acquisition timestamp into the actual playback timestamp. Then, the actual playback timestamp and the corresponding data list are encapsulated into a data instance and put into the data playback queue. And according to the relationship between the number of read points and the cache capacity of the data playback queue, the system dynamically adjusts the cache time window. This step is consistent with the implementation method of S220 to S230 in the above steps, and will not be repeated here.

[0098] After that, the data is played back. The timer is triggered every certain period of time (such as 1 second). When the timer is triggered, the system checks the data instance at the head of the queue. If the timestamp matches the current time, the data instance is sent. For example, if the timer is triggered once a second and the current time is 2024-02-02 10:00:00, the data instance at the head of the queue is: {"playbackTime":"2024-02-02 10:00:00","data":[{"Point Identification":"Sensor1","Data Value":35.5},{"Point Identification":"Sensor2","Data Value":100}]}. If the match is successful, the data instance is sent.

[0099] The system identifies the mutation node and determines whether the number of points sent each time is greater than the second preset data volume threshold. If the second preset data volume threshold is 1000, and the number of points currently sent is 1500, which is greater than the second preset data volume threshold, it is determined to be a potential mutation node, and the acquisition frequency period of the mutation node is calculated according to the records in the first mapping table. For example, if the first mapping table is {2024-02-02 10:00:00:["Sensor1","Sensor2"],2024-02-0210:05:00:["Sensor3","Sensor4"]}, and the currently sent point set is ["Sensor1","Sensor2"], then the actual playback time difference is 2024-02-02 10:05:00-2024-02-02 10:00:00=300 seconds, the collection frequency period of the mutation node is 300 seconds, and the preset mutation frequency threshold is set to 200 seconds. If the collection frequency period of the potential mutation node is greater than or equal to the preset mutation frequency threshold, then the next cache time and the sampling set of the point identifier of the mutation node are encapsulated into a mutation target, stored in the second mapping table and the third mapping table, and the corresponding mutation node record is deleted from the first mapping table. For example, if the mutation object 1 is {"point identification": ["Sensor1", "Sensor2"],"collection frequency cycle": 300 seconds}, and the next cache time is 2024-02-01 10:05:00, the second mapping table is updated to {2024-02-01 10:05:00: [mutation object 1], 2024-02-01 10:15:00: [mutation object 2]}, and the third mapping table is updated to {2024-02-01 10:05:00: [mutation object 1], 2024-02-01 10:15:00: [mutation object 2]}, and the records in the first mapping table are deleted, and the mutation node point data is read from the time series database and replayed according to the next cache time series in the third mapping table. At the same time, according to the collection frequency cycle of the mutation node, the new next cache time is calculated, and the third mapping table is updated. For example, the third mapping table is {2024-02-01 10:05:00:[Mutation Object 1], 2024-02-0110:15:00:[Mutation Object 2]}, the next cache time is 2024-02-01 10:05:00, and the process of modifying the next cache time is 2024-02-01 10:05:00+300 seconds=2024-02-01 10:10:00. Based on this, the third mapping table is updated to {2024-02-01 10:10:00:[Mutation Object 1], 2024-02-01 10:15:00:[Mutation Object 2]}.

[0100] Determine whether the amount of data of the mutation node read each time is greater than the second preset data amount threshold. If the amount of data is less than the second preset data amount threshold, delete the mutation object. For example: the amount of data of the mutation node currently read is 800, and the second preset data amount threshold is 1000. If it is less than the second preset data amount threshold, delete the corresponding mutation object 1 or mutation object 2 {2024-02-01 10:10:00: [Mutation Object 1], 2024-02-01 10:15:00: [Mutation Object 2]}. During the entire playback process, the system continuously updates the next cache time and repeats the above steps until the playback ends.

[0101] The present invention provides a time series data playback method, device, electronic device and storage medium, which obtains playback time, playback start time, playback end time and cache time window information by responding to a data playback request, sets the cache time start point and determines the cache time end point according to the cache time window information, and executes the playback data capture step, including acquiring point data based on the start point and the end point to obtain a point data set to be processed, sorting the point data set to be processed according to the data acquisition timestamp, and updating the timestamp, obtaining the current data sequence to be played back and adding it to the data playback queue, and cyclically executing the playback data capture step until the playback result is captured. End time, and play back data according to the data playback queue; the application ensures the consistency and integrity of data playback by sorting point data based on timestamps and dynamically adjusting data acquisition timestamps, avoiding information loss or inaccuracy caused by data segmentation, and secondly, by dynamically updating the cache time window and determining the timestamp update parameters according to the playback time and the playback start time, it can better adapt to changes in data volume, reduce excessive occupation or idleness of resources, improve system resource utilization and stability, support customized playback of multiple data frequencies, and can be more widely applied to different types of steel production scenarios, thereby enhancing the practical value of the system.

[0102] The following describes an apparatus embodiment of the present application, which can be used to execute the time series data playback method in the above embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above embodiment of the time series data playback method of the present application.

[0103] Figure 5 is a schematic diagram of a time series data playback device shown in an exemplary embodiment of the present application. The device can be applied to Figure 2 The method implementation process shown in the figure can be based on Figure 1 The present invention is executed in the implementation environment shown in the figure, and may also be applicable to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the apparatus is applicable.

[0104] like Figure 5As shown, the exemplary time series data playback device includes: a playback information acquisition module 501, a playback data capture module 502, and a queue data playback module 503.

[0105] The playback information acquisition module 501 is used to respond to the data playback request and obtain the playback time, playback start time, playback end time and cache time window information; the playback data capture module 502 is used to set the playback start time as the cache time start time, determine the cache time end time according to the cache time window information, and execute the playback data capture step; the playback data capture step includes acquiring point data in the target database based on the cache time start time and the cache time end time to obtain a point data set to be processed, the point data includes a data acquisition timestamp; the point data to be processed is captured according to the data acquisition timestamp The concentrated point data are sorted to obtain a sequence of replay data to be processed; the timestamp update parameters are determined according to the replay time and the replay start time, and the data acquisition timestamp of each point data in the replay data sequence to be processed is updated to obtain the current sequence of data to be replayed, and the current sequence of data to be replayed is added to the data replay queue; the queue data replay module 503 is used to determine the end point of the cache time as the new start point of the cache time, determine the end point of the cache time according to the cache time window information, and cyclically execute the replay data capture step until the playback end time is captured, and replay the data according to the data replay queue.

[0106] An embodiment of the present application also provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the timing data playback method provided in the above-mentioned embodiments.

[0107] Figure 6 is a schematic diagram of the structure of a computer system of an electronic device according to an exemplary embodiment of the present application. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0108] like Figure 6As shown, computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in a read-only memory (ROM) 602 or the program loaded from the storage part to a random access memory (RAM) 603, such as the method in the above embodiment. In RAM 603, various programs and data required for system operation are also stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus. Input / output (I / O) interface 605 is also connected to bus 604.

[0109] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0110] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0111] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. Among them, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0113] In the corresponding drawings of the above embodiments, connecting lines may indicate the connection relationship between the various components to indicate more constituent signal paths (constituent_signalpath) and / or one or more ends of some lines may have arrows to indicate the main information flow direction. Connecting lines, as a mark, are not a limitation to the scheme itself, but the use of these lines in combination with one or more exemplary embodiments helps to connect circuits or logic units more easily. Any represented signal (determined by design requirements or preferences) may actually include one or more signals that can be transmitted in either direction and implemented with any appropriate type of signal scheme.

[0114] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.

[0115] Another aspect of the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the above method is implemented. The computer-readable storage medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.

[0116] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0117] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0118] It should be noted that the present application can be used in many general or special computing system environments or configurations, such as personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.

[0119] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0120] It should be understood that the above content of the present application is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application should be the scope of protection required by the claims.

Claims

1. A time series data playback method, characterized in that: The time series data playback method comprises: In response to a data playback request, obtain playback time, playback start time, playback end time, and cache time window information; The playback start time is set as the cache time start time, the cache time end time is determined according to the cache time window information, and the playback data capture step is performed; The playback data capture step includes acquiring point data in the target database based on the cache time start point and the cache time end point to obtain a point data set to be processed, wherein the point data includes a data acquisition timestamp; sorting the point data in the point data set to be processed according to the data acquisition timestamp to obtain a playback data sequence to be processed; determining a timestamp update parameter according to the playback time and the playback start time, and updating the data acquisition timestamp of each point data in the playback data sequence to be processed to obtain a current data sequence to be played back, and adding the current data sequence to be played back to a data playback queue; The cache time end is determined as a new cache time start point, the cache time end is determined according to the cache time window information, and the playback data capture step is executed cyclically until the playback end time is captured, and data is played back according to the data playback queue.

2. The time series data playback method according to claim 1, characterized in that: Determining the cache time end point according to the cache time window information includes: If it is the first time to capture playback data, the playback start time is set as the cache time start time, and the cache time end time is calculated by twice the cache time window length in the cache time window information; If the playback data is captured later, the playback start time is set as the cache time start time, and the cache time end time is calculated using the cache time window length in the cache time window information.

3. The time series data playback method according to claim 1, characterized in that: After adding the current to-be-played data sequence into the data playback queue, the time series data playback method further includes: Get the amount of point data in the current data sequence to be played back; If the point data volume of the current data sequence to be replayed does not fall within the preset cache capacity interval, the point data volume of each historical data sequence to be replayed in the data playback queue is obtained, and a point data volume sequence is generated based on the point data volume of each historical data sequence to be replayed and the point data volume of the current data sequence to be replayed; A time window correction strategy is determined according to a change trend of the point data volume sequence, and the cache time window duration is corrected according to the time window correction strategy, and the cache time window information is updated with the corrected cache time window duration.

4. The time series data playback method according to claim 3, characterized in that: Determining the time window correction strategy according to the change trend of the point data volume sequence includes: Classifying each point data volume in the point data volume sequence according to a preset data volume classification rule to obtain classification mark information of each point data volume, and sorting the classification mark information corresponding to each point data volume according to the order of the point data volume sequence to obtain a classification mark sequence; The classification mark sequence is corrected according to a preset correction rule to obtain a classification mark correction queue, wherein the classification mark correction queue includes at least one mark element, and the mark element is used to represent the classification mark information corresponding to the point data volume; According to the number and category of the marked elements in the classification mark correction queue, the corresponding time window correction strategy is matched in the preset strategy information to correct the cache time window length according to the time window correction strategy.

5. The time series data playback method according to claim 4, characterized in that: Correcting the classification mark sequence according to a preset correction rule includes: If all the marking elements in the classification marking sequence are the same, no correction is made, and the same marking elements include the same element category and element digital marking; If there are different categories of marking elements in the classification marking sequence, when a different category of marking elements appears, all marking elements before the different category of marking elements are deleted, and the categories of the marking elements include less than the preset cache capacity interval category and more than the preset cache capacity interval category; If all the elements in the classification mark sequence are marked with the same category and the category of the marked element is less than the category of the preset cache capacity interval, when the digital mark of the element presents a non-strictly monotonically decreasing sequence and has no increasing inflection point, no correction is made; when the digital mark of the element presents a monotonically increasing sequence or an increasing inflection point appears after the non-strictly monotonically decreasing sequence, all marked elements before the digital mark increasing element are deleted; If the classification mark sequence contains only mark elements of the same category and the categories of the mark elements are more than the preset cache capacity interval categories, no correction will be made when the element digital mark presents a non-strictly monotonically increasing sequence and has no decreasing inflection point; when the element digital mark presents a monotonically decreasing sequence or a decreasing inflection point appears after a non-strictly monotonically increasing sequence, all mark elements before the decreasing element with the digital mark will be deleted.

6. The time series data playback method according to claim 1, characterized in that: After replaying the data according to the data replay queue: If the amount of current playback data sent by the data playback queue exceeds the second preset data amount threshold during data playback, the time point is marked as a potential mutation node; Calculate the acquisition frequency period of the potential mutation node based on the current playback data and the records in the first mapping table; If the acquisition frequency period of the potential mutation node is greater than or equal to the preset mutation frequency threshold, the potential mutation node is confirmed as a mutation node to be processed; Determine the next cache time of the potential mutation node according to the acquisition frequency cycle of the potential mutation node, obtain the point identifier of the mutation node to be processed, and encapsulate the next cache time and the point identifier of the mutation node to be processed into a mutation target; The mutation object is stored in a mutation information storage area, so that the mutation node to be processed is replayed separately according to the mutation object.

7. The time series data playback method according to claim 6, characterized in that: The mutation information storage area includes a third mapping table, and storing the mutation object in the mutation information storage area to individually replay the mutation node to be processed according to the mutation object includes: Storing the mutation objects in a third mapping table respectively; Calling a mutation data playback tool to read the mutation node point data and playback it according to the next cache time sequence of the mutation object in the third mapping table; According to the acquisition frequency period of the mutation object, a new next cache time is calculated, and the third mapping table is updated based on the new next cache time.

8. A time series data playback device, characterized in that: The time series data playback device comprises: A playback information acquisition module, used to obtain playback time, playback start time, playback end time and cache time window information in response to a data playback request; A playback data capture module is used to set the playback start time as the cache time start time, determine the cache time end time according to the cache time window information, and execute the playback data capture step; the playback data capture step includes acquiring point data in the target database based on the cache time start time and the cache time end time to obtain a point data set to be processed, and the point data includes a data acquisition timestamp; sorting the point data in the point data set to be processed according to the data acquisition timestamp to obtain a playback data sequence to be processed; determining a timestamp update parameter according to the playback time and the playback start time, and updating the data acquisition timestamp of each point data in the playback data sequence to be processed to obtain a current data sequence to be played back, and adding the current data sequence to be played back to a data playback queue; The queue data playback module is used to determine the cache time end as the new cache time start, determine the cache time end according to the cache time window information, and loop the playback data capture step until the playback end time is captured, and play back the data according to the data playback queue.

9. An electronic device, characterized in that: It comprises a processor, a memory and a communication bus; the communication bus is used to connect the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the timing data playback method as described in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program is used to enable a computer to execute the time series data playback method as described in any one of claims 1-7.