WO2018233216A1 - Method and electronic device for processing data - Google Patents

Method and electronic device for processing data Download PDF

Info

Publication number
WO2018233216A1
WO2018233216A1 PCT/CN2017/113559 CN2017113559W WO2018233216A1 WO 2018233216 A1 WO2018233216 A1 WO 2018233216A1 CN 2017113559 W CN2017113559 W CN 2017113559W WO 2018233216 A1 WO2018233216 A1 WO 2018233216A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
data
electronic device
information
physical memory
Prior art date
Application number
PCT/CN2017/113559
Other languages
French (fr)
Chinese (zh)
Inventor
廖毅
李波
何海洋
Original Assignee
联想(北京)有限公司
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 联想(北京)有限公司 filed Critical 联想(北京)有限公司
Publication of WO2018233216A1 publication Critical patent/WO2018233216A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Definitions

  • the present disclosure belongs to the field of data processing, and in particular, to a data processing method and an electronic device.
  • the physical memory when the physical memory is insufficient, part of the data in the memory is stored in a specific space of the hard disk, and when the part of the data needs to be executed, the physical memory is restored from the hard disk, thereby alleviating the physical memory.
  • the pressure of use However, the maximum read/write speed of the hard disk can only reach the M/s level. Under different user usage scenarios, the amount of data to be exchanged may be as high as several G. Obviously, the read/write speed of the hard disk cannot meet the demand.
  • Embodiments of the present disclosure provide a data processing method and an electronic device with fast reading and writing speed.
  • a data processing method is applied to an electronic device configured with a non-volatile memory, and includes: detecting usage state information of a physical memory of the electronic device; determining that the usage state information of the physical memory indicates occupation of physical memory When the rate is greater than the preset value, the first data is selected from the physical memory of the electronic device and the first data is transferred to the first partition of the non-volatile memory.
  • the method further includes: detecting call information about the first data; and recovering the first data into the physical memory when the call information of the first data is detected.
  • the detecting the usage status information of the physical memory of the electronic device includes: detecting a program executed in the physical memory, and information of a memory space occupied by each program; and based on a memory space occupied by each program The information generates information on the usage status of the physical memory.
  • selecting the first data from the physical memory of the electronic device includes: acquiring usage of the memory data stored in the physical memory; and the use case of the memory data indicates that the memory data is The first data is generated by using the memory data when the preset time is not being operated.
  • the dumping the first data to the first partition of the non-volatile memory includes: acquiring address information of a first partition in the non-volatile memory; based on the address information The acquired first data is dumped into an address space corresponding to the address information.
  • An embodiment of the present disclosure further provides an electronic device, including: an internal memory and a non-volatile memory, and a processor;
  • the processor is configured to detect usage status information of physical memory of an internal memory of the electronic device
  • the first data is selected from the physical memory of the electronic device, and the first data is transferred to the nonvolatile In the first partition of the memory.
  • the processor is further configured to detect call information regarding the first data; when the call information of the first data is detected, restore the first data into the physical memory.
  • the processor further detects a program executed in the physical memory, and information of a memory space occupied by each program; and generates a usage state of the physical memory based on information of a memory space occupied by each program. Information.
  • the processor acquires usage of the memory data stored in the physical memory; when the usage of the memory data indicates that the memory data is not operated within a preset time, the memory is utilized The data generates the first data.
  • the processor acquires address information of a first partition in the non-volatile memory; and dumps the acquired first data into an address space corresponding to the address information based on the address information.
  • the embodiment of the present disclosure may store the first data in the non-volatile memory when the physical memory of the electronic device is occupied, and may also store the non-volatile memory when the first data needs to be executed. The first data is restored to the physical memory. Since the embodiment of the present disclosure performs read and write operations through the memory, the read/write speed is fast, and there is no IO delay.
  • FIG. 1 is a schematic flowchart of a data processing method in an embodiment of the present disclosure
  • FIG. 2 is a schematic flowchart of detecting usage status information of physical memory of an electronic device according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of a data processing method according to another embodiment of the present disclosure.
  • FIG. 5 is a configuration diagram of an electronic device in an embodiment of the present disclosure.
  • a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions.
  • a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium.
  • the computer readable medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
  • a magnetic storage device such as a magnetic tape or a hard disk (HDD)
  • an optical storage device such as a compact disk (CD-ROM)
  • a memory such as a random access memory (RAM) or a flash memory
  • RAM random access memory
  • the embodiments of the present disclosure provide a data processing method for releasing a part of data in a memory to a non-volatile memory when the memory of the electronic device is insufficient.
  • the first partition ensures the normal use of the memory, and since the first partition that releases the data in the memory to the non-volatile memory is equivalent to the copy of the memory data, the data transfer speed can be greatly improved. Storage speed.
  • FIG. 1 it is a schematic flowchart of a data processing method in an embodiment of the present disclosure, which may be applied in an electronic device configured with a non-volatile memory, and the method may include:
  • the first data is selected from the physical memory of the electronic device, and the first data is transferred to the non-easy In the first partition of the memory.
  • various programs can be run in different stages of the electronic device or in different devices.
  • the program needs to be executed using the memory space of the electronic device, and the memory can also be used.
  • the space temporarily stores the data generated in the process, so if the memory of the electronic device is occupied in a large amount, it will affect the running speed of the electronic device and also affect the operation of the program.
  • Embodiments of the present disclosure may be configured with a non-volatile memory in an electronic device configured as a non-volatile memory.
  • a non-volatile memory in an electronic device configured as a non-volatile memory.
  • part of the data in the physical memory may be released into the non-volatile memory for storage, thereby reducing the occupation rate of the physical memory of the electronic device, and ensuring Inside the electronic device
  • the remaining space of the storage space may be sufficient for running various programs of the electronic device, thereby increasing the operating rate of the system of the electronic device and then the system performance.
  • the embodiment of the present disclosure can detect the usage status of the physical memory of the electronic device in real time, such as detecting the current physical memory usage rate or occupancy rate in real time. And the data in the physical memory is adjusted correspondingly by the detection result to ensure the remaining memory space of the physical memory.
  • the detecting the usage status information of the physical memory of the electronic device in the embodiment of the present disclosure may include: detecting a program executed in the physical memory, and information about a memory space occupied by each program; The information of the memory space generates information on the state of use of the physical memory.
  • the information of the currently running program in the electronic device may be separately collected, and the information of the memory space occupied by each program may be detected correspondingly, for example, expressed as a percentage.
  • the occupied memory space based on the information of the above program and the information of the occupied memory space, can count the current memory usage rate, that is, the information of the memory space occupied by each program is added to obtain the current occupancy rate information of the physical memory, that is, Use status information.
  • the first data when it is determined that the usage status information of the physical memory of the electronic device indicates that the occupancy rate of the physical memory is greater than a preset value, the first data may be selected from the physical memory of the electronic device, and the first data is selected. Released into the first partition of the non-volatile internal memory, the first data is stored by the first partition, thereby increasing the memory space and facilitating the operation of the electronic device.
  • the preset value may include a value in the range of 80%-100%, and may be other values in other embodiments, and can be set by a person skilled in the art according to requirements.
  • the first data in the physical memory may include data that is not operated within a preset time, and may also include data that occupies a large memory space.
  • the non-volatile memory in the embodiment of the present disclosure is configured as a non-volatile memory
  • the first partition of the non-volatile memory can be configured as a swap partition for use in physical memory of the electronic device.
  • the non-volatile memory may respectively include a plurality of address sections, and the first partition may be part of the plurality of address sections, or may include all address sections, that is, all in the non-volatile memory.
  • the memory space can be used as a SWAP partition, or a part of the address space can be used as a SWAP partition, and the remaining address space can be used as a storage space for other data.
  • FIG. 3 a schematic flowchart of a data processing method in another embodiment of the present disclosure, wherein the data processing method in the foregoing embodiment may further include: detecting call information about the first data; When the call information of the first data is detected, the first data is restored to the physical memory.
  • the call information for the first data in the physical memory such as the read information of the data, the request information of the file, and the like, may also be detected in real time.
  • the call information about the first data is detected, the first data can be restored from the non-volatile memory to the physical memory, thereby ensuring normal operation of the electronic device. That is, when the first data in the physical memory needs to be used when the electronic device runs each program, the first data may be restored from the first partition to the physical memory.
  • the first address information of the first data in the physical memory and the non-volatile memory may also be correspondingly stored.
  • the second address information in the medium thereby conveniently recovering the first data from the corresponding second address to the first address, and also speeding up the reading speed of the data.
  • the transferring the first data to the first partition of the non-volatile memory may include: acquiring address information of the first partition in the non-volatile memory; and acquiring the first information based on the address information A data is transferred to the address space corresponding to the address information.
  • the address information of the pre-configured first partition may also be read, and the second address information of one is assigned to the first data, thereby A data is stored under the address corresponding to the first partition.
  • the first address information of the physical memory and the second address information of the first data in the non-volatile memory may be stored in association.
  • FIG. 4 it is a schematic flowchart of selecting the first data in the embodiment of the present disclosure, which may include:
  • the use of the memory data indicates that the memory data is not being operated for a preset time, and the first data is generated using the memory data.
  • the first data may include data that is not operated within a preset time, and may also include data that occupies a large memory space.
  • the usage of the memory data stored in the physical memory of the electronic device may be acquired in real time, for example, may include real-time detection of the storage time of each memory data buffered in the memory, or the time of not being operated. , as well as information such as the size of the data.
  • the usage of the acquired memory data indicates that the memory data is not operated within a preset time or the capacity of the memory data exceeds a preset capacity
  • the first data may be generated by using the memory data.
  • the currently unoperated memory data can be first transferred to the swap partition, which reduces the memory usage on the one hand, and does not affect the operation of the program corresponding to the data on the other hand.
  • memory data with a large memory space can be dumped into the swap partition, thereby quickly increasing the memory usage space and rapidly improving system performance.
  • the non-volatile memory is used to form a swap partition of the memory data, which can avoid the IO return of the cache data hard disk device, and has the characteristics of fast response, and is solved in the hard disk device. Setting The problem with swap space.
  • an embodiment of the present disclosure further provides an electronic device that can apply the data processing method as described in the foregoing embodiments, and the electronic device can achieve improved data transmission speed and storage speed.
  • FIG. 5 it is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device may include:
  • the program can also temporarily store the data generated in the process through the memory, so if the memory space of the electronic device is occupied, it will affect the operation of the electronic device.
  • the non-volatile memory 200 in the embodiment of the present disclosure may be configured as a non-volatile memory, and may release part of the data in the physical memory to the non-volatile memory when the remaining amount of the physical memory of the electronic device is small. Storage is performed to reduce the physical memory usage of the electronic device and increase the operating rate of the electronic device system.
  • the processor 300 can detect usage status information of the physical memory of the internal memory 100 of the electronic device; and when determining that the usage status information of the physical memory indicates that the occupancy rate of the memory is greater than a preset value, from the physical memory of the electronic device The first data is selected and the first data is dumped into the first partition of the non-volatile memory 200.
  • the processor 300 can detect information about the usage status of the physical memory of the electronic device in real time, such as detecting the current physical memory usage rate or occupancy rate in real time.
  • the processor 300 in the embodiment of the present disclosure may detect a program executed in the physical memory, and information about a memory space occupied by each program, and generate a usage state of the physical memory based on information of a memory space occupied by each program. information. Thereby the release and buffering of the first data is performed based on the usage state of the physical memory.
  • the processor may separately collect information about the currently running program in the electronic device, such as the program name, the running time, and the like, and may also detect the information occupied by each program in the memory space, such as a percentage.
  • the form indicates the occupied memory space.
  • the current memory occupancy rate can be counted, that is, the information of the memory space occupied by each program is added to obtain the current occupancy rate information of the physical memory. , that is, information on the status of use.
  • the processor may select the first data from the physical memory of the internal memory 100 of the electronic device, The first data is released into the first partition of the non-volatile internal memory 200, and the first data is stored by the first partition, thereby increasing the memory space and facilitating the operation of the electronic device.
  • the preset value may include a value in the range of 80%-100%, and may be other values in other embodiments, and can be set by a person skilled in the art according to requirements.
  • the first data in the physical memory may include data that is not operated within a preset time, and may also include Take up more data in memory space.
  • the non-volatile memory in the embodiment of the present disclosure is configured as a non-volatile memory
  • the first partition of the non-volatile memory can be configured as a swap partition for use in physical memory of the electronic device.
  • non-volatile memory 200 may respectively include a plurality of address sections, and the first partition may be part of the plurality of address sections, or may include all address sections, that is, in a non-volatile memory. All memory space can be used as a SWAP partition, or part of the address space can be used as a SWAP partition, and the remaining address space can be used as storage space for other data.
  • the processor 300 may be further configured to detect the call information about the first data; and when the call information of the first data is detected, the first data is Revert to the physical memory.
  • the call information for the first data in the physical memory can also be detected in real time. Information, request information for documents, etc.
  • the call information about the first data can be detected, the first data can be restored from the non-volatile memory to the physical memory, thereby ensuring normal operation of the electronic device. That is, when the first data in the physical memory needs to be used when the electronic device runs each program, the first data may be restored from the first partition to the physical memory.
  • the processor 300 may further store the first address information of the first data in the physical memory and The second address information in the memory is deleted, thereby conveniently recovering the first data from the corresponding second address to the first address, and also speeding up the reading speed of the data.
  • the dumping, by the processor 300, the first data to the first partition of the non-volatile memory may include: acquiring address information of the first partition in the non-volatile memory; and based on the address information And transferring the obtained first data to an address space corresponding to the address information.
  • the address information of the pre-configured first partition may also be read, and the second address information of one is assigned to the first data, thereby A data is stored under the address corresponding to the first partition.
  • the first address information of the physical memory and the second address information of the first data in the non-volatile memory may be stored in association.
  • the processor 300 may use the memory data to generate the first data when the usage of the memory data indicates that the memory data is not operated within a preset time.
  • the first data may include data that is not operated within a preset time, or may be Includes data that takes up a lot of memory.
  • the usage of the memory data stored in the physical memory of the electronic device may be acquired in real time, for example, may include real-time detection of the storage time of each memory data buffered in the memory, or the time of not being operated. And the size and size of each memory data.
  • the usage of the acquired memory data indicates that the memory data is not operated within a preset time or the capacity of the memory data exceeds a preset capacity
  • the first data may be generated by using the memory data.
  • the currently unoperated memory data can be first transferred to the swap partition, which reduces the memory usage on the one hand, and does not affect the operation of the program corresponding to the data on the other hand.
  • memory data with a large memory space can be dumped into the swap partition, thereby quickly increasing the memory usage space and rapidly improving system performance.
  • the processor in the embodiment of the present disclosure may be configured as a CPU in an electronic device, or may be a separate data processing chip.
  • the processor in the embodiment of the present disclosure may be a separate electronic device or may include multiple electronic devices to implement the above functional configuration.
  • the electronic device in the embodiment of the present disclosure may include a smart device such as a mobile phone, a notebook computer, a desktop computer, a PAD, or the like.
  • the present disclosure is not limited thereto.
  • the non-volatile memory is used to form a swap partition of the memory data, which can avoid the IO return of the cache data hard disk device, and has the characteristics of fast response, and is solved in the hard disk device.
  • a swap partition of the memory data which can avoid the IO return of the cache data hard disk device, and has the characteristics of fast response, and is solved in the hard disk device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The present disclosure provides a method and an electronic device for processing data. The method can be applied to an electronic device configured with a non-volatile memory, and comprises: detecting usage state information of a physical memory of the electronic device; and when it is determined that the usage state information of the physical memory indicates that the occupancy rate of the physical memory is greater than a preset value, selecting first data from the physical memory of the electronic device, and transferring the first data to a first partition of the non-volatile memory. The present disclosure has the advantage of fast reading and writing speed, and can easily improve system performance of an electronic device.

Description

一种数据处理方法和电子设备Data processing method and electronic device 技术领域Technical field
本公开属于数据处理领域,特别涉及一种数据处理方法和电子设备。The present disclosure belongs to the field of data processing, and in particular, to a data processing method and an electronic device.
背景技术Background technique
现有的电子设备,在物理内存不够时,会将内存中的部分数据存储至硬盘的特定空间中,而在需要执行该部分数据时,再从硬盘中恢复到物理内存中,从而缓解物理内存的使用压力。但是硬盘目前最大的读写速度也只能达到M/s的级别,而在不同用户的使用场景下,要交换的数据量可能高达数G,显然,硬盘的读写速度并不能满足需求。In the existing electronic device, when the physical memory is insufficient, part of the data in the memory is stored in a specific space of the hard disk, and when the part of the data needs to be executed, the physical memory is restored from the hard disk, thereby alleviating the physical memory. The pressure of use. However, the maximum read/write speed of the hard disk can only reach the M/s level. Under different user usage scenarios, the amount of data to be exchanged may be as high as several G. Obviously, the read/write speed of the hard disk cannot meet the demand.
发明内容Summary of the invention
本公开实施例提供了一种读写速度快的数据处理方法和电子设备。Embodiments of the present disclosure provide a data processing method and an electronic device with fast reading and writing speed.
一种数据处理方法,其应用在配置有非易失性存储器的电子设备中,并且包括:检测电子设备的物理内存的使用状态信息;在判断所述物理内存的使用状态信息表示物理内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器的第一分区中。A data processing method is applied to an electronic device configured with a non-volatile memory, and includes: detecting usage state information of a physical memory of the electronic device; determining that the usage state information of the physical memory indicates occupation of physical memory When the rate is greater than the preset value, the first data is selected from the physical memory of the electronic device and the first data is transferred to the first partition of the non-volatile memory.
根据本公开的实施例,所述方法还包括:检测关于第一数据的调用信息;在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。According to an embodiment of the present disclosure, the method further includes: detecting call information about the first data; and recovering the first data into the physical memory when the call information of the first data is detected.
根据本公开的实施例,所述检测电子设备的物理内存的使用状态信息包括:检测所述物理内存中执行的程序,以及各程序占用的内存空间的信息;基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。According to an embodiment of the present disclosure, the detecting the usage status information of the physical memory of the electronic device includes: detecting a program executed in the physical memory, and information of a memory space occupied by each program; and based on a memory space occupied by each program The information generates information on the usage status of the physical memory.
根据本公开的实施例,从所述电子设备的物理内存中选择出第一数据包括:获取所述物理内存中存储的内存数据的使用情况;在内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时,利用该内存数据生成所述第一数据。According to an embodiment of the present disclosure, selecting the first data from the physical memory of the electronic device includes: acquiring usage of the memory data stored in the physical memory; and the use case of the memory data indicates that the memory data is The first data is generated by using the memory data when the preset time is not being operated.
根据本公开的实施例,将所述第一数据转存至所述非易失性存储器的第一分区包括:获取所述非易失性存储器中第一分区的地址信息;基于该地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。According to an embodiment of the present disclosure, the dumping the first data to the first partition of the non-volatile memory includes: acquiring address information of a first partition in the non-volatile memory; based on the address information The acquired first data is dumped into an address space corresponding to the address information.
本公开实施例还提供了一种电子设备,其包括:内存储器和非易失性存储器,以及处理器;An embodiment of the present disclosure further provides an electronic device, including: an internal memory and a non-volatile memory, and a processor;
其中,所述处理器配置为检测电子设备的内存储器的物理内存的使用状态信息;并 Wherein the processor is configured to detect usage status information of physical memory of an internal memory of the electronic device;
在判断所述物理内存的使用状态信息表示内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器的第一分区中。When it is determined that the usage status information of the physical memory indicates that the occupancy rate of the memory is greater than a preset value, the first data is selected from the physical memory of the electronic device, and the first data is transferred to the nonvolatile In the first partition of the memory.
根据本公开的实施例,所述处理器还配置为检测关于第一数据的调用信息;在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。According to an embodiment of the present disclosure, the processor is further configured to detect call information regarding the first data; when the call information of the first data is detected, restore the first data into the physical memory.
根据本公开的实施例,所述处理器进一步检测所述物理内存中执行的程序,以及各程序占用的内存空间的信息;基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。According to an embodiment of the present disclosure, the processor further detects a program executed in the physical memory, and information of a memory space occupied by each program; and generates a usage state of the physical memory based on information of a memory space occupied by each program. Information.
根据本公开的实施例,所述处理器获取所述物理内存中存储的内存数据的使用情况;在内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时,利用该内存数据生成所述第一数据。According to an embodiment of the present disclosure, the processor acquires usage of the memory data stored in the physical memory; when the usage of the memory data indicates that the memory data is not operated within a preset time, the memory is utilized The data generates the first data.
根据本公开的实施例,所述处理器获取所述非易失性存储器中第一分区的地址信息;并基于该地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。According to an embodiment of the present disclosure, the processor acquires address information of a first partition in the non-volatile memory; and dumps the acquired first data into an address space corresponding to the address information based on the address information. .
基于上述公开,本公开实施例的有益效果在于:Based on the above disclosure, the beneficial effects of the embodiments of the present disclosure are:
本公开实施例可以在电子设备的物理内存占用较大时,通过将第一数据存储到非易失性内存中进行存储,同时还可以在需要执行第一数据时,再从非易失性内存中恢复该第一数据至物理内存中,由于本公开实施例通过内存进行读写操作,具有读写速度快的特点,并且没有IO延时。The embodiment of the present disclosure may store the first data in the non-volatile memory when the physical memory of the electronic device is occupied, and may also store the non-volatile memory when the first data needs to be executed. The first data is restored to the physical memory. Since the embodiment of the present disclosure performs read and write operations through the memory, the read/write speed is fast, and there is no IO delay.
附图说明DRAWINGS
图1为本公开实施例中的一种数据处理方法的原理流程图;1 is a schematic flowchart of a data processing method in an embodiment of the present disclosure;
图2为本公开实施例中的检测电子设备的物理内存的使用状态信息的原理流程图;2 is a schematic flowchart of detecting usage status information of physical memory of an electronic device according to an embodiment of the present disclosure;
图3为本公开另一实施例中的一种数据处理方法的原理流程图;3 is a schematic flowchart of a data processing method according to another embodiment of the present disclosure;
图4为本公开实施例中选择第一数据的原理流程图;以及4 is a flow chart showing the principle of selecting first data in an embodiment of the present disclosure;
图5为本公开实施例中的一种电子设备的构造图。FIG. 5 is a configuration diagram of an electronic device in an embodiment of the present disclosure.
具体实施方式Detailed ways
下面,结合附图对本公开的具体实施例进行详细的描述,但不作为本公开的限定。The specific embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, but are not to be construed as limiting.
应理解的是,可以对此处公开的实施例做出各种修改。因此,上述说明书不应该视为限制,而仅是作为实施例的范例。本领域的技术人员将想到在本公开的范围和精神内的其他修 改。It should be understood that various modifications may be made to the embodiments disclosed herein. Therefore, the above description should not be taken as limiting, but merely as an example of the embodiments. Those skilled in the art will recognize other modifications within the scope and spirit of the present disclosure. change.
包含在说明书中并构成说明书的一部分的附图示出了本公开的实施例,并且与上面给出的对本公开的大致描述以及下面给出的对实施例的详细描述一起用于解释本公开的原理。The accompanying drawings, which are incorporated in FIG principle.
通过下面参照附图对给定为非限制性实例的实施例的优选形式的描述,本公开的这些和其它特性将会变得显而易见。These and other features of the present disclosure will become apparent from the following description of the preferred embodiments of the embodiments.
还应当理解,尽管已经参照一些具体实例对本公开进行了描述,但本领域技术人员能够确定地实现本公开的很多其它等效形式,它们具有如权利要求所述的特征并因此都位于借此所限定的保护范围内。It should also be understood that, although the present invention has been described with reference to the specific embodiments thereof, those skilled in the art Within the limits of protection.
在此使用的术语仅仅是为了描述具体实施例,而并非意在限制本公开。在此使用的术语“包括”、“包含”等表明了所述特征、步骤、操作和/或部件的存在,但是并不排除存在或添加一个或多个其他特征、步骤、操作或部件。The terminology used herein is for the purpose of describing the particular embodiments, The use of the terms "comprising", "comprising" or "an"
在此使用的所有术语(包括技术和科学术语)具有本领域技术人员通常所理解的含义,除非另外定义。应注意,这里使用的术语应解释为具有与本说明书的上下文相一致的含义,而不应以理想化或过于刻板的方式来解释。All terms (including technical and scientific terms) used herein have the meaning commonly understood by one of ordinary skill in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted as having a meaning consistent with the context of the present specification and should not be interpreted in an ideal or too rigid manner.
在使用类似于“A、B和C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B和C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。在使用类似于“A、B或C等中至少一个”这样的表述的情况下,一般来说应该按照本领域技术人员通常理解该表述的含义来予以解释(例如,“具有A、B或C中至少一个的系统”应包括但不限于单独具有A、单独具有B、单独具有C、具有A和B、具有A和C、具有B和C、和/或具有A、B、C的系统等)。本领域技术人员还应理解,实质上任意表示两个或更多可选项目的转折连词和/或短语,无论是在说明书、权利要求书还是附图中,都应被理解为给出了包括这些项目之一、这些项目任一方、或两个项目的可能性。例如,短语“A或B”应当被理解为包括“A”或“B”、或“A和B”的可能性。Where an expression similar to "at least one of A, B, and C, etc." is used, it should generally be interpreted in accordance with the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B, and C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Where an expression similar to "at least one of A, B or C, etc." is used, it should generally be interpreted according to the meaning of the expression as commonly understood by those skilled in the art (for example, "having A, B or C" "Systems of at least one of" shall include, but are not limited to, systems having A alone, B alone, C alone, A and B, A and C, B and C, and/or A, B, C, etc. ). Those skilled in the art will also appreciate that transitional conjunctions and/or phrases that are arbitrarily arbitrarily representing two or more optional items, whether in the specification, claims, or drawings, are to be construed as The possibility of one of the projects, either or both of these projects. For example, the phrase "A or B" should be understood to include the possibility of "A" or "B", or "A and B."
附图中示出了一些方框图和/或流程图。应理解,方框图和/或流程图中的一些方框或其组合可以由计算机程序指令来实现。这些计算机程序指令可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器,从而这些指令在由该处理器执行时可以创建用于实现这些方框图和/或流程图中所说明的功能/操作的装置。Some block diagrams and/or flowcharts are shown in the drawings. It will be understood that some blocks or combinations of the block diagrams and/or flowcharts can be implemented by computer program instructions. These computer program instructions may be provided to a general purpose computer, a special purpose computer or a processor of other programmable data processing apparatus such that when executed by the processor, the instructions may be used to implement the functions illustrated in the block diagrams and/or flowcharts. / operating device.
因此,本公开的技术可以硬件和/或软件(包括固件、微代码等)的形式来实现。另外,本公开的技术可以采取存储有指令的计算机可读介质上的计算机程序产品的形式,该计算机 程序产品可供指令执行系统使用或者结合指令执行系统使用。在本公开的上下文中,计算机可读介质可以是能够包含、存储、传送、传播或传输指令的任意介质。例如,计算机可读介质可以包括但不限于电、磁、光、电磁、红外或半导体系统、装置、器件或传播介质。计算机可读介质的具体示例包括:磁存储装置,如磁带或硬盘(HDD);光存储装置,如光盘(CD-ROM);存储器,如随机存取存储器(RAM)或闪存;和/或有线/无线通信链路。Thus, the techniques of this disclosure may be implemented in the form of hardware and/or software (including firmware, microcode, etc.). Additionally, the techniques of this disclosure may take the form of a computer program product on a computer readable medium having stored thereon instructions, the computer Program products are available for use by the instruction execution system or in conjunction with the instruction execution system. In the context of the present disclosure, a computer readable medium can be any medium that can contain, store, communicate, propagate or transport the instructions. For example, a computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: a magnetic storage device such as a magnetic tape or a hard disk (HDD); an optical storage device such as a compact disk (CD-ROM); a memory such as a random access memory (RAM) or a flash memory; and/or a wired /Wireless communication link.
当结合附图时,鉴于以下详细说明,本公开的上述和其他方面、特征和优势将变得更为显而易见。The above and other aspects, features, and advantages of the present disclosure will become more apparent from the aspects of the appended claims.
此后参照附图描述本公开的具体实施例;然而,应当理解,所公开的实施例仅仅是本公开的实例,其可采用多种方式实施。熟知和/或重复的功能和结构并未详细描述以避免不必要或多余的细节使得本公开模糊不清。因此,本文所公开的具体的结构性和功能性细节并非意在限定,而是仅仅作为权利要求的基础和代表性基础用于教导本领域技术人员以实质上任意合适的详细结构多样地使用本公开。Specific embodiments of the present disclosure are described hereinbelow with reference to the drawings; however, it is understood that the disclosed embodiments are only examples of the present disclosure, which can be implemented in various ways. The well-known and/or repeated functions and structures are not described in detail to avoid unnecessary or unnecessary details. Therefore, the specific structural and functional details disclosed herein are not intended to be limiting, but are merely to be used as a basis and representative basis of the claims to teach one skilled in the art to use the invention in virtually any suitable detailed structure. public.
本说明书可使用词组“在一种实施例中”、“在另一个实施例中”、“在又一实施例中”或“在其他实施例中”,其均可指代根据本公开的相同或不同实施例中的一个或多个。The description may use the phrases "in one embodiment", "in another embodiment", "in another embodiment" or "in other embodiments", which may refer to the same in accordance with the present disclosure. Or one or more of the different embodiments.
下面,结合附图详细的说明本公开实施例,本公开实施例提供了一种数据处理方法,该方法通过在电子设备的内存不够用时,将内存中的一部分数据释放到非易失性存储器的第一分区(swap分区)内,从而保证内存的正常使用,而且由于将内存中的数据释放至非易失性存储器的第一分区相当于内存数据的复制,可以大大的提高数据的传输速度和存储速度。The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings. The embodiments of the present disclosure provide a data processing method for releasing a part of data in a memory to a non-volatile memory when the memory of the electronic device is insufficient. The first partition (swap partition) ensures the normal use of the memory, and since the first partition that releases the data in the memory to the non-volatile memory is equivalent to the copy of the memory data, the data transfer speed can be greatly improved. Storage speed.
如图1所示,为本公开实施例中的一种数据处理方法的原理流程图,该方法可以应用在在配置有非易失性存储器的电子设备中,并且该方法可以包括:As shown in FIG. 1 , it is a schematic flowchart of a data processing method in an embodiment of the present disclosure, which may be applied in an electronic device configured with a non-volatile memory, and the method may include:
检测电子设备的物理内存的使用状态信息;Detecting usage status information of physical memory of the electronic device;
在判断所述物理内存的使用状态信息表示物理内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器的第一分区中。When it is determined that the usage status information of the physical memory indicates that the occupancy rate of the physical memory is greater than a preset value, the first data is selected from the physical memory of the electronic device, and the first data is transferred to the non-easy In the first partition of the memory.
本公开实施例中,电子设备中可以在不同的阶段或者在不同的设备中,可以运行各种各样的程序,在该过程中,需要使用电子设备的内存空间执行程序,而且还可以通过内存空间暂时存储该过程中生成的数据,因此,如果电子设备的内存被大量的占用时,会影响电子设备的运行速度以及还会影响程序的运行。In the embodiment of the present disclosure, various programs can be run in different stages of the electronic device or in different devices. In the process, the program needs to be executed using the memory space of the electronic device, and the memory can also be used. The space temporarily stores the data generated in the process, so if the memory of the electronic device is occupied in a large amount, it will affect the running speed of the electronic device and also affect the operation of the program.
本公开实施例可以在电子设备中配置有非易失性存储器,其构造为非易失性内存。本公开实施例可以在电子设备的物理内存的空间剩余量较小时,可以将物理内存中的部分数据释放至非易失性内存中进行存储,从而减小电子设备的物理内存的占用率,保证电子设备的内 存空间可以剩余空间可以足够用于运行电子设备的各程序,从而提高电子设备的系统的运行速率继而系统性能。Embodiments of the present disclosure may be configured with a non-volatile memory in an electronic device configured as a non-volatile memory. In the embodiment of the present disclosure, when the remaining amount of the physical memory of the electronic device is small, part of the data in the physical memory may be released into the non-volatile memory for storage, thereby reducing the occupation rate of the physical memory of the electronic device, and ensuring Inside the electronic device The remaining space of the storage space may be sufficient for running various programs of the electronic device, thereby increasing the operating rate of the system of the electronic device and then the system performance.
基于上述,本公开实施例可以实时的检测电子设备的物理内存的使用状态的信息,如可以实时的检测当前物理内存的使用率或占用率。并通过该检测结果对应的调整物理内存中的数据,以保证物理内存的剩余内存空间。如图2所示,本公开实施例中的检测电子设备的物理内存的使用状态信息可以包括:检测所述物理内存中执行的程序,以及各程序占用的内存空间的信息;基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。Based on the above, the embodiment of the present disclosure can detect the usage status of the physical memory of the electronic device in real time, such as detecting the current physical memory usage rate or occupancy rate in real time. And the data in the physical memory is adjusted correspondingly by the detection result to ensure the remaining memory space of the physical memory. As shown in FIG. 2, the detecting the usage status information of the physical memory of the electronic device in the embodiment of the present disclosure may include: detecting a program executed in the physical memory, and information about a memory space occupied by each program; The information of the memory space generates information on the state of use of the physical memory.
在电子设备的系统运行过程中,可以分别统计电子设备中当前运行的程序的信息,如程序名称、运行时间等等,还可以对应的检测各程序占用内存空间的信息,如以百分比的形式表示占用的内存空间,基于上述程序的信息以及占用的内存空间的信息可以统计当前内存的占用率,即对上述各程序占用的内存空间的信息进行加和来获得物理内存当前的占用率信息,即使用状态的信息。During the operation of the system of the electronic device, the information of the currently running program in the electronic device, such as the program name, the running time, and the like, may be separately collected, and the information of the memory space occupied by each program may be detected correspondingly, for example, expressed as a percentage. The occupied memory space, based on the information of the above program and the information of the occupied memory space, can count the current memory usage rate, that is, the information of the memory space occupied by each program is added to obtain the current occupancy rate information of the physical memory, that is, Use status information.
根据本公开的实施例,在判断电子设备的物理内存的使用状态信息表示物理内存的占用率大于预设值时,可以从电子设备的物理内存中选择出第一数据,并将该第一数据释放至非易失性内存储器的第一分区内,通过该第一分区存储该第一数据,从而增加内存空间,便于电子设备的运行。上述预设值可以包括80%-100%范围内的值,在其他实施例中也可以是其他的数值,本领域技术人员可以根据需求自行设定。According to an embodiment of the present disclosure, when it is determined that the usage status information of the physical memory of the electronic device indicates that the occupancy rate of the physical memory is greater than a preset value, the first data may be selected from the physical memory of the electronic device, and the first data is selected. Released into the first partition of the non-volatile internal memory, the first data is stored by the first partition, thereby increasing the memory space and facilitating the operation of the electronic device. The preset value may include a value in the range of 80%-100%, and may be other values in other embodiments, and can be set by a person skilled in the art according to requirements.
其中,上述物理内存中的第一数据可以包括在预设时间内未被操作的数据,也可以包括占用内存空间较大的数据。The first data in the physical memory may include data that is not operated within a preset time, and may also include data that occupies a large memory space.
在此需要说明的是,本公开实施例中的非易失性存储器构造为非易失性内存,该非易失性存储器的第一分区可以构造为swap分区,用于在电子设备的物理内存占用率过大时,缓存处理内存中的部分数据,而且由于非易失性存储器为非易失性内存存储器,对于第一数据的释放和存储相当于内存数据的拷贝,数据的转存速率可以达到G/S级别,速率极快。It should be noted that the non-volatile memory in the embodiment of the present disclosure is configured as a non-volatile memory, and the first partition of the non-volatile memory can be configured as a swap partition for use in physical memory of the electronic device. When the occupancy rate is too large, the cache processes part of the data in the memory, and since the non-volatile memory is a non-volatile memory, the release and storage of the first data is equivalent to the copy of the memory data, and the data transfer rate can be At the G/S level, the rate is extremely fast.
另外,非易失性存储器可以分别包括多个地址区间,上述第一分区可以是该多个地址区间中的一部分,也可以包括全部的地址区间,也就是说,非易失性存储器中的全部内存空间可以都用作SWAP分区,或者其中一部分地址空间用作SWAP分区,剩余的地址空间可以作为其他数据的存储空间。In addition, the non-volatile memory may respectively include a plurality of address sections, and the first partition may be part of the plurality of address sections, or may include all address sections, that is, all in the non-volatile memory. The memory space can be used as a SWAP partition, or a part of the address space can be used as a SWAP partition, and the remaining address space can be used as a storage space for other data.
另外,如图3所示,本公开另一实施例中的数据处理方法的原理流程图,其中基于上述实施例中的数据处理方法,还可以进一步包括:检测关于第一数据的调用信息;在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。In addition, as shown in FIG. 3, a schematic flowchart of a data processing method in another embodiment of the present disclosure, wherein the data processing method in the foregoing embodiment may further include: detecting call information about the first data; When the call information of the first data is detected, the first data is restored to the physical memory.
也就是说,在将物理内存中的第一数据释放至非易失性存储器的第一分区中进行存储后, 还可以实时的检测物理内存中对于第一数据的调用信息,例如数据的读取信息、文件的请求信息等。而在检测到关于第一数据的调用信息时,可以将第一数据从非易失性存储器中恢复至物理内存中,从而保证电子设备的正常运行。即,在电子设备运行各程序时需要使用物理内存中的第一数据时,还可以对应的从第一分区中将第一数据恢复至物理内存中。That is, after the first data in the physical memory is released into the first partition of the non-volatile memory for storage, The call information for the first data in the physical memory, such as the read information of the data, the request information of the file, and the like, may also be detected in real time. When the call information about the first data is detected, the first data can be restored from the non-volatile memory to the physical memory, thereby ensuring normal operation of the electronic device. That is, when the first data in the physical memory needs to be used when the electronic device runs each program, the first data may be restored from the first partition to the physical memory.
对应的,为了方便第一数据的读取和调用,在将数据释放存储至第一分区时,还可以对应的存储该第一数据在物理内存中的第一地址信息以及在非易失性存储器中的第二地址信息,从而方便的将第一数据从对应的第二地址中恢复至第一地址中,同时也加快了数据的读取速度。Correspondingly, in order to facilitate the reading and invoking of the first data, when the data is released to the first partition, the first address information of the first data in the physical memory and the non-volatile memory may also be correspondingly stored. The second address information in the medium, thereby conveniently recovering the first data from the corresponding second address to the first address, and also speeding up the reading speed of the data.
对应的,将所述第一数据转存至所述非易失性存储器的第一分区可以包括:获取所述非易失性存储器中第一分区的地址信息;基于该地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。Correspondingly, the transferring the first data to the first partition of the non-volatile memory may include: acquiring address information of the first partition in the non-volatile memory; and acquiring the first information based on the address information A data is transferred to the address space corresponding to the address information.
也就是说,在将第一数据存储至非易失性存储器时,也可以读取预先配置的第一分区的地址信息,并为该第一数据分配对一个的第二地址信息,从而将第一数据存储到第一分区对应的地址下。在该过程中,可以将物理内存的第一地址信息和第一数据在非易失性存储器中的第二地址信息关联存储。That is, when the first data is stored in the non-volatile memory, the address information of the pre-configured first partition may also be read, and the second address information of one is assigned to the first data, thereby A data is stored under the address corresponding to the first partition. In the process, the first address information of the physical memory and the second address information of the first data in the non-volatile memory may be stored in association.
另外,如图4所示为本公开实施例中选择第一数据的原理流程图,其中本可以包括:In addition, as shown in FIG. 4, it is a schematic flowchart of selecting the first data in the embodiment of the present disclosure, which may include:
获取所述物理内存中存储的内存数据的使用情况;Obtaining usage of the memory data stored in the physical memory;
在内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时,利用该内存数据生成所述第一数据。The use of the memory data indicates that the memory data is not being operated for a preset time, and the first data is generated using the memory data.
如上所述,本公开实施例中,第一数据可以包括在预设时间内未被操作的数据,也可以包括占用内存空间较大的数据。As described above, in the embodiment of the present disclosure, the first data may include data that is not operated within a preset time, and may also include data that occupies a large memory space.
也就是说,本公开实施例中可以实时地获取电子设备的物理内存中存储的内存数据的使用情况,例如可以包括实时的检测内存中缓存的各内存数据的存储时间、或者未被操作的时间,以及个数据的容量大小等信息。而在获取的内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时或者该内存数据的容量超过预设容量时,可以利用该内存数据生成所述第一数据。通过该配置,可以先将当前未被操作的内存数据转存至swap分区内,一方面缓解了内存的占用率,另一方面还不会对该数据对应的程序的运行造成影响。另外,还可以将占用内存空间较大的内存数据转存至swap分区内,从而快速的提高内存的使用空间,迅速提升系统性能。That is, in the embodiment of the present disclosure, the usage of the memory data stored in the physical memory of the electronic device may be acquired in real time, for example, may include real-time detection of the storage time of each memory data buffered in the memory, or the time of not being operated. , as well as information such as the size of the data. When the usage of the acquired memory data indicates that the memory data is not operated within a preset time or the capacity of the memory data exceeds a preset capacity, the first data may be generated by using the memory data. With this configuration, the currently unoperated memory data can be first transferred to the swap partition, which reduces the memory usage on the one hand, and does not affect the operation of the program corresponding to the data on the other hand. In addition, memory data with a large memory space can be dumped into the swap partition, thereby quickly increasing the memory usage space and rapidly improving system performance.
综上所述,本公开实施例中,利用非易失性存储器构成内存数据的swap分区的方式,可以避免在缓存数据硬盘设备的IO返回,具有响应速度快的特点,解决了在硬盘设备中设置 swap空间的问题。In summary, in the embodiment of the present disclosure, the non-volatile memory is used to form a swap partition of the memory data, which can avoid the IO return of the cache data hard disk device, and has the characteristics of fast response, and is solved in the hard disk device. Setting The problem with swap space.
另外,本公开实施例还提供了一种电子设备,该电子设备可以应用如上述实施例中所述的数据处理方法,并且该电子设备可以实现提高数据的传输速度和存储速度。In addition, an embodiment of the present disclosure further provides an electronic device that can apply the data processing method as described in the foregoing embodiments, and the electronic device can achieve improved data transmission speed and storage speed.
如图5所示,为本公开实施例中的一种电子设备的原理结构图,其中该电子设备可以包括:As shown in FIG. 5, it is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure, where the electronic device may include:
内存储器100和非易失性存储器200,以及处理器300;其中,内存储器100可以配置有电子设备的物理内存空间,电子设备可以在运行其内的各程序时,可以利用该物理内存空间执行程序,而且还可以通过内存暂时存储该过程中生成的数据,因此,如果电子设备的内存空间被占用时,会影响电子设备的运行。The internal memory 100 and the non-volatile memory 200, and the processor 300; wherein the internal memory 100 can be configured with a physical memory space of the electronic device, and the electronic device can be executed by using the physical memory space when running each program therein The program can also temporarily store the data generated in the process through the memory, so if the memory space of the electronic device is occupied, it will affect the operation of the electronic device.
本公开实施例中的非易失性存储器200,可以构造为非易失性内存,在电子设备的物理内存的空间剩余量较小时,可以将物理内存中的部分数据释放至非易失性内存中进行存储,从而减小电子设备的物理内存的使用率,提高电子设备的系统的运行速率。The non-volatile memory 200 in the embodiment of the present disclosure may be configured as a non-volatile memory, and may release part of the data in the physical memory to the non-volatile memory when the remaining amount of the physical memory of the electronic device is small. Storage is performed to reduce the physical memory usage of the electronic device and increase the operating rate of the electronic device system.
处理器300可以检测电子设备的内存储器100的物理内存的使用状态信息;并在判断所述物理内存的使用状态信息表示内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器200的第一分区中。The processor 300 can detect usage status information of the physical memory of the internal memory 100 of the electronic device; and when determining that the usage status information of the physical memory indicates that the occupancy rate of the memory is greater than a preset value, from the physical memory of the electronic device The first data is selected and the first data is dumped into the first partition of the non-volatile memory 200.
因此,本公开实施例中处理器300可以实时的检测电子设备的物理内存的使用状态的信息,如可以实时的检测当前物理内存的使用率或占用率。本公开实施例中的处理器300可以检测所述物理内存中执行的程序,以及各程序占用的内存空间的信息,并基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。从而基于物理内存的使用状态来执行第一数据的释放和缓存。Therefore, in the embodiment of the present disclosure, the processor 300 can detect information about the usage status of the physical memory of the electronic device in real time, such as detecting the current physical memory usage rate or occupancy rate in real time. The processor 300 in the embodiment of the present disclosure may detect a program executed in the physical memory, and information about a memory space occupied by each program, and generate a usage state of the physical memory based on information of a memory space occupied by each program. information. Thereby the release and buffering of the first data is performed based on the usage state of the physical memory.
在电子设备的系统运行过程中,处理器可以分别统计电子设备中当前运行的程序的信息,如程序名称、运行时间等等,还可以对应的检测各程序占用内存空间的信息,如以百分比的形式表示占用的内存空间,基于上述程序的信息以及占用的内存空间的信息可以统计当前内存的占用率,即对上述各程序占用的内存空间的信息进行加和来获得物理内存当前的占用率信息,即使用状态的信息。During the operation of the system of the electronic device, the processor may separately collect information about the currently running program in the electronic device, such as the program name, the running time, and the like, and may also detect the information occupied by each program in the memory space, such as a percentage. The form indicates the occupied memory space. Based on the information of the above program and the information of the occupied memory space, the current memory occupancy rate can be counted, that is, the information of the memory space occupied by each program is added to obtain the current occupancy rate information of the physical memory. , that is, information on the status of use.
根据本公开的实施例,在判断电子设备的物理内存的使用状态信息表示物理内存的占用率大于预设值时,处理器可以从电子设备的内存储器100的物理内存中选择出第一数据,并将该第一数据释放至非易失性内存储器200的第一分区内,通过该第一分区存储该第一数据,从而增加内存空间,便于电子设备的运行。上述预设值可以包括80%-100%范围内的值,在其他实施例中也可以是其他的数值,本领域技术人员可以根据需求自行设定。According to an embodiment of the present disclosure, when it is determined that the usage status information of the physical memory of the electronic device indicates that the occupancy rate of the physical memory is greater than a preset value, the processor may select the first data from the physical memory of the internal memory 100 of the electronic device, The first data is released into the first partition of the non-volatile internal memory 200, and the first data is stored by the first partition, thereby increasing the memory space and facilitating the operation of the electronic device. The preset value may include a value in the range of 80%-100%, and may be other values in other embodiments, and can be set by a person skilled in the art according to requirements.
其中,上述物理内存中的第一数据可以包括在预设时间内未被操作的数据,也可以包括 占用内存空间较大的数据。The first data in the physical memory may include data that is not operated within a preset time, and may also include Take up more data in memory space.
在此需要说明的是,本公开实施例中的非易失性存储器构造为非易失性内存,该非易失性存储器的第一分区可以构造为swap分区,用于在电子设备的物理内存占用率过大时,缓存处理内存中的部分数据,而且由于非易失性存储器为非易失性内存存储器,对于第一数据的释放和存储相当于内存数据的拷贝,数据的转存速率可以达到G/S级别,速率极快。It should be noted that the non-volatile memory in the embodiment of the present disclosure is configured as a non-volatile memory, and the first partition of the non-volatile memory can be configured as a swap partition for use in physical memory of the electronic device. When the occupancy rate is too large, the cache processes part of the data in the memory, and since the non-volatile memory is a non-volatile memory, the release and storage of the first data is equivalent to the copy of the memory data, and the data transfer rate can be At the G/S level, the rate is extremely fast.
另外,非易失性存储器200可以分别包括多个地址区间,上述第一分区可以是该多个地址区间中的一部分,也可以包括全部的地址区间,也就是说,非易失性存储器中的全部内存空间可以都用作SWAP分区,或者其中一部分地址空间用作SWAP分区,剩余的地址空间可以作为其他数据的存储空间。In addition, the non-volatile memory 200 may respectively include a plurality of address sections, and the first partition may be part of the plurality of address sections, or may include all address sections, that is, in a non-volatile memory. All memory space can be used as a SWAP partition, or part of the address space can be used as a SWAP partition, and the remaining address space can be used as storage space for other data.
另外,在本公开的另一实施例中,处理器300还可以进一步配置为通过检测关于第一数据的调用信息;以及在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。In addition, in another embodiment of the present disclosure, the processor 300 may be further configured to detect the call information about the first data; and when the call information of the first data is detected, the first data is Revert to the physical memory.
也就是说,在将物理内存中的第一数据释放至非易失性存储器的第一分区中进行存储后,还可以实时的检测物理内存中对于第一数据的调用信息,例如数据的读取信息、文件的请求信息等。而在检测到关于第一数据的调用信息时,可以将第一数据从非易失性存储器中恢复至物理内存中,从而保证电子设备的正常运行。即,在电子设备运行各程序时需要使用物理内存中的第一数据时,还可以对应的从第一分区中将第一数据恢复至物理内存中。That is to say, after the first data in the physical memory is released into the first partition of the non-volatile memory for storage, the call information for the first data in the physical memory, such as the reading of the data, can also be detected in real time. Information, request information for documents, etc. When the call information about the first data is detected, the first data can be restored from the non-volatile memory to the physical memory, thereby ensuring normal operation of the electronic device. That is, when the first data in the physical memory needs to be used when the electronic device runs each program, the first data may be restored from the first partition to the physical memory.
对应的,为了方便第一数据的读取和调用,在将数据释放存储至第一分区时,处理器300还可以对应的存储该第一数据在物理内存中的第一地址信息以及在非易失性存储器中的第二地址信息,从而方便的将第一数据从对应的第二地址中恢复至第一地址中,同时也加快了数据的读取速度。Correspondingly, in order to facilitate the reading and invoking of the first data, when the data is released to the first partition, the processor 300 may further store the first address information of the first data in the physical memory and The second address information in the memory is deleted, thereby conveniently recovering the first data from the corresponding second address to the first address, and also speeding up the reading speed of the data.
对应的,处理器300将所述第一数据转存至所述非易失性存储器的第一分区可以包括:获取所述非易失性存储器中第一分区的地址信息;以及基于该地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。Correspondingly, the dumping, by the processor 300, the first data to the first partition of the non-volatile memory may include: acquiring address information of the first partition in the non-volatile memory; and based on the address information And transferring the obtained first data to an address space corresponding to the address information.
也就是说,在将第一数据存储至非易失性存储器时,也可以读取预先配置的第一分区的地址信息,并为该第一数据分配对一个的第二地址信息,从而将第一数据存储到第一分区对应的地址下。在该过程中,可以将物理内存的第一地址信息和第一数据在非易失性存储器中的第二地址信息关联存储。That is, when the first data is stored in the non-volatile memory, the address information of the pre-configured first partition may also be read, and the second address information of one is assigned to the first data, thereby A data is stored under the address corresponding to the first partition. In the process, the first address information of the physical memory and the second address information of the first data in the non-volatile memory may be stored in association.
在本公开实施例中,处理器300可以在内存数据的使用情况表明该内存数据在预设时间内没有被操作时,则利用该内存数据生成所述第一数据。In the embodiment of the present disclosure, the processor 300 may use the memory data to generate the first data when the usage of the memory data indicates that the memory data is not operated within a preset time.
如上所述,本公开实施例中,第一数据可以包括在预设时间内未被操作的数据,也可以 包括占用内存空间较大的数据。As described above, in the embodiment of the present disclosure, the first data may include data that is not operated within a preset time, or may be Includes data that takes up a lot of memory.
也就是说,本公开实施例中可以实时地获取电子设备的物理内存中存储的内存数据的使用情况,例如可以包括实时的检测内存中缓存的各内存数据的存储时间、或者未被操作的时间,以及各内存数据的容量大小等信息。而在获取的内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时或者该内存数据的容量超过预设容量时,可以利用该内存数据生成所述第一数据。通过该配置,可以先将当前未被操作的内存数据转存至swap分区内,一方面缓解了内存的占用率,另一方面还不会对该数据对应的程序的运行造成影响。另外,还可以将占用内存空间较大的内存数据转存至swap分区内,从而快速的提高内存的使用空间,迅速提升系统性能。That is, in the embodiment of the present disclosure, the usage of the memory data stored in the physical memory of the electronic device may be acquired in real time, for example, may include real-time detection of the storage time of each memory data buffered in the memory, or the time of not being operated. And the size and size of each memory data. When the usage of the acquired memory data indicates that the memory data is not operated within a preset time or the capacity of the memory data exceeds a preset capacity, the first data may be generated by using the memory data. With this configuration, the currently unoperated memory data can be first transferred to the swap partition, which reduces the memory usage on the one hand, and does not affect the operation of the program corresponding to the data on the other hand. In addition, memory data with a large memory space can be dumped into the swap partition, thereby quickly increasing the memory usage space and rapidly improving system performance.
另外,本公开实施例中的处理器可以构造为电子设备中的CPU,也可以是单独的数据处理芯片。另外,本公开实施例中的处理器可以是单独的电子器件也可以包括多个电子器件共同实现上述功能配置。本公开实施例中的电子设备可以包括手机、笔记本电脑、台式机、PAD等智能设备。但本公开不限于此。In addition, the processor in the embodiment of the present disclosure may be configured as a CPU in an electronic device, or may be a separate data processing chip. In addition, the processor in the embodiment of the present disclosure may be a separate electronic device or may include multiple electronic devices to implement the above functional configuration. The electronic device in the embodiment of the present disclosure may include a smart device such as a mobile phone, a notebook computer, a desktop computer, a PAD, or the like. However, the present disclosure is not limited thereto.
综上所述,本公开实施例中,利用非易失性存储器构成内存数据的swap分区的方式,可以避免在缓存数据硬盘设备的IO返回,具有响应速度快的特点,解决了在硬盘设备中设置swap空间的问题。所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的数据处理方法所应用于的电子设备,可以参考前述产品实施例中的对应描述,在此不再赘述。In summary, in the embodiment of the present disclosure, the non-volatile memory is used to form a swap partition of the memory data, which can avoid the IO return of the cache data hard disk device, and has the characteristics of fast response, and is solved in the hard disk device. Set the issue of swap space. A person skilled in the art can clearly understand that, for the convenience and brevity of the description, the electronic device to which the data processing method described above is applied can refer to the corresponding description in the foregoing product embodiments, and details are not described herein again.
以上实施例仅为本公开的示例性实施例,不用于限制本公开,本公开的保护范围由权利要求书限定。本领域技术人员可以在本公开的实质和保护范围内,对本公开做出各种修改或等同替换,这种修改或等同替换也应视为落在本公开的保护范围内。 The above embodiments are merely exemplary embodiments of the present disclosure, and are not intended to limit the disclosure, and the scope of the disclosure is defined by the claims. A person skilled in the art can make various modifications or equivalents to the present disclosure within the spirit and scope of the disclosure, and such modifications or equivalents are also considered to be within the scope of the disclosure.

Claims (10)

  1. 一种数据处理方法,其应用在配置有非易失性存储器的电子设备中,所述方法包括:A data processing method for use in an electronic device configured with a non-volatile memory, the method comprising:
    检测电子设备的物理内存的使用状态信息;以及Detecting usage status information of physical memory of the electronic device;
    在判断所述物理内存的使用状态信息表示物理内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器的第一分区中。When it is determined that the usage status information of the physical memory indicates that the occupancy rate of the physical memory is greater than a preset value, the first data is selected from the physical memory of the electronic device, and the first data is transferred to the non-easy In the first partition of the memory.
  2. 根据权利要求1所述的方法,其中,所述方法还包括:The method of claim 1 wherein the method further comprises:
    检测关于第一数据的调用信息;以及Detecting call information about the first data;
    在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。When the call information of the first data is detected, the first data is restored to the physical memory.
  3. 根据权利要求1所述的方法,其中,所述检测电子设备的物理内存的使用状态信息包括:The method of claim 1, wherein the detecting usage status information of the physical memory of the electronic device comprises:
    检测所述物理内存中执行的程序,以及各程序占用的内存空间的信息;以及Detecting programs executed in the physical memory, and information about memory space occupied by each program;
    基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。Information on the usage status of the physical memory is generated based on information of a memory space occupied by each program.
  4. 根据权利要求1所述的方法,其中,从所述电子设备的物理内存中选择出第一数据包括:The method of claim 1, wherein selecting the first data from the physical memory of the electronic device comprises:
    获取所述物理内存中存储的内存数据的使用情况;以及Obtaining usage of memory data stored in the physical memory;
    在内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时,利用该内存数据生成所述第一数据。The use of the memory data indicates that the memory data is not being operated for a preset time, and the first data is generated using the memory data.
  5. 根据权利要求1所述的方法,其中,将所述第一数据转存至所述非易失性存储器的第一分区包括:The method of claim 1 wherein dumping the first data to the first partition of the non-volatile memory comprises:
    获取所述非易失性存储器中第一分区的地址信息;以及Obtaining address information of the first partition in the non-volatile memory;
    基于该地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。And uploading the acquired first data to the address space corresponding to the address information based on the address information.
  6. 一种电子设备,其包括:内存储器和非易失性存储器,以及处理器;An electronic device comprising: an internal memory and a non-volatile memory, and a processor;
    其中,所述处理器配置为检测电子设备的内存储器的物理内存的使用状态信息;并Wherein the processor is configured to detect usage status information of physical memory of an internal memory of the electronic device;
    在判断所述物理内存的使用状态信息表示内存的占用率大于预设值时,从所述电子设备的物理内存中选择出第一数据并将所述第一数据转存至所述非易失性存储器的第一分区中。When it is determined that the usage status information of the physical memory indicates that the occupancy rate of the memory is greater than a preset value, the first data is selected from the physical memory of the electronic device, and the first data is transferred to the nonvolatile In the first partition of the memory.
  7. 根据权利要求6所述的电子设备,其中,所述处理器还配置为检测关于第一数据的调用信息;The electronic device of claim 6, wherein the processor is further configured to detect call information regarding the first data;
    在检测到所述第一数据的调用信息时,将所述第一数据恢复至所述物理内存中。When the call information of the first data is detected, the first data is restored to the physical memory.
  8. 根据权利要求6所述的电子设备,其中,所述处理器进一步检测所述物理内存中执行 的程序,以及各程序占用的内存空间的信息;The electronic device of claim 6, wherein the processor further detects execution in the physical memory Program, and information about the memory space occupied by each program;
    基于各程序所占用的内存空间的信息生成所述物理内存的使用状态的信息。Information on the usage status of the physical memory is generated based on information of a memory space occupied by each program.
  9. 根据权利要求6所述的电子设备,其中,所述处理器获取所述物理内存中存储的内存数据的使用情况;The electronic device of claim 6, wherein the processor acquires usage of memory data stored in the physical memory;
    在内存数据的所述使用情况表明该内存数据在预设时间内没有被操作时,利用该内存数据生成所述第一数据。The use of the memory data indicates that the memory data is not being operated for a preset time, and the first data is generated using the memory data.
  10. 根据权利要求6所述的电子设备,其中所述处理器获取所述非易失性存储器中第一分区的地址信息;并基于所述地址信息将获取的第一数据转存至所述地址信息对应的地址空间内。 The electronic device according to claim 6, wherein said processor acquires address information of a first partition in said nonvolatile memory; and dumps the acquired first data to said address information based on said address information Within the corresponding address space.
PCT/CN2017/113559 2017-06-21 2017-11-29 Method and electronic device for processing data WO2018233216A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710476390.3 2017-06-21
CN201710476390.3A CN107291627B (en) 2017-06-21 2017-06-21 Data processing method and electronic equipment

Publications (1)

Publication Number Publication Date
WO2018233216A1 true WO2018233216A1 (en) 2018-12-27

Family

ID=60097414

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/113559 WO2018233216A1 (en) 2017-06-21 2017-11-29 Method and electronic device for processing data

Country Status (2)

Country Link
CN (1) CN107291627B (en)
WO (1) WO2018233216A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107291627B (en) * 2017-06-21 2021-05-18 联想(北京)有限公司 Data processing method and electronic equipment
CN110865884A (en) * 2019-09-30 2020-03-06 华为技术有限公司 Memory management method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019770A (en) * 2012-11-21 2013-04-03 北京荣之联科技股份有限公司 Application program quick launch management system and method
CN104679830A (en) * 2015-01-30 2015-06-03 乐视网信息技术(北京)股份有限公司 File processing method and device
CN106446038A (en) * 2016-08-31 2017-02-22 武汉钢铁工程技术集团通信有限责任公司 Hybrid database-based data access control system and method
CN106484814A (en) * 2016-09-23 2017-03-08 珠海格力电器股份有限公司 Data searching method and device
CN107291627A (en) * 2017-06-21 2017-10-24 联想(北京)有限公司 A kind of data processing method and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103019770A (en) * 2012-11-21 2013-04-03 北京荣之联科技股份有限公司 Application program quick launch management system and method
CN104679830A (en) * 2015-01-30 2015-06-03 乐视网信息技术(北京)股份有限公司 File processing method and device
CN106446038A (en) * 2016-08-31 2017-02-22 武汉钢铁工程技术集团通信有限责任公司 Hybrid database-based data access control system and method
CN106484814A (en) * 2016-09-23 2017-03-08 珠海格力电器股份有限公司 Data searching method and device
CN107291627A (en) * 2017-06-21 2017-10-24 联想(北京)有限公司 A kind of data processing method and electronic equipment

Also Published As

Publication number Publication date
CN107291627B (en) 2021-05-18
CN107291627A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
US11681441B2 (en) Input/output processing in a distributed storage node with RDMA
US11403044B2 (en) Method and apparatus for performing multi-object transformations on a storage device
US10331584B2 (en) Internal system namespace exposed through use of two local processors and controller memory buffer with two reserved areas
JP5922740B2 (en) Apparatus for memory device, memory device and method for control of memory device
TWI521518B (en) Method and device for storing data in flash memory device
JP2016035743A (en) Input/output interceptor logic including flush control logic, and computer implemented method using said input/output interceptor logic
US9690720B2 (en) Providing command trapping using a request filter circuit in an input/output virtualization (IOV) host controller (HC) (IOV-HC) of a flash-memory-based storage device
TWI639921B (en) Command processing method and storage controller using the same
EP3394762A1 (en) Techniques for a write transaction at a storage device
WO2018006587A1 (en) File storage method, terminal, and storage medium
WO2015027731A1 (en) Bloom filter generation method and device
TW201729098A (en) Technologies for reducing duplication of stored data
WO2023179742A1 (en) Data access method and system, hardware offloading device, electronic device and medium
WO2019080531A1 (en) Information acquisition method and apparatus, and memory release method and apparatus
WO2018233216A1 (en) Method and electronic device for processing data
JP6523707B2 (en) Memory subsystem that performs continuous reading from lap reading
US9619336B2 (en) Managing production data
US20240086113A1 (en) Synchronous write method and device, storage system and electronic device
US11782762B2 (en) Stack management
CN111666224B (en) Electronic device and method for utilizing memory space of electronic device
JP2018502379A5 (en)
WO2021082877A1 (en) Method and apparatus for accessing solid state disk
US20160062925A1 (en) Method and system for managing storage device operations by a host device
TW201734748A (en) Data storage device, memory controller and operation method thereof
WO2020063591A1 (en) Multi-language scheduling method and apparatus, and embedded device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17915088

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 08.04.2020.

122 Ep: pct application non-entry in european phase

Ref document number: 17915088

Country of ref document: EP

Kind code of ref document: A1