Event reporting method, device, apparatus, storage medium and computer program product

By using an event bus and shared sockets in the vehicle system, efficient event reporting between the kernel module and the monitoring service was achieved, solving the interaction cost problem caused by the increase of self-developed device drivers and improving event reporting efficiency and resource utilization.

CN122111703APending Publication Date: 2026-05-29SHANGHAI LIXIANG AUTOMOBILE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI LIXIANG AUTOMOBILE CO LTD
Filing Date
2024-11-29
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In vehicle systems, the increase in the types and number of self-developed device drivers leads to higher interaction costs between monitoring services and kernel modules, affecting event reporting efficiency.

Method used

The system receives exception event messages from the target kernel module via the event bus and determines the target monitoring service to parse and process them based on the event type. This reduces direct interaction between the kernel module and the monitoring service. By using shared sockets and a unified message format, the system reduces interaction and resource costs.

Benefits of technology

This improved event reporting efficiency and reduced the interaction costs and resource consumption between the kernel module and the monitoring service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111703A_ABST
    Figure CN122111703A_ABST
Patent Text Reader

Abstract

The application provides an event reporting method and device, a computer readable storage medium and a computer program product; the method comprises the following steps: receiving an abnormal event message sent by a target kernel module through an event bus, wherein the target kernel module sends the abnormal event message to the event bus when monitoring an abnormality, and the target kernel module is one of a plurality of kernel modules included in an operating system; sending the abnormal event message to a target monitoring service that subscribes to the abnormal event message, so that the target monitoring service analyzes and processes the abnormal event message after receiving the abnormal event message. Through the above method, the target kernel module and the monitoring service do not need to interact directly, the interaction cost of the kernel module and the monitoring service can be reduced, and the event reporting efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to data processing technology, and more particularly to an event reporting method, apparatus, computer-readable storage medium, and computer program product. Background Technology

[0002] In Linux systems, the reporting of kernel events by the operating system is crucial because it directly affects the system's performance, stability, and security. With the development of big data and machine learning, the automated analysis, prediction, and processing of kernel events have broad application prospects in improving the perception and response capabilities of vehicle operating systems.

[0003] In related technologies, deploying a monitoring service within the operating system is an effective and common maintenance method. When a kernel module detects an abnormal event, it typically performs the following steps: 1) The kernel module creates a netlink protocol family socket A. The Netlink protocol family is a fixed part of the Linux system, primarily used for communication between kernel and user space; 2) The monitoring service creates a netlink protocol family socket B; 3) Socket A and socket B are bound together; 4) The kernel module defines the message content and fills the message body; 5) The kernel module reports the message; 6) The monitoring service receives the message; 7) The monitoring service parses the message, at which point the reporting and receiving process is complete. However, in current automotive systems, the types and number of self-developed device drivers are increasing dramatically every day. Various new requirements are introducing many new types of device drivers into the operating system. If the above reporting method is used, it will increase the interaction cost between the monitoring service and these kernel modules, affecting the efficiency of event reporting. Summary of the Invention

[0004] This application provides an event reporting method, apparatus, computer-readable storage medium, and computer program product, which can improve event reporting efficiency.

[0005] The technical solution of this application embodiment is implemented as follows:

[0006] This application provides an event reporting method, the method including:

[0007] The system receives exception event messages sent by the target kernel module via the event bus. When the target kernel module detects an exception, it sends the exception event message to the event bus. The target kernel module is one of multiple kernel modules included in the operating system.

[0008] The abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it.

[0009] In the above scheme, the abnormal event message includes an event type, and sending the abnormal event message to the target monitoring service that subscribes to the abnormal event message includes:

[0010] Based on the event type, determine whether there is a target monitoring service that subscribes to the abnormal event message;

[0011] If it is determined that there is a target monitoring service that subscribes to the abnormal event message, the abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message.

[0012] In the above scheme, before the target kernel module sends the exception event message to the event bus, the method further includes:

[0013] Initialize the operating system and create a shared socket for the multiple kernel modules;

[0014] The shared socket is encapsulated to obtain an encapsulated socket;

[0015] Add the encapsulated socket to the event bus.

[0016] In the above scheme, after adding the encapsulated socket to the event bus, the method further includes:

[0017] Load the event bus;

[0018] The event types corresponding to each kernel module in the operating system are mounted to the event bus.

[0019] In the above scheme, after mounting the event types corresponding to each kernel module in the operating system to the event bus, the method further includes:

[0020] Initialize the various monitoring services in the operating system;

[0021] Each monitoring service subscribes to its corresponding event type from the various event types mounted on the event bus.

[0022] In the above scheme, sending the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service, upon receiving the abnormal event message, performs parsing and processing of the abnormal event message, includes:

[0023] The abnormal event message is sent to the target monitoring service, so that the target monitoring service, upon receiving the abnormal event message, parses and processes the abnormal event message according to a unified message format.

[0024] In the above scheme, the abnormal event message is generated by the target kernel module according to a unified message format and sent to the event bus when an abnormality is detected; the abnormal event message includes event type and event content.

[0025] This application embodiment also provides an event reporting device, the event reporting device comprising:

[0026] A receiving module is used to receive an exception event message sent by a target kernel module via an event bus. The target kernel module sends the exception event message to the event bus when it detects an exception. The target kernel module is one of a plurality of kernel modules included in the operating system.

[0027] The sending module is used to send the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it.

[0028] In the above scheme, the abnormal event message includes an event type, and the sending module is further configured to:

[0029] Based on the event type, determine whether there is a target monitoring service that subscribes to the abnormal event message;

[0030] If it is determined that there is a target monitoring service that subscribes to the abnormal event message, the abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message.

[0031] In the above scheme, before the target kernel module sends the exception event message to the event bus, the device further includes a creation module, which is used to:

[0032] Initialize the operating system and create a shared socket for the multiple kernel modules;

[0033] The shared socket is encapsulated to obtain an encapsulated socket;

[0034] Add the encapsulated socket to the event bus.

[0035] In the above scheme, after adding the encapsulated socket to the event bus, the device further includes a mounting module, which is used for:

[0036] Load the event bus;

[0037] The event types corresponding to each kernel module in the operating system are mounted to the event bus.

[0038] In the above scheme, after mounting the event types corresponding to each kernel module in the operating system to the event bus, the device further includes a subscription module, which is used for:

[0039] Initialize the various monitoring services in the operating system;

[0040] Each monitoring service subscribes to its corresponding event type from the various event types mounted on the event bus.

[0041] In the above scheme, the sending module is further configured to:

[0042] The abnormal event message is sent to the target monitoring service, so that the target monitoring service, upon receiving the abnormal event message, parses and processes the abnormal event message according to a unified message format.

[0043] In the above scheme, the abnormal event message is generated by the target kernel module according to a unified message format and sent to the event bus when an abnormality is detected; the abnormal event message includes event type and event content.

[0044] This application embodiment also provides an event reporting device, the event reporting device comprising:

[0045] Memory is used to store executable instructions for a computer;

[0046] A processor, when executing computer-executable instructions or computer programs stored in the memory, implements the event reporting method as described in any of the preceding claims.

[0047] This application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, which, when executed by a processor, implement the event reporting method as described in any of the preceding claims.

[0048] This application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the event reporting method as described in any of the preceding claims.

[0049] The embodiments of this application have the following beneficial effects:

[0050] The event reporting method provided in this application embodiment involves the target kernel module sending an exception event message to the event bus when it detects an anomaly. The event bus then forwards the exception event message to the target monitoring service that has subscribed to the exception event message. In other words, during the reporting of the exception event message, there is no need for direct interaction between the target kernel module and the monitoring service. The target kernel module only needs to focus on sending the exception event message, and the monitoring service only needs to focus on receiving the exception event message. There is no need for the kernel module and the monitoring service to create sockets and bind them separately for the exception event message, thus reducing interaction costs and improving event reporting efficiency. Furthermore, since the event bus sends the exception event message to the target monitoring service that has subscribed to it, and not to other monitoring services that have not subscribed to it, resource costs are saved. Moreover, if no monitoring service has subscribed to the exception event message after receiving it, the event bus will not perform the action of sending the exception event message, thus further saving resource costs. Attached Figure Description

[0051] Figure 1 A flowchart illustrating an event reporting method provided in an embodiment of this application;

[0052] Figure 2 A flowchart illustrating another event reporting method provided in an embodiment of this application;

[0053] Figure 3 A schematic diagram illustrating the sending of an abnormal event message, provided as an embodiment of this application;

[0054] Figure 4 This is a schematic diagram of the structure of the event reporting device provided in the embodiments of this application;

[0055] Figure 5 This is a schematic diagram of the structure of the event reporting device provided in the embodiments of this application. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0057] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0058] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0059] Unless otherwise defined, all technical and scientific terms used in the embodiments of this application have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in the embodiments of this application is for the purpose of describing the embodiments of this application only and is not intended to limit this application.

[0060] In the implementation of this application, the collection and processing of relevant data should strictly comply with the requirements of relevant national laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of laws and regulations and the authorization of the personal information subject.

[0061] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.

[0062] 1) An operating system is a set of system software programs that manage and control computer operation, hardware and software resources, and provide public services to organize user interaction.

[0063] 2) The kernel is the most basic part of the operating system. It provides the first layer of software extension to the hardware and is responsible for managing and maintaining the system's performance and stability.

[0064] 3) Kernel events are event messages issued by programs in kernel mode.

[0065] 4) Kernel modules contain kernel subsystems and device drivers.

[0066] In Linux systems, the reporting of kernel events by the operating system is crucial because it directly affects the system's performance, stability, and security. With the development of big data and machine learning, the automated analysis, prediction, and processing of kernel events have broad application prospects in improving the perception and response capabilities of vehicle operating systems.

[0067] In related technologies, deploying a monitoring service within the operating system is an effective and common maintenance method. When each kernel module detects an abnormal event, both the kernel module and the monitoring service first need to create netlink protocol family sockets. Then, the two sockets are bound together. Next, the kernel module defines the message content, fills the message body, and reports the message; the monitoring service receives and parses the message. However, in current automotive systems, the types and number of self-developed device drivers are increasing dramatically every day. Various new requirements are introducing many new types of device drivers into the operating system. If the above reporting process is adopted, it will increase the interaction cost between the monitoring service and these kernel modules, affecting the efficiency of event reporting.

[0068] Based on the above technical problems, embodiments of this application provide an event reporting method, apparatus, computer-readable storage medium, and computer program product.

[0069] Figure 1 This is a flowchart illustrating an event reporting method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes the following steps:

[0070] S101. Receive exception event messages sent by the target kernel module through the event bus.

[0071] The event reporting method provided in this application embodiment is applicable to scenarios where the operating system reports kernel events. For example, the executing entity of the event reporting method can be the operating system. Here, the operating system can be an in-vehicle operating system. The type of in-vehicle operating system is not specifically limited. For example, it can be a Linux system, an Android system, etc.

[0072] For example, an operating system may include multiple kernel modules and multiple monitoring services; wherein, the kernel modules are located in the kernel mode of the operating system, and the monitoring services are located in the user mode of the operating system; each kernel module has a unique identifier, which is used for subsequent source tracing and resolution by the monitoring services.

[0073] In this embodiment, when the target kernel module detects an anomaly, it sends an anomaly event message to the event bus. The target kernel module is one of multiple kernel modules included in the operating system; the source of the target kernel module is not specifically limited here. For example, the target kernel module can be a kernel module included with the operating system or a self-developed kernel module.

[0074] It should be noted that exception event messages are generated and sent to the event bus by the target kernel module according to a unified message format when an exception is detected.

[0075] For example, the unified message format is defined according to the communication convention between each kernel module and the monitoring service in the operating system; in the embodiments of this application, the abnormal event message may include an event type and an event content, wherein the event type represents the unique identifier of the target kernel module in the operating system, and the event content may include the exception level, message type and valid message content.

[0076] Here, the anomaly level refers to the severity of the anomaly, which may include, but is not limited to, normal, warning, danger, and emergency; the message type refers to the type of anomaly, which may include, but is not limited to, network anomalies, scheduling anomalies, and application anomalies; and the valid message content refers to the specific information contained in the anomaly event message, which is not specifically limited here.

[0077] As can be seen, in this embodiment of the application, since the abnormal event messages are generated according to a unified message format, the kernel module does not need to customize the message format of the abnormal event messages. In this way, the operational complexity of the kernel module in reporting abnormal event messages can be reduced and the event reporting efficiency can be improved.

[0078] In this embodiment of the application, before the target kernel module sends the exception event message to the event bus, the above method may further include: initializing the operating system and creating a shared socket for multiple kernel modules; encapsulating the shared socket to obtain an encapsulated socket; and adding the encapsulated socket to the event bus.

[0079] For example, a shared socket for multiple kernel modules can be created during the initialization of the operating system; then, the shared socket is encapsulated and added to the event bus; at this point, the event bus contains the encapsulated socket, so that the event bus can receive and send exception event messages through the encapsulated socket.

[0080] For example, the event bus provides a sending tool. When the target kernel module detects an exception, it can call the encapsulated socket and the sending tool to send the exception event message to the event bus. At this time, the event bus can receive the exception event message sent by the target kernel module.

[0081] As can be seen, in this embodiment of the application, by encapsulating the created shared socket and adding the encapsulated socket to the event bus, all kernel modules in the operating system that need to communicate can communicate through the encapsulated socket contained in the event bus. This avoids the waste of resources caused by each kernel module redundantly creating multiple sockets and binding multiple sockets to the corresponding monitoring service, and effectively reduces resource costs.

[0082] In some embodiments, after adding the encapsulated socket to the event bus, the above method may further include: loading the event bus; and attaching the event types corresponding to each kernel module in the operating system to the event bus.

[0083] For example, each kernel module has a unique identifier, where the event type corresponding to each kernel module refers to the unique identifier of each kernel module.

[0084] In this embodiment of the application, after creating a shared socket for multiple kernel modules, the event bus is first loaded, and all event types corresponding to each kernel module in the operating system are mounted to the event bus; for example, if the event types corresponding to each kernel module include event type A, event type B and event type C, event type A, event type B and event type C can all be mounted to the event bus.

[0085] In some embodiments, after mounting the event types corresponding to each kernel module in the operating system to the event bus, the above method may include: initializing each monitoring service in the operating system; each monitoring service subscribing to its corresponding event type from the event types mounted on the event bus.

[0086] In this embodiment of the application, the event bus communicates with each monitoring service based on a publish-subscribe mechanism; here, the event bus refers to the message sender, i.e., the publisher, and each monitoring service refers to the message receiver, i.e., the subscriber.

[0087] For example, after mounting the event types corresponding to each kernel module in the operating system to the event bus, the various monitoring services in the operating system are initialized. In this way, each monitoring service can subscribe to its corresponding event type from the various event types mounted on the event bus according to its own needs, that is, subscribe to the event types it is interested in. It should be noted that the event types subscribed to by different monitoring services can be the same or different, and no specific limitation is made here.

[0088] Understandably, since each monitoring service subscribes to the event types it is interested in after initialization, when the event bus sends an exception event message, it will only send the exception event message to the monitoring service that has subscribed to the event type that has subscribed to the exception event message. That is, it will not send the exception event message to other monitoring services that have not subscribed to the exception event message, thus saving memory resources.

[0089] S102. Send the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service can parse and process the abnormal event message after receiving it.

[0090] In this embodiment of the application, after receiving an exception event message sent by the target kernel module, the event bus will send the exception event message to the target monitoring service that subscribes to the exception event message; for example, the number of target monitoring services can be one or more, and no specific limitation is made here.

[0091] In some embodiments, sending an abnormal event message to a target monitoring service that subscribes to abnormal event messages may include: determining, based on the event type, whether there is a target monitoring service that subscribes to abnormal event messages; and if it is determined that there is a target monitoring service that subscribes to abnormal event messages, sending the abnormal event message to the target monitoring service that subscribes to abnormal event messages.

[0092] For example, as can be seen from the above, an abnormal event message may include an event type, and each monitoring service in the operating system will subscribe to the event types they are interested in from the various event types mounted on the event bus. Therefore, if the target monitoring service subscribes to the event type of the abnormal event message, it means that the target monitoring service subscribes to the abnormal event message.

[0093] In this embodiment of the application, after receiving an abnormal event message sent by the target kernel module, the event bus can determine whether there is a target monitoring service that subscribes to the abnormal event message based on the event types included in the abnormal event message; correspondingly, the event types included in the abnormal event message can be compared with multiple event types pre-mounted on the event bus to obtain a comparison result, and then, based on the comparison result, it can be determined whether there is a target monitoring service that subscribes to the abnormal event message.

[0094] For example, if the comparison results show that the event type included in the abnormal event message exists among the multiple event types pre-mounted on the event bus, it indicates that there is a target monitoring service subscribing to the abnormal event message. In this case, the event bus will send the abnormal event message to the target monitoring service subscribing to the abnormal event message. Conversely, if the comparison results show that the event type included in the abnormal event message does not exist among the multiple event types pre-mounted on the event bus, it indicates that there is no target monitoring service subscribing to the abnormal event message. In this case, the event bus will not send the abnormal event message.

[0095] For example, the event bus provides a subscription tool; the process by which the event bus sends abnormal event messages to the target monitoring service can be as follows: the target monitoring service calls the subscription tool to obtain abnormal event messages from the event bus.

[0096] As can be seen in this embodiment, when the event bus receives an abnormal event message sent by the target kernel module, it will send the abnormal event message to the target monitoring service that subscribes to the abnormal event message. That is, it will not send the abnormal event message to other monitoring services that have not been subscribed to. In this way, the event reporting efficiency can be improved while saving memory resources.

[0097] In some embodiments, sending an abnormal event message to a target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it, may include: sending the abnormal event message to the target monitoring service, so that the target monitoring service parses and processes the abnormal event message according to a unified message format after receiving it.

[0098] For example, as can be seen from the above, the abnormal event message is generated according to a unified message format. Thus, when the target monitoring service receives the abnormal event message sent by the event bus, it can parse and process the abnormal event message according to the unified message format; that is, it can parse the event type of the abnormal event message, as well as the abnormal level, message type and valid content of the event content.

[0099] As can be seen, in this embodiment of the application, the target monitoring service can parse and process the received abnormal event messages according to a unified message format. That is, it is not necessary to process each type of abnormal event message separately. In this way, the complexity of the monitoring service in parsing abnormal event messages can be reduced, and the event reporting efficiency can be further improved.

[0100] To better illustrate the purpose of this application, further examples are provided based on the above embodiments.

[0101] Figure 2 A flowchart illustrating another event reporting method provided in this application embodiment is shown below. Figure 2 As shown, the method includes the following steps:

[0102] Step 200: Create a shared socket.

[0103] For example, during operating system initialization, a shared socket for multiple kernel modules in the operating system is created, the shared socket is encapsulated, and the encapsulated socket is added to the event bus.

[0104] Step 201: Load the event bus.

[0105] Step 202: Define event types and a unified message format.

[0106] Step 203: Mount the event type to the event bus.

[0107] For example, the event types corresponding to each kernel module in the operating system are mounted to the event bus.

[0108] Step 204: Initialize the monitoring service.

[0109] For example, after the event bus is mounted, the various monitoring services in the operating system are initialized.

[0110] Step 205: Subscribe to the types of events you want to follow.

[0111] For example, each monitoring service in the operating system subscribes to the event types it is interested in from the various event types mounted on the event bus according to its own needs.

[0112] Step 206: The kernel module sends an exception event message to the event bus.

[0113] For example, when any kernel module in the operating system detects an exception, it generates an exception event message according to a unified message format and sends it to the event bus.

[0114] Step 207: Distribute exception event messages via the event bus.

[0115] For example, after receiving an exception event message from any kernel module, the event bus will send the exception event message to the monitoring service that subscribes to the exception event message.

[0116] Step 208: Receive and parse the exception event message.

[0117] For example, after receiving an abnormal event message sent by the event bus, the monitoring service can parse and process the abnormal event message according to the unified message format.

[0118] It should be noted that steps 200 to 203 and 206 occur in kernel mode, while steps 204, 205, 207, and 208 occur in user mode. The specific implementation process of steps 200 to 208 has been described in the above embodiments, and will not be repeated here to avoid repetition.

[0119] As can be seen from this embodiment, when the kernel module detects an anomaly, it sends the anomaly event message to the event bus, which then sends the anomaly event message to the target monitoring service that subscribes to the anomaly event message. That is, during the reporting of the anomaly event message, there is no need for direct interaction between the target kernel module and the monitoring service. In other words, the target kernel module only needs to focus on sending the anomaly event message, and the monitoring service only needs to focus on receiving the anomaly event message. There is no need for the kernel module and the monitoring service to create sockets and bind them separately for the anomaly event message. This reduces the interaction cost and improves the event reporting efficiency.

[0120] For ease of understanding, in Figure 2 Based on, combined Figure 3 Further explanation of the process for sending abnormal event messages; Figure 3 This is a schematic diagram illustrating the sending of an abnormal event message, as provided in an embodiment of this application. Figure 3 As shown, the operating system includes kernel module A, kernel module B, monitoring service I, monitoring service II, and monitoring service III. The event bus is connected to event type A and event type B. Monitoring services I and II subscribe to event type A, while monitoring services II and III subscribe to event type B. When kernel module A detects an anomaly, it sends an anomaly event message A to the event bus. Similarly, when kernel module B detects an anomaly, it sends an anomaly event message B to the event bus. The event type of an anomaly event message A is event type A, and the event type of an anomaly event message B is event type B. Since monitoring services I and II subscribe to event type A, and monitoring services II and III subscribe to event type B, when the event bus receives an anomaly event message A from kernel module A, it distributes the anomaly event message A to monitoring services I and II that subscribe to event type A. Similarly, when the event bus receives an anomaly event message B from kernel module B, it distributes the anomaly event message B to monitoring services II and III that subscribe to event type B.

[0121] Understandably, since the event bus only sends the abnormal event message to the target monitoring service that has subscribed to the abnormal event message after receiving it, and does not send it to other monitoring services that have not subscribed to the abnormal event message, it can save resource costs.

[0122] Based on the foregoing embodiments, this application also provides an event reporting device. Figure 4 This is a schematic diagram of the structure of the event reporting device provided in the embodiments of this application, as shown below. Figure 4 As shown, the event reporting device 4 may include:

[0123] The receiving module 400 is used to receive an exception event message sent by a target kernel module through an event bus, wherein the target kernel module sends the exception event message to the event bus when it detects an exception, and the target kernel module is one of a plurality of kernel modules included in the operating system;

[0124] The sending module 401 is used to send the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it.

[0125] In some embodiments, the exception event message includes an event type, and the sending module 401 is further configured to:

[0126] Based on the event type, determine whether there is a target monitoring service that subscribes to the abnormal event message;

[0127] If it is determined that there is a target monitoring service that subscribes to the abnormal event message, the abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message.

[0128] In some embodiments, before the target kernel module sends the exception event message to the event bus, the apparatus further includes a creation module, which is configured to: initialize the operating system and create a shared socket for the plurality of kernel modules; encapsulate the shared socket to obtain an encapsulated socket; and add the encapsulated socket to the event bus.

[0129] In some embodiments, after adding the encapsulated socket to the event bus, the device further includes a mounting module, which is configured to: load the event bus; and mount the event types corresponding to each kernel module in the operating system to the event bus.

[0130] In some embodiments, after mounting the event types corresponding to each kernel module in the operating system to the event bus, the device further includes a subscription module, which is used to: initialize each monitoring service in the operating system; and each monitoring service subscribes to its corresponding event type from each event type mounted on the event bus.

[0131] In some embodiments, the sending module 401 is further configured to: send the abnormal event message to the target monitoring service, so that the target monitoring service, upon receiving the abnormal event message, parses and processes the abnormal event message according to a unified message format.

[0132] In some embodiments, the exception event message is generated and sent to the event bus by the target kernel module in accordance with a unified message format when an exception is detected; the exception event message includes an event type and an event content.

[0133] In practical applications, the receiving module 400, sending module 401, creation module, mounting module, and subscription module can all be implemented by a processor located in the event reporting device. The processor can be at least one of the following: Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), controller, microcontroller, and microprocessor.

[0134] Based on the foregoing embodiments, this application also provides an event reporting device. Figure 5 This is a schematic diagram of the structure of the event reporting device provided in the embodiments of this application, such as... Figure 5 As shown, the event reporting device 5 may include a processor 501 and a memory 502; wherein,

[0135] Memory 502 is used to store computer-executable instructions;

[0136] The processor 501, when executing computer-executable instructions or computer programs stored in the memory 502, implements an event reporting method as described above.

[0137] Based on the foregoing embodiments, this application also provides a computer-readable storage medium storing computer-executable instructions or computer programs, wherein the computer-executable instructions or computer programs, when executed by a processor, implement the event reporting method as described in any of the preceding embodiments.

[0138] Based on the foregoing embodiments, this application also provides a computer program product, including computer-executable instructions or a computer program, which, when executed by a processor, can implement the event reporting method as described in any of the preceding embodiments.

[0139] In some embodiments, the computer-readable storage medium may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM), etc.; or it may be a device that includes one or any combination of the above-mentioned memories.

[0140] In some embodiments, computer-executable instructions may take the form of programs, software, software modules, scripts, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as stand-alone programs or as modules, components, subroutines, or other units suitable for use in a computing environment.

[0141] As an example, computer-executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple co-located files (e.g., files that store one or more modules, subroutines, or code sections).

Claims

1. An event reporting method, characterized in that, The method includes: The system receives exception event messages sent by the target kernel module via the event bus. When the target kernel module detects an exception, it sends the exception event message to the event bus. The target kernel module is one of multiple kernel modules included in the operating system. The abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it.

2. The method according to claim 1, characterized in that, The abnormal event message includes an event type, and sending the abnormal event message to the target monitoring service that subscribes to the abnormal event message includes: Based on the event type, determine whether there is a target monitoring service that subscribes to the abnormal event message; If it is determined that there is a target monitoring service that subscribes to the abnormal event message, the abnormal event message is sent to the target monitoring service that subscribes to the abnormal event message.

3. The method according to claim 1, characterized in that, Before the target kernel module sends the exception event message to the event bus, the method further includes: Initialize the operating system and create a shared socket for the multiple kernel modules; The shared socket is encapsulated to obtain an encapsulated socket; Add the encapsulated socket to the event bus.

4. The method according to claim 3, characterized in that, After adding the encapsulated socket to the event bus, the method further includes: Load the event bus; The event types corresponding to each kernel module in the operating system are mounted to the event bus.

5. The method according to claim 4, characterized in that, After mounting the event types corresponding to each kernel module in the operating system to the event bus, the method further includes: Initialize the various monitoring services in the operating system; Each monitoring service subscribes to its corresponding event type from the various event types mounted on the event bus.

6. The method according to claim 1, characterized in that, The step of sending the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service, upon receiving the abnormal event message, performs parsing and processing of the abnormal event message, includes: The abnormal event message is sent to the target monitoring service, so that the target monitoring service, upon receiving the abnormal event message, parses and processes the abnormal event message according to a unified message format.

7. The method according to claim 1, characterized in that, The abnormal event message is generated and sent to the event bus by the target kernel module according to a unified message format when it detects an abnormality; the abnormal event message includes the event type and the event content.

8. An event reporting device, characterized in that, The event reporting device includes: A receiving module is used to receive an exception event message sent by a target kernel module via an event bus. The target kernel module sends the exception event message to the event bus when it detects an exception. The target kernel module is one of a plurality of kernel modules included in the operating system. The sending module is used to send the abnormal event message to the target monitoring service that subscribes to the abnormal event message, so that the target monitoring service parses and processes the abnormal event message after receiving it.

9. An event reporting device, characterized in that, The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the event reporting method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the event reporting method as described in any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the event reporting method according to any one of claims 1 to 7.