CN111782474A - Log processing method and device, electronic equipment and medium - Google Patents

Log processing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN111782474A
CN111782474A CN202010612520.3A CN202010612520A CN111782474A CN 111782474 A CN111782474 A CN 111782474A CN 202010612520 A CN202010612520 A CN 202010612520A CN 111782474 A CN111782474 A CN 111782474A
Authority
CN
China
Prior art keywords
log
memory
kernel
content
driver
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010612520.3A
Other languages
Chinese (zh)
Inventor
刘兆龙
史继前
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202010612520.3A priority Critical patent/CN111782474A/en
Publication of CN111782474A publication Critical patent/CN111782474A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/1734Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a log processing method and device, electronic equipment and a medium. The log processing method in the application comprises the following steps: initializing a memory according to preset memory information at a stage before starting a kernel; storing the acquired log content into the memory through a log output interface; after the kernel is started, loading a log driver; based on the log drive, the log content is acquired to the kernel log file according to the preset memory mapping, and the log is not required to be acquired through a serial port for analysis, so that the specific log content can be directly and completely collected.

Description

Log processing method and device, electronic equipment and medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a log processing method and apparatus, an electronic device, and a medium.
Background
For electronic devices, information about hardware, software and system problems in the system can be recorded through logs, and events occurring in the system can be monitored. Through which the user can check the cause of the error or look for traces left by the attacker when under attack.
In the development and use process of a high-pass platform and android system based product, logs are generally collected and processed through a serial port. Due to external factors, serial ports cannot be welded in the later period or after the product is produced, so that the log is very inconvenient to obtain and analyze the log problems, and a lot of logs cannot be obtained.
Disclosure of Invention
The application provides a log processing method and device, electronic equipment and a medium.
In a first aspect, a log processing method is provided, including:
initializing a memory according to preset memory information at a stage before starting a kernel;
storing the acquired log content into the memory through a log output interface;
after the kernel is started, loading a log driver;
and based on the log drive, obtaining the log content to a kernel log file according to a preset memory mapping.
In an optional implementation manner, the initializing the memory according to preset memory information at a stage before the kernel is started includes:
initializing a first memory according to preset first memory information at a system starting and booting stage;
the storing the acquired log content into the memory through the log storage interface includes:
and storing the acquired first log content into the first memory through a first log output interface, and updating a memory control data structure.
In an optional implementation manner, the initializing the memory according to preset memory information at a stage before the kernel is started further includes:
reading the memory control data structure at the initialization stage of the micro kernel to obtain a second memory address of a second log;
the storing the acquired log content into the memory through the log storage interface includes:
and storing second log contents into the second memory address through a second log output interface, and updating the memory control data structure.
In an optional implementation manner, before initializing the memory according to the preset memory information, the method further includes:
configuring nodes and file editing interfaces provided by the log driver according to the driving editing instruction;
the obtaining of the log content into the kernel log file according to the preset memory mapping based on the log driver includes:
acquiring the log content through the nodes provided by the log driver;
and processing the log content based on the file editing interface of the log driver, and storing the log content into the kernel log file through the node provided by the log driver.
In an optional implementation manner, after obtaining, based on the log driver, log content according to a preset memory map and storing the log content in a kernel log file, the method further includes:
and accessing the nodes provided by the log driver through a user space access interface, and reading the log content to the user space.
In an optional embodiment, after reading the log content to the user space, the method further includes:
calling a log collection system to collect the log content;
and analyzing the equipment fault according to the log content.
In an optional implementation manner, the memory is a free memory reserved according to the memory configuration information before the memory is initialized according to the preset memory information.
In a second aspect, a log processing apparatus is provided, including:
the memory configuration module is used for initializing a memory according to preset memory information at the stage before the kernel is started;
the log storage module is used for storing the acquired log content into the memory through a log output interface;
the processing module is used for loading the log driver after the kernel is started;
and the acquisition module is used for acquiring the log content into the kernel log file according to the preset memory mapping based on the log driver.
In a third aspect, an electronic device is provided, comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps as in the first aspect and any one of its possible implementations.
In a fourth aspect, there is provided a computer storage medium storing one or more instructions adapted to be loaded by a processor and to perform the steps of the first aspect and any possible implementation thereof.
Initializing a memory according to preset memory information at the stage before a kernel is started, storing acquired log contents into the memory through a log output interface, loading a log driver after the kernel is started, and acquiring the log contents into a kernel log file according to preset memory mapping based on the log driver; by recording the log to a specific memory and reserving the memory mapping to the kernel, the log content can be obtained through the user space access interface for analysis and processing, and the log does not need to be collected through a serial port for analysis, so that the inconvenience caused by welding the serial port is eliminated, the log content can be directly obtained, and the corresponding problem analysis efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments or the background art of the present application, the drawings required to be used in the embodiments or the background art of the present application will be described below.
Fig. 1 is a schematic flowchart of a log processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another log processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a log processing apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, 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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The kernel involved in the embodiments of the present application is the most basic part of the operating system, which is a piece of software that provides secure access to the hardware of the electronic device, such as a computer, for a number of applications. This access is limited and the kernel decides when a program operates on some portion of the hardware for how long. The classification of kernels can be divided into single and dual kernels as well as microkernels. Strictly speaking, a kernel is not an essential component of a computer system. Direct hardware operations are very complex, so the kernel usually provides a hardware abstraction to do these operations. The hardware abstraction hides the complexity, provides a set of simple and uniform interfaces for application software and hardware, and makes the program design simpler. The cores may be named using modules generally according to the functions implemented by the cores, such as: camera drive module, ethernet drive module, serial ports drive module etc.. The camera driving module provides service for the camera, and adds a small block of codes in an operating system, wherein the small block of codes contains information related to the camera. With the information of the camera, the computer and other electronic equipment can communicate with the camera.
Where log information (log), typically a record of some processing done by the system or some software, is used for future reference. log has no fixed format, usually a text file, and can be opened with a notepad to view the content, although other formats are likely. Most logs can be seen in their role as filenames, such as uninstantall log (uninstall) which is usually a record generated during the installation of software and is provided to uninstallers for future uninstall, or error log (error) which is usually used to record some error information during the operation of software. For a kernel module of an operating system, its log information may include not only various information of the kernel module during running, but also configuration information of the kernel module at loading and various information of the kernel module at initialization.
The embodiments of the present application will be described below with reference to the drawings.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a log processing method according to an embodiment of the present disclosure. The method can comprise the following steps:
101. and initializing the memory according to preset memory information at the stage before the kernel is started.
The execution subject of the embodiments of the present application may be a log processing apparatus, and may be an electronic device, and in a specific implementation, the electronic device is a terminal, which may also be referred to as a terminal device, including but not limited to other portable devices such as a mobile phone, a laptop computer, or a tablet computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad), and may also be a wearable device such as a smart watch. It should also be understood that in some embodiments, the devices described above are not portable communication devices, but rather are desktop computers having touch-sensitive surfaces (e.g., touch screen displays and/or touch pads). In an optional implementation manner, the log processing method in the embodiment of the present application is applicable to a device using an Android operating system on a high-pass platform, and can be run through a corresponding software program.
In the starting process of the Anroid system, the method is generally divided into 3 stages:
1. the stage before Kernel start may include a System Boot Loader (SBL) and a tiny Kernel (LK);
2. a kernel boot phase (linux kernel);
3. and an Android starting stage.
In an embodiment, the memory is a free memory reserved according to the memory configuration information before the memory is initialized according to the preset memory information.
The memory for storing the specific log may be configured in advance through the memory configuration information, and may include information such as a memory address and a memory space size. The method includes that configuration is carried out through a dtsi (device tree sourceinclude) file at a kernel side, and a specified memory is reserved firstly, for example, an available memory address is confirmed in advance, and a 1MB memory space is reserved. The kernel can be prevented from being divided into Random Access Memories (RAMs) available to the system after the kernel is started.
The memory configuration information may be configuration information in dts (device tree source). On a high-pass platform and an Android system, a memory can be used once when an SBL exists, an uboot stage can be used once, after a kernel is started, the memory can be searched, and it is determined which part of the memory needs to be reserved (reserved according to configuration information in dts), and the rest part of the memory can be used as a system random access memory. The SBL reserved log memory may be copied during the uboot phase.
The preset memory information may include different memory information corresponding to different log types, so as to configure a specific memory for storing different types of logs.
After the device is started and before the kernel is started, the SBL and the LK may be initialized, and the memory corresponding to the SBL log and the memory corresponding to the LK log may be respectively initialized according to the preset memory information.
In the initialization of the kernel starting stage, the specified memory can be initialized according to the corresponding memory information, and the memory control data structure body is written into the first address of the memory address, so that the information such as the storage position, the length and the like of different types of logs can be represented.
102. And storing the acquired log content into the memory through a log output interface.
The SBL log output interface and the LK log output interface may be configured, so that after the initialization of the memory, the obtained SBL log content and the obtained LK log memory may be stored in the corresponding memories through the corresponding interfaces, respectively.
103. After the kernel starts, the log driver is loaded.
In the kernel starting stage, a configured log driver (bootlog driver) can be loaded, the log driver can provide a node and a file editing interface, the memory can be accessed through the provided path node, and the operation on the log content in the memory can be realized through the file editing interface.
104. And based on the log drive, obtaining the log content to a kernel log file according to a preset memory mapping.
And performing memory mapping (remap) on the log content through bootlog driving, acquiring SBL and LK log contents through reading nodes provided by the bootlog according to the preset memory mapping, and storing the SBL and LK logs into a kernel log file.
Before initializing the memory according to the preset memory information, the method further includes:
configuring nodes and file editing interfaces provided by the log driver according to the driving editing instruction;
the obtaining of the log content into the kernel log file according to the preset memory mapping based on the log driver includes:
acquiring the log content through the nodes provided by the log driver;
and processing the log content based on the file editing interface of the log driver, and storing the log content into the kernel log file through the node provided by the log driver.
In the embodiment of the application, the log driver can be configured in advance, bootlog driver writing is performed through a driver editing instruction in the previous period, a file editing (file editing) interface is provided, for example, the file editing interface can comprise an open interface and a read interface, and a node, such as a dev/bootlog node, is created at the same time, so that corresponding log data processing can be performed in the open interface and the read interface. And SBL, LK logs may be stored in the kernel log file. The bootlog driver described above may be registered as a standard linux driver (registered as a misc device).
Optionally, after the step 104, the method further includes:
and accessing the nodes provided by the log driver through a user space access interface, and reading the log content to the user space.
Specifically, the log driver may further provide a user space access interface, and when a process accesses the log, the log is transmitted to a user space (userpace) through a copy _ to _ user instruction.
Further optionally, after reading the log content to the user space, the method further includes:
calling a log collection system to collect the log content;
and analyzing the equipment fault according to the log content.
The device can be provided with a log collection system, and in the starting state of the device, before the log collection system collects the log API, the nodes provided by the log driver can be accessed, and the memory content can be read out (SBL and LK log content) in a read mode, so that the log content can be analyzed and processed.
Through providing user space access node and interface, make things convenient for the engineer can read SBL, LK log content fast, especially to the relevant problem of after-sale SBL, LK, can read appointed memory address content through reading kernel or snatching ramdump, be particularly useful for the scene of equipment crash, also can acquire log information smoothly to judge concrete problem detail fast, improved problem analysis efficiency.
In the development and use process of a high-pass platform and android system based product, logs are generally collected and processed through a serial port. Due to external factors, serial ports cannot be welded in the later period or after the product is produced, so that the log is very inconvenient to obtain and analyze the log problems, and a lot of logs cannot be obtained.
In the embodiment of the application, a memory is initialized according to preset memory information in a stage before a kernel is started, the obtained log content is stored in the memory through a log output interface, a log driver is loaded after the kernel is started, and the log content is obtained to a kernel log file according to preset memory mapping based on the log driver; by recording the log to a specific memory and reserving the memory mapping to the kernel, the log content can be obtained through the user space access interface for analysis and processing, and the log does not need to be collected through a serial port for analysis, so that the inconvenience caused by welding the serial port is eliminated, the log content can be directly obtained, and the corresponding problem analysis efficiency is improved.
Referring to fig. 2, fig. 2 is a schematic flowchart illustrating another log processing method according to an embodiment of the present disclosure. As shown in fig. 2, the method may specifically include:
201. and initializing the first memory according to preset first memory information at the system starting and booting stage.
The execution subject of the embodiments of the present application may be a log processing apparatus, and may be an electronic device, and in a specific implementation, the electronic device is a terminal, which may also be referred to as a terminal device, including but not limited to other portable devices such as a mobile phone, a laptop computer, or a tablet computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad), and may also be a wearable device such as a smart watch. It should also be understood that in some embodiments, the devices described above are not portable communication devices, but rather are desktop computers having touch-sensitive surfaces (e.g., touch screen displays and/or touch pads). In an optional implementation manner, the log processing method in the embodiment of the present application is applicable to a device using an android operating system on a high-pass platform, and can be run through a corresponding software program.
The first memory may be a memory for storing SBL log data, and is reserved in dtsi of the kernel side. In the system boot stage, a boot loader (SBL) is initialized, and may initialize a designated memory according to corresponding first memory information, and write a memory control data structure to a memory address first address for indicating information such as storage location and length of an SBL log and an SL log.
Step 201 and step 203 in the embodiment of the present application may also refer to specific contents in step 101 in the embodiment shown in fig. 1, and are not described herein again.
202. And storing the acquired first log content into the first memory through a first log output interface, and updating a memory control data structure.
The first log content is SBL log content. Specifically, the first log output interface is an interface for outputting the first log content to the first memory, that is, a preset SBL log output function interface, and outputs the SBL log content to a specified memory through the interface, and updates the memory control data structure.
203. And reading the memory control data structure at the initialization stage of the micro kernel to obtain a second memory address of a second log.
In the initialization stage of the micro kernel, the second log is an LK log. The LK initialization, reading the memory control data structure can obtain the memory address (the second memory address) for storing the LK log, and step 204 can be executed.
204. And storing the second log content into the second memory address through a second log output interface, and updating the memory control data structure.
Specifically, the second log output interface is an interface for outputting the second log content to the second memory, that is, a preset KL log output function interface, and outputs the SK log content to the specified memory through the interface, and updates the memory control data structure.
205. After the kernel starts, the log driver is loaded.
206. And based on the log driving, obtaining log contents into a kernel log file according to a preset memory mapping, wherein the log contents comprise the first log contents and the second log contents.
Step 205 and step 206 may refer to specific steps in step 103 and step 104 in the embodiment shown in fig. 1, respectively, and are not described herein again.
Specifically, in the SBL and LK stages, after the logs are output to the designated memory according to a certain format, the logs can be remapped in the kernel and then driven by the bootlog to provide a corresponding operation interface for the user space, so that the log system can keep the SBL and LK logs to the designated files when reading corresponding file nodes. The inconvenience caused by welding serial ports is eliminated, namely, the log file can be directly read, the contents of the SBL log and the LK log can be obtained, the subsequent log analysis and processing are facilitated, and the corresponding problem analysis efficiency is improved.
In the embodiment of the application, a first memory is initialized according to preset first memory information at a system start-up booting stage, acquired first log content is stored in the first memory through a first log output interface, a memory control data structure is updated, the memory control data structure is read at a micro kernel initialization stage to obtain a second memory address of a second log, the second log content is stored in the second memory address through a second log output interface, the memory control data structure is updated, then, after a kernel is started, a log driver can be loaded to acquire the log content into a kernel log file according to a preset memory mapping, the log content comprises the first log content and the second log content, SBL and LK are recorded into a specific memory, and the memory is mapped into the kernel log file, the log content can be obtained through the user space access interface for analysis processing, and the log does not need to be collected through a serial port for analysis, so that inconvenience caused by welding of the serial port is eliminated, the log content can be directly obtained, and the corresponding problem analysis efficiency is improved.
Based on the description of the log processing method embodiment, the embodiment of the application also discloses a log processing device. Referring to fig. 3, the log processing apparatus 300 includes:
the memory configuration module 310 is configured to initialize a memory according to preset memory information at a stage before the kernel is started;
a log storage module 320, configured to store the obtained log content in the memory through a log output interface;
the processing module 330 is configured to load the log driver after the kernel is started;
the obtaining module 340 is configured to obtain, based on the log driver, log content into a kernel log file according to a preset memory map.
Optionally, the memory configuration module 310 is specifically configured to:
initializing a first memory according to preset first memory information at a system starting and booting stage;
the log storage module 320 is specifically configured to store the acquired first log content in the first memory through a first log output interface, and update a memory control data structure.
Optionally, the memory configuration module 310 is further specifically configured to:
reading the memory control data structure at the initialization stage of the micro kernel to obtain a second memory address of a second log;
the log storage module 320 is further specifically configured to store a second log content in the second memory address through a second log output interface, and update the memory control data structure.
Optionally, the memory configuration module 310 is further configured to:
configuring nodes and file editing interfaces provided by the log driver according to the driving editing instruction;
the obtaining module 340 is specifically configured to:
acquiring the log content through the nodes provided by the log driver;
and processing the log content based on the file editing interface of the log driver, and storing the log content into the kernel log file through the node provided by the log driver.
Optionally, the obtaining module 340 is further configured to:
and accessing the nodes provided by the log driver through a user space access interface, and reading the log content to the user space.
Optionally, the processing module 330 is further configured to:
calling a log collection system to collect the log content;
and analyzing the equipment fault according to the log content.
Optionally, the memory is an idle memory reserved according to the memory configuration information before the memory is initialized according to the preset memory information.
The log processing apparatus 300 in the embodiment of the present application may be an apparatus suitable for a high-pass platform to use an android operating system. According to an embodiment of the present application, each step involved in the methods shown in fig. 1 and fig. 2 may be performed by each module in the log processing apparatus 300 shown in fig. 3, and is not described herein again.
In the log processing apparatus 300 in this embodiment, at a stage before the kernel is started, a memory is initialized according to preset memory information, an acquired log content is stored in the memory through a log output interface, a log driver is loaded after the kernel is started, and based on the log driver, the log content is acquired into a kernel log file according to a preset memory mapping; by recording the log to a specific memory and reserving the memory mapping to the kernel, the log content can be obtained through the user space access interface for analysis and processing, and the log does not need to be collected through a serial port for analysis, so that the inconvenience caused by welding the serial port is eliminated, the log content can be directly obtained, and the corresponding problem analysis efficiency is improved.
Based on the description of the method embodiment and the device embodiment, the embodiment of the application further provides an electronic device. Referring to fig. 4, the electronic device 400 includes at least a processor 401, an input device 402, an output device 403, and a computer storage medium 404. The processor 401, input device 402, output device 403, and computer storage medium 404 within the terminal may be connected by a bus or other means.
A computer storage medium 404 may be stored in the memory of the terminal, said computer storage medium 404 being adapted to store a computer program comprising program instructions, said processor 401 being adapted to execute said program instructions stored by said computer storage medium 404. The processor 401 (or CPU) is a computing core and a control core of the terminal, and is adapted to implement one or more instructions, and in particular, is adapted to load and execute the one or more instructions so as to implement a corresponding method flow or a corresponding function; in one embodiment, the processor 401 described above in the embodiments of the present application may be configured to perform a series of processes, including the method in the embodiments shown in fig. 1 and fig. 2, and so on.
An embodiment of the present application further provides a computer storage medium (Memory), where the computer storage medium is a Memory device in a terminal and is used to store programs and data. It is understood that the computer storage medium herein may include a built-in storage medium in the terminal, and may also include an extended storage medium supported by the terminal. The computer storage medium provides a storage space that stores an operating system of the terminal. Also stored in this memory space are one or more instructions, which may be one or more computer programs (including program code), suitable for loading and execution by processor 401. The computer storage medium may be a high-speed RAM memory, or may be a non-volatile memory (non-volatile memory), such as at least one disk memory; and optionally at least one computer storage medium located remotely from the processor.
In one embodiment, one or more instructions stored in a computer storage medium may be loaded and executed by processor 401 to perform the corresponding steps in the above embodiments; in particular implementations, one or more instructions in the computer storage medium may be loaded by processor 401 and executed to perform any step of the method in fig. 1 and/or fig. 2, which is not described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and modules may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the division of the module is only one logical division, and other divisions may be possible in actual implementation, for example, a plurality of modules or components may be combined or integrated into another system, or some features may be omitted, or not performed. The shown or discussed mutual coupling, direct coupling or communication connection may be an indirect coupling or communication connection of devices or modules through some interfaces, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are wholly or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on or transmitted over a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)), or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a read-only memory (ROM), or a random access memory (ram), or a magnetic medium, such as a floppy disk, a hard disk, a magnetic tape, a magnetic disk, or an optical medium, such as a Digital Versatile Disk (DVD), or a semiconductor medium, such as a Solid State Disk (SSD).

Claims (10)

1. A log processing method, comprising:
initializing a memory according to preset memory information at a stage before starting a kernel;
storing the acquired log content into the memory through a log output interface;
after the kernel is started, loading a log driver;
and based on the log drive, obtaining the log content to a kernel log file according to a preset memory mapping.
2. The log processing method according to claim 1, wherein initializing the memory according to preset memory information at a stage before the kernel is started comprises:
initializing a first memory according to preset first memory information at a system starting and booting stage;
the storing the acquired log content into the memory through the log storage interface includes:
and storing the acquired first log content into the first memory through a first log output interface, and updating a memory control data structure.
3. The log processing method according to claim 2, wherein, in a stage before the kernel is started, the memory is initialized according to preset memory information, further comprising:
reading the memory control data structure at the initialization stage of the micro kernel to obtain a second memory address of a second log;
the storing the acquired log content into the memory through the log storage interface includes:
and storing second log contents into the second memory address through a second log output interface, and updating the memory control data structure.
4. The log processing method according to any one of claims 1 to 3, wherein before initializing the memory according to the preset memory information, the method further comprises:
configuring nodes and file editing interfaces provided by the log driver according to the driving editing instruction;
the obtaining of the log content into the kernel log file according to the preset memory mapping based on the log driver includes:
acquiring the log content through the nodes provided by the log driver;
and processing the log content based on the file editing interface of the log driver, and storing the log content into the kernel log file through the node provided by the log driver.
5. The log processing method according to claim 4, wherein after obtaining the log content according to a preset memory map into the kernel log file based on the log driver, the method further comprises:
and accessing the nodes provided by the log driver through a user space access interface, and reading the log content to the user space.
6. The log processing method of claim 5, wherein after the reading of the log content to the user space, the method further comprises:
calling a log collection system to collect the log content;
and analyzing the equipment fault according to the log content.
7. The log processing method according to any one of claims 1 to 3, wherein the memory is a free memory reserved according to memory configuration information before the memory is initialized according to the preset memory information.
8. A log processing apparatus, comprising:
the memory configuration module is used for initializing a memory according to preset memory information at the stage before the kernel is started;
the log storage module is used for storing the acquired log content into the memory through a log output interface;
the processing module is used for loading the log driver after the kernel is started;
and the acquisition module is used for acquiring the log content into the kernel log file according to the preset memory mapping based on the log driver.
9. An electronic device, comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the log processing method according to any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, causes the processor to carry out the steps of the log processing method according to any one of claims 1 to 7.
CN202010612520.3A 2020-06-30 2020-06-30 Log processing method and device, electronic equipment and medium Pending CN111782474A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010612520.3A CN111782474A (en) 2020-06-30 2020-06-30 Log processing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010612520.3A CN111782474A (en) 2020-06-30 2020-06-30 Log processing method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN111782474A true CN111782474A (en) 2020-10-16

Family

ID=72760355

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010612520.3A Pending CN111782474A (en) 2020-06-30 2020-06-30 Log processing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN111782474A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328561A (en) * 2020-11-26 2021-02-05 广东小天才科技有限公司 Log transmission method, system, electronic equipment and storage medium
CN112612657A (en) * 2020-12-09 2021-04-06 南京微智新科技有限公司 Debug log output method and device, terminal equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7461080B1 (en) * 2003-05-09 2008-12-02 Sun Microsystems, Inc. System logging within operating system partitions using log device nodes that are access points to a log driver
CN104346265A (en) * 2013-07-29 2015-02-11 比亚迪股份有限公司 Terminal equipment and acquisition method and device for log information thereof
CN107622068A (en) * 2016-07-14 2018-01-23 深圳联友科技有限公司 A kind of blog management method and device based on JSON forms
CN109471773A (en) * 2018-10-31 2019-03-15 武汉斗鱼网络科技有限公司 A kind of method, apparatus, server and the storage medium of the output of front end log multichannel
CN109992489A (en) * 2018-12-29 2019-07-09 上海连尚网络科技有限公司 It is a kind of for monitoring the method and apparatus for the process performing applied in user equipment
CN110147304A (en) * 2019-04-03 2019-08-20 珠海全志科技股份有限公司 A kind of method and apparatus of acquisition system bootload log
CN110187955A (en) * 2019-05-27 2019-08-30 四川大学 A kind of Docker container contents safety detecting method and device that sound state combines

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7461080B1 (en) * 2003-05-09 2008-12-02 Sun Microsystems, Inc. System logging within operating system partitions using log device nodes that are access points to a log driver
CN104346265A (en) * 2013-07-29 2015-02-11 比亚迪股份有限公司 Terminal equipment and acquisition method and device for log information thereof
CN107622068A (en) * 2016-07-14 2018-01-23 深圳联友科技有限公司 A kind of blog management method and device based on JSON forms
CN109471773A (en) * 2018-10-31 2019-03-15 武汉斗鱼网络科技有限公司 A kind of method, apparatus, server and the storage medium of the output of front end log multichannel
CN109992489A (en) * 2018-12-29 2019-07-09 上海连尚网络科技有限公司 It is a kind of for monitoring the method and apparatus for the process performing applied in user equipment
CN110147304A (en) * 2019-04-03 2019-08-20 珠海全志科技股份有限公司 A kind of method and apparatus of acquisition system bootload log
CN110187955A (en) * 2019-05-27 2019-08-30 四川大学 A kind of Docker container contents safety detecting method and device that sound state combines

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112328561A (en) * 2020-11-26 2021-02-05 广东小天才科技有限公司 Log transmission method, system, electronic equipment and storage medium
CN112612657A (en) * 2020-12-09 2021-04-06 南京微智新科技有限公司 Debug log output method and device, terminal equipment and storage medium

Similar Documents

Publication Publication Date Title
US9262283B2 (en) Method for reading kernel log upon kernel panic in operating system
CN109889875B (en) Communication method, communication device, terminal equipment and computer readable medium
WO2015062389A1 (en) Method and apparatus for uninstalling system application on terminal device
WO2020001112A1 (en) Application method for platform supporting multiple types of devices, and mobile terminal
US10606677B2 (en) Method of retrieving debugging data in UEFI and computer system thereof
KR101555210B1 (en) Apparatus and method for downloadin contents using movinand in portable terminal
CN107870769A (en) The installation method and device of operating system
EP3572933B1 (en) Updating firmware via a remote device
US20170139813A1 (en) Method and device for checking influence of deleting cache file, and mobile terminal
CN105786562A (en) Method and device for integrating plug-in
US10282190B2 (en) System and method for updating a UEFI image in an information handling system
CN103853535A (en) Method and device for modifying middleware
CN108694052B (en) Firmware upgrading method, firmware upgrading device and firmware upgrading system
US6961848B2 (en) System and method for supporting legacy operating system booting in a legacy-free system
CN111782474A (en) Log processing method and device, electronic equipment and medium
JPWO2010052999A1 (en) Maintenance system, maintenance method, and maintenance program
CN114691300A (en) Hot migration method of virtual machine instance
CN106484779B (en) File operation method and device
CN111158987A (en) Health check method and device of micro-service architecture
CN114048415A (en) Form generation method and device, electronic equipment and computer readable storage medium
US10503430B2 (en) Method and device for clearing data and electronic device
CN109460187A (en) A kind of qcow2 file data consistency verification method and verifying terminal
CN107678770B (en) Interface chip upgrading method and device, storage medium and processor
CN113760631B (en) Page loading time length determining method, device, equipment and storage medium
JP7522775B2 (en) Non-volatile storage partition identifier

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20201016

RJ01 Rejection of invention patent application after publication