Event notification method, apparatus, device, medium and product
By allocating the event configuration area in the base address register space of the NVMe storage device, the storage device actively reports interrupt notifications, solving the problem of untimely reporting of events, realizing timely delivery of events and optimized resource utilization.
Patent Information
- Application Number
- CN202510344830.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2045-03-24
AI Technical Summary
In the prior art, the event reporting of NVMe storage devices is not timely, which can easily lead to event loss and occupy control command queue resources, resulting in resource consumption.
The event configuration area is allocated in the base address register space of the storage device. When the target event occurs, the storage device actively reports an interrupt notification, and reads the target offset through the event configuration area to obtain event information to avoid waiting for requests and occupies queue resources.
It realizes timely reporting of events, avoids incident loss, reduces resource consumption, and improves system reliability and responsiveness.
Smart Images

Figure CN119847792B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of storage technologies, and in particular, to an event notification method, apparatus, device, medium, and product. Background Art
[0002] Currently, in the prior art, after the host completes initialization, it sends a control command of an AER (i.e., Asynchronous Event Request) request to an NVMe (i.e., Non Volatile Memory Express, based on the Non-Volatile Memory Host Controller Interface Specification) storage device. After receiving the AER request, the storage device detects whether there is an event to report in the event cache pool. If there is an event to report, it sends an AER event message to the host. If there is no event, it waits for an event to occur and then sends an AER message to the host. After receiving the AER message, the host processes it. In order to receive the AER message of the storage device again, it sends an AER request to the storage device again. In this way, the event reporting to the host is not timely, and events may be lost due to not sending an AER request or insufficient event cache pool, and it occupies the queue of control commands, causing resource pressure.
[0003] Therefore, how to ensure timely event reporting, avoid event loss, and reduce resource consumption is a problem that needs to be solved by those skilled in the art. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an event notification method, apparatus, device, medium, and product, which can ensure timely event reporting, avoid event loss, and reduce resource consumption. The specific solutions are as follows:
[0005] In a first aspect, the present invention provides an event notification method applied to a host, including:
[0006] Obtaining an interrupt notification reported by a storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification;
[0007] Reading a target offset from an event configuration area based on the interrupt notification, where the target offset is the offset at which a target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0008] Reading the target event record based on the target offset to obtain event information corresponding to the latest-occurring target event.
[0009] Second aspect, the present invention provides an event notification method, which is applied to a storage device. The storage device is based on the Non-Volatile Memory Host Controller Interface Specification. The method includes:
[0010] In the case of a target event occurring, adding a target offset to an event configuration area, where the target offset recorded in the event configuration area is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0011] Reporting an interrupt notification to the host so that the host reads the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0012] Third aspect, the present invention provides an event notification device, which is applied to a host and includes:
[0013] An interrupt notification acquisition module, configured to acquire an interrupt notification reported by a storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification;
[0014] A target offset reading module, configured to read a target offset from an event configuration area based on the interrupt notification, where the target offset is the offset at which a target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0015] An event information reading module, configured to read the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0016] Fourth aspect, the present invention provides an event notification device, which is applied to a storage device. The storage device is based on the Non-Volatile Memory Host Controller Interface Specification and includes:
[0017] A target offset adding module, configured to add a target offset to an event configuration area in the case of a target event occurring, where the target offset recorded in the event configuration area is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0018] An interrupt notification reporting module, configured to report an interrupt notification to the host so that the host reads the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0019] In a fifth aspect, the present invention provides an electronic device, comprising:
[0020] a memory for storing a computer program;
[0021] a processor for executing the computer program to implement the steps of the foregoing event notification method.
[0022] In a sixth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the foregoing event notification method are implemented.
[0023] In a seventh aspect, the present invention discloses a computer program product comprising computer program / instructions, and when the computer program / instructions are executed by a processor, the steps of the foregoing event notification method are implemented.
[0024] As can be seen from the above solutions, the present invention provides an event notification method, which is applied to a host and includes: obtaining an interrupt notification reported by a storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification; reading a target offset from an event configuration area based on the interrupt notification, where the target offset is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device; reading the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0025] It can be seen that the beneficial effects of the present invention are as follows: An area is allocated in the base address register space of a storage device based on the Non-Volatile Memory Host Controller Interface Specification as an event configuration area. When a target event occurs in the storage device, an interrupt notification is actively reported to the host, the target offset is read from the event configuration area, and then the event record corresponding to the latest-occurring target event is obtained to obtain the event information. In this way, when an event occurs in the storage device, it actively reports through an interrupt and transmits the event information based on the event configuration area allocated in the base address register space of the storage device, without waiting for a request and occupying queue resources, which can ensure timely reporting of events, avoid event loss, and reduce resource consumption.
[0026] Correspondingly, the event notification device, device, medium, and product provided by the present invention also have the above technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] To more clearly illustrate the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0028] Figure 1 Flowchart of an event notification method provided by an embodiment of the present invention;
[0029] Figure 2 Another flowchart of an event notification method provided by an embodiment of the present invention;
[0030] Figure 3 Interaction schematic diagram of AER event notification of an NVMe storage device provided by an embodiment of the present invention;
[0031] Figure 4 Schematic diagram of a host - side processing flow provided by an example of the present invention;
[0032] Figure 5 Flowchart of a storage - device - side processing provided by an embodiment of the present invention;
[0033] Figure 6 Schematic diagram of an event configuration area provided by an embodiment of the present invention;
[0034] Figure 7 Interaction flowchart between a host and a storage device provided by an embodiment of the present invention;
[0035] Figure 8 Schematic diagram of the structure of an event notification device disclosed by an embodiment of the present invention;
[0036] Figure 9 Schematic diagram of the structure of an electronic device disclosed by an embodiment of the present invention. Detailed implementation manners [[ID=३९]]
[0037] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
[0038] The terms "including" and "having" in the specification of the present invention and any variations related to "including" and "having" are intended to cover non - exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the listed steps or units, but may include steps or units not listed.
[0039] First, the terms related to the present invention are explained as follows:
[0040] IO: Input / Output, i.e., input and output.
[0041] NVMe: Non Volatile Memory Express, an NVMe storage protocol based on the Non-Volatile Memory Host Controller Interface Specification.
[0042] SQ: Submission Queue, an instruction submission queue in the NVMe protocol.
[0043] CQ: Completion Queue, an instruction completion queue in the NVMe protocol.
[0044] ASQ: Admin Submission Queue, a control instruction submission queue.
[0045] ACQ: Admin Completion Queue, a control instruction completion queue.
[0046] AER: Asynchronous Event Request, an asynchronous event request initiated by the host.
[0047] AEN: Asynchronous Event Notify, an asynchronous event notification sent by the device.
[0048] BAR: Base Address Register, the base address register space, which is the configuration space of the NVMe device. The host and the device can interact through this area, similar to shared memory.
[0049] Doorbell: A doorbell, which is a register in the BAR space of the NVMe device and is used for the host to notify the NVMe device to read the SQE (i.e., Submission Queue Entry, the submission queue entry).
[0050] PCIe: peripheral component interconnect express, a high-speed serial computer expansion bus standard.
[0051] MSIX: Message Signaled Interrupts eXtended, a message-based PCIe interrupt.
[0052] Currently, when the host communicates with an NVME protocol-based storage device, it must be completed through the instruction queue located in the host memory. The host needs to put the instructions to be executed by the storage device into the SQ queue, and then write the Doorbell register of the device's SQ to notify the storage device to read the instructions. The controller inside the storage device reads the instructions from the SQ queue in the host memory through PCIe messages, executes the instructions inside the storage device, and finally puts the result of the executed instructions into the corresponding CQ queue through PCIe messages, and updates the Doorbell register of the CQ to complete an IO interaction. The maximum number of NVMe queues supported is 64K. The SQ command submission queue and the CQ command completion queue are in a one-to-one or many-to-one relationship. The NVMe protocol defines two types of instructions, one is a control instruction and the other is an IO instruction. Control instructions are mainly used to configure the storage device, and IO instructions are mainly used to read and write data in the Flash (i.e., flash memory) medium of the storage device. At the same time, two types of queues are also defined, namely the control queue and the IO queue. Control instructions can only be submitted to the control queue, and IO instructions can only be submitted to the IO queue. The control queue has only one set of SQ / CQ, and the IO queue can have multiple sets of SQ / CQ. All instructions are sent to the storage device through the PCIe link.
[0053] NVMe instructions implement interaction based on the synchronous method of request and response. Each request command corresponds to a response command. The request command is placed in the submission queue SQ by the host, and the response command is placed in the completion queue CQ by the controller of the storage device. All instructions in the NVMe device are requested by the host, and the storage device responds to the request. The AER message for event reporting of the storage device is also based on this method. The interaction process of the AER message reporting between the host and the storage device includes: after the host completes initialization, it will send a control command for the AER request to the storage device. After receiving the AER request, the storage device checks whether there is an event to report in the event cache pool. If there is an event to report, it will send an AER event message to the host. If there is no event in the storage device event cache pool, it will wait for an event to occur and then send an AER message to the host. After receiving the AER message, the host processes it. After the host processes the AER message, in order to receive the AER message of the device again, it will send an AER request to the storage device again. This cycle continues.
[0054] Problems existing in the above method include: when the storage device has an event to report to the host, it first needs to receive an AER request from the host. If the AER request from the host is not received, the device event will be temporarily stored in the event cache pool of the device. This results in the device event not being reported to the host in a timely manner. Since the AER message reported by the storage device to the host uses the ACQ queue of the control command, if there are too many control command completion instructions in the ACQ queue, the host will not process the AER message in a timely manner. In order for the host to receive all AER messages reported by the devices, it needs to send a request command for each AER message. This command has no parameters, and this operation will occupy the queue of the control command, consuming PCIe link resources and the controller resources of the device in the case of high IO throughput. If the host does not send an AER request, then the storage device will never report an AER event to the host. If the host does not send an AER request for a long time, or if the number of events generated by the storage device in a period is too large, exceeding the threshold of the device event cache pool, there may be a risk of losing important events. Obtaining an event requires 5 interactions with the device, consuming a total of 92 bytes, but in fact, the effective data is less, wasting the bandwidth of the link.
[0055] To this end, the present invention provides an event notification method, which can ensure the timely reporting of events, avoid the loss of events, and reduce resource consumption.
[0056] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
[0057] Next, an event notification method provided by an embodiment of the present invention will be introduced in detail. Figure 1 The following is a flowchart of an event notification method provided by an embodiment of the present invention. The event notification method includes:
[0058] Step S11: Obtain an interrupt notification reported by the storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification.
[0059] Among them, the target event is the AER event, the event corresponding to the asynchronous event request. In the embodiment of the present invention, it is not necessary for the host to send an AER request, and the storage device actively reports an interrupt notification when the target event occurs. The target event is a preset type of event, which may include a hard disk error event, a hard disk health event, a hard disk notification event, and a storage block specific event, that is, the event type may be a hard disk error event, a hard disk health event, a hard disk notification event, and a storage block specific event.
[0060] In an alternative embodiment, when any target event occurs, the storage device can report an interrupt notification.
[0061] Step S12: Read a target offset from the event configuration area based on the interruption notification, where the target offset is the offset of a target event recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device.
[0062] Among them, the event configuration area is an area allocated in the base address register space of the storage device for transmitting event information. In an embodiment of the present invention, a fixed offset address is selected in the base address register space of the storage device, and a certain area is allocated starting from the fixed offset address as the event configuration area. The event configuration area may include event records corresponding to each event type respectively. Different event types correspond to different event records. In this way, each event record has its own corresponding offset, and event information of different event types can be saved in different sub-areas in the event configuration area.
[0063] In addition, the event configuration area also saves the target offset, that is, sets a corresponding position to save the target offset, that is, saves the offset address of the target event record in the event configuration area. The target event record can be located through the target offset and the fixed offset address. Each time a target event occurs, the target offset in the event configuration area is modified to the offset corresponding to the target event. In this way, the target offset in the event configuration area remains the offset of the event record corresponding to the latest-occurring target event.
[0064] Step S13: Read the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0065] In an optional implementation manner, the event statistical quantity in the target event record may be read based on the target offset to obtain a first event statistical quantity; if the first event statistical quantity is greater than a second event statistical quantity, it is determined that a target event of the event type corresponding to the target event record occurs, and the event information is read from the target event record to obtain the event information corresponding to the latest-occurring target event; where the second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host at a first storage location, and the first storage location is a storage location outside the event configuration area.
[0066] In an embodiment of the present invention, any event record may include an event statistical quantity and event information. When a target event occurs, the storage device increments the event statistical quantity in the event record of the corresponding event type by 1, and updates the target offset to the offset of the event record. The initial values of the first event statistical quantity and the second event statistical quantity are 0.
[0067] In addition, the host also additionally records the event statistics quantity, which is used to compare with the time statistics quantity in the event records in the event storage area to determine whether a new target event has occurred. In the case where a new target event has occurred, the time information in the record is read. The first storage location can be an area that stores the event statistics quantity of each event type respectively. After the host obtains the event information of the event record each time, it can update the event statistics quantity in the event record to the first storage location.
[0068] In an alternative embodiment, the event information is the information required to determine the cause of the event occurrence, and may include the event type of the target event, the event description information, and the event log identifier. The event description information can be a description of the target event, and can be a sub - type of the event. The event log identifier is the identifier of the log of the target event, which can locate the log of the target event.
[0069] Among them, the event description information of the hard disk error event may include host write storage device register error, host write storage device register value error, diagnostic error, internal permanent error, internal temporary error, and firmware load (i.e., loading) error; the event description information of the hard disk health event may include storage block reliability event, temperature exceeding the threshold event, and capacity lower than the threshold event; the event description information of the hard disk notification event may include ns (i.e., namespace) attribute change notification, hard disk firmware upgrade notification, hard disk log (log) notification, and asymmetric access notification; the event description information of the storage block specific event may include storage block clear operation completion event and scheduled log (log) notification event.
[0070] Furthermore, different event types correspond to different event log identifiers. For example, the event log identifier of the hard disk error event may be 0x1; the event description information of the hard disk health event may be 0x2; the event log identifier of the ns attribute change notification may be 0x4, the event log identifier of the hard disk firmware upgrade notification may be 0x3, the event log identifier of the hard disk log notification may be 0x7, the event log identifier of the asymmetric access notification may be 0xc, the event log identifier of the storage block clear operation completion event may be 0x81, and the event log identifier of the scheduled log notification event may be 0x80.
[0071] In an alternative embodiment, after reading the target event record based on the target offset to obtain the event information corresponding to the latest - occurring target event, it further includes: looking up the event log corresponding to the latest - occurring target event based on the event log identifier in the event information corresponding to the latest - occurring target event; determining the cause of the event occurrence based on the event type, the event description information, and the event log. In the embodiments of the present invention, the cause of the event occurrence can be perceived through the event type, the event description information, and the event log.
[0072] In an alternative embodiment, it is determined whether there is still an unprocessed target event occurred by the storage device based on the event configuration area; if there is still an unprocessed target event occurred by the storage device, the event record of the target event is read to obtain the event information of the target event.
[0073] Wherein, the unprocessed target event occurred by the storage device is an event for which the event information has not been read and the event cause has not been located.
[0074] In an alternative embodiment, the total number of event statistics in the event configuration area can be read to obtain a first total number of event statistics, wherein the total number of event statistics is the total of the event statistics of the target events of each event type; if the first total number of event statistics is greater than the second total number of event statistics, and the difference between the first total number of event statistics and the second total number of event statistics is greater than or equal to 2, it is determined that there is still an unprocessed target event occurred by the storage device; wherein, the second total number of event statistics is the total of the event statistics of the target events of each event type recorded by the host at a second storage location, and the second storage location is a storage location outside the event configuration area.
[0075] Furthermore, if there is still an unprocessed target event occurred by the storage device, the event statistics of the event records of each event type in the event configuration area are traversed and compared with the event statistics corresponding to each event type in the first storage location respectively, and the event records with inconsistent event statistics are read to obtain the event information in the event records.
[0076] That is to say, the event configuration area also records the total number of event statistics, the initial value of the total number of event statistics is 0, and when a target event occurs, the total number of event statistics in the event configuration area is incremented by 1. After the host reads the event information of any event record, the second total number of event statistics can be updated according to the event statistics of the event record.
[0077] It should be noted that if an event does not report an interruption due to reasons such as a switch, the event configuration area will also be modified, and the host can process each occurred event through the information in the event configuration area to avoid event omission.
[0078] In an alternative embodiment, after the storage device initializes the event configuration area, the event configuration area is mapped from the base address register space of the storage device to the memory space of the host.
[0079] In this way, by mapping the base address register space to the host's memory space, the base address register space can be accessed through memory read and write operations. Reading event information through memory read operations can improve the efficiency of event information transmission.
[0080] Among them, initialization may include filling the event information in each event record based on the event types supported by the storage device itself, that is, adding the event type, event description information, and event log identifier to the corresponding positions in each event record respectively. In addition, the event configuration area also records the number of event types supported by the storage device itself. During the initialization phase, the storage device adds the number of event types it supports to the event configuration area. In addition, in an alternative embodiment, the event configuration area further includes a general event reporting switch, and each event record has an event reporting switch, which is initialized to the off state during the initialization phase of the storage device.
[0081] Furthermore, the embodiment of the present invention may also obtain the fixed offset address of the event configuration area in the base address register space of the storage device. Correspondingly, reading the target event record based on the target offset may include: reading the target event record based on the fixed offset address and the target offset. That is, the fixed offset address plus the target offset is the position of the target event record.
[0082] In an alternative embodiment, the general event reporting switch in the event configuration area may be turned on so that when the storage device encounters a target event and detects that the general event reporting switch is on, it reports an interrupt notification to the host.
[0083] That is, the event configuration area may include a general event reporting switch for controlling whether to report a host interrupt notification when a target event of all event types occurs. Among them, when the general event reporting switch is at a first preset value, it may represent the off state, and when the general event reporting switch is at a second preset value, it may represent the on state. After an event occurs, the storage device checks the general event reporting switch in the event configuration area and reports an interrupt notification to the host when the general event reporting switch is in the on state.
[0084] In an alternative embodiment, the event reporting switch in one or more event records in the event configuration area may also be turned on as needed so that when the storage device encounters a target event and detects that the general event reporting switch and the event reporting switch corresponding to the target event are on, it reports the interrupt notification corresponding to the target event to the host.
[0085] That is, each event record in the event configuration area may further include an event reporting switch for controlling whether to report a host interrupt notification when a target event of the event type corresponding to the event record occurs. Among them, when the event reporting switch is a first preset value, it may represent the off state, and when the event reporting switch is a second preset value, it may represent the on state. After an event occurs, the storage device checks the event reporting master switch in the event configuration area. When the event reporting master switch is in the on state, it checks the event reporting switch in the corresponding event record. When the event reporting switch in the corresponding event record is on, it reports an interrupt notification to the host. For example, the first preset value is 1 and the second preset value is 0.
[0086] In an alternative embodiment, the event reporting switch in one or more event records in the event configuration area may be turned on as required, including: obtaining the number of event types supported by the storage device from the event configuration area; based on the fixed offset address, the number of event types, and the address range occupied by each event record, turning on the event reporting switch in one or more event records in the event configuration area as required.
[0087] Among them, the address range occupied by each event record is the size of the space occupied, and the space sizes corresponding to each event record may be the same. Based on the number of event types supported by the storage device, the fixed offset address of the event configuration area, and the address range occupied by each event record, the host can locate the space corresponding to the event record, and then turn on the event reporting switch in one or more event records in the event configuration area as required.
[0088] In an alternative embodiment, after mapping the event configuration area from the base address register space of the storage device to the memory space of the host, the event configuration area may be read, the event information in the target event record may be obtained based on the target offset, and the event information of other event records may be obtained based on the total number of event statistics and the number of event statistics in each event record. Among them, after the storage device initializes the event configuration area, the event configuration area is modified by the storage device based on the occurring events. After the host maps the base address register space, the event information of the events occurring in the initialization stage is obtained.
[0089] In this way, after the device is initialized and the host maps the base address register space, it can immediately know whether there is a target event, so as to more quickly understand the internal state of the storage device and make a timely response.
[0090] It can be seen that, in the embodiment of the present invention, an area is allocated in the base address register space of a storage device based on the Non-Volatile Memory Host Controller Interface Specification as an event configuration area. When a target event occurs in the storage device, an interrupt notification is actively reported to the host. The target offset is read from the event configuration area, and then the event record corresponding to the most recently occurred target event is obtained to acquire event information. In this way, when an event occurs in the storage device, it actively reports through an interrupt and transmits the event information based on the event configuration area allocated in the base address register space of the storage device, without waiting for a request and occupying queue resources, which can ensure the timely reporting of events, avoid event loss, and reduce resource consumption.
[0091] Further, referring to Figure 2 as shown, an embodiment of the present invention discloses an event notification method applied to a storage device. The storage device is based on the Non-Volatile Memory Host Controller Interface Specification. The method includes:
[0092] Step S21: When a target event occurs, add the target offset to the event configuration area, where the target offset recorded in the event configuration area is the offset of the target event record in the event configuration area, the target event record is the event record corresponding to the most recently occurred target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0093] Step S22: Report an interrupt notification to the host so that the host reads the target event record based on the target offset to obtain the event information corresponding to the most recently occurred target event.
[0094] In an alternative embodiment, before reporting the interrupt notification to the host, increment the event count in the target event record. So that the host reads the event count in the target event record based on the target offset to obtain a first event count. When the first event count is greater than a second event count, it is determined that a target event of the event type corresponding to the target event record has occurred, and the event information is read from the target event record to obtain the event information corresponding to the most recently occurred target event; where the second event count is the event count of the event type corresponding to the target event record recorded by the host at a first storage location, and the first storage location is a storage location outside the event configuration area.
[0095] The above event notification method applied to a storage device can be referred to in mutual reference with the foregoing embodiments.
[0096] It can be seen that in the embodiment of the present invention, an area is allocated in the base address register space of a storage device based on the Non-Volatile Memory Host Controller Interface Specification as an event configuration area. When a target event occurs in the storage device, an interrupt notification is actively reported to the host, the target offset is read from the event configuration area, and then the event record corresponding to the most recently occurred target event is obtained to obtain event information. In this way, when an event occurs in the storage device, it actively reports through an interrupt, and the event information is transmitted based on the event configuration area allocated in the base address register space of the storage device, without waiting for a request and occupying queue resources, which can ensure the timely reporting of events, avoid event loss, and reduce resource consumption.
[0097] Further, as shown in Figure 3 shown, Figure 3 FIG. is an interaction schematic diagram of AER event notification for an NVMe storage device provided by an embodiment of the present invention. The controller is the storage device controller and does not occupy the control command submission queue, control command completion queue, IO command submission queue, and IO completion queue of the data plane and control plane. The AER event originates from the inside of the storage device. In the embodiment of the present invention, it is actively sent to the host in real time through an interrupt. The storage device uses the register in the NVMe Bar space to report events to the host. When an event occurs in the storage device, the event configuration area is modified, and the host is notified of the event through an interrupt. The host will immediately sense that an event has occurred in the device through the interrupt and obtain the event information by directly reading the Bar space, that is, the event configuration area. Because this method through the NVMe Bar space register has a higher priority than the processing of the SQ queue, and the operation method is simple and direct, the host will process the events of the storage device in the first place, preventing the loss caused by the AER message not being processed in time, improving the system reliability and responsiveness, avoiding the consumption of control command queues, PCIe links, and storage device controller resources caused by the host sending AER requests, reducing unnecessary message interactions on the PCIe link, and reducing the implementation complexity of the host and the storage device controller. The event reporting only has two interactions, and each time only 4-byte data access is involved.
[0098] Further, as shown in Figure 4 shown, Figure 4 FIG. is a schematic diagram of a host-side processing flow provided by an example of the present invention. It may include host initialization, mapping the base address register space, reading the event configuration area, and turning on the event reporting switch, including the overall event reporting switch and the event reporting switch in the corresponding event record; waiting for event reporting. As shown in Figure 5 shown, Figure 5A processing flowchart of the storage device side provided by an embodiment of the present invention. It may include device initialization; turning off the event reporting switch, including the total event reporting switch and the event reporting switch in each event record; setting event information. In the embodiment of the present invention, the event information is used as an event identifier, and the event information includes event type, event description information, and event log identifier; clearing event statistical data, including the number of event statistics and the total number of event statistics.
[0099] Among them, during the initialization phase, the host maps the register address space of the NVMe Bar (i.e., the base address register space) to the host's memory space, so that the space of the NVMe Bar can be accessed by means of memory read and write. The host reads the fixed offset address of the NVMe Bar register address space during the initialization phase. Here, it is the NVMe AER event configuration area, and its layout in memory is shown in Figure 6 shown Figure 6 A schematic diagram of the event configuration area provided by an embodiment of the present invention. Among them, the support number (support num) represents how many types of AER events the storage device supports, that is, the number of event types supported by the aforementioned storage device. The total number of event statistics (total aer num) represents how many AER events the storage device has generated in total. The total event reporting switch (top mask) represents the total switch for AER event reporting. The target offset (last aer offset, that is, the most recent event offset) represents the offset of the most recently occurred AER event in the AER event configuration area. Each type of AER event has an AER entry (event record) for control. During the initialization phase, the host sets the top mask of the AER event configuration area in the NVMe Bar space to 0, indicating that the total switch for AER event reporting is turned on. During the initialization phase, the host obtains how many AER events the device supports in total according to the support num of the AER event configuration area, and sequentially sets the mask (event reporting switch) of different types of AER events to 0, indicating that the corresponding AER event notification is turned on.
[0100] When initializing, the NVMe storage device needs to initialize the support num to the total number of AER events it supports, initialize the top mask and the mask of all AER entries (the event reporting switch, denoted as m in the figure) to 1, indicating that AER events are not reported. At the same time, fill in all supported AER id (i.e., event identifier, in this invention, event information is used as the event identifier) fields. When an event occurs in the storage device, the device finds the AER entry (event record) in the AER event configuration area according to the id of the AER event, and increments the event count field therein by one. The storage device also checks whether the top mask and the mask in the entry of this AER event are both 0. If both are 0, it means the host has enabled the interrupt notification function. At this time, the storage device notifies the host through MSIX interrupt. When the host receives the interrupt, it reads the target offset of the occurred event from the last aer offset in the AER event configuration area, and then reads the corresponding event record through the target offset to sense the cause of the occurred event through the event information.
[0101] That is to say, in this invention, by adding an AER event configuration area for the storage device in the NVMe Bar space, the NVMe storage device controller needs to configure the initial values into the AER event configuration area during initialization, and at the same time, the host enables or disables AER event reporting according to needs during initialization. It avoids the cumbersome request / response mechanism of the AER event reporting mechanism, overcomes the deficiency that the AER event reporting mechanism reports untimely and there may be potential event loss. At the same time, this invention also improves the utilization rate of the PCIe link, especially in the scenario of high IO throughput rate.
[0102] Further, as shown in Figure 7 The embodiment of this invention provides an interaction flowchart between the host and the storage device. The storage device initializes the event configuration area, the host maps the base address register space, reads the event configuration area, enables the event reporting switch. When the storage device generates an event, it performs interrupt reporting. When the host device receives the interrupt, it reads and processes the event configuration area. Both interrupt reporting and reading the event configuration area involve accessing 4 Bytes (bytes).
[0103] In this way, an AER event configuration area is created in the NVMe Bar memory for the NVMe storage device, and the device is interacted with in a memory-mapped manner, with a higher priority than all SQ / CQ queues. When the storage device has an event to report, it interacts with the host through this AER event configuration area, reducing the load on the event interaction process and link, improving the timeliness of event reporting of the NVMe storage device and the reliability of the system, significantly enhancing the efficiency, reducing the consumption of the NVMe storage device on the PCIe link. The consumption of this method on the link is only 8 bytes, reducing the occupation of the ASQ control command queue resources and controller resources by the NVMe storage device. The host can use the interrupt or polling method to process AER events, greatly expanding the business scenarios on the host.
[0104] See Figure 8 As shown, an event notification device is provided in an embodiment of the present invention, which is applied to a host and includes:
[0105] An interrupt notification acquisition module 81, configured to acquire an interrupt notification reported by a storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification;
[0106] A target offset reading module 82, configured to read a target offset from an event configuration area based on the interrupt notification, where the target offset is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0107] An event information reading module 83, configured to read the target event record based on the target offset to obtain event information corresponding to the latest occurring target event.
[0108] In an optional implementation manner, the event information reading module 83 includes:
[0109] Read the event statistics quantity in the target event record based on the target offset to obtain a first event statistics quantity;
[0110] If the first event statistics quantity is greater than a second event statistics quantity, it is determined that a target event of the event type corresponding to the target event record occurs, and event information is read from the target event record to obtain event information corresponding to the latest occurring target event;
[0111] Wherein, the second event statistics quantity is the event statistics quantity of the event type corresponding to the target event record recorded by the host at a first storage location, and the first storage location is a storage location outside the event configuration area.
[0112] In an alternative embodiment, the apparatus further comprises:
[0113] An event unprocessed judgment module, configured to, after reading the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event, judge whether there is still an unprocessed target event occurring in the storage device based on the event configuration area.
[0114] An event processing module, configured to, if there is still an unprocessed target event occurring in the storage device, read the event record of the target event to obtain the event information of the target event.
[0115] Wherein, the event unprocessed judgment module is specifically configured to read the total number of event statistics in the event configuration area to obtain a first total number of event statistics, where the total number of event statistics is the total of the event statistics of the target events of each event type;
[0116] If the first total number of event statistics is greater than the second total number of event statistics, and the difference between the first total number of event statistics and the second total number of event statistics is greater than or equal to 2, it is determined that there is still an unprocessed target event occurring in the storage device;
[0117] Wherein, the second total number of event statistics is the total of the event statistics of the target events of each event type recorded by the host at a second storage location, and the second storage location is a storage location outside the event configuration area.
[0118] Correspondingly, the event processing module is specifically configured to, if there is still an unprocessed target event occurring in the storage device, traverse the event statistics of the event records of each event type in the event configuration area, compare them with the event statistics corresponding to each event type in the first storage location respectively, and read the event records with inconsistent event statistics to obtain the event information in the event records.
[0119] In an alternative embodiment, the event information includes the event type of the target event, the event description information, and the event log identifier.
[0120] Further, the apparatus further comprises:
[0121] An event log search module, configured to, after reading the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event, search for the event log corresponding to the latest-occurring target event based on the event log identifier in the event information corresponding to the latest-occurring target event;
[0122] An event cause determination module, configured to determine the event cause based on the event type, the event description information, and the event log.
[0123] Further, the device further includes an address mapping module, configured to map the event configuration area from the base address register space of the storage device to the memory space of the host after the storage device initializes the event configuration area.
[0124] Further, the device further includes a fixed offset address acquisition module, configured to acquire a fixed offset address of the event configuration area in the base address register space of the storage device. Correspondingly, an event information reading module 83 is configured to read the target event record based on the fixed offset address and the target offset.
[0125] In an alternative embodiment, the device further includes:
[0126] An event reporting general switch enabling module, configured to enable the event reporting general switch in the event configuration area, so that when the storage device has a target event and detects that the event reporting general switch is enabled, the storage device reports an interrupt notification to the host.
[0127] In an alternative embodiment, the device further includes:
[0128] An event reporting switch enabling module, configured to enable the event reporting switch in one or more event records in the event configuration area as required, so that when the storage device has a target event and detects that the event reporting general switch and the event reporting switch corresponding to the target event are enabled, the storage device reports an interrupt notification corresponding to the target event to the host.
[0129] In an alternative embodiment, the event reporting switch enabling module may specifically be configured to:
[0130] Acquire the number of event types supported by the storage device from the event configuration area; <^
[0131] Based on the fixed offset address, the number of event types, and the address range occupied by each event record, enable the event reporting switch in one or more event records in the event configuration area as required.
[0132] It can be seen that in the embodiment of the present invention, an area is allocated in the base address register space of a storage device based on the Non-Volatile Memory Host Controller Interface Specification as an event configuration area. When a target event occurs in the storage device, an interrupt notification is actively reported to the host, and the target offset is read from the event configuration area, and then the event record corresponding to the latest-occurring target event is obtained to obtain event information. In this way, when an event occurs in the storage device, it actively reports through an interrupt and transmits event information based on the event configuration area allocated in the base address register space of the storage device, without waiting for requests and occupying queue resources, which can ensure timely reporting of events, avoid event loss, and reduce resource consumption.
[0133] Figure 8 For the description of the features in the corresponding embodiments, reference can be made to Figure 1 the relevant descriptions of the corresponding embodiments, which will not be elaborated here one by one.
[0134] Furthermore, an embodiment of the present invention discloses an event notification device applied to a storage device. The storage device is based on the Non-Volatile Memory Host Controller Interface Specification. The method includes:
[0135] A target offset adding module, configured to add a target offset to the event configuration area when a target event occurs, where the target offset recorded in the event configuration area is the offset of the target event record in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device;
[0136] An interrupt notification reporting module, configured to report an interrupt notification to the host so that the host reads the target event record based on the target offset to obtain the event information corresponding to the latest-occurring target event.
[0137] It can be seen that in the embodiment of the present invention, an area is allocated in the base address register space of a storage device based on the Non-Volatile Memory Host Controller Interface Specification as an event configuration area. When a target event occurs in the storage device, an interrupt notification is actively reported to the host, and the target offset is read from the event configuration area, and then the event record corresponding to the latest-occurring target event is obtained to obtain event information. In this way, when an event occurs in the storage device, it actively reports through an interrupt and transmits event information based on the event configuration area allocated in the base address register space of the storage device, without waiting for requests and occupying queue resources, which can ensure timely reporting of events, avoid event loss, and reduce resource consumption.
[0138] Figure 9 The following is a structural diagram of an electronic device provided by an embodiment of the present invention. As Figure 9 shown, the electronic device includes: a memory 90 for storing a computer program;
[0139] A processor 91, which is configured to execute a computer program to implement the steps of the event notification method as described in the above embodiments.
[0140] Wherein, the processor 91 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 91 may be implemented in at least one of the following hardware forms: digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 91 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 91 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 91 may further include an artificial intelligence (AI) processor, and the AI processor is used to process computational operations related to machine learning.
[0141] The memory 90 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 90 may further include high-speed random access memory and non-volatile memory, such as one or more disk storage devices and flash storage devices. In this embodiment, the memory 90 is at least used to store the following computer program 901. After the computer program is loaded and executed by the processor 91, it can implement the relevant steps of the event notification method disclosed in any of the foregoing embodiments. In addition, the resources stored in the memory 90 may further include an operating system 902 and data 903, etc., and the storage method may be transient storage or permanent storage. Among them, the operating system 902 may include Windows, Unix, Linux, etc. The data 903 may include, but is not limited to, event data, etc.
[0142] In some embodiments, the electronic device may further include a display screen 92, an input / output interface 93, a communication interface 94, a power supply 95, and a communication bus 96.
[0143] Those skilled in the art can understand that Figure 8 the structure shown in
[0144] It can be understood that if the event notification method in the above embodiments is implemented in the form of 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 current technology, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and executes all or part of the steps of the methods in the various embodiments of the present invention. The foregoing storage medium includes: USB flash drive, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc., which can store program codes.
[0145] Based on this, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the event notification method as described above are implemented.
[0146] Next, a computer program product provided by the embodiments of the present invention will be introduced. The computer program product described below can be cross-referred to other embodiments described herein.
[0147] A computer program product includes computer programs / instructions. When the computer programs / instructions are executed by a processor, the steps of the event notification method disclosed above are implemented.
[0148] The event notification method, device, equipment, medium and product provided by the embodiments of the present invention have been introduced in detail above. The various embodiments in the specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The same or similar parts among the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple. For the relevant parts, refer to the description of the method part.
[0149] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0150] The above has introduced in detail the event notification method, device, equipment, medium and product provided by the present invention. Specific examples are used in this article to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the present invention.
Claims
1. An event notification method, characterized in that, Applied to a host, including: Obtain an interrupt notification reported by a storage device, where the interrupt notification is reported when a target event occurs in the storage device, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification; Read a target offset from an event configuration area based on the interrupt notification, where the target offset is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device; the event configuration area includes event records corresponding to each event type respectively, each event record has its own corresponding offset, and each time a target event occurs, the target offset in the event configuration area is modified to the offset corresponding to the target event; any event record includes an event statistical quantity and event information, and when a target event occurs, the storage device increments the event statistical quantity in the event record of the corresponding event type by 1; the event configuration area also records the total event statistical quantity, and when a target event occurs, the total event statistical quantity in the event configuration area is incremented by 1; Read the event statistical quantity in the target event record based on the target offset to obtain a first event statistical quantity; if the first event statistical quantity is greater than a second event statistical quantity, it is determined that a target event of the event type corresponding to the target event record has occurred, and the event information is read from the target event record to obtain the event information corresponding to the latest-occurring target event; the second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host.
2. The event notification method according to claim 1, wherein The second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host at a first storage location, and the first storage location is a storage location outside the event configuration area.
3. The event notification method according to claim 2, wherein After obtaining the event information corresponding to the latest-occurring target event, it further includes: Judge whether there are still unprocessed target events occurring in the storage device based on the event configuration area; If there are still unprocessed target events occurring in the storage device, read the event record of the target event to obtain the event information of the target event.
4. The event notification method according to claim 3, characterized in that, Judging whether there are still unprocessed target events occurring in the storage device based on the event configuration area includes: Read the total event statistical quantity in the event configuration area to obtain a first total event statistical quantity, where the total event statistical quantity is the total of the event statistical quantities of the target events of each event type; If the first total event statistical quantity is greater than a second total event statistical quantity, and the difference between the first total event statistical quantity and the second total event statistical quantity is greater than or equal to 2, it is determined that there are still unprocessed target events occurring in the storage device; where the second total event statistical quantity is the total of the event statistical quantities of the target events of each event type recorded by the host at a second storage location, and the second storage location is a storage location outside the event configuration area.
5. The event notification method according to claim 4, characterized in that, If there are still target events occurred by the storage device that have not been processed, read the event record of the target event to obtain the event information of the target event, including: If there are still target events occurred by the storage device that have not been processed, traverse the event statistics quantities of the event records of each event type in the event configuration area, compare them with the event statistics quantities corresponding to each event type in the first storage location respectively, and read the event records with inconsistent event statistics quantities to obtain the event information in the event records.
6. The event notification method according to claim 1, characterized in that, The event information includes the event type of the target event, the event description information, and the event log identifier.
7. The event notification method according to claim 6, wherein, After obtaining the event information corresponding to the latest occurred target event, it further includes: Search for the event log corresponding to the latest occurred target event based on the event log identifier in the event information corresponding to the latest occurred target event; Determine the cause of the event based on the event type, the event description information, and the event log.
8. The event notification method according to claim 1, wherein It further includes: After the storage device initializes the event configuration area, map the event configuration area from the base address register space of the storage device to the memory space of the host.
9. The event notification method according to claim 8, characterized in that, It further includes: Obtain the fixed offset address of the event configuration area in the base address register space of the storage device.
10. The event notification method according to claim 9, wherein, Read the target event record based on the target offset, including: Read the target event record based on the fixed offset address and the target offset.
11. The event notification method according to claim 9, wherein It further includes: Turn on the event reporting general switch in the event configuration area so that when the storage device has a target event and detects that the event reporting general switch is on, it reports an interrupt notification to the host.
12. The event notification method according to claim 11, wherein It further includes: Turn on the event reporting switches of one or more event records in the event configuration area as required so that when the storage device has a target event and detects that the event reporting general switch and the event reporting switch corresponding to the target event are on, it reports an interrupt notification corresponding to the target event to the host.
13. The event notification method according to claim 12, characterized in that, Turning on the event reporting switches of one or more event records in the event configuration area as required includes: Obtain the number of event types supported by the storage device from the event configuration area; Based on the fixed offset address, the number of event types, and the address range occupied by each event record, turn on the event reporting switches of one or more event records in the event configuration area as required.
14. An event notification method, characterized in that, Applied to a storage device, the storage device is based on the Non-Volatile Memory Host Controller Interface Specification, and the method includes: In the case of a target event occurring, add a target offset to the event configuration area, where the target offset recorded in the event configuration area is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the most recently occurred target event, and the event configuration area is an area allocated in the base address register space of the storage device; the event configuration area includes event records corresponding to each event type respectively, each event record has its own corresponding offset, and each time a target event occurs, the target offset in the event configuration area is modified to the offset corresponding to the target event; any event record includes an event statistical quantity and event information, and when a target event occurs, the storage device increments the event statistical quantity in the event record of the corresponding event type by 1; the event configuration area also records the total event statistical quantity, and when a target event occurs, the total event statistical quantity in the event configuration area is incremented by 1; Report an interrupt notification to the host so that the host reads the event statistical quantity in the target event record based on the target offset to obtain a first event statistical quantity; if the first event statistical quantity is greater than a second event statistical quantity, it is determined that a target event of the event type corresponding to the target event record has occurred, and the event information is read from the target event record to obtain the event information corresponding to the most recently occurred target event; the second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host.
15. The event notification method according to claim 14, characterized in that, The second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host at a first storage location, and the first storage location is a storage location outside the event configuration area.
16. An event notification device, characterized in that, Applied to a host, it includes: An interrupt notification acquisition module, configured to acquire an interrupt notification reported by a storage device, where the interrupt notification is reported when the storage device has a target event, and the storage device is based on the Non-Volatile Memory Host Controller Interface Specification; A target offset reading module, configured to read a target offset from the event configuration area based on the interrupt notification, where the target offset is the offset at which the target event is recorded in the event configuration area, the target event record is the event record corresponding to the most recently occurred target event, and the event configuration area is an area allocated in the base address register space of the storage device; the event configuration area includes event records corresponding to each event type respectively, each event record has its own corresponding offset, and each time a target event occurs, the target offset in the event configuration area is modified to the offset corresponding to the target event; any event record includes an event statistical quantity and event information, and when a target event occurs, the storage device increments the event statistical quantity in the event record of the corresponding event type by 1; the event configuration area also records the total event statistical quantity, and when a target event occurs, the total event statistical quantity in the event configuration area is incremented by 1; An event information reading module, configured to read the event statistical quantity in the target event record based on the target offset to obtain a first event statistical quantity; if the first event statistical quantity is greater than a second event statistical quantity, it is determined that a target event of the event type corresponding to the target event record occurs, and event information is read from the target event record to obtain the event information corresponding to the latest-occurring target event; the second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host.
17. An event notification device, characterized in that, Applied to a storage device, the storage device is based on the Non-Volatile Memory Host Controller Interface Specification and includes: A target offset adding module, configured to add a target offset to an event configuration area when a target event occurs, where the target offset recorded in the event configuration area is the offset of the target event record in the event configuration area, the target event record is the event record corresponding to the latest-occurring target event, and the event configuration area is an area allocated in the base address register space of the storage device; the event configuration area includes event records corresponding to each event type respectively, each event record has its own corresponding offset, and each time a target event occurs, the target offset in the event configuration area is modified to the offset corresponding to the target event; any event record includes an event statistical quantity and event information, and when a target event occurs, the storage device increments the event statistical quantity in the event record of the corresponding event type by 1; the event configuration area also records the total event statistical quantity, and when a target event occurs, the total event statistical quantity in the event configuration area is incremented by 1; An interrupt notification reporting module, configured to report an interrupt notification to the host, so that the host reads the event statistical quantity in the target event record based on the target offset to obtain a first event statistical quantity; if the first event statistical quantity is greater than a second event statistical quantity, it is determined that a target event of the event type corresponding to the target event record occurs, and event information is read from the target event record to obtain the event information corresponding to the latest-occurring target event; the second event statistical quantity is the event statistical quantity of the event type corresponding to the target event record recorded by the host.
18. An electronic device, characterized in that, Including: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the event notification method according to any one of claims 1 to 15.
19. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the steps of the event notification method according to any one of claims 1 to 15 are implemented.
20. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the steps of the event notification method according to any one of claims 1 to 15 are implemented.
Citation Information
Patent Citations
Storage device and an element management method of the storage device
CN109840232A
Node abnormal event processing method, network card and storage cluster
CN118118321A