[go: up one dir, main page]

CN111274160A - Data storage method, electronic device, and medium - Google Patents

Data storage method, electronic device, and medium Download PDF

Info

Publication number
CN111274160A
CN111274160A CN202010074454.9A CN202010074454A CN111274160A CN 111274160 A CN111274160 A CN 111274160A CN 202010074454 A CN202010074454 A CN 202010074454A CN 111274160 A CN111274160 A CN 111274160A
Authority
CN
China
Prior art keywords
target
data
partition
storage area
storage
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010074454.9A
Other languages
Chinese (zh)
Inventor
贺柏鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010074454.9A priority Critical patent/CN111274160A/en
Publication of CN111274160A publication Critical patent/CN111274160A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7202Allocation control and policies

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明实施例公开了一种数据存储方法、电子设备及介质。其中,数据存储方法包括:获取目标应用程序对应的目标数据;将目标数据存储于与目标应用程序相关联的目标存储区域中;其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。利用本发明实施例,能够有效地提升应用程序的性能。

Figure 202010074454

The embodiments of the present invention disclose a data storage method, an electronic device and a medium. The data storage method includes: acquiring target data corresponding to the target application; storing the target data in a target storage area associated with the target application; wherein, the target storage area is located in the first partition of the storage space, and the storage space also A second partition is included, and the first data storage amount of the first storage unit in the first partition is smaller than the second data storage amount of the second storage unit in the second partition. By using the embodiments of the present invention, the performance of the application program can be effectively improved.

Figure 202010074454

Description

数据存储方法、电子设备及介质Data storage method, electronic device and medium

技术领域technical field

本发明实施例涉及通信技术领域,尤其涉及一种数据存储方法、电子设备及介质。Embodiments of the present invention relate to the field of communications technologies, and in particular, to a data storage method, an electronic device, and a medium.

背景技术Background technique

在电子设备的存储空间的可用存储容量不足的情况下,电子设备上的应用程序的性能会随之降低。When the available storage capacity of the storage space of the electronic device is insufficient, the performance of the application on the electronic device may be degraded accordingly.

目前,在电子设备检测到可用存储容量不足的情况下,会对存储空间进行碎片整理,将碎片数据中的临时数据删除并且将离散化的碎片数据连续存储,以降低碎片数据对应用程序的性能的影响。At present, when the electronic device detects that the available storage capacity is insufficient, it will defragment the storage space, delete the temporary data in the fragmented data, and store the discrete fragmented data continuously, so as to reduce the performance of the fragmented data on the application program. Impact.

但是,上述的方法并不能完全消除存储空间对应用程序的性能的影响,无法有效地提升应用程序的性能。However, the above-mentioned method cannot completely eliminate the influence of the storage space on the performance of the application, and cannot effectively improve the performance of the application.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种数据存储方法、电子设备及介质,能够解决现有技术中应用程序的性能较低的问题。Embodiments of the present invention provide a data storage method, an electronic device and a medium, which can solve the problem of low performance of application programs in the prior art.

为了解决上述技术问题,本发明是这样实现的:In order to solve the above-mentioned technical problems, the present invention is achieved in this way:

第一方面,本发明实施例提供了一种数据存储方法,应用于电子设备,包括:In a first aspect, an embodiment of the present invention provides a data storage method, applied to an electronic device, including:

获取目标应用程序对应的目标数据;Obtain the target data corresponding to the target application;

将目标数据存储于与目标应用程序相关联的目标存储区域中;store the target data in the target storage area associated with the target application;

其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。The target storage area is located in the first partition of the storage space, the storage space further includes a second partition, and the first data storage capacity of the first storage unit in the first partition is smaller than the second storage capacity of the second storage unit in the second partition. Amount of data storage.

第二方面,本发明实施例提供了一种电子设备,包括:In a second aspect, an embodiment of the present invention provides an electronic device, including:

数据获取模块,用于获取目标应用程序对应的目标数据;The data acquisition module is used to acquire the target data corresponding to the target application;

数据存储模块,用于将目标数据存储于与目标应用程序相关联的目标存储区域中;a data storage module for storing target data in a target storage area associated with the target application;

其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。The target storage area is located in the first partition of the storage space, the storage space further includes a second partition, and the first data storage capacity of the first storage unit in the first partition is smaller than the second storage capacity of the second storage unit in the second partition. Amount of data storage.

第三方面,本发明实施例提供了一种电子设备,包括处理器、存储器及存储在存储器上并可在处理器上运行的计算机程序,计算机程序被处理器执行时实现如第一方面所述的数据存储方法的步骤。In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a memory, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, the implementation is as described in the first aspect The steps of the data storage method.

第四方面,本发明实施例提供了一种计算机可读存储介质,计算机可读存储介质上存储计算机程序,计算机程序被处理器执行时实现如第一方面所述的数据存储方法的步骤。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the data storage method described in the first aspect are implemented.

在本发明实施例中,电子设备的存储空间分为第一分区和第二分区,第一分区中的目标存储区域被用作于目标应用程序的独立存储区域,在获取到目标应用程序对应的目标数据之后,可以将目标数据存储于该目标存储区域中,使得目标应用程序读取所需要的数据时可以快速地找到数据所存储的位置,并且,由于第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量,使得向第一分区内存储数据的程序比第二分区内存储数据的程序更加简化,并且从目标存储区域中读取目标应用程序读取所需要的数据的程序也相应地简化,从而可以提升读取目标应用程序所需的数据的效率,使得电子设备读写数据的响应速度更快,从而大幅提高目标应用程序的性能。同时,由于目标应用程序可以在第一分区中的独立存储区域内进行数据写入和读取,相当于目标应用程序都具有自己的高速缓存区域,能在长时间内保证应用程序具有较高的性能。In this embodiment of the present invention, the storage space of the electronic device is divided into a first partition and a second partition, and the target storage area in the first partition is used as an independent storage area for the target application. After the target data, the target data can be stored in the target storage area, so that the target application can quickly find the location where the data is stored when reading the required data. The first data storage amount is smaller than the second data storage amount of the second storage unit in the second partition, so that the program for storing data in the first partition is more simplified than the program for storing data in the second partition, and the data is stored in the target storage area. The program for reading the data required by the target application program is also simplified accordingly, which can improve the efficiency of reading the data required by the target application program, make the electronic device read and write data faster, and greatly improve the target application program. program performance. At the same time, since the target application can write and read data in the independent storage area in the first partition, it is equivalent to that the target application has its own cache area, which can ensure that the application has a high performance for a long time. performance.

附图说明Description of drawings

图1为应用程序与存储器的交互框架示意图;1 is a schematic diagram of an interaction framework between an application program and a memory;

图2为本发明一个实施例提供的数据存储方法的流程示意图;2 is a schematic flowchart of a data storage method provided by an embodiment of the present invention;

图3为现有的一种存储器的结构示意图;3 is a schematic structural diagram of a conventional memory;

图4为对图3所示的存储器改进后的结构示意图;4 is a schematic structural diagram of the improved memory shown in FIG. 3;

图5为本发明一个实施例提供的常用应用程序管理栏的示意图;5 is a schematic diagram of a commonly used application management bar provided by an embodiment of the present invention;

图6为本发明一个实施例提供的应用程序存储数据的分布示意图;6 is a schematic diagram of the distribution of application program storage data provided by an embodiment of the present invention;

图7为本发明另一个实施例提供的应用程序存储数据的分布示意图;7 is a schematic diagram of the distribution of application program storage data provided by another embodiment of the present invention;

图8为本发明一个实施例提供的应用图标显示界面的界面示意图;8 is a schematic interface diagram of an application icon display interface provided by an embodiment of the present invention;

图9为本发明一个实施例提供的电子设备的结构示意图;9 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention;

图10为实现本发明各个实施例的一种电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

电子设备的存储器通常使用三层单元(Trinary-Level Cell,TLC)芯片作为NAND闪存芯片,TLC即3bit/cell。A memory of an electronic device usually uses a Trinary-Level Cell (TLC) chip as a NAND flash memory chip, and TLC is 3bit/cell.

尽管电子设备会按照应用程序的活跃度对存储器中的各个应用程序的数据进行归类,但仍然无法对存储器的存储空间进行有效管理,无法长时间保持应用程序的高性能。Although the electronic device classifies the data of each application program in the memory according to the activity of the application program, it still cannot effectively manage the storage space of the memory, and cannot maintain the high performance of the application program for a long time.

下面,以一个具体示例进行说明。Hereinafter, a specific example will be used for description.

图1示出了应用程序与存储器的交互框架示意图。如图1所示,应用程序A、应用程序B和应用程序C直接将各自的数据写入存储器110中,其中,A数据1-5为应用程序A写入的数据,B数据1-2为应用程序B写入的数据,C数据1为应用程序C写入的数据。对于存储器110来说,存储器110在物理地址上会对各个应用程序的数据块按照写入时间顺序进行排列,因此,不同应用程序之间的数据可能混杂在一起进行存储。并且,应用程序都是并行处理数据的,因此,单个应用程序生成的多个数据在物理地址上存在不连续性,若应用程序生成的数据都是小数据量的数据,比如4KB数据时,很容易形成碎片。另外,有一些临时数据删除后,也会留下碎片空间,如图1中的A数据4删除后则会空出一个碎片空间。Figure 1 shows a schematic diagram of an interaction framework between an application program and a memory. As shown in FIG. 1 , application A, application B, and application C directly write their respective data into the memory 110 , wherein A data 1-5 are data written by application A, and B data 1-2 are The data written by application B, C data 1 is the data written by application C. For the memory 110, the memory 110 arranges the data blocks of each application program in the order of writing time on the physical address, therefore, the data of different application programs may be mixed together for storage. In addition, applications process data in parallel. Therefore, multiple data generated by a single application program have discontinuities in physical addresses. If the data generated by the application program is small amount of data, such as 4KB data, it is very Fragments easily form. In addition, after some temporary data is deleted, fragmented space will also be left, for example, a fragmented space will be vacated after data A in Figure 1 is deleted.

随着电子设备内安装的应用程序越来越多,尤其是存储器的存储空间不足的情况下,累积的碎片变多,使常用的应用程序性能变低,从而影响用户体验。As more and more applications are installed in the electronic device, especially when the storage space of the memory is insufficient, the accumulated fragments increase, which reduces the performance of the commonly used applications, thereby affecting the user experience.

目前,在电子设备检测到可用存储容量不足的情况下,会对存储空间进行碎片整理,将碎片数据中的临时数据删除并且将离散化的碎片数据连续存储,以降低碎片数据对应用程序的性能的影响。At present, when the electronic device detects that the available storage capacity is insufficient, it will defragment the storage space, delete the temporary data in the fragmented data, and store the discrete fragmented data continuously, so as to reduce the performance of the fragmented data on the application program. Impact.

虽然,碎片整理能够在一定程度上缓解电子设备随着使用时间的增长而导致性能降低的问题,但过多的碎片整理也会对存储器的寿命有一定的影响。因为存储器的存储空间的减少以及用户对电子设备的日常操作,累计的碎片越来越多,碎片容量越来越大,应用程序的文件离散化也会逐渐形成,各个应用程序的碎片混杂在一起,使得碎片整理并不能完全消除存储空间对应用程序的性能的影响,依然无法有效地提升应用程序的性能。Although defragmentation can alleviate to a certain extent the problem of performance degradation of electronic devices over time, excessive defragmentation will also have a certain impact on the lifespan of memory. Due to the reduction of the storage space of the memory and the daily operation of the electronic device by the user, more and more fragments are accumulated, and the fragment capacity is increasing. , so that the defragmentation cannot completely eliminate the impact of storage space on the performance of the application, and still cannot effectively improve the performance of the application.

图2示出了本发明一个实施例提供的数据存储方法的流程示意图。FIG. 2 shows a schematic flowchart of a data storage method provided by an embodiment of the present invention.

在本发明一些实施例中,图2所示的方法可以由电子设备执行,电子设备可以包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。In some embodiments of the present invention, the method shown in FIG. 2 may be performed by an electronic device, and the electronic device may include, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle terminal, a wearable device, and a pedometer, etc. .

如图2所示,该数据存储方法可以包括:As shown in Figure 2, the data storage method may include:

步骤210、获取目标应用程序对应的目标数据;Step 210, obtaining target data corresponding to the target application;

步骤220、将目标数据存储于与目标应用程序相关联的目标存储区域中;Step 220, storing the target data in the target storage area associated with the target application;

其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。The target storage area is located in the first partition of the storage space, the storage space further includes a second partition, and the first data storage capacity of the first storage unit in the first partition is smaller than the second storage capacity of the second storage unit in the second partition. Amount of data storage.

在本发明实施例中,电子设备的存储空间分为第一分区和第二分区,第一分区中的目标存储区域被用作于目标应用程序的独立存储区域,在获取到目标应用程序对应的目标数据之后,可以将目标数据存储于该目标存储区域中,使得目标应用程序读取所需要的数据时可以快速地找到数据所存储的位置,并且,由于第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量,使得向第一分区内存储数据的程序比第二分区内存储数据的程序更加简化,并且从目标存储区域中读取目标应用程序读取所需要的数据的程序也相应地简化,从而可以提升读取目标应用程序所需的数据的效率,使得电子设备读写数据的响应速度更快,从而大幅提高目标应用程序的性能。同时,由于目标应用程序可以在第一分区中的独立存储区域内进行数据写入和读取,相当于目标应用程序都具有自己的高速缓存区域,能在长时间内保证应用程序具有较高的性能。In this embodiment of the present invention, the storage space of the electronic device is divided into a first partition and a second partition, and the target storage area in the first partition is used as an independent storage area for the target application. After the target data, the target data can be stored in the target storage area, so that the target application can quickly find the location where the data is stored when reading the required data. The first data storage amount is smaller than the second data storage amount of the second storage unit in the second partition, so that the program for storing data in the first partition is more simplified than the program for storing data in the second partition, and the data is stored in the target storage area. The program for reading the data required by the target application program is also simplified accordingly, which can improve the efficiency of reading the data required by the target application program, make the electronic device read and write data faster, and greatly improve the target application program. program performance. At the same time, since the target application can write and read data in the independent storage area in the first partition, it is equivalent to that the target application has its own cache area, which can ensure that the application has a high performance for a long time. performance.

在本发明一些实施例的步骤210中,目标应用程序可以是电子设备中的任意应用程序,目标数据可以是该应用程序需要写入电子设备的存储器的数据。In step 210 of some embodiments of the present invention, the target application may be any application in the electronic device, and the target data may be data that the application needs to write into the memory of the electronic device.

在本发明另一些实施例的步骤210中,目标应用程序可以是电子设备中的用户经常使用的任意应用程序,即任意常用应用程序,目标数据可以是该常用应用程序需要写入电子设备的存储器的数据。In step 210 of other embodiments of the present invention, the target application may be any application frequently used by the user in the electronic device, that is, any commonly used application, and the target data may be the commonly used application that needs to be written into the memory of the electronic device The data.

在本发明实施例中,需要写入电子设备的存储器的数据可以是需要写入电子设备的文件或者存储数据中的至少一种。In this embodiment of the present invention, the data to be written into the memory of the electronic device may be at least one of a file or stored data to be written into the electronic device.

在本发明一些实施例中,存储空间为任意的存储器,例如,硬盘、闪存存储器等。In some embodiments of the present invention, the storage space is any memory, such as a hard disk, a flash memory, and the like.

在本发明一些实施例中,第一分区为单层存储单元(Single-Level Cell,SLC)存储模式,第二分区为三层存储单元TLC存储模式。In some embodiments of the present invention, the first partition is a single-level storage cell (Single-Level Cell, SLC) storage mode, and the second partition is a three-layer storage cell TLC storage mode.

在本发明另一些实施例中,第二分区还可以为任意的多层存储单元(Multi-LevelCell,MLC)存储模式,第一分区也可以为第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量的任意MLC或者SLC存储模式,在此不做限制。In other embodiments of the present invention, the second partition may also be an arbitrary multi-level cell (Multi-Level Cell, MLC) storage mode, and the first partition may also be that the first data storage capacity of the first storage unit is smaller than that of the second partition. Any MLC or SLC storage mode of the second data storage amount of the second storage unit in the partition is not limited here.

以第一分区为SLC存储模式分区(以下简称为“SLC分区”)、第二分区为TLC存储模式分区(以下简称为“TLC分区”)为例,目标应用程序如果直接在SLC分区中读写数据,相对于传统的在TLC分区中读写数据而言,顺序写入速度能够提高1倍以上,从而大幅提高目标应用程序的性能。Taking the first partition as an SLC storage mode partition (hereinafter referred to as "SLC partition") and the second partition as a TLC storage mode partition (hereinafter referred to as "TLC partition") as an example, if the target application directly reads and writes in the SLC partition Compared with the traditional reading and writing data in the TLC partition, the sequential writing speed can be more than doubled, thereby greatly improving the performance of the target application.

在本发明一些实施例中,第一分区中设有与目标应用程序相关联的目标存储区域,该目标存储区域可以为仅用于存储目标应用程序的数据的存储区域,使得不同的应用程序可以在第一分区中各自的存储区域内进行数据写入和读取,使得各个应用程序在第一分区内的存储区域各自独立,相当于每个应用程序都具有自己的高速缓存区域,不但能在长时间内保证应用程序具有较高的性能,还能够减少存储空间内的碎片数据和碎片空间,提高存储数据的连续性。In some embodiments of the present invention, the first partition is provided with a target storage area associated with the target application, and the target storage area may be a storage area only used to store data of the target application, so that different applications can Write and read data in their respective storage areas in the first partition, so that the storage areas of each application in the first partition are independent, which is equivalent to each application having its own cache area, which can not only store data in It ensures high performance of applications for a long time, and can also reduce fragmented data and fragmented space in the storage space, and improve the continuity of stored data.

在本发明一些实施例中,在步骤210之前,该数据存储方法还可以包括:In some embodiments of the present invention, before step 210, the data storage method may further include:

在存储空间中,创建第一分区;In the storage space, create the first partition;

按照预定分配方式,在第一分区的第一存储单元中,选取至少一个目标第一存储单元;According to a predetermined allocation method, in the first storage unit of the first partition, select at least one target first storage unit;

将所选取的目标第一存储单元确定为目标存储区域。The selected target first storage unit is determined as the target storage area.

以存储器为TLC芯片的NAND闪存芯片为例,可以通过NAND Flash命令,在TLC芯片上烧录系统版本,构造SLC分区,作为第一分区,其他TLC分区作为第二分区。从而可以使部分TLC分区转换为SLC分区,以牺牲部分容量为代价获取到高性能的优点。Taking a NAND flash chip whose memory is a TLC chip as an example, the system version can be programmed on the TLC chip through the NAND Flash command to construct an SLC partition as the first partition, and other TLC partitions as the second partition. Therefore, some TLC partitions can be converted into SLC partitions, and the advantage of high performance can be obtained at the expense of part of the capacity.

图3示出了现有的一种存储器的结构示意图。图4示出了对图3所示的存储器改进后的结构示意图。FIG. 3 shows a schematic structural diagram of a conventional memory. FIG. 4 shows a schematic diagram of the improved structure of the memory shown in FIG. 3 .

如图3所示,电子设备的NAND闪存芯片310目前有多个分区,包含boot、system、user_data、cache等多个分区,但是这些分区对于NAND闪存芯片310来说都是属于TLC分区,即第二分区。如图4所示,可以通过TLC区域转SLC区域技术,将NAND闪存芯片310的部分TLC分区转变为SLC分区,从而在NAND闪存芯片310中构造出一个新的SLC分区,即第一分区。As shown in FIG. 3 , the NAND flash memory chip 310 of the electronic device currently has multiple partitions, including multiple partitions such as boot, system, user_data, and cache, but these partitions belong to the TLC partition for the NAND flash memory chip 310, that is, the first partition Second division. As shown in FIG. 4 , part of the TLC partitions of the NAND flash memory chip 310 can be converted into SLC partitions through the TLC area to SLC area technology, thereby constructing a new SLC partition, ie, the first partition, in the NAND flash memory chip 310 .

在本发明一些实施例中,第一分区内可以包括多个第一存储单元,针对不同的应用程序,可以按照预定分配方式为其分配至少一个第一存储单元,使所分配的第一存储单元形成与该应该程序相关联的存储区域。例如,可以按照预定分配方式为目标应用程序分配至少一个目标第一存储单元,形成与目标应用程序相关联的目标存储区域,使其可以获得目标存储区域的使用权限,从而直接在目标存储区域中读写数据。In some embodiments of the present invention, the first partition may include multiple first storage units, and for different application programs, at least one first storage unit may be allocated to it according to a predetermined allocation method, so that the allocated first storage unit A storage area associated with the application is formed. For example, at least one target first storage unit can be allocated to the target application according to a predetermined allocation method to form a target storage area associated with the target application, so that it can obtain the use authority of the target storage area, so that the target storage area can be directly stored in the target storage area. Read and write data.

具体地,预定分配方式可以包括以下的至少一项:Specifically, the predetermined allocation manner may include at least one of the following:

1、根据应用程序的日常写入数据量进行分配。例如,SLC分区总大小为16GB,若有5个应用程序需要分配SLC分区中的存储区域,其中,2个应用程序是网游应用程序,2个应用程序是通讯应用程序,1个应用程序是视频应用程序,则可以按照预先设定的不同类型的应用程序的分配比例,给视频应用程序分配数量较多的第一存储单元,形成较大的存储空间,例如12GB,给通讯应用程序分配数量次多的第一存储单元,形成次大的存储空间,例如2GB,给网游应用程序分配数量较少的第一存储单元,形成较小的存储空间,例如512MB。1. Allocate according to the daily write data volume of the application. For example, the total size of the SLC partition is 16GB. If there are 5 applications that need to allocate the storage area in the SLC partition, 2 applications are online game applications, 2 applications are communication applications, and 1 application is video applications. application program, you can allocate a larger number of first storage units to the video application program according to the preset allocation ratio of different types of application programs to form a larger storage space, such as 12GB, and allocate a number of times to the communication application program More first storage units form the next largest storage space, such as 2GB, and allocate a smaller number of first storage units to the online game application to form a smaller storage space, such as 512MB.

2、根据应用程序的数量和SLC分区的大小按固定比例进行平均分配。例如,SLC分区总大小为16GB,若有8个应用程序需要分配SLC分区中的存储区域,则将SLC分区内的第一存储单元的数量平均分为8分,使每个应用程序可以分配的存储区域为2GB。2. According to the number of applications and the size of the SLC partition, it is evenly distributed according to a fixed ratio. For example, the total size of the SLC partition is 16GB. If there are 8 applications that need to allocate the storage area in the SLC partition, the number of the first storage unit in the SLC partition is divided into 8 points, so that each application can allocate The storage area is 2GB.

在本发明实施例中,还可以根据第一分区的大小限制能够在第一分区内存储数据的应用程序的数量。例如,SLC分区总大小为16GB,可限定最多可以设置8个应用程序能够向第一分区内存储数据,每个应用程序的存储区域设为2GB。In this embodiment of the present invention, the number of application programs that can store data in the first partition may also be limited according to the size of the first partition. For example, the total size of the SLC partition is 16GB, and it can be limited that up to 8 applications can be set to store data in the first partition, and the storage area of each application is set to 2GB.

在本发明一些实施例中,该数据存储方法还可以包括:In some embodiments of the present invention, the data storage method may further include:

在目标存储区域在第一预设时间段内的第一数据存储量小于第一预设阈值或者大于第二预设阈值的情况下,根据第一数据存储量,调节目标存储区域所包含的目标第一存储单元的数量;In the case that the first data storage amount of the target storage area within the first preset time period is smaller than the first preset threshold or greater than the second preset threshold, the target storage area included in the target storage area is adjusted according to the first data storage amount the number of first storage units;

其中,第一预设阈值小于第二预设阈值。Wherein, the first preset threshold is smaller than the second preset threshold.

在一些实施例中,在目标存储区域在第一预设时间段内的第一数据存储量小于第一预设阈值的情况下,可以根据目标存储区域所存储的数据量,减少目标存储区域所包含的目标第一存储单元的数量,使得减少后的目标存储区域的数据存储量小于减少前的目标存储区域的数据存储量,从而节约SLC分区的存储区域。In some embodiments, when the first data storage amount of the target storage area within the first preset time period is less than the first preset threshold, the amount of data stored in the target storage area may be reduced according to the amount of data stored in the target storage area. The number of included target first storage units makes the data storage capacity of the target storage area after the reduction smaller than the data storage capacity of the target storage area before the reduction, thereby saving the storage area of the SLC partition.

在另一些实施例中,在目标存储区域在第一预设时间段内的第一数据存储量大于第二预设阈值的情况下,第二预设阈值可以大于第一预设阈值且小于或等于目标存储区域的最大数据存储量,此时,可以根据目标存储区域所存储的数据量,增加目标存储区域所包含的目标第一存储单元的数量,使得增加后的目标存储区域的数据存储量大于增加前的目标存储区域的数据存储量,从而保证目标应用程序对应的目标存储区域的数据存储量是足够的,从而使目标应用程序保持高性能。In other embodiments, when the first data storage amount of the target storage area within the first preset time period is greater than the second preset threshold, the second preset threshold may be greater than the first preset threshold and less than or It is equal to the maximum data storage capacity of the target storage area. At this time, according to the amount of data stored in the target storage area, the number of target first storage units included in the target storage area can be increased, so that the data storage capacity of the increased target storage area can be increased. It is greater than the data storage volume of the target storage area before the increase, so as to ensure that the data storage volume of the target storage area corresponding to the target application is sufficient, so that the target application can maintain high performance.

因此,本发明实施例的数据存储方法可以应用于对目标存储区域的数据存储量进行动态调整的场景下,此时,电子设备为每个应用程序分配的第一分区内的存储区域是可以动态调整的,从而保证每个具有存储区域的应用程序的目标存储区域的数据存储量是足够的,从而使这些应用程序长时间保持较高的性能。Therefore, the data storage method of the embodiment of the present invention can be applied to the scenario of dynamically adjusting the data storage amount of the target storage area. At this time, the storage area in the first partition allocated by the electronic device for each application program can be dynamically adjusted. Adjusted to ensure that each application with a storage area has sufficient data storage in the target storage area, so that these applications maintain high performance for a long time.

在本发明一些实施例中,可以存储区域的数据存储量可以设有多种预设数据存储量,例如,12GB、2GB和512MB。当需要增加或者减少目标存储区域所包含的目标第一存储单元的数量时,可以直接根据目标存储区域所存储的数据量选择对应的预设数据存储量即可。In some embodiments of the present invention, the data storage amount of the storage area can be set with various preset data storage amounts, for example, 12GB, 2GB, and 512MB. When the number of target first storage units included in the target storage area needs to be increased or decreased, the corresponding preset data storage amount may be directly selected according to the data amount stored in the target storage area.

在本发明另一些实施例中,还可以根据目标存储区域所存储的数据量,按照预设比例,增加或者减少存储区域中的第一存储单元的数量,例如,增加或者减少存储区域中的20%的第一存储单元,从而实现存储区域的数据存储量的动态调整。In other embodiments of the present invention, according to the amount of data stored in the target storage area, the number of first storage units in the storage area may be increased or decreased according to a preset ratio, for example, 20 units in the storage area may be increased or decreased. % of the first storage unit, so as to realize the dynamic adjustment of the data storage capacity of the storage area.

例如,当将目标应用程序对应目标存储区域中的全部有效数据刷新到第二分区后,可以确定目标应用程序在第一预设时间段内所存储的数据量,如果所存储的数据量未达到目标存储区域的20%,且当前的目标存储区域的数据存储量为2GB,则可以重新为其分配更小的存储区域,使目标应用程序的目标存储区域的数据存储量变为512MB。For example, after refreshing all valid data in the target storage area corresponding to the target application to the second partition, the amount of data stored by the target application in the first preset time period can be determined. 20% of the target storage area, and the current data storage area of the target storage area is 2GB, you can reallocate a smaller storage area to it, so that the data storage capacity of the target storage area of the target application becomes 512MB.

再例如,当电子设备在定时检测的过程中,确定目标应用程序在第一预设时间段内所存储的数据量使目标存储区域的剩余数据存储量仅剩总数据存储量的20%,且当前的目标存储区域的数据存储量为512MB,则可以重新为其分配更大的存储区域,使目标应用程序的目标存储区域的数据存储量变为2GB。For another example, when the electronic device is in the process of timing detection, it is determined that the amount of data stored by the target application within the first preset time period makes the remaining data storage in the target storage area only 20% of the total data storage, and The current data storage volume of the target storage area is 512MB, and a larger storage area can be re-allocated to make the data storage volume of the target storage area of the target application become 2GB.

在电子设备的使用过程中,随着应用程序使用时间的增长,第一分区内存储的数据量变大,为维持应用程序的高性能,需要及时搬移第一分区内的有效数据,释放出部分第一分区的存储区域,即刷新第一分区。During the use of the electronic device, as the usage time of the application program increases, the amount of data stored in the first partition becomes larger. In order to maintain the high performance of the application program, it is necessary to move the valid data in the first partition in time to release part of the first partition. The storage area of a partition is to refresh the first partition.

在本发明一些实施例中,目标应用程序可以为具有第一属性的应用程序;In some embodiments of the present invention, the target application may be an application with the first attribute;

在这些实施例中,可选地,该数据存储方法还可以包括:In these embodiments, optionally, the data storage method may further include:

在目标应用程序由第一属性更新为第二属性的情况下,将目标存储区域所存储的目标类别的数据移动至第二分区内;When the target application is updated from the first attribute to the second attribute, the data of the target category stored in the target storage area is moved to the second partition;

释放目标存储区域。Free the target storage area.

在一些实施例中,第一属性可以为常用应用程序属性,第二属性可以为非常用应用程序属性。在另一些实施例中,第一属性还可以为用户选中属性,第二属性还可以为非用户选中属性。In some embodiments, the first attribute may be a frequently used application attribute, and the second attribute may be an uncommon application attribute. In other embodiments, the first attribute may also be a user-selected attribute, and the second attribute may also be a non-user-selected attribute.

在一些实施例中,以第一属性为常用应用程序属性、第二属性为非常用应用程序属性为例,用户还可以手动在多个应用程序中选取具有常用应用程序属性的目标应用程序,电子设备也可以根据预设的选取规则,通过人工智能(Artificial Intelligence,AI)分类方法对多个应用程序进行分类,从而自动在多个应用程序中选取常用应用程序。In some embodiments, taking the first attribute being a frequently used application attribute and the second attribute being an uncommon application attribute as an example, the user can also manually select a target application with a commonly used application attribute from multiple applications, and the electronic The device can also classify multiple application programs through an artificial intelligence (Artificial Intelligence, AI) classification method according to a preset selection rule, so as to automatically select a common application program among the multiple application programs.

以第一属性为常用应用程序属性、第二属性为非常用应用程序属性为例,AI分类方法可以具体为:电子设备可以获取目标应用程序在第二预设时间段内的使用频率,如果使用频率大于或等于预定频率阈值,则将其确定为常用应用程序属性,如果使用频率小于预定频率阈值,则将其确定为非常用应用程序属性。Taking the first attribute as a common application attribute and the second attribute as an uncommon application attribute as an example, the AI classification method may be specifically as follows: the electronic device can obtain the use frequency of the target application in the second preset time period, and if the If the frequency is greater than or equal to the predetermined frequency threshold, it is determined as a common application attribute, and if the usage frequency is less than the predetermined frequency threshold, it is determined as a very common application attribute.

在另一些实施例中,以第一属性为用户选中属性、第二属性为非用户选中属性为例,用户可以选择希望具有高性能的应用程序,并将其属性设置为用户选中属性,则未被用户选择的应用程序的属性则为非用户选中属性。In other embodiments, taking the first attribute as the user-selected attribute and the second attribute as the non-user-selected attribute as an example, the user can select an application program that wants to have high performance, and set its attribute as the user-selected attribute, then the application is not selected. The properties of the application selected by the user are the properties that are not selected by the user.

图5示出了本发明一个实施例提供的常用应用程序管理栏的示意图。如图5所示,以第一属性为常用应用程序属性、第二属性为非常用应用程序属性为例,电子设备的显示界面中,可以设有常用应用程序管理栏410,用户或者电子设备所选取的具有第一属性的常用应用程序420都会在该常用应用程序管理栏410内显示,并且该常用应用程序管理栏410内显示的全部常用应用程序420都会在第一分区内具有相关联的存储区域,每个常用应用程序420相关联的存储区域的大小可以动态改变,从而能更有效地提高每个常用应用程序420的数据读写性能。FIG. 5 shows a schematic diagram of a common application management bar provided by an embodiment of the present invention. As shown in FIG. 5 , taking the first attribute as a commonly used application attribute and the second attribute as an uncommon application attribute as an example, the display interface of the electronic device may be provided with a commonly used application management column 410. The selected frequently-used applications 420 with the first attribute will be displayed in the frequently-used application management bar 410, and all frequently-used applications 420 displayed in the frequently-used application management bar 410 will have associated storage in the first partition The size of the storage area associated with each frequently used application program 420 can be dynamically changed, so that the data read and write performance of each frequently used application program 420 can be more effectively improved.

在另一些实施例中,继续以第一属性为常用应用程序属性、第二属性为非常用应用程序属性为例,目标应用程序由第一属性更新为第二属性,例如,用户或者电子设备将目标应用程序从图5中的常用应用程序管理栏中删除,则可以将目标存储区域所存储的目标类别的数据移动至第二分区内,并且释放目标存储区域。In other embodiments, continuing to take the first attribute as a common application attribute and the second attribute as an uncommon application attribute as an example, the target application is updated from the first attribute to the second attribute. If the target application is deleted from the commonly used application management column in FIG. 5 , the data of the target category stored in the target storage area can be moved to the second partition, and the target storage area can be released.

继续参见图5,如果用户将常用应用程序管理栏410的任一应用程序从该常用应用程序管理栏410中移除,说明该应用程序由第一属性更新为第二属性,则电子设备可以将在第一分区内与该应用程序相关联的存储区域中存储的目标类别的数据移动至第二分区内,并且释放第一分区内与该应用程序相关联的存储区域。Continuing to refer to FIG. 5 , if the user removes any application in the frequently used application management bar 410 from the frequently used application management bar 410 , indicating that the application is updated from the first attribute to the second attribute, the electronic device can The data of the target category stored in the storage area associated with the application in the first partition is moved to the second partition, and the storage area associated with the application in the first partition is released.

在本发明一些实施例中,目标类别的数据可以为有效数据。In some embodiments of the present invention, the data of the target category may be valid data.

在本发明一些实施例中,在释放目标存储区域之后,该数据存储方法还可以包括:In some embodiments of the present invention, after releasing the target storage area, the data storage method may further include:

解除目标应用程序与目标存储区域的关联关系。Disassociates the target application from the target storage area.

因此,本发明实施例可以应用于目标应用程序由常用应用程序变为非常用应用程序的场景,在这个场景下,可以释放原本与目标应用程序相关联的目标存储区域,并且解除目标应用程序与目标存储区域的关联关系,从而使目标存储区域与目标应用程序不再关联,并且使目标存储区域释放后的存储区域可以与新的常用应用程序相关联。Therefore, the embodiments of the present invention can be applied to a scenario where the target application is changed from a commonly used application to a very frequently used application. In this scenario, the target storage area originally associated with the target application can be released, and the target application can be released from the The association relationship of the target storage area, so that the target storage area is no longer associated with the target application, and the storage area after the release of the target storage area can be associated with a new common application.

在本发明另一些实施例中,该数据存储方法还可以包括:In other embodiments of the present invention, the data storage method may further include:

在目标存储区域的第二数据存储量大于第三预设阈值的情况下,将目标存储区域所存储的目标类别的数据移动至第二分区内;When the second data storage amount of the target storage area is greater than the third preset threshold, move the data of the target category stored in the target storage area to the second partition;

释放目标存储区域。Free the target storage area.

在一些实施例中,目标存储区域的第二数据存储量大于第三预设阈值,使得目标存储区域的剩余存储数据量不足或者使目标类别的数据超过第三预设阈值,此时,可以将目标存储区域所存储的目标类别的数据移动至第二分区内,并且释放目标存储区域。In some embodiments, the second data storage volume of the target storage area is greater than the third preset threshold, so that the remaining storage data volume of the target storage area is insufficient or the data of the target category exceeds the third preset threshold. The data of the target category stored in the target storage area is moved to the second partition, and the target storage area is released.

例如,若与目标应用程序相关联的目标存储区域的数据存储量为512MB,并且目标存储区域所存储的目标类别的数据量超过256MB,则为了预防碎片化产生,可以将目标存储区域所存储的目标类别的数据组成一个连续的数据后,通过电子设备的系统主动式刷新或者后台刷新(Flush)把这部连续的分数据搬移到第二分区内。For example, if the data storage volume of the target storage area associated with the target application program is 512MB, and the data volume of the target category stored in the target storage area exceeds 256MB, in order to prevent fragmentation, the data stored in the target storage area can be After the data of the target category forms a continuous data, the continuous sub-data is moved to the second partition through the system active refresh or background refresh (Flush) of the electronic device.

因此,本发明实施例的数据存储方法可以应用于对目标存储区域的数据存储量进行动态调整的场景下,此时,电子设备为每个应用程序分配的第一分区内的存储区域是可以动态调整的,从而保证每个具有存储区域的应用程序的目标存储区域的数据存储量是足够的,从而使这些应用程序长时间保持较高的性能。Therefore, the data storage method of the embodiment of the present invention can be applied to the scenario of dynamically adjusting the data storage amount of the target storage area. At this time, the storage area in the first partition allocated by the electronic device for each application program can be dynamically adjusted. Adjusted to ensure that each application with a storage area has sufficient data storage in the target storage area, so that these applications maintain high performance for a long time.

图6示出了本发明一个实施例提供的应用程序存储数据的分布示意图。图7示出了本发明另一个实施例提供的应用程序存储数据的分布示意图。FIG. 6 shows a schematic diagram of the distribution of application program storage data provided by an embodiment of the present invention. FIG. 7 shows a schematic diagram of the distribution of application program storage data provided by another embodiment of the present invention.

如图6所示,应用程序A在SLC分区510的程序A存储区域中写入了A数据1-5,应用程序B在在SLC分区510的程序B存储区域中写入了B数据1-2,应用程序C在在SLC分区510的程序C存储区域中写入了C数据1,并且TLC分区520中无应用程序A、应用程序B和应用程序C的写入的数据。在应用程序A将写入的A数据4从程序A存储区域中删除后,A数据3与A数据5之间形成了碎片空间,并且使A数据5成为了碎片数据。As shown in FIG. 6 , application A has written A data 1-5 in the program A storage area of the SLC partition 510, and application B has written B data 1-2 in the program B storage area of the SLC partition 510 , application C has written C data 1 in the program C storage area of the SLC partition 510 , and there is no written data of application A, application B and application C in the TLC partition 520 . After application A deletes the written A data 4 from the program A storage area, a fragmented space is formed between the A data 3 and the A data 5, and the A data 5 becomes fragmented data.

如图7所示,当SLC分区510内所存储的有效数据累积到一定程度后,电子设备可以通过刷新机制,将目标类别的数据超过第三预设阈值的应用程序A的有效数据A数据1-3和A数据5连续的存储至TLC分区520中,从而能够让应用程序A的有效数据保持连续性,减少碎片空间。As shown in FIG. 7 , after the valid data stored in the SLC partition 510 is accumulated to a certain extent, the electronic device can use the refresh mechanism to refresh the valid data A data 1 of the application program A whose data of the target category exceeds the third preset threshold. -3 and A data 5 are continuously stored in the TLC partition 520, so that the effective data of application A can be kept continuous and the fragmented space can be reduced.

从图6和图7可以看出,应用程序A的程序A存储区域快满时,刷新程序A存储区域后,无效数据“A数据4”并没有搬移到TLC分区520中,所以不会形成碎片空间,并且搬移的有效数据会形成一个规整的连续数据,使数据存储地址在TLC分区520上是连续的,进而在应用程序A从TLC分区520中读取其数据时,由于数据连续且搜索范围小,可以提高数据读取的性能。同时,应用程序A的程序A存储区域清空后,应用程序A的程序A存储区域可继续供应用程序A进行读写操作,不存在碎片问题,这样可以让应用程序A长久保持较高的性能。It can be seen from Fig. 6 and Fig. 7 that when the program A storage area of application A is almost full, after the program A storage area is refreshed, the invalid data "A data 4" is not moved to the TLC partition 520, so fragmentation will not be formed. space, and the moved valid data will form a regular continuous data, so that the data storage address is continuous on the TLC partition 520, and then when application A reads its data from the TLC partition 520, because the data is continuous and the search range is continuous small, which can improve the performance of data reading. At the same time, after the program A storage area of application A is cleared, the program A storage area of application A can continue to be read and written by application A, and there is no fragmentation problem, so that application A can maintain high performance for a long time.

在本发明一些实施例中,在目标应用程序由第一属性更新为第二属性的情况下,或,在目标存储区域的第二数据存储量大于第三预设阈值的情况下,电子设备的系统可以发送命令对第一分区进行主动刷新。In some embodiments of the present invention, when the target application is updated from the first attribute to the second attribute, or when the second data storage amount of the target storage area is greater than the third preset threshold, the electronic device's The system may send a command to actively refresh the first partition.

在本发明实施例中,上述的全部阈值均可以为电子设备预先设定的阈值,也可以为用户设定的阈值,在此不做限制。In this embodiment of the present invention, all the above-mentioned thresholds may be thresholds preset by an electronic device, or may be thresholds set by a user, which are not limited herein.

在本发明另一些实施例中,在目标应用程序关闭或者一段时间未使用的情况下,电子设备的后台可以对第一分区进行自动刷新。In other embodiments of the present invention, when the target application is closed or not used for a period of time, the background of the electronic device may automatically refresh the first partition.

在本发明又一些实施例中,在用户对目标应用程序使用性能加速功能的情况下,电子设备的系统可以发送命令对第一分区进行主动刷新。In still other embodiments of the present invention, when the user uses the performance acceleration function for the target application, the system of the electronic device may send a command to actively refresh the first partition.

在本发明又一些实施例中,该数据存储方法还可以包括:In still other embodiments of the present invention, the data storage method may further include:

在目标应用程序被卸载的情况下,释放目标存储区域。In the case where the target application is uninstalled, the target storage area is released.

即在用户将目标应用程序从电子设备删除的情况下,需要把目标存储区域释放,并且删除目标存储区域内所存储的全部数据。That is, when the user deletes the target application program from the electronic device, the target storage area needs to be released, and all the data stored in the target storage area needs to be deleted.

在本发明一些实施例中,在释放目标存储区域之后,该数据存储方法还可以包括:In some embodiments of the present invention, after releasing the target storage area, the data storage method may further include:

解除目标应用程序与目标存储区域的关联关系。Disassociates the target application from the target storage area.

由此,可以使目标存储区域与目标应用程序不再关联,并且使目标存储区域释放后的存储区域可以与新的常用应用程序相关联。In this way, the target storage area can be no longer associated with the target application, and the storage area after the target storage area is released can be associated with the new frequently used application.

在本发明一些实施例中,该数据存储方法还可以包括:In some embodiments of the present invention, the data storage method may further include:

在目标应用图标上,显示目标标识;On the target application icon, display the target logo;

其中,目标应用图标为在显示界面上显示的与目标应用程序相关联的应用图标。The target application icon is an application icon associated with the target application displayed on the display interface.

具体地,目标标识为用于指示该目标应用图标对应的目标应用程序在第一分区中具有目标存储区域,也可以理解为具有“加速”标识。例如,目标标识可以为“火箭”图标或者“☆”图标。Specifically, the target identifier is used to indicate that the target application program corresponding to the target application icon has a target storage area in the first partition, which can also be understood as having an “acceleration” identifier. For example, the target identifier may be a "rocket" icon or a "☆" icon.

在本发明实施例中,目标标识可以由电子设备预先设置,或者,也可以由用户进行设置,在此不做限制。In this embodiment of the present invention, the target identifier may be preset by the electronic device, or may also be set by the user, which is not limited herein.

图8示出了本发明一个实施例提供的应用图标显示界面的界面示意图。其中,带有“☆”图标630的第一应用图标610可以为在第一分区中具有存储区域的应用程序对应的应用图标,不带有“☆”图标630的第二应用图标620可以为在第一分区中不具有存储区域的应用程序对应的应用图标。用户可以手动在不带有“☆”图标630的第二应用图标620的右下方添加“☆”图标630,使电子设备在第一分区中为其对应的应用程序分配相关联的存储空间。由此,通过“☆”图标630可以让用户知晓这个应用程序为具有高性能的应用程序。FIG. 8 shows a schematic interface diagram of an application icon display interface provided by an embodiment of the present invention. The first application icon 610 with the "☆" icon 630 may be the application icon corresponding to the application with a storage area in the first partition, and the second application icon 620 without the "☆" icon 630 may be the application icon in the first partition. An application icon corresponding to an application program that does not have a storage area in the first partition. The user can manually add a "☆" icon 630 to the lower right of the second application icon 620 without the "☆" icon 630, so that the electronic device allocates associated storage space for its corresponding application in the first partition. Therefore, through the "☆" icon 630, the user can be informed that this application is an application with high performance.

在本发明另一些实施例中,在在目标应用图标上显示目标标识之后,该数据存储方法还可以包括:In other embodiments of the present invention, after displaying the target identifier on the target application icon, the data storage method may further include:

接收用户对目标标识的第一输入;receiving the first input of the target identifier from the user;

响应于第一输入,将目标存储区域所存储的目标类别的数据移动至第二分区内;In response to the first input, the data of the target category stored in the target storage area is moved to the second partition;

释放目标存储区域。Free the target storage area.

在本发明一些实施例中,目标输入可以为用于取消目标标识的输入,例如对目标标识的点击输入、长按输入等,目标输入还可以为对目标标识的第一操作,例如,在设置界面内针对目标应用图标的目标标识的取消操作。以目标输入为对目标标识的点击输入为例,在用户点击目标标识后,则电子设备可以确定用户希望将第一分区内的目标存储区域进行释放,因此,电子设备可以响应于目标输入,将目标存储区域所存储的目标类别的数据移动至第二分区内,并且释放目标存储区域。In some embodiments of the present invention, the target input may be an input for canceling the target identification, such as a click input on the target identification, a long-press input, etc., and the target input may also be a first operation on the target identification, for example, in setting The cancel operation for the target ID of the target application icon in the interface. Taking the target input as the click input on the target identifier as an example, after the user clicks on the target identifier, the electronic device can determine that the user wishes to release the target storage area in the first partition. Therefore, the electronic device can respond to the target input, The data of the target category stored in the target storage area is moved to the second partition, and the target storage area is released.

在本发明一些实施例中,目标类别的数据可以为有效数据。In some embodiments of the present invention, the data of the target category may be valid data.

在本发明一些实施例中,在释放目标存储区域之后,该数据存储方法还可以包括:In some embodiments of the present invention, after releasing the target storage area, the data storage method may further include:

解除目标应用程序与目标存储区域的关联关系。Disassociates the target application from the target storage area.

由此,可以使目标存储区域与目标应用程序不再关联,并且使目标存储区域释放后的存储区域可以与新的常用应用程序相关联。In this way, the target storage area can be no longer associated with the target application, and the storage area after the target storage area is released can be associated with the new frequently used application.

在本发明一些实施例中,在释放目标存储区域之后,该数据存储方法还可以包括:In some embodiments of the present invention, after releasing the target storage area, the data storage method may further include:

隐藏目标标识。Hide target ID.

具体地,如果目标应用图标上不再显示目标标识,则可以使用户知晓目标应用图标对应的目标应用程序在第一分区内不再具有目标存储区域。Specifically, if the target identifier is no longer displayed on the target application icon, the user can be informed that the target application program corresponding to the target application icon no longer has the target storage area in the first partition.

在使用测试工具AndroBench性能测试工具测试电子设备时,若利用现有技术的方法进行应用程序的数据存储,普通写速度只有250MB/s,随着电子设备使用时间的增长,存储空间的数据存储量减少,碎片数据和碎片空间变多,写速度会下降30%左右;若利用本发明实施例提供的数据存储方法进行应用程序的数据存储,电子设备写速度可达到500MB/s,若写速度偶尔下降时,电子设备静置一段时间后速度可恢复到500MB/s,使得电子设备的较高性能能够长久维持下去。When using the test tool AndroBench performance test tool to test the electronic device, if the method of the prior art is used to store the data of the application program, the ordinary writing speed is only 250MB/s. Reduce, fragmented data and fragmented space will increase, and the writing speed will drop by about 30%; if the data storage method provided by the embodiment of the present invention is used to store the data of the application, the writing speed of the electronic device can reach 500MB/s. If the writing speed is occasional When descending, the speed of the electronic device can be restored to 500MB/s after standing for a period of time, so that the high performance of the electronic device can be maintained for a long time.

综上所述,在本发明实施例中,由于应用程序可以享有独立的高性能的存储区域,该存储区域比普通的存储区域具有更快的读写响应速度,可以提高电子设备中的应用程序的性能。并且,由于应用程序的读写响应速度不会受到电子设备的使用时间及碎片的影响,存储区域可以动态刷新,使应用程序的存储区域始终保持充分的数据存储量,因此,能够使电子设备的应用程序长期保持较高的性能。To sum up, in the embodiment of the present invention, since the application program can enjoy an independent high-performance storage area, the storage area has a faster read and write response speed than the ordinary storage area, and the application program in the electronic device can be improved. performance. In addition, since the read and write response speed of the application program will not be affected by the use time and fragmentation of the electronic device, the storage area can be dynamically refreshed, so that the storage area of the application program always maintains sufficient data storage capacity. The application maintains high performance for a long time.

图9示出了本发明一个实施例提供的电子设备的结构示意图。FIG. 9 shows a schematic structural diagram of an electronic device provided by an embodiment of the present invention.

在本发明一些实施例中,图9所示的电子设备可以包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。In some embodiments of the present invention, the electronic devices shown in FIG. 9 may include, but are not limited to, mobile phones, tablet computers, notebook computers, handheld computers, vehicle-mounted terminals, wearable devices, and pedometers.

如图9所示,该电子设备可以包括:As shown in Figure 9, the electronic device may include:

数据获取模块710,用于获取目标应用程序对应的目标数据;a data acquisition module 710, configured to acquire target data corresponding to the target application;

数据存储模块720,用于将目标数据存储于与目标应用程序相关联的目标存储区域中;a data storage module 720, configured to store target data in a target storage area associated with the target application;

其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。The target storage area is located in the first partition of the storage space, the storage space further includes a second partition, and the first data storage capacity of the first storage unit in the first partition is smaller than the second storage capacity of the second storage unit in the second partition. Amount of data storage.

在本发明实施例中,电子设备的存储空间分为第一分区和第二分区,第一分区中的目标存储区域被用作于目标应用程序的独立存储区域,在获取到目标应用程序对应的目标数据之后,可以将目标数据存储于该目标存储区域中,使得目标应用程序读取所需要的数据时可以快速地找到数据所存储的位置,并且,由于第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量,使得向第一分区内存储数据的程序比第二分区内存储数据的程序更加简化,并且从目标存储区域中读取目标应用程序读取所需要的数据的程序也相应地简化,从而可以提升读取目标应用程序所需的数据的效率,使得电子设备读写数据的响应速度更快,从而大幅提高目标应用程序的性能。同时,由于目标应用程序可以在第一分区中的独立存储区域内进行数据写入和读取,相当于目标应用程序都具有自己的高速缓存区域,能在长时间内保证应用程序具有较高的性能。In this embodiment of the present invention, the storage space of the electronic device is divided into a first partition and a second partition, and the target storage area in the first partition is used as an independent storage area for the target application. After the target data, the target data can be stored in the target storage area, so that the target application can quickly find the location where the data is stored when reading the required data. The first data storage amount is smaller than the second data storage amount of the second storage unit in the second partition, so that the program for storing data in the first partition is more simplified than the program for storing data in the second partition, and the data is stored in the target storage area. The program for reading the data required by the target application program is also simplified accordingly, which can improve the efficiency of reading the data required by the target application program, make the electronic device read and write data faster, and greatly improve the target application program. program performance. At the same time, since the target application can write and read data in the independent storage area in the first partition, it is equivalent to that the target application has its own cache area, which can ensure that the application has a high performance for a long time. performance.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

分区创建模块,用于在获取目标应用程序对应的目标数据之前,在存储空间中创建第一分区;The partition creation module is used to create the first partition in the storage space before acquiring the target data corresponding to the target application;

分区分配模块,用于按照预定分配方式,在第一分区的第一存储单元中,选取至少一个目标第一存储单元;a partition allocation module, configured to select at least one target first storage unit in the first storage unit of the first partition according to a predetermined distribution method;

分区确定模块,用于将所选取的目标第一存储单元确定为目标存储区域。The partition determination module is configured to determine the selected target first storage unit as a target storage area.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

区域调节模块,用于在目标存储区域在第一预设时间段内的第一数据存储量小于第一预设阈值或者大于第二预设阈值的情况下,根据第一数据存储量,调节目标存储区域所包含的目标第一存储单元的数量;an area adjustment module, configured to adjust the target storage area according to the first data storage amount when the first data storage amount of the target storage area within the first preset time period is less than the first preset threshold or greater than the second preset threshold the number of target first storage units contained in the storage area;

其中,第一预设阈值小于第二预设阈值。Wherein, the first preset threshold is smaller than the second preset threshold.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

图标显示模块,用于在目标应用图标上,显示目标标识;The icon display module is used to display the target identification on the target application icon;

其中,目标应用图标为在显示界面上显示的与目标应用程序相关联的应用图标。The target application icon is an application icon associated with the target application displayed on the display interface.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

输入接收模块,用于在目标应用图标上显示目标标识之后,接收用户对目标标识的第一输入;an input receiving module, configured to receive the first input of the target identifier by the user after displaying the target identifier on the target application icon;

第一数据移动模块,用于响应于第一输入,将目标存储区域所存储的目标类别的数据移动至第二分区内;a first data moving module, configured to move the data of the target category stored in the target storage area to the second partition in response to the first input;

第一区域释放模块,用于释放目标存储区域。The first area release module is used to release the target storage area.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

标识隐藏模块,用于在释放目标存储区域之后,隐藏目标标识。The identifier hiding module is used to hide the target identifier after releasing the target storage area.

在本发明一些实施例中,目标应用程序为具有第一属性的应用程序。此时,该电子设备还可以包括:In some embodiments of the present invention, the target application is an application with the first attribute. At this time, the electronic device may further include:

第二数据移动模块,用于在目标应用程序由第一属性更新为第二属性的情况下,将目标存储区域所存储的目标类别的数据移动至第二分区内;a second data moving module, configured to move the data of the target category stored in the target storage area to the second partition when the target application is updated from the first attribute to the second attribute;

第二区域释放模块,用于释放目标存储区域。The second area release module is used to release the target storage area.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

第三区域释放模块,用于在目标应用程序被卸载的情况下,释放目标存储区域。The third area release module is used to release the target storage area when the target application is uninstalled.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

关联接触模块,用于在释放目标存储区域之后,解除目标应用程序与目标存储区域的关联关系。The association contact module is used to release the association relationship between the target application and the target storage area after releasing the target storage area.

在本发明一些实施例中,该电子设备还可以包括:In some embodiments of the present invention, the electronic device may further include:

第三数据移动模块,用于在目标存储区域的第二数据存储量大于第三预设阈值的情况下,将目标存储区域所存储的目标类别的数据移动至第二分区内;A third data moving module, configured to move the data of the target category stored in the target storage area to the second partition when the second data storage amount of the target storage area is greater than the third preset threshold;

第四区域释放模块,用于释放目标存储区域。The fourth area release module is used to release the target storage area.

在本发明一些实施例中,第一分区为单层存储单元SLC存储模式,第二分区为三层存储单元TLC存储模式。In some embodiments of the present invention, the first partition is a single-layer storage cell SLC storage mode, and the second partition is a three-layer storage cell TLC storage mode.

需要说明的是,本发明实施例提供的电子设备能够实现图2至图8的方法实施例中电子设备实现的各个过程和效果,并且实现的原理相似,为避免重复,这里不再赘述。It should be noted that the electronic device provided in the embodiments of the present invention can implement various processes and effects implemented by the electronic device in the method embodiments of FIG. 2 to FIG. 8 , and the implementation principles are similar.

图10为实现本发明各个实施例的一种电子设备的硬件结构示意图。如图10所示,该电子设备800包括但不限于:射频单元801、网络模块802、音频输出单元803、输入单元804、传感器805、显示单元806、用户输入单元807、接口单元808、存储器809、处理器810、以及电源811等部件。本领域技术人员可以理解,图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present invention. As shown in FIG. 10 , the electronic device 800 includes but is not limited to: a radio frequency unit 801 , a network module 802 , an audio output unit 803 , an input unit 804 , a sensor 805 , a display unit 806 , a user input unit 807 , an interface unit 808 , and a memory 809 , the processor 810, and the power supply 811 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 10 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or different components layout. In this embodiment of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.

其中,处理器810,用于获取目标应用程序对应的目标数据;将目标数据存储于与目标应用程序相关联的目标存储区域中;其中,目标存储区域位于存储空间的第一分区内,存储空间还包括第二分区,第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量。The processor 810 is configured to acquire target data corresponding to the target application; store the target data in a target storage area associated with the target application; wherein, the target storage area is located in the first partition of the storage space, and the storage space A second partition is also included, and the first data storage amount of the first storage unit in the first partition is smaller than the second data storage amount of the second storage unit in the second partition.

在本发明实施例中,电子设备的存储空间分为第一分区和第二分区,第一分区中的目标存储区域被用作于目标应用程序的独立存储区域,在获取到目标应用程序对应的目标数据之后,可以将目标数据存储于该目标存储区域中,使得目标应用程序读取所需要的数据时可以快速地找到数据所存储的位置,并且,由于第一分区中的第一存储单元的第一数据存储量小于第二分区中的第二存储单元的第二数据存储量,使得向第一分区内存储数据的程序比第二分区内存储数据的程序更加简化,并且从目标存储区域中读取目标应用程序读取所需要的数据的程序也相应地简化,从而可以提升读取目标应用程序所需的数据的效率,使得电子设备读写数据的响应速度更快,从而大幅提高目标应用程序的性能。同时,由于目标应用程序可以在第一分区中的独立存储区域内进行数据写入和读取,相当于目标应用程序都具有自己的高速缓存区域,能在长时间内保证应用程序具有较高的性能。In this embodiment of the present invention, the storage space of the electronic device is divided into a first partition and a second partition, and the target storage area in the first partition is used as an independent storage area for the target application. After the target data, the target data can be stored in the target storage area, so that the target application can quickly find the location where the data is stored when reading the required data. The first data storage amount is smaller than the second data storage amount of the second storage unit in the second partition, so that the program for storing data in the first partition is more simplified than the program for storing data in the second partition, and the data is stored in the target storage area. The program for reading the data required by the target application program is also simplified accordingly, which can improve the efficiency of reading the data required by the target application program, make the electronic device read and write data faster, and greatly improve the target application program. program performance. At the same time, since the target application can write and read data in the independent storage area in the first partition, it is equivalent to that the target application has its own cache area, which can ensure that the application has a high performance for a long time. performance.

应理解的是,本发明实施例中,射频单元801可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器810处理;另外,将上行的数据发送给基站。通常,射频单元801包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元801还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in this embodiment of the present invention, the radio frequency unit 801 can be used for receiving and sending signals during sending and receiving of information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 810; The uplink data is sent to the base station. Generally, the radio frequency unit 801 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 801 can also communicate with the network and other devices through a wireless communication system.

电子设备通过网络模块802为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The electronic device provides the user with wireless broadband Internet access through the network module 802, such as helping the user to send and receive emails, browse web pages, access streaming media, and the like.

音频输出单元803可以将射频单元801或网络模块802接收的或者在存储器809中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元803还可以提供与电子设备800执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元803包括扬声器、蜂鸣器以及受话器等。The audio output unit 803 may convert audio data received by the radio frequency unit 801 or the network module 802 or stored in the memory 809 into audio signals and output as sound. Also, the audio output unit 803 may also provide audio output related to a specific function performed by the electronic device 800 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 803 includes a speaker, a buzzer, a receiver, and the like.

输入单元804用于接收音频或视频信号。输入单元804可以包括图形处理器(Graphics Processing Unit,GPU)8041和麦克风8042,图形处理器8041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元806上。经图形处理器8041处理后的图像帧可以存储在存储器809(或其它存储介质)中或者经由射频单元801或网络模块802进行发送。麦克风8042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元801发送到移动通信基站的格式输出。The input unit 804 is used to receive audio or video signals. The input unit 804 may include a graphics processor (Graphics Processing Unit, GPU) 8041 and a microphone 8042, and the graphics processor 8041 captures images of still pictures or videos obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 806 . The image frames processed by the graphics processor 8041 may be stored in the memory 809 (or other storage medium) or transmitted via the radio frequency unit 801 or the network module 802 . The microphone 8042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 801 for output in the case of a telephone call mode.

电子设备800还包括至少一种传感器805,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板8061的亮度,接近传感器可在电子设备800移动到耳边时,关闭显示面板8061和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器805还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The electronic device 800 also includes at least one sensor 805, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 8061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 8061 and the display panel 8061 when the electronic device 800 is moved to the ear. / or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, related games , magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 805 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, Infrared sensors, etc., are not repeated here.

显示单元806用于显示由用户输入的信息或提供给用户的信息。显示单元806可包括显示面板8061,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板8061。The display unit 806 is used to display information input by the user or information provided to the user. The display unit 806 may include a display panel 8061, and the display panel 8061 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

用户输入单元807可用于接收输入的数字或字符信息,以及产生与电子设备的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元807包括触控面板8071以及其他输入设备8072。触控面板8071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板8071上或在触控面板8071附近的操作)。触控面板8071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器810,接收处理器810发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板8071。除了触控面板8071,用户输入单元807还可以包括其他输入设备8072。具体地,其他输入设备8072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 807 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 807 includes a touch panel 8071 and other input devices 8072 . The touch panel 8071, also referred to as a touch screen, collects the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable object or accessory on or near the touch panel 8071). operate). The touch panel 8071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 810, the command sent by the processor 810 is received and executed. In addition, the touch panel 8071 can be realized by various types of resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 8071 , the user input unit 807 may also include other input devices 8072 . Specifically, other input devices 8072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and operation sticks, which will not be repeated here.

进一步的,触控面板8071可覆盖在显示面板8061上,当触控面板8071检测到在其上或附近的触摸操作后,传送给处理器810以确定触摸事件的类型,随后处理器810根据触摸事件的类型在显示面板8061上提供相应的视觉输出。虽然在图10中,触控面板8071与显示面板8061是作为两个独立的部件来实现电子设备的输入和输出功能,但是在某些实施例中,可以将触控面板8071与显示面板8061集成而实现电子设备的输入和输出功能,具体此处不做限定。Further, the touch panel 8071 can be covered on the display panel 8061. When the touch panel 8071 detects a touch operation on or near it, it transmits it to the processor 810 to determine the type of the touch event, and then the processor 810 determines the type of the touch event according to the touch The type of event provides a corresponding visual output on the display panel 8061. Although in FIG. 10 , the touch panel 8071 and the display panel 8061 are used as two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 8071 and the display panel 8061 can be integrated The implementation of the input and output functions of the electronic device is not specifically limited here.

接口单元808为外部装置与电子设备800连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元808可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备800内的一个或多个元件或者可以用于在电子设备800和外部装置之间传输数据。The interface unit 808 is an interface for connecting an external device to the electronic device 800 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 808 may be used to receive input (eg, data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 800 or may be used between the electronic device 800 and external Transfer data between devices.

存储器809可用于存储软件程序以及各种数据。存储器809可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器809可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 809 may be used to store software programs as well as various data. The memory 809 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc. Additionally, memory 809 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

处理器810是电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储器809内的软件程序和/或模块,以及调用存储在存储器809内的数据,执行电子设备的各种功能和处理数据,从而对电子设备进行整体监控。处理器810可包括一个或多个处理单元;优选的,处理器810可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器810中。The processor 810 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 809, and calling the data stored in the memory 809. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole. The processor 810 may include one or more processing units; preferably, the processor 810 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 810.

电子设备800还可以包括给各个部件供电的电源811(比如电池),优选的,电源811可以通过电源管理系统与处理器810逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The electronic device 800 may also include a power supply 811 (such as a battery) for supplying power to various components. Preferably, the power supply 811 may be logically connected to the processor 810 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system and other functions.

另外,电子设备800包括一些未示出的功能模块,在此不再赘述。In addition, the electronic device 800 includes some functional modules not shown, which will not be repeated here.

优选的,本发明实施例还提供一种电子设备,包括处理器810,存储器809,存储在存储器809上并可在所述处理器810上运行的计算机程序,该计算机程序被处理器810执行时实现上述数据存储方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Preferably, an embodiment of the present invention further provides an electronic device, including a processor 810 , a memory 809 , a computer program stored in the memory 809 and running on the processor 810 , when the computer program is executed by the processor 810 The various processes of the above data storage method embodiments are implemented, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述数据存储方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the foregoing data storage method embodiments can be implemented, and the same technology can be achieved. The effect, in order to avoid repetition, is not repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。From the description of the above embodiments, those skilled in the art can clearly understand that the method of the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is better implementation. Based on this understanding, the technical solutions of the present invention can be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products are stored in a storage medium (such as ROM/RAM, magnetic disk, CD), including several instructions to make a terminal (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the methods described in the various embodiments of the present invention.

上面结合附图对本发明的实施例进行了描述,但是本发明并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本发明的启示下,在不脱离本发明宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本发明的保护之内。The embodiments of the present invention have been described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific embodiments, which are merely illustrative rather than restrictive. Under the inspiration of the present invention, without departing from the spirit of the present invention and the scope protected by the claims, many forms can be made, which all belong to the protection of the present invention.

Claims (12)

1. A data storage method is applied to electronic equipment and is characterized by comprising the following steps:
acquiring target data corresponding to a target application program;
storing the target data in a target storage area associated with the target application;
the target storage area is located in a first partition of a storage space, the storage space further comprises a second partition, and a first data storage amount of a first storage unit in the first partition is smaller than a second data storage amount of a second storage unit in the second partition.
2. The method according to claim 1, wherein before obtaining the target data corresponding to the target application, further comprising:
creating the first partition in the storage space;
selecting at least one target first storage unit from the first storage units of the first partition according to a preset distribution mode;
and determining the selected target first storage unit as the target storage area.
3. The method of claim 1 or 2, further comprising:
under the condition that a first data storage amount of the target storage area in a first preset time period is smaller than a first preset threshold value or larger than a second preset threshold value, adjusting the number of target first storage units contained in the target storage area according to the first data storage amount;
wherein the first preset threshold is smaller than the second preset threshold.
4. The method of claim 1, further comprising:
displaying a target identifier on the target application icon;
the target application icon is an application icon which is displayed on a display interface and is associated with the target application program.
5. The method of claim 4, wherein after displaying the target identifier on the target application icon, further comprising:
receiving a first input of the target identification by a user;
moving data of a target category stored by the target storage area into the second partition in response to the first input;
and releasing the target storage area.
6. The method of claim 1, wherein the target application is an application having a first property;
wherein the method further comprises:
when the target application program is updated to be the second attribute from the first attribute, moving the data of the target category stored in the target storage area into the second partition;
and releasing the target storage area.
7. The method of claim 1, further comprising:
releasing the target storage area in the event that the target application is uninstalled.
8. The method according to any one of claims 5-7, wherein after releasing the target storage area, further comprising:
and releasing the association relation between the target application program and the target storage area.
9. The method of claim 1, further comprising:
under the condition that a second data storage amount of the target storage area is larger than a third preset threshold, moving the data of the target category stored in the target storage area into the second partition;
and releasing the target storage area.
10. The method of claim 1, wherein the first partition is a single-level cell (SLC) memory mode and the second partition is a triple-level cell (TLC) memory mode.
11. An electronic device, comprising:
the data acquisition module is used for acquiring target data corresponding to the target application program;
a data storage module to store the target data in a target storage area associated with the target application;
the target storage area is located in a first partition of a storage space, the storage space further comprises a second partition, and a first data storage amount of a first storage unit in the first partition is smaller than a second data storage amount of a second storage unit in the second partition.
12. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the data storage method according to any one of claims 1 to 10.
CN202010074454.9A 2020-01-22 2020-01-22 Data storage method, electronic device, and medium Pending CN111274160A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010074454.9A CN111274160A (en) 2020-01-22 2020-01-22 Data storage method, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010074454.9A CN111274160A (en) 2020-01-22 2020-01-22 Data storage method, electronic device, and medium

Publications (1)

Publication Number Publication Date
CN111274160A true CN111274160A (en) 2020-06-12

Family

ID=70999113

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010074454.9A Pending CN111274160A (en) 2020-01-22 2020-01-22 Data storage method, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN111274160A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782154A (en) * 2020-07-13 2020-10-16 北京四季豆信息技术有限公司 Data transfer method, device and system
CN112347503A (en) * 2020-10-14 2021-02-09 重庆传音通讯技术有限公司 Management method, management device and computer storage medium
CN112416253A (en) * 2020-11-25 2021-02-26 新华三云计算技术有限公司 Storage area dynamic adjustment method and device based on distributed storage
CN113407259A (en) * 2021-07-13 2021-09-17 北京百度网讯科技有限公司 Scene loading method, device, equipment and storage medium
CN113778712A (en) * 2021-09-10 2021-12-10 苏州苏试试验集团股份有限公司 Embedded system
CN114356796A (en) * 2021-12-30 2022-04-15 杭州萤石软件有限公司 Flash memory card, and pre-allocation method and system of flash memory card
CN115095950A (en) * 2022-05-20 2022-09-23 北京小米移动软件有限公司 Method and device for controlling air conditioner, electronic equipment and storage medium
CN115826854A (en) * 2022-11-09 2023-03-21 深圳市广和通无线股份有限公司 Storage method, device, device and storage medium
CN118628057A (en) * 2024-06-26 2024-09-10 深圳市圣旺达科技有限公司 Enterprise smart management method, system and terminal based on big data and smart office
WO2025001459A1 (en) * 2023-06-30 2025-01-02 华为技术有限公司 Data management method and apparatus, device, and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070002612A1 (en) * 2005-06-29 2007-01-04 Chang Robert C Method and system for managing partitions in a storage device
CN105867845A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Application storage space management method and device
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109144723A (en) * 2018-07-23 2019-01-04 北京轻元科技有限公司 A kind of method and terminal for distributing memory space
CN110083573A (en) * 2019-04-30 2019-08-02 维沃移动通信有限公司 A file management method and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070002612A1 (en) * 2005-06-29 2007-01-04 Chang Robert C Method and system for managing partitions in a storage device
CN105867845A (en) * 2016-03-28 2016-08-17 乐视控股(北京)有限公司 Application storage space management method and device
CN108595113A (en) * 2018-03-22 2018-09-28 维沃移动通信有限公司 A kind of method and terminal of subregion adjustment
CN109144723A (en) * 2018-07-23 2019-01-04 北京轻元科技有限公司 A kind of method and terminal for distributing memory space
CN110083573A (en) * 2019-04-30 2019-08-02 维沃移动通信有限公司 A file management method and mobile terminal

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111782154A (en) * 2020-07-13 2020-10-16 北京四季豆信息技术有限公司 Data transfer method, device and system
CN111782154B (en) * 2020-07-13 2023-07-04 芯象半导体科技(北京)有限公司 Data moving method, device and system
CN112347503A (en) * 2020-10-14 2021-02-09 重庆传音通讯技术有限公司 Management method, management device and computer storage medium
CN112416253B (en) * 2020-11-25 2022-09-30 新华三云计算技术有限公司 A method and device for dynamic adjustment of storage area based on distributed storage
CN112416253A (en) * 2020-11-25 2021-02-26 新华三云计算技术有限公司 Storage area dynamic adjustment method and device based on distributed storage
CN113407259A (en) * 2021-07-13 2021-09-17 北京百度网讯科技有限公司 Scene loading method, device, equipment and storage medium
CN113778712A (en) * 2021-09-10 2021-12-10 苏州苏试试验集团股份有限公司 Embedded system
CN113778712B (en) * 2021-09-10 2024-03-29 苏州苏试试验集团股份有限公司 Embedded system
CN114356796A (en) * 2021-12-30 2022-04-15 杭州萤石软件有限公司 Flash memory card, and pre-allocation method and system of flash memory card
CN115095950A (en) * 2022-05-20 2022-09-23 北京小米移动软件有限公司 Method and device for controlling air conditioner, electronic equipment and storage medium
CN115826854A (en) * 2022-11-09 2023-03-21 深圳市广和通无线股份有限公司 Storage method, device, device and storage medium
WO2025001459A1 (en) * 2023-06-30 2025-01-02 华为技术有限公司 Data management method and apparatus, device, and readable storage medium
CN118628057A (en) * 2024-06-26 2024-09-10 深圳市圣旺达科技有限公司 Enterprise smart management method, system and terminal based on big data and smart office

Similar Documents

Publication Publication Date Title
CN111274160A (en) Data storage method, electronic device, and medium
CN110083573B (en) A file management method and mobile terminal
CN107480169B (en) Image loading method, terminal and computer-readable storage medium
CN110147380B (en) Data update method, device, server and storage medium
CN108595113A (en) A kind of method and terminal of subregion adjustment
CN110008141B (en) Fragment sorting method and electronic equipment
US11704240B2 (en) Garbage data scrubbing method, and device
CN109144723B (en) Method and terminal for allocating storage space
CN109885257A (en) A kind of disk file reading/writing method and device
CN108228398A (en) A kind of abnormality eliminating method and mobile terminal
CN107870874B (en) A data writing control method and storage device
CN107766370A (en) A kind of file fragmentation appraisal procedure and terminal
CN114691531A (en) Memory recovery method and related equipment
CN115729478B (en) Solid state disk block correction method and device, electronic equipment and storage medium
CN115756341B (en) Solid state disk garbage collection method, device, electronic equipment and storage medium
CN111026674A (en) Data storage method and electronic equipment
CN110008184A (en) A file processing method and electronic device
CN109508300B (en) Disk fragment sorting method and device and computer readable storage medium
US11237741B2 (en) Electronic device and control method for controlling memory
CN115167764B (en) Data read-write processing method and device, electronic equipment and storage medium
CN118550689A (en) A shared memory allocation method, device, electronic device and storage medium
CN111966493B (en) Process processing method, electronic device and storage medium
CN115657943A (en) Data processing method, device and equipment for thin volume of storage system and storage medium
CN115543459A (en) Server memory configuration method and device, electronic equipment and readable storage medium
CN108255930A (en) The data clearing method and mobile terminal of a kind of mobile terminal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination