Storage management method and electronic equipment

By introducing storage management methods of expansion mode and external storage mode in electronic devices, the problem of single use mode of storage devices in the prior art is solved, and the user's diverse storage needs are met and a higher storage experience is achieved.

CN119847412APending Publication Date: 2025-04-18HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311351103.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The storage device usage mode of existing electronic devices is single, and users find it difficult to access data in the storage device when the device is shut down or the screen cannot be used, which cannot meet the user's diverse storage needs.

Method used

A storage management method is provided that allows electronic devices to provide a scalable mode and an external storage mode through multiple memory devices, and the user can switch modes manually or automatically. In external storage mode, the memory device acts as a mobile hard disk and other devices can be accessed through the connection cable.

Benefits of technology

It enables users to flexibly manage storage devices in different modes, meets diverse storage needs, and provides higher storage experience and data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119847412A_ABST
    Figure CN119847412A_ABST
Patent Text Reader

Abstract

The invention provides a storage management method and electronic equipment. The electronic device may provide two usage modes to a user based on the plurality of memory devices: a capacity expansion mode and an external storage mode. In a capacity expansion mode, the plurality of devices can be combined into a whole to serve as internal storage. In an external storage mode, the plurality of memory devices may be divided into external storage and internal storage. A user can manually set the use mode as the capacity expansion mode or the external storage mode, and the capacity expansion mode and the external storage mode can be freely switched. In the external storage mode, the storage device serving as external storage can also be equivalent to a mobile hard disk. Other devices can access the external storage through the connecting line without depending on the operation of the system of the electronic device. The method can meet diversified storage requirements of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a storage management method and an electronic device. Background Art

[0002] With the development of portable electronic devices such as mobile phones, the storage capacity of electronic devices is gradually increasing. However, the storage devices in electronic devices are usually used as internal storage. The usage mode of storage devices is single. Moreover, when the electronic device is turned off or the screen is unusable, it is difficult for users to access the data stored in the storage device. The storage devices in current electronic devices are difficult to meet the diverse storage needs of users. Summary of the invention

[0003] The present application provides a storage management method and an electronic device. The electronic device can use multiple storage devices to provide two usage modes for users: expansion mode and external storage mode. The user can manually set the usage mode to expansion mode or external storage mode, and can freely switch between expansion mode and external storage mode. In the external storage mode, the storage device used as external storage can also be equivalent to a mobile hard disk. Other devices can access the above external storage through a connecting line without relying on the operation of the electronic device's own system. This can meet the user's diverse storage needs.

[0004] In a first aspect, the present application provides a storage management method. The method can be applied to a first device, the first device includes a first memory and a second memory, the memory of the first device operates in a first mode, and in the first mode, the first memory and the second memory are both internal storage. The first device displays a first interface, and a first storage capacity is displayed in the first interface. The first storage capacity is used to indicate the storage capacity of the internal storage in the first device, and the value of the first storage capacity is the sum of the storage capacities of the first memory and the second memory. The first device receives a first operation, and the first operation is used to switch the first mode to a second mode. In the second mode, the first memory is internal storage and the second memory is external storage. In response to the first operation, the first device sets the second memory to external storage and changes the value of the first storage capacity to the storage capacity of the first memory. The first device displays the second storage capacity, and the second storage capacity is used to indicate the storage capacity of the external storage in the first device, and the value of the second storage capacity is the storage capacity of the second memory.

[0005] The first mode may also be called a capacity expansion mode, etc. The second mode may also be called an external storage mode, etc.

[0006] The first memory can refer to this application Figure 2A The second memory device s1 can refer to the present application Figure 2A The storage device s2 is shown.

[0007] The first interface can refer to this application Figure 5A The user interface 510 is shown. The first storage capacity can refer to the present application Figure 5A The prompt information 513 is used to indicate the total capacity of the internal storage (eg, 2 TB). The value of the first storage capacity is changed to the storage capacity of the first memory. Figure 5A The prompt message 513 shown changes to Figure 5D The prompt information 531 is shown. By comparing the prompt information 513 and the prompt information 531, it can be seen that when the first mode is switched to the second mode, the value of the first storage capacity (ie, the total internal storage capacity) changes from 2 TB to 1 TB.

[0008] The first operation can refer to this application Figure 5B Operation of external storage mode option 523 is shown.

[0009] The second storage capacity can refer to this application Figure 5E The prompt information 532 is used to indicate the total capacity of the external storage (eg, 1 TB).

[0010] It can be seen from the above method that the second memory can be used as both internal storage and external storage. The user can set the usage mode to the first mode or the second mode according to the usage needs, and can switch the usage mode at any time. This can provide users with the opportunity to choose the working mode of the storage device in the first device to meet the storage needs of different users. In addition, since the above-mentioned second memory is integrated in the first device, the transmission rate and stability of the second memory as external storage are both high. Compared with external external storage or cloud storage, the built-in external storage in this application can bring users a better storage experience.

[0011] In combination with the first aspect, in some embodiments, in the first mode, the second memory has a first mark, and the first mark is used to indicate that the second memory is internal storage. After the first device receives the first operation, the first device modifies the first mark to a second mark, and the second mark is used to indicate that the second memory is external storage.

[0012] The first mark may also be referred to as an expansion mode mark. The second mark may also be referred to as an external storage mode mark.

[0013] When the first device is powered on, the first device may mount the second storage on the internal storage according to the first mark, or mount the second storage on the external storage according to the second mark.

[0014] It can be seen that the first device can implement the switching of the second memory between the internal storage and the external storage based on the first mark and the second mark.

[0015] In combination with the first aspect, in some embodiments, in the first mode, data is stored in the second memory, and after the first device receives the first operation, the first device transfers part or all of the data in the second memory to the first memory.

[0016] It is understandable that in the first mode, the second memory is used as internal storage, and the privacy of one or more data stored therein may be relatively high. When switched to the second mode, the second memory is used as external storage, and the security level of data storage is reduced. Therefore, the first device can transfer part or all of the data in the second memory to the first memory, so as to better protect the privacy security of the user.

[0017] In combination with the first aspect, in some embodiments, before the first device transfers part or all of the data in the second memory to the first memory, the first device compresses the data stored in the first memory and / or the second memory.

[0018] The above embodiment can better transfer the data in the second memory to the first memory, and reduce the situation where the data from the second memory cannot be stored due to insufficient remaining storage capacity of the first memory.

[0019] In combination with the first aspect, in some embodiments, the first device detects that the remaining space of the first memory is insufficient to accommodate the data in the second memory; the first device displays a first prompt, which is used to prompt the user to clean up the data in the second memory before switching to the second mode.

[0020] The above first tip can refer to this application Figure 6C Prompt box 526 is shown.

[0021] In combination with the first aspect, in some embodiments, the first device receives a second operation, the second operation is used to store the first data in the external storage of the first device; in response to the second operation, the first device stores the first data in the second memory; the first device receives a third operation, the third operation is used to store the second data in the internal storage of the first device; in response to the third operation, the first device stores the second data in the first memory.

[0022] The second operation can refer to this application Figure 7B Operation of external storage option 713B is shown.

[0023] It can be seen that in the second mode, the user can select the storage location of the data as needed, and store the data in the internal storage (ie, the first storage) or the external storage (ie, the second storage).

[0024] In combination with the first aspect, in some embodiments, the first device receives a fourth operation, and the fourth operation is used to copy third data in the first memory to the second memory; in response to the fourth operation, the electronic device stores the third data in the second memory.

[0025] In combination with the first aspect, in some embodiments, the first device is connected to the second device via a data cable, and in a second mode, data in the second memory is transmitted to the second device via the data cable; when the first device meets a first condition, the data in the first memory is transmitted to the second device via the data cable, wherein the first condition includes: the operating system of the first device is in a running state and / or the first device receives an authorization operation from the user, and the authorization operation is used to authorize the second device to access the internal storage of the first device.

[0026] In the second mode, regardless of whether the first device meets the above-mentioned first condition, the data in the second memory can be transmitted to the second device via the data line. In other words, other devices can access the built-in external storage in the first device without relying on the operation of the first device's own system. The external storage (second memory) in the electronic device 100 can be equivalent to a mobile hard disk. Even if the first device is in a stopped state (for example, turned off, or the screen is unusable, etc.), the second device can also read / write control of the external storage of the first device through the data line. In this way, the user can back up the data to the external storage of the first device. Even if the first device is turned off or has problems such as operating failures, the user can connect to the first device through the second device in real time to view the data backed up in the external storage of the first device. This can improve the user's storage experience.

[0027] The internal storage in the first device can be accessed by an external device (such as the second device) only after the first device operating system is in operation and / or after user authorization. This can improve the security level of the internal storage and help protect the privacy of the user.

[0028] In combination with the first aspect, in some embodiments, before the data in the second memory is transmitted to the second device via the data line, the first device receives a fifth operation, and the fifth operation is used to transmit the data in the second memory to the second device.

[0029] The fifth operation may include an operation of selecting data in the second memory on the first device. The first device may transmit the selected data in the second memory to the second device via a data line. Optionally, the second device may send a data read instruction to the second memory via the data line to obtain the data in the second memory. Upon receiving the data read instruction from the second device, the second memory may transmit the data to the second device via the data line.

[0030] After the data in the second memory is transmitted to the second device, the second device can store the data in a temporary storage such as a memory or a cache, or can also store the data in a non-volatile memory such as a read-only memory (ROM). The embodiment of the present application does not limit the method by which the second device processes the data from the second memory.

[0031] In some embodiments, in the second mode, regardless of whether the first device satisfies the first condition, the second device can also directly write data into the second memory through the data line.

[0032] In combination with the first aspect, in some embodiments, the first device divides the second memory into a first partition and a second partition, and sets the first partition as internal storage and the second partition as external storage; the first device changes the value of the first storage capacity to the sum of the storage capacities of the first memory and the first partition, and changes the value of the second storage capacity to the storage capacity of the second partition.

[0033] The storage capacity of the first partition and the second partition may be set by the first device or by a user. Optionally, the first device may also dynamically adjust the storage capacity of the first partition and the second partition according to the usage of the internal storage and the external storage.

[0034] The above embodiments can facilitate users to better manage the internal storage and external storage in the first device. The first device can reasonably allocate the storage capacity of the internal storage and external storage, and improve the use experience of the memory in the first device.

[0035] In combination with the first aspect, in some embodiments, the first device receives a sixth operation, which is used to switch the second mode to the first mode; in response to the sixth operation, the first device sets the second memory to internal storage, and changes the value of the first storage capacity to the sum of the storage capacities of the first memory and the second memory; the first device cancels the display of the second storage capacity.

[0036] It can be seen that the user can switch freely between the first mode and the second mode, which can meet the storage needs of different users.

[0037] In combination with the first aspect, in some embodiments, in the second mode, the second memory has a second mark, and the second mark is used to indicate that the second memory is external storage. After the first device receives the sixth operation, the first device modifies the second mark to a first mark, and the first mark is used to indicate that the second memory is internal storage.

[0038] In combination with the first aspect, in some embodiments, in the second mode, data is stored in the second memory, and after the first device receives the sixth operation, the first device formats the second memory; or, the first device transfers part or all of the data in the second memory to the first memory.

[0039] In combination with the first aspect, in some embodiments, the first device provides a first-time startup guide when it is powered on for the first time, and the first-time startup guide includes setting the memory to work in the first mode or the second mode; if an operation of setting the memory to work in the first mode is received, the first device sets both the first memory and the second memory to internal storage, and configures a first mark for the second memory, and the first mark is used to indicate that the second memory is internal storage; if an operation of setting the memory to work in the second mode is received, the first device sets the first memory to internal storage, sets the second memory to external storage, and configures a second mark for the second memory, and the second mark is used to indicate that the second memory is external storage.

[0040] When the first device is powered on for the first time, the user can set the usage mode of the storage device to the expansion mode or the external storage mode as needed. In addition, the first device can mount the storage device according to the mode mark on the storage device to achieve the expansion mode or the external storage mode. Therefore, after the first device is powered on, the mode mark of the storage device can also be modified according to the user operation to achieve the switching of the usage mode of the storage device. This can better meet the storage needs of the user.

[0041] In combination with the first aspect, in some embodiments, setting the memory to operate in the first mode or the second mode is the first setting in the first boot guide.

[0042] The first item in the first boot guide is set to set the usage mode of the storage device to improve the efficiency of the first device mounting the storage device. The external storage mode and the expansion mode can take effect immediately after the user completes the setting, without restarting the first device. The first device stores one or more pieces of information received after the first item in the first boot guide is set to the first memory and / or the second memory according to the usage mode being the expansion mode or the external storage mode.

[0043] In combination with the first aspect, in some embodiments, before receiving the operation of setting the memory to work in the first mode or the second mode, the first device also receives one or more information input by the user; the first device stores the one or more information in the memory; after receiving the operation of setting the memory to work in the first mode or the second mode, the first device stores the one or more information in the first memory and / or the second memory according to the first mode or the second mode.

[0044] It can be seen that in the scenario of the first boot guidance, before the usage mode of the storage device is set, the first device may not mount any storage device and temporarily store one or more information entered by the user in the memory. After the usage mode of the storage device is set, the first device can store the data previously temporarily stored in the memory to the first memory and / or the second memory according to the usage mode of the expansion mode or the external storage mode. This can also improve the efficiency of the first device mounting the storage device. The external storage mode and the expansion mode can take effect immediately after the user settings are completed, without restarting the first device.

[0045] In a second aspect, the present application provides an electronic device. The electronic device includes a first memory, a second memory, a storage driver, and a processor, wherein the first memory is an internal storage, the second memory is an internal storage and / or an external storage, the first memory and the second memory are both used to store computer programs and data, the storage driver is used to control the first memory and the second memory, and perform read and write operations on the first memory and the second memory, and the processor is used to call a computer program, so that the electronic device is implemented as any possible method in the first aspect.

[0046] In conjunction with the second aspect, in some embodiments, the first memory and the second memory are both universal flash memory ufs. For example, the first memory may be ufs1 in the present application, and the second memory may be ufs2 in the present application.

[0047] In conjunction with the second aspect, in some embodiments, the storage driver includes a small computer system interface (SCSI) driver, and the electronic device includes two SCSI paths, which are used for the SCSI driver to control the first memory and the second memory, respectively. The two SCSI paths may be integrated on the SOC of the electronic device.

[0048] In conjunction with the second aspect, in some embodiments, the storage driver includes a SCSI driver and a universal serial bus USB driver, and the electronic device includes a UFS to USB conversion module, a SCSI channel and a USB channel, and the UFS to USB conversion module is used to convert data between the UFS protocol and the USB protocol. One SCSI channel is used for the SCSI driver to control the first memory, and one USB channel is used for the USB driver to control the second memory through the UFS to USB conversion module; or, one SCSI channel is used for the SCSI driver to control the second memory, and one USB channel is used for the USB driver to control the first memory through the UFS to USB conversion module.

[0049] Among them, one SCSI channel and one USB channel can be integrated on the SOC of the electronic device.

[0050] In combination with the second aspect, in some embodiments, the storage driver includes a SCSI driver and a peripheral component interconnection extension PCIE driver, the electronic device includes a UFS and PCIE conversion module, a SCSI channel and a PCIE channel, the UFS and PCIE conversion module is used to convert data between the UFS protocol and the PCIE protocol; one SCSI channel is used for the SCSI driver to control the first memory, and one PCIE channel is used for the PCIE driver to control the second memory through the UFS and PCIE conversion module; or, one SCSI channel is used for the SCSI driver to control the second memory, and one PCIE channel is used for the PCIE driver to control the first memory through the UFS and PCIE conversion module.

[0051] Among them, one SCSI channel and one pcie channel can be integrated on the SOC of the electronic device.

[0052] It can be seen that even if the electronic device's SOC does not integrate two SCSI channels, the electronic device can also configure two storage devices of type UFS through the corresponding protocol conversion module (such as UFS to USB conversion module, UFS to PCIE conversion module). In this way, a large-capacity storage space (for example, 2TB) can be realized to meet the user's needs for storing large amounts of data.

[0053] In a third aspect, the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute any possible implementation method in the first aspect.

[0054] In a fourth aspect, the present application provides a computer program product, which may include computer instructions. When the computer instructions are run on an electronic device, the electronic device executes any possible implementation method in the first aspect.

[0055] In a fifth aspect, the present application provides a chip, which is applied to an electronic device, and the chip includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute any possible implementation method as in the first aspect.

[0056] It can be understood that the electronic device provided in the second aspect, the computer-readable storage medium provided in the third aspect, the computer program product provided in the fourth aspect, and the chip provided in the fifth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 is a schematic diagram of the hardware structure of an electronic device 100 provided in an embodiment of the present application;

[0058] Figure 2A to Figure 2D , Figure 3 , Figure 4 is a schematic diagram of the structure of some electronic devices 100 provided in the embodiments of the present application;

[0059] Figure 5A to Figure 5F It is a schematic diagram of some storage management scenarios provided by the embodiments of the present application;

[0060] Figure 6A to Figure 6C It is a schematic diagram of some storage management scenarios provided by the embodiments of the present application;

[0061] Figure 7A to Figure 7C It is a schematic diagram of some storage management scenarios provided by the embodiments of the present application;

[0062] Figure 8 is a flow chart of a storage management method provided by an embodiment of the present application;

[0063] Fig. 9 is a flow chart of another storage management method provided by an embodiment of the present application;

[0064] Fig.10 is a flow chart of another storage management method provided by an embodiment of the present application;

[0065] Fig.11 It is a structural diagram of an electronic device 100 provided in an embodiment of the present application. DETAILED DESCRIPTION

[0066] The technical solutions in the embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "a", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear indication to the contrary in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one or more (including two). The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in a "or" relationship.

[0067] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Thus, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways. The term "connection" includes direct connection and indirect connection, unless otherwise specified. "First" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated.

[0068] In the embodiments of the present application, the words "exemplarily" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplarily" or "for example" is intended to present related concepts in a specific way.

[0069] The term "user interface (UI)" in the following embodiments of the present application refers to the medium interface for interaction and information exchange between an application (APP) or an operating system (OS) and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that can be recognized by the user. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0070] Embodiments of the present application provide a storage management method and an electronic device. The electronic device includes a plurality of separate storage devices, and provides two usage modes to the user based on the working modes of the plurality of storage devices: an expansion mode and an external storage mode. In the expansion mode, the electronic device can mount all the plurality of storage devices on the internal storage. That is, the plurality of storage devices can be combined into a whole and work as internal storage. In the external storage mode, the electronic device can mount a part of the plurality of storage devices on the internal storage, and mount another part on the external storage. That is, the plurality of storage devices can be divided into internal storage and external storage. The user can manually set the usage mode to the expansion mode or the external storage mode, and can freely switch between the expansion mode and the external storage mode. When the usage mode is set to the external storage mode, the user can select the storage location of the data, for example, storing the data in the internal storage or the external storage.

[0071] In addition, in the external storage mode, the storage device used as external storage can also be equivalent to a mobile hard disk. Other electronic devices are connected to the electronic device containing the external storage through a transfer line to access the data in the external storage. Moreover, other electronic devices can access the data in the external storage without relying on the operation and security mechanism of the system in the electronic device containing the external storage. Therefore, even if the electronic device containing the external storage is in a stopped state (such as shutting down or the screen cannot be used), other electronic devices can access its external storage.

[0072] It can be seen that the electronic device can use multiple storage devices to provide users with two usage modes to meet the user's diverse storage needs. In addition, the storage device used as external storage is integrated inside the electronic device, does not need to be plugged in and out, has high stability and fast transmission rate. Compared with external storage devices that need to be plugged in and out, the external storage in this application can give users a better storage experience. When exporting data, the storage device used as external storage does not need to rely on the normal operation of the electronic device's own system. Therefore, in the external storage mode, the user can also use the electronic device as a mobile hard disk.

[0073] It should be noted that the embodiments of the present application do not limit the names of the usage modes of the above-mentioned storage devices. The above-mentioned expansion mode and external storage mode are only exemplary descriptions of the present application. For example, the expansion mode can also be called the internal storage mode. The external storage mode can also be called the hybrid storage mode.

[0074] In some embodiments, multiple separate storage devices in an electronic device may be storage devices of the same type. For example, these multiple separate storage devices may all be universal flash storage (UFS), or may be embedded multimedia memory cards (EMMC), etc. Optionally, multiple storage devices of the same type in an electronic device may also be storage devices supporting different storage protocols. For example, an electronic device includes multiple UFS. These multiple UFS may include a UFS that supports the UFS3.1 protocol, and a UFS that supports the UFS4.0 protocol. In some embodiments, multiple separate storage devices in an electronic device may also include different types of storage devices. For example, these multiple separate storage devices may include both UFS and EMMC. The embodiment of the present application does not limit the type of storage device in the electronic device.

[0075] In some embodiments, multiple separate storage devices in an electronic device may be storage devices with the same storage capacity. For example, the storage capacity of the storage devices in the electronic device may all be 128GB, or all 256GB, or all 1TB, etc. Alternatively, the storage capacity of multiple separate storage devices in the electronic device may also be different. The performance of EMMC is worse than that of UFS. Among them, EMMC can usually only support 256GB at most. UFS can support 1TB at most. The present application embodiment does not limit the storage capacity of the storage device in the electronic device.

[0076] In the subsequent embodiments of the present application, an electronic device is configured with two separate storage devices, and both of the two separate storage devices are UFS with a storage capacity of 1TB.

[0077] For ease of understanding, the “internal storage” and “external storage” involved in this application are introduced here.

[0078] In the operating system of an electronic device, all files and directories can be organized into an inverted tree structure starting with a root node. The tree structure can be called the directory structure of the operating system. The operating system can manage files and directories through the file system. The root directory of the operating system can be represented by " / ". The directory structure of the operating system may include directories corresponding to internal storage and directories corresponding to external storage. For example, the directory corresponding to the internal storage may be / data. The directory corresponding to the external storage may be / mnt / external or / storage. The directories corresponding to the above internal storage and external storage are only exemplary descriptions of the present application and should not be construed as limiting the present application.

[0079] Storage devices can be mounted on both internal storage and external storage. The above-mentioned mounting of storage devices can specifically include associating the storage device with an existing directory or file. That is to say, the electronic device can mount the storage device on the internal storage by associating the storage device with the directory of the internal storage. The electronic device can mount the storage device on the external storage by associating the storage device with the directory of the external storage. Among them, the storage device mounted on the internal storage can work as internal storage. The storage device mounted on the external storage can work as external storage. The file system in the electronic device can read and write data on the storage device mounted on the internal storage according to the directory of the internal storage, and read and write data on the storage device mounted on the external storage according to the directory of the external storage.

[0080] In some embodiments, internal storage can be used to store data directly related to the APP (for example, cache data generated during the use of the APP, data generated by code optimization during the APP runtime, data that the APP depends on for operation, etc.), as well as data with high privacy or sensitivity. The directories in the internal storage can be organized according to the APP package name. Each APP can have its own internal storage directory. The APP can store data related to itself under its own internal storage directory. The internal storage directory of an APP can be private, and other APPs have no access or need to apply for access rights.

[0081] External storage can be used to store data that is not private or sensitive, as well as data that an app wants to share with other apps. For example, image files from camera apps, files manually downloaded using browser apps, etc. External storage can be directly accessed by apps in electronic devices without requiring permissions.

[0082] In some embodiments, the electronic device may encrypt data stored in the internal storage. Optionally, the electronic device may also encrypt the storage device mounted on the internal storage. This can improve the security of the internal storage and better protect the data in the internal storage. The embodiments of the present application do not limit the implementation of the above data encryption and storage device encryption.

[0083] In some embodiments, multiple storage devices are integrated in the electronic device. One or more storage devices integrated in the electronic device can be mounted on the internal storage and work as internal storage. These one or more storage devices mounted on the internal storage can be collectively referred to as internal storage. One or more storage devices integrated in the electronic device can be mounted on the external storage and work as external storage. These one or more storage devices mounted on the external storage can be called built-in external storage. In some embodiments, an external storage device can be inserted into the electronic device, for example, a secure digital (SD) card, an on-the-go (OTG) card, a nano memory (NM) card, etc. The above-mentioned external storage device can be separated from the electronic device. When the above-mentioned external storage device is inserted, the electronic device can mount the storage device on the external storage. That is, the external storage can also include an external storage device.

[0084] In some embodiments, other devices can be connected to the electronic device through an adapter cable to access the external storage of the electronic device. Among them, the above-mentioned external storage can be equivalent to a mobile hard disk. When the electronic device is in a stopped state (such as shutting down or the screen is unusable), other devices can also read and write operations on the storage device mounted on the external storage in the electronic device. The above-mentioned adapter cable can also be called a data cable or other name. The embodiment of the present application does not limit the type of adapter cable. In other words, other devices can access the built-in external storage in the electronic device without relying on the operation of the electronic device's own system.

[0085] The structure of the electronic device 100 involved in this application is introduced below.

[0086] Figure 1 The schematic diagram of the hardware structure of the electronic device 100 is exemplarily shown.

[0087] like Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, a memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0088] It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0089] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0090] In some embodiments, the AP, modem processor, GPU, ISP, DSP, NPU and other processing units may be integrated on a single chip, which may be called a system on chip (SOC) or a system on chip.

[0091] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0092] The processor 110 may also be provided with a memory for storing instructions and data. In some examples, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0093] The USB interface 130 is an interface that complies with USB standard specifications, and may be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 may be used to connect a charger to charge the electronic device 100, or may be used to transmit data between the electronic device 100 and a peripheral device. It may also be used to connect headphones to play audio through the headphones.

[0094] The charging management module 140 is used to receive charging input from a charger. The charger can be a wireless charger or a wired charger. While the charging management module 140 charges the battery 142, it can also power the electronic device through the power management module 141.

[0095] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the memory 121, the display screen 194, the camera 193, and the wireless communication module 160.

[0096] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0097] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0098] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.

[0099] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0100] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.

[0101] The display screen 194 is used to display images, videos, etc. The display screen 194 may be a liquid crystal display screen, an OLED display screen, etc. The present application embodiment does not limit the material of the display screen 194. In some embodiments, the display screen 194 may also include a flexible folding screen. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0102] The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

[0103] The ISP is used to process data fed back by the camera 193. For example, when taking a photo, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, and the light signal is converted into an electrical signal. The camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye.

[0104] The camera 193 is used to capture still images or videos. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0105] The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0106] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can also continuously self-learn. Through NPU, applications such as intelligent cognition of electronic device 100 can be realized, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0107] The external memory interface 120 can be used to connect an external memory device that is physically independent of the electronic device 100, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory device communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos are stored in an external memory card. The external memory device can be mounted on the external storage of the electronic device 100.

[0108] The memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the memory 121. The memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc.

[0109] In some embodiments, the memory 121 may include a plurality of separate memory devices, which may include a memory device mounted on an internal memory of the electronic device 100 and a memory device mounted on an external memory of the electronic device 100 .

[0110] In some embodiments, the storage device mounted on the external storage in the memory 121 may also be connected to a switching circuit. The switching circuit may be used to enable other devices to access the storage device mounted on the external storage in the memory 121, so that other devices can read and write operations such as the external storage of the electronic device 100 without relying on the operation of the operating system in the electronic device 100.

[0111] In addition, the type of memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, UFS, EMMC, etc.

[0112] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0113] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some examples, the audio module 170 can be arranged in the processor 110, or some functional modules of the audio module 170 can be arranged in the processor 110. The speaker 170A, also known as the "speaker", is used to convert audio electrical signals into sound signals. The receiver 170B, also known as the "earpiece", is used to convert audio electrical signals into sound signals. The microphone 170C, also known as the "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone jack 170D is used to connect wired headphones.

[0114] The sensor module 180 may include a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a gravity sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, an angle sensor, and the like.

[0115] The buttons 190 include a power button, a volume button, etc. The motor 191 can generate a vibration prompt. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power change, messages, missed calls, notifications, etc.

[0116] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and separated from the electronic device 100 by inserting it into the SIM card interface 195 or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications. In some examples, the electronic device 100 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 100 and cannot be separated from the electronic device 100.

[0117] The electronic device 100 may be a mobile phone, a smart watch, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) or virtual reality (VR) device, etc. The embodiment of the present application does not impose any special restrictions on the specific type of the electronic device 100.

[0118] Figure 2A A schematic structural diagram of an electronic device 100 is exemplarily shown.

[0119] like Figure 2A As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0120] The hardware device may include one or more storage devices, for example, storage device s1, storage device s2. Storage devices may also be referred to as storage devices, etc. Not limited to storage devices, the hardware device may also include more content, such as display screens, cameras, etc. This application does not limit this.

[0121] The operating system of the electronic device 100 can divide the virtual memory into user space and kernel space. The virtual memory and the actual physical memory can be mapped. The kernel space can be an area that the operating system kernel can access, which is independent of ordinary applications and is a protected memory space. The user space is a memory area that ordinary applications can access.

[0122] The kernel space may include a block layer and a driver layer. The block layer may also be referred to as a block device layer or the like. The block layer may be used to provide a module interface for applications and file systems to access storage devices. The block layer may include one or more block devices, for example, block device 1, block device 2, and the like. In some embodiments, all codes under the block subdirectory in the operating system are block layers. Block devices may be represented by corresponding directories or files in the directory structure of the operating system. For example, the directory / dev / block / sda in the operating system may represent block device 1. The directory / dev / block / sdb in the operating system may represent block device 2. "sda" and "sdb" in the above directories may represent different storage devices in the electronic device 100. That is, block device 1 and block device 2 may be used by applications and file systems to access different storage devices, respectively.

[0123] The directories corresponding to the above block device 1 and block device 2 are only exemplary descriptions of the present application and should not be construed as limiting the present application. The block layer is not limited to block device 1 and block device 2, and may include more or fewer block devices.

[0124] The driver layer may include a storage driver. The storage driver may be used to control the storage device in the underlying hardware device and perform operations such as reading and writing on the storage device. Exemplarily, the storage device represented by "sda" in the directory corresponding to block device 1 may be storage device s1. The storage device represented by "sdb" in the directory corresponding to block device 2 may be storage device s2. Block device 1 may issue a read / write instruction to storage device s1 through the storage driver to read data from storage device s1 or write data to storage device s1. Block device 2 may issue a read / write instruction to storage device s2 through the storage driver to read data from storage device s2 or write data to storage device s2.

[0125] It should be noted that in order to more clearly show the control relationship between the block device in the block layer and the storage device, the example Figure 2A The driver layer shown shows two storage drivers, which both represent storage drivers in an electronic device and may be the same or different.

[0126] In some embodiments, the electronic device 100 can use a direct connection or protocol conversion method to implement multiple storage devices accessing the SOC on the storage driver side. Among them, the SOC can be designed with multiple paths for storage drive control of storage devices to support the access of multiple storage devices. Take the electronic device 100 including storage device S1 and storage device S2 as an example for explanation. If the storage protocol supported by the storage driver is the same as the storage protocol supported by the storage device S1 and the storage device S2, the storage driver can directly connect the storage device S1 and the storage device S2. If the storage protocol supported by the storage driver is different from the storage protocol supported by the storage device S1 (or storage device S2), the storage driver can be connected to the storage device S1 (or storage device S2) through a protocol conversion module. The protocol conversion module can convert the data from the storage driver into a format corresponding to the storage protocol supported by the storage device S1 (or storage device S2), and send it to the storage device S1 (or storage device S2). The protocol conversion module can also convert the data from the storage device S1 (or storage device S2) into a format corresponding to the storage protocol supported by the storage driver.

[0127] The embodiment of the present application does not limit the specific implementation method of the protocol conversion module.

[0128] In some embodiments, the storage driver in the electronic device 100 includes a small computer system interface (SCSI) driver (also referred to as a SCSI driver). The SCSI driver can directly connect to a storage device of the UFS type. The following introduces another structure of the electronic device 100 based on the SCSI driver and the UFS.

[0129] Figure 2B A schematic structural diagram of another electronic device 100 is exemplarily shown.

[0130] like Figure 2B As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0131] The user space may refer to the introduction of the aforementioned embodiment.

[0132] The hardware device may include ufs1 and ufs2. ufs1 and ufs2 may represent separate storage devices of the UFS type. For example, Figure 2A The storage device s1 shown may be ufs1, and the storage device s2 may be ufs2.

[0133] The kernel space can include the block layer and the driver layer. The block layer can refer to the above Figure 2A The driver layer may include a SCSI driver.

[0134] Since the scsi driver can be directly connected to ufs1 and ufs2, block device 1 can control ufs1 through the scsi driver, and block device 2 can control ufs2 through the scsi driver.

[0135] In some embodiments, the SOC of the electronic device 100 may be designed with two SCSI channels to respectively support ufs1 and ufs2 to be directly connected to the SCSI driver.

[0136] It should be noted that Figure 2B The two SCSI drivers shown in the driver layer are only for illustrating the control relationship between the block device in the block layer and the storage device. The two SCSI drivers can be the same.

[0137] In some embodiments, the storage capacity of ufs1 and ufs2 can both be 1 TB. In this way, the electronic device 100 can have a large storage space of 2 TB to meet the user's demand for storing a large amount of data.

[0138] In some embodiments, the storage driver in the electronic device 100 may include a SCSI driver and a USB driver. The storage protocol supported by the USB driver is different from that supported by the UFS. The storage protocol supported by the USB driver is the USB protocol. The protocol supported by the UFS is the UFS protocol. The USB driver and the UFS can be connected through a protocol conversion module. The structure of another electronic device 100 is introduced below based on the SCSI driver, the USB driver and the UFS.

[0139] Figure 2C A schematic structural diagram of another electronic device 100 is exemplarily shown.

[0140] like Figure 2C As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0141] The user space may refer to the introduction of the aforementioned embodiment.

[0142] The kernel space can include the block layer and the driver layer. The block layer can refer to the above Figure 2A The driver layer can include SCSI drivers and USB drivers.

[0143] The hardware device may include ufs1, ufs2, and a ufs and usb conversion module. ufs1 and ufs2 may refer to the aforementioned Figure 2B The ufs and usb conversion module is a protocol conversion module used to convert the UFS protocol to the USB protocol. The usb driver can connect to ufs2 through the ufs and usb conversion module.

[0144] In some embodiments, block device 1 can control ufs1 through a scsi driver. Block device 2 can issue a read instruction for ufs2 through a usb driver. The ufs and usb conversion module can convert the read instruction for ufs2 into a read instruction that conforms to the corresponding format of the UFS protocol. Then, ufs2 can send the read data to the ufs and usb conversion module according to the received read instruction. The ufs and usb conversion module can convert the data from ufs2 into data that conforms to the corresponding format of the USB protocol, and pass it to block device 2 through the usb driver. In this way, block device 2 can read the data stored in ufs2. In addition, block device 2 can issue a write instruction for ufs2 and data to be written in ufs2 through a usb driver. The ufs and usb conversion module can convert the write instruction for ufs2 and the data to be written into a write instruction and data to be written that conform to the corresponding format of the UFS protocol respectively. Then, ufs2 can store the data to be written according to the received write instruction.

[0145] The embodiment of the present application does not limit the specific implementation method of the above-mentioned UFS and USB conversion module.

[0146] In some embodiments, the SOC of the electronic device 100 may be designed with one SCSI channel and one USB channel. One SCSI channel can support a storage device of type UFS (such as ufs1) to be directly connected to the SCSI drive. One USB channel can support ufs2 to access the USB drive after the ufs and USB conversion modules perform protocol conversion. In other words, even if the SOC of the electronic device 100 does not have two SCSI channels, two storage devices of type UFS can be configured by protocol conversion. In this way, a large storage space (for example, 2TB) can be realized to meet the user's needs for storing large amounts of data.

[0147] It needs to be explained that Figure 2C The connection relationship of each device in the electronic device 100 is only an exemplary description of the present application and should not be construed as limiting the present application. Among them, the one connected to the SCSI driver may be usf2, and the one connected to the USB driver through the ufs to USB conversion module may be ufs1.

[0148] Optionally, two USB paths may be designed on the SOC of the electronic device 100. The two USB paths may respectively support ufs1 and ufs2 to be included in the USB driver after the ufs and USB conversion modules perform protocol conversion.

[0149] In some embodiments, the storage driver in the electronic device 100 may include a SCSI driver and a peripheral component interconnect express (PCIE) driver (which may be referred to as a PCIE driver). The storage protocol supported by the PCIE driver is different from that supported by the UFS. The storage protocol supported by the PCIE driver is the PCIE protocol. The PCIE driver and the UFS may be connected through a protocol conversion module. The following introduces another structure of the electronic device 100 based on the SCSI driver, the PCIE driver and the UFS.

[0150] Figure 2D A schematic structural diagram of another electronic device 100 is exemplarily shown.

[0151] like Figure 2D As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0152] The user space may refer to the introduction of the aforementioned embodiment.

[0153] The kernel space can include the block layer and the driver layer. The block layer can refer to the above Figure 2A The driver layer can include scsi driver and pcie driver.

[0154] The hardware device may include ufs1, ufs2, and ufs and pcie conversion modules. ufs1 and ufs2 may refer to the aforementioned Figure 2B The ufs and pcie conversion module is a protocol conversion module used to convert the UFS protocol to the PCIE protocol. The pcie driver can connect to ufs2 through the ufs and pcie conversion module.

[0155] In some embodiments, block device 1 can control ufs1 through scsi driver. Block device 2 can send read instructions for ufs2 through pcie driver. UFS and PCIE conversion module can convert the read instructions for ufs2 into read instructions that conform to the corresponding format of UFS protocol. Then, ufs2 can send the read data to ufs and PCIE conversion module according to the received read instructions. UFS and PCIE conversion module can convert the data from ufs2 into data that conforms to the corresponding format of PCIE protocol, and pass it to block device 2 through PCIE driver. In this way, block device 2 can read the data stored in ufs2. In addition, block device 2 can send write instructions for ufs2 and data to be written in ufs2 through PCIE driver. UFS and PCIE conversion module can convert the write instructions for ufs2 and the data to be written into the write instructions and data to be written that conform to the corresponding format of UFS protocol respectively. Then, ufs2 can store the data to be written according to the received write instructions.

[0156] The embodiment of the present application does not limit the specific implementation method of the above-mentioned UFS and PCIE conversion module.

[0157] In some embodiments, the SOC of the electronic device 100 may be designed with one SCSI channel and one PCIE channel. One SCSI channel can support a storage device of type UFS (such as ufs1) to be directly connected to the SCSI driver. One PCIE channel can support ufs2 to access the PCIE driver after the ufs and pcie conversion modules perform protocol conversion. In other words, even if the SOC of the electronic device 100 does not have two SCSI channels, two storage devices of type UFS can be configured by protocol conversion. In this way, large-capacity storage space (for example, 2TB) can be realized to meet the user's needs for storing large amounts of data.

[0158] It should be noted that Figure 2D The connection relationship of each device in the electronic device 100 is only an exemplary description of the present application and should not be construed as limiting the present application. Among them, the one connected to the SCSI driver may be usf2, and the one connected to the PCIE driver through the UFS and PCIE conversion module may be ufs1.

[0159] Optionally, two PCIe channels may be designed on the SOC of the electronic device 100. The two PCIe channels may respectively support UFS1 and UFS2 to be included in the PCIe driver after the UFS and PCIe conversion modules perform protocol conversion.

[0160] In some embodiments, multiple storage devices (e.g., storage device s1, storage device s2) in the electronic device 100 can be mounted on the internal storage. The mode in which multiple storage devices in the electronic device 100 work as internal storage can be called an expansion mode. The following introduces another structure of the electronic device 100 based on the expansion mode.

[0161] Figure 3 A schematic structural diagram of another electronic device 100 is exemplarily shown.

[0162] like Figure 3 As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0163] The hardware device can refer to the above Figure 2A Introduction.

[0164] The user space may include applications, storage management services, and internal storage modules. Among them, the applications may include but are not limited to: camera, gallery, Bluetooth, WLAN, map, settings, browser, music, communication applications, etc. The embodiments of the present application do not limit the applications in the user space.

[0165] The storage management service can be used to manage the usage mode of the storage device. For example, the storage management service can provide the user with a control for setting the usage mode of the storage device, so that the user can choose to set the usage mode of the storage device to the expansion mode or the external storage mode.

[0166] The storage management service may also be used to manage data stored in various storage devices in the electronic device 100 .

[0167] The internal storage module can be used to mount storage devices. The storage device mounted on the internal storage module can work as internal storage. In some embodiments, the internal storage module can be represented by the directory " / data" in the operating system. Among them, the electronic device 100 can mount the storage device s1 on the internal storage module by associating the storage device s1 with the directory " / data". Mounting the storage device on the internal storage module means mounting the storage device on the internal storage in this application. The directory corresponding to the above-mentioned internal storage module is only an exemplary description of this application and should not constitute a limitation on this application.

[0168] The kernel space can include the file system, block layer, and driver layer. The block layer and driver layer can refer to the above Figure 2AIntroduction.

[0169] The file system is a method and data structure used by the operating system to clarify files on a storage device or a storage device partition, that is, a method of organizing files on a storage device. The file system can organize and allocate the controls of the storage device, be responsible for file storage, and protect and retrieve the stored files. In some embodiments, the file system in the electronic device 100 can be a flash friendly file system (F2FS). F2FS is a log-structured file system designed specifically for flash devices. The implementation method of the file system is not limited in the embodiments of the present application.

[0170] In the expansion mode, the electronic device 100 can mount both the storage device s1 and the storage device s2 on the internal storage module. That is, the storage device s1 and the storage device s2 can be equivalent to a whole and work as internal storage. In some embodiments, the F2FS file system has a multi-device management mechanism. Based on the multi-device management mechanism, the electronic device 100 can mount the storage device s1 and the storage device s2 on the internal storage module.

[0171] In some embodiments, when an application needs to read / write data to the internal storage, the application may send a request to the internal storage module for reading / writing data. Then, the internal storage module may send a message to the file system indicating that the application requests to read / write data. The file system may send a command to read / write data to the block device 1. Figure 2A to Figure 2D As can be seen from the embodiment, block device 1 can read / write data through storage driver control storage device s1. Optionally, since storage device s2 is also mounted on the internal storage module, the file system can also send a read / write data instruction to block device 2. Figure 2A to Figure 2D As can be seen from the embodiment, the block device 2 can control the storage device s2 to read / write data through the storage driver.

[0172] That is to say, in the expansion mode, when the application needs to write data, the data to be written can be stored in the storage device s1 or the storage device s2, or part of the data can be stored in the storage device s1 and the other part can be stored in the storage device s2. Among them, since the storage device s1 and the storage device s2 are both used as internal storage, there is no difference between storing the data in the storage device s1 and storing the data in the storage device s2. The storage location of the data to be written can be allocated by the file system.

[0173] Depend on Figure 3It can be seen that in the expansion mode, multiple storage devices in the electronic device 100 can be mounted on the internal storage module as internal storage. This can expand the storage capacity of the internal storage in the electronic device 100 to meet the user's needs for storing large amounts of data. In addition, the storage location of the data can be allocated by the file system. The expansion mode can make the user unaware of the multiple storage devices, without the user manually allocating the storage location of the data.

[0174] In some embodiments, the electronic device 100 includes multiple storage devices, for example, storage device s1 and storage device s2. Among them, storage device s1 can be mounted on internal storage. Storage device s2 can be mounted on external storage. That is, part of the multiple storage devices in the electronic device 100 can work as internal storage, and another part can work as external storage. The mode in which part of the multiple storage devices in the electronic device 100 work as internal storage and another part work as external storage can be called external storage mode. The following introduces the structure of another electronic device 100 based on the external storage mode.

[0175] Figure 4 A schematic structural diagram of another electronic device 100 is exemplarily shown.

[0176] like Figure 4 As shown, the electronic device 100 may include a user space, a kernel space, and hardware devices.

[0177] For hardware devices and kernel space, please refer to the above Figure 2A Introduction.

[0178] The user space may include applications, storage management services, internal storage modules, and external storage modules. Figure 3 Introduction.

[0179] The external storage module can be used to mount the storage device. The storage device mounted on the external storage module can work as an external storage. In some embodiments, the external storage module can be represented by the directory " / mnt / external" in the operating system. Among them, the electronic device 100 can mount the storage device s2 on the external storage module by associating the storage device s2 with the directory " / mnt / external". Mounting the storage device on the external storage module means mounting the storage device on the external storage in this application. The directory corresponding to the above-mentioned external storage module is only an exemplary description of this application and should not constitute a limitation on this application.

[0180] In the external storage mode, the electronic device 100 can mount the storage device s1 on the internal storage module, and mount the storage device s2 on the internal storage module, that is, the storage device s1 can work as internal storage, and the storage device s2 can work as external storage.

[0181] In some embodiments, when an application needs to store data, the application can determine the storage location of the data to be written based on the sensitivity or privacy of the data to be written. For example, if the sensitivity or privacy of the data to be written is high, the application can write the data to the internal storage. If the sensitivity or privacy of the data to be written is low, the application can write the data to the external storage. Optionally, the storage location of the above-mentioned data to be written can be selected by the user. In other words, the user can choose to store the data in the external storage or the internal storage.

[0182] In the case of writing data to the internal storage, the application may send a request to the internal storage module for writing data. Then, the internal storage module may send a message to the file system indicating that the application requests to write data. The file system may send a command to write data to the block device 1. Figure 2A to Figure 2D As can be seen from the embodiment of the invention, block device 1 can control storage device s1 to write data through storage driver. In the case of writing data to external storage, the application can send a request for writing data to the external storage module. Then, the external storage module can send a request to the file system to instruct the application to request writing data. The file system can send a command to write data to block device 2. Figure 2A to Figure 2D As can be seen from the embodiment, the block device 2 can control the storage device s2 to write data through the storage driver.

[0183] It needs to be explained that Figure 4 The two file systems presented in the kernel space are only for illustrating the control relationship between the internal storage module and the external storage module over the storage device. The two file systems may be the same.

[0184] In some embodiments, the electronic device 101 can be connected to the electronic device 100 via an adapter cable. The electronic device 101 can access the data stored in the storage device S2 directly through the adapter cable without relying on the operation of the operating system of the electronic device 100. In other words, in the external storage mode, the storage device S2 can be equivalent to a mobile hard disk. Other devices, such as the electronic device 101, can also perform read / write operations on the storage device S2 when the electronic device 100 stops running (such as shutting down or the screen is unavailable). In this way, the user can store some data in the storage device S2 so that the data can be easily viewed or copied through the electronic device 101.

[0185] In some embodiments, both storage device s1 and storage device s2 can be UFS with a storage capacity of 1TB. Then, the internal storage space in the electronic device 100 is 1TB, and the external storage space is also 1TB. This can meet the user's needs for storing large amounts of data, and can facilitate the user to manage the storage location of the data, thereby improving the user's experience in data storage.

[0186] Depend on Figure 4 It can be seen that in the external storage mode, the multiple storage devices in the electronic device 100 can be divided into internal storage and external storage. Among them, the storage device as external storage is integrated in the electronic device 100, and its stability and transmission rate are better than those of the external plug-in external storage device. The user can read / write data to the above-mentioned external storage (that is, the storage device s2) anytime and anywhere without relying on network environments such as Wi-Fi or mobile data traffic. Compared with cloud storage, the external storage in the electronic device 100 in the external storage mode is stable and can be used without long-term renewal. The above-mentioned external storage mode can meet the needs of users for using external storage.

[0187] Compare the above Figure 3 and Figure 4 It can be seen that the electronic device 100 can always mount the storage device s1 on the internal storage module. The electronic device 100 can switch between the expansion mode and the external storage mode by adjusting the location where the storage device s2 is mounted. The storage device s2 can be used as both internal storage and external storage. The user can set the use mode to the expansion mode or the external storage mode according to the use needs, and can switch the use mode at any time. This can provide the user with the opportunity to select the working mode of the storage device in the electronic device 100 to meet the storage needs of different users.

[0188] Based on the structure of the above electronic device 100, some storage management scenarios provided by this application are introduced below.

[0189] Figure 5A to Figure 5F Some schematic diagrams of storage management scenarios are shown exemplarily.

[0190] like Figure 5A As shown, the electronic device 100 may display a user interface 510. The user interface 510 may include an internal storage control 511, a cloud storage control 512, a prompt message 513, a cleanup control 514, a usage mode setting control 515, and an internal storage management control 516.

[0191] The internal storage control 511 may be used to view the usage of the internal storage.

[0192] The cloud storage control 512 can be used to view the usage of the cloud storage space.

[0193] The user can view the usage of the internal storage or cloud storage space by selecting the internal storage control 511 or the cloud storage control 512. Figure 5A As shown, when the internal storage control 511 is in a selected state, the electronic device 100 can display prompt information 513.

[0194] The prompt information 513 may be used to indicate the usage of the internal storage. For example, the content of the prompt information 513 may be "210GB / 2TB used". This may indicate that the total capacity of the internal storage is 2TB, and 210GB is currently used. The storage device of the electronic device 100 may include ufs1 and ufs2. The capacity of ufs1 and ufs2 is 1TB, and both are mounted on the internal storage. Therefore, the total capacity of the internal storage of the electronic device 100 may be 2TB.

[0195] The content of the above prompt information 513 is only an exemplary description of the present application and shall not constitute a limitation to the present application.

[0196] The cleanup control 514 can be used to clean up the data in the internal storage.

[0197] The usage mode setting control 515 may be used to set the usage mode of the storage device.

[0198] The internal storage management control 516 can be used to manage the data stored in the internal storage. For example, in response to the operation of the internal storage management control 516, the electronic device 100 can display the data such as files stored in the internal storage, so that the user can perform management operations such as copying, transferring, and deleting the data in the internal storage.

[0199] In response to Figure 5A For the operation of using the mode setting control 515, the electronic device 100 can display Figure 5B The user interface 520 shown may include an expansion mode option 521 , expansion mode information 522 , an external storage mode option 523 , and external storage mode information 524 .

[0200] The expansion mode option 521 can be used to set the usage mode of the storage device to the expansion mode. Figure 5B The selected state shown may indicate that the current usage mode of the storage device is the capacity expansion mode.

[0201] The external storage mode option 523 may be used to set the usage mode of the storage device to the external storage mode.

[0202] The expansion mode information 522 can be used to remind the user of the function of the expansion mode. The external storage mode information 524 can be used to remind the user of the function of the external storage mode. The present application does not limit the specific contents of the expansion mode information 522 and the external storage mode information 524.

[0203] In response to Figure 5B By operating the external storage mode option 523, such as clicking, the electronic device 100 can detect whether it is currently possible to switch from the expansion mode to the external storage mode. If it is currently possible to switch from the expansion mode to the external storage mode, the electronic device 100 can adjust the mounting position of the storage device s2, changing the mounting position of the storage device s2 from internal storage to external storage.

[0204] In some embodiments, the above-mentioned usage mode switching takes effect after the electronic device 100 is restarted. The electronic device 100 may display Figure 5C Prompt box 525 is shown. Prompt box 525 can be used to prompt the user to restart the device.

[0205] The prompt box 525 may include an immediate restart control 525A and a later restart control 525B. The immediate restart control 525A may be used to trigger the electronic device 100 to restart immediately. The later restart control 525B may be used to restart the device at a later time. In response to the operation of the immediate restart control 525A, the electronic device 100 may restart. After the restart is completed, the usage mode of the storage device in the electronic device 100 may be an external storage mode.

[0206] In the external storage mode, the electronic device 100 can Figure 5D User interface 530 is shown. User interface 530 may include internal storage control 511, cloud storage control 512, external storage control 517, prompt information 531, cleanup control 514, usage mode setting control 515, and internal storage management control 516.

[0207] The internal storage control 511 and the cloud storage control 512 can refer to the aforementioned Figure 5A Introduction.

[0208] The external storage control 517 may be used to view the usage of the external storage.

[0209] Prompt information 531 can be used to indicate the usage of internal storage. For example, the content of prompt information 531 can be "210GB / 1TB used". This can mean that the total capacity of the internal storage is 1TB, and 210GB is currently used. The storage device of electronic device 100 can include ufs1. The capacity of ufs1 is 1TB, and it is mounted on the internal storage. Therefore, the total capacity of the internal storage of electronic device 100 can be 1TB. Figure 5A and Figure 5D It can be seen that when switching from the expansion mode to the external storage mode, the total capacity of the internal storage changes from 2TB to 1TB. Among them, the storage device that is part of the internal storage in the expansion mode is converted into external storage in the external storage mode. Therefore, after the above-mentioned use mode switching, the total capacity of the internal storage decreases.

[0210] like Figure 5D As shown, in response to the operation of the external storage control 517, the electronic device 100 may display Figure 5E User interface 530 is shown.

[0211] like Figure 5E As shown, the selected control is indicated by Figure 5D The internal storage control 511 shown changes to Figure 5E The external storage control 517 is shown. When the external storage control 517 is in a selected state, the user interface 530 may include a prompt message 532, a cleanup control 533, a usage mode setting control 515, and an external storage management control 534.

[0212] The prompt information 532 may be used to indicate the usage of the external storage. For example, the content of the prompt information 532 may be "0GB / 1TB used". This may indicate that the total capacity of the external storage is 1TB, and the storage space of the current external storage has not been used. The storage device of the electronic device 100 may include ufs2. The capacity of ufs2 is 1TB, and it is mounted on the external storage. Therefore, the total capacity of the external storage of the electronic device 100 may be 1TB.

[0213] The cleanup control 533 can be used to clean up data in the external storage.

[0214] The external storage management control 534 may be used to manage data stored in the external storage.

[0215] In response to Figure 5E For the operation of using the mode setting control 515, the electronic device 100 can display Fig. 5F The user interface 520 is shown. The user interface 520 may refer to the description of the above embodiment. The user interface 520 may include an expansion mode option 521 and an external storage mode option 523. Among them, the external storage mode option 523 is in a selected state, which may indicate that the current usage mode of the storage device is the external storage mode.

[0216] In external storage mode, users can also click Fig. 5F The expansion mode option 521 shown switches the usage mode to the expansion mode. In some embodiments, the switching from the external storage mode to the expansion mode can take effect after the electronic device 100 is restarted.

[0217] Figure 6A to Figure 6C Some schematic diagrams of storage management scenarios are shown exemplarily.

[0218] like Fig. 6A As shown, the electronic device 100 can display a user interface 510. The user interface 510 can refer to the introduction of the aforementioned embodiment. The user interface 510 may include an internal storage control 511, a prompt message 518, and a usage mode setting control 515. When the internal storage control 511 is in a selected state, the prompt message 518 can be used to indicate the usage of the internal storage. For example, the content of the prompt message 518 may be "1TB+200GB / 2TB used". This may indicate that the total capacity of the internal storage is 2TB, and 1TB+200GB is currently in use. The internal storage in the electronic device 100 may be composed of 2 UFSs (such as ufs1 and ufs2) each with a capacity of 1TB. It can be seen that the amount of data currently stored in the internal storage of the electronic device 100 has exceeded the capacity of 1 UFS.

[0219] In response to Fig. 6A For the operation of using the mode setting control 515, the electronic device 100 can display Figure 6B The user interface 520 shown in FIG. 5 may refer to the description of the above embodiment for the user interface 520. The user interface 520 may include an expansion mode option 521 and an external storage mode option 523. The expansion mode option 521 is selected, which may indicate that the current usage mode of the storage device is the expansion mode. Figure 6B The operation of the external storage mode option 523 is shown, and the electronic device 100 can detect whether it is currently possible to switch from the expansion mode to the external storage mode.

[0220] Specifically, the electronic device 100 can detect whether the amount of data currently stored internally exceeds the capacity of the storage device that is always mounted on the internal storage. For example, ufs1 is a storage device that is always mounted on the internal storage (i.e., in expansion mode and external storage mode). The capacity of ufs1 is 1TB. If the amount of data currently stored internally exceeds 1TB, it is currently not possible to switch from expansion mode to external storage mode. If the amount of data currently stored internally does not exceed 1TB, it is currently possible to switch from expansion mode to external storage mode.

[0221] Depend on Fig. 6A It can be seen that the amount of data currently stored in the internal storage of the electronic device 100 has exceeded 1TB. Therefore, the electronic device 100 can display Figure 6C The prompt box 526 is shown. The prompt box 526 can be used to prompt the user to clean up the data and reduce the amount of data in the internal storage before switching to the external storage mode.

[0222] As can be seen from the above scenario, in the expansion mode, the user does not need to be aware of the existence of multiple storage devices in the electronic device 100. These multiple storage devices can be combined into a whole and used as internal storage for the user. The user does not need to manually allocate the storage location of the data. In the external storage mode, the user can view and manage the internal storage and external storage in the electronic device 100 respectively. The above expansion mode and external storage mode can be switched between each other. This can meet the storage needs of different users.

[0223] Figure 7A to Figure 7C Some schematic diagrams of storage management scenarios are shown exemplarily.

[0224] like Fig. 7A As shown, the electronic device 100 may display a user interface 710. The user interface 710 may include a document option 711 and a download control 712. The document option 711 may be, for example, an option corresponding to a name of "XX document". The download control 712 may be used to download the document corresponding to the document option 711. Fig. 7A As shown in the operation of the download control 712, the electronic device 100 can detect whether the electronic device 100 has external storage.

[0225] For example, when it is detected that the electronic device 100 has an external storage, the electronic device 100 may display Figure 7B Prompt box 713 is shown. Prompt box 713 can be used to ask the user where the data is stored.

[0226] like Figure 7B As shown, the prompt box 713 may include an internal storage option 713A, an external storage option 713B, a confirmation control 713C, and a cancel control 713D. The internal storage option 713A can be used to select to store data in the internal storage. The external storage option 713B can be used to select to store data in the external storage. The confirmation control 713C can be used to trigger the electronic device 100 to store data according to the option selected in the prompt box 713. The cancel control 713D can be used to cancel the download.

[0227] In response to Figure 7B The operation of the external storage option 713B is shown in FIG. 1 . The electronic device 100 may display the external storage option 713B as Figure 7C In response to Figure 7C As shown in the operation of the determination control 713C, the electronic device 100 can download Fig. 7A The document corresponding to the document option 711 is stored in the external storage. For example, the storage device s2 in the electronic device 100 is mounted on the external storage. The electronic device 100 can store the document corresponding to the document option 711 in the storage device s2.

[0228] In some embodiments, the electronic device 100 may move some data stored in the internal storage to the external storage, or move some data stored in the external storage to the internal storage according to user operations.

[0229] As can be seen from the above scenario, in the external storage mode, the user can choose to store data in the internal storage or external storage as needed. In addition, since the above external storage is integrated in the electronic device 100, the transmission rate and stability are both high. Compared with external external storage or cloud storage, the built-in external storage in this application can bring a better storage experience to the user.

[0230] Figure 8 The flowchart of a storage management method provided by the present application is exemplified.

[0231] Figure 8 The storage management method shown is used to illustrate the specific process of determining the storage device usage mode in the power-on scenario of the electronic device 100. Figure 8 As shown, the method may include steps S811 to S827.

[0232] 1. (S811-S818) Determine the usage mode of the storage device during the startup phase.

[0233] S811, turn on the computer.

[0234] The electronic device 100 receives a power-on or restart operation and can be powered on.

[0235] S812: Determine whether there are multiple storage devices.

[0236] In some embodiments, the directory structure of the operating system of the electronic device 100 may include directories corresponding to all storage devices in the electronic device 100. The electronic device 100 may traverse the nodes of the storage device to determine the number of storage devices in the electronic device 100.

[0237] If the electronic device 100 has a plurality of storage devices, the electronic device 100 may perform the following step S813 .

[0238] If the electronic device 100 has only one storage device, the electronic device 100 may perform the following step S818.

[0239] Here, the electronic device 100 includes two storage devices: storage device s1 and storage device s2. Storage device s1 can also be called a primary storage device, and storage device s2 can also be called a secondary storage device.

[0240] S813: Determine whether at least one of the storage devices is configured with a mode mark.

[0241] In the case that the electronic device 100 includes a plurality of storage devices, the electronic device 100 may determine whether one of the storage devices is configured with a mode flag.

[0242] Specifically, the electronic device 100 can determine whether the storage device s2 is configured with a mode mark. The mode mark may include an expansion mode mark and an external storage mode mark. Among them, the expansion mode mark can be used to indicate that the storage device s2 is internal storage. The external storage mode mark can be used to indicate that the storage device s2 is external storage. The above-mentioned mode mark can be stored in the storage device s2, for example, in a storage area at the front end of the storage device s2. The above-mentioned mode mark can be added by the electronic device 100 according to the usage mode set by the user. The embodiment of the present application does not limit the specific content of the above-mentioned expansion mode mark and external storage mode mark.

[0243] The fact that the storage device s2 is configured with a mode mark may indicate that the user has set a usage mode of the storage device in the electronic device 100. The fact that the storage device s2 is not configured with a mode mark may indicate that the user has not set a usage mode of the storage device in the electronic device 100.

[0244] Since the electronic device 100 must have internal storage, at least one storage device in the electronic device 100 must be mounted on the internal storage. For example, the storage device s1 in the electronic device 100 can always be mounted on the internal storage. Therefore, the electronic device 100 does not need to determine whether the storage device s1 has a mode flag.

[0245] If the storage device s2 has a mode flag, the electronic device 100 may perform the following step S814.

[0246] If the storage device s1 does not have a mode flag, the electronic device 100 may perform the following step S818 .

[0247] S814: Determine whether the mode mark is a capacity expansion mode mark or an external storage mode mark.

[0248] S815. Mount two storage devices on the internal storage.

[0249] If the mode mark in the storage device s2 is the capacity expansion mode mark, the electronic device 100 can mount the storage device s1 and the storage device s2 on the internal storage.

[0250] S816. Mount storage device s1 on the internal storage, and mount storage device s2 on the external storage.

[0251] If the mode mark in the storage device s2 is an external storage mode mark, the electronic device 100 can mount the storage device s1 on the internal storage and mount the storage device s2 on the external storage.

[0252] In some embodiments, the electronic device 100 may be based on the aforementioned Figure 3 The storage device s1 and the storage device s2 are mounted using the multi-device management mechanism of the file system. The specific implementation method of mounting the storage device s1 and the storage device s2 is not limited in the embodiment of the present application.

[0253] S817. The boot process is complete and the desktop is displayed.

[0254] After the storage device s1 and the storage device s2 are both mounted (ie, step S815 or S816 ), the electronic device 100 may display the desktop so that the user can use the electronic device 100 normally.

[0255] The embodiment of the present application does not limit the execution order of the above step S817 and the above steps S812 to S816. In some embodiments, one or more of the electronic device 100 determining whether it has multiple storage devices, determining whether the storage device s2 has an expansion mode mark or an external storage mode mark, and mounting the storage device s1 and the storage device s2 can also be performed after the electronic device 100 displays the desktop.

[0256] S818. Mount the storage device s1 on the internal storage.

[0257] In the case that the electronic device 100 has only one storage device, for example, the storage device s1 , the electronic device 100 may mount the storage device s1 on the internal storage.

[0258] When the electronic device 100 has the storage device s1 and the storage device s2 and the storage device s2 is not configured with a mode flag, the electronic device 100 may mount the storage device s1 on the internal storage.

[0259] In some embodiments, the situation where the storage device s2 is not configured with a mode mark usually occurs when the electronic device 100 is powered on for the first time, or when the electronic device 100 is powered on for the first time after restoring the factory settings. When the electronic device 100 is powered on for the first time, the electronic device 100 can provide the user with a first-time power-on guide, and prompt the user to set the usage mode of the storage device during the guidance process.

[0260] 2. (S819-S827) When the computer is turned on for the first time, the user is guided to set the usage mode of the storage device.

[0261] S819, provide first-time startup instructions.

[0262] The first boot guide can be used to guide the user to complete the information that needs to be set when the electronic device 100 is turned on for the first time, so as to help the user become familiar with the operation and use of the electronic device 100. For example, the first boot guide may include guiding the user to set the device account name and password, set the usage mode of the storage device, set the display style of the desktop of the electronic device 100, etc. The embodiment of the present application does not limit the content of the first boot guide.

[0263] S820. Provide options corresponding to the capacity expansion mode and the external storage mode.

[0264] During the first boot guidance process, the electronic device 100 may provide options corresponding to the expansion mode and the external storage mode for the user to set the usage mode of the storage device.

[0265] S821. Determine whether the user selects the capacity expansion mode or the external storage mode.

[0266] S822. Configure an external storage mode flag for the storage device s2.

[0267] If the user selects the external storage mode, the electronic device 100 may configure an external storage mode flag for the storage device s2.

[0268] S823. Mount storage device s2 in external storage.

[0269] S824. Complete the first boot guide and display the desktop.

[0270] S825. Configure an expansion mode flag for the storage device s2.

[0271] If the user selects the capacity expansion mode, the electronic device 100 may configure the capacity expansion mode mark for the storage device s2.

[0272] S826. Complete the first boot guide.

[0273] S827, Restart.

[0274] In some embodiments, each storage device in the electronic device 100 needs to be remounted each time the electronic device 100 is turned on. Among them, in a single-startup scenario, the internal storage of the electronic device 100 does not support the update of the mounted device. That is to say, when the internal storage is mounted by a device once, the electronic device 100 needs to restart the device to subsequently adjust the storage devices mounted on the internal storage (for example, increase the storage devices mounted on the internal storage). After restarting the device, the electronic device 100 can mount the corresponding storage devices on the internal storage at one time. Therefore, it can be seen from the aforementioned step S818 that the electronic device 100 has mounted the storage device s1 on the internal storage. After step S825, the electronic device 100 needs to add a mounted storage device on the internal storage: storage device s2. Then, the electronic device 100 can restart and implement the mounting of storage devices s1 and storage devices s2 on the internal storage according to the aforementioned steps S811 to S815.

[0275] In some embodiments, the above step S827 is optional. In a single boot scenario, the internal storage of the electronic device 100 can support the update of the mounted device. That is to say, when the internal storage is mounted by a device once, the electronic device 100 can subsequently adjust the storage device mounted on the internal storage without restarting the device. Among them, when the user selects the expansion mode, in addition to executing step S825, the electronic device 100 can also mount the storage device s2 on the internal storage. Finally, after the electronic device 100 completes the first boot instructions, the desktop can be displayed for the user to use the electronic device 100 normally. It can be seen that if the user selects the expansion mode during the first boot process, the storage device s1 and the storage device s2 can both be mounted on the internal storage without restarting the electronic device 100.

[0276] In some embodiments, when the electronic device 100 is powered on for the first time, the usage mode of the storage device can be set to the expansion mode by default. When the above step S813 is executed to determine that all storage devices in the electronic device 100 are not configured with a mode mark, the electronic device 100 executes step S818, and in addition to mounting the storage device s1 on the internal storage, the storage device s2 can also be mounted on the internal storage, and the expansion mode mark can be configured for the storage device s2. Afterwards, the user can adjust the usage mode of the storage device during the first boot guidance process or after the boot is completed.

[0277] In some embodiments, when the electronic device 100 is powered on for the first time, the usage mode of the storage device may be set to the external storage mode by default. When the above step S813 is executed to determine that all storage devices in the electronic device 100 are not configured with a mode mark, the electronic device 100 executes step S818, and in addition to mounting the storage device s1 on the internal storage, the storage device s2 may also be mounted on the external storage, and the storage device s2 may be configured with an external storage mode mark. Afterwards, the user may adjust the usage mode of the storage device during the first boot guidance process or after the boot is completed.

[0278] In some embodiments, the above step S818 may be performed after step S822 or step S825. Exemplarily, when there are multiple storage devices in the electronic device 100, and none of the multiple storage devices are configured with a mode mark, the electronic device 100 may instruct the user to set the usage mode of the storage device (i.e., step S820). When the user selects the external storage mode, the electronic device 100 may execute step S822, and mount the storage device s1 on the internal storage, and mount the storage device s2 on the external storage. When the user selects the expansion mode, the electronic device 100 may execute step S825, and mount the storage device s1 and the storage device s2 on the internal storage. In this way, regardless of whether the internal storage of the electronic device 100 supports the update of the mounted device, the external storage mode and the expansion mode can take effect without restarting the electronic device 100 after completing the first boot instructions.

[0279] Among them, when the electronic device 100 provides the first power-on guidance, the first setting that the user is guided to perform may be to set the usage mode of the storage device. In this way, the electronic device 100 can mount all storage devices in the electronic device 100 according to the usage mode set by the user. Afterwards, the electronic device 100 can store one or more pieces of information entered by the user during the first power-on guidance process in the internal storage and / or external storage. Setting the first item in the first power-on guidance to set the usage mode of the storage device can improve the efficiency of the electronic device 100 in mounting the storage device, and the external storage mode and the expansion mode can take effect immediately after the user settings are completed, without restarting the electronic device 100.

[0280] Optionally, when the electronic device 100 provides the first power-on instructions, setting the usage mode of the storage device may not be the first setting of the first power-on instructions. Before setting the usage mode of the storage device, the electronic device 100 may not mount any storage device and temporarily store one or more information entered by the user in the memory. When instructing the user to set the usage mode of the storage device, the electronic device 100 may mount all storage devices in the electronic device 100 according to the usage mode set by the user. Then, the electronic device 100 may store one or more information temporarily stored in the memory before setting the usage mode of the storage device to the internal storage and / or external storage. The above method can also improve the efficiency of the electronic device 100 in mounting storage devices, and the external storage mode and the expansion mode can take effect immediately after the user settings are completed, without restarting the electronic device 100.

[0281] It should be noted that the above steps S819 to S827 are optional. In other words, setting the usage mode of the storage device is optional in the first boot guidance. For example, during the first boot guidance, the electronic device 100 may prompt the user to set the usage mode of the storage device. However, the user may choose to skip setting the usage mode of the storage device and set the usage mode of the storage device by himself after the first boot guidance is completed. For another example, the content of the first boot guidance does not include setting the usage mode of the storage device.

[0282] By the above Figure 8 It can be seen from the method shown that the user can set the usage mode of the storage device to the expansion mode or the external storage mode as needed when the electronic device 100 is turned on for the first time. In addition, the electronic device 100 can mount the storage device according to the mode mark on the storage device to achieve the expansion mode or the external storage mode. Therefore, after the electronic device 100 is turned on, the mode mark of the storage device can also be modified according to the user operation to achieve the switching of the usage mode of the storage device. This can better meet the storage needs of the user.

[0283] Fig. 9 The flowchart of another storage management method provided by the present application is exemplified.

[0284] Fig. 9 The storage management method shown is used to illustrate the specific process of switching the usage mode of the storage device from the expansion mode to the external storage mode. Fig. 9 As shown, the method may include steps S911 to S918.

[0285] S911: Receive an operation of switching from capacity expansion mode to external storage mode.

[0286] The above operation of switching from expansion mode to external storage mode can refer to the above Figure 5BThe operation of the external storage mode option 523 is shown. The content of the operation is not limited in the embodiment of the present application.

[0287] S912: Detect whether the storage device s2 stores data.

[0288] If the storage device s2 stores data, the electronic device 100 may execute the following step S913 .

[0289] If the storage device s2 does not store any data, the electronic device 100 may execute the following step S915.

[0290] S913 , detecting whether the remaining space of the storage device s1 can accommodate the data in the storage device s2 .

[0291] It is understandable that in the expansion mode, both storage device s1 and storage device s2 are used as internal storage. The data stored in storage device s2 belongs to the data stored in the internal storage. When the expansion mode needs to be switched to the external storage mode, storage device s2 needs to be converted from internal storage to external storage. Therefore, the electronic device 100 needs to transfer the data originally stored in storage device s2 to storage device s1.

[0292] When the remaining space of the storage device s1 can accommodate the data in the storage device s2 , the electronic device 100 can directly move all the data in the storage device s2 to the storage device s1 (ie, step S914 ).

[0293] When the remaining space of the storage device s1 cannot accommodate the data in the storage device s2, the electronic device 100 may perform the following step S918. For example, in the expansion mode, the amount of data stored in the storage device s2 is 150 GB. The remaining space of the storage device s1 is 100 GB. This 100 GB space cannot accommodate the 150 GB of data in the storage device s2.

[0294] In some embodiments, when the data in the storage device s2 supports compression, the electronic device 100 can detect whether the remaining space of the storage device s1 can accommodate the data in the storage device s2 based on the compression ratio. The above compression ratio can represent the ratio of the amount of data after compression to the amount of data before compression when the data is compressed using data compression technology. For example, the compression ratio is 0.5. The amount of data of 150GB becomes 75GB after compression. If the data in the storage device s2 can be stored in the storage device s1 after compression, the electronic device 100 can execute the following step S914. Among them, when executing step S914, the electronic device 100 can compress the data in the storage device s2 and then store it in the storage device s1. If the amount of data in the storage device s2 after compression is still greater than the capacity of the remaining space of the storage device s1, the electronic device 100 can execute the following step S918.

[0295] The electronic device 100 is not limited to compressing the data in the storage device s2, and can also compress the data in the storage device s1. After the data in the storage device s1 is compressed, the storage device s1 can free up more remaining space for the electronic device 100 to store the data transferred from the storage device s2. In other words, the electronic device 100 can compress the data of one or more storage devices included in the electronic device 100.

[0296] In some embodiments, the above detection of whether the remaining space of the storage device s1 can accommodate the data in the storage device s2 can be performed by the aforementioned Figure 3 The file system shown is complete.

[0297] S914, move all the data in the storage device s2 to the storage device s1.

[0298] In some embodiments, the file system in the electronic device 100 may move all data in the storage device s2 to the storage device s1.

[0299] S915 . Change the mode flag of the storage device s2 from the capacity expansion mode flag to the external storage mode flag.

[0300] S916. Prompt the user to restart the device before the mode switch takes effect.

[0301] The scenario in which the electronic device 100 prompts the user to restart the device can refer to the aforementioned Figure 5C The scene shown.

[0302] S917, reboot.

[0303] S918. Prompt the user that there is too much data and that the user needs to clean up the data before switching to another mode.

[0304] The electronic device 100 can refer to the above-mentioned scenario where it prompts the user that the data is too much. Figure 6C The scene shown.

[0305] In some embodiments, when the remaining space of storage device s1 cannot accommodate the data in storage device s2, electronic device 100 may ask the user whether to format storage device s2. If the user agrees to format storage device s2, electronic device 100 may format storage device s2 and execute steps S916 to S917.

[0306] In some embodiments, when the remaining space of the storage device s1 cannot accommodate the data in the storage device s2, the electronic device 100 can move some of the data with high privacy or sensitivity to the storage device s1 based on the privacy or sensitivity of the data in the storage device s2. Among them, the data with low privacy or sensitivity can continue to be stored in the storage device s2. Then, the electronic device 100 can perform the above steps S915 to S916. In this way, the expansion mode can be quickly switched to the external storage mode, and the user does not need to spend time and energy to clean up the data in the storage device s2.

[0307] In some embodiments, when switching from the expansion mode to the external storage mode, the electronic device 100 can also move part or all of the data in the storage device s2 to the storage device s1 in response to the user's data migration operation. In other words, the user can select the data to be moved from the storage device s2 to the storage device s1. Optionally, the electronic device 100 is not limited to moving the data in the storage device s2 to the storage device s1, and one or more data in the storage device s1 can also be moved to the storage device s2.

[0308] In some embodiments, the above steps S916 and S917 are optional. In addition to executing step S915, the electronic device 100 can also cancel the mounting of the storage device s2 on the internal storage and mount the storage device s2 on the external storage. The switching of the use mode of the storage device from the expansion mode to the external storage mode takes effect without restarting the electronic device 100.

[0309] Fig.10 The flowchart of another storage management method provided by the present application is exemplified.

[0310] Fig.10 The storage management method shown is used to illustrate the specific process of switching the usage mode of the storage device from the external storage mode to the expansion mode. Fig.10 As shown, the method may include steps S1011 to S1018.

[0311] S1011. Receive an operation of switching from an external storage mode to a capacity expansion mode.

[0312] The above operation of switching from external storage mode to expansion mode can refer to the above Fig. 5F The operation of the expansion mode option 521 is shown. The content of the operation is not limited in the embodiment of the present application.

[0313] S1012: Detect whether the storage device s2 stores data.

[0314] If the storage device s2 stores data, the electronic device 100 may execute the following step S1013 .

[0315] If the storage device s2 does not store any data, the electronic device 100 may execute the following step S1015 .

[0316] S1013. Determine whether the user accepts formatting of the storage device s2.

[0317] In the external storage mode, the storage device s2 is used as the external storage. The data stored in the storage device s2 belongs to the data stored in the external storage. When the external storage mode needs to be switched to the expansion mode, the storage device s2 needs to be converted from the external storage to the internal storage. The electronic device 100 can prompt the user to format the storage device s2.

[0318] If the user agrees to format the storage device s2, the electronic device 100 may execute the following step S1014.

[0319] If the user does not agree to format the storage device s2, the electronic device 100 may perform the following step S1018.

[0320] S1014. Format the storage device s2.

[0321] S1015 . Change the mode flag of the storage device s2 from the external storage mode flag to the capacity expansion mode flag.

[0322] S1016. Prompt the user to restart the device for the mode switch to take effect.

[0323] S1017, Restart.

[0324] S1018, prompting the user that the mode switching cannot be completed, and the storage device s2 needs to be formatted to switch to the expansion mode.

[0325] In some embodiments, the above steps S1012, S1013 and S1018 are optional. In the case that the storage device s2 stores data, the electronic device 100 can retain the data therein and execute steps S1015 to S1017. That is to say, when switching from the external storage mode to the expansion mode, the electronic device 100 does not need to format the data stored in the storage device s2. Alternatively, when switching to the expansion mode, the electronic device 100 can also move part or all of the data in the storage device s2 to the storage device s1. Among them, before the electronic device 100 moves the data in the storage device s2 to the storage device s1, the data in the storage device s1 and / or the storage device s2 can be compressed. In this way, the external storage mode can be quickly switched to the expansion mode without the user having to format the data in the storage device s2.

[0326] In some embodiments, the above steps S1016 and S1017 are optional. In addition to executing step S1015, the electronic device 100 can also cancel the mounting of the storage device s2 on the external storage and mount the storage device s2 on the internal storage. The switching of the use mode of the storage device from the external storage mode to the expansion mode takes effect without restarting the electronic device 100.

[0327] In some embodiments, when storage device s2 is used as internal storage, storage device s2 needs to be encrypted, and data stored in storage device s2 also needs to be encrypted. When storage device s2 is used as external storage, storage device s2 does not need to be encrypted, and data stored in storage device s2 does not need to be encrypted. Therefore, when switching from expansion mode to external storage mode, electronic device 100 can cancel encryption of storage device s2, and there is no need to encrypt data when data is stored in storage device s2. When switching from external storage mode to expansion mode, electronic device 100 can encrypt storage device s2, and encrypt data when data is stored in storage device s2.

[0328] In some embodiments, in the external storage mode, other devices can be connected to the electronic device 100 via a switching cable and access the external storage in the electronic device 100 via the switching cable.

[0329] Please refer to Fig.11 , Fig.11 A structural diagram of an electronic device 100 is exemplarily shown.

[0330] The electronic device 100 may include internal storage, external storage and a switching circuit. The switching circuit may be used for other devices to access the external storage through a switching line. The internal storage may include a storage device that works as an internal storage, such as a storage device s1. The external storage may include a storage device that works as an external storage, such as a storage device s2.

[0331] The electronic device 101 can be connected to the electronic device 100 through a transfer line. Among them, the electronic device 101 can access the transfer circuit of the electronic device 100 through the transfer line, and access the external storage of the electronic device 100 through the transfer circuit. The type of the above-mentioned transfer line may include a USB transfer line, etc. This embodiment of the application is not limited to this. The electronic device 101 accesses the external storage of the electronic device 100 without relying on the operation of the electronic device 100 system itself. In other words, even if the electronic device 100 is in a stopped state (for example, shut down, or the screen cannot be used, etc.), the electronic device 101 can also realize read / write control of the external storage of the electronic device 100 through the transfer line. In this way, the user can back up the data to the external storage of the electronic device 100. Even if the electronic device 100 is shut down or has problems such as operating failures, the user can also connect the electronic device 100 through the electronic device 101 in real time to view the data backed up in the external storage of the electronic device 100. This can improve the user's storage experience.

[0332] In some embodiments, when the electronic device 100 is connected to the electronic device 101 through a transfer line, when the electronic device 100 satisfies a first condition, the electronic device 101 can access the data in the internal storage of the electronic device 100 through the transfer line. The above-mentioned first condition may include that the electronic device 100 receives an operation authorized by the user and / or the operating system of the electronic device 100 is in a running state. The above-mentioned user-authorized operation can be used to authorize the electronic device 101 to access the internal storage of the electronic device 100. In addition, the internal storage of the electronic device 100 has a binding relationship with the processor or SOC of the electronic device 100. Among them, the storage device (such as the storage device s1) as the internal storage can be accessed by the electronic device 101 when it is located in the electronic device 100. The processor or SOC of the electronic device 100 can read the data in the internal storage and transmit the data to the electronic device 101 through the transfer line. If the storage device as the internal storage in the electronic device 100 is taken out from the electronic device 100, the storage device is generally not accessible by the electronic device 101 or other electronic devices outside the electronic device 100. That is to say, the internal storage security level of the electronic device 100 is relatively high, and can be accessed by other electronic devices only when the operating system of the electronic device 100 is running and / or the user authorizes.

[0333] The security level of the external storage in the electronic device 100 is lower than that of the internal storage. In some embodiments, when the electronic device 100 is connected to the electronic device 101 via an adapter cable, regardless of whether the electronic device 100 meets the first condition mentioned above, the electronic device 101 can access the data in the external storage of the electronic device 100 through the adapter cable. Among them, the electronic device 100 can actively transmit one or more data in the external storage to the electronic device 101 through the adapter cable. Alternatively, the electronic device 100 can transmit one or more data selected by the user to the electronic device 101 through the adapter cable in response to the user's operation of selecting one or more data. Alternatively, the electronic device 101 can obtain the data in the external storage of the electronic device 100 through the adapter cable in response to the user's operation of reading the data in the external storage of the electronic device 100.

[0334] In some embodiments, when switching from the expansion mode to the external storage mode, the electronic device 100 can turn on the above-mentioned switching circuit so that the external storage can be accessed by other devices. When switching from the external storage mode to the expansion mode, the electronic device 100 can turn off the above-mentioned switching circuit. The specific implementation method of the switching circuit is not limited in the embodiment of the present application.

[0335] From the above method, it can be seen that the electronic device can use multiple storage devices to provide users with two usage modes: expansion mode and external storage mode. The user can set the usage mode of the storage device as needed, and can switch the usage mode of the storage device at any time. This can meet the user's diverse storage needs.

[0336] In some embodiments, the electronic device 100 can be restored to factory settings. Restoring factory settings may refer to clearing all information stored on the electronic device 100 (such as personalized settings information, non-system applications, etc.) and restoring the electronic device to its original system state. In the process of restoring factory settings, the electronic device 100 may format a storage device (such as storage device S1, storage device S2). In addition, the storage device S2 is also configured with a mode mark. Restoring factory settings may also include clearing the mode mark of the storage device S2. In this way, the storage device of the electronic device 100 can be restored to a state where the usage mode has not yet been set.

[0337] In some embodiments, the electronic device 100 may provide controls for managing internal storage and external storage. For example, the controls for managing internal storage may refer to the aforementioned Figure 5A The internal storage management control 516 shown. The control for managing external storage can refer to the aforementioned Figure 5EThe external storage management control 534 shown. Based on the above controls for managing internal storage and external storage, the user can perform operations such as transferring and deleting stored data. For example, the user can transfer data from internal storage to external storage, or transfer data from external storage to internal storage. The user can also delete one or more data in the internal storage or external storage. For example, the user can select one or more data in the external storage to delete the selected data at one time. This can improve the efficiency of the user in managing internal storage and external storage.

[0338] In some embodiments, the electronic device 100 can partition the storage device s2. Some of the partitions in the storage device s2 can be mounted on the internal storage, and other partitions can be mounted on the external storage. In other words, the storage device s2 can be mounted on both the internal storage and the external storage.

[0339] For example, the electronic device 100 divides the space of the storage device s2 into: partition 1 and partition 2. Partition 1 can be represented by the directory " / dev / block / sdb1" in the operating system. Partition 2 can be represented by the directory " / dev / block / sdb2" in the operating system. In the external storage mode, the electronic device 100 can mount partition 1 of the storage device s2 on the internal storage, and mount partition 2 on the external storage. In this way, partition 1 can be used as internal storage. Partition 2 can be used as external storage. The storage capacity of partition 1 and partition 2 can be set by the electronic device 100, or can also be set by the user. The embodiment of the present application does not limit the implementation method of the above-mentioned storage device s2 partition.

[0340] In some embodiments, the electronic device 100 can dynamically partition the storage device s2. Among them, the storage management service and the file system can manage the partitions of the storage device s2. When the internal storage space is tight and the external storage space is surplus, the electronic device 100 can divide a part of the partition of the storage device s2 mounted on the external storage as internal storage. Exemplarily, when it is detected that the remaining capacity of the internal storage is less than 5GB, and the remaining capacity of the external storage is greater than 20GB, the electronic device 100 can divide 5GB of storage capacity from the partition of the storage device s2 mounted on the external storage, and transfer the mounting location of the divided 5GB storage partition from the external storage to the internal storage.

[0341] In the case where the space of the external storage is tight and the space of the internal storage is sufficient, the electronic device 100 can divide a part of the partition mounted on the internal storage in the storage device s2 into the external storage. For example, when it is detected that the remaining capacity of the external storage is less than 5GB, and the remaining capacity of the external storage is greater than 20GB, the electronic device 100 can divide 5GB of storage capacity from the partition mounted on the internal storage in the storage device s2, and transfer the mounting location of the divided 5GB storage partition from the internal storage to the external storage.

[0342] Optionally, the electronic device 100 is not limited to partitioning the storage device s2, and can also partition other storage devices in the electronic device 100. For example, the electronic device 100 can partition the storage device s1, and mount different partitions of the storage device s1 on the internal storage and the external storage respectively.

[0343] The above-mentioned method for dynamically managing the partition of the storage device s2 can adjust the size of the internal storage and the external storage according to the actual usage of the internal storage and the external storage in the electronic device 100, thereby improving the user experience of using the internal storage and the external storage.

[0344] It is understandable that the various user interfaces described in the embodiments of the present application are only example interfaces and do not limit the present application scheme. In other embodiments, the user interface may adopt a different interface layout, may include more or fewer controls, and may increase or decrease other functional options, as long as they are based on the same inventive concept provided by the present application, they are all within the scope of protection of the present application.

[0345] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.

[0346] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A storage management method, characterized in that: The method is applied to a first device, the first device includes a first memory and a second memory, the memory of the first device operates in a first mode, in the first mode, the first memory and the second memory are both internal storage, the method includes: The first device displays a first interface, wherein a first storage capacity is displayed in the first interface, the first storage capacity is used to indicate the storage capacity of internal storage in the first device, and the value of the first storage capacity is the sum of the storage capacities of the first memory and the second memory; The first device receives a first operation, where the first operation is used to switch the first mode to a second mode, where in the second mode, the first memory is an internal storage and the second memory is an external storage; In response to the first operation, the first device sets the second memory as external storage and changes the value of the first storage capacity to the storage capacity of the first memory; The first device displays a second storage capacity, where the second storage capacity is used to indicate the storage capacity of an external storage in the first device, and the value of the second storage capacity is the storage capacity of the second memory.

2. The method according to claim 1, characterized in that In the first mode, the second memory has a first mark, and the first mark is used to indicate that the second memory is internal storage. After the first device receives the first operation, the method further includes: The first device modifies the first mark into a second mark, where the second mark is used to indicate that the second memory is external storage.

3. The method according to claim 1 or 2, characterized in that: In the first mode, the second memory stores data, and after the first device receives the first operation, the method further includes: The first device transfers part or all of the data in the second memory to the first memory.

4. The method according to claim 3, characterized in that Before the first device transfers part or all of the data in the second memory to the first memory, the method further includes: The first device compresses data stored in the first memory and / or the second memory.

5. The method according to claim 3 or 4, characterized in that: The method further comprises: The first device detects that the remaining space of the first memory is insufficient to accommodate the data in the second memory; The first device displays a first prompt, where the first prompt is used to prompt a user to clean up data in the second memory before switching to the second mode.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The first device receives a second operation, where the second operation is used to store the first data in an external storage of the first device; In response to the second operation, the first device stores the first data in the second memory; The first device receives a third operation, wherein the third operation is used to store second data in an internal storage of the first device; In response to the third operation, the first device stores the second data in the first memory.

7. The process according to any one of claims 1 to 6, characterized in that: The method further comprises: The first device receives a fourth operation, where the fourth operation is used to copy third data in the first memory to the second memory; In response to the fourth operation, the electronic device stores the third data in the second memory.

8. The method according to any one of claims 1 to 7, characterized in that The first device is connected to the second device via a data line, and the method further includes: In the second mode, data in the second memory is transmitted to the second device via the data line; When the first device satisfies a first condition, the data in the first memory is transmitted to the second device via the data line, wherein the first condition includes: the operating system of the first device is in running state and / or the first device receives an authorization operation from the user, and the authorization operation is used to authorize the second device to access the internal storage of the first device.

9. The method according to claim 8, characterized in that Before the data in the second memory is transmitted to the second device via the data line, the method further includes: The first device receives a fifth operation, where the fifth operation is used to transfer the data in the second memory to the second device.

10. The method according to claim 1, characterized in that The method further comprises: The first device divides the second memory into a first partition and a second partition, and sets the first partition as internal storage and sets the second partition as external storage; The first device changes the value of the first storage capacity to the sum of the storage capacities of the first memory and the first partition, and changes the value of the second storage capacity to the storage capacity of the second partition.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: The first device receives a sixth operation, where the sixth operation is used to switch the second mode to the first mode; In response to the sixth operation, the first device sets the second memory as internal storage, and changes the value of the first storage capacity to the sum of the storage capacities of the first memory and the second memory; The first device cancels displaying the second storage capacity.

12. The method according to claim 11, characterized in that In the second mode, the second memory has a second mark, and the second mark is used to indicate that the second memory is an external storage. After the first device receives the sixth operation, the method further includes: The first device modifies the second mark into a first mark, where the first mark is used to indicate that the second memory is internal storage.

13. The method according to claim 11 or 12, characterized in that: In the second mode, the second memory stores data, and after the first device receives the sixth operation, the method further includes: The first device formats the second memory; or, the first device transfers part or all of the data in the second memory to the first memory.

14. The method according to any one of claims 1 to 13, characterized in that The method further comprises: The first device provides a first boot guide when the device is first powered on, wherein the first boot guide includes setting the memory to operate in the first mode or the second mode; If an operation of setting the memory to work in the first mode is received, the first device sets both the first memory and the second memory as internal storage, and configures a first mark for the second memory, where the first mark is used to indicate that the second memory is internal storage; If an operation to set the memory to work in the second mode is received, the first device sets the first memory to internal storage, sets the second memory to external storage, and configures a second mark for the second memory, where the second mark is used to indicate that the second memory is external storage.

15. The method according to claim 14, characterized in that The setting memory operating in the first mode or the second mode is the first setting in the first boot guide.

16. The method according to claim 14, characterized in that The method further comprises: Before receiving the operation of setting the memory to work in the first mode or the second mode, the first device further receives one or more items of information input by a user; The first device stores the one or more items of information in a memory; After receiving the operation of setting the memory to work in the first mode or the second mode, the first device stores the one or more items of information in the first memory and / or the second memory according to the first mode or the second mode.

17. An electronic device, characterized in that: The electronic device includes a first memory, a second memory, a storage drive, and a processor, wherein the first memory is internal storage, the second memory is internal storage and / or external storage, the first memory and the second memory are both used to store computer programs and data, the storage drive is used to control the first memory and the second memory, and perform read and write operations on the first memory and the second memory, and the processor is used to call the computer program so that the electronic device executes the method described in any one of claims 1 to 16.

18. The electronic device according to claim 17, characterized in that: The first memory and the second memory are both universal flash memory ufs.

19. The electronic device according to claim 18, characterized in that: The storage driver comprises a small computer system interface (scsi) driver, and the electronic device comprises two scsi paths, which are respectively used for the scsi driver to control the first memory and the second memory.

20. The electronic device according to claim 18, characterized in that The storage driver includes a SCSI driver and a universal serial bus USB driver, the electronic device includes a UFS and USB conversion module, a SCSI channel and a USB channel, and the UFS and USB conversion module is used to convert data between UFS protocol and USB protocol; The one SCSI path is used by the SCSI driver to control the first memory, and the one SCSI path is used by the USB driver to control the second memory through the UFS and USB conversion module; Alternatively, the one-way SCSI is used by the SCSI driver to control the second memory, and the one-way USB path is used by the USB driver to control the first memory through the UFS and USB conversion module.

21. The electronic device according to claim 18, characterized in that: The storage driver includes a SCSI driver and a peripheral component interconnection extension pcie driver, the electronic device includes a ufs and pcie conversion module, a SCSI channel and a pcie channel, and the ufs and pcie conversion module is used to convert data between the ufs protocol and the pcie protocol; The one scsi path is used by the scsi driver to control the first memory, and the one pcie path is used by the pcie driver to control the second memory through the ufs and pcie conversion module; Alternatively, the one-way SCSI is used by the SCSI driver to control the second memory, and the one-way pcie path is used by the pcie driver to control the first memory through the ufs and pcie conversion module.

22. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 16.

23. A computer program product, characterized in that The computer program product comprises computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the method according to any one of claims 1 to 16.