A sliding substructure aggregation method and device based on natural time

Through the natural time-based sliding substructure aggregation method, the flexibility and accuracy issues of substructure definition and aggregation in streaming data processing are solved, and efficient data management and query optimization are achieved.

CN116450683BActive Publication Date: 2025-09-30ZHEJIANG BANGSUN TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310306243.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-27
Publication Date
2025-09-30
Estimated Expiration
2043-03-27

AI Technical Summary

Technical Problem

Existing streaming data processing technologies cannot simultaneously meet the precise definition of the minimum granularity substructure and effective aggregation methods, resulting in inaccurate data or data containing multiple months during queries.

Method used

A sliding substructure aggregation method based on natural time is provided, which allows users to customize the time span and sliding span of the substructure, and aggregates fine-grained substructures into coarse-grained substructures through aggregation algorithms, supporting flexible time unit definition and efficient data management.

Benefits of technology

It achieves flexible customization of substructure time span, improves the accuracy and efficiency of data query, reduces the difficulty of system storage management, supports storage optimization of data of different granularities, and the algorithm performs well in single and multi-query environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450683B_ABST
    Figure CN116450683B_ABST
Patent Text Reader

Abstract

The present invention discloses a sliding substructure aggregation method and device based on natural time. Natural time refers to the units commonly used to measure time, including minutes, hours, days, weeks, months and years. Users can choose the natural time units to use. The desired substructure results can be obtained by combining the sliding substructure results of different natural time units. The sliding substructure aggregation method based on natural time is mainly divided into five parts: definition of sliding substructure, creation of sliding substructure, management of sliding substructure, aggregation of sliding substructure and query of sliding substructure. The method proposed in the present invention can obtain the time substructure result of another natural time unit by calculating the sliding substructure, so it can ensure that more accurate data can be saved while still returning results in milliseconds, saving a lot of storage space and speeding up the query speed of large time spans.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of streaming big data processing, and in particular to a sliding substructure aggregation method and device based on natural time. Background Art

[0002] In actual data processing, much of the data processed is presented as real-time data streams, but existing technologies are unable to process data streams in strict real-time. Therefore, it is generally necessary to structure streaming data into time substructures based on its time structure to facilitate processing. For example, in the marketing field, users' spending habits can be analyzed based on their transactions within a month or week. In the risk control field, whether an account is at risk can be determined by whether it has abnormal behavior within a certain period of time. In the field of network security, the number of times a user is accessed within a minute or hour can be used to determine whether the user is likely to be under attack.

[0003] Currently, there are three types of structured processing for streaming data:

[0004] 1) Fixed substructure: A fixed substructure divides time into segments of fixed length, and there is no overlapping between substructures.

[0005] 2) Sliding substructure: A sliding substructure is a generalization of a fixed substructure. It is determined by the time span of the substructure and the sliding time span. If the sliding span is smaller than the original time span, the substructures will overlap.

[0006] The optimal substructure and fixed substructure of natural time are both processing technologies with fixed time spans, but the substructure based on natural time can aggregate natural time substructures with longer time spans based on existing substructures. For example, there is an application scenario that requires calculating a user's consumption over a period of time, where the period can be as long as a year or as short as a month. Therefore, to ensure the accuracy of user queries, the system needs to save substructures with time precision less than or equal to a natural month, and then reassemble the natural day substructures into substructures with larger time spans based on user needs. The usual processing method is to directly save the substructure with the smallest granularity to be queried. That is, if the smallest granularity the user wants to query is a natural month, then save the substructure of the natural month.

[0007] However, this approach presents some issues. Considering the aforementioned scenario, if a query in December about a user's spending in November is performed, the result may be data covering exactly thirty days from the beginning to the end of November. This presents several challenges. First, some months, such as February, may not have exactly thirty days. Second, the user may want to retrieve data from the current date to the previous month, which may include some data from both November and December. Therefore, simply preserving the required minimum-granularity substructure cannot meet business requirements. In summary, neither of the two existing substructure processing techniques can simultaneously meet two requirements: a precise definition of the minimum-granularity substructure and an effective aggregation method for the minimum-granularity substructure. Summary of the Invention

[0008] The purpose of the present invention is to address the deficiencies of existing substructure processing technologies and to propose a natural-time-based optimal substructure aggregation method and device for streaming big data processing. This method allows users to more freely and flexibly define the time span of a substructure using natural time as the basic unit, and provides a reasonable and effective substructure aggregation method. The present invention can obtain a natural time substructure with a coarser granularity than the original granularity by aggregating fine-grained natural time substructures. The smaller the time span of the query, the higher its accuracy. The larger the time span of the query, the more time substructures are aggregated and the lower its accuracy. The substructure finally obtained can query itself to obtain the finer-grained substructure data contained in it.

[0009] The object of the present invention is achieved through the following technical solutions: In a first aspect, the present invention provides a sliding substructure aggregation method based on natural time, the method comprising the following steps:

[0010] (1) Definition of sliding substructure:

[0011] Users need to customize the time span (length) and sliding span (slide) of a substructure based on the accuracy required by the current business. The length and slide fields are natural time lengths. The entire substructure is divided into equal parts (lenth / GCD (length, slide)), and each part is a pane.

[0012] (2) Creation of sliding substructure:

[0013] After the user defines the properties of the substructure (length and slide), it is necessary to determine the data that should be contained in each substructure based on the current minimum time span, and then create the substructure and pane;

[0014] (3) Management of sliding substructure:

[0015] After completing the definition and creation of the sliding substructure, the user needs to define the time span duration, end time time_ref and the number of fine-grained substructures size included in the aggregated substructure;

[0016] (4) Aggregation process of sliding substructure:

[0017] According to user needs, the existing fine-grained panes are aggregated into coarse-grained panes through an aggregation algorithm, and the data and timestamps in the substructure are also calculated as data in coarse-grained natural time units.

[0018] (5) Query method of sliding substructure: The aggregation method includes two stages: preparation stage and execution stage. In the preparation stage, two loop arrays are initialized, namely the result array and the pointer array. In the execution stage, all query conditions are processed in a loop, and the range to be calculated is obtained through the two loop arrays. The query results of different time spans are calculated through a stack, which is used to store the windows to be calculated.

[0019] Furthermore, the natural time refers to the units used to measure time, including seconds, minutes, hours, days, weeks, months and years.

[0020] Furthermore, step (4) includes the following sub-steps:

[0021] (4.1) For existing data, all panes within the user-defined duration field are found and stored in a queue. The substructure of the panes in the queue after aggregation is smaller than the time span of the substructure required for the query. That is, the data in the panes is first aggregated, and the results are then aggregated again. For new data, the corresponding queue is first found, and then the pane at the head of the queue is determined to be valid.

[0022] a. If the queue head pane exists and is valid, add the pane to the queue;

[0023] b. If the queue head pane does not exist or is invalid, create a new pane queue and push the pane containing the data into the queue;

[0024] (4.2) After the pane is pushed into the queue, the following two methods are used to determine whether the current queue is full.

[0025] a. The time span between the timestamp carried by the pane at the end of the queue and the timestamp carried by the pane at the head of the queue exceeds the duration of the required aggregated substructure;

[0026] b. The time at the end of the queue is greater than or equal to the currently specified query time.

[0027] If the queue is not full, the process ends and continues to wait for new panes to be pushed into the queue until the queue is full; if the queue is full, the aggregation operation is performed.

[0028] (4.3) For each pane, a new substructure is obtained after aggregation, whose length field is the query duration specified by the user, its time_ref is the start time of the pane in the original queue, and the stored data is the aggregate value required by the user.

[0029] Furthermore, in step (4), the aggregation algorithm includes sum, count, maximum, mean and variance.

[0030] Furthermore, step (5) includes the following sub-steps:

[0031] (5.1) In the preparation phase, all query conditions are taken as input and the maximum commonality between them is calculated to avoid duplicate calculations between different queries. Then, two arrays need to be initialized. For the result array, initialize it accordingly based on the calculation requirements. For the pointer array, set each pointer to point to the next position, with the last pointer pointing to the first position. An index stack also needs to be initialized to store the pane pointers that the current query needs to process.

[0032] (5.2) During the execution phase, the method loops through all queries. For each query, the two arrays are used to retrieve the panes to be calculated. Aggregate the data in the panes to obtain partial aggregate values, which are then placed on a stack for further calculation. The final result is returned to the user, and the next query is processed. After processing all queries, if the user still wishes to output results, a new round of query processing begins.

[0033] Using the query plan generated during the preparation phase, the method determines the pointer index of the starting pane for a specific query and pushes the indices of all panes that need to be accessed subsequently onto the index stack. The method then loops through the panes in the stack and stores the partial aggregation results into the result array.

[0034] In the second aspect, the present invention also provides an example of a sliding substructure aggregation device based on natural time, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement the steps of the sliding substructure aggregation method based on natural time.

[0035] In a third aspect, the present invention further provides an example of a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps of the natural time-based sliding substructure aggregation method.

[0036] The beneficial effects of the present invention are:

[0037] (1) The time span of the substructure can be customized by the user. The user can save the finest-grained natural time substructure that meets the accuracy requirements according to the actual situation.

[0038] (2) Users can aggregate fine-grained natural time substructures through efficient aggregation calculation methods to obtain reasonable coarse-grained natural time substructures. This avoids storing many substructures of different time granularities in the system and reduces the difficulty of managing substructures.

[0039] (3) The length of the finest-grained natural time substructure that users can customize and the time span of the substructure obtained through aggregation calculation are not limited to general natural hours, natural days or natural months. Users can also obtain natural time substructures of two hours, three days or three months. In addition, the time span of the natural time substructure after aggregation can also be customized and does not necessarily need to meet the natural time length in the strict sense. This can solve the problem of different users having different understandings of the same natural time unit, thereby providing greater flexibility. In addition, the aggregation algorithm used in the aggregation process can maximize the use of various intermediate results obtained in the process, and can achieve good results in both single-query and multi-query environments. The time complexity of the algorithm under single-query conditions reaches the Changshu level, and the time complexity under multi-query conditions is O(n), which is much better than traditional aggregation algorithms.

[0040] (4) Meeting spatiotemporal locality requirements. In practical application scenarios, the latest data is often accessed most frequently, so higher accuracy is required. Older data does not require high accuracy, so aggregation algorithms can be used to obtain coarse-grained substructures, providing users with older indicator data queries.

[0041] (5) Substructures of different granularities can be stored on different storage media. Due to temporal locality, the latest data is most frequently accessed, so it can be stored in memory. Coarse-grained data obtained through aggregation algorithms can be stored on disk. This approach further increases the upper limit of the indicator data storage capacity of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 An instance of a natural time substructure with natural minutes as the unit and its aggregation into a substructure with natural hours as the unit.

[0043] Figure 2 Schematic diagram of the sliding substructure and pane.

[0044] Figure 3 This is the processing flow for the natural time substructure.

[0045] Figure 4 is the natural time substructure of the initial situation obtained according to the assumption.

[0046] Figure 5 It is the large natural time substructure obtained after the aggregation operation.

[0047] Figure 6 This is a schematic structural diagram of a sliding substructure aggregation device based on natural time provided by the present invention. DETAILED DESCRIPTION

[0048] The specific embodiments of the present invention are further described in detail below with reference to the accompanying drawings.

[0049] The present invention is mainly applicable to various fields related to streaming big data processing, such as financial risk control, traffic flow supervision, and user behavior habit analysis. A sliding substructure aggregation method based on natural time is provided, which can provide a substructure that best meets business needs according to the current business scenario. For example, if a user wants to be able to query the consumption situation in the past month, the system can aggregate the time substructure with "day" as the natural unit. The method provides a method for constructing a natural time substructure and calculating, storing and querying an existing natural time substructure, so that a natural time substructure with a larger time span can be calculated based on the existing natural time substructure. The method of the present invention comprises the following steps:

[0050] (1) Definition of sliding substructure:

[0051] Users need to customize the substructure's time span (length) and sliding span (slide) based on the business's required accuracy. The length and slide fields must be a natural time length. Length can be a natural hour, day, or month. The substructure also contains the current substructure's timestamp and the data to be saved. The entire substructure is divided into equal parts (length / GCD(length,slide)), with each part forming a pane.

[0052] (2) Creation of sliding substructure:

[0053] After the user defines the properties (length and slide) of the natural sliding substructure, it is necessary to determine the data that should be contained in each substructure based on the time span of the current minimum substructure, and then create the substructure and pane.

[0054] (3) Management of sliding substructure:

[0055] After the sliding substructure is defined and created, the user defines the range duration, end time time_ref, and the number of fine-grained substructures contained in the queried substructure. The method of the present invention parses the relationship between the time query range and end time entered by the user during the query.

[0056] (4) Aggregation process of sliding substructure:

[0057] According to user needs, the existing fine-grained natural time substructure is aggregated into a coarse-grained natural time substructure through an aggregation algorithm, and the data and timestamps in the substructure are also calculated as data in units of coarse-grained natural time. Figure 1 It shows a natural time substructure with natural minutes as the smallest unit and its aggregation into a natural time substructure with natural hours as the unit; Figure 2 The relationship between a set of sliding substructures and panes is shown below. The aggregation process of natural time substructures is described in detail.

[0058] (4.1) For existing data, all panes within the duration range are found based on the duration field and stored in a queue. The resulting substructure of the panes in this queue, after aggregation, is slightly smaller than the time span of the substructure being queried. This means that the data within the panes is first aggregated, and the resulting results are then aggregated again. For new data, the corresponding queue is first searched, and then the presence and validity of the pane at the head of the queue are determined.

[0059] a. If the queue head pane exists and is valid, add the pane to the queue.

[0060] b. If the queue head pane does not exist or is invalid, create a new pane queue and push the pane into the queue.

[0061] (4.2) After a pane is pushed into the queue, there are two ways to determine whether the queue is full: one is to check if the time span between the timestamp of the pane at the end of the queue and the timestamp of the pane at the head of the queue exceeds the duration of the desired aggregated substructure; the other is to check if the time at the end of the queue is greater than or equal to the currently specified query time. If the queue is not full, the process ends and waits for new panes to be pushed into the queue until it is full. If the queue is full, the aggregation operation is performed.

[0062] (4.3) For each pane, there are multiple aggregation methods, including sum, count, maximum, mean, and variance. After aggregation, a new substructure is obtained, whose length field is the query duration specified by the user, its time_ref is the start time of the substructure in the original queue, and the stored data is the aggregate value requested by the user.

[0063] The above polymerization process can be expressed as Figure 3 The flow chart shown. Aggregate calculations for natural time substructures include the maximum or minimum metric within a period, the maximum number of consecutive increases or decreases for a metric within a period, and the variance or standard deviation of a metric within a period. The substructure's duration here refers to a natural time period such as one day or two months, but different people often have different understandings of this time length. For example, if the current time is November 10, 2020, a query period of one month generally includes the following two interpretations: the first is a strictly natural month, that is, from October 10, 2020 to November 10, 2020; the second is from October 1, 2020 to November 10, 2020. Users can choose the query mode when defining the query length, and the method of the present invention can well support both. In addition, the method of the present invention can support the conversion of substructure time spans at a certain granularity. For example, if the query range is 1 minute, the method of the present invention can convert it to 60 seconds or 60,000 milliseconds. If the query period is one day, it can be converted to smaller units such as 24 hours or 1440 minutes. For the method of the present invention, during use, for any expression evaluateFormulation(String timePattern), the method can automatically convert the time length contained therein to match the same time length in different units, that is, the expression evaluateFormula("1hour"), the expression evaluateFormula("60minutes") and the expression evaluateFormula("3600seconds") are equivalent to each other. This conversion makes the method more convenient and flexible to use. For example, suppose that the minimum time span and a series of query time lengths have been predefined. At this time, if a user wants to query an undefined time length, you can try to convert the time length into an existing time length and return the result to the user.

[0064] (5) Query method of natural time substructure:

[0065] The aggregation method consists of two phases: preparation and execution. This method uses two loop arrays and a stack to compute query results for different time spans. The two arrays are the result array and the pointer array, respectively, and the stack is used to store the windows to be computed.

[0066] (5.1) In the preparation phase, the method takes all queries as input and calculates the maximum common part between them. By calculating the common part, it can avoid the repeated calculation process between different queries to the greatest extent. After that, a query plan needs to be generated to obtain the required sliding substructure attribute length. Then, two arrays with the same length need to be initialized. For the result array, different calculations require different initializations. For example, for the sum operation, the value needs to be initialized to 0; for the maximum value operation, the value needs to be initialized to negative infinity. For the pointer array, each pointer points to the next bit, and the last pointer points to the first bit. It is also necessary to initialize an index stack to store the pane pointers that need to be processed by the current query.

[0067] (5.2) During the execution phase, the method loops through all queries. For each query, the two arrays are used to retrieve the panes to be calculated. Aggregate the data in the panes to obtain partial aggregate values, which are then placed on a stack for further calculation. The final result is returned to the user, and the next query is processed. After processing all queries, if the user still wishes to output results, a new round of query processing begins.

[0068] Using the query plan generated during the preparation phase, the method determines the pointer index of the starting pane for a specific query and pushes the indices of all panes that need to be accessed subsequently onto the index stack. The method then loops through the panes in the stack and stores the partial aggregation results into the result array.

[0069] The pseudo code for this process is as follows:

[0070]

[0071] Example:

[0072] The above-mentioned optimal substructure processing technology based on natural time applied to streaming big data processing is further described in the form of an embodiment.

[0073] This example has the following assumptions:

[0074] (1) The metric calculated in the example is “the number of times a sensor in a factory exceeds a certain threshold within a certain period of time.” This is a common metric in the industrial production field, which is also a common application area for streaming big data.

[0075] (2) Assuming that a sensor A transmits data once every second, it will generate about 86,400 pieces of data per day and about 2,592,000 pieces of data per month. Assume that the relevant data format of sensor A is as shown in the following table:

[0076]

[0077] (3) The finest-grained substructure can be defined as 1 second, which can make the results more accurate. Suppose you want to query the working status of the sensor within a month, then the aggregation time length is defined as one month.

[0078] (4) The current time is 18:04:00 on November 24, 2020. The query time_ref given by the user is the current time. The system contains data up to 00:00:00 on October 24, 2020. The aggregation evaluation is to calculate the number of times the sensor exceeds the threshold during this month.

[0079] According to the above assumptions, the substructure is initially as follows Figure 4 shown.

[0080] In the initial state, the substructure exists at the finest granularity defined, and no aggregation operation is required. When the user requests a query, the user needs to provide the query deadline time_ref, the query duration duration, and the corresponding required value after aggregation. The query duration here is defined as one month, but there are several specific implementation methods here. 28, 29, 30, and 31 days are selected as the length of a natural month. In addition, the user can also define whether to strictly aggregate by hour or day. For example, the start time can be 0:0:00 on October 24, 2020, or 18:04:00 on the 24th. The user can freely define the desired length. Here, it is assumed that there are 30 days in a month and the complete October 24 is calculated. The time substructure after aggregation is as follows Figure 5 shown.

[0081] During the test, the system using the optimal substructure processing technology based on natural time completed 10,000,000 indicator calculation transactions in 76 seconds, with an average response time of 18 milliseconds. The system also completed 10,000,000 indicator query transactions in 3 seconds. The system built with a fixed substructure completed 10,000,000 indicator calculation transactions in 112 milliseconds, with an average response time of 20 milliseconds. The system also completed 10,000,000 indicator query transactions in 5 seconds.

[0082] The test results are as follows:

[0083]

[0084] Corresponding to the aforementioned embodiment of the sliding substructure aggregation method based on natural time, the present invention also provides an embodiment of the sliding substructure aggregation device based on natural time.

[0085] See also Figure 6 An embodiment of the present invention provides a sliding substructure aggregation device based on natural time, including a memory and one or more processors, wherein the memory stores executable code, and when the processor executes the executable code, it is used to implement the sliding substructure aggregation method based on natural time in the above embodiment.

[0086] The embodiment of the sliding substructure aggregation device based on natural time of the present invention can be applied to any device with data processing capability, and the device with data processing capability can be a device or apparatus such as a computer. The device embodiment can be implemented through software, or through hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the processor of any device with data processing capability in which it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution. From the hardware level, if Figure 6 As shown, it is a hardware structure diagram of any device with data processing capability where the sliding substructure aggregation device based on natural time of the present invention is located, except Figure 6 In addition to the processor, memory, network interface, and non-volatile memory shown, any device with data processing capabilities in which the apparatus in the embodiment is located may also include other hardware, generally based on the actual functions of the device with data processing capabilities, which will not be described in detail.

[0087] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0088] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can be referred to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present invention. A person of ordinary skill in the art can understand and implement the present invention without inventive work.

[0089] An embodiment of the present invention further provides a computer-readable storage medium having a program stored thereon. When the program is executed by a processor, the natural time-based sliding substructure aggregation method in the above embodiment is implemented.

[0090] The computer-readable storage medium may be an internal storage unit of any device with data processing capabilities described in any of the aforementioned embodiments, such as a hard disk or memory. The computer-readable storage medium may also be an external storage device of any device with data processing capabilities, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card, etc. equipped on the device. Furthermore, the computer-readable storage medium may also include both an internal storage unit and an external storage device of any device with data processing capabilities. The computer-readable storage medium is used to store the computer program and other programs and data required by any device with data processing capabilities, and may also be used to temporarily store data that has been output or is to be output.

[0091] The above embodiments are used to illustrate the present invention rather than to limit the present invention. Any modifications and changes made to the present invention within the spirit of the present invention and the protection scope of the claims shall fall within the protection scope of the present invention.

Claims

1. A sliding substructure aggregation method based on natural time, characterized in that: The method comprises the following steps: (1) Definition of sliding substructure: Users need to customize the time span (length) and sliding span (slide) of a substructure based on the accuracy required by the current business. The length and slide fields are natural time lengths. The entire substructure is divided into equal parts: length / GCD(length, slide), where GCD(length, slide) is the greatest common divisor of length and slide. Each part is a pane. (2) Creation of sliding substructure: After the user defines the substructure attributes, namely length and slide, it is necessary to determine the data that should be contained in each substructure based on the current minimum time span, and then create the substructure and pane; (3) Management of sliding substructure: After completing the definition and creation of the sliding substructure, the user needs to define the time span duration, end time time_ref and the number of fine-grained substructures size included in the aggregated substructure; (4) Aggregation process of sliding substructure: According to user needs, the existing fine-grained panes are aggregated into coarse-grained panes through an aggregation algorithm, and the data and timestamps in the substructure are also calculated as data in coarse-grained natural time units; (5) Query method of sliding substructure: The query method consists of two phases: the preparation phase and the execution phase. In the preparation phase, two loop arrays are initialized, namely the result array and the pointer array. In the execution phase, all query conditions are processed in a loop, and the range to be calculated is obtained through the two loop arrays. The query results of different time spans are calculated through a stack, which is used to store the windows to be calculated.

2. The natural time-based sliding substructure aggregation method according to claim 1, characterized in that: The natural time refers to the units used to measure time, including seconds, minutes, hours, days, weeks, months and years.

3. The natural time-based sliding substructure aggregation method according to claim 1, characterized in that: Step (4) includes the following sub-steps: (4.1) For existing data, all panes within the user-defined duration field are found and stored in a queue. The substructure of the panes in the queue after aggregation is smaller than the time span of the substructure required for the query. That is, the data in the panes is first aggregated, and the results are then aggregated again. For new data, the corresponding queue is first found, and then the pane at the head of the queue is determined to be valid. a. If the queue head pane exists and is valid, push the pane into the queue; b. If the queue head pane does not exist or is invalid, create a new pane queue and push the pane containing the data into the queue; (4.2) After a pane is pushed into the queue, the following two methods are used to determine whether the queue is full: a. The time span between the timestamp carried by the pane at the end of the queue and the timestamp carried by the pane at the head of the queue exceeds the duration of the required aggregated substructure; b. The time at the end of the queue is greater than or equal to the currently specified query time; If the queue is not full, the process ends and continues to wait for new panes to be pushed into the queue until the queue is full; If the queue is full, perform aggregation operation; (4.3) For each pane, a new substructure is obtained after aggregation, whose length field is the query duration specified by the user, its time_ref is the start time of the pane in the original queue, and the stored data is the aggregate value required by the user.

4. The natural time-based sliding substructure aggregation method according to claim 1, characterized in that: In step (4), the aggregation algorithms include sum, count, maximum, mean and variance.

5. The natural time-based sliding substructure aggregation method according to claim 1, characterized in that: Step (5) includes the following sub-steps: (5.1) In the preparation phase, based on all query conditions, the maximum common part between them is calculated to avoid repeated calculations between different queries; Then you need to initialize the result array and pointer array. For the result array, perform corresponding initialization according to the calculation needs; for the pointer array, make each pointer point to the next bit, and the last pointer points to the first bit; (5.2) During the execution phase, all query conditions are processed in a loop. For each query condition, the pane to be calculated is obtained through the two arrays mentioned above. The pointer index of the starting pane of a specific query is determined, and the indexes of all panes to be accessed subsequently are pushed into the index stack. The panes in the stack are processed in a loop, and after performing aggregation calculations on the data in the panes to obtain partial aggregate values, these values ​​are placed into the stack for further calculation, and the partial aggregate results are stored in the result array. After obtaining the final result, it is returned to the user, and the next query condition is processed. After all queries are processed, if the user still wants to output results, a new round of query processing will begin.

6. A sliding substructure aggregation device based on natural time, comprising a memory and one or more processors, wherein the memory stores executable code, characterized in that: When the processor executes the executable code, it is used to implement the steps of the natural time-based sliding substructure aggregation method according to any one of claims 1 to 5.

7. A computer-readable storage medium having a program stored thereon, characterized in that: When the program is executed by a processor, the steps of the sliding substructure aggregation method based on natural time as described in any one of claims 1 to 5 are implemented.