Electronic device and method for preserving data during initialization of electronic device
By creating logical partitions and separate disk areas within the device's memory, data is safeguarded during initialization, addressing the challenges of cumbersome external backups and ensuring data integrity.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SAMSUNG ELECTRONICS CO LTD
- Filing Date
- 2025-10-29
- Publication Date
- 2026-05-21
AI Technical Summary
Existing methods for preserving user data during electronic device initialization, such as factory resets, often require cumbersome backup processes to external storage, which can lead to data loss and exposure of personal information.
The method involves creating a logical partition in the non-volatile memory, copying data to this partition, forming separate disk areas, and formatting one area while retaining data in another, allowing data preservation within the device without external storage.
This approach ensures data is securely preserved during initialization, avoiding data loss and exposure, by utilizing the device's internal memory effectively.
Smart Images

Figure KR2025017471_21052026_PF_FP_ABST
Abstract
Description
Method to preserve data during electronic device initialization
[0001] This document relates to electronic devices, and, for example, to a method for preserving stored data when an electronic device is initialized.
[0002] Electronic devices such as smartphones and tablet PCs can store various types of data in memory to provide diverse user experiences. For example, electronic devices may be shipped and provided to users with basic data (e.g., default applications) pre-stored, and users can save applications, text messages, contacts, photos, videos, documents, or other data during use. The storage capacity of electronic devices capable of storing data may vary depending on the manufacturer or the specific model.
[0003] Electronic devices may provide a factory reset (or device full reset). A factory reset is a process that returns an electronic device to its state at the time of shipment, prior to use by the user. Performing a factory reset deletes user data and settings stored in memory, allowing the device to return to its initial state. When performing a factory reset on an electronic device, users can prevent the deletion of desired data by selectively choosing specific data stored on the device and backing it up to external storage (e.g., PC, SD card, cloud storage). If the electronic device is reset without such a backup process, data saved by the user will be lost and may be impossible to recover.
[0004] Backing up data to external storage before resetting an electronic device can be a somewhat difficult or cumbersome process. For example, some users may be unaware that stored data is deleted after a reset, they may lose some data during the transfer process to external storage, or the stored data could be exposed to other users.
[0005] An electronic device according to various embodiments of this disclosure (or specification, invention) may include a non-volatile memory and at least one processor.
[0006] According to one embodiment, the non-volatile memory may be executed by at least one processor, and at execution, the electronic device may store instructions for creating a logical partition in a data area of the non-volatile memory, copying and storing at least a portion of the data stored in the data area into the created logical partition, forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area, copying and storing at least a portion of the data stored in the logical partition into the second disk area, formatting the first disk area, and restoring the data stored in the second disk area to the first disk area.
[0007] A method performed by an electronic device according to various embodiments of the present document may include: creating a logical partition in a data area of a non-volatile memory of the electronic device; copying and storing at least a portion of data stored in the data area into the created logical partition; forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area; copying and storing at least a portion of data stored in the logical partition into the second disk area; formatting the first disk area; and restoring data stored in the second disk area to the first disk area.
[0008] A computer-readable non-transient recording medium according to various embodiments of the present document may store instructions for performing operations such as creating a logical partition in a data area of a non-volatile memory of the electronic device, copying and storing at least a portion of data stored in the data area into the created logical partition, forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area, copying and storing at least a portion of data stored in the logical partition into the second disk area, formatting the first disk area, and restoring data stored in the second disk area to the first disk area.
[0009] According to various embodiments of the present document, a method for preserving data during the initialization of an electronic device can be provided, which allows data to be preserved by utilizing the storage space of the electronic device's memory without utilizing external storage space during the factory initialization of the electronic device.
[0010] FIG. 1 is a block diagram of an electronic device in a network environment according to various embodiments.
[0011] FIG. 2 illustrates data stored in a non-volatile memory before and after initialization of an electronic device according to one embodiment.
[0012] FIG. 3 is a block diagram of an electronic device according to one embodiment.
[0013] FIG. 4 briefly illustrates the normal mode booting and recovery mode booting of an electronic device according to one embodiment.
[0014] FIG. 5 is a flowchart of the operation in the general mode boot state of an electronic device according to one embodiment.
[0015] FIG. 6 illustrates a state in which a logical partition is created in a data area according to one embodiment.
[0016] FIG. 7 illustrates the process of storing data in a logical partition according to one embodiment.
[0017] FIG. 8 illustrates the process of storing metadata in a designated area of non-volatile memory according to one embodiment.
[0018] FIG. 9 is a flowchart of the operation in the recovery mode boot state of an electronic device according to one embodiment.
[0019] FIG. 10 illustrates a method for mounting a logical partition based on metadata according to one embodiment.
[0020] FIG. 11 illustrates a state in which a first disk area and a second disk area are formed in a data area according to one embodiment.
[0021] FIG. 12 illustrates the process of storing data in a second disk area and a RAM disk area according to one embodiment.
[0022] FIG. 13 illustrates the process of formatting a first disk area according to one embodiment.
[0023] FIG. 14 illustrates the process of restoring data to a first disk area according to one embodiment.
[0024] FIG. 15 illustrates the process of formatting a second disk area according to one embodiment.
[0025] FIG. 16 illustrates the process of resizing a first disk area according to one embodiment.
[0026] FIG. 17 illustrates data stored in non-volatile memory during normal booting after initialization is completed according to one embodiment.
[0027] FIG. 18 illustrates a user interface that allows selecting data to be backed up during the initialization of an electronic device according to one embodiment.
[0028] Hereinafter, embodiments of this document are described in detail with reference to the drawings so that those skilled in the art can easily implement them. However, this document may be embodied in various different forms and is not limited to the embodiments described herein. In relation to the description of the drawings, identical or similar reference numerals may be used for identical or similar components. Furthermore, in the drawings and related descriptions, descriptions of well-known functions and configurations may be omitted for clarity and brevity.
[0029] FIG. 1 is a block diagram of an electronic device (101) in a network environment (100) according to various embodiments.
[0030] Referring to FIG. 1, in a network environment (100), an electronic device (101) may communicate with an electronic device (102) through a first network (198) (e.g., a short-range wireless communication network) or with at least one of an electronic device (104) or a server (108) through a second network (199) (e.g., a long-range wireless communication network). According to one embodiment, the electronic device (101) may communicate with the electronic device (104) through a server (108). According to one embodiment, the electronic device (101) may include a processor (120), memory (130), input module (150), sound output module (155), display module (160), audio module (170), sensor module (176), interface (177), connection terminal (178), haptic module (179), camera module (180), power management module (188), battery (189), communication module (190), subscriber identification module (196), or antenna module (197). In some embodiments, at least one of these components (e.g., connection terminal (178)) may be omitted from the electronic device (101), or one or more other components may be added. In some embodiments, some of these components (e.g., sensor module (176), camera module (180), or antenna module (197)) may be integrated into a single component (e.g., display module (160)).
[0031] The processor (120) can control at least one other component (e.g., a hardware or software component) of the electronic device (101) connected to the processor (120) by executing software (e.g., a program (140)), and can perform various data processing or operations. According to one embodiment, as at least part of the data processing or operations, the processor (120) can store commands or data received from other components (e.g., a sensor module (176) or a communication module (190)) in volatile memory (132), process the commands or data stored in volatile memory (132), and store the resulting data in non-volatile memory (134). According to one embodiment, the processor (120) may include a main processor (121) (e.g., a central processing unit or an application processor) or an auxiliary processor (123) that can operate independently or together with it (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, if the electronic device (101) includes a main processor (121) and an auxiliary processor (123), the auxiliary processor (123) may be configured to use lower power than the main processor (121) or to be specialized for a designated function. The auxiliary processor (123) may be implemented separately from the main processor (121) or as part thereof.
[0032] The auxiliary processor (123) may control at least some of the functions or states associated with at least one component of the electronic device (101) (e.g., display module (160), sensor module (176), or communication module (190)) on behalf of the main processor (121) while the main processor (121) is in an inactive (e.g., sleep) state, or together with the main processor (121) while the main processor (121) is in an active (e.g., application execution) state. According to one embodiment, the auxiliary processor (123) (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module (180) or communication module (190)). According to one embodiment, the auxiliary processor (123) (e.g., neural network processing unit) may include a hardware structure specialized for processing an artificial intelligence model. The artificial intelligence model may be generated through machine learning. Such learning may be performed, for example, on the electronic device (101) itself where the artificial intelligence model is executed, or through a separate server (e.g., server (108)). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but is not limited to the examples described above. The artificial intelligence model may include a plurality of artificial neural network layers.An artificial neural network may be a deep neural network (DNN), a convolutional neural network (CNN), a recurrent neural network (RNN), a restricted Boltzmann machine (RBM), a deep belief network (DBN), a bidirectional recurrent deep neural network (BRDNN), a deep Q-network, or a combination of two or more of the above, but is not limited to the examples described above. In addition to the hardware structure, the artificial intelligence model may include a software structure, either additionally or substantially.
[0033] The memory (130) can store various data used by at least one component of the electronic device (101) (e.g., processor (120) or sensor module (176)). The data may include, for example, input data or output data for software (e.g., program (140)) and related commands. The memory (130) may include volatile memory (132) or non-volatile memory (134).
[0034] The program (140) may be stored as software in memory (130) and may include, for example, an operating system (142), middleware (144), or an application (146).
[0035] The input module (150) can receive commands or data to be used for a component of the electronic device (101) (e.g., processor (120)) from outside the electronic device (101) (e.g., user). The input module (150) may include, for example, a microphone, a mouse, a keyboard, a key (e.g., a button), or a digital pen (e.g., a stylus pen).
[0036] The sound output module (155) can output a sound signal to the outside of the electronic device (101). The sound output module (155) may include, for example, a speaker or a receiver. The speaker may be used for general purposes, such as multimedia playback or recording playback. The receiver may be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from the speaker or as part thereof.
[0037] The display module (160) can visually provide information to an external (e.g., user) of the electronic device (101). The display module (160) may include, for example, a display, a holographic device, or a projector and a control circuit for controlling said device. According to one embodiment, the display module (160) may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of the force generated by said touch.
[0038] The audio module (170) can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module (170) can acquire sound through the input module (150) or output sound through the sound output module (155) or an external electronic device (e.g., electronic device (102)) (e.g., speaker or headphones) connected directly or wirelessly to the electronic device (101).
[0039] The sensor module (176) can detect the operating state of the electronic device (101) (e.g., power or temperature) or the external environmental state (e.g., user state) and generate an electrical signal or data value corresponding to the detected state. According to one embodiment, the sensor module (176) may include, for example, a gesture sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an accelerometer sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biosensor, a temperature sensor, a humidity sensor, or an illuminance sensor.
[0040] The interface (177) may support one or more specified protocols that can be used for the electronic device (101) to be connected directly or wirelessly to an external electronic device (e.g., electronic device (102)). According to one embodiment, the interface (177) may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
[0041] The connection terminal (178) may include a connector through which the electronic device (101) can be physically connected to an external electronic device (e.g., electronic device (102)). According to one embodiment, the connection terminal (178) may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (e.g., a headphone connector).
[0042] The haptic module (179) can convert an electrical signal into a mechanical stimulus (e.g., vibration or movement) or an electrical stimulus that can be perceived by the user through tactile or kinesthetic senses. According to one embodiment, the haptic module (179) may include, for example, a motor, a piezoelectric element, or an electric stimulation device.
[0043] The camera module (180) can capture still images and video. According to one embodiment, the camera module (180) may include one or more lenses, image sensors, image signal processors, or flashes.
[0044] The power management module (188) can manage power supplied to the electronic device (101). According to one embodiment, the power management module (188) can be implemented, for example, as at least part of a power management integrated circuit (PMIC).
[0045] The battery (189) can supply power to at least one component of the electronic device (101). According to one embodiment, the battery (189) may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.
[0046] The communication module (190) can support the establishment of a direct (e.g., wired) communication channel or a wireless communication channel between an electronic device (101) and an external electronic device (e.g., electronic device (102), electronic device (104), or server (108)), and the performance of communication through the established communication channel. The communication module (190) may include one or more communication processors that operate independently of the processor (120) (e.g., application processor) and support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module (190) may include a wireless communication module (192) (e.g., cellular communication module, short-range wireless communication module, or GNSS (global navigation satellite system) communication module) or a wired communication module (194) (e.g., LAN (local area network) communication module, or power line communication module). The corresponding communication module among these communication modules can communicate with an external electronic device (104) through a first network (198) (e.g., a short-range communication network such as Bluetooth, WiFi (wireless fidelity) direct, or IrDA (infrared data association)) or a second network (199) (e.g., a legacy cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., a LAN or WAN)). These various types of communication modules may be integrated into a single component (e.g., a single chip) or implemented as multiple separate components (e.g., multiple chips). The wireless communication module (192) can identify or authenticate the electronic device (101) within a communication network such as the first network (198) or the second network (199) using subscriber information (e.g., International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module (196).
[0047] The wireless communication module (192) can support 5G networks and next-generation communication technologies following 4G networks, for example, new radio access technology. NR access technology can support high-speed transmission of high-capacity data (enhanced mobile broadband (eMBB)), minimization of terminal power and connection of multiple terminals (massive machine type communications (mMTC)), or high reliability and low latency (ultra-reliable and low-latency communications (URLLC)). The wireless communication module (192) can support a high-frequency band (e.g., mmWave band) to achieve a high data transmission rate, for example. The wireless communication module (192) can support various technologies for securing performance in the high-frequency band, such as beamforming, massive MIMO (multiple-input and multiple-output), full-dimensional MIMO (FD-MIMO), array antenna, analog beam-forming, or large-scale antenna. The wireless communication module (192) can support various requirements specified in the electronic device (101), external electronic device (e.g., electronic device (104)), or network system (e.g., second network (199)). According to one embodiment, the wireless communication module (192) may support a Peak data rate (e.g., 20 Gbps or more) for eMBB realization, loss coverage (e.g., 164 dB or less) for mMTC realization, or U-plane latency (e.g., downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) for URLLC realization.
[0048] An antenna module (197) can transmit a signal or power to or from an external source (e.g., an external electronic device). According to one embodiment, the antenna module (197) may include an antenna comprising a radiator made of a conductor or a conductive pattern formed on a substrate (e.g., a PCB). According to one embodiment, the antenna module (197) may include a plurality of antennas (e.g., an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network, such as a first network (198) or a second network (199), may be selected from the plurality of antennas, for example, by a communication module (190). A signal or power may be transmitted or received between the communication module (190) and an external electronic device through the selected at least one antenna. According to some embodiments, in addition to the radiator, other components (e.g., a radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module (197).
[0049] According to various embodiments, the antenna module (197) may form a mmWave antenna module. According to one embodiment, the mmWave antenna module may include a printed circuit board, an RFIC disposed on or adjacent to a first surface (e.g., bottom surface) of the printed circuit board and capable of supporting a specified high frequency band (e.g., mmWave band), and a plurality of antennas (e.g., array antennas) disposed on or adjacent to a second surface (e.g., top surface or side surface) of the printed circuit board and capable of transmitting or receiving a signal of the specified high frequency band.
[0050] At least some of the above components can be connected to each other via a communication method between peripheral devices (e.g., bus, GPIO (general purpose input and output), SPI (serial peripheral interface), or MIPI (mobile industry processor interface)) and exchange signals (e.g., commands or data) with each other.
[0051] According to one embodiment, commands or data may be transmitted or received between an electronic device (101) and an external electronic device (104) through a server (108) connected to a second network (199). Each of the external electronic devices (102, or 104) may be the same or a different type of device as the electronic device (101). According to one embodiment, all or part of the operations performed on the electronic device (101) may be performed on one or more of the external electronic devices (102, 104, or 108). For example, if the electronic device (101) needs to perform a function or service automatically or in response to a request from a user or another device, the electronic device (101) may request one or more external electronic devices to perform at least part of the function or service instead of performing the function or service itself or additionally. One or more external electronic devices that receive the above request may execute at least part of the requested function or service, or additional function or service related to the request, and transmit the result of the execution to the electronic device (101). The electronic device (101) may provide the result as is or additionally processed as at least part of the response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device (101) may provide ultra-low latency services using, for example, distributed computing or mobile edge computing. In one embodiment, the external electronic device (104) may include an Internet of Things (IoT) device. The server (108) may be an intelligent server using machine learning and / or neural networks. According to one embodiment, the external electronic device (104) or the server (108) may be included within a second network (199).The electronic device (101) can be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology.
[0052] FIG. 2 illustrates data stored in a non-volatile memory before and after initialization of an electronic device according to one embodiment.
[0053] According to one embodiment, an electronic device may store various data in a non-volatile memory. The non-volatile memory (200) may be a NAND flash memory, but is not limited thereto, and may be various storage devices capable of reading and writing (RW) in at least some area, such as a NOR flash memory, a SLC flash memory, a multi-level cell flash memory, or a hard disk.
[0054] According to one embodiment, various data may be stored in a non-volatile memory (200) during the process of an electronic device. For example, applications provided by the manufacturer of the electronic device, a telecommunications carrier, or a third party may be stored in the non-volatile memory (200). Additionally, applications, text messages, contacts, photos, videos, documents, or other data may be stored in the non-volatile memory (200) while the user is using the electronic device.
[0055] According to one embodiment, an electronic device may not use the entire capacity of a storage space, such as a non-volatile memory (200), as a single space, but may divide it into several types of individual storage spaces. Here, the divided individual spaces may be referred to as partitions. Some of the partitions may be used in a read-only (RO) format, where data is written only once during the manufacture of the electronic device and cannot be written again thereafter, while others may be used in a read-and-write (RW) format, where data can be continuously written and erased.
[0056] Referring to FIG. 2, the storage space of the non-volatile memory (200) may be composed of four regions. Each region may be a partition occupying a physical area separated from one another on the non-volatile memory (200). Each region may be referred to as a partition, storage area, section, zone, block, or segment. The division of each region (or partition) shown in FIG. 2 corresponds to one embodiment and is not limited thereto.
[0057] According to one embodiment, an operating system and system applications may be stored in a system area (or system partition) (210). For security and stability, the system area (210) may be configured in an RO format so that it cannot be arbitrarily modified or deleted by the user.
[0058] According to one embodiment, the EFS (encrypting file system) area (or EFS partition) (220) may store unique information of the device. For example, data such as IMEI (international mobile equipment identity), MAC address, and network setting value may be stored in the EFS area (220).
[0059] According to one embodiment, the cache area (230) may store temporary data generated by the system and application. The cache area (230) is used in RW format, and the temporary data stored in the cache area (230) may be deleted periodically, according to capacity, or according to user input.
[0060] According to one embodiment, various applications and user data may be stored in the data area (250). For example, applications installed during the manufacturing process of the electronic device and applications installed by the user during the usage process may be stored in the data area (250). According to one embodiment, the electronic device may be able to access the data in the data area (250) when booting in normal mode, and access to the data in the data area (250) may be blocked by default when booting in recovery mode.
[0061] According to one embodiment, an electronic device may perform a factory reset based on user input. The factory reset may include the process of deleting data stored in the non-volatile memory (200) of the electronic device and returning it to its factory state. During the factory reset, the electronic device may delete (or format) data stored in partitions designated as RW format in the non-volatile memory (200). The factory reset described herein may include at least one of factory state reset, initial state restoration, default value restoration, or hard reset.
[0062] According to one embodiment, the electronic device may delete (or format) data stored in the data area (250) and data stored in the cache area (230) upon factory initialization. Referring to FIG. 2 (a) and (b), among the data stored in each partition prior to factory initialization, the data stored in the data area (250), which is the RW area, and the data stored in the cache area (230) may be deleted upon factory initialization. In contrast, data stored in the system area (210), which is the RO area, may be retained without being deleted.
[0063] During such a factory reset, data stored in the data area is deleted, and data that the user wishes to retain, as well as data (or applications) that must be preserved for functional and / or commercial reasons, need to be backed up separately. However, backing up data to another storage space outside the electronic device may result in the consumption of time and resources, the possibility of data loss, and / or the leakage of personal information. Hereinafter, through FIGS. 2 to 17, various embodiments will be described that allow data stored in the data area to be retained without separate operation by the user during a factory reset.
[0064] FIG. 3 is a block diagram of an electronic device according to one embodiment.
[0065] Referring to FIG. 3, an electronic device (300) according to one embodiment may include a display (340), a processor (310), a non-volatile memory (320), and a volatile memory (330). Various embodiments of this document may be implemented even if at least some of the illustrated configurations are omitted or replaced with other configurations. In addition to the illustrated configurations, the electronic device (300) may further include at least some of the configurations and / or functions of the electronic device (101) of FIG. 1. At least some of the configurations of each illustrated (or unillustrated) electronic device (300) (e.g., processor (310), non-volatile memory (320), volatile memory (330)) may be placed within the housing of the electronic device (300), and at least some other configurations may be exposed to the outside of the housing. At least some of the configurations of each electronic device (300) may be operatively, functionally, and / or electrically connected to one another.
[0066] According to one embodiment, the display (340) can display various images provided by the processor (310). For example, the display (340) may be implemented as any one of a liquid crystal display (LCD), a light-emitting diode (LED) display, an organic light-emitting diode (OLED) display, a micro electro mechanical systems (MEMS) display, or an electronic paper display, but is not limited thereto. The display (340) may be configured as a touch screen that detects touch and / or proximity touch (or hovering) input using a part of the user's body (e.g., a finger) or an input device (e.g., a stylus pen). The display (340) may include at least some of the configurations and / or functions of the display module (160) of FIG. 1.
[0067] According to one embodiment, the electronic device (300) may include a volatile memory (330) and a non-volatile memory (320) to store various data temporarily or permanently. The electronic device (300) may include at least some of the configuration and / or functions of the memory (130) of FIG. 1 and may store the program (140) of FIG. 1.
[0068] According to one embodiment, the volatile memory (330) can store data only while power is supplied, and random access memory (RAM) can be cited as an example.
[0069] According to one embodiment, the non-volatile memory (320) may have the property of being able to retain data even when the power is turned off. The non-volatile memory (320) may be a NAND flash memory, but is not limited thereto, and may be composed of various storage devices capable of reading and writing (RW) in at least some areas, such as a NOR flash memory, a SLC flash memory, a multi-level cell flash memory, and a hard disk.
[0070] According to one embodiment, the electronic device (300) may not use the entire given capacity of a storage space, such as non-volatile memory (320), as a single space, but may divide it into several types of individual storage spaces (e.g., partitions). For example, the non-volatile memory (320) may include a first area, a second area, a third area, and a data area that are physically separated from one another. Here, the first area may be a system area where data related to an operating system and system applications is stored (e.g., the system area (210) of FIG. 2), the second area may be an EFS (encrypting file system) area where data related to the device's unique information is stored (e.g., the EFS area (220) of FIG. 2), and the third area may be a cache area where temporary data is stored (e.g., the cache area (230) of FIG. 2), but is not limited thereto. In addition, the first area may be a read-only (RO) area where data can only be read, and the second area, the third area, and the data area may be read-and-write (RW) areas where data can be read and written.
[0071] According to one embodiment, the non-volatile memory (320) can store various instructions that can be executed by the processor (310). Such instructions may include control commands such as arithmetic and logical operations, data movement, and input / output that can be recognized by the processor (310).
[0072] According to one embodiment, the processor (310) may be configured to perform operations or data processing regarding the control and / or communication of each component of the electronic device (300), and may be composed of one or more processors. The processor (310) may include at least some of the configuration and / or functions of the processor (120) of FIG. 1. Although there are no limitations on the operations and data processing functions that the processor (310) can implement on the electronic device (300), this document describes various embodiments that allow data stored in the data area of the non-volatile memory (320) to be maintained by utilizing the storage space of the volatile memory (330) and / or non-volatile memory (320) during the factory initialization of the electronic device (300). The operations of the processor (310) described below may be performed by loading instructions stored in the non-volatile memory (320) into the volatile memory (330).
[0073] In this document, the description that a processor (310) can perform a certain operation (or function, task, or operation) may be interpreted substantially as meaning that an instruction (or command, computer program) causing the electronic device (300) (or processor (310)) to perform said operation is stored in memory (e.g., non-volatile memory (320)). Additionally, the description that a processor (310) can perform a certain operation may be interpreted substantially as meaning that at least one processor (310), which is not specified, can perform said operation.
[0074] According to one embodiment, the processor (310) may perform a factory reset based on user input. The factory reset may include the process of deleting data stored in the non-volatile memory (320) of the electronic device (300) and returning it to its original state. When performing a factory reset, the electronic device (300) may delete (or format) data stored in a storage area (e.g., a data area) designated as RW format in the non-volatile memory (320).
[0075] According to one embodiment, the processor (310) can boot through normal mode or recovery mode. For example, when the electronic device (300) is turned on, a bootloader is executed, and normal mode booting or recovery mode booting can be performed by the bootloader. The booting process of the electronic device (300) will be described in more detail through FIG. 4.
[0076] According to one embodiment, the processor (310) can provide a user interface provided in each boot mode through a display (340).
[0077] According to one embodiment, the operation during initialization of the electronic device (300) may be performed in recovery mode. For example, when initialization is triggered by user input in a normal mode boot state, the processor (310) may perform the initialization operation after rebooting into recovery mode.
[0078] According to one embodiment, the processor (310) may back up at least some of the data stored in the data area in a normal mode boot state before proceeding with the initialization of the electronic device (300). The backup operation may include the process of creating a logical partition in the data area of the non-volatile memory (320) and backing up user data to the logical partition. This backup operation may be performed when a specific user input (e.g., input of a specific external key combination) or a specific command (e.g., AT CMD) is received from an external device connected via a wired interface (e.g., USB) in a normal mode boot state, or when a factory initialization is initiated.
[0079] According to one embodiment, the processor (310) may create a logical partition in the data area of the non-volatile memory (320) during a normal mode boot state. The logical partition is a storage space for storing data to be retained without being deleted during the initialization of the electronic device (300), and may include a specific physical area within the data area.
[0080] According to one embodiment, the processor (310) may form a logical partition in a portion of the physical area where user data is not stored in the data area. The logical partition may have a form similar to a normal file in a normal mode boot state, and may have a structure similar to a container that can internally contain other files. Data other than the data to be backed up during initialization may not be stored in the logical partition.
[0081] According to one embodiment, the processor (310) may copy and store at least some of the data in the data area into a logical partition. For example, if a logical partition is created when the electronic device (300) is first turned on after shipment, basic applications that were previously stored in the data area prior to shipment may be stored in the logical partition. Additionally, if a logical partition is created when factory initialization is initiated by user input, at least some of the data such as applications, images, and messages stored in the data area may be stored in the logical partition. Data other than the data to be backed up during initialization may not be stored in the logical partition.
[0082] According to one embodiment, the processor (310) can copy and store data selected by the user from among the data in the data area into a logical partition. The processor (310) can provide a user interface that allows the user to select data to be backed up during initialization. The user interface will be described in more detail through FIG. 18.
[0083] According to one embodiment, the processor (310) may store metadata containing information about a logical partition in another area of the non-volatile memory (320). For example, the processor (310) may store it in a second area (or EFS area) that is accessible in recovery mode. The second area may be an EFS area that is in RW (read & write) format and is accessible in recovery mode as well as normal mode booting, but is not limited thereto. The metadata may define information such as where a number of fragments constituting the logical partition are located in the non-volatile memory (320) (e.g., starting position and size) in blocks, which is a low-level concept. The logical partition may include scattered blocks rather than physically contiguous storage spaces in the non-volatile memory (320), and the metadata may enable identification of the locations of such blocks. In recovery mode, access to data stored in the data area may not be permitted, but the processor (310) may be able to access the data area when the metadata is obtained.
[0084] The processes for backing up data in the user area of the non-volatile memory (320) in a normal mode boot state before factory initialization of the electronic device (300) will be explained in more detail through FIGS. 5 to 8.
[0085] According to one embodiment, the processor (310) can back up data in the data area to the logical partition and, while storing metadata related to the logical partition, perform a reboot into recovery mode for initialization.
[0086] According to one embodiment, the processor (310) may mount a logical partition based on metadata containing information related to a previously stored logical partition while in a recovery mode boot state. Mounting may include a process in which the operating system connects a specific physical area of non-volatile memory (320) to a file system to enable access. In the recovery mode state, access to data in areas other than the mountable logical partition using metadata may be impossible.
[0087] According to one embodiment, the processor (310) can mount a logical partition by utilizing the function of a device mapper (DM). Here, the device mapper is a module that provides a virtual device layer in the Linux kernel and may be a module used to virtualize physical storage devices to manage and mount logical volumes. When metadata is delivered to the device mapper, the device mapper can identify the locations (e.g., starting location and size) of the detailed blocks constituting the logical partition recorded in the metadata, and access each detailed block as if it were a contiguous physical space to read the data recorded in the logical partition.
[0088] According to one embodiment, the processor (310) may form a first disk area and a second disk area in the data area. Here, the first disk area includes a portion of the storage area including a logical partition in the data area of the non-volatile memory (320), and the second disk area may include a storage area excluding the first disk area in the data area. The first disk area may cover the storage space of various data that cannot be accessed in the logical partition and recovery mode. The second disk area may be configured with a small capacity in a portion of the storage space of the data area so as not to include any part of the logical partition.
[0089] According to one embodiment, the processor (310) can form a first disk area and a second disk area by utilizing the DM linear function of the device mapper. The DM linear function refers to a function that logically linearly connects physical storage spaces and may also be referred to as linear mapping. When using DM linear, any storage area configured as a single partition, such as a data area, can be configured as separate storage spaces by dividing it into portions of a certain capacity, rather than using the original given capacity as is.
[0090] According to one embodiment, the processor (310) may store at least a portion of the data stored in the logical partition in the second disk area. Additionally, the processor (310) may store at least another portion of the data stored in the logical partition in the RAM disk area of the volatile memory (330). Since the capacity of the volatile memory (330) is limited, if the data stored in the logical partition is stored only in the RAM disk area of the volatile memory (330), the storage space may be insufficient. Accordingly, the processor (310) may store the data stored in the logical partition in the second disk area of the non-volatile memory (320), or divide and store it in the second disk area of the non-volatile memory (320) and the RAM disk area of the volatile memory (330). Since the processor (310) can access the first disk area and the second disk area individually, the data stored in the second disk area can be maintained even when the first disk area is formatted. In addition, since the RAM disk area is formed within volatile memory (330) (e.g., RAM), it can be maintained unless a reason such as power off occurs during the initialization process.
[0091] According to one embodiment, the processor (310) may determine the area to back up data as a second disk area or a RAM disk area based on the priority of each of the data to be stored. Since the RAM disk area is formed within volatile memory (330) (e.g., DRAM) and is fast but has the potential for data loss, the electronic device (300) may store high-priority data in the second disk area and store relatively low-priority data in the RAM disk area.
[0092] According to one embodiment, the processor (310) may format the first disk area after backing up data to the second disk area and / or RAM disk area. Since the first disk area and the second disk area can be recognized as separate partitions by the device mapper (DM) linear, the processor (310) may format only the data in the first disk area while retaining the data in the second disk area. When formatting the first disk area, data in other storage spaces (e.g., first area, second area, third area) other than the data area of the non-volatile memory (320) and data in the RAM disk area of the volatile memory (330) may also be retained without being deleted.
[0093] According to one embodiment, the processor (310) can restore data stored in the second disk area and data stored in the RAM disk area to the first disk area after formatting the first disk area. Accordingly, data previously stored in the data area can be returned to its original location after formatting the first disk area. The processor (310) can determine what file system the data area was used with before formatting and mount it in the same format.
[0094] According to one embodiment, the processor (310) can format the second disk area after restoring data to the first disk area. Since the data stored in the temporary storage has been copied to the location corresponding to the original space, the processor (310) can delete the data in the storage space used as the temporary storage. Accordingly, the detection of garbage data can be prevented during the process of using the data area by rebooting after initialization. Since the RAM disk area is formed in the volatile memory (330), all data stored in the RAM disk area can be deleted upon rebooting after initialization is complete.
[0095] According to one embodiment, the processor (310) can resize the size of the first disk area after formatting the second disk area. For example, the processor (310) can expand the size of the first disk area to correspond to the size of the data area. While the first disk area and the second disk area were configured and used for data backup using DM linear, the second disk area has been formatted, so data may currently be stored only in the first disk area among the data areas. In this case, if the first disk area is resized to the capacity of the data area, the first disk area can be used again as a single partition when rebooting in normal mode.
[0096] According to one embodiment, the processor (310) may reboot into normal mode after initialization is complete. When rebooting, at least some of the data stored in the data area has been backed up and restored, so the restored data may remain in the original path.
[0097] According to one embodiment, the processor (310) can delete metadata for a logical partition that was stored in a second area (or EFS area).
[0098] After the electronic device (300) boots into recovery mode, the initialization process of formatting the data in the user area of the non-volatile memory (320) while preserving the data stored in the logical partition will be explained in more detail through FIGS. 9 to 17.
[0099] Instructions for performing the operation of the electronic device (300) (or processor (310)) described above may be stored in a computer-readable recording medium. The recording medium may be tangible and non-transitory. The recording medium may store one or more computer programs containing the instructions.
[0100] FIG. 4 briefly illustrates the normal mode booting and recovery mode booting of an electronic device according to one embodiment.
[0101] According to one embodiment, the electronic device (300) may provide normal mode booting or recovery mode booting during the booting process after turn-on.
[0102] According to one embodiment, a bootloader (410) may be executed when the electronic device (300) is turned on. The bootloader (410) may perform operations necessary for the initialization of the system, such as initializing the hardware and loading system files necessary for booting.
[0103] According to one embodiment, the bootloader (410) can check (420) whether to boot into normal mode (430) or boot into recovery mode (440). For example, the bootloader (410) may boot into recovery mode (440) after the electronic device (300) is turned on, when a reboot occurs due to a factory reset, when a system error occurs, when an update of the operating system or firmware is performed, or when a specific user input (e.g., a specific combination of external keys) is detected. The bootloader (410) may boot into normal mode (430) when it is not operating in a recovery mode (440) as described above.
[0104] According to one embodiment, normal mode booting (430) is a basic boot mode of the electronic device (300), and when normal mode booting (430) is performed, an operating system is loaded, thereby enabling the execution of functions and applications of the electronic device (300). When normal mode booting (430) is performed, a user interface (450), such as a home screen, is provided so that the user can execute desired functions. In the normal mode booting (430) state, the executed application can access data in a data area (e.g., data area (250) of FIG. 2).
[0105] According to one embodiment, recovery mode boot (440) may be a boot mode provided for special functions such as factory reset, system recovery, and firmware update. In the recovery mode boot (440) state, a limited user interface (460) is provided, and basic operations such as the execution of applications may be restricted. In the recovery mode boot (440) state, access to data in the data area may be restricted by default.
[0106] According to one embodiment, the electronic device (300) can create a logical partition in the data area of non-volatile memory in a normal mode boot (430) state and copy at least a portion of the data stored in the data area to the logical partition.
[0107] According to one embodiment, when a factory initialization is performed, the electronic device (300) may reboot into a recovery mode (440), form a first disk area and a second disk area in a data area of non-volatile memory, copy at least a portion of the data stored in a logical partition to the second disk area, format the first disk area, and perform an operation to restore the data stored in the second disk area by copying it to the first disk area.
[0108] FIG. 5 is a flowchart of the operation in the general mode boot state of an electronic device according to one embodiment.
[0109] FIG. 6 illustrates a state in which a logical partition is created in a data area according to one embodiment.
[0110] FIG. 7 illustrates the process of storing data in a logical partition according to one embodiment.
[0111] FIG. 8 illustrates the process of storing metadata in a designated area of non-volatile memory according to one embodiment.
[0112] Hereinafter, processes for backing up data in the user area of non-volatile memory in a normal mode boot state are described through FIGS. 5 to 8.
[0113] According to one embodiment, the illustrated method may be performed by an electronic device (e.g., the electronic device (300) of FIG. 3), and the technical features described above may be omitted from the description below.
[0114] According to one embodiment, in operation 510, the electronic device may perform normal mode booting. For example, when the electronic device is turned on, a bootloader (e.g., the bootloader (410) of FIG. 4) is executed, and the bootloader may perform normal mode booting when the conditions for recovery mode booting (e.g., reboot following factory reset, occurrence of a system error, update of the operating system or firmware, detection of a defined user input) are not satisfied.
[0115] According to one embodiment, the operations 520, 530, and / or 540 described below may be performed in a normal mode boot state, or may be performed according to a set user input or when a factory reset is initiated.
[0116] According to one embodiment, when a user inputs a predetermined external key combination during the booting of an electronic device, or when a specific command (e.g., AT CMD) is received from an external device connected via a wired interface (e.g., USB), the electronic device may create a logical partition (660) for data backup and store data from the data area (650) in the logical partition (660).
[0117] According to one embodiment, when a factory reset is initiated based on user input in a normal mode boot state, the electronic device does not immediately reboot into recovery mode, but creates a logical partition (660) and can store data from the data area (650) in the logical partition (660).
[0118] According to one embodiment, in operation 520, the electronic device may create a logical partition (660) in the data area (650) of the non-volatile memory (320). The logical partition (660) may include a specific physical area within the data area (650) as a storage space for storing data to be retained without being deleted during the initialization of the electronic device.
[0119] Referring to FIG. 6, the non-volatile memory (320) of the electronic device may include a first area (610), a second area (620), a third area (630), and a data area (650) that are physically separated from each other. Here, the first area (610) may be a system area where data related to an operating system and system applications is stored (e.g., the system area (210) of FIG. 2), the second area (620) may be an EFS (encrypting file system) area where data related to the device's unique information is stored (e.g., the EFS area (220) of FIG. 2), and the third area (630) may be a cache area where temporary data is stored (e.g., the cache area (230) of FIG. 2), but is not limited thereto. Additionally, the first area (610) is a read-only (RO) area where data can only be read, and the second area (620), the third area (630), and the data area (650) may be read-and-write (RW) areas where data can be read and written.
[0120] According to one embodiment, the electronic device may form a logical partition (660) in a portion of the physical area in the data area (650) where user data is not stored. For example, the logical partition (660) may have a fixed size, and if additional data to be backed up is added, the electronic device may expand the size of the logical partition (660) in the data area (650).
[0121] According to one embodiment, when the initialization of an electronic device is executed, most of the processes may occur in recovery mode. Since access to the data area (650) of the non-volatile memory (320) is fundamentally impossible in recovery mode, in order to preserve data when the electronic device is initialized, it is necessary to create a structural storage space that is accessible even in recovery mode, such as a logical partition (660). The logical partition (660) may have the form of a normal file in a normal mode boot state, and may have a structure such as a container that can internally contain other files.
[0122] According to one embodiment, the logical partition (660) may not store data other than the data to be backed up during initialization.
[0123] According to one embodiment, in operation 530, the electronic device may copy and store at least some of the data stored in the data area (650) in the logical partition (660). For example, if the logical partition (660) is created when the electronic device is first turned on after shipment, the basic applications that were previously stored in the data area (650) prior to shipment may be stored in the logical partition (660). Additionally, if the logical partition (660) is created when a factory reset is initiated according to user input, at least some of the data such as applications, images, and messages stored in the data area (650) may be stored in the logical partition (660).
[0124] Referring to FIG. 7, the electronic device may copy and store data from the data area (650) into a logical partition (660), and may not copy data from the first area (610), the second area (620), and the third area (630) into the logical partition (660).
[0125] According to one embodiment, the electronic device may select some of the data stored in the data area (650) and store them in a logical partition (660). For example, the designated data may be data that the electronic device or the user has set (or decided) to preserve. The electronic device may determine the designated data based on the user's usage history of the electronic device. The usage history may include at least one of how often (e.g., usage time, number of uses) the data (e.g., applications, photos, documents, files) was used, whether the data was used within a specified period (e.g., within 24 hours, within 7 days, within 1 month), how old the data is, or the importance of the data. For example, the designated data may be determined in the order of the oldest created and stored data, the most recently created data, the most frequently accessed records, or data generally considered important (e.g., certificates). Alternatively, whenever the user saves data, the electronic device may receive a selection from the user as to whether the data is to be preserved even after the initialization of the electronic device. The electronic device may copy the specified data from among the data stored in the data area (650) and store it in the logical partition (660), and any data in the data area (650) that is not stored in the logical partition (660) may be deleted when the electronic device is initialized.
[0126] According to one embodiment, the logical partition (660) may not store data other than the data to be backed up during initialization.
[0127] According to one embodiment, in operation 540, the electronic device may store metadata (670) containing information of a logical partition (660) in an area other than the data area (650) of the non-volatile memory (320).
[0128] According to one embodiment, metadata (670) may include configuration information of a logical partition (660). Metadata (670) may be a collection of information configured for mounting the logical partition (660). For example, metadata (670) may define information such as where a plurality of pieces constituting the logical partition (660) are located in the non-volatile memory (320) (e.g., starting position and size) in blocks, which is a low-level concept. The logical partition (660) may include scattered blocks rather than physically contiguous storage spaces in the non-volatile memory (320), and metadata (670) may enable identification of the locations of the blocks formed in this way.
[0129] According to one embodiment, access to data stored in the data area (650) may not be allowed in recovery mode, but if metadata (670) is obtained, the electronic device may be able to access the data area (650).
[0130] Referring to FIG. 8, the electronic device may store metadata (670) in a second area (620). The electronic device may store a logical partition (660) formed in a data area (650) in a second area (620), which is an area (or partition) accessible in recovery mode, so that it can be accessed in recovery mode later. The second area (620) may be an EFS area that is in RW (read & write) format and is accessible in recovery mode as well as normal mode booting, but is not limited thereto.
[0131] According to one embodiment, the electronic device may store metadata (670) in a second area (620) by encrypting it, or store metadata (670) in an encrypted space (e.g., trust zone) of the second area (620) without encrypting it.
[0132] According to one embodiment, the electronic device can back up the data of the data area (650) to the logical partition (660), and, with metadata (670) related to the logical partition (660) stored, perform a reboot into recovery mode for initialization.
[0133] According to one embodiment, instructions for performing each operation constituting the method may be stored on a tangible and non-transitory computer-readable recording medium.
[0134] FIG. 9 is a flowchart of the operation in the recovery mode boot state of an electronic device according to one embodiment.
[0135] FIG. 10 illustrates a method for mounting a logical partition based on metadata according to one embodiment.
[0136] FIG. 11 illustrates a state in which a first disk area and a second disk area are formed in a data area according to one embodiment.
[0137] FIG. 12 illustrates the process of storing data in a second disk area and a RAM disk area according to one embodiment.
[0138] FIG. 13 illustrates the process of formatting a first disk area according to one embodiment.
[0139] FIG. 14 illustrates the process of restoring data to a first disk area according to one embodiment.
[0140] FIG. 15 illustrates the process of formatting a second disk area according to one embodiment.
[0141] FIG. 16 illustrates the process of resizing a first disk area according to one embodiment.
[0142] FIG. 17 illustrates data stored in non-volatile memory during normal booting after initialization is completed according to one embodiment.
[0143] Hereinafter, through FIGS. 9 to 17, the processes of backing up data in the data area of the logical partition in a normal mode boot state, saving metadata related to the logical partition, booting into recovery mode, and formatting the data in the user area of non-volatile memory while preserving the data stored in the logical partition are described.
[0144] According to one embodiment, the illustrated method may be performed by an electronic device (e.g., the electronic device (300) of FIG. 3), and the technical features described above may be omitted from the description below.
[0145] According to one embodiment, in operation 910, the electronic device may perform recovery mode booting. For example, the electronic device may back up the data of the data area (650) to the logical partition (660) in a normal mode boot state and store metadata (670) related to the logical partition (660), and then reboot into recovery mode to initialize the data stored in the data area (650). In the recovery mode boot state, a limited user interface is provided, and basic operations such as the execution of applications may be restricted.
[0146] According to one embodiment, in recovery mode, access to files stored inside the storage space, such as the data area (650), may not be allowed. Accordingly, even if the electronic device is lost or stolen, user data can be protected from being leaked to the outside by a third party who acquires the electronic device.
[0147] According to one embodiment, in operation 915, the electronic device may mount a logical partition (660) based on metadata (670). Here, the metadata (670) may contain information related to the logical partition (660) and may be stored in a designated area (e.g., a second area (620)) of the non-volatile memory (320) in normal boot mode. The metadata (670) may define information such as where a plurality of pieces constituting the logical partition (660) are located in the non-volatile memory (320) (e.g., starting position and size) in blocks, which is a low-level concept. The logical partition (660) may include scattered blocks that are not physically contiguous storage spaces in the non-volatile memory (320), and the metadata (670) may enable identification of the locations of the blocks thus formed.
[0148] Referring to FIG. 10, the electronic device can mount a logical partition (660) using metadata (670) stored in a second area (620) (e.g., an EFS area) after booting into recovery mode. In the recovery mode state, it may not be possible to access data in areas other than the logical partition (660) that can be mounted using metadata (670).
[0149] According to one embodiment, an electronic device can mount a logical partition (660) by utilizing the function of a device mapper (DM). Here, the device mapper is a module that provides a virtual device layer in the Linux kernel and may be a module used to virtualize physical storage devices to manage and mount logical volumes. The device mapper can abstract device files to divide them into multiple layers and support the performance of various storage management tasks. When using a device mapper, the partition can be accessed via a logical path rather than a physical address.
[0150] According to one embodiment, when metadata (670) is transmitted to a device mapper, the device mapper checks the locations (e.g., starting locations and sizes) of the detailed blocks constituting the logical partition (660) recorded in the metadata (670), and accesses each detailed block as if it were a continuous physical space to read the data recorded in the logical partition (660). If the device mapper succeeds in mounting the logical partition (660), access to the file recorded in the logical partition (660) may be possible. For example, even if security features such as encryption or mount prevention are applied to the data area (650), the device mapper may be able to access the logical partition (660) as a file in a normal state. Accordingly, the electronic device can mount and access the logical partition (660), which is a part of the data area (650), as a separate partition, even without mounting the entire data area (650), which is the space where the logical partition (660) is located.
[0151] According to one embodiment, in operation 920, the electronic device may form a first disk area (710) and a second disk area (720) in a data area (650). Here, the first disk area (710) includes a portion of the storage area including a logical partition (660) in the data area (650) of the non-volatile memory (320), and the second disk area (720) may include a storage area in the data area (650) excluding the first disk area (710).
[0152] Referring to FIG. 11, the electronic device may designate a storage area containing a logical partition (660) created during normal mode booting in a data area (650) as a first disk area (710) (or DM disk 1), and designate at least a portion of the remaining area excluding the first disk area (710) as a second disk area (720) (or DM disk 2). The first disk area (710) may cover the storage space for the logical partition (660) and various data that cannot be accessed in recovery mode. The second disk area (720) may be configured with a small capacity in a portion of the storage space of the data area (650) so as not to include any part of the logical partition (660). For example, if the total data area (650) has a capacity of 461GB (or 512GB NAND) or 223GB (or 256GB NAND), the storage space of approximately 16GB of the physical area of the data area (650) at the rear can be designated as the second disk area (720). The capacity of the second disk area (720) is not limited to approximately 16GB and may be determined according to the requirements of the telecommunications carrier, application provider, and / or electronic device manufacturer. According to one embodiment, the electronic device can determine the size of the first disk area (710) and the second disk area (720) based on the capacity of the data stored in the logical partition (660).
[0153] According to one embodiment, the electronic device can access the first disk area (710) and the second disk area (720) individually as separate storage spaces.
[0154] According to one embodiment, the logical partition (660) that was successfully mounted in operation 915 may disappear according to the formatting operation 935 described later. Therefore, data existing within the logical partition (660) must be temporarily stored in another area to prevent data loss. Since the second disk area (720) is an area that does not overlap with the logical partition (660), even if the data of the logical partition (660) is deleted by formatting the first disk area (710) after copying the data of the logical partition (660) to the second disk area (720), the data can be maintained on the second disk area (720).
[0155] According to one embodiment, the electronic device can form a first disk area (710) and a second disk area (720) by utilizing the DM linear function of the device mapper. The DM linear function refers to a function that logically linearly connects physical storage spaces and may also be referred to as linear mapping. When using DM linear, any storage area consisting of a single partition, such as the data area (650), can be configured as separate storage spaces by dividing it into portions of a certain capacity, rather than using the original given capacity.
[0156] According to one embodiment, in operation 925, the electronic device may store at least a portion of the data stored in the logical partition (660) in the second disk area (720). According to one embodiment, in operation 930, the electronic device may store another portion of the data stored in the logical partition (660) in the RAM disk area (730) of the volatile memory (330). Either operation 925 and operation 930 may be performed first, or at least partially simultaneously.
[0157] According to one embodiment, the electronic device may determine the size of the RAM disk area (730) based on the capacity of the volatile memory (330) (e.g., DRAM). For example, the RAM disk area (730) may have a size of approximately 40% of the capacity of the volatile memory (330), but is not limited thereto. Unlike the second disk area (720) formed in the non-volatile memory (320), the RAM disk area (730) may have all data stored therein deleted if a reboot occurs while data is stored therein or if a sudden power-off occurs. Therefore, the RAM disk area (730) can only be utilized until the recovery mode situation ends, and the data must be moved back to the storage space of the non-volatile memory (320) before the recovery mode ends.
[0158] Referring to FIG. 12, the electronic device may copy and store some of the data stored in the logical partition (660) included in the first disk area (710) to a second disk area (720) that does not overlap with the first disk area (710), and copy and store other data to a RAM disk area (730) of the volatile memory (330).
[0159] According to one embodiment, the electronic device may determine the area to back up data as a second disk area (720) or a RAM disk area (730) based on the priority of each of the data to be stored. Since the RAM disk area (730) is formed within volatile memory (330) (e.g., DRAM) and is fast but carries the possibility of data loss, the electronic device may store high-priority data in the second disk area (720) and relatively low-priority data in the RAM disk area (730). For example, among the applications installed prior to the shipment of the electronic device, the priority may be determined in the order of third-party, telecommunications carrier, and manufacturer applications based on business reasons. Additionally, among user data generated by the user, data of high importance to the user, such as phone numbers, memos, and schedules, may be backed up to the second disk area (720) as high priority, and the remaining data, such as images and video files, may be backed up to the RAM disk area (730) as low priority.
[0160] According to one embodiment, if the capacity of data stored in the logical partition (660) is less than the capacity of the second disk area (720) and the capacity of the RAM disk area (730), the electronic device can back up the same data stored in the logical partition (660) to both the second disk area (720) and the RAM disk area (730).
[0161] According to one embodiment, in operation 935, the electronic device can format the first disk area (710).
[0162] Referring to FIG. 13, the electronic device can perform a format operation to delete all data in the first disk area (710) (or DM disk 1) among the data areas (650) of the non-volatile memory (320). Since the first disk area (710) and the second disk area (720) can be recognized as separate partitions by DM linear, the electronic device can format only the data in the first disk area (710). Even when formatting the first disk area (710), the data stored in the first area (610), the second area (620), and the third area (630) of the non-volatile memory (320) can be maintained as is, and the data backed up in the second disk area (720) can also be maintained as is without being deleted. The data backed up in the RAM disk area (730) can also be maintained as is without being deleted.
[0163] According to one embodiment, the electronic device can delete stored temporary data by also formatting the third area (or cache area).
[0164] According to one embodiment, in operation 940, the electronic device can restore data stored in the second disk area (720) and data stored in the RAM disk area (730) to the first disk area (710).
[0165] Referring to FIG. 14, the electronic device can copy data that was backed up in the second disk area (720) and RAM disk area (730), which are temporary storage areas, to the area corresponding to the logical original location of the data in order to return the data to its previous location. Accordingly, data that was previously stored in the data area (650) can be returned to its original location after the first disk area (710) is formatted. The first disk area (710) formatted in operation 935 can be mounted without any particular restrictions. Additionally, since the first disk area (710) is not currently in a state where security-related functions such as a security mode (e.g., file-based encryption, FBE) are applied, data can be stored without restrictions.
[0166] According to one embodiment, the electronic device can determine what file system was used for the data area (650) prior to formatting and mount it in the same format. For example, the first disk area (710) can be mounted with a file system such as F2FS (flash-friendly file system) or ext4. If the mounting of the first disk area (710) is successful, the electronic device can copy and store data that was backed up in a temporary storage (e.g., second disk area (720), RAM disk area (730)) to the first disk area (710).
[0167] According to one embodiment, in operation 945, the electronic device can format the second disk area (720).
[0168] Referring to FIG. 15, the electronic device can format the second disk area (720) while maintaining the first disk area (710) in the data area (650). Since the first disk area (710) and the second disk area (720) can be recognized as separate partitions by DM linear, the electronic device can format only the data in the first disk area (710). Because the data stored in the temporary storage is copied to the location corresponding to the original space, the data in the storage space used as temporary storage can be deleted. Accordingly, the detection of garbage data can be prevented during the process of using the data area (650) by rebooting after initialization.
[0169] According to one embodiment, since the RAM disk area (730) is formed in the volatile memory (330), all data stored in the RAM disk area (730) can be deleted upon reboot. Accordingly, the electronic device deletes data in the second disk area (720) among the temporary storage, but does not perform a separate removal operation for the RAM disk area (730).
[0170] According to one embodiment, in operation 950, the electronic device can resize the size of the first disk area (710).
[0171] Referring to FIG. 16, the electronic device can expand the size of the first disk area (710) to correspond to the size of the data area (650). For data backup, the first disk area (710) and the second disk area (720) are configured and used by dividing them using DM linear, but since the second disk area (720) has been formatted, data may currently be stored only in the first disk area (710) of the data area (650). In this case, if the first disk area (710) is resized to the capacity of the data area (650), the first disk area (710) can be used again as a single partition when rebooting in normal mode.
[0172] According to one embodiment, in operation 955, the electronic device can be rebooted into normal mode after the initialization is completed. Since the data area (650) is formatted after backing up some of the data stored in the data area (650) before initialization by operations 910 to 950, the restored data can be stored in the original path as is.
[0173] Referring to FIG. 17, the backed-up data may be restored to its original location in the data area (650). Additionally, the logical partition (660) may be removed compared to the state prior to logical initialization.
[0174] According to one embodiment, the electronic device can delete metadata (670) for a logical partition (660) that was stored in a second area (620) (or EFS area).
[0175] According to one embodiment, the size of the data that can be preserved may depend on the capacity of the logical partition (660), which is the primary storage, and / or the capacity of the second disk area (720) and the RAM disk area (730), which are the secondary storage. Since the logical partition (660) is formed within the data area (650) of the non-volatile memory (320), there are few restrictions on its size; however, since the storage space for general data is reduced due to the logical partition (660), the capacity of the logical partition (660) can be appropriately set in consideration of this. The second disk area (720) has no restrictions on the capacity that can be set, but since the space must not overlap with the logical partition (660), it can be operated with an appropriate capacity that satisfies the corresponding condition. In the case of the RAM disk area (730), it can be set in consideration of the size of the physical capacity of the volatile memory (330) installed in the electronic device. The electronic device can compress and store data to be preserved during the initialization process, and accordingly, the capacity to be preserved may be about 1.5 times the combined capacity of the RAM disk area (730) and the second disk area (720).
[0176] According to one embodiment, instructions for performing each operation constituting the method may be stored on a tangible and non-transitory computer-readable recording medium.
[0177] FIG. 18 illustrates a user interface that allows selecting data to be backed up during initialization of an electronic device (300) according to one embodiment.
[0178] According to one embodiment, an electronic device (300) (e.g., the electronic device (300) of FIG. 3) may provide a user interface (1810) through a display (340) that allows selecting data to be backed up during the initialization of the electronic device (300).
[0179] Referring to FIG. 18, the user interface (1810) may include a list (1820) of data stored in non-volatile memory. For example, the electronic device (300) may provide a list of applications, text messages, contacts, photos, videos, documents, or other data stored in non-volatile memory on the user interface (1810).
[0180] According to one embodiment, the user interface (1810) may include selection buttons (1820) that allow selecting whether to back up each data. According to one embodiment, the electronic device (300) may set the selection buttons for high-priority data (e.g., third-party, carrier-provided applications, phone book, memo, schedule) to default to backup execution based on the priority of the stored data, and set the buttons for other low-priority data to default to non-backup execution. The electronic device (300) may switch from backup execution to non-backup execution or switch from non-backup execution to backup execution based on user input for each selection button (1820).
[0181] According to one embodiment, the electronic device (300) may store at least one data selected for backup execution via the user interface (1810) in a logical partition (e.g., logical partition (660) of FIG. 3) formed on the data area of non-volatile memory prior to the initialization process. Data stored in the logical partition according to the embodiments described above may be retained and not deleted during the initialization process of the electronic device (300).
[0182] An electronic device according to various embodiments of the present document may include a non-volatile memory and at least one processor.
[0183] According to one embodiment, the non-volatile memory may be executed by at least one processor, and at execution, the electronic device may store instructions for creating a logical partition in a data area of the non-volatile memory, copying and storing at least a portion of the data stored in the data area into the created logical partition, forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area, copying and storing at least a portion of the data stored in the logical partition into the second disk area, formatting the first disk area, and restoring the data stored in the second disk area to the first disk area.
[0184] According to one embodiment, the non-volatile memory may store instructions for the electronic device to copy and store at least a portion of the data stored in the data area in the normal mode boot state to the logical partition, then perform a reboot in recovery mode, and in the recovery mode boot state, form the first disk area and the second disk area, format the first disk area, and restore the data stored in the second disk area to the first disk area.
[0185] According to one embodiment, the non-volatile memory may store instructions for the electronic device to format the second disk area after restoring data stored in the second disk area to the first disk area in the recovery mode boot state.
[0186] According to one embodiment, when the second disk area is formatted, the data stored in the first disk area may be retained.
[0187] According to one embodiment, the non-volatile memory may store instructions that cause the electronic device to adjust the first disk area to correspond to the size of the data area after formatting the second disk area.
[0188] According to one embodiment, the non-volatile memory may store instructions that cause the electronic device to store metadata containing information of the logical partition in an area different from the data area of the non-volatile memory.
[0189] According to one embodiment, the non-volatile memory may store instructions that cause the electronic device to mount the logical partition based on the metadata in the recovery mode boot state.
[0190] According to one embodiment, the non-volatile memory may store instructions that cause the electronic device to mount the logical partition using a device mapper.
[0191] According to one embodiment, the non-volatile memory can store instructions that cause the electronic device to form the first disk region and the second disk region by using the DM linear function of the device mapper.
[0192] According to one embodiment, the device further comprises a volatile memory, wherein the non-volatile memory may store instructions that cause the electronic device to store at least another portion of the data stored in the logical partition in the volatile memory.
[0193] According to one embodiment, the non-volatile memory may store instructions that cause the electronic device to restore data stored in the volatile memory to the first disk area after formatting the first disk area.
[0194] A method performed by an electronic device according to various embodiments of the present document may include: creating a logical partition in a data area of a non-volatile memory of the electronic device; copying and storing at least a portion of data stored in the data area into the created logical partition; forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area; copying and storing at least a portion of data stored in the logical partition into the second disk area; formatting the first disk area; and restoring data stored in the second disk area to the first disk area.
[0195] According to one embodiment, the method may include the operation of copying and storing at least a portion of the data stored in the data area in a normal mode boot state to the logical partition and then performing a reboot into recovery mode, and in a recovery mode boot state, forming the first disk area and the second disk area, formatting the first disk area, and restoring the data stored in the second disk area to the first disk area.
[0196] According to one embodiment, the method may further include the operation of formatting the second disk area after restoring data stored in the second disk area in the recovery mode boot state to the first disk area.
[0197] According to one embodiment, the method may further include the operation of formatting the second disk area and then adjusting the first disk area to correspond to the size of the data area.
[0198] According to one embodiment, the method may further include the operation of storing metadata containing information of the logical partition in an area different from the data area of the non-volatile memory, and the operation of mounting the logical partition based on the metadata in the recovery mode boot state.
[0199] According to one embodiment, the operation of mounting the logical partition may include the operation of mounting the logical partition using a device mapper.
[0200] According to one embodiment, the operation of forming the first disk region and the second disk region may include the operation of forming the first disk region and the second disk region using the DM linear function of the device mapper.
[0201] According to one embodiment, the method may further include the operation of storing another at least part of the data stored in the logical partition in volatile memory, and the operation of restoring the data stored in the volatile memory to the first disk area after formatting the first disk area.
[0202] A computer-readable non-transient recording medium according to various embodiments of the present document may store instructions for performing operations such as creating a logical partition in a data area of a non-volatile memory of the electronic device, copying and storing at least a portion of data stored in the data area into the created logical partition, forming a first disk area including the logical partition and a second disk area including a physical area different from the first disk area in the data area, copying and storing at least a portion of data stored in the logical partition into the second disk area, formatting the first disk area, and restoring data stored in the second disk area to the first disk area.
[0203] The electronic device according to the various embodiments disclosed in this document may be of various forms. The electronic device may include, for example, a portable communication device (e.g., a smartphone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a consumer electronics device. The electronic device according to the embodiments of this document is not limited to the devices described above.
[0204] The various embodiments of this document and the terms used therein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various modifications, equivalents, or substitutions of said embodiments. In connection with the description of the drawings, similar reference numerals may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of said items unless the relevant context clearly indicates otherwise. In this document, phrases such as "A or B," "at least one of A and B," "at least one of A or B," "A, B or C," "at least one of A, B and C," and "at least one of A, B, or C" may each include any one of the items listed together in the corresponding phrase, or all possible combinations thereof. Terms such as "first," "second," or "first" or "second" may be used simply to distinguish said components from other said components and do not limit said components in any other aspect (e.g., importance or order). Where any (e.g., 1st) component is referred to as “coupled” or “connected” to another (e.g., 2nd) component, with or without the terms “functionally” or “communicationly,” it means that said any component may be connected to said other component directly (e.g., via a wire), wirelessly, or through a third component.
[0205] The term “module” as used in the various embodiments of this document may include a unit implemented in hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic block, component, or circuit, for example. A module may be a component formed integrally, or a minimum unit of said component or a part thereof that performs one or more functions. For example, according to one embodiment, a module may be implemented in the form of an application-specific integrated circuit (ASIC).
[0206] Various embodiments of the present document may be implemented as software (e.g., program (140)) comprising one or more instructions stored in a storage medium (e.g., internal memory (136) or external memory (138)) readable by a machine (e.g., electronic device (101)). For example, a processor (e.g., processor (120)) of the machine (e.g., electronic device (101)) may call at least one of the one or more instructions stored in the storage medium and execute it. This enables the machine to be operated to perform at least one function according to the at least one called instruction. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. The storage medium readable by the machine may be provided in the form of a non-transitory storage medium. Here, 'non-temporary' simply means that the storage medium is a tangible device and does not contain a signal (e.g., electromagnetic waves), and the term does not distinguish between cases where data is stored semi-permanently and cases where it is stored temporarily.
[0207] According to one embodiment, the method according to the various embodiments disclosed herein may be provided by being included in a computer program product. The computer program product may be traded between a seller and a buyer as a product. The computer program product may be distributed in the form of a device-readable storage medium (e.g., compact disc read-only memory (CD-ROM)) or an application store (e.g., Play Store). TM It can be distributed online (e.g., downloaded or uploaded) through ) or directly between two user devices (e.g., smartphones). In the case of online distribution, at least a portion of the computer program product may be temporarily stored or temporarily created on a device-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.
[0208] According to various embodiments, each component (e.g., module or program) of the components described above may include a singular or multiple entities, and some of the multiple entities may be separated and placed in other components. According to various embodiments, one or more of the components or operations of the aforementioned components may be omitted, or one or more other components or operations may be added. Generally or additionally, multiple components (e.g., module or program) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each of the multiple components in the same or similar manner as those performed by the corresponding component among the multiple components prior to integration. According to various embodiments, operations performed by the module, program, or other components may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, omitted, or one or more other operations may be added.
Claims
1. In an electronic device, Non-volatile memory; and It includes at least one processor, The above non-volatile memory can be executed by at least one processor, and at the time of execution, the electronic device, A logical partition is created in the data area of the above-mentioned non-volatile memory, and At least a portion of the data stored in the above data area is copied and stored in the created logical partition, and A first disk area including the logical partition in the above data area and a second disk area including a physical area different from the first disk area are formed, At least a portion of the data stored in the above logical partition is copied and stored in the above second disk area, and Format the above-mentioned first disk area, and An electronic device that stores instructions for restoring data stored in the second disk area to the first disk area.
2. In Paragraph 1, The above non-volatile memory is, the electronic device, After copying and saving at least a portion of the data stored in the data area to the logical partition while booting in normal mode, perform a reboot in recovery mode, An electronic device that stores instructions for forming the first disk area and the second disk area, formatting the first disk area, and restoring data stored in the second disk area to the first disk area while booting in recovery mode.
3. In Paragraph 2, The above non-volatile memory is, the electronic device, An electronic device that stores instructions to format the second disk area after restoring data stored in the second disk area to the first disk area in the recovery mode boot state.
4. In Paragraph 3, An electronic device in which data stored in the first disk area is retained when the second disk area is formatted.
5. In Paragraph 3 or 4, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for formatting the second disk area and then adjusting the first disk area to correspond to the size of the data area.
6. In any one of paragraphs 1 through 5, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for storing metadata containing information of the above logical partition in an area different from the data area of the above non-volatile memory.
7. In Paragraph 6, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for mounting the logical partition based on the metadata in the above recovery mode boot state.
8. In Paragraph 7, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for mounting the logical partition using a device mapper.
9. In any one of paragraphs 1 through 8, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for forming the first disk region and the second disk region using the DM linear function of a device mapper.
10. In any one of paragraphs 1 through 9, It further includes volatile memory, and The above non-volatile memory is, the electronic device, An electronic device that stores instructions for storing at least another portion of the data stored in the above logical partition in the above volatile memory.
11. In Paragraph 10, The above non-volatile memory is, the electronic device, An electronic device that stores instructions for restoring data stored in the volatile memory to the first disk area after formatting the first disk area.
12. In a method performed by an electronic device, The operation of creating a logical partition in the data area of the non-volatile memory of the electronic device; The operation of copying and storing at least a portion of the data stored in the above data area to the created logical partition; An operation to form a first disk region including the logical partition in the above data region and a second disk region including a physical region different from the first disk region; The operation of copying and storing at least a portion of the data stored in the above logical partition to the above second disk area; The operation of formatting the first disk area; and A method including the operation of restoring data stored in the second disk area to the first disk area.
13. In Paragraph 12, An operation of copying and saving at least a portion of the data stored in the data area to the logical partition while booting in normal mode, and then performing a reboot into recovery mode; In a recovery mode boot state, forming the first disk area and the second disk area, formatting the first disk area, and restoring data stored in the second disk area to the first disk area; The operation of restoring data stored in the second disk area to the first disk area in the recovery mode boot state, and then formatting the second disk area; and A method including the operation of formatting the second disk area and then adjusting the first disk area to correspond to the size of the data area.
14. In any one of paragraphs 12 through 13, The operation of storing metadata containing information of the above logical partition in an area different from the data area of the above non-volatile memory; and A method further comprising the operation of mounting the logical partition based on the metadata in the above recovery mode boot state.
15. In a computer-readable non-transient recording medium, The operation of creating a logical partition in the data area of the non-volatile memory of the electronic device; The operation of copying and storing at least a portion of the data stored in the above data area to the created logical partition; An operation to form a first disk region including the logical partition in the above data region and a second disk region including a physical region different from the first disk region; The operation of copying and storing at least a portion of the data stored in the above logical partition to the above second disk area; The operation of formatting the first disk area; and A recording medium storing instructions for performing an operation to restore data stored in the second disk area to the first disk area.