CN117130541A - Storage space configuration method and related equipment - Google Patents

Storage space configuration method and related equipment Download PDF

Info

Publication number
CN117130541A
CN117130541A CN202310247836.0A CN202310247836A CN117130541A CN 117130541 A CN117130541 A CN 117130541A CN 202310247836 A CN202310247836 A CN 202310247836A CN 117130541 A CN117130541 A CN 117130541A
Authority
CN
China
Prior art keywords
partition
storage
determining
reserved
memory
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
CN202310247836.0A
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.)
Honor Device Co Ltd
Original Assignee
Honor Device 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 Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310247836.0A priority Critical patent/CN117130541A/en
Publication of CN117130541A publication Critical patent/CN117130541A/en
Pending legal-status Critical Current

Links

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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of 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/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/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Abstract

The application provides a storage space configuration method and related equipment, wherein the method comprises the following steps: when the electronic equipment is started to mount a file system, acquiring a first storage capacity of an operation memory of the electronic equipment; determining a second storage capacity of a storage device reserved partition to be allocated to the electronic device based on the first storage capacity, and determining an address range of the reserved partition; and distributing the storage space corresponding to the address range in the storage device to a reserved partition, wherein the reserved partition is used for storing the complete memory data. The application can adapt to memories with different storage capacities, avoid wasting storage space, ensure normal execution of the transfer of full memory data and repair the faults of intelligent terminal equipment in time.

Description

Storage space configuration method and related equipment
Technical Field
The present application relates to the field of intelligent terminals, and in particular, to a storage space configuration method and related devices.
Background
When the intelligent terminal equipment such as a smart phone, a personal computer and the like fails, in order to analyze the failure cause and failure positioning, the complete memory data are acquired and transferred to the storage equipment. In order to ensure that the full memory data can be successfully transferred to the storage device, the storage device generally needs to reserve a storage space for storing the full memory data, and since the transfer scheme needs to adapt to memories with different storage capacities, the storage capacity of the reserved storage space is set to be the maximum storage capacity of the memory. However, if the actual storage capacity of the memory is smaller than the storage capacity of the reserved storage space, the storage space of the storage device is wasted, and if the storage capacity of the newly designed memory is larger than the storage capacity of the reserved storage space, the transfer scheme cannot be adapted to the newly designed memory. Therefore, the existing complete memory data transfer scheme cannot dynamically adapt to memories with different storage capacities, so that waste of storage space is easily caused, or transfer of complete memory data cannot be normally executed, so that faults of intelligent terminal equipment cannot be repaired in time, and use experience of users is affected.
Disclosure of Invention
In view of the foregoing, it is necessary to provide a storage space configuration method and related devices, so as to solve the problem that a complete memory data transfer scheme cannot dynamically adapt to memories with different storage capacities, which is easy to cause waste of storage space, or cannot normally execute transfer of complete memory data, so that failure of an intelligent terminal device cannot be repaired in time.
In a first aspect, the present application provides a storage space configuration method, applied to an electronic device, where the method includes: when the electronic equipment is started to mount a file system, acquiring a first storage capacity of an operation memory of the electronic equipment; determining a second storage capacity of a storage device reserved partition to be allocated to the electronic device based on the first storage capacity, and determining an address range of the reserved partition; and distributing the storage space corresponding to the address range in the storage device to the reserved partition, wherein the reserved partition is used for storing the complete memory data.
Based on the scheme, the partition for storing the full memory data in the storage device can be dynamically reserved based on the running memory capacity of the electronic device, so that the transfer scheme of the full memory data can be adapted to different running memory specifications, the waste of the storage space is avoided, the transfer of the full memory data can be ensured to be normally executed, the fault of the intelligent terminal device can be timely repaired, and the user experience is effectively improved.
In one possible implementation, the determining, based on the first storage capacity, a second storage capacity of a reserved partition of a storage device to be allocated to the electronic device includes: determining that the second storage capacity to be allocated to the reserved partition is the same as the first storage capacity.
Based on the scheme, the second storage capacity to be allocated to the reserved partition is determined to be the same as the first storage capacity, so that the normal execution of the transfer of the full memory data can be ensured, and the fault of the intelligent terminal equipment can be repaired in time.
In one possible implementation, the determining, based on the first storage capacity, a second storage capacity of a reserved partition of a storage device to be allocated to the electronic device includes: and determining the second storage capacity to be allocated to the reserved partition as the sum of the first storage capacity and a preset storage capacity.
Based on the scheme, the second storage capacity to be allocated to the reserved partition is determined to be the sum of the first storage capacity and the preset storage capacity, so that the reserved partition can have a redundant space, and other running state information of the electronic equipment can be stored besides the storage of the complete memory data, and the fault repairing efficiency of the electronic equipment is improved.
In one possible implementation, the determining the address range of the reserved partition includes: determining a starting address of the reserved partition in the storage device based on the second storage capacity and an end address of the storage device, and determining the address range to be from the starting address of the reserved partition to the end address of the storage device.
Based on the scheme, the reserved partition is arranged at the tail end of the storage device, so that the influence of the transfer of the full memory data on the reading of the user data and the system data originally stored in the storage device can be effectively avoided.
In one possible implementation manner, the allocating the storage space corresponding to the address range in the storage device to the reserved partition includes: executing a mounting command on a data partition outside the address range in the storage equipment, and mounting the data partition to the file system; and reserving the bare partition of the second storage capacity as the reserved partition at the end of the storage device to store full memory data.
Based on the scheme, the bare partition with the second storage capacity is reserved at the tail end of the storage device and used as the reserved partition to store the full memory data, so that the normal execution of the transfer of the full memory data can be ensured, the fault can be modified in time, meanwhile, the influence of the transfer of the full memory data on the reading of the user data and the system data originally stored in the storage device is effectively avoided, and the use experience of a user is ensured.
In one possible implementation, the method further includes: judging whether the storage device performs partition reservation or not when the electronic device is started to execute kernel loading or initialization process loading; and if the storage device performs partition reservation, acquiring the first storage capacity of the running memory when the electronic device mounts the file system.
Based on the scheme, the partition reservation and the partition reservation of the running memory specification are performed only when the storage device executes the partition reservation, so that the partition reservation and the complete memory data transfer scheme of the embodiment of the application can adapt to the requirements of users.
In one possible implementation, the storage device includes an original dump data partition for storing a full memory data control information structure including a storage capacity of the running memory, a storage capacity of the reserved partition, an address range of the reserved partition in the storage device, and a reservation flag.
Based on the scheme, the control information of the full memory data transfer is stored in the original transfer data partition, so that the full memory data transfer scheme provided by the embodiment of the application can be suitable for electronic equipment of different systems or brands.
In one possible implementation manner, the determining whether the storage device performs partition reservation includes: when the electronic equipment is started to execute kernel loading or initializing process loading, acquiring the reserved mark from the complete memory data control information structure body of the original dump data partition and determining the value of the reserved mark; if the reservation mark is 0, determining that the storage device does not execute partition reservation; or if the reservation mark is 1, determining that the storage device executes partition reservation.
Based on the scheme, whether the electronic device performs partition reservation can be quickly and conveniently determined by storing the reservation mark in the complete memory data control information structure body of the original transferred data partition.
In one possible implementation manner, the determining whether the storage device performs partition reservation further includes: when the electronic equipment is started to execute kernel loading or initializing process loading, acquiring a system version of the electronic equipment, and if the system version is a test version, determining that the storage equipment executes partition reservation; if the partition reservation execution is successful, updating the reservation mark to 1; if the partition reservation execution fails, updating the reservation mark to 0; and if the system version is a commercial version, determining that the storage device does not execute partition reservation.
Based on the scheme, whether the electronic equipment performs partition reservation or not can be automatically determined by determining the system version type of the electronic equipment, and the accuracy of the judgment result of the partition reservation is ensured.
In one possible implementation, the method further includes: in the stage of starting up the electronic equipment to execute the boot loading, judging whether a complete transfer function is started or not; if the complete transfer function is started, judging whether the storage device performs partition reservation when the electronic device performs kernel loading or initializing process loading.
Based on the scheme, when the complete memory data transfer function is judged to be started in the boot execution boot loading stage of the electronic equipment, whether the partition reservation is carried out or not is judged, so that the complete memory data transfer scheme provided by the embodiment of the application can determine whether to start or not based on the preset mark, and the complete memory data transfer function meets the requirements of users.
In one possible implementation manner, the full memory data control information structure further includes an enable flag, and the determining whether the full memory transfer function is turned on includes: in the stage of starting up the electronic equipment to execute boot loading, acquiring an enabling mark from the full memory data control information structure body of the original dump data partition and determining the value of the enabling mark; if the enabling mark is 0, determining that the complete transfer function is not started, determining that partition reservation is not executed, and failing to execute partition reservation; or if the enabling mark is 1, determining that the complete transfer function is started, and executing partition reservation.
Based on the scheme, whether the complete transfer function of the electronic equipment is started or not can be quickly and conveniently determined by storing the enabling mark in the complete memory data control information structure body of the original transfer data partition.
In one possible implementation manner, the determining whether the complete transfer function is turned on further includes: if the enabling flag is 0, determining that the complete transfer function is not started, starting the complete transfer function, and updating the enabling flag to be 1.
Based on the scheme, when the complete transfer function is not started, the complete transfer function is started and the enabling mark is updated, so that the complete transfer function is started in time, and transfer of the complete memory data is performed.
In one possible implementation, the method further includes: and when the electronic equipment fails, acquiring the complete memory data, and transferring the complete memory data to the reserved partition.
Based on the scheme, through transferring the complete memory data to the reserved partition when the electronic equipment fails, the complete memory data can be conveniently recovered and timely used for failure analysis of the electronic equipment.
In one possible implementation, the acquiring the full memory data and the transferring the full memory data to the reserved partition includes: when the electronic equipment generates faults, loading an operation fault processing system; acquiring state information of the running memory through a fault processing system, and generating a log based on the state information of the running content to obtain the complete memory data; and acquiring the address range of the reserved partition in the storage device from the complete memory data control information structure body of the original transfer data partition, addressing the complete memory data to the reserved partition based on the address range of the reserved partition.
Based on the scheme, the transfer efficiency of the full memory data can be improved by acquiring the reserved partition information from the full memory data control information structure body.
In one possible implementation manner, the acquiring the full memory data and the transferring the full memory data to the reserved partition further includes: and acquiring the current address range of the reserved partition from the original dump data partition, and if the first storage capacity is smaller than or equal to the storage capacity of a storage space corresponding to the current address range of the reserved partition, addressing based on the current address range of the reserved partition, and dumping the complete memory data to the reserved partition.
Based on the scheme, when the first storage capacity is determined to be smaller than or equal to the storage capacity of the storage space corresponding to the current address range of the reserved partition, the full memory data is transferred, and the full memory data can be ensured to be successfully transferred.
In a second aspect, the present application provides an electronic device comprising a memory and a processor: wherein the memory is used for storing program instructions; the processor is configured to read and execute the program instructions stored in the memory, and when the program instructions are executed by the processor, cause the electronic device to execute the storage space configuration method described above.
In a third aspect, the present application provides a chip coupled to a memory in an electronic device, where the chip is configured to control the electronic device to perform the above-described memory space configuration method.
In a fourth aspect, the present application provides a computer storage medium storing program instructions that, when executed on an electronic device, cause the electronic device to perform the storage space configuration method described above.
In addition, the technical effects of the second aspect to the fourth aspect may be referred to in the description related to the method designed in the method section, and are not repeated here.
Drawings
FIG. 1A is a schematic diagram of a running memory and storage device according to an embodiment of the present application.
FIG. 1B is another schematic diagram of a running memory and storage device according to one embodiment of the present application.
Fig. 2 is a software architecture diagram of an electronic device according to an embodiment of the present application.
Fig. 3 is a flowchart of a storage space configuration method according to an embodiment of the present application.
Fig. 4 is a block diagram of a storage space configuration method according to an embodiment of the present application.
Fig. 5 is a flowchart of a storage space configuration method according to another embodiment of the present application.
Fig. 6 is a block diagram of a storage space configuration method according to another embodiment of the present application.
Fig. 7 is a flowchart of a storage space configuration method according to another embodiment of the present application.
Fig. 8 is a block diagram of a storage space configuration method according to another embodiment of the present application.
Fig. 9 is a flowchart of a storage space configuration method according to another embodiment of the present application.
Fig. 10 is a block diagram of a storage space configuration method according to another embodiment of the present application.
Fig. 11 is a flowchart of a storage space configuration method according to another embodiment of the present application.
Fig. 12 is a hardware architecture diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The terms "first" and "second" in the embodiments of the present application are used 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 defining "a first" or "a second" may explicitly or implicitly include one or more such feature. In describing embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It is to be understood that, unless otherwise indicated, a "/" means or. For example, A/B may represent A or B. The "and/or" in the present application is merely one association relationship describing the association object, indicating that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist simultaneously, and B exists alone. "at least one" means one or more. "plurality" means two or more than two. For example, at least one of a, b or c may represent: seven cases of a, b, c, a and b, a and c, b and c, a, b and c.
The following embodiments and features of the embodiments may be combined with each other without conflict.
When a complete machine failure occurs in an intelligent terminal device, such as a smart phone, a personal computer, etc., in order to analyze the failure cause and locate the failure, a Dump flow is executed, including: and loading a fault processing system, and acquiring and storing dump data (namely fault diagnosis data), wherein the dump data comprises memory RAM data, the full memory data is Fulldump data, and the Fulldump data can be Fulldump logs and comprise complete memory information. In the Dump flow, there are two data saving paths, the first one is not to automatically save Dump data, and other electronic devices such as a computer end need to save the Dump data by using a QPST (Qualcomm Product Support Tool, transmission software developed for a high-pass chip) tool, so that the Dump data cannot be saved in time due to the precondition that the Dump data is saved in full memory; the second type of method automatically transfers the Fulldump data to a rawdump (original transfer data) partition of the physical storage device, so that the usable storage space of the physical storage device is reduced, and the Fulldump data cannot be recovered conveniently and cannot meet the user requirements of the test device. In addition, the analysis of the overall stability problem of the intelligent terminal device is strongly dependent on the Fulldump log, so that a Fulldump transfer scheme is provided for the problem that the Fulldump log cannot be conveniently extracted and the pain point of the user use requirement is tested.
The Fulldump transfer scheme reserves a fixed size of storage space at the tail of a data partition available to a user of the physical storage device, for storing the Fulldump log. The Fulldump transfer scheme can be applied to terminal devices with different memory capacity specifications of Double Data Rate (DDR) devices. The Fulldump transfer scheme is terminal equipment adapting to memory capacity specifications of different DDR devices, meets the memory capacity specification of the maximum DDR device of the terminal equipment at the moment, is designed to be downward compatible, and the reserved memory space is the memory capacity of the maximum DDR device of the terminal equipment. However, the Fulldump transfer scheme thus designed has the following problems: for terminal equipment with the memory capacity specification of the DDR device smaller than the preset maximum capacity specification, a large amount of storage space on the physical storage equipment is wasted, so that available data partitions of users are reduced, the scheme is not applicable, and resources are wasted to influence user experience; the Fulldump transfer scheme starts to preset the possible maximum DDR device memory capacity specification, and because the preset memory capacity specification is static and invariable, if the new DDR device memory capacity specification is designed by a new product and exceeds the preset memory capacity specification, the scheme adaptation problem will be caused, the Fulldump transfer scheme is invalid, so that the fault of the intelligent terminal device cannot be repaired in time, and the use experience of the user is affected.
In order to reduce repeated manpower work in the adapting process of the Fulldump transfer scheme and compatibility and resource waste problems existing in the scheme, the embodiment of the application provides a storage space configuration method, which can adapt memories with different storage capacities, avoid the waste of storage space, ensure normal execution of transfer of complete memory data and timely repair faults of intelligent terminal equipment. For details of the storage space configuration method, reference may be made to the descriptions in the various embodiments below.
In order to better understand the storage space configuration method provided by the embodiment of the present application, an application scenario of the storage space configuration method provided by the embodiment of the present application is described below with reference to fig. 1A and fig. 1B.
Referring to fig. 1A, the storage device of the terminal device is a universal flash memory (Universal Flash Storage, UFS), and the storage capacity of the storage device is 128G. If the preset maximum memory capacity of the DDR device is 12G, the capacity of the reserved memory space for storing Fulldump data of the memory device is 12G. If the DDR device memory capacity is 4G, the DDR device memory capacity is smaller than the preset maximum memory capacity and the reserved memory space capacity of the memory device. When the terminal equipment fails, the capacity of the Fulldump data is 4G, after the Fulldump data is transferred to the reserved storage space of the storage equipment, the reserved storage space still has the free storage space with the capacity of 8G, and the free storage space can not store other data, so that the storage space with the capacity of 8G of the storage equipment is wasted.
Referring to fig. 1B, the storage device of the terminal device is a general flash memory, and the storage capacity of the storage device is 128G. If the preset maximum memory capacity of the DDR device is 12G, the capacity of the reserved memory space for storing Fulldump data of the memory device is 12G. If the memory capacity of the new DDR device designed by the new product is 16G, the memory capacity of the new DDR device is larger than the preset maximum memory capacity and the reserved memory space of the memory device. When the terminal equipment fails, the Fulldump data capacity is 16G, and exceeds the capacity of the reserved storage space, so that the terminal equipment cannot be repaired in time, and the use experience of a user is affected.
Fig. 2 is a software architecture diagram of an electronic device according to an embodiment of the present application. The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. For example, the Android system is divided into four layers, namely, an application layer 101, a framework layer 102, an Android runtime (Android run) and system library 103, a hardware abstraction layer 104 and a kernel layer 105 from top to bottom.
The application layer may include a series of application packages. For example, the application package may include applications for cameras, gallery, calendar, phone calls, maps, navigation, WLAN, bluetooth, music, video, short messages, device control services, etc.
The framework layer provides an application programming interface (Application Programming Interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
Wherein the window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like. The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture. The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.). The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like. The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system. The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the framework layer run in virtual machines. The virtual machine executes java files of the application program layer and the framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. Such as surface manager (surface manager), media library (Media Libraries), three-dimensional graphics processing library (e.g., openGL ES), 2D graphics engine (e.g., SGL), etc.
The surface manager is used for managing the display subsystem and providing fusion of 2D and 3D layers for a plurality of application programs. Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The hardware abstraction layer runs in the user space, encapsulates the kernel layer driver and provides a calling interface for the upper layer.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
The kernel layer is the core of the operating system of the electronic device, is the first layer of software expansion based on hardware, provides the most basic function of the operating system, is the basis of the operating system, is responsible for managing the processes, the memory, the device driver, the files and the network system of the system, and determines the performance and the stability of the system. For example, the kernel may determine the time an application is operating on a certain portion of hardware.
The kernel layer includes hardware-closely related programs, such as interrupt handlers, device drivers, etc., basic, common, higher frequency of operation modules, such as clock management modules, process scheduling modules, etc., and critical data structures. The kernel layer may be provided in the processor or cured in an internal memory.
Referring to fig. 3, a flowchart of a storage space configuration method according to an embodiment of the application is shown. The method is applied to the electronic equipment, and the storage space configuration method comprises the following steps:
S101, when the electronic equipment is started to mount a file system, acquiring a first storage capacity of an operation memory of the electronic equipment.
Referring to fig. 4, in an embodiment of the present application, a storage device of an electronic device is mounted on a file system during a kernel (kernel) loading stage or an Init (Initialization) process loading stage of a first boot process of the electronic device. Before the storage device is mounted, a first storage capacity of a running memory of the electronic device is obtained. In one embodiment, the first storage capacity of the running memory may be 6G. In other embodiments, the first storage capacity may be set to other values as desired. The running memory is a random access memory (Random Access Memory, RAM), specifically, a Double Data Rate (DDR) device, such as a DDR SDRAM (Synchronous Dynamic Random Access Memory ). The storage device is a Read-Only Memory (ROM), for example, a general-purpose flash Memory, a hard disk, or the like.
In an embodiment of the present application, a kernel loading stage of a boot process of the electronic device is used for loading a hardware device driver and initializing process management, and an Init process loading stage is used for initializing a first process of the electronic device, mounting a file system, and executing an Init. Rc configuration file.
S102, determining a second storage capacity of a reserved partition to be allocated to the storage device based on the first storage capacity, and determining an address range of the reserved partition.
In an embodiment of the present application, the reserved partition of the storage device is used to store a fault diagnosis file, which may be full memory data (Fulldump data), such as a Fulldump log. The full memory data includes all memory information during process operation, and the memory information includes stack information, register information, etc. of the operation memory, so that the capacity of the full memory data is the same as the first storage capacity of the operation memory.
In one embodiment of the application, determining a second storage capacity of a reserved partition to be allocated to a storage device based on a first storage capacity comprises: the second storage capacity of the reserved partition to be allocated to the storage device is determined to be the same as the first storage capacity. At this time, the full memory data includes all register data of the running memory.
In another embodiment of the present application, determining a second storage capacity of a reserved partition to be allocated to a storage device based on a first storage capacity comprises: the second storage capacity of the reserved partition to be allocated to the storage device is determined as the sum of the first storage capacity and the preset storage capacity. At this time, the full memory data includes all register data of the running memory and data of the on-chip memory, and the on-chip memory is disposed on the processor. In an embodiment of the present application, the preset storage capacity is 0.5G, and in other embodiments of the present application, the preset storage capacity may be set to other values according to the requirement.
In one embodiment of the present application, determining the address range of the reserved partition includes: and determining the starting address of the reserved partition in the storage device based on the second storage capacity and the end address of the storage device, and determining the address range of the reserved partition from the starting address of the reserved partition to the end address of the storage device, wherein the capacity of a storage space between the starting address of the reserved partition and the end address of the storage device is the second storage capacity.
S103, distributing the storage space corresponding to the address range in the storage device to the reserved partition.
In an embodiment of the present application, allocating a storage space corresponding to an address range in a storage device to a reserved partition includes: and executing a mount command on the data partition outside the address range in the storage device to mount to the file system, and reserving a bare partition with the second storage capacity at the end of the storage device as a reserved partition to store the full memory data.
When the original Fulldump transfer scheme reallocates the data partition according to the given static partition space size during the first startup process after the startup and the factory setting recovery process, the storage space configuration method in the above embodiment is to solve the foregoing problem, that is, the dynamic reservation method increases the specification information reading flow of the running memory, recalculates the reserved partition space size data to be actually allocated according to the read specification information, performs partition reservation according to the dynamically acquired space size data, and saves the specification information (storage capacity) of the running memory of the current electronic device in the Fulldump control information structure of the rawdump partition in addition to the information such as the original bare partition address and partition size after the reservation is successful, and falls on the storage device.
Referring to fig. 5, a flowchart of a storage space configuration method according to another embodiment of the application is shown. The method is applied to the electronic equipment, and the storage space configuration method comprises the following steps:
s201, when the electronic device is started to execute kernel loading or initializing process loading, whether the storage device of the electronic device executes partition reservation is judged.
Referring to fig. 6, in an embodiment of the present application, the storage device includes a raw dump partition for storing a full memory data control information structure, which is a metadata structure for storing metadata. The metadata stored by the full memory data control information structure includes, but is not limited to, the storage capacity of the running memory, the storage capacity of the reserved partition, the address range of the reserved partition in the storage device, and the reservation label. The value of the reservation flag is 0 or 1, if the reservation flag is 0, it indicates that the storage device does not execute partition reservation, and if the reservation flag is 1, it indicates that the storage device executes partition reservation.
In an embodiment of the present application, when the electronic device is first powered on to perform kernel loading or initializing process loading, it is determined whether a storage device of the electronic device performs partition reservation. Determining whether to perform partition reservation includes: when the electronic equipment starts up to execute kernel loading or initializing process loading, acquiring a reservation mark from an original transfer data partition, determining the value of the reservation mark, determining that the storage equipment does not execute partition reservation if the reservation mark is 0, and determining that the storage equipment executes partition reservation if the reservation mark is 1.
In another embodiment of the present application, determining whether to perform partition reservation includes: when the electronic equipment is started to execute kernel loading or initializing process loading, a system version of the electronic equipment is obtained, if the system version is a test version, partition reservation is determined to be executed, if partition reservation execution is successful, a reservation mark is updated to 1, if partition reservation execution fails, the reservation mark is updated to 0, and if the system version is a commercial version, partition reservation is determined not to be executed.
S202, if the storage device performs partition reservation, when the electronic device mounts a file system, a first storage capacity of an operation memory of the electronic device is obtained.
S203, determining a second storage capacity of the reserved partition to be allocated to the storage device based on the first storage capacity, and determining an address range of the reserved partition.
S204, the storage space corresponding to the address range in the storage device is distributed to the reserved partition.
The specific embodiments of S202-S204 are the same as the specific embodiments of S101-S103, and are not described here.
Referring to fig. 7, a flowchart of a storage space configuration method according to another embodiment of the application is shown. The method is applied to the electronic equipment, and the storage space configuration method comprises the following steps:
S301, in the stage of starting the electronic equipment to execute the boot loading, judging whether a complete transfer function of the electronic equipment is started.
Referring to FIG. 8, in one embodiment of the present application, the metadata stored by the full memory data control information structure includes, but is not limited to, the storage capacity of the running memory, the storage capacity of the reserved partition, the address range of the reserved partition in the storage device, the enable flag, and the reservation flag. The value of the enable flag is 0 or 1, if the enable flag is 0, it indicates that the full transfer function of the electronic device is not turned on, and if the enable flag is 1, it indicates that the full transfer function of the electronic device is turned on.
In an embodiment of the present application, during a first boot execution boot loading phase of the electronic device, it is determined whether a full dump function is turned on. Judging whether the complete transfer function is started or not includes: and in the stage of boot execution and boot loading of the electronic equipment, acquiring an enabling mark from the original transfer data partition, determining the value of the enabling mark, if the enabling mark is 0, determining that the complete transfer function of the electronic equipment is not started, determining that partition reservation is not executed, determining that partition reservation execution fails, and if the enabling mark is 1, determining that the complete transfer function of the electronic equipment is started, and determining that partition reservation is executed.
In another embodiment of the present application, determining whether the full dump function is on includes: in the boot execution and boot loading stage of the electronic equipment, acquiring an enabling mark from an original transfer data partition, determining the value of the enabling mark, if the enabling mark is 0, determining that a complete transfer function of the electronic equipment is not started, starting the complete transfer function, updating the enabling mark to be 1, and executing partition reservation; if the enabling mark is 1, determining that the complete transfer function of the electronic equipment is started, and determining to execute partition reservation. In the further embodiment of the application, the full spool function of the electronic device is enabled or disabled and the enable flag is updated by an application bootloader (Unified Extensible Firmware Interface-Application bootloader, UEFI-ABL) of the unified programmable firmware interface.
In an embodiment of the present application, in a boot execution boot loading phase of the electronic device, the boot loader is used to boot the operating system to start, initialize the hardware device, create a mapping of the storage space of the storage device, load the kernel file, and so on.
S302, if the complete transfer function of the electronic device is started, when the electronic device executes kernel loading or initializing process loading, judging whether the storage device of the electronic device executes partition reservation.
S303, if the storage device performs partition reservation, when the electronic device mounts the file system, a first storage capacity of an operation memory of the electronic device is obtained.
S304, determining a second storage capacity of the reserved partition to be allocated to the storage device based on the first storage capacity, and determining an address range of the reserved partition.
S305, distributing the storage space corresponding to the address range in the storage device to the reserved partition.
The specific embodiments of S302-S305 are the same as the specific embodiments of S201-S204, and are not described here.
In the above embodiment, the electronic device boot process includes a bootloader stage and a kernel stage, the kernel mirror image is loaded and executed through the bootloader boot stage, in order to ensure that the Fulldump transfer function can be controlled between different platforms, and in the bootloader stage, a scheme enabling control logic is added to determine whether to start the Fulldump transfer function on the current platform by updating an enabling flag stored on the storage device.
After bootloader guiding is completed, a kernel stage is entered, a file system is mounted in the first starting process of the device, at this time, partition division is performed on the storage device for different file systems, when a Fulldump transfer scheme is used for mounting a data partition (F2 fs file system), a space with a fixed size at the tail is reserved, the file system mounting is not performed, the space is used as a bare partition, and meanwhile, information such as the address of the bare partition, the partition size and the like is stored in a complete memory data control information structure of the rawdump.
Referring to fig. 9, a flowchart of a storage space configuration method according to another embodiment of the application is shown. The method is applied to the electronic equipment, and the storage space configuration method comprises the following steps:
s401, in the stage of starting the electronic equipment to execute the boot loading, judging whether the complete transfer function is started.
S402, if the complete transfer function of the electronic device is started, when the electronic device executes kernel loading or initializing process loading, judging whether the storage device of the electronic device executes partition reservation.
S403, if the storage device performs partition reservation, when the electronic device mounts the file system, a first storage capacity of an operation memory of the electronic device is obtained.
S404, determining a second storage capacity of the reserved partition to be allocated to the storage device based on the first storage capacity, and determining an address range of the reserved partition.
S405, the storage space corresponding to the address range in the storage device is allocated to the reserved partition.
S406, when the electronic equipment fails, acquiring the complete memory data, and transferring the complete memory data to the reserved partition.
Referring to fig. 10, in an embodiment of the present application, when an electronic device fails, acquiring full memory data includes: when the electronic equipment generates faults which cannot be processed by the kernel, such as blue screen, dead halt, automatic restarting and the like, the electronic equipment triggers kernel errors (kernel errors), loads an operation fault processing system, acquires state information of the whole operation memory, and generates a log based on the state information of the whole operation content to obtain complete memory data. In one embodiment of the present application, the state information of the running memory includes stack and register information of the running memory.
In one embodiment of the present application, the transferring of the full memory data to the reserved partition includes: and acquiring an address range of the reserved partition in the storage device from the full memory data control information structure body of the original transfer data partition, addressing based on the address range, transferring the full memory data to the reserved partition, and restarting the electronic device.
In an embodiment of the present application, the transferring the full memory data to the reserved partition further includes: judging whether the full memory data transfer function is started, if the full memory data transfer function is started, acquiring the address range of the reserved partition in the storage device from the full memory data control information structure body of the original transfer data partition, addressing based on the address range of the reserved partition, transferring the full memory data to the reserved partition, and restarting the electronic device.
In another embodiment of the present application, when the electronic device fails, acquiring the full memory data and transferring the full memory data to the reserved partition further includes: if the full memory data transfer function is started, acquiring the current address range of the reserved partition from the original transfer data partition, judging whether the first storage capacity is smaller than or equal to the storage capacity of a storage space corresponding to the current address range of the reserved partition, if the first storage capacity is smaller than or equal to the storage capacity of the storage space corresponding to the current address range of the reserved partition, addressing based on the current address range of the reserved partition, transferring the full memory data to the reserved partition, and restarting the electronic equipment; and if the first storage capacity of the running memory is larger than the storage capacity of the storage space corresponding to the current address range of the reserved partition, discarding the dump full memory data.
In the other embodiment of the present application, by determining whether the first storage capacity is smaller than or equal to the storage capacity of the storage space corresponding to the current address range of the reserved partition, it may be determined whether the starting address of the reserved partition in the storage device is bit hopped, so that the storage capacity of the reserved partition is smaller than the first storage capacity of the running memory, and if the storage capacity of the reserved partition is smaller than the first storage capacity of the running memory, it indicates that the reserved partition cannot store the full memory data, thereby discarding the transferring full memory data.
The specific embodiments of S401 to S405 are the same as those of S301 to S305, and will not be described here again.
In the above embodiment, when the kernel of the whole electronic device fails to process the fault in the running state, the panic is triggered, and the whole electronic device enters the fault processing system to perform log grabbing, so as to save the complete memory state when the fault occurs. Based on the Fulldump transfer function, judging whether to start Fulldump log transfer through the mark state information stored on the full memory data control information structure body of the rawdump partition, if so, extracting the Fulldump log according to the bare partition information (the second storage capacity and the address range of the reserved partition) stored during partition division, addressing and storing the Fulldump log according to the provided bare partition information, and restarting the machine after transfer is completed.
When the whole machine of the equipment fails, entering a Dump processing logic, reading a metadata structure body stored on a rawdump partition of the storage equipment, acquiring current equipment state information, transmitting acquired data into a preprocessing module, judging whether the current equipment has transfer capacity or not by the preprocessing module, performing boundary inspection according to running memory information and reserved partition information in order to ensure that the data transfer does not damage other file system data, and performing Fulldump transfer according to the reserved partition information after the boundary inspection passes.
Referring to fig. 11, a flowchart of a storage space configuration method according to another embodiment of the application is shown. The method is applied to the electronic equipment, and the storage space configuration method comprises the following steps:
s501, executing a Resizer F2fs command and entering partition reservation processing logic.
S502, executing an IsneedleReserve DataForResize command, executing Fulldump reservation logic, and judging whether partition reservation is needed. If partition reservation is needed, the flow proceeds to S503; if partition reservation is not required, the flow proceeds to S508.
S503, executing the GetDDRInfo command to acquire DDR device information.
S504, executing a CalrulateReserve DataSize command, and calculating the size of the needed reserved partition.
S505, executing the IsFulldumpSupport command, and judging whether the Fulldump transfer scheme is started. If the Fulldump transfer scheme is turned on, the process proceeds to S506; if the Fulldump transfer scheme is not on, the process proceeds to S508.
S506, executing a ProcessResizedDataReserve command and executing the bare partition reservation.
S507, executing an UpdateFulldumpMetadata command to update the structural information on the physical storage device, namely, storing the address range of the reserved bare partition into the full memory data control information structural body of the physical storage device.
S508, canceling the reservation of the bare partition.
An embodiment of the present application further provides an electronic device 100, referring to fig. 12, the electronic device 100 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an Ultra-mobile Personal Computer, a UMPC, a netbook, a cellular phone, a personal digital assistant (Personal Digital Assistant, PDA), an augmented Reality (Augmented Reality, AR) device, a Virtual Reality (VR) device, an artificial intelligence (Artificial Intelligence, AI) device, a wearable device, a vehicle-mounted device, an intelligent home device, and/or a smart city device, and the specific type of the electronic device 100 is not particularly limited.
The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (Universal Serial Bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (Subscriber Identification Module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It should be understood that the illustrated structure of the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), a controller, a video codec, a digital signal processor (Digital Signal Processor, DSP), a baseband processor, and/or a Neural network processor (Neural-network Processing Unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (Inter-integrated Circuit, I2C) interface, an integrated circuit built-in audio (Inter-integrated Circuit Sound, I2S) interface, a pulse code modulation (Pulse Code Modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (Mobile Industry Processor Interface, MIPI), a General-Purpose Input/Output (GPIO) interface, a subscriber identity module (Subscriber Identity Module, SIM) interface, and/or a universal serial bus (Universal Serial Bus, USB) interface, among others.
The I2C interface is a bi-directional synchronous Serial bus, comprising a Serial Data Line (SDA) and a Serial clock Line (Derail Clock Line, SCL). In some embodiments, the processor 110 may contain multiple sets of I2C buses. The processor 110 may be coupled to the touch sensor 180K, charger, flash, camera 193, etc., respectively, through different I2C bus interfaces. For example: the processor 110 may be coupled to the touch sensor 180K through an I2C interface, such that the processor 110 communicates with the touch sensor 180K through an I2C bus interface to implement a touch function of the electronic device 100.
The I2S interface may be used for audio communication. In some embodiments, the processor 110 may contain multiple sets of I2S buses. The processor 110 may be coupled to the audio module 170 via an I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through the I2S interface, to implement a function of answering a call through the bluetooth headset.
PCM interfaces may also be used for audio communication to sample, quantize and encode analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 may be coupled through a PCM bus interface. In some embodiments, the audio module 170 may also transmit audio signals to the wireless communication module 160 through the PCM interface to implement a function of answering a call through the bluetooth headset. Both the I2S interface and the PCM interface may be used for audio communication.
The UART interface is a universal serial data bus for asynchronous communications. The bus may be a bi-directional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is typically used to connect the processor 110 with the wireless communication module 160. For example: the processor 110 communicates with a bluetooth module in the wireless communication module 160 through a UART interface to implement a bluetooth function. In some embodiments, the audio module 170 may transmit an audio signal to the wireless communication module 160 through a UART interface, to implement a function of playing music through a bluetooth headset.
The MIPI interface may be used to connect the processor 110 to peripheral devices such as a display 194, a camera 193, and the like. The MIPI interfaces include camera serial interfaces (Camera Serial Interface, CSI), display serial interfaces (Display Serial Interface, DSI), and the like. In some embodiments, processor 110 and camera 193 communicate through a CSI interface to implement the photographing functions of electronic device 100. The processor 110 and the display 194 communicate via a DSI interface to implement the display functionality of the electronic device 100.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal or as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 110 with the camera 193, the display 194, the wireless communication module 160, the audio module 170, the sensor module 180, and the like. The GPIO interface may also be configured as an I2C interface, an I2S interface, a UART interface, an MIPI interface, etc.
The USB interface 130 is an interface conforming to the USB standard specification, and may specifically be a Mini USB interface, a Micro USB interface, a USB Type C interface, or the like. The USB interface 130 may be used to connect a charger to charge the electronic device 100, and may also be used to transfer data between the electronic device 100 and a peripheral device. And can also be used for connecting with a headset, and playing audio through the headset. The interface may also be used to connect other electronic devices 100, such as AR devices, etc.
It should be understood that the interfacing relationship between the modules illustrated in the embodiments of the present application is only illustrative, and is not meant to limit the structure of the electronic device 100. In other embodiments of the present application, the electronic device 100 may also employ different interfacing manners in the above embodiments, or a combination of multiple interfacing manners.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (Wireless Local Area Networks, WLAN) (e.g., wireless fidelity (Wireless Fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (Global Navigation Satellite System, GNSS), frequency modulation (Frequency Modulation, FM), near field wireless communication technology (Near Field Communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (Global System For Mobile Communications, GSM), general packet radio service (General Packet Radio Service, GPRS), code division multiple access (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), time division code division multiple access (Time-Division Code Division Multiple Access, TD-SCDMA), long term evolution (Long Term Evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (Global Positioning System, GPS), a global navigation satellite system (Global Navigation Satellite System, GLONASS), a beidou satellite navigation system (Beidou Navigation Satellite System, BDS), a Quasi zenith satellite system (Quasi-Zenith Satellite System, QZSS) and/or a satellite based augmentation system (Satellite Based Augmentation Systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), an Active-matrix Organic Light-Emitting Diode (AMOLED) or an Active-matrix Organic Light-Emitting Diode (Matrix Organic Light Emitting Diode), a flexible Light-Emitting Diode (Flex), a mini, a Micro-OLED, a quantum dot Light-Emitting Diode (Quantum Dot Light Emitting Diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (Charge Coupled Device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (Moving Picture Experts Group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a Neural-Network (NN) computing processor, and can rapidly process input information by referencing a biological Neural Network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The internal Memory 121 may include one or more random access memories (Random Access Memory, RAM) and one or more Non-Volatile memories (NVM).
The Random Access Memory may include Static Random-Access Memory (SRAM), dynamic Random-Access Memory (Dynamic Random Access Memory, DRAM), synchronous dynamic Random-Access Memory (Synchronous Dynamic Random Access Memory, SDRAM), double data rate synchronous dynamic Random-Access Memory (Double Data Rate Synchronous Dynamic Random Access Memory, DDR SDRAM, e.g., fifth generation DDR SDRAM is commonly referred to as DDR5 SDRAM), etc.;
the nonvolatile memory may include a disk storage device, a flash memory (flash memory).
The FLASH memory may include NOR FLASH, NAND FLASH, 3d nand FLASH, etc. divided according to an operation principle, may include Single-Level Cell (SLC), multi-Level Cell (MLC), triple-Level Cell (TLC), quad-Level Cell (QLC), etc. divided according to a storage specification, may include universal FLASH memory (Universal Flash Storage, UFS), embedded multimedia memory card (embedded Multi Media Card, eMMC), etc. divided according to a storage specification.
The random access memory may be read directly from and written to by the processor 110, may be used to store executable programs (e.g., machine instructions) for an operating system or other on-the-fly programs, may also be used to store data for users and applications, and the like.
The nonvolatile memory may store executable programs, store data of users and applications, and the like, and may be loaded into the random access memory in advance for the processor 110 to directly read and write.
The external memory interface 120 may be used to connect external non-volatile memory to enable expansion of the memory capabilities of the electronic device 100. The external nonvolatile memory communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and video are stored in an external nonvolatile memory.
The internal memory 121 or the external memory interface 120 is used to store one or more computer programs. One or more computer programs are configured to be executed by the processor 110. The one or more computer programs include a plurality of instructions that when executed by the processor 110, implement the screen display detection method performed on the electronic device 100 in the above embodiment to implement the screen display detection function of the electronic device 100.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device 100 platform (Open Mobile Terminal Platform, OMTP) standard interface, a american cellular telecommunications industry association (Cellular Telecommunications Industry Association of the USA, CTIA) standard interface.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys. Or may be a touch key. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100.
The motor 191 may generate a vibration cue. The motor 191 may be used for incoming call vibration alerting as well as for touch vibration feedback. For example, touch operations acting on different applications (e.g., photographing, audio playing, etc.) may correspond to different vibration feedback effects. The motor 191 may also correspond to different vibration feedback effects by touching different areas of the display screen 194. Different application scenarios (such as time reminding, receiving information, alarm clock, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect may also support customization.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being a positive integer greater than 1. The SIM card interface 195 may support Nano SIM cards, micro SIM cards, and the like. The same SIM card interface 195 may be used to insert multiple cards simultaneously. The types of the plurality of cards may be the same or different. The SIM card interface 195 may also be compatible with different types of SIM cards. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to realize functions such as communication and data communication. In some embodiments, the electronic device 100 employs esims, i.e.: an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100. Embodiments of the present application also provide a computer storage medium having stored therein computer instructions that, when executed on an electronic device 100, cause the electronic device 100 to perform the above-described related method steps to implement the storage space configuration method in the above-described embodiments.
The embodiment of the application also provides a computer program product, which when run on a computer, causes the computer to execute the above related steps to implement the storage space configuration method in the above embodiment.
In addition, embodiments of the present application also provide an apparatus, which may be embodied as a chip, component or module, which may include a processor and a memory coupled to each other; the memory is used for storing computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the storage space configuration method in each method embodiment.
The electronic device, the computer storage medium, the computer program product, or the chip provided in this embodiment are used to execute the corresponding methods provided above, so that the beneficial effects thereof can be referred to the beneficial effects in the corresponding methods provided above, and will not be described herein.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another apparatus, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and the parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated unit may be stored in a readable storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Finally, it should be noted that the above-mentioned embodiments are merely for illustrating the technical solution of the present application and not for limiting the same, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made to the technical solution of the present application without departing from the spirit and scope of the technical solution of the present application.

Claims (18)

1. A storage space configuration method applied to an electronic device, the method comprising:
when the electronic equipment is started to mount a file system, acquiring a first storage capacity of an operation memory of the electronic equipment;
determining a second storage capacity of a reserved partition in a storage device to be allocated to the electronic device based on the first storage capacity, and determining an address range of the reserved partition;
and distributing the storage space corresponding to the address range in the storage device to the reserved partition, wherein the reserved partition is used for storing the complete memory data.
2. The storage space configuration method of claim 1, wherein the determining a second storage capacity of a reserved partition of a storage device to be allocated to the electronic device based on the first storage capacity comprises:
determining that the second storage capacity to be allocated to the reserved partition is the same as the first storage capacity.
3. The storage space configuration method of claim 1, wherein the determining a second storage capacity of a reserved partition of a storage device to be allocated to the electronic device based on the first storage capacity comprises:
And determining the second storage capacity to be allocated to the reserved partition as the sum of the first storage capacity and a preset storage capacity.
4. The storage space configuration method of claim 1, wherein the determining the address range of the reserved partition comprises:
determining a starting address of the reserved partition in the storage device based on the second storage capacity and an end address of the storage device, and determining the address range to be from the starting address of the reserved partition to the end address of the storage device.
5. The storage space configuration method according to claim 2, wherein the allocating the storage space corresponding to the address range in the storage device to the reserved partition includes:
executing a mounting command on a data partition outside the address range in the storage equipment, and mounting the data partition to the file system;
and reserving the bare partition of the second storage capacity as the reserved partition at the end of the storage device to store full memory data.
6. The storage space configuration method of claim 1, wherein the method further comprises:
judging whether the storage device performs partition reservation or not when the electronic device is started to execute kernel loading or initialization process loading;
And if the storage device performs partition reservation, acquiring the first storage capacity of the running memory when the electronic device mounts the file system.
7. The storage space configuration method of claim 6, wherein the storage device comprises an original dump data partition for storing a full memory data control information structure comprising a storage capacity of the running memory, a storage capacity of the reserved partition, an address range of the reserved partition in the storage device, and a reservation flag.
8. The storage space configuration method of claim 7, wherein the determining whether the storage device performs partition reservation comprises:
when the electronic equipment is started to execute kernel loading or initializing process loading, acquiring the reserved mark from the complete memory data control information structure body of the original dump data partition and determining the value of the reserved mark;
if the reservation mark is 0, determining that the storage device does not execute partition reservation; or (b)
And if the reservation mark is 1, determining that the storage equipment executes partition reservation.
9. The storage space configuration method of claim 7, wherein the determining whether the storage device performs partition reservation further comprises:
when the electronic equipment is started to execute kernel loading or initializing process loading, acquiring a system version of the electronic equipment;
if the system version is a test version, determining that the storage device executes partition reservation;
if the partition reservation execution is successful, updating the reservation mark to 1;
if the partition reservation execution fails, updating the reservation mark to 0;
and if the system version is a commercial version, determining that the storage device does not execute partition reservation.
10. The storage space configuration method of claim 7, wherein the method further comprises:
judging whether a complete transfer function is started or not when the electronic equipment is started to execute a boot loading stage;
if the complete transfer function is started, judging whether the storage device performs partition reservation when the electronic device performs kernel loading or initializing process loading.
11. The memory space allocation method according to claim 10, wherein the full memory data control information structure further includes an enable flag, and the determining whether the full dump function is on includes:
When the electronic equipment is started to execute a boot loading stage, acquiring the enabling mark from the full memory data control information structure body of the original dump data partition and determining the value of the enabling mark;
if the enabling mark is 0, determining that the complete transfer function is not started, determining that partition reservation is not executed, and determining that partition reservation execution fails; or (b)
If the enabling mark is 1, determining that the complete transfer function is started, and determining to execute partition reservation.
12. The memory space allocation method according to claim 11, wherein the determining whether the complete transfer function is turned on further comprises:
if the enabling flag is 0, determining that the complete transfer function is not started, starting the complete transfer function, and updating the enabling flag to be 1.
13. The storage space configuration method of claim 7, wherein the method further comprises:
and when the electronic equipment fails, acquiring the complete memory data, and transferring the complete memory data to the reserved partition.
14. The storage space configuration method of claim 13, wherein the acquiring the full memory data and the transferring the full memory data to the reserved partition comprises:
When the electronic equipment generates faults, loading an operation fault processing system;
acquiring state information of the running memory through a fault processing system, and generating a log based on the state information of the running content to obtain the complete memory data;
and acquiring the address range of the reserved partition in the storage device from the full memory data control information structure body of the original transfer data partition, addressing based on the address range, and transferring the full memory data to the reserved partition.
15. The storage space configuration method of claim 13, wherein the acquiring the full memory data and the transferring the full memory data to the reserved partition further comprises:
acquiring the current address range of the reserved partition from the original dump data partition;
and if the first storage capacity is smaller than or equal to the storage capacity of the storage space corresponding to the current address range of the reserved partition, addressing is performed based on the current address range of the reserved partition, and the complete memory data are transferred to the reserved partition.
16. An electronic device, the electronic device comprising a memory and a processor:
Wherein the memory is used for storing program instructions;
the processor configured to read and execute the program instructions stored in the memory, which when executed by the processor, cause the electronic device to perform the storage space configuration method according to any one of claims 1 to 15.
17. A chip coupled to a memory in an electronic device, wherein the chip is configured to control the electronic device to perform the memory space configuration method of any one of claims 1 to 15.
18. A computer storage medium storing program instructions which, when run on an electronic device, cause the electronic device to perform the storage space configuration method of any one of claims 1 to 15.
CN202310247836.0A 2023-03-02 2023-03-02 Storage space configuration method and related equipment Pending CN117130541A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310247836.0A CN117130541A (en) 2023-03-02 2023-03-02 Storage space configuration method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310247836.0A CN117130541A (en) 2023-03-02 2023-03-02 Storage space configuration method and related equipment

Publications (1)

Publication Number Publication Date
CN117130541A true CN117130541A (en) 2023-11-28

Family

ID=88853367

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310247836.0A Pending CN117130541A (en) 2023-03-02 2023-03-02 Storage space configuration method and related equipment

Country Status (1)

Country Link
CN (1) CN117130541A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117874843A (en) * 2024-03-08 2024-04-12 荣耀终端有限公司 Method, apparatus and computer readable storage medium for expanding protected memory space

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831033A (en) * 2012-07-26 2012-12-19 深圳市同洲电子股份有限公司 Recovery method and recovery device for file system data
CN105469001A (en) * 2014-08-15 2016-04-06 中兴通讯股份有限公司 Disk data protection method and device
CN106294019A (en) * 2016-08-11 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of operating system mirror image preserves and restoration methods and device
CN109343956A (en) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 A kind of operating system configuration method and device
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN113485858A (en) * 2021-06-15 2021-10-08 荣耀终端有限公司 System fault processing method of electronic equipment and electronic equipment
CN113495799A (en) * 2020-03-20 2021-10-12 华为技术有限公司 Memory fault processing method and related equipment
CN113505014A (en) * 2021-06-09 2021-10-15 荣耀终端有限公司 Fault diagnosis file acquisition method and device
CN113704205A (en) * 2021-07-29 2021-11-26 荣耀终端有限公司 Log storage method, chip, electronic device and readable storage medium
CN114153642A (en) * 2021-11-29 2022-03-08 联想(北京)有限公司 System detection method and electronic equipment
CN114185494A (en) * 2022-02-16 2022-03-15 荣耀终端有限公司 Memory anonymous page processing method, electronic device and readable storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831033A (en) * 2012-07-26 2012-12-19 深圳市同洲电子股份有限公司 Recovery method and recovery device for file system data
CN105469001A (en) * 2014-08-15 2016-04-06 中兴通讯股份有限公司 Disk data protection method and device
CN106294019A (en) * 2016-08-11 2017-01-04 浪潮(北京)电子信息产业有限公司 A kind of operating system mirror image preserves and restoration methods and device
CN109343956A (en) * 2018-09-20 2019-02-15 阿里巴巴集团控股有限公司 A kind of operating system configuration method and device
CN109522147A (en) * 2018-11-15 2019-03-26 Oppo广东移动通信有限公司 A kind of method, apparatus, storage medium and the terminal of record booting exception information
CN109710317A (en) * 2018-11-16 2019-05-03 华为技术有限公司 System start method, device, electronic equipment and storage medium
CN113495799A (en) * 2020-03-20 2021-10-12 华为技术有限公司 Memory fault processing method and related equipment
CN113505014A (en) * 2021-06-09 2021-10-15 荣耀终端有限公司 Fault diagnosis file acquisition method and device
CN113485858A (en) * 2021-06-15 2021-10-08 荣耀终端有限公司 System fault processing method of electronic equipment and electronic equipment
CN113704205A (en) * 2021-07-29 2021-11-26 荣耀终端有限公司 Log storage method, chip, electronic device and readable storage medium
CN114153642A (en) * 2021-11-29 2022-03-08 联想(北京)有限公司 System detection method and electronic equipment
CN114185494A (en) * 2022-02-16 2022-03-15 荣耀终端有限公司 Memory anonymous page processing method, electronic device and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117874843A (en) * 2024-03-08 2024-04-12 荣耀终端有限公司 Method, apparatus and computer readable storage medium for expanding protected memory space

Similar Documents

Publication Publication Date Title
EP4002108B1 (en) Application start method and electronic device
CN112783564A (en) Method for accelerating starting of application program and electronic equipment
CN113704014A (en) Log acquisition system, method, electronic device and storage medium
CN113553130B (en) Method for executing drawing operation by application and electronic equipment
CN113704205B (en) Log storage method, chip, electronic device and readable storage medium
CN117130541A (en) Storage space configuration method and related equipment
CN116665751B (en) Test method and electronic equipment
CN114443109B (en) Patch repair method, electronic device and storage medium
CN114461589B (en) Method for reading compressed file, file system and electronic equipment
CN113885928B (en) Program updating method and electronic device
CN112783418B (en) Method for storing application program data and mobile terminal
CN115904297A (en) Screen display detection method, electronic device and storage medium
CN113467821A (en) Application program repairing method, device, equipment and readable storage medium
CN116627855B (en) Memory processing method and related device
CN115482143B (en) Image data calling method and system for application, electronic equipment and storage medium
CN116795476B (en) Wallpaper deleting method and electronic equipment
CN116841575B (en) Method and related device for generating image file
CN117312055B (en) Data backup method and related device
CN116703689B (en) Method and device for generating shader program and electronic equipment
CN115952564B (en) Data writing method and terminal equipment
CN116709609B (en) Message delivery method, electronic device and storage medium
CN117009023B (en) Method for displaying notification information and related device
CN117013660B (en) Charging icon display method and electronic equipment
CN114006969B (en) Window starting method and electronic equipment
CN117707563A (en) Application resource processing method and related equipment

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