# US 12,111,742 B2 · Method for log recording, electronic device and non-transitory computer-readable storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 12,111,742 B2
- Document ID: US12111742B2
- Status: Granted
- Kind: B2
- Application number: 18/692,281
- Filed: 2022-09-29
- Published: 2024-08-08
- Granted: 2024-10-08
- Earliest claimed: 2021-10-26
- Assignees: Suzhou Metabrain Intelligent Technology Co., Ltd.
- Applicants: Suzhou Metabrain Intelligent Technology Co., Ltd.
- Inventors: Guohua Liu
- Web page: https://patentgrep.com/patent/US12111742B2

## CPC

- G06F 11/3034: {where the computing system component is a storage system, e.g. DASD based or network based (digital input from or digital output to record carriers G06F3/06; digital recording or reproducing G11B20/18; for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS], H04L67/1097)}
- G06F 1/30: Means for acting in the event of power-supply failure or interruption, e.g. power-supply fluctuations (for resetting only G06F1/24)
- G06F 11/1441: {Resetting or repowering}
- G06F 11/2015: {Redundant power supplies (power supply failure G06F1/30)}
- G06F 11/3065: {Monitoring arrangements determined by the means or processing involved in reporting the monitored data (error or fault reporting or logging G06F11/0766)}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

A method and an apparatus for log recording, and an electronic device are provided. The method is applied to a storage device, wherein a storage space of the storage device is configured to be at least two storage areas, and the at least two storage areas includes at least one first storage area for storing data by using a serial writing mode and at least one second storage area for storing the data by using a parallel writing mode, the method includes: monitoring an operating state of a system of the storage device; when the operating state of the system of the storage device is normal, storing generated log data in the first storage area.

## Claims

### Claim 1

A method for log recording applied to a storage device, wherein, a storage space of the storage device has at least two storage areas, and the at least two storage areas comprises at least one first storage area for storing data by using a serial writing mode and at least one second storage area for storing the data by using a parallel writing mode, the method comprises:
monitoring an operating state of a system of the storage device;
in response to the operating state of the system of the storage device being normal, storing generated log data in the first storage area; and
in response to the system of the storage device being abnormally powered off, switching an emergency power supply to supply power for the storage device and controlling a log data storage operation of the second storage area in response to abnormal power-off;
wherein in response to the system of the storage device being abnormally powered off, switching the emergency power supply to supply power for the storage device and controlling the log data storage operation of the second storage area in response to the abnormal power-off comprises:
in response to the system of the storage device being abnormally powered off, switching the emergency power supply to supply power for the storage device and responding to a timing operation; and
in response to a power-off process of the system being not completed within a target duration, storing the generated log data in the second storage area.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the target duration is determined according to a duration consumed by an abnormal power-off process of the system and an available duration of the emergency power supply.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the method further comprises:
in response to the system of the storage device being powered on again, determining a processing result for previous power-off of the system of the storage device; and
in response to the processing result for the previous power-off of the system of the storage device being abnormal, obtaining log data from the second storage area for performing abnormal power-off analysis.

### Claim 4 (depends on 3)

The method according to claim 3, wherein the method further comprises:
in response to the processing result for the previous power-off of the system of the storage device being normal, performing no processing.

### Claim 5 (depends on 3)

The method according to claim 3, wherein the step of determining the processing result for previous power-off of the system of the storage device comprises:
obtaining a programmed data saving result;
obtaining mark data of the processing result for the previous power-off of the system of the storage device from the programmed data saving result; and
determining the processing result for the previous power-off of the system of the storage device according to a type of the mark data.

### Claim 6 (depends on 5)

The method according to claim 5, wherein the step of determining the processing result for the previous power-off of the system of the storage device according to the type of the mark data comprises:
comparing the obtained mark data with data in a target database, wherein a correlation between the mark data and the processing result is pre-stored in the target database; and
determining the processing result for the previous power-off of the system of the storage device according to a comparison result.

### Claim 7 (depends on 1)

The method according to claim 1, wherein the step of in response to the operating state of the system of the storage device being normal, storing the generated log data in the first storage area comprises:
storing the generated log data in a first caching area that is pre-configured; and
in response to a preset caching condition being met, downloading log data in the first caching area to a flash memory in the first storage area.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the preset caching condition is that the first caching area is full or a caching duration reaches a preset duration.

### Claim 9 (depends on 7)

The method according to claim 7, wherein the step of storing the generated log data in the first caching area that is pre-configured comprises:
configuring a double data rate (DDR) storage area in the storage device, wherein the DDR storage area is configured for caching the log data generated by the system.

### Claim 10 (depends on 1)

The method according to claim 1, wherein the step of storing the generated log data in the second storage area comprises:
storing the generated log data in a second caching area that is pre-configured; and
in response to a preset caching condition being met, downloading log data in the second caching area to a flash memory in the second storage area.

### Claim 11 (depends on 10)

The method according to claim 10, wherein the log data comprises all information data that is needed in a process of problem location.

### Claim 12 (depends on 11)

The method according to claim 11, wherein the information data comprises global variable information and/or stack data of the system.

### Claim 13 (depends on 12)

The method according to claim 12, wherein the information data is stored in the second storage area by a predefined data structure.

### Claim 14 (depends on 1)

The method according to claim 1, wherein the emergency power supply is a temporary power supply device.

### Claim 15 (depends on 14)

The method according to claim 14, wherein the emergency power supply is a capacitor.

### Claim 16 (depends on 1)

An electronic device, comprising a memory and one or more processors, wherein a computer-readable instruction is stored in the memory, and the computer-readable instruction, in response to being executed by the one or more processors, causes the one or more processors to implement the steps of the method for log recording according to claim 1.

### Claim 17 (depends on 1)

One or more non-transitory computer-readable storage mediums storing a computer-readable instruction, wherein the computer-readable instruction, in response to being executed by one or more processors, causes the one or more processors to implement the steps of the method for log recording according to claim 1.

### Claim 18 (depends on 1)

The method according to claim 1, wherein the first storage area and the second storage area share a DDR storage area.
