A system index monitoring apparatus, method, device and medium

The system indicator monitoring device solves the problem of insufficient flexibility in traditional monitoring solutions, enabling flexible collection and export of system indicators to adapt to emergencies and instantaneous changes in status.

CN115629941BActive Publication Date: 2026-06-02GUANGZHOU WERIDE TECH LTD CO

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GUANGZHOU WERIDE TECH LTD CO
Filing Date
2022-11-10
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Traditional system indicator monitoring solutions cannot cope with the ever-increasing quantity, type, and format of module information, resulting in low flexibility and an inability to handle sudden situations or instantaneous changes in status. They can only proactively collect system indicators.

Method used

A system indicator monitoring device is provided, including a main module, an indicator acquisition management module, and an indicator export management module. The main module instantiates the indicator acquisition management module and the indicator export management module, registers the indicator export components, uses the indicator acquisition management module to initialize and the event-driven module to load multiple indicator acquisition components from the indicator collector pool, realizes periodic and event-driven indicator acquisition, and exports system indicators through the indicator export management module.

Benefits of technology

The program has improved the programming flexibility of the system indicator components, added passive event-triggered functionality, provided system indicator export functionality, and enabled more flexible system indicator collection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115629941B_ABST
    Figure CN115629941B_ABST
Patent Text Reader

Abstract

The application discloses a system index monitoring device, method, equipment and medium, the device includes main module, index collection management module and index export management module, the main module is used for responding to the received configuration file, instantiates index collection management module and index export management module, and registers index export component to index export management module;Index collection management module is used for initializing collection module and event-driven module, and loading multiple index collection components from index collector pool;Collection module is used for periodically waking up index collection component to execute index collection, and obtains first system index;Event-driven module is used for waking up target event associated index collection component to execute index collection when listening to target event, and obtains second system index;Index export management module is used for calling index export component to export first system index and / or second system index. Thus, the collection of system indexes is more flexible.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of system monitoring technology, and in particular to a device, method, equipment, and medium for monitoring system indicators. Background Technology

[0002] With the continuous development of autonomous driving technology, the functions of autonomous driving systems are becoming increasingly sophisticated. Current autonomous driving systems possess a vast and complex software architecture, including artificial intelligence models and autonomous driving frameworks. These systems also constantly run numerous processes that share many system resources, such as CPU, memory, and I / O.

[0003] When an autonomous driving system encounters problems due to resource constraints, it is often impossible to accurately determine the root cause of the problem by looking at a single module. In this case, it is necessary to analyze the internal state of the entire system. Therefore, information about each module can be obtained by acquiring multiple system indicators and components.

[0004] However, as the quantity, types, and formats of module information continue to increase, traditional system indicator monitoring solutions typically acquire indicators through their respective system indicator acquisition components. These solutions are unable to cope with sudden situations or instantaneous state changes and only actively collect system indicators, resulting in low flexibility. Summary of the Invention

[0005] This invention provides a system indicator monitoring device, method, equipment, and medium, which solves the technical problem that as the quantity, type, and format of module information continue to increase, traditional system indicator monitoring schemes usually acquire indicators through their respective system indicator acquisition components, and cannot cope with sudden situations or instantaneous state changes. They only actively collect system indicators, resulting in low flexibility.

[0006] The first aspect of the present invention provides a system indicator monitoring device, comprising a main module, an indicator acquisition and management module, and an indicator export and management module;

[0007] The main module is used to respond to the received configuration file, instantiate the indicator collection management module and the indicator export management module, and register the indicator export component to the indicator export management module.

[0008] The indicator collection and management module is used to initialize the collection module and the event-driven module, and load multiple indicator collection components from the indicator collector pool;

[0009] The acquisition module is used to periodically wake up the indicator acquisition component to perform indicator acquisition and obtain the first system indicator;

[0010] The event-driven module is used to wake up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator when the target event is detected.

[0011] The indicator export management module is used to call the indicator export component to export the first system indicator and / or the second system indicator.

[0012] Optionally, the main module is further configured to:

[0013] After registering the indicator export component to the indicator export management module, it switches to dormant state;

[0014] If a monitoring end signal is received, the indicator acquisition management module and the indicator export management module are deleted.

[0015] Optionally, the indicator collection and management module further includes an indicator communication interface;

[0016] The indicator communication interface is used to obtain operating parameter information from the indicator collection management module and transmit it to the indicator collection component when the indicator collection component is loaded.

[0017] Optionally, the acquisition module is specifically used for:

[0018] The periodic collection configuration information is obtained from the indicator collection management module through the indicator communication interface.

[0019] The wake-up cycle and the first wake-up component information are determined according to the periodic collection configuration information.

[0020] The first system indicator is obtained by waking up the indicator collection component corresponding to the first wake-up component information according to the wake-up cycle.

[0021] Optionally, the event-driven module is specifically used for:

[0022] Target event information is obtained from the indicator collection and management module through the indicator communication interface;

[0023] Extract the target event and associated second wake-up component information from the target event information;

[0024] When the target event is detected, the indicator collection component associated with the second wake-up component is woken up to perform indicator collection and obtain the second system indicator.

[0025] Optionally, the indicator communication interface adopts the Protobuf communication protocol.

[0026] Optionally, the indicator acquisition component includes a first sampling interface, and the indicator export component includes an export communication interface. The indicator acquisition component is used for:

[0027] In response to a wake-up signal sent by the acquisition module and / or the event-driven module, determine the acquisition module specified by the wake-up signal;

[0028] The system metrics are collected from the module to be collected by calling the first sampling interface, and the system metrics are serialized to generate a first system metric and / or a second system metric, as well as a first data description.

[0029] The first data description, the first system indicator, and / or the second system indicator are transmitted to the indicator export component through the export communication interface.

[0030] Optionally, the indicator export component is used for:

[0031] Deserialize the first system indicator and / or the second system indicator according to the first data description to generate data structure information and system indicator content;

[0032] Export the data structure information and the system indicator content to the target disk or network location.

[0033] Optionally, the indicator acquisition component includes a second sampling interface and component memory, and the indicator export component includes an export communication interface. The indicator acquisition component is used for:

[0034] In response to a wake-up signal sent by the acquisition module and / or the event-driven module, determine the acquisition module specified by the wake-up signal;

[0035] The first sampling interface is invoked to collect system indicators from the module to be collected and store them in the component memory, generating an indicator memory that stores the first system indicator and / or the second system indicator, as well as a second data description;

[0036] The indicator memory and the second data description are transmitted to the indicator export component through the export communication interface;

[0037] Optionally, the indicator export component is used for:

[0038] Read the memory layout of the indicator memory according to the second data description;

[0039] Export the corresponding first system metrics and / or second system metrics to the target disk or network location according to the memory layout.

[0040] Optionally, the indicator collection and management module is further used for:

[0041] When an updated configuration file is received, the new metric collection component is loaded and added to the metric collector pool according to the updated configuration file.

[0042] Optionally, the device further includes a self-test module;

[0043] The self-test module is used to monitor the operational status information of the acquisition module and the indicator export component in real time.

[0044] A second aspect of the present invention provides a method for monitoring system indicators, comprising:

[0045] The main module responds to the received configuration file, instantiates the indicator collection management module and the indicator export management module, and registers the indicator export component to the indicator export management module.

[0046] The indicator collection management module initializes the collection module and the event-driven module, and loads multiple indicator collection components from the indicator collector pool.

[0047] The acquisition module periodically wakes up the indicator acquisition component to perform indicator acquisition, thereby obtaining the first system indicator;

[0048] When a target event is detected, the event-driven module wakes up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator.

[0049] The first system indicator and / or the second system indicator can be exported by calling the indicator export component through the indicator export management module.

[0050] Optionally, the method further includes:

[0051] In response to a received access platform request, determine the platform to be used corresponding to the access platform request;

[0052] A new system indicator monitoring device is constructed by using the platform-compatible system library interface for conditional compilation.

[0053] When a compatible configuration file is received in response to the input of the module type within the platform, the compatible configuration file is compiled to generate the indicator collection component corresponding to the module type.

[0054] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a system indicator monitoring method as described in any of the second aspects of the present invention.

[0055] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed, implements a method for monitoring system indicators as described in any of the second aspects of the present invention.

[0056] As can be seen from the above technical solutions, the present invention has the following advantages:

[0057] This invention provides a system indicator monitoring device, comprising a main module, an indicator acquisition management module, and an indicator export management module. The main module, in response to a received configuration file, instantiates the indicator acquisition management module and the indicator export management module, and registers indicator export components to the indicator export management module. The indicator acquisition management module initializes the acquisition module and the event-driven module, and loads multiple indicator acquisition components from an indicator collector pool. The acquisition module periodically wakes up the indicator acquisition components to perform indicator acquisition, obtaining a first system indicator. The event-driven module, when a target event is detected, wakes up the indicator acquisition component associated with the target event to perform indicator acquisition, obtaining a second system indicator. The indicator export management module calls the indicator export component to export the first system indicator and / or the second system indicator. This provides necessary middleware to reduce the programming difficulty of system indicator components, adds passive event-triggered functionality to the active acquisition method of system indicators, and provides system indicator export functionality, enabling more flexible acquisition of system indicators. Attached Figure Description

[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0059] Figure 1 A structural block diagram of a system indicator monitoring device provided in an embodiment of the present invention;

[0060] Figure 2 A schematic diagram of an instantiated configuration file provided in an embodiment of the present invention;

[0061] Figure 3 A structural block diagram of a system indicator monitoring device provided in an embodiment of the present invention;

[0062] Figure 4 A flowchart illustrating the steps of a system indicator monitoring method provided in an embodiment of the present invention. Detailed Implementation

[0063] This invention provides a system indicator monitoring device, method, equipment, and medium to address the technical problem that traditional system indicator monitoring schemes typically acquire indicators through their respective system indicator acquisition components as the quantity, type, and format of module information continue to increase. These schemes are unable to cope with sudden situations or instantaneous state changes and only actively collect system indicators, resulting in low flexibility.

[0064] To make the objectives, features, and advantages of this invention more apparent and understandable, the technical solutions of the embodiments of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described below are only some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0065] Please see Figure 1 , Figure 1 This is a structural block diagram of a system indicator monitoring device provided in an embodiment of the present invention.

[0066] The present invention provides a system indicator monitoring device, comprising a main module 101, an indicator acquisition and management module 102, and an indicator export and management module 103;

[0067] Main module 101 is used to respond to the received configuration file, instantiate the indicator collection management module and the indicator export management module, and register the indicator export component to the indicator export management module.

[0068] Configuration files refer to computer configuration parameters and initial settings that record information about modules such as the indicator collection and management module and the indicator export and management module. For example, when the indicator collection and management module (collector manager) is instantiated, the thread pool size needs to be configured; when the collection module (sampling module) is instantiated, the sampling resolution needs to be configured, etc. Specific details can be found in... Figure 2 As shown.

[0069] The metrics collection management module manages all metrics collection components (collectors). Specifically, it manages the lifecycle of all metrics collection components, including their creation, operation, and destruction. It also provides middleware support for both active and passive information collection by the metrics collection components, namely the collection module and the event-driven module.

[0070] The indicator export management module refers to the module that manages all indicator export components, specifically managing their lifecycle, including the registration and destruction of indicator export components.

[0071] In this embodiment of the invention, when the main module receives the configuration file, it parses the configuration file to instantiate the indicator acquisition management module and the indicator export management module. At the same time, it registers the corresponding indicator export component to the indicator export management module according to the content of the configuration file, and establishes a synchronous or asynchronous communication channel between the indicator export component and the indicator acquisition component to complete the initialization of the operating environment.

[0072] The indicator collection and management module 102 is used to initialize the collection module 1021 and the event-driven module 1022, and load multiple indicator collection components from the indicator collector pool.

[0073] Once the indicator collection and management module is instantiated by the main module, it instantiates its associated collection modules and event-driven modules. At the same time, it transmits necessary operating parameters to multiple indicator collection components in the preset indicator collector pool through the indicator collection interface, such as the wake-up cycle and initialization parameters of the indicator collection components, in order to complete the loading of all indicator collection components in the indicator collector pool.

[0074] It should be noted that the indicator collector pool can pre-store multiple indicator collection components and respond to input update configuration files to add new indicator collection components.

[0075] The data acquisition module 1021 is used to periodically wake up the indicator acquisition component to perform indicator acquisition and obtain the first system indicators;

[0076] Once the acquisition module is successfully initialized, it periodically wakes up at least one indicator acquisition component according to a preset cycle. The indicator acquisition component then collects system indicators from each autonomous driving system that needs to be monitored, thereby obtaining the first system indicator and completing the active acquisition of system indicators for the autonomous driving system.

[0077] Event-driven module 1022 is used to wake up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator when the target event is detected.

[0078] Meanwhile, once the event-driven module is successfully initialized, it monitors various target events of the autonomous driving system in real time. When a target event is detected, it wakes up the indicator acquisition component associated with the target event to collect indicators of the autonomous driving system and obtain the second system indicator.

[0079] It should be noted that the type and content of the first or second system indicators collected are not limited in this embodiment of the invention.

[0080] The indicator export management module 103 is used to call the indicator export component to export the first system indicators and / or the second system indicators.

[0081] In this embodiment, after the indicator export management module is instantiated and the indicator acquisition component acquires the first system indicator and / or the second system indicator, the indicator export management module calls the corresponding indicator export component to export the first system indicator and / or the second system indicator to the hard disk or for network transmission.

[0082] It should be noted that the specific export behavior can be achieved by calling different types of indicator export components through the indicator export management module. Each indicator export component can correspond to different transmission locations or export behaviors. The specific content of this embodiment of the invention is not limited in this regard.

[0083] This invention provides a system indicator monitoring device, including a main module, an indicator acquisition management module, and an indicator export management module. The main module, in response to a received configuration file, instantiates the indicator acquisition management module and the indicator export management module, and registers indicator export components to the indicator export management module. The indicator acquisition management module initializes the acquisition module and the event-driven module, and loads multiple indicator acquisition components from an indicator collector pool. The acquisition module periodically wakes up the indicator acquisition components to perform indicator acquisition and obtain a first system indicator. The event-driven module, when a target event is detected, wakes up the indicator acquisition component associated with the target event to perform indicator acquisition and obtain a second system indicator. The indicator export management module calls the indicator export component to export the first system indicator and / or the second system indicator. This provides necessary middleware to reduce the programming difficulty of system indicator components, adds passive event-triggered functionality to the active acquisition method of system indicators, and provides system indicator export functionality, enabling more flexible acquisition of system indicators.

[0084] Please see Figure 3 , Figure 3 This is a structural block diagram of a system indicator monitoring device provided in an embodiment of the present invention.

[0085] The present invention provides a system indicator monitoring device, comprising a main module 201, an indicator acquisition and management module 202, and an indicator export and management module 203;

[0086] Main module 201 is used to respond to the received configuration file, instantiate the indicator collection management module and the indicator export management module, and register the indicator export component to the indicator export management module.

[0087] Optionally, the main module 201 is also used for:

[0088] Once the registered metric export component is transferred to the metric export management module, it will switch to dormant mode.

[0089] If a monitoring end signal is received, the indicator acquisition management module and the indicator export management module will be deleted.

[0090] In this embodiment of the invention, after the main module registers the indicator export component to the indicator export management module, the main module is switched to a dormant state to reduce the resource consumption of the device. At this time, the indicator acquisition management module and the indicator export management module call the indicator acquisition component to collect and export system indicators.

[0091] Once system metrics have been collected and exported, the metric export management module can send a monitoring end signal to the main module, at which point the main module will delete both the metric collection management module and the metric export management module. Similarly, if other metric collection and export components need to be deleted, they can also send a monitoring end signal to the main module, allowing the main module to remove them.

[0092] The indicator collection management module 202 is used to initialize the collection module 2021 and the event-driven module 2022, and load multiple indicator collection components from the indicator collector pool.

[0093] Optionally, the indicator collection and management module is also used for:

[0094] When an updated configuration file is received, the new metric collection component is loaded into the metric collector pool according to the updated configuration file.

[0095] In this embodiment of the invention, when the indicator collection management module receives an updated configuration file, it parses the updated configuration file to identify new indicator collection components and adds them to the indicator collector pool, thereby realizing the plug-inization of indicator collection components.

[0096] In practical implementation, for the device framework, achieving platform compatibility requires programming with platform-compatible system library interfaces, such as standard C / C++ libraries and POSIX-compliant libraries. Platform-related tasks, such as acquiring specific hardware information, are then extracted and assigned to the metric acquisition component. During implementation, the metric acquisition component can use kernel technologies like perf or ebpf to acquire kernel-related metrics. For modules specific to a particular platform, selection is made at the compilation level, and different metric acquisition components are loaded based on updated configuration files to achieve overall platform compatibility.

[0097] The data acquisition module 2021 is used to periodically wake up the indicator acquisition component to perform indicator acquisition and obtain the first system indicators;

[0098] The event-driven module 2022 is used to wake up the indicator collection component associated with the target event when the target event is detected to perform indicator collection and obtain the second system indicator.

[0099] In one example of the present invention, the indicator collection and management module further includes an indicator communication interface;

[0100] The indicator communication interface is used to obtain running parameter information from the indicator acquisition management module and transmit it to the indicator acquisition component when the indicator acquisition component is loaded.

[0101] The indicator communication interface is also used for the interface protocol used by the indicator collection management module and the indicator collection component for communication. For example, how to instantiate the indicator collection component, how to trigger the indicator collection component to collect information, how to collect the information collected by the indicator collection component or export it to the indicator export module for data storage, etc., are all communicated through this interface.

[0102] Furthermore, the data acquisition module is specifically used for:

[0103] Obtain periodic data collection configuration information from the indicator collection management module through the indicator communication interface;

[0104] The wake-up cycle and the first wake-up component information are determined by collecting configuration information periodically.

[0105] The first system indicator is obtained by waking up the indicator collection component corresponding to the first wake-up component information according to the wake-up cycle.

[0106] Optionally, the event-driven module is specifically used for:

[0107] Target event information is obtained from the indicator collection and management module through the indicator communication interface;

[0108] Extract the target event and associated second wake-up component information from the target event information;

[0109] When the target event is detected, the indicator collection component associated with the second wake-up component is activated to perform indicator collection and obtain the second system indicator.

[0110] In this embodiment of the invention, the acquisition module obtains periodic acquisition configuration information from the indicator acquisition management module through the indicator communication interface, determines the wake-up period and first wake-up component information corresponding to each indicator acquisition component according to the periodic acquisition configuration information, wakes up the indicator acquisition component corresponding to the first wake-up component information according to the wake-up period, and uses the indicator acquisition component to perform indicator acquisition to obtain the first system indicator.

[0111] At the same time, the event-driven module obtains target event information from the indicator collection and management module through the indicator communication interface. This information may include at least one target event, from which all target events and the associated second wake-up component information are extracted.

[0112] When any target event is detected, the indicator collection component associated with the second wake-up component is activated. The indicator collection components then collect indicators from the autonomous driving system or modules within the autonomous driving system where the target event occurred, thereby obtaining the second system indicator.

[0113] Optionally, the indicator communication interface uses the Protobuf communication protocol.

[0114] In this embodiment of the invention, since the information formats of the system indicators collected by various indicator collection components are different, in order to achieve universal collection of system indicators, this device can use the Protobuf communication protocol as the type protocol for transmitting system indicators. Protobuf is an open-source data serialization library developed by Google.

[0115] In one example of the present invention, the indicator acquisition component includes a first sampling interface, and the indicator export component includes an export communication interface. The indicator acquisition component is used for:

[0116] Responding to the wake-up signal sent by the acquisition module and / or the event-driven module, determine the acquisition module specified by the wake-up signal;

[0117] The system metrics are collected from the module to be collected by calling the first sampling interface, and the system metrics are serialized to generate the first system metrics and / or the second system metrics, as well as the first data description.

[0118] The first data description, the first system indicator, and / or the second system indicator are transmitted to the indicator export component via the export communication interface.

[0119] In this embodiment of the invention, the indicator acquisition component includes a first sampling interface, and the indicator export component includes an export communication interface. The indicator acquisition component responds to a wake-up signal sent by the acquisition module and / or the event-driven module to determine the module to be acquired specified by the wake-up signal, further calls the first sampling interface to acquire system indicators from the module to be acquired, and serializes the system indicators to generate a first system indicator and / or a second system indicator, as well as a first data description; the first data description, the first system indicator, and / or the second system indicator are transmitted to the indicator export component through the export communication interface.

[0120] In this embodiment, the indicator export component is used for:

[0121] Deserialize the first system indicators and / or the second system indicators according to the first data description to generate data structure information and system indicator content;

[0122] Export data structure information and system metrics to the target disk or network location.

[0123] After the indicator export component receives the first data description, it deserializes the first system indicator and / or the second system indicator according to the first data description, generates data structure information and system indicator content, and exports it to the target disk or network location.

[0124] It should be noted that after the indicator export management module is instantiated, a thread pool is started to wait for information input. After receiving the indicator export component registration from the main module, the corresponding indicator export component is registered. When information is input, threads in the thread pool are responsible for injecting the information into the various registered indicator export components to complete the export work. Information can also be filtered or preprocessed if necessary during injection.

[0125] In another example of the present invention, the indicator acquisition component includes a second sampling interface and component memory, and the indicator export component includes an export communication interface. The indicator acquisition component is used for:

[0126] Responding to the wake-up signal sent by the acquisition module and / or the event-driven module, determine the acquisition module specified by the wake-up signal;

[0127] The first sampling interface is called to collect system metrics from the module to be collected and store them in the component memory, generating a metric memory that stores the first system metrics and / or the second system metrics, as well as a second data description;

[0128] The indicator memory and second data description are transferred to the indicator export component via the export communication interface.

[0129] Optionally, the indicator export component is used for:

[0130] Read the memory layout of the indicator memory according to the second data description;

[0131] Export the corresponding first system metrics and / or second system metrics to the target disk or network location according to the memory layout.

[0132] In the specific implementation, data is passed through the public base class type message of protobuf and the second data description describing the data. This method avoids the time overhead of serialization and deserialization, and directly passes the indicator memory of the indicator collection component to the indicator export component. The indicator export component directly reads the data according to the memory layout defined by the indicator collection component through the data description of the second data description, and exports the corresponding first system indicator and / or second system indicator to the target disk or network location according to the memory layout.

[0133] protobuf itself has corresponding optimizations for memory allocation of new protobuf data types. Here, in order to obtain better performance, the system memory allocation component can be combined with tcmalloc to reduce or even eliminate the number of system memory allocations, thereby significantly improving performance.

[0134] In the specific implementation, two different collectors are given as examples:

[0135] One approach is a collector process that reads metrics from the / proc filesystem:

[0136] 1. When the collector is instantiated and loaded into the collector_manager, the preparation work for the relevant metrics is initialized. If the preparation of the relevant environment fails, the loading of the collector_manager will fail.

[0137] 2. When the sampling period arrives, the framework calls the collector's sampling interface.

[0138] 3. The collector sampling interface starts working, collecting relevant data from / proc and recording it in protobuf. Multiple data entries are stored in multiple protobuf entries.

[0139] 4. Transfer the collected vector <protobuf>The data is returned to the framework, which processes it slightly (adding metric tags and timestamps, etc.) before sending it to the exporter module for output.

[0140] Another collector process for reading kernel metrics via BPF:

[0141] Prior knowledge: BPF code is divided into two parts. One part is kernel-mode code, which is used to dynamically instrument kernel code, collect data, and send it to user space through BPF map. The other part is user-mode code, which is used to receive the data sent back by kernel-mode code and process it.

[0142] 1. When the collector is instantiated and loaded into the collector_manager, initialization work is performed, which requires dynamically instrumenting kernel-mode code into specified kernel code locations. If instrumentation fails, the collector loading process will fail.

[0143] 2. When the sampling period arrives, the framework calls the collector's sampling interface.

[0144] 3. The collector user-mode code is invoked to collect and summarize the data measured by the kernel-mode code during this period, and records the data in protobuf, which is consistent with the remaining process of the previous collector.

[0145] Besides the two methods mentioned above—obtaining data from / proc and bpf—there are many other ways to collect data. For example, data can be obtained through proprietary module APIs, such as obtaining GPU-related data through NVIDIA's API, or through Dynamst user-space library function dynamic instrumentation (a data collection method for third-party libraries whose source code we do not have and cannot obtain data by modifying the code to add debugging code), or by obtaining the kernel function call stack that we are interested in through the Linux perf tool interface.

[0146] During runtime, CPU consumption is extremely low, approximately 0.02 CPU cores, and memory usage is less than 20MB. In our onboard environment, with collectors collecting hundreds of metrics and exporters for exporting, CPU consumption is around 0.13~0.2 ms (primarily due to collector data acquisition; collectors using the / proc filesystem consume more CPU, while those using BPF consume much less, but require more sophisticated coding skills). Memory consumption is less than 90MB (mainly due to storing the collected data asynchronously while waiting for the exporter to consume it).

[0147] The indicator export management module 203 is used to call the indicator export component to export the first system indicators and / or the second system indicators.

[0148] Furthermore, the device also includes a self-test module 204;

[0149] The self-test module 204 is used to monitor the real-time operation status information of the acquisition module and the indicator export component.

[0150] In an optional embodiment of the present invention, the system indicator monitoring device may further include a self-testing module, which can monitor the operation status information of the acquisition module and the indicator exporting module in real time, such as the indicator acquisition component performing a periodic wake-up and performing indicator acquisition, and the time required for the event-driven module to acquire indicators triggered by a target event, providing a data basis for the subsequent optimization of the device.

[0151] This invention provides a system indicator monitoring device, including a main module, an indicator acquisition management module, and an indicator export management module. The main module, in response to a received configuration file, instantiates the indicator acquisition management module and the indicator export management module, and registers indicator export components to the indicator export management module. The indicator acquisition management module initializes the acquisition module and the event-driven module, and loads multiple indicator acquisition components from an indicator collector pool. The acquisition module periodically wakes up the indicator acquisition components to perform indicator acquisition and obtain a first system indicator. The event-driven module, when a target event is detected, wakes up the indicator acquisition component associated with the target event to perform indicator acquisition and obtain a second system indicator. The indicator export management module calls the indicator export component to export the first system indicator and / or the second system indicator. This provides necessary middleware to reduce the programming difficulty of system indicator components, adds passive event-triggered functionality to the active acquisition method of system indicators, and provides system indicator export functionality, enabling more flexible acquisition of system indicators.

[0152] Please see Figure 4 , Figure 4 A flowchart illustrating the steps of a system indicator monitoring method according to an embodiment of the present invention is shown.

[0153] This invention provides a method for monitoring system metrics, including:

[0154] Step 301: In response to the received configuration file from the main module, instantiate the indicator collection management module and the indicator export management module, and register the indicator export component to the indicator export management module.

[0155] Step 302: Initialize the acquisition module and event-driven module through the indicator acquisition management module, and load multiple indicator acquisition components from the indicator collector pool;

[0156] Step 303: The data acquisition module periodically wakes up the indicator acquisition component to perform indicator acquisition and obtain the first system indicators;

[0157] Step 304: When the target event is detected, the event-driven module wakes up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator.

[0158] Step 305: Use the indicator export management module to call the indicator export component to export the first system indicators and / or the second system indicators.

[0159] Optionally, the method further includes the following steps:

[0160] In response to a received access platform request, determine the platform to be used corresponding to the access platform request;

[0161] A new system indicator monitoring device is constructed by using the platform-compatible system library interface for conditional compilation.

[0162] When a compatible configuration file is received in response to the input of the module type within the platform, the compatible configuration file is compiled to generate the indicator collection component corresponding to the module type.

[0163] In this embodiment of the invention, after receiving an access platform request, the device framework can first determine the platform corresponding to the access platform request and implement it using a platform-compatible library, such as a POSIX-compatible library or a C++ standard library. By using platform-compatible system library interfaces for conditional compilation, a system indicator monitoring device compatible with the platform can be constructed.

[0164] Furthermore, as a system for collecting system metrics, many platform-specific metrics inevitably have compatibility issues. These are addressed by having each collector handle these issues independently, thus ensuring the framework's overall compatibility. Platform-specific issues refer to things like metrics available only on Intel x86 CPUs not being available on ARM CPUs, or information only supported in higher versions of the Linux kernel, which lower kernel versions don't support. Due to the nature of autonomous driving systems, they need to support both x86 and ARM architectures, with different kernel versions running on different architectures. Operating systems also need to support Linux and QNX. These platform differences are significant, making it difficult to write a monitoring platform for each one. Therefore, the framework needs to be able to run anywhere without code changes. Differences between platforms can be addressed by loading platform-compatible collectors. To this end, based on the module types within the platform that require system metric collection, corresponding compatibility configuration files are input, and these files are compiled to adapt the metric collection components for various platforms and module types.

[0165] In this embodiment of the invention, the main module responds to the received configuration file, instantiates the indicator collection management module and the indicator export management module, and registers the indicator export component to the indicator export management module. The indicator collection management module initializes the collection module and the event-driven module, and loads multiple indicator collection components from the indicator collector pool. The collection module periodically wakes up the indicator collection components to perform indicator collection, obtaining the first system indicator. When the event-driven module detects a target event, it wakes up the indicator collection component associated with the target event to perform indicator collection, obtaining the second system indicator. The indicator export management module calls the indicator export component to export the first system indicator and / or the second system indicator. This provides necessary middleware to reduce the programming difficulty of the system indicator components, adds passive event-triggered functionality to the active system indicator collection method, and provides system indicator export functionality, enabling more flexible implementation of system indicator collection.

[0166] This invention provides an electronic device, including a memory and a processor. The memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of a system indicator monitoring method as described in any embodiment of this invention.

[0167] This invention provides a computer-readable storage medium storing a computer program thereon, which, when executed, implements a system indicator monitoring method as described in any embodiment of this invention.

[0168] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0169] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0170] The units described as separate components may or may not be physically separate. 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 units can be selected to achieve the purpose of this embodiment according to actual needs.

[0171] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0172] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0173] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such 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 invention.< / protobuf>

Claims

1. A monitoring device for system indicators, characterized in that, It includes a main module, an indicator collection and management module, and an indicator export and management module; The main module is used to respond to the received configuration file, instantiate the indicator collection management module and the indicator export management module, and register the indicator export component to the indicator export management module. The indicator collection and management module is used to initialize the collection module and the event-driven module, and load multiple indicator collection components from the indicator collector pool; The acquisition module is used to periodically wake up the indicator acquisition component to perform indicator acquisition and obtain the first system indicator; The event-driven module is used to wake up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator when the target event is detected. The indicator export management module is used to call the indicator export component to export the first system indicator and / or the second system indicator; The indicator acquisition component includes a first sampling interface, a second sampling interface, and component memory; the indicator export component includes an export communication interface; the indicator acquisition component is used for: In response to a wake-up signal sent by the acquisition module and / or the event-driven module, the module to be acquired specified by the wake-up signal is determined; the module to be acquired is any module within the autonomous driving system, and the autonomous driving system has different architectures or different operating system kernels; The system metrics are collected from the module to be collected by calling the first sampling interface, and the system metrics are serialized to generate a first system metric and / or a second system metric, as well as a first data description. The first data description, the first system indicator, and / or the second system indicator are transmitted to the indicator export component through the export communication interface. or, The second sampling interface is invoked to collect system indicators from the module to be collected and store them in the component memory, generating an indicator memory that stores the first system indicator and / or the second system indicator, as well as a second data description; The indicator memory and the second data description are transmitted to the indicator export component through the export communication interface.

2. The apparatus according to claim 1, characterized in that, The main module is also used for: After registering the indicator export component to the indicator export management module, it switches to dormant state; If a monitoring end signal is received, the indicator acquisition management module and the indicator export management module are deleted.

3. The apparatus according to claim 1, characterized in that, The indicator collection and management module also includes an indicator communication interface; The indicator communication interface is used to obtain operating parameter information from the indicator collection management module and transmit it to the indicator collection component when the indicator collection component is loaded.

4. The apparatus according to claim 3, characterized in that, The acquisition module is specifically used for: The periodic collection configuration information is obtained from the indicator collection management module through the indicator communication interface. The wake-up cycle and the first wake-up component information are determined according to the periodic collection configuration information. The first system indicator is obtained by waking up the indicator collection component corresponding to the first wake-up component information according to the wake-up cycle.

5. The apparatus according to claim 3, characterized in that, The event-driven module is specifically used for: Target event information is obtained from the indicator collection and management module through the indicator communication interface; Extract the target event and associated second wake-up component information from the target event information; When the target event is detected, the indicator collection component associated with the second wake-up component is woken up to perform indicator collection and obtain the second system indicator.

6. The apparatus according to claim 3, 4, or 5, characterized in that, The indicator communication interface uses the Protobuf communication protocol.

7. The apparatus according to claim 1, characterized in that, The indicator export component is used for: Deserialize the first system indicator and / or the second system indicator according to the first data description to generate data structure information and system indicator content; Export the data structure information and the system indicator content to the target disk or network location.

8. The apparatus according to claim 1, characterized in that, The indicator export component is used for: Read the memory layout of the indicator memory according to the second data description; Export the corresponding first system metrics and / or second system metrics to the target disk or network location according to the memory layout.

9. The apparatus according to claim 1, characterized in that, The indicator collection and management module is also used for: When an updated configuration file is received, the new metric collection component is added to the metric collector pool according to the updated configuration file.

10. The apparatus according to claim 1, characterized in that, The device also includes a self-testing module; The self-test module is used to monitor the operational status information of the acquisition module and the indicator export component in real time.

11. A method for monitoring system indicators, characterized in that, A monitoring device for system indicators according to any one of claims 1-10, the device comprising a main module, an indicator acquisition and management module, and an indicator export and management module, the method comprising: The main module responds to the received configuration file, instantiates the indicator collection management module and the indicator export management module, and registers the indicator export component to the indicator export management module. The indicator collection management module initializes the collection module and the event-driven module, and loads multiple indicator collection components from the indicator collector pool. The acquisition module periodically wakes up the indicator acquisition component to perform indicator acquisition, thereby obtaining the first system indicator; When a target event is detected, the event-driven module wakes up the indicator collection component associated with the target event to perform indicator collection and obtain the second system indicator. The first system indicator and / or the second system indicator are exported by calling the indicator export component through the indicator export management module. The indicator acquisition component includes a first sampling interface, a second sampling interface, and component memory; the indicator export component includes an export communication interface; the indicator acquisition component is used for: In response to a wake-up signal sent by the acquisition module and / or the event-driven module, the module to be acquired specified by the wake-up signal is determined; the module to be acquired is any module within the autonomous driving system, and the autonomous driving system has different architectures or different operating system kernels; The system metrics are collected from the module to be collected by calling the first sampling interface, and the system metrics are serialized to generate a first system metric and / or a second system metric, as well as a first data description. The first data description, the first system indicator, and / or the second system indicator are transmitted to the indicator export component through the export communication interface. or, The second sampling interface is invoked to collect system indicators from the module to be collected and store them in the component memory, generating an indicator memory that stores the first system indicator and / or the second system indicator, as well as a second data description; The indicator memory and the second data description are transmitted to the indicator export component through the export communication interface.

12. The method according to claim 11, characterized in that, The method further includes: In response to a received access platform request, determine the platform to be used corresponding to the access platform request; A new system indicator monitoring device is constructed by using the platform-compatible system library interface for conditional compilation. When a compatible configuration file corresponding to the module type within the platform is received, the compatible configuration file is compiled to generate the indicator collection component corresponding to the module type.

13. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the steps of the system indicator monitoring method as described in claim 11 or 12.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed, it implements the system indicator monitoring method as described in claim 11 or 12.