A time compensation system and method for solving the delay of intelligent network card monitoring alarm
Patent Information
- Application Number
- CN202311722408.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-14
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-12-14
AI Technical Summary
[0002]智能网卡自带SOC小系统,智能网卡SOC系统中存在告警监控上报模块定时持续向运维的平台侧上报各种监控指标,由于每一监控条目收集数据时都会产生耗时,当SOC小系统存在网络延迟、硬件时钟偏差或者定制的监控告警项条目量大时,每个条目累积起来的延时再上送平台的时,就会产生时延误差,导致长期积累下来后的监控数据延迟时间越来越长,时效性不能够满足,且上报的监控周期不准确,该耗时问题带来的现实问题,例如平台每分钟(60秒)收集一次的指定端口数据收发包统计计数,经过一段时间延迟后,上报给平台侧的数据可能为延后5s的数据,即每65秒检测到的统计计数,与预期不符,出现统计层面的误差
本发明通过时间轮和补偿单元的设计,通过时间计算增量和进一步调整时钟漂移问题,可以实现精确的时间同步,再由每个节点只需要将本地记录时间增量并同步发送到时间轮上即可,此种方式简单快捷,无需每个节点的精准计算,从而降低系统和硬件的复杂程度。
Smart Images

Figure CN118101111B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of IT and software development, and in particular to a time compensation system and method for solving the problem of monitoring and alarm delays in smart network cards. Background Technology
[0002] The smart network interface card (NIC) has a built-in SOC (System-on-a-Chip) system. Within this system, an alarm monitoring and reporting module continuously reports various monitoring metrics to the maintenance platform. Since each monitoring item incurs time consumption during data collection, when the SOC system experiences network latency, hardware clock deviations, or a large number of customized monitoring alarm items, the accumulated latency of each item before being sent to the platform results in latency errors. This leads to increasingly longer and longer latency in the monitoring data over time, failing to meet timeliness requirements and inaccurate reporting cycles. This time consumption issue causes practical problems. For example, if the platform collects data packet statistics for a specified port every minute (60 seconds), after a certain delay, the data reported to the platform may be 5 seconds late, meaning the statistics detected every 65 seconds are inconsistent with expectations, resulting in statistical errors.
[0003] Traditional solutions typically use a time wheel approach to periodically report maintenance and monitoring data, which polls and pushes the time wheel's cells, with each cell having a callback function attached to the task. However, the traditional time wheel approach for time compensation involves precisely processing timestamps and high-precision frequency tuning for each node, thus increasing the complexity of the system and hardware. Summary of the Invention
[0004] The purpose of this invention is to provide a time compensation system and method for solving the problem of monitoring and alarm delay of smart network cards, so as to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a time compensation system for solving the delay of intelligent network card monitoring and alarm, the time compensation system for solving the delay of intelligent network card monitoring and alarm includes a monitoring and alarm unit, the monitoring and alarm unit is internally provided with a time wheel for timing, the time wheel is composed of multiple linked lists, the linked lists are internally provided with Entry, curTime, wheelSize, delayTime, deltaTime and lastTime, one end of the monitoring and alarm unit is provided with a compensation unit for delay compensation, the compensation unit includes an input unit, a calculation unit, a judgment unit and an output unit.
[0006] Preferably, the monitoring and alarm unit includes a monitoring and alarm module, the output terminal of the monitoring and alarm module is electrically connected to the input unit, and the output unit is electrically connected to the input terminal of the monitoring and alarm module.
[0007] Preferably, deltaTime is used to represent the predetermined time error of the Entry, and lastTime is used to represent the timestamp of the last execution.
[0008] Preferably, the input unit includes an input module, which is used to receive information transmitted by the monitoring and alarm module; The calculation unit includes a calculation module, which is used to calculate the size of deltaTime1 and the scale of the compensation time. The determination unit includes a determination module, which is used to determine the sign of deltaTime1 and the size of deltaTime1 relative to the wheel scale. The output unit includes an output module, which is used to output time compensation information.
[0009] Preferably, the deltaTime1 is calculated as follows: (1); Where deltaTime and lastTime are the deltaTime and lastTime of the new Entry after the callback function is executed, curTime is the current execution time, and wheelSize is the time scale of the linked list.
[0010] A time compensation method for solving the problem of monitoring and alarm delay in smart network interface cards (NICs) includes the following steps: The first step is to have the monitoring and alarm module forward messages normally and then push the reporting time wheel. After the callback function is executed, the deltaTime and lastTime of the Entry are updated. The second step is that the monitoring and alarm module sends the information to the input module, and the input module sends the information to the calculation module. Based on deltaTime, curTime, lastTime and wheelSize, the deltaTime1 value is calculated, and the calculation result is sent to the judgment module. The third step is for the determination module to first determine the result of the current function execution time based on the sign of deltaTime1 using the determination method; The fourth step is to compare the absolute value of deltaTime1 with the value of one division on the wheel to determine the time compensation. Fifth step: When the absolute value of deltaTime1 is determined to be greater than the value of one wheel scale, the determination module sends it to the calculation module, which obtains the position of the wheel scale value of the execution compensation time through the value acquisition method, and then sends it to the output module. The output module sends it to the monitoring and alarm module for time compensation. Step 6: Clear the compensated deltaTime1 count to zero.
[0011] Preferably, the determination method includes the following steps: If S1 and deltaTime1 are positive, it means that the currently executing function has delayed deltaTime. If S2, deltaTime1 is negative, it means that the currently executing function has advanced the deltaTime by the specified time.
[0012] Preferably, the method of obtaining the value is to use the remainder of delayTime divided by the time wheel scale as the compensation time wheel scale value.
[0013] The technical effects and advantages of this invention are as follows: This invention achieves precise time synchronization by designing a time wheel and a compensation unit, calculating time increments, and further adjusting for clock drift. Each node then only needs to record the local time increment and send it synchronously to the time wheel. This method is simple and fast, eliminating the need for precise calculations by each node, thereby reducing the complexity of the system and hardware. Attached Figure Description
[0014] Figure 1 This is a schematic diagram of the system control connection of the present invention. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Example 1: The present invention provides as follows Figure 1 The present invention discloses a time compensation system for solving the delay of monitoring and alarming of smart network cards. The time compensation system for solving the delay of monitoring and alarming of smart network cards includes a monitoring and alarm unit. The monitoring and alarm unit is equipped with a time wheel for timing. The time wheel is composed of multiple linked lists. The linked lists are equipped with Entry, curTime, wheelSize, delayTime, deltaTime and lastTime. One end of the monitoring and alarm unit is equipped with a compensation unit for delay compensation. The compensation unit includes an input unit, a calculation unit, a judgment unit and an output unit.
[0017] Specifically, the monitoring and alarm unit includes a monitoring and alarm module. The output terminal of the monitoring and alarm module is electrically connected to the input unit, and the output unit is electrically connected to the input terminal of the monitoring and alarm module. deltaTime is used to represent the predetermined time error of the Entry, and lastTime is used to represent the timestamp of the last execution.
[0018] Furthermore, the time wheel is a circular array used to store timed tasks. Its working principle is similar to the dial of a clock. The time wheel consists of two parts: a circular array and a pointer to traverse the circular array. Each element in the time wheel is a container for storing timed tasks. When a timed task is added to the time wheel, its array index is calculated based on its execution time. If multiple timed tasks exist at a certain time scale, they are stored using a doubly linked list. The current time wheel consists of tickMs, wheelSize, startMs, interval, currentTime, and buck... The system consists of multiple components such as ts, TimerTaskList, TimerTaskEntry, delayTime, expireTime, queue, and taskCounter. The compensation system of this invention mainly uses some of these components. It adds two data points to the instance structure of each grid linked list of the time wheel in the existing smart network card SoC system monitoring module: deltaTime and lastTime. deltaTime is in microseconds. After the smart network card is powered on and the monitoring and alarm module is started, the time wheel rotates and the Entry of each grid linked list task is pushed, and the size of the new deltaTime1 at this time is calculated.
[0019] Specifically, the input unit includes an input module for receiving information transmitted from the monitoring and alarm module; the calculation unit includes a calculation module for calculating the magnitude of deltaTime1 and the scale of the compensation time; the judgment unit includes a judgment module for determining the sign of deltaTime1 and the magnitude of deltaTime1 relative to the wheel scale; and the output unit includes an output module for outputting time compensation information. The calculation method for deltaTime1 is as follows: (1); Where deltaTime and lastTime are the deltaTime and lastTime of the new Entry after the callback function is executed, curTime is the current execution time, and wheelSize is the time scale of the linked list.
[0020] Furthermore, after deltaTime1 is calculated, the value of curTime is assigned to lastTime. Through this method, the present invention achieves the following advantages: generation of time compensation increments; each node generates a time increment locally and records it on the time wheel; adjustment of the local time wheel; each node adjusts its next execution time according to the time increment to achieve time synchronization in the smart NIC SoC system; compensation for network latency and hardware clock skew; by adjusting the time increment of the time wheel, network latency and hardware clock skew can be effectively compensated, improving the time synchronization accuracy in the smart NIC SoC system. This effectively compensates for network latency, hardware clock skew, or time wheel delay caused by a large number of tasks in a distributed system, while reducing system complexity and minimizing time synchronization errors.
[0021] Reduced system complexity: This invention reduces the complexity of time synchronization in smart NIC SoC systems and reduces time synchronization errors through a simplified method.
[0022] Example 2: A time compensation method for solving the problem of monitoring and alarm delay in smart network cards, using the compensation system of Example 1. The compensation method includes the following steps: The first step is to have the monitoring and alarm module forward messages normally and then push the reporting time wheel. After the callback function is executed, the deltaTime and lastTime of the Entry are updated. The second step is that the monitoring and alarm module sends the information to the input module, and the input module sends the information to the calculation module. Based on deltaTime, curTime, lastTime and wheelSize, the deltaTime1 value is calculated, and the calculation result is sent to the judgment module. The third step is for the determination module to first determine the result of the current function execution time based on the sign of deltaTime1 using the determination method; Furthermore, if the resulting deltatime1 value is positive, it means that the currently executing function has delayed deltatime by a certain amount of time; if it is negative, it means that the currently executing function has advanced deltatime1 by a certain amount of time.
[0023] The fourth step is to compare the absolute value of deltaTime1 with the value of one division on the wheel to determine the time compensation. Furthermore, each increment on the roulette wheel represents a specific time span.
[0024] Fifth step: When the absolute value of deltaTime1 is determined to be greater than the value of one wheel scale, the determination module sends it to the calculation module, which obtains the position of the wheel scale value of the execution compensation time through the value acquisition method, and then sends it to the output module. The output module sends it to the monitoring and alarm module for time compensation. Furthermore, when the absolute value of deltaTime1 is greater than the value of one wheel scale and deltaTime1 is positive, the delayed time will be compensated for by the scale corresponding to the time wheel value in advance when the next wheel is repositioned. When the absolute value of deltaTime1 is greater than the value of one wheel scale and deltaTime1 is negative, the delayed time will be compensated for by the scale corresponding to the time wheel value in delay when the next wheel is repositioned.
[0025] Step 6: Clear the compensated deltaTime1 count to zero.
[0026] The determination method includes the following steps: If S1 and deltaTime1 are positive, it means that the currently executing function has delayed deltaTime. If S2, deltaTime1 is negative, it means that the currently executing function has advanced the deltaTime by the specified time.
[0027] The value is determined by dividing delayTime by the time wheel scale value, and the remainder is used as the compensation time wheel scale value.
[0028] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A time compensation system for solving the problem of monitoring and alarm delay in smart network cards, characterized in that, The compensation system includes a monitoring and alarm unit, which has a time wheel for timing. The time wheel is composed of multiple linked lists, and each linked list has an entry, a curTime, a wheelSize, a delayTime, a deltaTime, and a lastTime. One end of the monitoring and alarm unit is equipped with a compensation unit for delay compensation, which includes an input unit, a calculation unit, a judgment unit, and an output unit. The input unit includes an input module, which is used to receive information transmitted by the monitoring and alarm module. The calculation unit includes a calculation module, which is used to calculate the size of deltaTime1 and the scale of the compensation time. The determination unit includes a determination module, which is used to determine the sign of deltaTime1 and the size of deltaTime1 relative to the wheel scale. The output unit includes an output module, which is used to output time compensation information.
2. The time compensation system for solving the problem of monitoring and alarm delay of intelligent network cards according to claim 1, characterized in that, The monitoring and alarm unit includes a monitoring and alarm module, the output terminal of which is electrically connected to the input unit, and the output unit is electrically connected to the input terminal of the monitoring and alarm module.
3. The time compensation system for solving the problem of monitoring and alarm delay of intelligent network cards according to claim 1, characterized in that, The deltaTime is used to represent the predetermined time error of the Entry, and the lastTime is used to represent the timestamp of the last execution.
4. The time compensation system for solving the delay in monitoring and alarming of intelligent network cards according to claim 1, characterized in that, The deltaTime1 is calculated as follows: (1); Where deltaTime and lastTime are the deltaTime and lastTime of the new Entry after the callback function is executed, curTime is the current execution time, and wheelSize is the time scale of the linked list.
5. A time compensation method for solving the problem of monitoring and alarm delay in smart network cards, characterized in that, The time compensation system for solving the delay in monitoring and alarming of smart network cards as described in any one of claims 1-4 includes the following steps: The first step is to have the monitoring and alarm module forward messages normally and then push the reporting time wheel. After the callback function is executed, the deltaTime and lastTime of the Entry are updated. The second step is that the monitoring and alarm module sends the information to the input module, and the input module sends the information to the calculation module. Based on deltaTime, curTime, lastTime and wheelSize, the deltaTime1 value is calculated, and the calculation result is sent to the judgment module. The third step is for the determination module to first determine the result of the current function execution time based on the sign of deltaTime1 using the determination method; The fourth step is to compare the absolute value of deltaTime1 with the value of one division on the wheel to determine the time compensation. Fifth step: When the absolute value of deltaTime1 is determined to be greater than the value of one wheel scale, the determination module sends it to the calculation module, which obtains the position of the wheel scale value of the execution compensation time through the value acquisition method, and then sends it to the output module. The output module sends it to the monitoring and alarm module for time compensation. Step 6: Clear the compensated deltaTime1 count to zero.
6. The time compensation method for solving the problem of monitoring and alarm delay of intelligent network cards according to claim 5, characterized in that, The determination method includes the following steps: If S1 and deltaTime1 are positive, it means that the currently executing function has delayed deltaTime1 time. If S2, deltaTime1 is negative, it means that the currently executing function has advanced deltaTime1 by the specified time.
Citation Information
Patent Citations
High-availability distributed real-time alarm processing method and high-availability distributed real-time alarm processing system
CN112671560A
Detecting time delay between circuits to achieve time synchronization
US20220329339A1