Method and device for dynamically adjusting time window based on flow

By monitoring and adjusting the time window of data traffic, the problem of data processing delay caused by static time frames in traditional technology is solved, flexible data processing is realized, adapts to the performance requirements of low-load and high-load scenarios, and improves processing efficiency and response. speed.

CN118677818APending Publication Date: 2024-09-20WUXI STARS MICRO SYSTEM TECHNOLOGIES CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410933520.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-09-20

AI Technical Summary

Technical Problem

Traditional data processing technology relies on static time frames and cannot flexibly respond to the volatility of data traffic, resulting in unnecessary waiting times when traffic is low and delaying data processing, response and feedback cycles.

Method used

Intelligent data aggregation and processing can be achieved by monitoring data traffic within the current time window, detecting characteristic values, and dynamically adjusting the time window timeout threshold based on traffic. The specific method includes counting traffic and detecting characteristic values ​​when receiving target data. If it matches or reaches a threshold, batch processing is performed, and the timeout threshold of the next time window is calculated based on the current traffic.

Benefits of technology

It achieves quick response and reduces delays when the load traffic is low, and automatically selects the appropriate time length for multi-data aggregation when the load traffic is high, improving processing efficiency and meeting the processing needs of high-time-sensitive data. It is suitable for data aggregation and I/O. Scenarios such as aggregation and interruption of aggregation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677818A
    Figure CN118677818A
Patent Text Reader

Abstract

The invention provides a method and device for dynamically adjusting a time window based on traffic, and the method comprises the steps: monitoring received target data in a current time window, carrying out the statistics of the traffic of the target data, and detecting a feature value of the target data; if the flow of the target data reaches a predefined aggregation threshold, or the flow of the target data reaches a predefined aggregation threshold, or the flow of the target data reaches a window timeout threshold of a current time window, performing batch processing on the received target data; and determining a window timeout threshold value of the next time window according to the flow of the target data in the current time window. According to the technical scheme, the dynamic timeout threshold value and the traffic characteristic value are used for carrying out aggregation processing on the data, and the response timeliness is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data aggregation, and in particular, relates to a method and device for dynamically adjusting a time window based on traffic. Background Art

[0002] Data aggregation generally refers to the process of combining multiple data items or events into a larger, more meaningful unit in distributed systems, database operations, data processing, and event-driven architectures. This technique is particularly critical when dealing with large-scale data sets or high-frequency events.

[0003] In the context of aggregation behavior, the timeout mechanism plays a crucial role, which determines how the system handles data that fails to meet the aggregation criteria within the specified time. Specifically, if the data aggregation does not meet the established threshold within the predetermined time, the system may perform an aggregation operation to process the collected data in time.

[0004] Traditional data processing techniques usually rely on static time frames to determine data timeouts. In this approach, the system will only start the subsequent data processing process when the target data traffic accumulates to a pre-set aggregation threshold. If the threshold is not reached, the system will wait until the fixed window period ends before processing. However, this strategy based on a fixed time frame cannot flexibly respond to the volatility of data traffic, which is particularly evident when the traffic is low. It may lead to unnecessary increase in waiting time, thereby delaying the entire data processing, response and feedback cycle. Summary of the invention

[0005] The purpose of this application is to provide a method and device for dynamically adjusting time windows based on traffic, aiming to achieve intelligent data aggregation and processing.

[0006] According to a first aspect of the present application, a method for dynamically adjusting a time window based on traffic flow is provided, comprising:

[0007] Monitor the received target data within the current time window, count the flow of the target data, and detect the characteristic value of the target data;

[0008] If the characteristic value matches a predefined characteristic value, or the flow of the target data reaches a predefined aggregation threshold, or reaches a window timeout threshold of the current time window, batch processing is performed on the received target data;

[0009] A window timeout threshold of a next time window is determined according to the flow of the target data in the current time window.

[0010] In an optional implementation manner, before monitoring the received target data within the current time window, the method further includes:

[0011] If the time window is not currently established, a timer is started to establish the current time window, and the window timeout threshold of the current time window is set to a preset minimum value.

[0012] In an optional implementation manner, before detecting the characteristic value of the target data, the method further includes:

[0013] Determines whether to enable the characteristic value check. When the characteristic value check is not enabled, the characteristic value detection is not performed.

[0014] In an optional implementation manner, the batch processing of the received target data further includes:

[0015] If the characteristic value indicates that the target data is high-timeliness data, the processor is notified to perform batch processing on the target data, restart the timer, and establish the next time window.

[0016] In an optional implementation manner, determining the window timeout threshold of the next time window according to the flow of the current time window of the target data further includes:

[0017] Calculate the timeout threshold f(x) of the x-th time window:

[0018] f(x)=A+tk x-1

[0019] Where A is the preset minimum value, t is the unit value constant for dynamic window adjustment, k x-1 is the flow size of the target data in the x-1th time window.

[0020] According to a second aspect of the present application, a device for dynamically adjusting a time window based on traffic flow is provided, comprising:

[0021] an aggregation unit, configured to monitor received target data within a current time window, count the flow of the target data, and detect characteristic values ​​of the target data;

[0022] A processing unit, configured to batch process the received target data when the characteristic value matches a predefined characteristic value, or the flow of the target data reaches a predefined aggregation threshold, or reaches a window timeout threshold of a current time window;

[0023] An adjustment unit is used to determine a window timeout threshold of a next time window according to the flow of the target data.

[0024] Compared with the related art, the technical solution of this application has the following advantages:

[0025] It automatically selects the appropriate time window to adapt to the performance requirements of low-load traffic scenarios and high-load traffic scenarios. When the target is in low-load traffic, it can get a fast processing response, reduce unnecessary waiting time, and reduce latency. When the target is in high-load traffic, it can automatically select the appropriate time length for multi-data aggregation according to the traffic size, increase processing efficiency, and meet the high-timeliness processing requirements of target sensitive data. This implementation method is easy to reuse and expand. Through parameterized definition and design, it is flexible and reusable, with wide applicability. It can be applied to scenarios such as data aggregation, I / O aggregation, and interrupt aggregation.

[0026] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained through the structures and processes indicated in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. It is obvious that the drawings described below are certain embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0028] Figure 1 It is a schematic diagram of the principle of dynamically adjusting the time window according to the present application.

[0029] Figure 2 It is a module architecture diagram of a method for dynamically adjusting a time window according to an exemplary embodiment of the present application.

[0030] Figure 3 It is a flowchart of a method for dynamically adjusting a time window based on traffic according to an exemplary embodiment of the present application.

[0031] Figure 4 It is a flowchart of a method for dynamically adjusting a time window based on traffic according to another exemplary embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0033] Data aggregation generally refers to the process of combining multiple data items or events into a larger, more meaningful unit in distributed systems, database operations, data processing, and event-driven architectures. This technique is particularly critical when dealing with large-scale data sets or high-frequency events.

[0034] In the context of aggregation behavior, the timeout mechanism plays a crucial role, which determines how the system handles data that fails to meet the aggregation criteria within the specified time. Specifically, if the data aggregation does not meet the established threshold within the predetermined time, the system may perform an aggregation operation to process the collected data in time.

[0035] Based on the above analysis, the present application provides a method and device for dynamically adjusting the time window based on traffic flow, dynamically adjusting the time window of the timeout threshold according to the real-time traffic flow, and combining real-time monitoring and identification of target data characteristic values ​​to achieve intelligent data aggregation and processing. For example, if the target data is highly time-sensitive data, it is processed in a timely manner. By real-time detection of the data flow and characteristic values ​​in the current time window, the duration of the next time window of the timeout threshold is dynamically determined. The principle of the method for dynamically adjusting the time window based on traffic flow of the present application is as follows: Figure 1 shown.

[0036] The structure of this application is as follows Figure 2 As shown in the figure. Buff is a data buffer used to cache or aggregate target data, Monitor is a traffic monitoring module used to count target real-time traffic, Timer is a timer used to generate a time window, and Processor is a processor used to complete the processing of target data. Depending on the processing methods of different business scenarios, the processing of target data can include data calculation, storage, transmission, etc.

[0037] For example, see Figure 3 The method for dynamically adjusting the time window based on traffic provided in the embodiment of the present application includes:

[0038] Step 101: monitor the received target data within the current time window, count the flow of the target data, and detect the characteristic value of the target data.

[0039] Specifically, after the Monitor module is initialized, it monitors the target data input, and if there is target data input, it determines whether it is in the window monitoring state. That is, after the current time window is established, it starts to count the current target data flow.

[0040] According to a possible implementation, if the window is not currently in the monitoring state, a window timeout threshold needs to be set, and a timer is started to establish a time window. The window timeout threshold at this time may be a preset minimum value.

[0041] Step 102: If the characteristic value matches a predefined characteristic value, or the flow of the target data reaches a predefined aggregation threshold, or reaches a window timeout threshold of the current time window, batch processing is performed on the received target data.

[0042] For example, if the characteristic value indicates that the target data is highly time-sensitive data (such as high priority), an interrupt or some other method can be used to notify the processor of the aggregated relevant information of the target data before the window timeout threshold is reached, so as to facilitate timely processing.

[0043] At the same time, if the feature value represents normal timeliness, the window timeout threshold is still used as the condition for aggregation processing. When the window timeout threshold is reached, the target data is batch processed.

[0044] According to a possible implementation, the characteristic value of the target data can be represented by an existing field in the business data, such as a command code, defining some commands as having high timeliness and other commands as having low timeliness; or a special field can be additionally defined in the business data, such as a number, with different values ​​representing the degree of timeliness required for response. For example, the field of the predefined characteristic value is a value A, B or C, A for low timeliness, B for medium timeliness, and C for high timeliness. In actual applications, the degree of timeliness may not be limited to the above three.

[0045] The characteristic value information is configured by the CPU, and the monitor unit can obtain the characteristic value and perform comparative detection on the data. Taking the command type as an example, commands can be divided into advanced management commands, general management commands and read-write commands. Among them, advanced management commands require timely response and can be assigned high timeliness characteristics; general management commands can be responded to after a period of time, and can be assigned medium timeliness characteristics; read-write commands have relatively low timeliness requirements and can be assigned low timeliness characteristics.

[0046] According to a possible implementation, first determine whether to enable the feature value check. For example, the target data may not carry a feature value, indicating that the feature value check is not enabled. In this case, the feature value is not detected, that is, only the flow size and time window of the target data are monitored.

[0047] After batch processing of the target data, the process also includes restarting the timer to establish the next time window.

[0048] Step 103: Determine a window timeout threshold of a next time window according to the flow of the current time window of the target data.

[0049] The current target flow rate and the timeout threshold of the next time window present a linear relationship, so the timeout threshold of the next time window can be calculated according to the current target flow rate and the linear relationship.

[0050] According to a possible implementation, the formula for dynamically adjusting the time window based on traffic can be expressed as:

[0051] f(x)=A+tk x-1

[0052] in:

[0053] f(x) is the timeout threshold of the xth time window; A is the minimum threshold constant of the time window; t is the unit value constant for dynamic adjustment of the window; k x-1 is the traffic size of the target in the x-1th time window.

[0054] According to a possible implementation, when the flow of target data is not received within the current time window, the window timeout threshold may return to the preset minimum value and the window monitoring state may be exited.

[0055] For example, Figure 4 The time window adjustment process of a specific embodiment of the present application is shown. At the beginning of step 1, the Monitor module needs to be initialized and set to set the time window minimum value A, the window dynamic adjustment unit value t and the target maximum aggregation value k. After the initialization is completed, step 2 is entered.

[0056] In step 2, the Monitor module monitors the target data input. If there is target data input, it goes to step 3; otherwise, it goes to step 6.

[0057] In step 3, if the current state is not window monitoring, go to step 4; otherwise go to step 5;

[0058] In step 4, the first target input appears when window monitoring is not enabled. The window timeout threshold is set according to the formula f(x)=A+tkx-1. Since there is no previous traffic statistics, the target data traffic k x-1 is 0, so the window timeout threshold is A, start the Timer, and go to step 5;

[0059] In step 5, the target data flow k is counted. x , and go to step 7;

[0060] In step 6, if the current state is not window monitoring, return to step 2; otherwise, go to step 7;

[0061] In step 7, check whether the time window reaches the window timeout threshold. If not, proceed to step 8; otherwise, proceed to step 13;

[0062] In step 8, if the target flow rate has not reached the aggregation threshold, then return to step 2; if the flow rate has reached the aggregation threshold, then proceed to step 9;

[0063] In step 9, it is determined whether to enable the feature value check. In some scenarios, the target data may not carry the feature value. In this case, the feature value is not detected and the process returns to step 2. If the feature value check is enabled, the process proceeds to step 10.

[0064] In step 10, check the characteristic value of the target data. If the characteristic value is of high timeliness, it means that it needs to be processed in time, and go to step 11; if the target data is of low timeliness, wait for the aggregation of subsequent data and return to step 2;

[0065] In step 11, an interrupt or some other method is used to notify the processor and inform the relevant information that the target data has been aggregated, batch process the target data, and enter step 12;

[0066] In step 12, according to the current statistical flow k x Get the timeout threshold for the next time window:

[0067] f(x+1)=A+tk x

[0068] Reset the timeout threshold of the time window, clear the traffic statistics value k, restart the timer, and then return to step 2;

[0069] In step 13, if there is traffic, that is, k x If it is not 0, return to step 8; otherwise, go to step 14:

[0070] In step 14, it indicates that the target data has not been received for a long time, and the window monitoring state can be exited and the process goes to step 15, and this round of window monitoring behavior ends.

[0071] It can be seen that the method for dynamically adjusting the time window based on traffic provided by this application has the following advantages compared with the related technologies:

[0072] By automatically selecting the appropriate time window, it can adapt to the performance requirements of low-load traffic scenarios and high-load traffic scenarios. When the target is in low-load traffic, it can obtain a fast processing response, reduce unnecessary waiting time, and reduce latency. When the target is in high-load traffic, it can automatically select the appropriate time length for multi-data aggregation according to the traffic size, increase processing efficiency, and meet the high-timeliness processing requirements of target sensitive data. Compared with the technical solution that uses window time thresholds or traffic data features alone, the present application can not only meet the timely processing of high-timeliness data, but also meet the processing requirements of low-timeliness data under low load, and at the same time, it can also maximize the CPU processing efficiency when the data is highly loaded. The implementation method of the present application is easy to reuse and expand, and through parameterized definition and design, it is flexible and reusable, and has a wide range of applicability. It can be applied to scenarios such as data aggregation, I / O aggregation, and interrupt aggregation.

[0073] Accordingly, the present application provides, in a second aspect, a device for dynamically adjusting a time window based on traffic flow, comprising:

[0074] an aggregation unit, configured to monitor received target data within a current time window, count the flow of the target data, and detect characteristic values ​​of the target data;

[0075] A processing unit, configured to batch process the received target data when the characteristic value matches a predefined characteristic value, or the flow of the target data reaches a predefined aggregation threshold, or reaches a window timeout threshold of a current time window;

[0076] The adjustment unit is used to determine the window timeout threshold of the next time window according to the flow of the current time window of the target data.

[0077] The above-mentioned device can be implemented through the method for dynamically adjusting the time window based on flow provided by the embodiment of the above-mentioned first aspect. The specific implementation method can be found in the description of the embodiment of the first aspect, and will not be repeated here.

[0078] It is understood that the architectures, names and parameters described in the above embodiments are only examples. Those skilled in the art can also easily combine and adjust the structural features of the above embodiments according to the use requirements, and should not limit the concept of the present application to the specific details of the above examples.

[0079] Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that he or she may still modify the technical solutions described in the aforementioned embodiments, or make equivalent substitutions for some of the technical features therein; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for dynamically adjusting a time window based on traffic, characterized in that: include: Monitor the received target data within the current time window, count the flow of the target data, and detect the characteristic value of the target data; If the characteristic value matches a predefined characteristic value, or the flow of the target data reaches a predefined aggregation threshold, or reaches a window timeout threshold of the current time window, batch processing is performed on the received target data; A window timeout threshold of a next time window is determined according to the flow of the target data in the current time window.

2. The method for dynamically adjusting the time window based on traffic according to claim 1 is characterized in that: Before monitoring the received target data within the current time window, the method further includes: If the time window is not currently established, a timer is started to establish the current time window, and the window timeout threshold of the current time window is set to a preset minimum value.

3. The method for dynamically adjusting the time window based on traffic according to claim 1 is characterized in that: Before detecting the characteristic value of the target data, the method further includes: Determines whether to enable the characteristic value check. When the characteristic value check is not enabled, the characteristic value detection is not performed.

4. The method for dynamically adjusting the time window based on traffic according to claim 2 is characterized in that: The batch processing of the received target data further comprises: If the characteristic value indicates that the target data is high-timeliness data, the processor is notified to perform batch processing on the target data, restart the timer, and establish the next time window.

5. The method for dynamically adjusting the time window based on traffic according to claim 2, characterized in that: The determining of the window timeout threshold of the next time window according to the flow of the current time window of the target data further includes: Calculate the timeout threshold f(x) of the x-th time window: f(x)=A+tk x-1 Where A is the preset minimum value, t is the unit value constant for dynamic window adjustment, k x-1 is the flow size of the target data in the x-1th time window.

6. A device for dynamically adjusting a time window based on traffic flow, characterized in that: include: an aggregation unit, configured to monitor received target data within a current time window, count the flow of the target data, and detect characteristic values ​​of the target data; A processing unit, configured to batch process the received target data when the characteristic value matches a predefined characteristic value, or when the flow of the target data in the current time window reaches a predefined aggregation threshold, or reaches a window timeout threshold of the current time window; The adjustment unit is used to determine the window timeout threshold of the next time window according to the flow of the current time window of the target data.

7. The device for dynamically adjusting the time window based on flow rate according to claim 6, characterized in that: The polymerization unit is further used for: Before monitoring the received target data within the current time window, if the time window is not currently established, a timer is started to establish the current time window, and a window timeout threshold of the current time window is set to a preset minimum value.

8. The device for dynamically adjusting the time window based on flow rate according to claim 6, characterized in that: The polymerization unit is further used for: Before detecting the characteristic value of the target data, it is determined whether the characteristic value check is enabled. When the characteristic value check is not enabled, the characteristic value detection is not performed.

9. The device for dynamically adjusting the time window based on flow rate according to claim 7, characterized in that: The processing unit is further configured to: If the characteristic value indicates that the target data is high-timeliness data, the processor is notified to perform batch processing on the target data, restart the timer, and establish the next time window.

10. The device for dynamically adjusting the time window based on flow rate according to claim 7, characterized in that: The adjustment unit is further used for: Calculate the timeout threshold f(x) of the x-th time window: f(x)=A+tk x-1 Where A is the preset minimum value, t is the unit value constant for dynamic window adjustment, k x-1 is the flow size of the target data in the x-1th time window.

Citation Information

Patent Citations

  • Window data processing method and device, server and storage medium

    CN111142942A

  • Data storage processing method and device, computer equipment and storage medium

    CN112000703A

  • Method for determining target object, data storage method and corresponding device

    CN115168462A

  • Message processing method and device, DPU equipment, server and storage medium

    CN118018410A

  • Dynamic window-based adaptive fault monitoring systemand method thereof

    KR1020070052065A