CN115407943A - Memory dump file generation method, device and equipment and readable storage medium - Google Patents

Memory dump file generation method, device and equipment and readable storage medium Download PDF

Info

Publication number
CN115407943A
CN115407943A CN202211040068.3A CN202211040068A CN115407943A CN 115407943 A CN115407943 A CN 115407943A CN 202211040068 A CN202211040068 A CN 202211040068A CN 115407943 A CN115407943 A CN 115407943A
Authority
CN
China
Prior art keywords
memory
data
dump file
dumped
uncompressed
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
CN202211040068.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.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211040068.3A priority Critical patent/CN115407943A/en
Publication of CN115407943A publication Critical patent/CN115407943A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • G06F3/0611Improving I/O performance in relation to response time
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0643Management of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Abstract

The application discloses a memory dump file generation method, a device, equipment and a readable storage medium in the technical field of computers. After a main program of a storage system quits running, a memory management module is utilized to inquire a memory page with a disk drop mark in a system memory, and then data in the memory page is determined to be data to be dumped; when the current residual space of the nonvolatile memory is large enough, creating an uncompressed memory dump file storing data to be dumped, and writing the uncompressed memory dump file into the nonvolatile memory; after the main program of the storage system is restarted, the uncompressed memory dump file in the nonvolatile memory is compressed, so that not only can the space be saved, but also the reduction of the file generation efficiency due to the compression operation can be avoided. The scheme can obtain the memory dump file by considering the limited storage space and the file generation efficiency. The memory dump file generation device, the equipment and the readable storage medium provided by the application also have the technical effects.

Description

Memory dump file generation method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a readable storage medium for generating a memory dump file.
Background
In the process of debugging or running the storage system, if the main program plmain is abnormal, the reason for the abnormality can be analyzed and located through a memory dump file (dump). At present, with the continuous expansion of the main program function, the memory dump file generated when the program is abnormal is also larger and larger, and the space for storing the memory dump file is limited, and we hope to analyze and locate the reason of the abnormality through the memory dump file as soon as possible when the main program plmain is abnormal.
Therefore, how to quickly store the memory dump file in the limited storage space is a problem to be solved by those skilled in the art.
Disclosure of Invention
In view of the above, an object of the present application is to provide a method, an apparatus, a device and a readable storage medium for generating a memory dump file, so as to quickly store the memory dump file in a limited storage space, and take account of the limited storage space and the file generation efficiency. The specific scheme is as follows:
in a first aspect, the present application provides a method for generating a memory dump file, including:
if the main program of the storage system quits running, inquiring a memory page with a disk drop mark in a system memory by using a memory management module, and determining data in the memory page as data to be dumped;
if the current residual space of a nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory;
and if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
Optionally, the method further comprises:
and if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received, controlling the main program of the storage system to quit running.
Optionally, the querying, by using the memory management module, the memory page with the landing flag in the system memory includes:
obtaining a memory page description table from a memory management module;
and inquiring the memory page in the system memory according to the memory page description table.
Optionally, the creating an uncompressed memory dump file in which the data to be dumped is stored includes:
and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain the uncompressed memory dump file.
Optionally, the method further comprises:
recording whether to compress a mark, a dump type, the number of memory pages, file creation time, verification information and component information of the main program of the storage system to a file header of the uncompressed memory dump file.
Optionally, the method further comprises:
if the current residual space is not larger than the size of the data to be dumped, deleting the stored files in the nonvolatile memory according to the importance degree of the files;
and if the current residual space is still not larger than the size of the data to be dumped after the deletion operation is executed, generating a prompt message with insufficient space.
Optionally, the method further comprises:
and if the current residual space is larger than the size of the data to be dumped and an uncompressed memory dump file exists in the nonvolatile memory, creating a compressed memory dump file in which the data to be dumped is stored, and writing the compressed memory dump file into the nonvolatile memory.
In a second aspect, the present application provides an apparatus for generating a memory dump file, including:
the query module is used for querying a memory page with a tray drop mark in a system memory by using the memory management module if the main program of the storage system quits running, and determining data in the memory page as data to be dumped;
a writing module, configured to create an uncompressed memory dump file in which the data to be dumped is stored, and write the uncompressed memory dump file into the nonvolatile memory, if a current remaining space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump file in the nonvolatile memory is subjected to compressed storage;
and the compression module is used for compressing the uncompressed memory dump file in the nonvolatile memory if the main program of the storage system is restarted.
Optionally, the method further comprises:
and the triggering module is used for controlling the main program of the storage system to quit running if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received.
Optionally, the query module is specifically configured to:
obtaining a memory page description table from a memory management module;
and inquiring the memory page in the system memory according to the memory page description table.
Optionally, the writing module is specifically configured to:
and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain the uncompressed memory dump file.
Optionally, the writing module is further configured to:
recording whether to compress a mark, a dump type, the number of memory pages, file creation time, verification information and component information of the main program of the storage system to a file header of the uncompressed memory dump file.
Optionally, the method further comprises:
the deleting module is used for executing deleting operation on the stored files in the nonvolatile memory according to the importance degree of the files if the current residual space is not larger than the size of the data to be dumped;
and the alarm module is used for generating a prompt message of insufficient space if the current residual space is not larger than the size of the data to be dumped after the deletion operation is executed.
Optionally, the method further comprises:
and the compressed storage module is used for creating a compressed memory dump file in which the data to be dumped is stored and writing the compressed memory dump file into the nonvolatile memory if the current residual space is larger than the size of the data to be dumped and the uncompressed memory dump file exists in the nonvolatile memory.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the memory dump file generation method disclosed by the foregoing.
In a fourth aspect, the present application provides a readable storage medium for storing a computer program, where the computer program, when executed by a processor, implements the memory dump file generation method disclosed in the foregoing.
According to the above scheme, the present application provides a method for generating a memory dump file, including: if the main program of the storage system quits running, inquiring a memory page with a disk drop mark in a system memory by using a memory management module, and determining data in the memory page as data to be dumped; if the current residual space of a nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory; and if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
Therefore, in the application, after the main program of the storage system quits running, the memory management module is utilized to inquire the memory page with the disk drop mark in the system memory so as to find out the memory data related to the main program of the system, and then the data in the memory page is determined as the data to be dumped; when the current residual space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are compressed and stored, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory, so that the memory dump files generated in different periods can be reserved, and the storage space of the nonvolatile memory can be saved; after the main program of the storage system is restarted, the uncompressed memory dump file in the nonvolatile memory is compressed, so that the memory dump file generated in each period is compressed and stored in the nonvolatile memory, the space can be saved, and the reduction of the file generation efficiency caused by compression operation can be avoided. Therefore, the memory dump file can be obtained by considering both the limited storage space and the file generation efficiency, help can be provided for restarting the main program of the storage system, and the recovery efficiency of the main program of the storage system is improved.
Accordingly, the memory dump file generation device, the memory dump file generation equipment and the readable storage medium provided by the application also have the technical effects.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for generating a memory dump file according to the present disclosure;
FIG. 2 is a schematic diagram of a dump file generation apparatus disclosed herein;
FIG. 3 is a flowchart of another method for generating a memory dump file according to the present disclosure;
FIG. 4 is a schematic diagram of another apparatus for generating a memory dump file according to the present disclosure;
fig. 5 is a schematic diagram of an electronic device disclosed in the present application.
Detailed Description
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.
At present, with the continuous expansion of the main program function, the memory dump file generated when the program is abnormal is also larger and larger, and the space for storing the memory dump file is limited, and we hope to analyze and locate the reason of the abnormality through the memory dump file as soon as possible when the main program plmain is abnormal. Therefore, the memory dump file generation scheme provided by the application can be used for rapidly storing the memory dump file in a limited storage space, can provide help for restarting the main program of the storage system, and improves the recovery efficiency of the main program of the storage system.
Referring to fig. 1, an embodiment of the present application discloses a method for generating a memory dump file, including:
s101, if the main program of the storage system quits running, the memory management module is used for inquiring a memory page with a disk falling mark in the system memory, and data in the memory page is determined to be data to be dumped.
It should be noted that, during the initialization phase of the main program of the storage system, the memory management module allocates a corresponding memory to each component in the main program. Each time a segment of memory is allocated, it will be determined whether marking of Harden (i.e. a landing mark) is required according to the purpose of the allocated memory. And when the memory dump file needs to be generated, determining whether the data in the corresponding memory page needs to be collected according to whether the memory page is Harden marked or not. In one embodiment, the method for querying a memory page with a landing mark in a system memory by using a memory management module includes: obtaining a memory page description table from a memory management module; and inquiring the memory pages with the falling disk marks in the system memory according to the memory page description table.
Generally, the exit of the main program of the storage system is triggered by an exception or a user instruction of the main program of the storage system. Therefore, in one embodiment, if an exception occurs in the main program of the storage system or a memory dump file generation instruction of the main program of the storage system is received, the main program of the storage system is controlled to exit from running.
S102, if the current residual space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump file in the nonvolatile memory is subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory.
In one embodiment, creating an uncompressed memory dump file storing data to be dumped comprises: and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain an uncompressed memory dump file. Recording whether a mark, a dump type, the number of memory pages, file creation time, verification information and component information of a main program of a storage system are compressed into a file header of an uncompressed memory dump file. Wherein, LRC operation can be adopted to check the data to be dumped. The 8 memory pages constitute a iob (io buffer, io cache), one page is 4k in size, and one iob is 32k in size. Therefore, iob numbers can be recorded in the file header.
S103, if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
In a specific embodiment, if the current remaining space is not larger than the size of the data to be dumped, it indicates that the current remaining space of the nonvolatile memory is too small to store the data to be dumped, so that the deletion operation is performed on the stored files in the nonvolatile memory according to the importance degree of the files; and if the current residual space is still not larger than the size of the data not to be dumped after the deletion operation is executed, generating a prompt message of insufficient space so that a user can manually clear the storage space of the nonvolatile memory. In order to avoid affecting the file generation efficiency, the number of times of executing the deletion operation may be limited, for example: the number of times the deletion operation is performed is limited to 1. The stored files in the nonvolatile memory may include other files (such as log files) in addition to the previously generated memory dump file. The importance degree of the file can be determined according to the creation date of the file, such as: the earlier the creation date is, the less important the file is, so that the file with the earlier creation date is deleted preferentially. Of course, the importance of the file may also be determined according to the priority of the file, for example: and preferentially deleting the files with low priority.
In one embodiment, if the current remaining space is larger than the size of the data to be dumped and there is an uncompressed memory dump file in the nonvolatile memory, it indicates that: although the current remaining space of the nonvolatile memory is enough to store the data to be dumped, the remaining space of the nonvolatile memory is not enough after the data to be dumped is stored, so that a compressed memory dump file storing the data to be dumped is created, and the compressed memory dump file is written into the nonvolatile memory to save the storage space of the nonvolatile memory. Among them, the uncompressed memory dump files are generally large.
It can be seen that, in this embodiment, after the main program of the storage system exits from running, the memory management module is used to query the memory page with the disk drop mark in the system memory to find the memory data related to the main program of the system, and then determine the data in the memory page as the data to be dumped; when the current residual space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are compressed and stored, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory, so that the memory dump files generated in different periods can be reserved, and the storage space of the nonvolatile memory can be saved; after the main program of the storage system is restarted, the uncompressed memory dump file in the nonvolatile memory is compressed, so that the memory dump file generated in each period is compressed and stored in the nonvolatile memory, the space can be saved, and the reduction of the file generation efficiency caused by compression operation can be avoided. Therefore, the memory dump file can be obtained by considering the limited storage space and the file generation efficiency, help can be provided for restarting the main program of the storage system, and the recovery efficiency of the main program of the storage system is improved.
The following embodiment provides a dump file generation apparatus including a cache unit, a nonvolatile storage unit, a trigger unit, a management unit, and a compression unit, and please refer to fig. 2 specifically.
Wherein, the buffer unit is: the internal memory directly exchanging data with CPU or MCU has the features of fast read/write speed and loss of power-off data, and may be memory of memory device or RAM.
Nonvolatile memory cell refers to: the module that the power failure data will not lose and can store the data for a long time can be a hard disk of the storage device, such as: solid state drives SSD, mechanical hard disk HDDs, and the like.
The trigger unit is used for triggering generation of the dump file, and is generally triggered when the main program of the storage system is abnormal or manually triggered by a user through a command.
When receiving the instruction of the trigger unit, the management unit stores the data in the cache unit to the nonvolatile storage unit in a compression or non-compression mode, or restores the memory dump file from the nonvolatile storage unit to the cache unit.
The compression unit is used for compressing the data in the cache unit or the uncompressed data in the nonvolatile memory.
Referring to fig. 3, a logic schematic of the device shown in fig. 2 for generating a dump file is shown in fig. 3, which specifically includes the following steps:
(1) The management unit starts, judges whether the number of the uncompressed memory dump files in the nonvolatile storage unit is more than 1, and when the number of the uncompressed memory dump files in the nonvolatile storage unit is more than 1, the management unit sequentially compresses the uncompressed memory dump files.
(2) The management unit circularly monitors whether the main program plmain of the storage system is abnormally interrupted or monitors whether a user manually triggers the generation of the memory dump file through the trigger unit, and if the main program plmain is abnormally interrupted or a memory dump file generation instruction is monitored, the management unit controls the main program plmain to exit.
(3) The management unit obtains memory page information of the cache unit, which needs to be dumped by the main process pipeline, through the memory management module.
(4) The management unit calculates the size of the dump file to be stored currently according to the memory page information to be dumped, judges whether the residual space of the nonvolatile storage unit is larger than the size of the current dump file, deletes a part of files in the nonvolatile storage unit according to the importance of the files if the residual space is smaller than the size of the dump file, and enters the step (5); otherwise, it indicates that the nonvolatile memory cell space is sufficient, and step (6) is entered.
(5) And the management unit judges whether the residual space of the nonvolatile storage unit is larger than the dump file size again, and if the residual space is not enough, the management unit reports an alarm to prompt a user.
(6) The management unit judges whether the non-volatile storage unit has an uncompressed dump file, if so, the management unit controls the generation of the compressed dump file, and the step (7) is carried out; otherwise, the control generates an uncompressed dump file, and the step (8) is carried out.
(7) Creating a compressed dump file: and taking the verified memory page information of the cache unit as a file header, compressing the memory page data to be dumped to obtain compressed data B, and writing the compressed data B into the file to obtain a compressed dump file.
(8) Creating an uncompressed dump file: and taking the verified memory page information of the cache unit as a file header, then directly writing the memory page data to be dumped into the file, and obtaining the uncompressed dump file after the writing is finished.
(9) The management unit controls the starting of the main program plmain process. After the main program plmain process is started, whether uncompressed dump files exist in the nonvolatile storage unit is judged, if yes, the main program plmain is informed to compress the uncompressed dump files in an inter-process communication IPC mode, then the step (2) is carried out, and if not, the step (2) is directly carried out.
Therefore, the memory information is compressed, the memory dumping efficiency of the storage system can be improved, and the occupation of the hard disk space of the storage device system is reduced. Meanwhile, whether the file is compressed or not can be selectively determined when the file is generated every time, so that the limited storage space and the file generation efficiency can be considered, the recovery efficiency of the main program of the storage system is improved, and effective support is provided for storage equipment fault location and research and development personnel to analyze and solve the problems.
In the following, a memory dump file generation apparatus provided in an embodiment of the present application is introduced, and a memory dump file generation apparatus described below and a memory dump file generation method described above may be referred to each other.
Referring to fig. 4, an embodiment of the present application discloses a device for generating a memory dump file, including:
the query module 401 is configured to query, by using the memory management module, a memory page with a disk drop flag in the system memory if the main program of the storage system exits from running, and determine data in the memory page as data to be dumped;
a writing module 402, configured to create an uncompressed memory dump file in which data to be dumped is stored, and write the uncompressed memory dump file into the nonvolatile memory, if the current remaining space of the nonvolatile memory is greater than the size of the data to be dumped and the memory dump file in the nonvolatile memory is subjected to compressed storage;
the compressing module 403 is configured to compress an uncompressed memory dump file in the nonvolatile memory if the main program of the storage system is restarted.
In a specific embodiment, the method further comprises the following steps:
and the triggering module is used for controlling the main program of the storage system to quit running if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received.
In a specific embodiment, the query module is specifically configured to:
obtaining a memory page description table from a memory management module;
and inquiring the memory pages in the system memory according to the memory page description table.
In a specific embodiment, the writing module is specifically configured to:
and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain an uncompressed memory dump file.
In one embodiment, the write module is further configured to:
recording whether a mark, a dump type, the number of memory pages, file creation time, verification information and component information of a main program of a storage system are compressed into a file header of an uncompressed memory dump file.
In a specific embodiment, the method further comprises the following steps:
the deleting module is used for executing deleting operation on the stored files in the nonvolatile memory according to the importance degree of the files if the current residual space is not larger than the size of the data to be dumped;
and the alarm module is used for generating a prompt message of insufficient space if the current residual space is not larger than the size of the data not to be dumped after the deletion operation is executed.
In a specific embodiment, the method further comprises the following steps:
and the compressed storage module is used for creating a compressed memory dump file in which the data to be dumped is stored and writing the compressed memory dump file into the nonvolatile memory if the current residual space is larger than the size of the data to be dumped and the uncompressed memory dump file exists in the nonvolatile memory.
For more specific working processes of each module and unit in this embodiment, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not described herein again.
Therefore, the embodiment provides a memory dump file generation device, which can obtain a memory dump file by considering both limited storage space and file generation efficiency, can provide help for restarting a main program of a storage system, and improves recovery efficiency of the main program of the storage system.
In the following, an electronic device provided by an embodiment of the present application is introduced, and an electronic device described below and the method and the apparatus for generating a memory dump file described above may be referred to each other.
Referring to fig. 5, an embodiment of the present application discloses an electronic device, including:
a memory 501 for storing a computer program;
a processor 502 for executing the computer program to implement the method disclosed by any of the embodiments described above.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: if the main program of the storage system quits running, inquiring a memory page with a disk drop mark in a system memory by using a memory management module, and determining data in the memory page as data to be dumped; if the current residual space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory; and if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: and if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received, controlling the main program of the storage system to quit running.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: obtaining a memory page description table from a memory management module; and inquiring the memory pages in the system memory according to the memory page description table.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain an uncompressed memory dump file.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: recording whether a mark, a dump type, the number of memory pages, file creation time, verification information and component information of a main program of a storage system are compressed into a file header of an uncompressed memory dump file.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: if the current residual space is not larger than the size of the data to be dumped, executing deletion operation on the stored files in the nonvolatile memory according to the importance degree of the files; and if the current residual space is still not larger than the size of the data not to be dumped after the deletion operation is executed, generating a prompt message of insufficient space.
In this embodiment, when the processor executes the computer program stored in the memory, the following steps may be specifically implemented: if the current residual space is larger than the size of the data to be dumped and the non-volatile memory has an uncompressed memory dump file, creating a compressed memory dump file storing the data to be dumped, and writing the compressed memory dump file into the non-volatile memory.
Further, an embodiment of the present application further provides a server as the electronic device. The server may specifically include: at least one processor, at least one memory, a power supply, a communication interface, an input output interface, and a communication bus. The memory is used for storing a computer program, and the computer program is loaded and executed by the processor to implement the relevant steps in the memory dump file generation method disclosed by any one of the foregoing embodiments.
In this embodiment, the power supply is configured to provide a working voltage for each hardware device on the server; the communication interface can create a data transmission channel between the server and external equipment, and the communication protocol followed by the communication interface is any communication protocol applicable to the technical scheme of the application, and the communication interface is not specifically limited herein; the input/output interface is used for acquiring external input data or outputting data to the outside, and the specific interface type can be selected according to specific application requirements without specific limitation.
In addition, the memory is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, where the stored resources include an operating system, a computer program, data, and the like, and the storage manner may be a transient storage manner or a permanent storage manner.
The operating system is used for managing and controlling hardware devices and computer programs on the Server so as to realize the operation and processing of the processor on the data in the memory, and the operating system can be Windows Server, netware, unix, linux and the like. The computer program may further include a computer program that can be used to perform other specific tasks in addition to the computer program that can be used to perform the memory dump file generation method disclosed in any of the foregoing embodiments. The data may include data such as developer information of the virtual machine, in addition to data such as the virtual machine.
Further, the embodiment of the application also provides a terminal as the electronic device. The terminal may specifically include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
Generally, the terminal in this embodiment includes: a processor and a memory.
The processor may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in a wake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
The memory may include one or more computer-readable storage media, which may be non-transitory. The memory may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory is at least used for storing a computer program, where after the computer program is loaded and executed by the processor, the relevant steps in the memory dump file generation method executed by the terminal side disclosed in any of the foregoing embodiments can be implemented. In addition, the resources stored by the memory may also include an operating system, data and the like, and the storage mode may be a transient storage mode or a permanent storage mode. The operating system may include Windows, unix, linux, and the like. The data may include, but is not limited to, update information for the application.
In some embodiments, the terminal may further include a display, an input/output interface, a communication interface, a sensor, a power source, and a communication bus.
In the following, a readable storage medium provided by an embodiment of the present application is introduced, and a readable storage medium described below and a method, an apparatus, and a device for generating a memory dump file described above may be referred to each other.
A readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the memory dump file generation method disclosed in the foregoing embodiments.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: if the main program of the storage system quits running, inquiring a memory page with a disk drop mark in a system memory by using a memory management module, and determining data in the memory page as data to be dumped; if the current residual space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump files in the nonvolatile memory are subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory; and if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: and if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received, controlling the main program of the storage system to quit running.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: obtaining a memory page description table from a memory management module; and inquiring the memory pages in the system memory according to the memory page description table.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain an uncompressed memory dump file.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: recording whether a mark, a dump type, the number of memory pages, file creation time, verification information and component information of a main program of a storage system are compressed into a file header of an uncompressed memory dump file.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: if the current residual space is not larger than the size of the data to be dumped, executing deletion operation on the stored files in the nonvolatile memory according to the importance degree of the files; and if the current residual space is still not larger than the size of the data not to be dumped after the deletion operation is executed, generating a prompt message of insufficient space.
In this embodiment, the computer program executed by the processor may specifically implement the following steps: and if the current residual space is larger than the size of the data to be dumped and an uncompressed memory dump file exists in the nonvolatile memory, creating a compressed memory dump file in which the data to be dumped are stored, and writing the compressed memory dump file into the nonvolatile memory.
References in this application to "first," "second," "third," "fourth," etc., if any, are intended to distinguish between similar elements and not necessarily to describe a particular order or sequence. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises" and "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, or apparatus.
It should be noted that the descriptions in this application referring to "first", "second", etc. are for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the feature. In addition, technical solutions between various embodiments may be combined with each other, but must be realized by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination should not be considered to exist, and is not within the protection scope of the present application.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of readable storage medium known in the art.
The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific implementation manner and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for generating a memory dump file is characterized by comprising the following steps:
if the main program of the storage system quits running, inquiring a memory page with a disk drop mark in a system memory by using a memory management module, and determining data in the memory page as data to be dumped;
if the current residual space of a nonvolatile memory is larger than the size of the data to be dumped and the memory dump file in the nonvolatile memory is subjected to compression storage, creating an uncompressed memory dump file in which the data to be dumped are stored, and writing the uncompressed memory dump file into the nonvolatile memory;
and if the main program of the storage system is restarted, compressing the uncompressed memory dump file in the nonvolatile memory.
2. The method of claim 1, further comprising:
and if the main program of the storage system is abnormal or a memory dump file generation instruction of the main program of the storage system is received, controlling the main program of the storage system to quit running.
3. The method according to claim 1, wherein the querying, by the memory management module, the memory page with the landing flag in the system memory comprises:
obtaining a memory page description table from a memory management module;
and inquiring the memory page in the system memory according to the memory page description table.
4. The method according to claim 1, wherein the creating an uncompressed memory dump file storing the data to be dumped comprises:
and checking the data to be dumped, and if the data to be dumped passes the checking, writing the data to be dumped into an empty file to obtain the uncompressed memory dump file.
5. The method of claim 4, further comprising:
recording whether to compress a mark, a dump type, the number of memory pages, file creation time, verification information and component information of the main program of the storage system to a file header of the uncompressed memory dump file.
6. The method of any of claims 1 to 5, further comprising:
if the current residual space is not larger than the size of the data to be dumped, executing deletion operation on the stored files in the nonvolatile memory according to the importance degree of the files;
and if the current residual space is still not larger than the size of the data to be dumped after the deletion operation is executed, generating a prompt message with insufficient space.
7. The method of any one of claims 1 to 5, further comprising:
and if the current residual space is larger than the size of the data to be dumped and an uncompressed memory dump file exists in the nonvolatile memory, creating a compressed memory dump file in which the data to be dumped is stored, and writing the compressed memory dump file into the nonvolatile memory.
8. An apparatus for generating a memory dump file, comprising:
the query module is used for querying a memory page with a tray drop mark in a system memory by using the memory management module if the main program of the storage system quits running, and determining data in the memory page as data to be dumped;
a writing module, configured to create an uncompressed memory dump file in which the data to be dumped is stored, and write the uncompressed memory dump file into the nonvolatile memory, if a current remaining space of the nonvolatile memory is larger than the size of the data to be dumped and the memory dump file in the nonvolatile memory is subjected to compressed storage;
and the compression module is used for compressing the uncompressed memory dump file in the nonvolatile memory if the main program of the storage system is restarted.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the method of any one of claims 1 to 7.
10. A readable storage medium for storing a computer program, wherein the computer program when executed by a processor implements the method of any one of claims 1 to 7.
CN202211040068.3A 2022-08-29 2022-08-29 Memory dump file generation method, device and equipment and readable storage medium Pending CN115407943A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211040068.3A CN115407943A (en) 2022-08-29 2022-08-29 Memory dump file generation method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211040068.3A CN115407943A (en) 2022-08-29 2022-08-29 Memory dump file generation method, device and equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN115407943A true CN115407943A (en) 2022-11-29

Family

ID=84162683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211040068.3A Pending CN115407943A (en) 2022-08-29 2022-08-29 Memory dump file generation method, device and equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115407943A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116302646A (en) * 2023-02-24 2023-06-23 荣耀终端有限公司 Fault positioning method, system, electronic equipment and storage medium
CN116661678A (en) * 2022-12-28 2023-08-29 荣耀终端有限公司 Data dump method and electronic equipment
CN116661678B (en) * 2022-12-28 2024-04-19 荣耀终端有限公司 Data dump method and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116661678A (en) * 2022-12-28 2023-08-29 荣耀终端有限公司 Data dump method and electronic equipment
CN116661678B (en) * 2022-12-28 2024-04-19 荣耀终端有限公司 Data dump method and electronic equipment
CN116302646A (en) * 2023-02-24 2023-06-23 荣耀终端有限公司 Fault positioning method, system, electronic equipment and storage medium
CN116302646B (en) * 2023-02-24 2024-03-29 荣耀终端有限公司 Fault positioning method, system, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108874624B (en) Server, method for monitoring Java process and storage medium
KR101636870B1 (en) Method and apparatus for generating minimal boot image
JP5211751B2 (en) Calculator, dump program and dump method
CN107403089B (en) Resource tampering identification method and device based on application program
CN110413432B (en) Information processing method, electronic equipment and storage medium
US10228993B2 (en) Data dump for a memory in a data processing system
CN110427258B (en) Resource scheduling control method and device based on cloud platform
US9575827B2 (en) Memory management program, memory management method, and memory management device
CN114546634B (en) Management of synchronous restart of system
CN115495025B (en) Method and device for managing abnormal memory block
CN112214388A (en) Memory monitoring method, device, equipment and computer readable storage medium
US9507657B2 (en) Investigation program, information processing apparatus, and information processing method
CN115407943A (en) Memory dump file generation method, device and equipment and readable storage medium
CN110221932B (en) Computer and control method thereof
CN108829345B (en) Data processing method of log file and terminal equipment
US11487428B2 (en) Storage control apparatus and storage control method
CN117131014A (en) Database migration method, device, equipment and storage medium
CN114756355B (en) Method and device for automatically and quickly recovering process of computer operating system
CN114328007B (en) Container backup and restoration method, device and medium thereof
CN113467698A (en) Writing method and device based on file system, computer equipment and storage medium
CN113076122A (en) Resource file management method, device, equipment and storage medium
CN111984618A (en) Log compression method and device
CN111176571A (en) Method, device, equipment and medium for managing local object
CN111625192B (en) Metadata object access method, device, equipment and medium
CN112257004B (en) Method, device, server and storage medium for page backup

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