Time series data stream processing method, and device and storage medium
By constructing a time series wide table, multiple time series data streams are converted into relational data tables, which solves the complexity problem of joint calculation of time series data streams in industrial scenarios, achieves efficient and convenient real-time calculation and data analysis, and reduces the implementation threshold and data Bandwidth requirements.
Patent Information
- Application Number
- PCT/CN2024/071544
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-29
- Filing Date
- 2024-01-10
- Publication Date
- 2024-10-03
AI Technical Summary
In industrial scenarios, joint computing of time series data streams requires writing complex multi-stream connection JOIN query statements, which results in high implementation threshold and low real-time performance and efficiency.
By building a time series wide table, multiple time series data streams are converted into relational data tables, and simple relational query statements are used for real-time calculations, which reduces the complexity and threshold for users to write query logic, and performs real-time data analysis at edge nodes. Reduce upstream data bandwidth.
It realizes convenient joint calculation of multiple time series data streams, improves the convenience and efficiency of real-time calculation, reduces user operation complexity and data processing time, and provides flexibility and high controllability to adapt to different application scenarios.
Smart Images

Figure CN2024071544_03102024_PF_FP_ABST
Abstract
Description
A method, device and storage medium for processing time series data stream
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on March 29, 2023, with application number 202310351536.7 and invention name “A method, device and storage medium for processing time series data streams”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of data processing technology, and in particular to a method, device and storage medium for processing time series data streams. Background Art
[0003] A time series data stream, also known as time series data, is a sequence of data with timestamps. A single data point in this sequence is also called a data point, and a data point is typically a (timestamp, value) pair.
[0004] In industrial scenarios, for refined and automated management, several sensors are usually deployed to monitor various equipment attributes. On this basis, real-time computing systems can be used to perform real-time calculations on the time-series data streams generated in industrial scenarios.
[0005] For example, in some typical application scenarios, it may be necessary to perform joint calculations on the time series data streams generated by multiple device attributes. In this case, users need to write very complex query statements using multi-stream JOINs, which usually requires hundreds of lines of statements to implement joint calculations, making the implementation threshold too high.
[0006] Summary of the Invention
[0007] Various aspects of the present application provide a method, device, and storage medium for processing a time series data stream, so as to more conveniently implement joint calculations on multiple time series data streams.
[0008] An embodiment of the present application provides a method for processing a time series data stream, comprising: obtaining a specified plurality of time series data streams in response to a real-time computing request; constructing a time series wide table for the plurality of time series data streams according to preset construction rules, wherein the time series wide table is a relational data table in which a single data record is used to describe a plurality of data points, and the plurality of data points are located in different time series data streams; and performing a data point query operation on the time series wide table according to the relational query logic contained in the real-time computing request to generate a calculation result corresponding to the real-time computing request.
[0009] An embodiment of the present application also provides a method for processing a wide table, including: obtaining a wide table to be processed; in the wide table to be processed, if it is determined that a target data value under a target data column is a copied data value, creating a first status code for the target data value, otherwise creating a second status code for the target data value; in the wide table to be processed, creating a status column for the target data column, the status column including status codes corresponding to respective data values under the target data column; wherein the target data column is any data column in the wide table to be processed, the first status code is used to represent that the data value identified by it is a copied data value, and the second status code is used to represent that the data value identified by it is not a copied data value.
[0010] An embodiment of the present application also provides a computing device, comprising a memory, a processor, and a communication component; the memory is used to store one or more computer instructions; the processor is coupled to the memory and the communication component, and is used to execute the one or more computer instructions, so as to execute the aforementioned method for processing a time series data stream or the aforementioned method for processing a wide table.
[0011] An embodiment of the present application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed by one or more processors, the one or more processors are caused to execute the aforementioned method for processing a time series data stream or the aforementioned method for processing a wide table.
[0012] It should be noted that the above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The drawings described herein are used to provide further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute improper limitations on the present application.
[0014] FIG1 shows a flow chart of a method for processing a time series data stream provided by an exemplary embodiment of the present application.
[0015] FIG2 shows a logic diagram of a method for processing a time series data stream provided by an exemplary embodiment of the present application.
[0016] FIG3 shows a schematic diagram of a wide table configuration interface provided by an exemplary embodiment of the present application.
[0017] FIG4 shows a method for processing a wide table provided by an exemplary embodiment of the present application.
[0018] FIG5 shows a schematic structural diagram of a computing device provided by another exemplary embodiment of the present application. DETAILED DESCRIPTION
[0019] To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0020] At present, users need to write very complex query statements in the form of multi-stream connection JOIN, which usually requires hundreds of lines of statements to achieve joint calculation, resulting in a high implementation threshold. To this end, in some embodiments of the present application: in response to a real-time calculation request, multiple specified time series data streams can be obtained; according to preset construction rules, a time series wide table is constructed for the multiple time series data streams; according to the query logic contained in the real-time calculation request, a data point query operation is performed on the time series wide table to generate a calculation result corresponding to the real-time calculation request. As a relational data table, a single data record in the time series wide table can be used to describe multiple data points and the multiple data points are located in different time series data streams. In this way, during the real-time calculation process, users no longer need to write complex query statements in the form of multi-stream connection JOIN, but can use simple relational query statements based on this relational data table to achieve joint calculation of multiple time series data streams.
[0021] The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0022] Figure 1 is a flow chart of a method for processing a time series data stream provided by an exemplary embodiment of the present application, and Figure 2 is a logic diagram of a method for processing a time series data stream provided by an exemplary embodiment of the present application. The method can be executed by a data processing device, which can be implemented as software, hardware, or a combination of software and hardware, and can be integrated into a computing device. Referring to Figure 1, the method may include the following steps.
[0023] Step 100: In response to a real-time computing request, obtain a plurality of specified time series data streams.
[0024] Step 101: construct a time series wide table for multiple time series data streams according to preset construction rules. The time series wide table is a relational data table in which a single data record is used to describe multiple data points, and the multiple data points are located in different time series data streams.
[0025] Step 102: Execute a data point query operation on the time series wide table according to the relational query logic included in the real-time computing request to generate a computing result corresponding to the real-time computing request.
[0026] The processing method of the time series data stream provided in this embodiment can be used to perform real-time calculations on the time series data stream, especially to perform joint calculations on multiple time series data streams. Among them, the technical solution provided in this embodiment can be applied to various scenarios that require real-time calculations on time series data streams, such as industrial monitoring, log monitoring, or risk monitoring scenarios. This embodiment does not limit the application scenarios. In different application scenarios, the meanings of the data points contained in the time series data stream are different. For example, in an industrial monitoring scenario, the data points in the time series data stream can be used to represent the monitoring data of industrial equipment at a certain moment. For another example, in a log monitoring scenario, the data points in the time series data stream can be used to represent the operating status data of the monitored application or service at a certain moment, etc. No more examples are given here.
[0027] In actual applications, in the aforementioned industrial monitoring scenarios, the operation of factory workshop equipment will generate a large amount of data. In order to reduce the amount of data uploaded to the cloud or improve the real-time performance of data processing, this embodiment proposes that data analysis and processing can be performed close to the place where the data is generated. To this end, this embodiment proposes that the processing solution for the time series data stream provided by this embodiment can be deployed on the edge node, so that the real-time calculation of the time series data stream can be completed on the edge node, and then the calculation results can be reported to the cloud, which can greatly reduce the uplink data bandwidth requirements. Among them, the edge node is a concept in the edge cloud. The edge node is usually closer to the place where the data is generated, so that the time series data stream can be obtained more efficiently. Of course, in this embodiment, the deployment location for the technical solution provided by this embodiment can be determined according to the actual needs in the application scenario, and this embodiment does not limit the deployment location.
[0028] Referring to Figure 1, in step 100, multiple specified time series data streams can be obtained in response to a real-time calculation request. Among them, the user can specify multiple time series data streams or factory information system (ERP, MES, WMS, MOM, etc.) data according to their own needs. For example, in an industrial monitoring scenario, multiple time series data streams can be time series data streams generated by attribute monitoring of industrial equipment. For example, if the user's own needs are to calculate the qualified rate of products produced by statistical equipment, the user can specify two time series data streams: a qualified product quantity data stream and an unqualified product quantity data stream. The specified multiple time series data streams will be used as the source data for its real-time calculation.
[0029] In one implementation scheme: a wide table configuration interface can be displayed to the user, in which the operation controls corresponding to the time series data streams that the user has permission to use are displayed; in response to the user's selection operation on the operation control, multiple time series data streams specified by the user are determined.
[0030] Figure 3 is a schematic diagram of a wide table configuration interface provided by an exemplary embodiment of the present application. Referring to Figure 3, the wide table configuration interface may include at least a user operation area, and the operation controls corresponding to the time series data streams that the user has the right to use are displayed in the user operation area. As shown in Figure 3, the user interaction UI interface of the operation control can display the name of the time series data stream and provide a checkbox for each. The user's selection operation can be to select the corresponding checkbox, so that one or more time series data streams can be selected. Of course, the wide table configuration interface may also include other areas, such as a time series wide table display area, a query logic editing area, etc. This embodiment does not limit this, and the UI design of the wide table configuration interface can be performed according to actual needs.
[0031] This allows users to easily specify multiple time series data streams, and allows them to flexibly add or remove them as needed. This user-friendly designation mechanism provides users with a highly convenient, flexible, and controllable experience during real-time computing.
[0032] On this basis, referring to Figures 1 and 2, in step 101, a time series wide table can be constructed for multiple time series data streams according to preset construction rules. In this embodiment, various preset construction rules can be supported. In step 101, appropriate construction rules can be flexibly selected. This embodiment does not limit the specific rule content in the construction rules and will not be described in detail here. The exemplary rule content will be explained in subsequent embodiments. In actual applications, multiple construction rules can be provided to users, and users can specify the required construction rules as needed; or appropriate construction rules can be automatically determined according to the application scenario.
[0033] The time series wide table is a new concept proposed in this embodiment. In this embodiment, the time series wide table can be understood as a dynamically changing wide table built based on the time series data stream. A single data record contained in the time series wide table can be used to describe multiple data points. Since the data points in the time series data stream increase over time, new data records will also be continuously generated in the time series wide table.
[0034] Regardless of the construction rule, the common goal is to convert multiple time series data streams into the same relational data table. That is, the time series wide table generated in step 101 is a relational data table, and a single data record in the time series wide table is used to describe multiple data points, and the multiple data points are located in different time series data streams. In this way, from the perspective of the entire time series wide table, the data points of multiple time series data streams are all included in the time series wide table in the form of a relational data structure. This relational data structure can facilitate various joint calculations.
[0035] It can be seen that in this embodiment, a time series wide table can be constructed for multiple specified time series data streams, so that multiple time series data streams can be converted into a relational data table, so that real-time calculations can be performed on the relational data table, thereby effectively improving the convenience of real-time calculations.
[0036] In actual applications, the operation of constructing a time-series wide table can be performed according to a specified time window in step 101. To this end, the data points in multiple time-series data streams that are within the time window can be used as the basis for constructing a time-series wide table, and according to preset construction rules, the data points in the time window are stored in the time-series wide table corresponding to the time window according to a relational data structure. In addition, within a single time window, since the data points in multiple time-series data streams are gradually generated in an incremental manner, data records can also be gradually added to the time-series wide table in an incremental manner within the time window. After the end of a single time window, the construction of the time-series wide table corresponding to the next time window can be started. The time window here can be consistent with the time window required for real-time calculation, of course, it can also be inconsistent, and this embodiment does not limit this.
[0037] As mentioned above, in step 100, the user is supported to flexibly increase or decrease the specified time series data stream as needed. Accordingly, in step 101, when the specified time series data stream increases or decreases, the data points in the time series wide table can be increased or decreased accordingly. Following the wide table configuration interface provided in the previous article, in response to the user's time series data stream deselection operation in the wide table configuration interface (for example, deselecting the selected checkbox), the data points corresponding to the canceled time series data stream can be deleted from the time series wide table; in response to the user's time series data stream addition operation in the wide table configuration interface (for example, selecting the unselected checkbox), the data points in the newly added time series data stream are added to the time series wide table. Here, in the process of deleting the data points corresponding to the canceled time series data stream from the time series wide table, the data column deletion operation can be performed in the time series wide table as needed. For example, when the data column where the canceled time series data stream is located only contains data points of the time series data stream, the data column can be deleted. When adding data points from a newly added time series data stream to a wide time series table, you can perform new data column addition operations in the wide time series table as needed. For example, if the data points of the newly added time series data stream cannot be integrated into any existing data columns, you can add a new data column for the time series data stream in the wide time series table. Otherwise, you can integrate the data points of the time series data stream into the existing data columns.
[0038] As can be seen, in this embodiment, when the user adjusts the specified time series data stream, the structure of the time series wide table can be adaptively and automatically adjusted, so that the adjusted time series data stream can be correctly described according to the relational data structure. This adjustment is transparent to the user and does not require user perception, which greatly reduces the complexity of user operations.
[0039] On this basis, referring to FIG1 and FIG2, in step 102, a data point query operation may be performed on the time series wide table according to the relational query logic contained in the real-time computing request to generate a calculation result corresponding to the real-time computing request.
[0040] In actual applications, during real-time calculations, the multiple time series data streams obtained in step 100 can be stored in the memory of a computing device that executes the time series data stream processing method provided in this embodiment, and the time series wide table constructed in step 101 can also be stored in the memory. In this way, in step 102, the time series wide table can be directly accessed from the memory, thereby efficiently generating the calculation results corresponding to the real-time calculation request.
[0041] As mentioned earlier, wide time series tables are relational data tables. Therefore, users can write query logic using relational query statements, significantly reducing the barrier to entry and complexity when writing query logic. For the same real-time computing requirement, traditional solutions using multi-stream JOINs might require hundreds of lines of statements. However, in this embodiment, based on wide time series tables, users only need to write two or three lines of relational query statements, significantly reducing complexity.
[0042] In this embodiment, the query logic may include but is not limited to arithmetic operations, aggregation operations based on time windows, or aggregation operations based on the number of data records. The types of functions supported by the aggregation operation logic may include but are not limited to max, min, count, avg, stat_if, stattime, statchange, delta, first_value, last_value, stat_failure_time, etc., and these aggregation functions may also be combined with the four arithmetic operations to form aggregation operation logic, such as combinations of max(a)+max(b), max(a)+min(b)+avg(c), etc. The four arithmetic operations may include addition, subtraction, multiplication, and division, etc., and there is no limit on the number of data points used in the size operation logic, and any number of data points can be supported for joint calculation.
[0043] In addition, in this embodiment, the status of the time-series wide table can also be monitored. When an increment occurs in the time-series wide table, a real-time calculation request is triggered to perform incremental calculation. In practical applications, two tasks can be created for the real-time calculation request in step 100: a time-series wide table construction task and a calculation task. Thus, by monitoring the status of the time-series wide table constructed in the time-series wide table construction task, incremental events occurring in the time-series wide table can be identified. The identified incremental events are then notified to the calculation task, which triggers the calculation task to perform incremental calculation via an event trigger. This allows the calculation task to perform cascade calculations after the time-series wide table construction task. In other words, the calculation task can use the time-series wide table generated by the time-series wide table construction task as the basis for calculation analysis. Incremental calculation can refer to real-time calculation based on the incremental time-series wide table. This embodiment allows for flexible setting of incremental calculation rules as needed, which is not limited here. For example, after a time window ends, it can be monitored whether the time-series wide table construction task has received new data points. If so, it is determined that an increment has occurred in the time-series wide table, indicating that the next time window is about to begin, thereby triggering the real-time calculation task for the next time window.
[0044] It can be seen that in this embodiment, by adding a mechanism to capture the change data of the time series wide table, the dynamic variability of the time series wide table can be adapted, and when an increment occurs in the time series wide table, the incremental calculation is triggered in time, thereby effectively improving the computational efficiency of real-time calculation and improving real-time performance.
[0045] In one embodiment, in this embodiment, historical data points in the time series data stream can also be stored. Based on this, this embodiment also proposes a backflow query mechanism:
[0046] In response to a reflow query request, determining a plurality of time series data flows to be reflowed and a historical time period of required reflow;
[0047] Based on the data points of each of the multiple time series data streams to be reflowed in the historical time period, a time series wide table for reflow query is created for the multiple time series data streams to be reflowed;
[0048] According to the query logic in the backflow query request, a data point query operation is performed on the time series wide table used for the backflow query to generate a calculation result corresponding to the backflow query request.
[0049] That is, under the reflux query mechanism, a wide time series table for reflux query can be reconstructed based on the historical data points stored for the time series data stream and according to the required historical time period. In particular, when the query logic is modified, requiring a reflux query, or when a logical error or anomaly in the cascade calculation causes data loss during the abnormal period, and a reflux query is performed for data retrieval, the actual historical data points can be replayed in the manner of a relational data table, thereby achieving efficient and convenient reflux query functionality. The historical data points in the relevant time series data stream can be stored in a time series database, which is not limited in this embodiment.
[0050] Furthermore, in this embodiment, the wide time series table created in step 101 can be sent to an external database for storage. These external databases may include, but are not limited to, the column-based database management system ClickHouse, the relational database management system MySQL, the real-time data warehouse Hologres, or the Oracle database. Alternatively, the wide time series table can be sent to a message queue for storage. These message queues may include, but are not limited to, the MQTT telemetry transport protocol queue or the Kafka queue. The stored wide time series table can serve as the basis for online analytical programs (OLAP), effectively improving OLAP query efficiency.
[0051] In summary, in this embodiment, in response to a real-time computing request, a specified plurality of time series data streams can be obtained; a time series wide table can be constructed for the plurality of time series data streams according to preset construction rules; and a data point query operation is performed on the time series wide table according to the query logic contained in the real-time computing request to generate a calculation result corresponding to the real-time computing request. As a relational data table, a single data record in a time series wide table can be used to describe multiple data points and the multiple data points are located in different time series data streams. In this way, during the real-time computing process, users no longer need to write complex query statements in the manner of multi-stream connection JOIN, but can use simple relational query statements based on this relational data table to realize the joint calculation of multiple time series data streams.
[0052] In the above or following embodiments, it is possible to support the construction of a timing wide table for multiple timing data streams according to various construction rules.
[0053] In one implementation, a single time series data stream is associated with a monitoring object identifier and an attribute identifier. Different time series data streams are associated with different monitoring object identifiers and / or attribute identifiers. Based on this, the attribute identifiers involved in multiple time series data streams can be used as column names; the multiple time series data streams are placed under the corresponding column names to obtain multiple data columns; the combined information formed by the monitoring object identifier and the timestamp is used as the alignment basis to perform data point alignment operations on the multiple time series data streams to obtain multiple data records; based on the multiple data records, a time series wide table is generated.
[0054] In this implementation, identification information of two dimensions, monitoring object identification and attribute identification, is configured for a single time series data stream. The monitoring object identification is used to characterize the monitoring object described by the time series data stream. For example, in an industrial monitoring scenario, the monitoring object identification can be the asset code Assetcode of an industrial equipment, which is used to uniquely identify the industrial equipment. The attribute identification is used to characterize the monitoring indicators described by the time series data stream. For example, in an industrial monitoring scenario, the attribute identification can be the temperature, material quantity or striker frequency of an industrial equipment. For different time series data streams, their associated monitoring object identification and / or attribute identification will be different. For example, different monitoring indicators of the same industrial equipment will correspond to different time series data streams, and the same monitoring indicators of different industrial equipment will also correspond to different time series data streams.
[0055] Based on this, in this implementation, the attribute identifiers involved in multiple time series data streams can be used as column names. There is a special case here: the attribute identifiers of different time series data streams may be the same. In order to deal with this special case, in actual applications, the attribute identifiers involved in multiple time series data streams can be deduplicated, and the retained attribute identifiers can be used as column names. On this basis, multiple time series data streams can be placed under corresponding column names respectively, thereby obtaining multiple data columns. It should be understood that different time series data streams with the same attribute identifier will be placed under the same column name, thereby converging into the same data column. At this point, the arrangement of time series data streams can be completed from the perspective of columns.
[0056] In this implementation, the combined information formed by the monitoring object identifier and the timestamp can also be used as the basis for alignment, and data point alignment operations can be performed on multiple time series data streams to obtain multiple data records. Here, the data points in each time series data stream are arranged from the perspective of the row. Among them, the alignment operation refers to placing the data points corresponding to the same monitoring object identifier and timestamp in the same data row. It is worth noting that the data points are divided into rows from the two dimensions of monitoring object identifier and timestamp, which can ensure that the data points corresponding to different monitoring objects are scattered in different data rows, and the data points with different timestamps are scattered in different data rows. In practical applications, this alignment method can better support various joint computing logics.
[0057] For example, the timing data stream used to describe the number of qualified products of device EL_C1 is [(2022-12-13 16:32:01, 10)…], the timing data stream used to describe the number of qualified products of device EL_C2 is [(2022-12-13 16:32:02, 20)…], the timing data stream used to describe the number of unqualified products of device EL_C1 is [(2022- 12-13 16:32:01, 5)…], and the timing data stream used to describe the number of qualified products of device EL_C2 is [(2022-12-13 16:32:02, 3)…], then the timing width table constructed according to the above implementation method is as shown in Table 1 below.
[0058] During the research process, the inventors found that different time series data streams do not necessarily generate data points at the same sampling frequency as in the previous example. This results in some data records having missing data values under certain column names when performing data point alignment operations.
[0059] To this end, in one example, a wide table to be processed can be generated based on multiple data records; if the target data record contained in the wide table to be processed is missing a data value under the target column name, the time series data stream to be queried is determined based on the attribute identifier corresponding to the target column name and the monitoring object identifier corresponding to the target data record; the data value of the target data point in the time series data stream to be queried that is before the target timestamp corresponding to the target data record and closest to the target timestamp is copied to the target column name in the target data record; and a time series wide table is generated based on each data record after the data value is filled in.
[0060] For example, if the timing data stream used to describe the number of unqualified products of device EL_C1 in the above example is [(2022-12-13 16:32:08, 5)…], and the timing data stream used to describe the number of qualified products of device EL_C2 is [(2022-12-13 16:32:09, 3)…], the generated timing width table to be processed is Table 2 shown below.
[0061] It can be found that some data values are missing in the time series wide table to be processed. According to the above priority scheme, for the missing data value X, the time series data stream to be queried can be determined to be the aforementioned [(2022-12-13 16:32:01, 10)…] based on the monitoring object identifier EL_C1 and the attribute identifier EgoodCount. Therefore, the target data point (2022-12-13 16:32:01, 10) that is before the timestamp 2022-12-13 16:32:08 and closest to the timestamp can be found in the time series data stream. Therefore, the data value 10 in the target data point can be copied to X. Similarly, the data values at other missing data locations can be determined. After filling in the data values, the generated time series wide table will be as shown in Table 3 below.
[0062] In the case where there is no previous timestamp, the data value 0 can be directly added to the missing position of the corresponding data value.
[0063] As shown in the above example, the data value completion mechanism implemented in the above priority solution ensures that no missing data values exist in any data record in the wide time series table. This ensures that each data record fully describes the data point corresponding to each column name in the wide time series table. This makes the constructed wide time series table more conducive to performing aggregation calculations on multiple data points based on the data record dimension.
[0064] Based on this, if the query logic instructs to query one or more data records in a wide time series table, a joint calculation can be performed based on the multiple data points described by the queried data records. Because the queried data records contain complete data points, the joint calculation can be completed using only the queried data records, eliminating the need to query other data records in the wide time series table due to missing data values. This effectively improves the efficiency of the joint calculation of multiple data points and reduces complexity.
[0065] It is worth noting that the above-mentioned implementation methods and the priority schemes provided in the implementation methods are all exemplary. In this embodiment, other implementation methods can also be used to realize the construction of a wide time series table, that is, the preset construction rules are not limited to this. For example, in a joint calculation scenario where multiple time series data streams are calculated without distinguishing between monitoring objects, a construction rule adapted to the scenario can be provided. In this construction rule, attention is no longer paid to the monitoring object identifier, but only to the attribute identifier associated with different time series data streams. When only data point alignment operations are required, only the attribute identifier can be used as the basis for alignment. Of course, in other construction rules, more dimensions of attention can be added, and data point alignment operations can be performed according to finer-grained alignment bases, etc., which are not exhaustively listed here.
[0066] It can be seen that in this embodiment, there may be copied data values in the time-series wide table constructed for multiple time-series data streams. In this regard, in a possible implementation, it is also proposed that: in the time-series wide table, if it is determined that the target data value under the target data column is a copied data value, a first status code is created for the target data value, otherwise a second status code is created for the target data value; in the time-series wide table, a status column is created for the target data column, and the status column contains the status code corresponding to each data value under the target data column; wherein the target data column is any data column in the time-series wide table, the first status code is used to indicate that the data value it identifies is a copied data value, and the second status code is used to indicate that the data value it identifies is not a copied data value.
[0067] According to Table 3 in the aforementioned example, it can be found that in the data column "Number of qualified products EGoodCount", the data points (2022-12-13 16:32:01, 10) and the data point [(2022-12-13 16:32:02, 20) are described repeatedly. This repeated description is caused by the aforementioned filling operation on the missing data values. This repeated description may cause errors when performing aggregate calculations at the data column level. In this embodiment, an innovative technical concept of adding a status column to the time series wide table is proposed. The status column can accurately describe whether each data value in each data column is copied. This description can provide guidance for aggregate calculations at the data column level, thereby avoiding calculation errors.
[0068] In one example, the aforementioned first state code may be 1, and the second state code may be 0. Based on this, the timing width table after adding a state column will be Table 4 shown below.
[0069] It is worth noting that, in this embodiment, there is no restriction on the arrangement order of the data columns in the time series wide table, and other data columns except the data columns corresponding to the attribute identifiers can be flexibly added and deleted. For example, the data columns corresponding to the monitoring object identifiers in Table 4 can be placed in a separate data table, and the codes configured for the relevant monitoring object identifiers in the separate data table are used in the time series wide table, such as 1, 2, etc.
[0070] Based on this, if the query logic instructs to query one or more data columns in a wide time series table, the data points in the queried data column are filtered based on the status column corresponding to the queried data column; the data point query operation is then performed on the filtered queried data column. Referring to Table 4, the query logic can specify that only data values corresponding to the first status code in the data column be retained, while filtering out data values corresponding to the second status code. The data point query operation can then be performed on the filtered data column.
[0071] An exemplary query statement may be as follows.
[0072] "sum(case when C_EGoodCount=1 ------When the status code is 1
[0073] Then EGoodCount ------ retain data value
[0074] else 0 end) ------When the status code is 0, filter
[0075] +sum(case when C_EBadCount=1
[0076] then EBadCount
[0077] else 0 end)".
[0078] The above exemplary query statement is used to sum the two data columns in Table 4, respectively, and then sum the two sums. It can be understood that in the above exemplary query statement, by limiting the status code, the two data columns are filtered, so that the correct summation result can be obtained.
[0079] Based on this, in this embodiment, data points in multiple time series data streams can be arranged along both column and row dimensions. This allows multiple time series streams to be stored in a wide time series table according to a relational data structure, providing a convenient query foundation for joint computations. Furthermore, a status column can be added to the wide time series table to describe whether each data value in each data column is copied. This facilitates fast and accurate data filtering during aggregate computations on the data columns, ensuring the accuracy of the aggregate computations.
[0080] FIG4 is a method for processing a wide table provided by an exemplary embodiment of the present application. Referring to FIG4 , the method may include: step 400, obtaining a wide table to be processed; step 401, in the wide table to be processed, if it is determined that the target data value under the target data column is a copied data value, then creating a first status code for the target data value, otherwise creating a second status code for the target data value; step 402, in the wide table to be processed, creating a status column for the target data column, the status column containing status codes corresponding to each data value under the target data column; wherein the target data column is any data column in the wide table to be processed, the first status code is used to indicate that the data value identified by it is a copied data value, and the second status code is used to indicate that the data value identified by it is not a copied data value.
[0081] Among them, the wide table to be processed in this embodiment can be the time series wide table constructed for multiple time series data streams in the aforementioned embodiment, or it can be a static wide table in the database. The static wide table in the database may also have the problem of repeated recording of the same data point.
[0082] In one embodiment, if the query logic indicates to query one or more data columns in the time series wide table, data points of the queried data columns are filtered according to the status columns corresponding to the queried data columns; and a data point query operation is performed on the filtered queried data columns.
[0083] It is worth noting that the technical details in the above-mentioned embodiments of the wide table processing method can be referred to the relevant description in the above-mentioned embodiment of the timing data stream processing method. In order to save space, they will not be repeated here, but this should not cause a loss of the protection scope of this application.
[0084] It should be noted that in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or may be executed in parallel. The sequence numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the sequence numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that descriptions such as "first" and "second" in this article are used to distinguish different status codes, etc., and do not represent the order of precedence, nor do they limit "first" and "second" to be different types.
[0085] FIG5 is a schematic diagram of a computing device according to another exemplary embodiment of the present invention. As shown in FIG5 , the computing device includes a memory 50 and a processor 51 .
[0086] Based on the computing device provided in Figure 5, in some possible design schemes, the processor 51 is coupled to the memory 50 and is used to execute the computer program in the memory 50, so as to: obtain a specified plurality of time series data streams in response to a real-time computing request; construct a time series wide table for the plurality of time series data streams according to preset construction rules, wherein the time series wide table is a relational data table and a single data record therein is used to describe a plurality of data points, and the plurality of data points are located in different time series data streams; perform a data point query operation on the time series wide table according to the query logic contained in the real-time computing request to generate a calculation result corresponding to the real-time computing request.
[0087] In one embodiment, a single time series data stream is associated with a monitoring object identifier and an attribute identifier, and different time series data streams are associated with different monitoring object identifiers and / or attribute identifiers. When the processor 51 constructs a time series wide table for multiple time series data streams, it can be used to: use the attribute identifiers involved in the multiple time series data streams as column names; place the multiple time series data streams under the corresponding column names to obtain multiple data columns; use the combined information formed by the monitoring object identifier and the timestamp as the alignment basis to perform data point alignment operations on the multiple time series data streams to obtain multiple data records; and generate a time series wide table based on the multiple data records.
[0088] In one embodiment, when the processor 51 generates a time series wide table based on multiple data records, it can be used to: generate a wide table to be processed based on multiple data records; if the target data record contained in the wide table to be processed has a missing data value under the target column name, determine the time series data stream to be queried based on the attribute identifier corresponding to the target column name and the monitoring object identifier corresponding to the target data record; copy the data value of the target data point in the time series data stream to be queried that is before the target timestamp corresponding to the target data record and is closest to the target timestamp to the target column name in the target data record; generate a time series wide table based on each data record after the data value is filled in.
[0089] In one embodiment, the processor 51 can also be used to: in the time series wide table, if it is determined that the target data value under the target data column is a copied data value, then create a first status code for the target data value, otherwise create a second status code for the target data value; in the time series wide table, create a status column for the target data column, the status column containing status codes corresponding to each data value under the target data column; wherein the target data column is any data column in the time series wide table, the first status code is used to represent that the data value it identifies is a copied data value, and the second status code is used to represent that the data value it identifies is not a copied data value.
[0090] In one embodiment, when the processor 51 performs a data point query operation on a time-series wide table according to the query logic contained in a real-time computing request, it can be used to: if the query logic indicates to query one or more data columns in the time-series wide table, filter the data points of the queried data column according to the status column corresponding to the queried data column; and perform a data point query operation on the filtered queried data column.
[0091] In one embodiment, when the processor 51 performs a data point query operation on a time-series wide table according to the query logic contained in the real-time computing request, it can be used to: if the query logic indicates to query one or more data records in the time-series wide table, then perform a joint calculation based on multiple data points described by the queried data records.
[0092] In one embodiment, when the processor 51 obtains multiple specified time series data streams in response to a real-time computing request, it can be used to: display a wide table configuration interface to the user, in which the operation controls corresponding to each time series data stream that the user has permission to use are displayed; and determine the multiple time series data streams specified by the user in response to the user's selection operation on the operation control.
[0093] In one embodiment, the processor 51 can also be used to: in response to the user's cancellation operation of the timing data stream in the wide table configuration interface, delete the data points corresponding to the canceled timing data stream from the timing wide table; in response to the user's addition operation of the timing data stream in the wide table configuration interface, add the data points in the newly added timing data stream to the timing wide table.
[0094] In one embodiment, the processor 51 may be further configured to: trigger a real-time calculation request to perform incremental calculation when an increment occurs in the time series width table.
[0095] In one embodiment, the processor 51 may also be used to: determine, in response to a reflow query request, multiple time series data streams to be reflowed and the historical time period of the required reflow; create a time series wide table for reflow query for the multiple time series data streams to be reflowed based on the data points of each of the multiple time series data streams to be reflowed in the historical time period; and perform a data point query operation on the time series wide table for reflow query according to the query logic in the reflow query request to generate a calculation result corresponding to the reflow query request.
[0096] In one embodiment, the multiple time series data streams are time series data streams generated by attribute monitoring of industrial equipment; the query logic includes one or more of four arithmetic operations logic, aggregation operation logic based on time windows, or aggregation operation logic based on the number of data records.
[0097] Based on the computing device provided in Figure 5, in other possible design schemes, the processor 51 is coupled to the memory 50 and is used to execute the computer program in the memory 50, so as to: obtain the wide table to be processed; in the wide table to be processed, if it is determined that the target data value under the target data column is a copied data value, then create a first status code for the target data value, otherwise create a second status code for the target data value; in the wide table to be processed, create a status column for the target data column, the status column including status codes corresponding to each data value under the target data column; wherein the target data column is any data column in the wide table to be processed, the first status code is used to represent that the data value identified by it is a copied data value, and the second status code is used to represent that the data value identified by it is not a copied data value.
[0098] In one embodiment, as shown in Figure 5 , the computing device further includes other components such as a communication component 52 and a power supply component 53. Figure 5 only schematically illustrates some components, which does not mean that the computing device only includes the components shown in Figure 5 .
[0099] It is worth noting that the technical details in the above-mentioned embodiments of the computing device can refer to the relevant description of the second type of application end in the aforementioned system embodiment. In order to save space, they will not be repeated here, but this should not cause any loss of the scope of protection of this application.
[0100] , an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which can implement each step in the above method embodiment when executed.
[0101] The memory in Figure 5 is used to store computer programs and can be configured to store various other data to support operations on the computing platform. Examples of such data include instructions for any application or method operating on the computing platform, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0102] The communication component in Figure 5 above is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0103] The power supply assembly in Figure 5 provides power to various components of the device in which the power supply assembly is located. The power supply assembly may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which the power supply assembly is located.
[0104] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0105] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0106] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0108] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0109] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0110] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.
[0111] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0112] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0113] The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included in the protection scope of the present application.
Claims
1. A method for processing a time series data stream, comprising: In response to a real-time computing request, obtaining a specified plurality of time series data streams; According to a preset construction rule, a time series wide table is constructed for the multiple time series data streams, wherein the time series wide table is a relational data table and a single data record therein is used to describe multiple data points, and the multiple data points are located in different time series data streams; According to the relational query logic included in the real-time computing request, a data point query operation is performed on the time series wide table to generate a calculation result corresponding to the real-time computing request.
2. According to the method of claim 1, a single time series data stream is associated with a monitoring object identifier and an attribute identifier, and different time series data streams are associated with different monitoring object identifiers and / or attribute identifiers, and a time series wide table is constructed for the multiple time series data streams, comprising: Using the attribute identifiers involved in the multiple time series data streams as column names; Placing the multiple time series data streams under corresponding column names respectively to obtain multiple data columns; Using the combined information formed by the monitoring object identifier and the timestamp as the alignment basis, performing a data point alignment operation on the multiple time series data streams to obtain multiple data records; The time series width table is generated based on the plurality of data records.
3. The method according to claim 2, generating the time series width table based on the plurality of data records, comprising: Generate a wide table to be processed according to the multiple data records; If the target data record contained in the to-be-processed wide table has a missing data value under the target column name, determining the time series data stream to be queried according to the attribute identifier corresponding to the target column name and the monitoring object identifier corresponding to the target data record; Copy the data value of the target data point in the time series data stream to be queried that is before the target timestamp corresponding to the target data record and closest to the target timestamp to the target column name in the target data record; The time series width table is generated according to each data record after the data value is padded.
4. The method according to claim 1 or 3, further comprising: In the time series width table, if it is determined that the target data value under the target data column is a copied data value, a first status code is created for the target data value, otherwise a second status code is created for the target data value; In the time series width table, a state column is created for the target data column, wherein the state column contains state codes corresponding to respective data values under the target data column; The target data column is any data column in the time series width table, the first status code is used to indicate that the data value identified by it is a copied data value, and the second status code is used to indicate that the data value identified by it is not a copied data value.
5. The method according to claim 4, performing a data point query operation on the time series wide table according to the query logic contained in the real-time computing request, comprising: If the query logic indicates to query one or more data columns in the time series wide table, filtering data points of the queried data columns according to the status columns corresponding to the queried data columns; The data point query operation is performed on the filtered queried data column.
6. The method according to any one of claims 1 to 5, performing a data point query operation on the time series wide table according to the query logic contained in the real-time computing request, comprising: If the query logic indicates to query one or more data records in the time series wide table, then based on the queried data Multiple data points described by the record are calculated jointly.
7. The method according to claim 1, in response to a real-time computing request, obtaining a plurality of specified time series data streams, comprising: Displaying a wide table configuration interface to the user, wherein the wide table configuration interface displays operation controls corresponding to the time series data streams that the user has permission to use; In response to a selection operation performed by the user on an operation control, a plurality of time series data flows specified by the user are determined.
8. The method according to claim 7, further comprising: In response to the user canceling a selection operation of a time series data stream in the wide table configuration interface, deleting data points corresponding to the canceled time series data stream from the time series wide table; In response to the user's adding operation of a time series data stream in the wide table configuration interface, data points in the newly added time series data stream are added to the time series wide table.
9. The method according to claim 1, further comprising: When an increment occurs in the timing width table, the real-time calculation request is triggered to perform the incremental calculation.
10. The method according to claim 1, further comprising: In response to the reflow query request, determine a plurality of time series data flows to be reflowed and a historical time period of the required reflow; Creating a time series wide table for reflow query for the multiple time series data flows to be reflowed according to the data points of each of the multiple time series data flows to be reflowed in the historical time period; According to the query logic in the backflow query request, a data point query operation is performed on the time-series wide table used for backflow query to generate a calculation result corresponding to the backflow query request.
11. According to the method of claim 1, the multiple time series data streams are time series data streams generated by attribute monitoring of industrial equipment; the query logic includes one or more of four arithmetic operation logic, aggregation operation logic based on time window or aggregation operation logic based on the number of data records.
12. A method for processing a wide table, comprising: Get the wide table to be processed; In the to-be-processed wide table, if it is determined that the target data value under the target data column is a copied data value, a first status code is created for the target data value; otherwise, a second status code is created for the target data value; In the to-be-processed wide table, a status column is created for the target data column, wherein the status column contains status codes corresponding to respective data values under the target data column; The target data column is any data column in the wide table to be processed, the first status code is used to indicate that the data value identified by it is a copied data value, and the second status code is used to indicate that the data value identified by it is not a copied data value.
13. A computing device comprising a memory, a processor, and a communication component; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component, and is used to execute the one or more computer instructions to execute the method for processing a time series data stream as described in any one of claims 1 to 11 or the method for processing a wide table as described in claim 12.
14. A computer-readable storage medium storing computer instructions, which, when executed by one or more processors, causes the one or more processors to execute the method for processing a time series data stream as described in any one of claims 1 to 11 or the method for processing a wide table as described in claim 12.
Citation Information
Patent Citations
Automated analysis system for modeling online business behavior and detecting outliers
CN104285212A
High-efficiency industrial big data multidimensional analysis method
CN107016501A
Radar fault prediction method and device and storage medium
CN112488142A
Time series data stream processing method and device and storage medium
CN116450685A
System That Reconfigures Usage of a Storage Device and Method Thereof
US20160173122A1
Cited By
Data materialization method and device, computer equipment and storage medium
CN120448375A
Time sequence feature calculation method and system, computer equipment and readable storage medium
CN121188077A
Production data storage method and system and electronic equipment
CN122633737A
