A file dumping method and device, electronic equipment and storage medium

By dynamically adjusting the storage space of the dump file, the problem of inflexible storage caused by changes in the size of the dump file is solved, achieving efficient storage resource management and improved fault analysis efficiency.

CN115185884BActive Publication Date: 2026-04-28CHINA AUTOMOTIVE INNOVATION CORP
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA AUTOMOTIVE INNOVATION CORP
Filing Date
2022-06-29
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In existing technologies, the storage method for dump files cannot be flexibly adjusted, which makes the system partition unable to cope with situations where the dump file is too large or too small. Furthermore, adjusting the partition requires a system update, which affects storage efficiency and stability.

Method used

By receiving dump file update requests, adjusting the dump space according to the file size, creating the target dump file, and writing the file location and size to the shared storage space, the dump component can read the data, enabling dynamic adjustment of the dump space.

Benefits of technology

It enables flexible adjustment of storage space when the size of the dump file changes, saving storage resources, improving fault analysis efficiency, and eliminating the need for a complete system update.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115185884B_ABST
    Figure CN115185884B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a file dump method and device, electronic equipment and storage medium, the method comprising: receiving a dump file update request corresponding to a target test task, deleting an original dump file in a first original dump space; if the target file size meets a first preset condition, creating a target dump file in the first original dump space; or; if the target file size meets a second preset condition, determining a first target dump space from a system storage space based on a preset storage condition; creating a target dump file in the first target dump space; writing the target file location and target file size of the target dump file into a shared storage space through an operating system; the shared storage space is used for reading by a dump component. Through the file dump method of the embodiments of the present application, the dump space can be flexibly adjusted according to the changing dump requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information technology, and in particular to a file dumping method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the continuous development of embedded platforms, both manufacturers and users are placing higher demands on the system stability of devices. When the operating system crashes or experiences abnormal states, the system needs to save a memory dump file, which is used for subsequent analysis of the operating system. In the event of an abnormal state, the system can use a dump component to dump the complete contents of the dump file to flash memory or hard disk, and then restart the operating system after the dump is complete.

[0003] Current dump file dumping methods typically store dump files in a fixed system partition. Because the system partition's size is inflexible and dump files in dumping scenarios often cannot be dynamically compressed, the system partition may be unable to handle excessive storage requirements when the dump file becomes too large. Furthermore, adjusting a fixed system partition can only be done after a system-wide update, and adjusting partitions through a system update can have complex impacts on internal storage. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this disclosure provides a file dumping method, apparatus, electronic device, and storage medium that can flexibly adjust the dumping space to meet ever-changing dumping needs.

[0005] This application provides a file dumping method, the method comprising: receiving a dump file update request corresponding to a target test task, deleting the original dump file in a first original dump space; the dump file update request includes the target file size of the target dump file; if the target file size meets a first preset condition, creating a target dump file in the first original dump space; or; if the target file size meets a second preset condition, determining a first target dump space from the system storage space based on preset storage conditions; creating a target dump file in the first target dump space; and writing the target file location and target file size of the target dump file into a shared storage space through the operating system; the shared storage space is used for reading by a dumping component.

[0006] Optionally, after the operating system writes the target file location and target file size of the target dump file to the shared storage space, the method further includes: if the operating system is detected to be in an abnormal state, reading the target file location and target file size from the shared storage space through the dump component; reading the target dump file based on the target file location and target file size through the dump component; and storing the target dump file to the second target dump space.

[0007] Optionally, if a dump file update request is received, before deleting the original dump file in the first original dump space, the method further includes: if a dump file creation request is received, the dump file creation request includes the original file size of the original dump file; determining the first original dump space from the system storage space based on the original file size; and creating the original dump file in the first original dump space.

[0008] Optionally, if the target file size meets the first preset condition, a target dump file is created in the first original dump space, including: if the target file size is less than or equal to the original file size of the original dump file, a target dump file is created in the first original dump space; if the target file size meets the second preset condition, a first target dump space is determined from the system storage space based on preset storage conditions, including: if the target file size is greater than the original file size, a first target dump space is determined from the system storage space based on preset storage conditions.

[0009] Optionally, if the target file size is larger than the original file size, a first target dump space is determined from the system storage space based on preset storage conditions, including: if the target file size is larger than the original file size, a first remaining contiguous space is determined from the system storage space; if there exists a space with a first remaining contiguous space size greater than or equal to the target file size, the first remaining contiguous space is determined as the first target dump space; or; if the space with a first remaining contiguous space size is smaller than the target file size, the system storage space is cleaned up to obtain an updated system space; the space with an updated system space size greater than or equal to the target file size; the first target dump space is determined from the updated system space.

[0010] Optionally, determining the first target storage space from the updated system space includes: determining a second remaining contiguous space from the updated system space; the size of the second remaining contiguous space is greater than or equal to the size of the target file; and determining the second remaining contiguous space as the first target dump space.

[0011] Optionally, the target file location and target file size of the target dump file are written to the shared storage space by the operating system, including: writing the target file location in the form of a logical block address to the first field of the shared storage space; and writing the target file size to the second field of the shared storage space.

[0012] Accordingly, embodiments of this application provide a file dumping device, the device comprising:

[0013] The deletion module is used to receive a dump file update request corresponding to the target test task and delete the original dump file in the first original dump space; the dump file update request includes the target file size of the target dump file;

[0014] A creation module is used to create a target dump file in the first original dump space if the target file size meets a first preset condition; or; if the target file size meets a second preset condition, determine the first target dump space from the system storage space based on preset storage conditions; and create the target dump file in the first target dump space.

[0015] The write module is used to write the target file location and target file size of the target dump file to the shared storage space via the operating system; the shared storage space is used for reading by the dump component.

[0016] Optionally, the device also includes a dump module, which, after writing the target file location and target file size of the target dump file to the shared storage space through the operating system: if an abnormal state of the operating system is detected, reads the target file location and target file size from the shared storage space through the dump component; reads the target dump file based on the target file location and target file size through the dump component; and stores the target dump file to the second target dump space.

[0017] Optionally, the apparatus further includes a raw module, configured to: upon receiving a dump file update request corresponding to the target test task and before deleting the original dump file in the first raw dump space, if a dump file creation request is received, the dump file creation request includes the original file size of the original dump file; determine the first raw dump space from the system storage space based on the original file size; and create the original dump file in the first raw dump space.

[0018] Optionally, the creation module is used to: create a target dump file in the first original dump space if the target file size is less than or equal to the original file size of the original dump file; and determine the first target dump space from the system storage space based on the preset storage conditions if the target file size meets the second preset condition, including: determining the first target dump space from the system storage space based on the preset storage conditions if the target file size is greater than the original file size.

[0019] Optionally, the creation module is also used to: if the target file size is greater than the original file size, determine the first remaining contiguous space from the system storage space; if there exists a space with the first remaining contiguous space that is greater than or equal to the target file size, determine the first remaining contiguous space as the first target dump space; or; if the space with the first remaining contiguous space is less than the target file size, clean up the system storage space to obtain the updated system space; the space with the updated system space is greater than or equal to the target file size; determine the first target dump space from the updated system space.

[0020] Optionally, the creation module is also used to: determine a second remaining contiguous space from the updated system space; the size of the second remaining contiguous space is greater than or equal to the target file size; and determine the second remaining contiguous space as the first target dump space.

[0021] Optionally, the write module is used to: write the target file location, in the form of a logical block address, into the first field of the shared storage space; and write the target file size into the second field of the shared storage space.

[0022] Accordingly, this disclosure provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the above-described file dumping method.

[0023] Accordingly, embodiments of this disclosure provide a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, at least one program, code set, or instruction set is loaded and executed by a processor to implement the above-described file dumping method.

[0024] The embodiments of this application have the following beneficial effects:

[0025] (1) Update the dump file in a timely manner according to the needs of different test scenarios so as to collect an appropriate amount of analysis data during the test analysis process and improve the efficiency of fault analysis.

[0026] (2) When the size of the dump file is reduced, the storage space can be reduced to save as much storage space as possible while meeting the functional requirements.

[0027] (3) When the size of the dump file increases, the memory requirements of the excessive dump file can be met by determining a larger dump space without the need for a system-wide update or compression of the dump file. Attached Figure Description

[0028] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0029] Figure 1 This is a schematic diagram illustrating an application scenario of a file dumping method provided in an embodiment of this application;

[0030] Figure 2This is a first flowchart illustrating a file dumping method provided in an embodiment of this application;

[0031] Figure 3 This is a schematic diagram of the second process of a file dumping method provided in an embodiment of this application;

[0032] Figure 4 This is a schematic diagram of the third process of a file dumping method provided in an embodiment of this application;

[0033] Figure 5 This is a schematic diagram of the structure of a file dumping device provided in an embodiment of this application;

[0034] Figure 6 This is a hardware structure block diagram of a server for a file dumping method provided in an embodiment of this application. Detailed Implementation

[0035] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings. Obviously, the described embodiments are merely one embodiment of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0036] The term "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of this application. In the description of the embodiments of this application, it should be understood that the terms "upper," "lower," "left," "right," "top," "bottom," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device / system or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first" and "second" may explicitly or implicitly include one or more of that feature. Moreover, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in a sequence other than that illustrated or described herein. Furthermore, the terms “comprising” and “having” / “being” and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system / apparatus, product or device that includes a series of steps or units / modules is not necessarily limited to those steps or units / modules that are explicitly listed, but may include other steps or units / modules that are not explicitly listed or that are inherent to such process, method, product or device.

[0037] The following describes a specific embodiment of a file dumping method provided in this application. Please refer to [link / reference]. Figure 1 , Figure 1 This is a schematic diagram illustrating an application scenario of a file dumping method provided in an embodiment of this application. For example... Figure 1 As shown, it includes server 101 and terminal 102. Optionally, server 101 and terminal 102 can be connected via a wireless link or a wired link, which is not limited in this disclosure.

[0038] Specifically, server 101 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the operating system running on server 101 may include, but is not limited to, iOS, Linux, Windows, Unix, Android, etc.

[0039] Specifically, terminal 102 may include, but is not limited to, electronic devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. Optionally, the operating system running on the electronic device may include, but is not limited to, Android, iOS, Linux, and Windows.

[0040] In an optional embodiment, terminal 102 can run a bootloader when the operating system malfunctions. In the event of an abnormality such as a system crash, the operating system can perform a software reset, and the bootloader can dump the data from memory to flash memory. After the dump is complete, the operating system can restart normally. The dumped data can be used for subsequent analysis of the cause of the system abnormality. Optionally, the dumped data can be uploaded to server 101, where server 101 can uniformly analyze all dumped data under the current system version and determine a system upgrade plan based on the analysis. Since the size of the dump file used for dumping may need to be changed, and the memory space of terminal 102 is limited, terminal 102 needs to flexibly configure the space of the dump file. Optionally, terminal 102 can receive a dump file update request corresponding to the target test task and delete the original dump file in the first original dump space. The dump file update request includes the target file size of the target dump file. If the target file size meets a first preset condition, the target dump file is created in the first original dump space. Or, if the target file size meets a second preset condition, the first target dump space is determined from the system storage space based on preset storage conditions. The target dump file is created in the first target dump space. The target file position and target file size of the target dump file are written to the shared storage space by the operating system. The shared storage space can be read by the dump component. In an optional implementation, the dump file update request can be sent by server 101.

[0041] In addition, it should be noted that, Figure 1 The example shown is merely one application environment of the file dumping method provided in this disclosure. In practical applications, other application environments may also be included, but this embodiment does not limit this.

[0042] The following describes an exemplary process of a file dumping method provided in this application. Optionally, the entity executing a file dumping method can be a terminal or a file dumping system. Figure 2This is a first flowchart illustrating a file dumping method provided in an embodiment of this application. This specification provides the method or process steps shown in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer steps may be included. The order of steps listed in the embodiments is merely one of many execution orders and does not represent the only execution order. In actual execution, the method or process can be executed in the order shown in the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). Specifically, as shown... Figure 2 As shown, the method includes:

[0043] S201: Received a dump file update request corresponding to the target test task, and deleted the original dump file in the first original dump space.

[0044] Optionally, the dump file update request may include the target file size of the target dump file.

[0045] In one optional implementation, the terminal can be in the test scenario corresponding to the target test task. During the test phase, the terminal can receive a dump file update request and update the existing dump file according to the dump file update request so that the updated dump file matches the test requirements. The dump file can be exported by the terminal from the dumped location for analysis of the cause of the operating system anomaly.

[0046] In another alternative implementation, the terminal can be in a daily use scenario, and the target test task can correspond to the operating system version. The vendor server can send a dump file update request corresponding to the target test task to the terminal, so that the terminal's dump file is updated according to the vendor server's test requirements, thereby making the dump files subsequently collected by the vendor meet the analysis requirements. Subsequently, the vendor can update the terminal system based on the analysis results.

[0047] Optionally, the original dump file to be deleted can be a dump file used for dumping in system memory before a dump file update request is received. This original dump file can be a dump file created when the operating system first boots, or it can be a dump file that has been updated once or multiple times.

[0048] S202: If the target file size meets the first preset condition, create the target dump file in the first original dump space.

[0049] In one optional implementation, the first preset condition may be: the target file size is less than or equal to the original file size of the original dump file. Step S202 may include: if the target file size is less than or equal to the original file size of the original dump file, creating the target dump file in the first original dump space.

[0050] S203: If the target file size meets the second preset condition, determine the first target dump space from the system storage space based on the preset storage conditions.

[0051] In one optional implementation, the second preset condition may be: the target file size is greater than the original file size. Step S203 may include: if the target file size is greater than the original file size, determining a first target dump space from the system storage space based on preset storage conditions.

[0052] Since the operating systems of embedded platforms on terminals generally support various file systems, a dedicated partition for dumping files is not required; instead, the files can be stored in a writable data storage space that meets the requirements. For example, the / data partition on a mobile phone. In an optional implementation, if there is not enough contiguous space in the system memory, the system memory space can be released through disk cleanup; where system memory can refer to the operating system's running memory. Step S203 may include: if the target file size is larger than the original file size, determining a first remaining contiguous space from the system storage space; if the size of the first remaining contiguous space is greater than or equal to the target file size, determining the first remaining contiguous space as the first target dump space; or; if the size of the first remaining contiguous space is smaller than the target file size, cleaning up the system storage space to obtain an updated system space; the size of the updated system space is greater than or equal to the target file size; determining the first target dump space from the updated system space. Optionally, determining the first target storage space from the updated system space may include: determining a second remaining contiguous space from the updated system space; the size of the second remaining contiguous space is greater than or equal to the target file size; determining the second remaining contiguous space as the first target dump space.

[0053] Optionally, if disk cleanup fails to free up sufficient space in system memory, the first target dump space can be determined from flash memory. The first remaining contiguous space can be determined from flash memory; if the size of the first remaining contiguous space is greater than or equal to the target file size, this first remaining contiguous space is designated as the first target dump space.

[0054] S204: Create a target dump file in the first target dump space.

[0055] Optionally, a target dump file can be created in the first target dump space according to the target file size. The data blocks stored in the target dump file in the first target dump space can be contiguous.

[0056] In one alternative implementation, Figure 2Steps S202-S204 illustrated can also be replaced by the following steps: creating a target dump file in the first original dump space; if creation is successful, proceed to step S205; if creation fails, determine the first target dump space from the system storage space based on preset storage conditions; create a target dump file in the first target dump space. The specific content of creating the target dump file in the first original dump space, determining the first target dump space from the system storage space based on preset storage conditions, and creating the target dump file in the first target dump space in this embodiment can be referred to the above description, and will not be repeated here.

[0057] S205: The target file location and target file size of the target dump file are written to the shared storage space by the operating system.

[0058] Optionally, the shared storage space can be read by the dump component. The dump component may include a bootloader with read permissions for the shared storage space, and the operating system with write and read permissions for the shared storage space; the shared storage space can be in flash memory. After reading the target file location and size in the shared storage space, the dump component can perform a dump operation on the target file based on the read information.

[0059] Optionally, the operating system can write the target file location and target file size of the target dump file to the shared storage space, and replace the original file location and original file size stored in the shared storage space respectively.

[0060] Optionally, the target file location can be written to the first field of the shared storage space as a logical block address; the target file size can be written to the second field of the shared storage space. The first and second fields can be two UINT type fields, shm_dump_lba and shm_dump_size, set on the shared storage space.

[0061] Figure 3 This is a schematic diagram of the second process of a file dumping method provided in an embodiment of this application. The following is based on... Figure 3 This application further illustrates an exemplary flow of a file dumping method that includes steps following step S205. For example... Figure 3 As illustrated, step S205 may further include:

[0062] S301: If the operating system is detected to be in an abnormal state, the target file location and target file size are read from the shared storage space through the dump component.

[0063] Optionally, if an abnormal operating system is detected, or a dump request is detected, the target file location and target file size can be read from the shared storage space through the dump component.

[0064] S302: Read the target dump file based on the target file location and target file size using the dump component.

[0065] Optionally, the target dump file can be read by the dump component based on the target file location and target file size read by the dump component in step S301.

[0066] S303: Use the dump component to save the target dump file to the second target dump space.

[0067] Optionally, the second target dump file can be space in flash memory.

[0068] Optionally, after step 303, the method may further include: restarting the operating system; upon receiving a dump file export request, reading the target dump file of the second target dump space through the operating system.

[0069] Figure 4 This is a schematic diagram of the third process of a file dumping method provided in an embodiment of this application. The following is based on... Figure 4 This paper further illustrates an exemplary flow of a file dumping method according to an embodiment of the present application, which includes steps prior to step S201. For example... Figure 4 As illustrated, step S201 may also include:

[0070] S401: If a dump file creation request is received, determine the first original dump space from the system storage space based on the original file size.

[0071] Optionally, the dump file creation request may include the original file size of the original dump file.

[0072] In one optional implementation, a first remaining contiguous space can be determined from the system storage space; if the size of the first remaining contiguous space is greater than or equal to the original file size, the first remaining contiguous space is determined as the first original dump space; or; if the size of the first remaining contiguous space is less than the original file size, the system storage space is cleaned up to obtain updated system space; the size of the updated system space is greater than or equal to the original file size; the first original dump space is determined from the updated system space. Optionally, determining the first original storage space from the updated system space may include: determining a second remaining contiguous space from the updated system space; the size of the second remaining contiguous space is greater than or equal to the original file size; the second remaining contiguous space is determined as the first original dump space.

[0073] In an alternative implementation, step S401 can be executed when the terminal's operating system is first started.

[0074] S402: Create an original dump file in the first original dump space.

[0075] Optionally, an original dump file can be created in the first original dump space according to the original file size. The data blocks stored in the first original dump space can be contiguous.

[0076] Optionally, after step S402, the method may further include: writing the original file size and original file location of the original dump file into the shared storage space.

[0077] The file dumping method provided in this application allows for flexible adjustment of the dump space. When the dump file size is reduced, the dump space can be reduced to save storage space as much as possible while still meeting functional requirements. When the dump file size is increased, a larger dump space can be determined, satisfying the excessive dump file memory requirements without requiring a system-wide update or compression. Furthermore, the file dumping method provided in this application can update the dump file in a timely manner according to the needs of different testing scenarios, ensuring the collection of appropriate analytical data during test analysis and improving the efficiency of fault analysis.

[0078] Accordingly, this application also provides a file dumping device. Figure 5 This is a schematic diagram of a file dumping device provided in an embodiment of this application. Figure 5 As illustrated, the file dumping device 500 may include:

[0079] The deletion module 501 is used to receive a dump file update request corresponding to the target test task and delete the original dump file in the first original dump space; the dump file update request includes the target file size of the target dump file.

[0080] The creation module 502 is used to create a target dump file in the first original dump space if the target file size meets the first preset condition; or; if the target file size meets the second preset condition, determine the first target dump space from the system storage space based on the preset storage conditions; and create the target dump file in the first target dump space.

[0081] The write module 503 is used to write the target file location and target file size of the target dump file to the shared storage space via the operating system; the shared storage space is used for reading by the dump component.

[0082] Optionally, the device also includes a dump module, which, after writing the target file location and target file size of the target dump file to the shared storage space through the operating system: if an abnormal state of the operating system is detected, reads the target file location and target file size from the shared storage space through the dump component; reads the target dump file based on the target file location and target file size through the dump component; and stores the target dump file to the second target dump space.

[0083] Optionally, the apparatus further includes a raw module, configured to: upon receiving a dump file update request corresponding to the target test task and before deleting the original dump file in the first raw dump space, if a dump file creation request is received, the dump file creation request includes the original file size of the original dump file; determine the first raw dump space from the system storage space based on the original file size; and create the original dump file in the first raw dump space.

[0084] Optionally, the creation module 502 is used to: create a target dump file in the first original dump space if the target file size is less than or equal to the original file size of the original dump file; and determine the first target dump space from the system storage space based on the preset storage conditions if the target file size meets the second preset condition, including: determining the first target dump space from the system storage space based on the preset storage conditions if the target file size is greater than the original file size.

[0085] Optionally, the creation module 502 is further configured to: if the target file size is greater than the original file size, determine a first remaining contiguous space from the system storage space; if there exists a space with a first remaining contiguous space size greater than or equal to the target file size, determine the first remaining contiguous space as the first target dump space; or; if the space with a first remaining contiguous space size is less than the target file size, clean up the system storage space to obtain an updated system space; the space with an updated system space size greater than or equal to the target file size; determine the first target dump space from the updated system space.

[0086] Optionally, the creation module 502 is also used to: determine a second remaining contiguous space from the updated system space; the size of the second remaining contiguous space is greater than or equal to the size of the target file; and determine the second remaining contiguous space as the first target dump space.

[0087] Optionally, the write module 503 is used to: write the target file location, in the form of a logical block address, into the first field of the shared storage space; and write the target file size into the second field of the shared storage space.

[0088] The device and method embodiments provided in this application can be based on the same concept.

[0089] Accordingly, this disclosure also provides an electronic device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement the above-described file dumping method.

[0090] The methods and embodiments provided in this application can be executed on a computer terminal, server, or similar computing device. Taking running on a server as an example, Figure 6 This is a hardware structure block diagram of the server for the file dumping method provided in this application embodiment. For example... Figure 6 As shown, the server 600 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 610 (CPUs 610 may include, but are not limited to, microprocessors (MCUs) or programmable logic devices (FPGAs), a memory 630 for storing data, and one or more storage media 620 (e.g., one or more mass storage devices) for storing application programs 623 or data 622. The memory 630 and storage media 620 may be temporary or persistent storage. The program stored in the storage media 620 may include one or more modules, each module may include a series of instruction operations on the server. Furthermore, the CPU 610 may be configured to communicate with the storage media 620 and execute the series of instruction operations stored in the storage media 620 on the server 600. Server 600 may also include one or more power supplies 650, one or more wired or wireless network interfaces 650, one or more input / output interfaces 640, and / or one or more operating systems 621, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0091] The input / output interface 640 can be used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of server 600. In one example, the input / output interface 640 includes a network interface controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the input / output interface 640 may be a radio frequency (RF) module for wireless communication with the Internet.

[0092] Those skilled in the art will understand that Figure 6The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, server 600 may also include... Figure 6 The more or fewer components shown, or having the same Figure 6 The different configurations shown.

[0093] This application provides a storage medium that can be located in a server to store at least one instruction, at least one program, code set, or instruction set related to implementing the file dumping method in the method embodiment. The at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the above-described file dumping method.

[0094] Optionally, in this embodiment, the storage medium may be located at at least one of the multiple network servers in a computer network. Alternatively, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), portable hard drives, magnetic disks, or optical disks.

[0095] In this invention, unless otherwise explicitly specified and limited, the terms "connected" and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the connection within two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0096] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, while this specification describes specific embodiments, other embodiments are also within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in the order shown in different embodiments and still achieve the desired results. Additionally, the processes depicted in the drawings do not necessarily require a specific order or sequence of connections to achieve the desired results; in some implementations, parallel processing of multiple tasks is possible or may be advantageous.

[0097] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of the apparatus / system are relatively simple in description because they are based on similarity to the method embodiments; relevant parts can be referred to the descriptions of the method embodiments.

[0098] The above are preferred embodiments of the present invention. It should be noted that, for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A file dumping method, characterized in that, The method includes: Upon receiving a dump file update request corresponding to the target test task, delete the original dump file in the first original dump space; the dump file update request includes the target file size of the target dump file; If the target file size meets a first preset condition, a target dump file is created in the first original dump space; if the target file size meets a second preset condition, a first target dump space is determined from the system storage space based on preset storage conditions; a target dump file is created in the first target dump space; wherein, the system storage space is the operating system's running memory space; The operating system writes the target file location and target file size of the target dump file into the shared storage space; the shared storage space is used for reading by the dump component. If the operating system is detected to be in an abnormal state, the location and size of the target file are read from the shared storage space through the dump component; The target dump file is read using the dump component based on the target file location and the target file size. The target dump file is stored in the second target dump space using the dump component.

2. The file dumping method according to claim 1, characterized in that, Before deleting the original dump file in the first original dump space if a dump file update request is received, the method further includes: If a dump file creation request is received, the first original dump space is determined from the system storage space based on the original file size; the dump file creation request includes the original file size of the original dump file; The original dump file is created in the first original dump space.

3. A file dumping method according to claim 1, characterized in that, If the target file size meets the first preset condition, creating a target dump file in the first original dump space includes: If the size of the target file is less than or equal to the original file size of the original dump file, the target dump file is created in the first original dump space; If the target file size meets the second preset condition, determining the first target dump space from the system storage space based on preset storage conditions includes: If the target file size is larger than the original file size, the first target dump space is determined from the system storage space based on preset storage conditions.

4. The file dumping method according to claim 3, characterized in that, If the target file size is larger than the original file size, determining the first target dump space from the system storage space based on preset storage conditions includes: If the target file size is larger than the original file size, a first remaining contiguous space is determined from the system storage space; If there exists a space in the first remaining contiguous space that is greater than or equal to the target file size, the first remaining contiguous space is determined as the first target dump space; or; If the size of the first remaining contiguous space is less than the size of the target file, the system storage space is cleaned up to obtain updated system space; the size of the updated system space is greater than or equal to the size of the target file. The first target dump space is determined from the updated system space.

5. The file dumping method according to claim 4, characterized in that, Determining the first target dump space from the updated system space includes: A second remaining contiguous space is determined from the updated system space; the size of the second remaining contiguous space is greater than or equal to the size of the target file. The second remaining continuous space is determined as the first target dump space.

6. The file dumping method according to claim 1, characterized in that, The step of writing the target file location and target file size of the target dump file into the shared storage space via the operating system includes: The target file location is written into the first field of the shared storage space in the form of a logical block address; Write the target file size into the second field of the shared storage space.

7. A file dumping device, characterized in that, The device includes: The deletion module is used to receive a dump file update request corresponding to the target test task and delete the original dump file in the first original dump space; the dump file update request includes the target file size of the target dump file; A creation module is configured to: if the target file size meets a first preset condition, create a target dump file in the first original dump space; if the target file size meets a second preset condition, determine a first target dump space from the system storage space based on preset storage conditions; and create a target dump file in the first target dump space; wherein the system storage space is the operating system's runtime memory space. The writing module is used to write the target file location and target file size of the target dump file to the shared storage space through the operating system; the shared storage space is used to be read by the dump component, which reads the target file location and target file size in the shared storage space and performs a dump operation on the target dump file based on the read information; The dump module is used to: after the target file location and target file size of the target dump file are written to the shared storage space by the operating system; if the operating system is detected to be in an abnormal state, read the target file location and target file size from the shared storage space through the dump component; read the target dump file based on the target file location and target file size through the dump component; and store the target dump file to the second target dump space.

8. An electronic device, characterized in that, The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement a file dumping method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The storage medium stores at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or instruction set is loaded and executed by a processor to implement a file dumping method according to any one of claims 1-6.

Citation Information

Patent Citations

  • File storage method and apparatus

    CN105740425A

  • Method for Automatic Dump Assurance

    US20080209264A1