Log management method and device, equipment and storage medium
By implementing cache allocation and segmented cyclic export strategies during the SSD device power-on initialization process, the problem of time-consuming SSD device log export was solved, achieving efficient and stable log export and improving operational efficiency.
Patent Information
- Application Number
- CN202511574678.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, the process of exporting SSD device logs is time-consuming, which affects the work efficiency of maintenance personnel, especially when exporting log files through BMC, which may take tens of minutes or even hours.
During the power-on initialization process, memory requirement information is reported to the host for cache allocation, and log export instructions are received through the out-of-band command processing component. Log export is completed using a segmented loop export strategy and a preset direct memory access engine. The instruction completion information is then sent back to the host to trigger log processing operations.
It enables efficient, stable and reliable export of SSD device logs, improving the work efficiency of operation and maintenance personnel. The log export rate can reach GB/s level, which is several orders of magnitude higher than traditional methods.
Smart Images

Figure CN121387689A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, in particular to a log management method and device, equipment and storage medium. BACKGROUND
[0002] In the use and operation process of a solid state drive (SSD) device, a log module records important historical information in the running process of the device, and in the case of device abnormalities, log data export analysis is a basic log management function.
[0003] Currently, the log export of the SSD device mainly uses in-band commands, including NVMe Admin commands defined by the manufacturer or Telemetry log acquisition commands defined by the protocol standard, but in actual application, the scenarios that need to export logs often mean that the device or environment has failed, and these failures may affect the sending and processing of the customized in-band commands. Therefore, some manufacturers also support obtaining the log data of the SSD device through the device management function provided by the BMC (Baseboard Management Controller) device platform. However, the time-consuming of exporting log files through the BMC is often in the order of tens of minutes or even hours, which will seriously affect the work efficiency of the operation and maintenance personnel.
[0004] Therefore, how to solve the problems existing in the prior art and efficiently, stably and reliably realize the log export of the SSD device is a problem to be solved by those skilled in the art. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a log management method, device, equipment and storage medium, which can solve the problems existing in the prior art and efficiently, stably and reliably realize the log export of the SSD device. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a log management method applied to a solid state drive device, comprising:
[0007] In the power-on initialization process, the host memory requirement information is reported to the corresponding host, so that the cache allocation is performed through the host and based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state drive device;
[0008] When the log export instruction sent by the host is received through the local out-of-band command processing component, the log data reading is performed based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy;
[0009] The log export operation is completed by using a segmented cycle export strategy, to-be-exported logs, cache allocation results and a preset local direct memory access engine, so as to obtain instruction completion information corresponding to the log export instruction;
[0010] The instruction completion information is fed back to the host, so that the host reads the logs from the local memory based on the received instruction completion information, and triggers a log processing operation according to a corresponding log reading result.
[0011] Optionally, the cache allocation is performed by the host based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device, including:
[0012] The solid state disk device is authenticated by the host to determine an authentication result;
[0013] When the authentication result indicates that the authentication is passed, the host memory requirement information reported by the solid state disk device is received; wherein the host memory requirement information includes memory space size information and a host memory cache function required;
[0014] The support capability of the solid state disk device for the host memory cache function is analyzed to determine a function analysis result;
[0015] Based on the function analysis result, it is judged whether the cache request condition is met or not to determine a request condition judgment result;
[0016] If the request condition judgment result indicates that the condition is met, the cache allocation is performed in the target memory area based on the memory space size information and the host memory cache function to determine a cache allocation result; wherein the cache allocation result includes a cache base address and cache size information;
[0017] The cache allocation result is fed back to the solid state disk device.
[0018] Optionally, when the log export instruction sent by the host is received by the local out-of-band command processing component, the log data reading is performed based on the log export instruction and the local flash memory to determine the to-be-exported logs and the segmented cycle export strategy, including:
[0019] The log export instruction sent by the host is received by the out-of-band command processing component of the solid state disk locally;
[0020] The log export instruction is parsed based on the out-of-band command processing component to determine the target log data length to be exported;
[0021] The log data reading is performed based on the out-of-band command processing component, the target log data length and the local flash memory to determine the to-be-exported logs;
[0022] determine whether the log data of the preset sensitive type exists in the to-be-exported log to determine a data determination result;
[0023] If the data determination result indicates that the preset sensitive type does not exist, it is determined whether the data amount corresponding to the to-be-exported log is greater than the cache size information to determine a data amount determination result;
[0024] If the data amount determination result is yes, new host memory requirement information is sent to the host through the solid state disk device and the data amount corresponding to the to-be-exported log to obtain a new cache allocation result;
[0025] If the data amount determination result is no, it is determined whether the preset segmented cyclic export condition is met based on the data amount corresponding to the to-be-exported log to determine an export condition determination result;
[0026] When the export condition determination result indicates that the preset segmented cyclic export condition is met, a segmented cyclic export strategy corresponding to the to-be-exported log is determined; wherein the segmented cyclic export strategy includes log segment size information exported each time.
[0027] Optionally, the segmented cyclic export strategy, the to-be-exported log, the cache allocation result, and the local preset direct memory access engine are used to complete a log export operation, including:
[0028] The to-be-exported log is processed using the segmented cyclic export strategy to determine a plurality of log segment sets; wherein the log segment set includes a plurality of target log segments;
[0029] The target address is determined based on the local preset direct memory access engine and the cache allocation result;
[0030] Each log segment set is subjected to segmented export of different cyclic rounds based on the preset direct memory access engine and the target address, and preset metadata is added to the head of the target log segment to complete the log export operation and obtain a log export result; the preset metadata is any one or a combination of a plurality of sequence numbers, timestamps, and log types;
[0031] Based on the log export result, instruction completion information corresponding to the log export instruction is determined;
[0032] The instruction completion information is sent to a baseboard management controller management component in the host.
[0033] Optionally, the log management method further includes:
[0034] The log segment export state corresponding to each cyclic round is monitored through the solid state disk device to determine a monitoring result;
[0035] Based on the monitoring result, it is judged whether a log segment export failure event has occurred at present, so as to determine an event judgment result;
[0036] If the time judgment result is yes, an export retry operation corresponding to the corresponding log segment set is triggered, and the number of current log segment export failure events and the retry times are recorded.
[0037] Optionally, the host reads the log from the local memory based on the received instruction completion information, and triggers a log processing operation according to the corresponding log reading result, including:
[0038] The substrate management controller management component in the host receives the instruction completion information corresponding to the log export instruction;
[0039] Based on the preset data verification rule and the instruction completion information, log data verification is performed to determine a verification result;
[0040] If the verification result indicates that the verification fails, a corresponding log segment retransmission request operation is triggered based on the verification result;
[0041] If the verification result indicates that the verification is successful, the host reads the log from the local memory based on the log export result, determines the log reading result, and triggers a corresponding cache release operation;
[0042] In the form of a log file, the data in the log reading result is transmitted to the path specified by the substrate management controller management component, so as to trigger the log processing operation.
[0043] Optionally, the log management method further comprises:
[0044] After the host issues the log export instruction to the solid state disk device, based on the preset timeout mechanism, it is judged whether the instruction completion information corresponding to the log export instruction is received within a preset time period, so as to determine a timeout judgment result;
[0045] If the timeout judgment result is no, an alarm operation is triggered, and the host reissues the log export instruction to the solid state disk device.
[0046] In a second aspect, the present application provides a log management device applied to a solid state disk device, comprising:
[0047] The cache allocation module is used to report host memory demand information to the corresponding host in the power-on initialization process, so that the host allocates the cache based on the received host memory demand information, and feeds back the corresponding cache allocation result to the solid state disk device;
[0048] The export strategy determination module is configured to, when receiving the log export instruction sent by the host through the local out-of-band command processing component, perform log data reading based on the log export instruction and the local flash memory to determine the log to be exported and a segmented cyclic export strategy.
[0049] The log export module is configured to complete the log export operation by using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine to obtain instruction completion information corresponding to the log export instruction.
[0050] The log reading module is configured to feed back the instruction completion information to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation according to a corresponding log reading result.
[0051] In a third aspect, the present application provides an electronic device, comprising:
[0052] The memory is configured to save the computer program.
[0053] The processor is configured to execute the computer program to realize the steps of the log management method.
[0054] In a fourth aspect, the present application provides a computer readable storage medium configured to save a computer program, and the computer program is executed by a processor to realize the steps of the log management method.
[0055] It can be seen that, in the present application, the host memory requirement information is reported to the corresponding host in the power-on initialization process of the solid state disk device, so that the host performs cache allocation based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device; when the log export instruction sent by the host is received through the local out-of-band command processing component, log data reading is performed based on the log export instruction and the local flash memory to determine the log to be exported and a segmented cyclic export strategy; the log export operation is completed by using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine to obtain instruction completion information corresponding to the log export instruction; the instruction completion information is fed back to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation according to a corresponding log reading result.
[0056] It can be seen from the above technical solution that, applied to a solid state disk device, in a power-on initialization process, host memory requirement information is reported to a corresponding host, so that the host performs cache allocation based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device; when a log export instruction sent by the host is received by the local out-of-band command processing component, log data is read based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy; the log export operation is completed using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine to obtain instruction completion information corresponding to the log export instruction; the instruction completion information is fed back to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation according to the corresponding log reading result. That is, in the present application, in the power-on initialization process, the host memory requirement information is reported to the corresponding host, so that the host performs cache allocation based on the received host memory requirement information, and the cache allocation result is fed back to the solid state disk device. Then, when the log export instruction sent by the host is received by the local out-of-band command processing component, the log data is read based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy. Then, the log export operation is completed by the local preset direct memory access engine and using the segmented cyclic export strategy, the log to be exported and the cache allocation result, to obtain the log export result. Then, the instruction completion information is fed back to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation. In this way, the problems existing in the related solutions can be effectively solved, so that the log export of the SSD device is efficiently, stably and reliably realized, and the work efficiency of the operation and maintenance personnel is improved. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the embodiments of the present application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0058] Figure 1 A specific log management method flowchart is provided for the present application.
[0059] Figure 2 A specific log management scheme architecture diagram is provided for the present application.
[0060] Figure 3 A log management method timing diagram is provided for the present application.
[0061] Figure 4 A structure diagram of a log management device provided by the present application is shown in the figure.
[0062] Figure 5 An electronic device structure diagram provided by the present application is shown in the figure. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0064] The terms “include” and “have” and any variations thereof in the specification and the above drawings of the present application are intended to cover the non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can include steps or units not listed.
[0065] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the drawings and specific embodiments.
[0066] Currently, the export of SSD device logs mainly uses in-band commands, including custom NVMe Admin commands (Non-Volatile Memory Host Controller Interface Specification) or protocol standard defined Telemetry log acquisition commands, but in actual application, the scenarios that need to export logs often mean that the device or environment has failed, and these failures may affect the sending and processing of custom in-band commands. Therefore, some manufacturers also support the device management function provided by the BMC (Baseboard Management Controller) device platform to obtain the log data of the SSD device. However, the time-consuming of exporting log files through BMC is often in the order of tens of minutes or even hours, which will seriously affect the work efficiency of the operation and maintenance personnel.
[0067] Therefore, the present application provides a log management scheme, which can effectively solve the problems existing in the related schemes in the prior art, thereby efficiently, stably and reliably realizing the log export of the SSD device, and further improving the work efficiency of the operation and maintenance personnel.
[0068] Reference is made to Figure 1As shown, the embodiment of the present application discloses a log management method, applied to a solid state disk device, comprising:
[0069] In the power-on initialization process, the host memory requirement information is reported to the corresponding host, so that the cache allocation is performed by the host based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device.
[0070] In this embodiment, the solid state disk device needs to report the required host memory information to the host, so that the host allocates cache for the solid state disk device accordingly, that is, the solid state disk device is authenticated by the host to determine the authentication result; when the authentication result indicates that the authentication is passed, the host memory requirement information reported by the solid state disk device is received; wherein the host memory requirement information includes the required memory space size information and the host memory cache function; the support capability of the solid state disk device for the host memory cache function is analyzed to determine the function analysis result; based on the function analysis result, it is judged whether the cache request condition is met at present to determine the request condition judgment result; if the request condition judgment result indicates that it is met, the cache allocation is performed in the target memory area based on the memory space size information and the host memory cache function to determine the cache allocation result; wherein the cache allocation result includes the cache base address and the cache size information; the cache allocation result is fed back to the solid state disk device. Wherein, the host should verify the identity of the SSD device, which can be verified by digital certificate or hardware identity number, to ensure that only trusted devices can request memory allocation.
[0071] It should be understood that on the host side, a fixed address and size cache space will be allocated, and the address and size information of the space is notified to the SSD device through a related protocol, such as the host memory cache function of the NVMe protocol, for use by the SSD device. In this scheme, it is used as the target address of the exported log data of the SSD device.
[0072] In addition, when the host allocates memory, it can use reserved memory or dedicated cache area, for example: reserved through UEFI (Unified Extensible Firmware Interface) or related operating system, to avoid being occupied by other application programs. Specifically, a continuous physical address space can be used to optimize the DMA (Direct Memory Access) performance. Moreover, after the host allocates memory, it can set access permissions through IOMMU (Input-Output Memory Management Unit) to ensure that only authorized SSD devices can access the memory area, so as to prevent malicious access or data damage through the memory protection mechanism.
[0073] Step S12, when the log export instruction sent by the host is received by the local out-of-band command processing component, log data reading is performed based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy.
[0074] In this embodiment, after the cache allocation is completed, until the log export instruction sent by the host is received by the local out-of-band command processing component, the log to be exported and the strategy for exporting the log in the current out-of-band scenario are determined based on the instruction, that is, the log export instruction sent by the host is received by the local out-of-band command processing component of the solid state disk; the log export instruction is parsed by the out-of-band command processing component to determine the length of the target log data to be exported; log data reading is performed based on the out-of-band command processing component, the length of the target log data, and the local flash memory to determine the log to be exported; it is determined whether there is log data of a preset sensitive type in the log to be exported to determine the data determination result; if the data determination result indicates that there is no, it is determined whether the data amount corresponding to the log to be exported is greater than the cache size information to determine the data amount determination result; if the data amount determination result is yes, new host memory requirement information is sent to the host by the solid state disk device and the data amount corresponding to the log to be exported to obtain a new cache allocation result; if the data amount determination result is no, it is determined whether the preset segmented cyclic export condition is met based on the data amount corresponding to the log to be exported to determine the export condition determination result; when the export condition determination result indicates that it is met, the segmented cyclic export strategy corresponding to the log to be exported is determined; wherein, in combination with Figure 2 As shown in the figure, the out-of-band command processing component is located on the side of the solid state disk device, responsible for processing the out-of-band management commands issued by the host side, including the log export command. And cooperate with the log management component, read out the log data located in the persistent storage medium, such as NAND Flash, and transmit it to the specified target address. The segmented cyclic export strategy includes the log segment size information exported each time.
[0075] It can be understood that after the log to be exported is determined, in this embodiment, it is also necessary to detect whether there is sensitive log data in the log, and if there is, the data needs to be encrypted before export to ensure the security of data transmission. And according to the data amount of the log to be exported, it is determined whether it needs to be exported in segments, if not, it can be directly written to the target address by DMA, if it needs to be segmented, the corresponding segmented cyclic export strategy is determined according to the data amount.
[0076] Step S13, using the segmented cyclic export strategy, the log to be exported, the cache allocation result, and the local preset direct memory access engine, the log export operation is completed to obtain the instruction completion information corresponding to the log export instruction.
[0077] In this embodiment, after determining the logs to be exported this time and the related export strategy, the log export is performed in combination with the local preset direct memory access engine, and after the export is completed, the instruction completion information is determined, that is, the segmented cyclic export strategy is used to process the logs to be exported to determine a plurality of log segment sets to be exported; wherein the log segment set includes a plurality of target log segments; based on the local preset direct memory access engine and the cache allocation result, the target address is determined; based on the preset direct memory access engine and the target address, the segmented export of each log segment set is performed in different cyclic rounds respectively, and the preset metadata is added in the head of the target log segment to complete the log export operation and obtain the log export result; the preset metadata is any one or a combination of a plurality of sequence numbers, timestamps and log types; based on the log export result, the instruction completion information corresponding to the log export instruction is determined; and the instruction completion information is sent to the baseboard management controller management component in the host. The solid state disk device writes the exported log data to the specified target address according to the local DMA management component. The baseboard management controller management component is located on the host side and is mainly responsible for the interaction of the out-of-band management command with the solid state disk device to complete the device management function of the BMC platform.
[0078] It can be understood that in the process of segmented cyclic export of logs, metadata such as sequence number, timestamp, log type, etc. can be added in the head of each log segment, so that the host can reorganize and verify according to the metadata.
[0079] Further, in the process of segmented cyclic export of logs in this embodiment, the solid state disk device can also monitor the state of each log segment DMA writing to the target address, and if the writing fails, it will automatically trigger a retry and count, that is, the solid state disk device monitors the log segment export state corresponding to each cyclic round to determine the monitoring result; based on the monitoring result, it is judged whether a log segment export failure event has occurred, to determine the event judgment result; if the time judgment result is yes, the export retry operation corresponding to the corresponding log segment set is triggered, and the current log segment export failure event number and retry number are recorded. The retry number can be pre-set to a corresponding threshold, if the retry number exceeds the threshold, it will not be retried to avoid wasting resources, and related alarm measures are triggered to allow relevant personnel to check and correct in time according to the alarm.
[0080] Step S14, feedback the instruction completion information to the host, so that the host reads the logs from the local memory based on the received instruction completion information, and triggers the log processing operation according to the corresponding log reading result.
[0081] In this embodiment, the obtained instruction completion information is sent to the host, so that after the host receives the information, the log is read and other processing operations are triggered, that is, the substrate management controller management component in the host receives the instruction completion information corresponding to the log export instruction; based on the preset data verification rule and the instruction completion information, the log data is verified to determine the verification result; if the verification result indicates that the verification fails, the corresponding log segment retransmission request operation is triggered based on the verification result; if the verification result indicates that the verification is successful, the local memory of the host is read based on the log export result to determine the log reading result, and the corresponding cache release operation is triggered; the data in the log reading result is transmitted to the path specified by the substrate management controller management component in the form of a log file to trigger a log processing operation.
[0082] It can be understood that in this embodiment, after the host receives the instruction completion information, the integrity and accuracy of the transmitted log can be verified, and if the verification fails, the device is requested to retransmit the missing or erroneous log segment, so as to improve the reliability of the log export.
[0083] Further, in this embodiment, after the host issues the log export instruction to the solid state disk device, based on the preset timeout mechanism, it is determined whether the instruction completion information corresponding to the log export instruction is received within a preset time period to determine a timeout determination result; if the timeout determination result is no, an alarm operation is triggered, and the host reissues the log export instruction to the solid state disk device. It can be understood that in this embodiment, a command timeout mechanism can also be set: if the host does not receive the completion information corresponding to the instruction within a predetermined time after issuing the log export instruction, it is considered as timeout, and the host will resend the instruction and / or trigger an alarm.
[0084] As can be seen from the above, the scheme of this embodiment uses the host memory address as the target address of the log export in the out-of-band scenario, which solves the problem of low data file transmission rate and long transmission time based on the SMBus bus in the traditional BMC channel, and improves the reliability and efficiency of the log export.
[0085] It can be seen that, in the power-on initialization process, the host memory demand information is reported to the corresponding host, so that the host performs cache allocation based on the received host memory demand information, and feeds back the cache allocation result to the solid state disk device, and then when the local out-of-band command processing component receives the log export instruction sent by the host, the log export instruction and the local flash memory log data reading are used to determine the to-be-exported log and the segmented cyclic export strategy. Then, through the local preset direct memory access engine, and using the segmented cyclic export strategy, the to-be-exported log, and the cache allocation result, the log export operation is completed, the log export result is obtained, and then the instruction completion information is fed back to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers the log processing operation. In this way, the problems existing in the prior related scheme can be effectively solved, so that the log export of the SSD device is efficiently, stably and reliably realized, and the work efficiency of the operation and maintenance personnel is improved.
[0086] The technical solutions of the embodiments of the present application will be described in detail below in combination with the timing diagram disclosed in the present application. Figure 3
[0087] In the present embodiment, system initialization is first performed, and during the initialization, the SSD device reports the required host memory address capability and the information of the required space size to the Host (host). Then, the Host queries the support capability of the SSD device for the host memory cache function, and if it is determined that the device is supported, the cache is applied according to the information reported by the SSD device, and the base address and size information of the applied cache are notified to the SSD device. After receiving the cache address A and length information L issued by the Host, the SSD device will record them as the target address and size for subsequent log data export.
[0088] Further, the present embodiment also includes a corresponding log generation process, in which the solid state disk device is run, and the log information generated during the running process is cached to the buffer area (Buffer) inside the device, and then the solid state disk device flushes the log of the buffer area to the flash memory (NAND flash).
[0089] Afterwards, in the log export process, the Host sends a log export command to the SSD device through the BMC management component. After receiving the log export command, the SSD device parses the data length of the log to be exported, reads the log from the persistent storage medium, i.e., the NAND flash, to the local cache, and writes the log data in the local cache. Furthermore, the export strategy is formulated, and the SSD device can select the cyclic multiple times and segmented export mode, fixedly export a specified size L1 of log data at a time, and write the exported log data to the addresses A, A+L1, A+L2, … in multiple steps through the DMA engine.
[0090] After the SSD device completes writing all the log data to be exported to the target address (i.e., the host memory address), the completion information of the log export command received in the foregoing step is returned to the BMC management component of the Host. Afterwards, the Host receives the completion information through the component, reads all the log information from the host memory address according to the completion information, and outputs the log information in the form of a log file to a specified path of the BMC platform for the operation and maintenance personnel to obtain and use.
[0091] In this way, the rate of transmitting the log file using this mode can reach the order of GB / S, which is several orders of magnitude higher than the rate of 100 Kbps based on the traditional SMBus bus, and the acquisition of the log file in the out-of-band channel within one second is realized, greatly improving the work efficiency of the operation and maintenance personnel.
[0092] Referring to Figure 4 The embodiment of the application also discloses a log management device applied to a solid state disk device, which comprises:
[0093] The cache allocation module 11 is configured to report host memory demand information to the corresponding host in the power-on initialization process, so that the host performs cache allocation based on the received host memory demand information, and feeds back the corresponding cache allocation result to the solid state disk device.
[0094] The export strategy determination module 12 is configured to, when receiving the log export instruction sent by the host through the local out-of-band command processing component, perform log data reading based on the log export instruction and the local flash memory, so as to determine the log to be exported and the segmented cyclic export strategy.
[0095] The log export module 13 is configured to complete the log export operation by using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine, so as to obtain the instruction completion information corresponding to the log export instruction.
[0096] The log reading module 14 is configured to feed back instruction completion information to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation according to a corresponding log reading result.
[0097] It can be seen that, in the power-on initialization process, the host memory requirement information is reported to the corresponding host, so that the host performs cache allocation based on the received host memory requirement information, and feeds back the cache allocation result to the solid state disk device, and then when the local out-of-band command processing component receives the log export instruction sent by the host, the log data reading is read based on the log export instruction and the local flash memory, to determine the to-be-exported log and the segmented cyclic export strategy. Then, the log export operation is completed by the local preset direct memory access engine, and the segmented cyclic export strategy, the to-be-exported log and the cache allocation result are used to obtain the log export result, and then the instruction completion information is fed back to the host, so that the host performs log reading on the local memory of the host based on the received instruction completion information, and triggers a log processing operation. In this way, the problems existing in the prior related solutions can be effectively solved, so that the log export of the SSD device is efficiently, stably and reliably realized, and the work efficiency of the operation and maintenance personnel is improved.
[0098] Since the embodiments of the device part correspond to the above-mentioned embodiments, the embodiments of the device part are described with reference to the embodiments of the method part described above, and will not be described here.
[0099] Further, the embodiment of the present application also discloses an electronic device, Figure 5 is an electronic device structure diagram shown according to an exemplary embodiment, the content in the figure cannot be considered as any limitation on the use range of the present application. The electronic device can specifically include: at least one processor 21, at least one memory 22, power supply 23, communication interface 24, input output interface 25 and communication bus 26. Wherein, the memory 22 is used for storing computer programs, the computer programs are loaded and executed by the processor 21, to realize the related steps in the log management method disclosed in any of the preceding embodiments. In addition, the electronic device in the present embodiment can be an electronic computer.
[0100] In the present embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and the external device, and the communication protocol followed by the communication interface 24 is any communication protocol applicable to the technical solution of the present application, which is not limited specifically here; the input output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically here.
[0101] In addition, the memory 22 can be a read-only memory, a random access memory, a magnetic disk, an optical disk or the like as a carrier for storing resources, and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.
[0102] The operating system 221 is used to manage and control each hardware device on the electronic device and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the log management method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.
[0103] Further, the present application also discloses a computer readable storage medium for storing a computer program, wherein the computer program is executed by a processor to implement the log management method disclosed above. For the specific steps of the method, refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0104] Further, the present application also discloses a computer program product comprising computer programs / instructions, wherein the computer programs / instructions are executed by a processor to implement the log management method disclosed above. For the specific steps of the method, refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
[0105] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0106] The skilled person can further realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware, computer software or a combination of the two. In order to clearly show the interchangeability of hardware and software, the composition and steps of each example have been described in the above description. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0107] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The
[0108] Finally, it should be noted that the terms "first" and "second", and the like, are used herein only to distinguish one entity or action from another, and do not necessarily require or imply any actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by an "comprising" statement is not excluded from a process, method, article, or apparatus that includes the element, even if the same process, method, article, or apparatus also includes other identical elements.
[0109] The above detailed description of the technical solutions provided by the present application has been described in detail, and the principles and implementation modes of the present application have been described by applying specific examples. The above description of the embodiments is only applicable to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed, and the above description of the content of the specification should not be understood as a limitation of the present application.
Claims
1. A log management method characterized by comprising: The application is applied to a solid state disk device, comprising: In the power-on initialization process, the host memory requirement information is reported to the corresponding host, so that the cache allocation is performed through the host and based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device; When the log export instruction sent by the host is received through the local out-of-band command processing component, log data reading is performed based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy; The log export operation is completed using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine to obtain the instruction completion information corresponding to the log export instruction; The instruction completion information is fed back to the host, so that the local memory of the host is used for log reading based on the received instruction completion information, and a log processing operation is triggered according to the corresponding log reading result.
2. The log management method according to claim 1, characterized by, The cache allocation is performed through the host and based on the received host memory requirement information, and the corresponding cache allocation result is fed back to the solid state disk device, comprising: The identity of the solid state disk device is verified through the host to determine the identity verification result; When the identity verification result indicates that the verification is passed, the host memory requirement information reported by the solid state disk device is received; wherein the host memory requirement information includes the required memory space size information and the host memory cache function; The support capability of the solid state disk device for the host memory cache function is analyzed to determine the function analysis result; Based on the function analysis result, it is judged whether the cache request condition is met at present to determine the request condition judgment result; If the request condition judgment result indicates that it is met, cache allocation is performed in the target memory area based on the memory space size information and the host memory cache function to determine the cache allocation result; wherein the cache allocation result includes the cache base address and the cache size information; The cache allocation result is fed back to the solid state disk device.
3. The log management method according to claim 2, characterized by, When the log export instruction sent by the host is received through the local out-of-band command processing component, log data reading is performed based on the log export instruction and the local flash memory to determine the log to be exported and the segmented cyclic export strategy, comprising: The log export instruction sent by the host is received through the local out-of-band command processing component of the solid state disk; The target log data length to be exported is determined by analyzing the log export instruction based on the out-of-band command processing component; Log data reading is performed based on the out-of-band command processing component, the target log data length and the local flash memory to determine the log to be exported; It is judged whether there is log data of a preset sensitive type in the log to be exported to determine the data judgment result; If the data judgment result indicates that there is no, it is judged whether the data amount corresponding to the log to be exported is greater than the cache size information to determine the data amount judgment result; If the data amount judgment result is yes, new host memory requirement information is sent to the host through the solid state disk device and the data amount corresponding to the log to be exported, so as to obtain a new cache allocation result; If the data amount judgment result is no, whether a preset segment cycle export condition is met is judged based on the data amount corresponding to the log to be exported, so as to determine an export condition judgment result; When the export condition judgment result indicates that the condition is met, a segment cycle export strategy corresponding to the log to be exported is determined; wherein the segment cycle export strategy includes log segment size information exported each time.
4. The log management method according to claim 2, characterized by, The log export operation is completed by using the segment cycle export strategy, the log to be exported, the cache allocation result and a preset direct memory access engine locally, including: The log to be exported is processed by using the segment cycle export strategy, so as to determine a plurality of log segment sets to be exported; wherein the log segment set includes a plurality of target log segments. A target address is determined based on the preset direct memory access engine and the cache allocation result. Each of the log segment sets is subjected to segment export of different cycle rounds respectively based on the preset direct memory access engine and the target address, and preset metadata is added to the head of the target log segment, so as to complete the log export operation and obtain a log export result; the preset metadata is a combination of any one or more of a serial number, a timestamp and a log type. Based on the log export result, instruction completion information corresponding to the log export instruction is determined. The instruction completion information is sent to a baseboard management controller management component in the host.
5. The log management method according to claim 4, characterized by, Further comprising: The log segment export state corresponding to each cycle round is monitored by the solid state disk device, so as to determine a monitoring result; Based on the monitoring result, whether a log segment export failure event has occurred is judged, so as to determine an event judgment result; If the time judgment result is yes, an export retry operation corresponding to the corresponding log segment set is triggered, and the number of current log segment export failure events and the number of retries are recorded.
6. The log management method according to claim 4, characterized by, The local memory of the host is subjected to log reading based on the received instruction completion information, and log processing operation is triggered according to the corresponding log reading result, including: The instruction completion information corresponding to the log export instruction is received by the baseboard management controller management component in the host; Based on a preset data verification rule and the instruction completion information, log data verification is performed to determine a verification result; If the verification result indicates that the verification fails, a corresponding log segment retransmission request operation is triggered based on the verification result; If the verification result indicates that the verification is successful, the local memory of the host is subjected to log reading based on the log export result, so as to determine a log reading result and trigger a corresponding cache release operation; In the form of a log file, the data in the log reading result is transmitted to the path specified by the baseboard management controller management component to trigger a log processing operation.
7. The log management method according to any one of claims 1 to 6, characterized by, Also includes: After the host issues the log export instruction to the solid state disk device, based on a preset timeout mechanism, it is judged whether the instruction completion information corresponding to the log export instruction is received within a preset time period to determine a timeout judgment result; If the timeout judgment result is no, an alarm operation is triggered, and the host reissues the log export instruction to the solid state disk device.
8. A log management apparatus characterized by comprising: Applied to a solid state disk device, comprising: A cache allocation module for reporting host memory requirement information to the corresponding host in the power-on initialization process, so that the host performs cache allocation based on the received host memory requirement information, and feeds back the corresponding cache allocation result to the solid state disk device; An export strategy determination module for performing log data reading based on the log export instruction and the local flash memory when the local out-of-band command processing component receives the log export instruction sent by the host to determine the log to be exported and the segmented cyclic export strategy; A log export module for completing log export operation using the segmented cyclic export strategy, the log to be exported, the cache allocation result and the local preset direct memory access engine to obtain the instruction completion information corresponding to the log export instruction; A log reading module for feeding back the instruction completion information to the host so that the host performs log reading on the local memory based on the received instruction completion information, and triggers a log processing operation according to the corresponding log reading result.
9. An electronic device, comprising: Including: Memory for storing computer programs; The processor is configured to execute the computer program to implement the steps of the log management method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the steps of the log management method according to any one of claims 1 to 7.
