A method for real-time dynamic detection of event occurrence density
By introducing event heat and negative feedback coefficients and combining them with logical right shift operations, the real-time and resource occupation problems of event frequency detection in SoC systems are solved, and fast and accurate detection of event density is achieved.
Patent Information
- Application Number
- CN202210272811.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-18
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-03-18
AI Technical Summary
The existing technology of event frequency detection in SoC systems has problems such as untimely frequency output, high resource usage, and difficulty in implementation, making it difficult to meet the requirements of real-time performance and accuracy.
Event heat is used to replace event frequency, a heat decreasing negative feedback coefficient is introduced, and logical right shift is used to replace division operation to achieve real-time dynamic detection of event density.
It achieves timely and accurate detection of event density with low resource usage. It is suitable for hardware systems such as SoC, FPGA, and ASIC, with flexible calculation and high applicability.
Smart Images

Figure CN114626066B_ABST
Abstract
Description
Technical Field
[0001] The invention discloses a method for real-time dynamic detection of event occurrence density, belonging to the technical field of chip logic design. Background Art
[0002] In SoC system design, it's common to detect the frequency of specific events, such as those associated with system anomalies or attacks. Event frequency is typically measured using event frequency. To detect event frequency, a common approach is to count the number of events within a fixed time period or to record whether an event is triggered within each cycle, then sequentially calculate the number of events within each time period.
[0003] Counting events within a fixed time period requires setting a fixed statistical window. The total number of events occurring within this window is then counted. Based on the number of events, the frequency is calculated to reflect the event density. While this method is simple in principle and implementation, it still suffers from the drawback of only being able to determine the frequency after the time interval has expired, resulting in delayed frequency output. Furthermore, if a period with a high frequency is split across two time windows, the accuracy of the density measurement will be compromised.
[0004] Furthermore, in scenarios where real-time and accurate event detection is crucial, the traditional approach is to record trigger data for multiple consecutive detection cycles, then count the total number of triggers within a fixed time period to reflect the event density. This approach is difficult to implement, consumes a lot of space, and is not suitable for hardware implementation. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention discloses a method for real-time dynamic detection of event density. Compared to traditional approaches, the present invention boasts advantages such as ease of implementation in hardware systems such as SoCs, FPGAs, and ASICs, minimal resource consumption, and the ability to detect event density in real time with rapid response times. Summary of the invention:
[0007] The present invention proposes to use event heat instead of event frequency to measure the density of events.
[0008] In addition, in order to solve the problem of high-frequency occurrence of events and continuous increase in heat values, the present invention introduces a heat-decreasing negative feedback coefficient. The introduction of this coefficient can enable the heat value to enter different stable states through negative feedback under different event densities, corresponding to different event densities.
[0009] The corresponding negative feedback coefficient requires a division operation, which consumes a lot of resources and time in hardware. In order to facilitate implementation in hardware, the present invention proposes using logical right shift instead of division to greatly save hardware resources without significantly affecting the negative feedback effect.
[0010] Technical term explanation:
[0011] Event heat reflects the frequency of events occurring in the recent period. After an event is triggered, heat increases, and the corresponding event density also increases. When no event occurs, heat decreases, and the corresponding event density also decreases. Thus, event heat is a more accurate measure of event density than event frequency.
[0012] The detailed technical solutions of the present invention are as follows:
[0013] A method for real-time dynamic detection of event occurrence density, characterized by comprising:
[0014] 1) Setting the initial heat value T0 of the event; generally speaking, the initial heat value T0=0;
[0015] 2) Calculate the real-time heat value T of the event:
[0016] When an event occurs, the heat value increases to the real-time heat value, and the increment is the heat increase value H, T = T + H;
[0017] When the event does not occur, the heat value is reduced to the real-time heat value, and the reduction is the heat decrement value D, T=TD; wherein the heat decrement value D is a variable and increases as the real-time heat value increases.
[0018] SoCs with high stability and security requirements typically incorporate anomaly detection or security monitoring modules. These modules detect whether specific events have been triggered and, if the frequency of these events exceeds a certain threshold, perform security or system stability processing. The frequency measurement algorithm is a key component of these modules, and frequency is typically measured using event frequency. Furthermore, detecting the frequency of specific event triggers is also applicable in a variety of scenarios. However, traditional methods for calculating event frequency in hardware suffer from low accuracy, poor real-time performance, high resource consumption, and algorithmic complexity.
[0019] To this end, the present invention not only introduces the concept of heat value to measure the occurrence of events, but also considers that if the heat increase value H and the heat decrease value D are constant, the event frequency When the heat value T increases over time, the heat value T will continue to increase. In order to solve this problem, the heat decrease value D is set as a variable, and the heat decrease value D increases as the heat value increases. In the present invention, the heat increase value H is determined according to the application scenario. The determination of the heat increase value H is not the content to be protected by the present invention. The determination of this value can be adjusted according to the actual application scenario.
[0020] According to a preferred embodiment of the present invention, the method for increasing the heat decrement value D as the real-time heat value increases is:
[0021] D=T*R,R<1 (1)
[0022] In formula (1), T is the real-time heat value, and R is the variable parameter for adjusting the change of heat decrement value;
[0023] In this solution, the heat decrement value D increases as the real-time heat value increases, which will cause the heat calculation to enter a stable state through negative feedback. This will stabilize the real-time heat value at a corresponding specific value at a stable frequency. The flow chart is as follows: Figure 2 As shown, R is less than 1. The way in which the heat decrement value D increases with the heat value will make the heat value and event frequency have a corresponding relationship, that is, when D*(1-m)=H*m, it will stabilize at a specific Near the range.
[0024] According to a preferred embodiment of the present invention, the method for increasing the heat decrement value D as the real-time heat value increases is:
[0025]
[0026] T*R simplifies to T>>n.
[0027] In hardware implementation, the division operation will consume a relatively large amount of hardware space and time. In order to reduce the consumption of hardware resources by the division operation, the present invention proposes to convert the division operation in T*R into a logical right shift operation. The right shift can realize T*R with minimal resources, and R is specifically Where n>0, T*R is simplified to T>>n.
[0028] According to a preferred embodiment of the present invention, the method for increasing the heat decrement value D as the real-time heat value increases is:
[0029] T=T-(T>>n)-1 (3)
[0030] Due to hardware calculation errors, hardware logic right shift will cause the heat value to still not return to 0 when there is no event trigger for a long time. In order to eliminate this error, the present invention proposes to increase the heat decrement value by 1, that is, D = (T>>n) + 1, that is, to correct T = T-(T>>n) to T = T-(T>>n)-1. In this way, the heat decrement value is fixedly reduced by 1, which solves the problem that the heat value cannot return to 0, but does not affect the accuracy and real-time performance. The flow chart is as follows: Figure 3 Show.
[0031] The technical advantages of the present invention are:
[0032] 1. Compared with the traditional method of using frequency to measure event density, the event heat proposed in this invention can reflect density more timely and accurately, and is consistent with the true concept of event density.
[0033] 2. The event heat calculation algorithm proposed in this invention uses fewer resources than traditional frequency calculations, is more flexible, and has higher applicability. It can also be adapted to different scenarios by adjusting various parameters.
[0034] 3. The heat calculation algorithm and implementation process proposed in this invention can dynamically detect event density in real time. The occurrence or non-occurrence of any event will affect the heat, with high accuracy and real-time performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 This is a schematic diagram of the event heat calculation process of the present invention;
[0036] Figure 2 This is a schematic diagram of the event heat calculation process after the negative feedback coefficient is introduced in the present invention;
[0037] Figure 3 This is a schematic diagram of the event heat calculation process with negative feedback that is simplified according to the hardware characteristics of the present invention. DETAILED DESCRIPTION
[0038] The present invention will be described in detail below with reference to the embodiments and the accompanying drawings, but is not limited thereto.
[0039] Example 1
[0040] A method for real-time dynamic detection of event occurrence density, comprising:
[0041] 1) Setting the initial heat value T0 of the event; generally speaking, the initial heat value T0=0;
[0042] 2) Calculate the real-time heat value T of the event:
[0043] When an event occurs, the heat value increases to the real-time heat value, and the increment is the heat increase value H, T = T + H;
[0044] When the event does not occur, the heat value is reduced to the real-time heat value, and the reduction is the heat decrement value D, T=TD; wherein the heat decrement value D is a variable and increases as the real-time heat value increases.
[0045] Specifically, such as Figure 1 As shown:
[0046] 2-1) Start;
[0047] 2-2) Determine whether the event occurred?
[0048] If the event occurs, then T = T + H;
[0049] If the event does not occur, determine whether TD is greater than 0?
[0050] If TD is greater than 0, then T = TD and wait for the next event cycle;
[0051] If TD is less than or equal to 0, then T = 0, waiting for the next event cycle;
[0052] 2-3) Repeat step 2-2).
[0053] Example 2
[0054] A method for real-time dynamic detection of event occurrence density, wherein the heat decrement value D increases as the real-time heat value increases, is as follows:
[0055] D=T*R,R<1 (1)
[0056] In formula (1), T is the real-time heat value, and R is the variable parameter for adjusting the change of heat decrement value;
[0057] like Figure 2 As shown, specifically:
[0058] 2-1) Start;
[0059] 2-2) Determine whether the event occurred?
[0060] If the event occurs, then T = T + H;
[0061] If the event does not occur, then T = TT*R;
[0062] 2-3) Wait for the next event cycle;
[0063] 2-4) Repeat step 2-2).
[0064] Example 3
[0065] A method for real-time dynamic detection of event occurrence density, wherein the heat decrement value D increases as the real-time heat value increases, is as follows:
[0066]
[0067] T*R simplifies to T>>n.
[0068] Example 4
[0069] A method for real-time dynamic detection of event occurrence density, wherein the heat decrement value D increases as the real-time heat value increases, is as follows:
[0070] T=T-(T>>n)-1 (3)
[0071] like Figure 3 As shown, specifically:
[0072] 2-1) Start;
[0073] 2-2) Determine whether the event occurred?
[0074] If an event occurs, then T = T + H, then wait for the next event cycle;
[0075] If the event does not occur, then determine whether T is equal to 0. If T = 0, then wait for the next event cycle; if T is not equal to 0, then T = T-(T>>n)-1, and wait for the next event cycle;
[0076] 2-3) Repeat step 2-2).
Claims
1. A method for real-time dynamic detection of event occurrence density, characterized in that: include: 1) Set the initial heat value T0 of the event; 2) Calculate the real-time heat value T of the event: When an event occurs, the heat value increases to the real-time heat value, and the increment is the heat increase value H, T=T+H; When the event does not occur, the heat value is reduced to the real-time heat value, and the reduction is the heat decrement value D, T=TD; wherein the heat decrement value D is a variable and increases as the real-time heat value increases; The heat value refers to the event heat, which reflects the density of events in the recent period. After the event is triggered, the heat increases, and the corresponding event density also increases. When no event occurs, the heat decreases, and the corresponding event density also decreases. The method of increasing the heat decrement value D as the real-time heat value increases is as follows: D=T*R, R<1(1) In formula (1), T is the real-time heat value, and R is the variable parameter for adjusting the change of the heat decrease value.
2. The method for real-time dynamic detection of event occurrence density according to claim 1, characterized in that: The method of increasing the heat decrement value D as the real-time heat value increases is as follows: D=T*R,R= , (2) T*R simplifies to T>>n.
3. The method for real-time dynamic detection of event occurrence density according to claim 1, characterized in that: The method of increasing the heat decrement value D as the real-time heat value increases is as follows: T=T-(T>>n)-1(3).
Citation Information
Patent Citations
Heat management method based on cached data, server, and storage medium
CN109471875A