WO2020101211A1 - Electronic apparatus and controlling method thereof - Google Patents

Electronic apparatus and controlling method thereof Download PDF

Info

Publication number
WO2020101211A1
WO2020101211A1 PCT/KR2019/014030 KR2019014030W WO2020101211A1 WO 2020101211 A1 WO2020101211 A1 WO 2020101211A1 KR 2019014030 W KR2019014030 W KR 2019014030W WO 2020101211 A1 WO2020101211 A1 WO 2020101211A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
data
data stored
region
processor
Prior art date
Application number
PCT/KR2019/014030
Other languages
French (fr)
Korean (ko)
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 WO2020101211A1 publication Critical patent/WO2020101211A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0631Configuration or reconfiguration of storage systems by allocating resources to storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • G06F9/4856Task life-cycle, e.g. stopping, restarting, resuming execution resumption being on a different machine, e.g. task migration, virtual machine migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the present invention relates to an electronic device managing a memory provided in the device and a control method thereof.
  • the operating system of an electronic device such as a smart TV or a server, allocates computing resources such as a central processing unit (CPU), volatile memory, or non-volatile memory to an application to execute an application. do.
  • computing resources such as a central processing unit (CPU), volatile memory, or non-volatile memory
  • the operating system supports an on-demand memory allocation method, so that an area other than the volatile memory area used as the main memory of the electronic device can be allocated to the application. For example, when the memory area of the main memory device in the electronic device is insufficient, the operating system solves the memory shortage phenomenon by moving the data of the memory area pre-allocated to the application to a swap area of the nonvolatile memory used as the auxiliary storage device. can do.
  • the area of the volatile memory and the area of the nonvolatile memory are used as a swap area, and data stored in the area of the volatile memory used as the swap area is moved to the area of the nonvolatile memory used as the swap area based on the storage time.
  • An electronic device includes a volatile memory; Non-volatile memory; And when the usable capacity of the first area of the volatile memory is less than a threshold capacity, control at least one data in the first area to move to the second area of the volatile memory, and the data of the data stored in the second area is And a processor for determining whether to control data stored in the second area to be moved to the non-volatile memory based on at least one of a storage time in the second area and a possibility to move to the first area.
  • the processor may include information on a storage time in the second area, information on a data type, information on a corresponding application, and information on a memory setting for each data moving from the first area to the second area.
  • Property information including at least one may be assigned.
  • the processor determines the probability of movement of data stored in the second region to the first region based on the attribute information, and thresholds the data stored in the second region to be proportional to the probability of movement to the first region
  • the storage time can be determined.
  • the processor may control data stored in the second region to be moved to the nonvolatile memory when the storage time in the second region of the data stored in the second region is equal to or greater than the determined threshold storage time.
  • the processor is configured to move data stored in the second region, which is expected to move to the first region, to the nonvolatile memory based on the possibility of moving data stored in the second region to the first region. It can be banned.
  • the processor may store data stored in the second area in proportion to at least one of a page fault ratio, an execution frequency, and a central processing unit (CPU) usage time of an application corresponding to data stored in the second area. The possibility of movement to the first region may be determined.
  • the processor may determine the possibility of movement of data stored in the second area to the first area based on a foreground state or a background state of an application corresponding to data stored in the second area. .
  • the processor based on information on a relationship between a preset application and a possibility of movement to the first area and information on a corresponding application of data stored in the second area, the processor may perform the first processing of data stored in the second area.
  • the possibility of movement to one area can be determined.
  • the processor based on information on a relationship between a preset data type and the likelihood of movement to the first area and information on a data type of data stored in the second area, the processor performs the first processing of the data stored in the second area.
  • the possibility of movement to one area can be determined.
  • the processor based on information on a relationship between a preset memory setting and a possibility of moving to the first area and information on a memory setting of data stored in the second area, the processor may perform the first processing of data stored in the second area.
  • the possibility of movement to one area can be determined.
  • the processor controls to move data stored in the second area to the nonvolatile memory, whether the nonvolatile memory is idle based on at least one of a usage pattern and a queue state of the nonvolatile memory When the non-volatile memory is idle, it is possible to control data stored in the second area to be moved to the non-volatile memory.
  • the processor is based on the usage pattern of the non-volatile memory indicating the number of writes and the number of reads of the non-volatile memory according to the operation of the electronic device and the current operation of the electronic device. It can be determined whether the idle state.
  • the processor divides the data stored in the second area into a size equal to or less than the preset threshold size, and the divided data is sequentially It can be controlled to move to the non-volatile memory.
  • the processor identifies the data stored in the second area for each application, and based on at least one of a storage time of the identified data in the second area and a possibility of moving to the first area. It is possible to determine at least one data among data stored in the two areas, and to determine whether to control the determined at least one data to be moved to the nonvolatile memory.
  • a method of controlling an electronic device including a volatile memory and a nonvolatile memory
  • FIG. 1 illustrates a network environment including an electronic device according to an embodiment of the present invention.
  • FIG. 2 is a block diagram of an electronic device including a volatile memory and a nonvolatile memory according to an embodiment of the present invention.
  • FIG 3 illustrates a two-step swap operation of an electronic device according to an embodiment of the present invention.
  • FIG. 4 is a diagram illustrating attribute information allocated to data by an electronic device according to an embodiment of the present invention.
  • FIG. 5 is a diagram illustrating a case in which an electronic device controls secondary swap according to an embodiment of the present invention.
  • FIG. 6 is a flowchart illustrating a case of determining data to be moved to a third area on a nonvolatile memory in a method of controlling an electronic device according to an embodiment of the present invention.
  • FIG. 7 is a flowchart illustrating a case in which data is moved to a third area on a nonvolatile memory in a control method of an electronic device according to an embodiment of the present invention.
  • first may be referred to as a second component without departing from the scope of the present invention, and similarly, the second component may be referred to as a first component.
  • ⁇ unit may refer to a unit that processes at least one function or operation.
  • the terms may mean at least one process processed by at least one hardware, at least one software or processor stored in memory, such as a field-programmable gate array (FPGA) / application specific integrated circuit (ASIC).
  • FPGA field-programmable gate array
  • ASIC application specific integrated circuit
  • FIG. 1 shows a network environment 10 including an electronic device 100 according to an embodiment of the present invention.
  • the electronic device 100 may include a bus 110, a processor 120, a memory 130, an input / output interface 150, a display 160, and a communication interface 170. According to various embodiments of the present disclosure, the electronic device 100 may omit at least one of the above-described components or additionally include other components.
  • the electronic device 100 includes, for example, a smart phone, a tablet personal computer (PC), a mobile phone, a video phone, and an e-book reader (e- book reader), desktop personal computer (PC), laptop personal computer (PC), netbook computer, workstation, server, personal digital assistant (PDA), portable multimedia player (PMP), MP3 It may include at least one of a player, a mobile medical device, a camera, or a wearable device.
  • a smart phone a tablet personal computer (PC), a mobile phone, a video phone, and an e-book reader (e- book reader), desktop personal computer (PC), laptop personal computer (PC), netbook computer, workstation, server, personal digital assistant (PDA), portable multimedia player (PMP), MP3
  • PDA personal digital assistant
  • MP3 MP3 It may include at least one of a player, a mobile medical device, a camera, or a wearable device.
  • the wearable device may be an accessory type (for example, a watch, ring, bracelet, anklet, necklace, glasses, contact lens, or head-mounted device (HMD)), a fabric, or an integrated garment ( Examples may include at least one of an electronic garment), a body attachment type (eg, a skin pad or tattoo), or a bio-implantable type (eg, an implantable circuit).
  • an accessory type for example, a watch, ring, bracelet, anklet, necklace, glasses, contact lens, or head-mounted device (HMD)
  • HMD head-mounted device
  • a fabric for example, a watch, ring, bracelet, anklet, necklace, glasses, contact lens, or head-mounted device (HMD)
  • HMD head-mounted device
  • the electronic device 100 may be a home appliance.
  • Household appliances include, for example, televisions, smart TVs, digital video disk (DVD) players, audio, refrigerators, air conditioners, vacuum cleaners, ovens, microwave ovens, washing machines, air cleaners, set-top boxes, home autos every Orientation control panel (home automation control panel), the security control panel (security control panel), TV box (for example, Samsung HomeSync TM, Apple TV TM, or Google TV TM), game consoles (for example: Xbox TM, PlayStation TM) , An electronic dictionary, an electronic key, a camcorder, or at least one of an electronic picture frame.
  • DVD digital video disk
  • the electronic device 100 includes various medical devices (for example, various portable medical measurement devices (blood glucose meter, heart rate monitor, blood pressure meter, blood flow meter, heart rate meter, ECG meter, EMG meter, or body temperature meter) , Magnetic resonance angiography (MRA), magnetic resonance imaging (MRI), computed tomography (CT), imaging, or ultrasound), navigation devices, global navigation satellite system (GNSS), event data (EDR) Recorder), FDR (flight data recorder), automotive infotainment devices, marine electronic equipment (e.g.
  • marine navigation devices gyro compasses, etc.
  • avionics security devices
  • head units for vehicles Industrial or household robots
  • financial teller's machines ATMs
  • POS point of sales
  • Internet of things e.g. light bulbs, various sensors, electricity or gas meters, sprinkler devices, fires
  • It may include at least one of an alarm, a thermostat, a street light, a toaster, exercise equipment, a hot water tank, a heater, a boiler, and the like.
  • the electronic device 100 may be a furniture or a part of a building / structure, an electronic board, an electronic signature receiving device, a projector, or various measuring devices. (For example, water, electricity, gas, or radio wave measurement devices, etc.). In various embodiments, the electronic device 100 may be a combination of one or more of the various devices described above.
  • the electronic device 100 may be a flexible electronic device. Further, the electronic device 100 according to an embodiment of the present invention is not limited to the aforementioned devices, and may include a new electronic device according to the development of technology.
  • the term user may refer to a person using the electronic device 100 or a device using the electronic device 100 (eg, an artificial intelligence electronic device).
  • the bus 110 connects the above-described components (eg, the processor 120, the memory 130, the input / output interface 150, the display 160, or the communication interface 170) to each other and , It may be a circuit for transmitting communication (for example, control messages and / or data) between the above-described components.
  • the above-described components eg, the processor 120, the memory 130, the input / output interface 150, the display 160, or the communication interface 170
  • It may be a circuit for transmitting communication (for example, control messages and / or data) between the above-described components.
  • the processor 120 may include one or more of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). have.
  • the processor 120 may perform, for example, calculation or data processing related to control and / or communication of at least one other component of the electronic device 100.
  • the processor 120 may detect a memory allocation request by executing an application and allocate a portion of the memory 130 to the corresponding application.
  • the processor 120 may allocate, for example, an area not allocated to another application among the first areas of the volatile memory to an application requiring execution.
  • the first area according to an embodiment may be a system memory area designated to at least temporarily store a program and execution related data of the program for program execution.
  • the processor 120 may determine whether primary swap is required based on the available capacity of the first area.
  • the processor 120 may compare usable usable capacity of the first area with a preset threshold capacity, and determine whether primary swap is required according to the comparison result.
  • the primary swap means that data stored at least temporarily in the first area of the volatile memory in the memory 130 is moved to and stored in the second area of the volatile memory.
  • the primary swap may mean copying data stored at least temporarily in the first area of the volatile memory in the memory 130 to the second area of the volatile memory and freeing memory allocation for the first area. .
  • the second area is designated to store programs related to execution of the program and programs that are not expected to be used at least temporarily to secure the usable capacity of the first area when the first area, which is the system memory area, is insufficient. It may be the primary swap area.
  • the data stored in the second area may be compressed data.
  • the second area may be a compressed memory pool in which page-level data is compressed and stored.
  • the size of the second region may be fixed or variable.
  • the processor 120 may determine that primary swap is required. When primary swap is required, the processor 120 may compress at least one page data temporarily stored in the first area of the volatile memory, and then move the compressed data to the second area of the volatile memory.
  • the processor 120 may select data that satisfies a preset condition among data in the first region of the volatile memory, and assign attribute information to each of the selected data to move to the second region of the volatile memory.
  • the processor 120 may select at least one page data that has not been used for the longest time among the data in the first area for primary swap.
  • the processor 120 compresses at least one page data selected in the first area, and processes the compressed data to be moved to the second area.
  • the processor 120 may select page data corresponding to a preset application from among data in the first area for primary swap.
  • the processor 120 compresses at least one page data selected in the first area, and processes the compressed data to be moved to the second area.
  • the attribute information may include at least one of information about a storage time point in the second area of data to which the attribute information is assigned, information about a data type, information about a corresponding application, and information about a memory setting. have.
  • the attribute information allocated to the data moving to the second area may be used to calculate data that is the target of secondary swap indicating data movement from the second area to the third area of the nonvolatile memory. The calculation of the data to be subject to the secondary swap will be discussed in detail later.
  • the processor 120 releases a previous allocation for a specific region of the first region in which at least one page data moved to the second region is stored, and an application requiring execution of the specific region in which the allocation is released Can be assigned to
  • the processor 120 may determine that primary swap is not required. When primary swap is not required, the processor 120 allocates an available area of the first area to the corresponding application.
  • the threshold capacity may be fixed or may vary depending on the application for which execution is required.
  • the processor 120 may determine whether a secondary swap is necessary based on at least one of a storage time in a second area of each data stored in the second area and a possibility of moving to the first area.
  • Secondary swap means that data stored at least temporarily in the second area of the volatile memory in the memory 130 is moved to and stored in the third area of the nonvolatile memory.
  • the secondary swap may mean copying data stored at least temporarily in the second area of the volatile memory in the memory 130 to the third area of the non-volatile memory, and freeing memory allocation for the second area. have.
  • the processor 120 determines at least one data among the data stored in the second area based on at least one of a storage time in the second area and a possibility of moving to the first area of each data stored in the second area. And, it can be controlled to move the determined at least one data to the third area of the non-volatile memory.
  • the processor 120 determines at least one data whose storage time in the second area is greater than or equal to the critical storage time by comparing the storage time in the second area of each data stored in the second area with the critical storage time, and the determined at least One data can be controlled to move to the third area of the non-volatile memory.
  • the processor 120 identifies the data stored in the second area for each application, and the second area based on at least one of the storage time in the second area of each identified data and the possibility of moving to the first area. At least one of the data stored in the data may be determined, and it may be determined whether to control the determined at least one data to be moved to the non-volatile memory.
  • data moved from the first area to the second area may be moved to the first area within a specific time (eg, 30 seconds to 1 minute). That is, according to the execution of the application in the first area of the volatile memory corresponding to the system memory area, the movement from the first area to the second area (swap out) and the movement from the second area to the first area (swap in) ) Can be performed within a certain time.
  • a specific time eg, 30 seconds to 1 minute
  • the processor 120 determines that data in the second area that has not moved back to the first area within a certain time will not move back to the first area, and moves the data to the third area of the non-volatile memory. By doing so, the usable capacity of the second area of the volatile memory can be largely secured. Through this, the primary swap on the memory 130 of the electronic device 100 can be performed more quickly, and accordingly, system memory for application execution, that is, memory allocation in the first area can be performed more quickly. have.
  • the processor 120 presets a specific time as a threshold storage time, and determines at least one data stored in the second area beyond the threshold storage time, so that the determined at least one data is the third of the non-volatile memory. It can be controlled to move to an area.
  • the processor 120 may adjust the threshold storage time based on the importance of each data stored in the second area. Specifically, the processor 120 determines the probability of movement of each data stored in the second region to the first region, and determines the critical storage time of each data stored in the second region in proportion to the probability of movement to the first region Can be.
  • the processor 120 may determine the possibility of movement of the data stored in the second area to the first area based on the attribute information of each data stored in the second area.
  • the possibility of moving to the first area may be a probability that data stored in the second area is moved to the first area corresponding to the system memory area by executing a corresponding application. Determining the possibility of movement to the first area will be described in detail again later.
  • the higher the probability of execution of an application the higher the probability of movement of data corresponding to the application to the first area.
  • the processor 120 may determine a critical storage time of each data stored in the second area in proportion to the probability of movement to the first area.
  • the threshold storage time is a time value compared to the storage time in each second area of data stored in the second area, and the processor 120 corresponds to the storage time in the second area among the data stored in the second area. At least one data that is equal to or greater than the critical storage time may be determined, and the determined at least one data may be controlled to move to the third area on the nonvolatile memory.
  • the processor 120 changes the threshold storage time corresponding to the data of the application according to the possibility of moving to the first area, that is, the application feasibility, thereby viewing the critical storage time corresponding to the data of the application having high feasibility.
  • the processor 120 changes the threshold storage time corresponding to the data of the application according to the possibility of moving to the first area, that is, the application feasibility, thereby viewing the critical storage time corresponding to the data of the application having high feasibility.
  • the processor 120 may set the threshold storage time corresponding to the data of the application with low feasibility to be shorter, so that the data of the application with low feasibility to be stored in the second area may be shorter.
  • the data of the application with high feasibility may be stored in the second region longer than the data of the application with low feasibility, and through this, when the application with high feasibility is executed, the corresponding data stored in the second region Can be immediately moved to the first area corresponding to the system memory area.
  • the processor 120 may determine whether at least one data expected to move to the first area is based on the possibility of movement of the data stored in the second area to the first area. It is forbidden to move to 3 areas.
  • the processor 120 is stored in the second region on the volatile memory in the case of data expected to move to the first region, based on the possibility of movement of the data stored in the determined second region to the first region. This ensures rapid movement to the first area (swap in).
  • the processor 120 determines whether the nonvolatile memory is idle based on at least one of a usage pattern and a queue state of the nonvolatile memory, and when the nonvolatile memory is idle, At least one data determined to have a storage time equal to or greater than a threshold storage time may be controlled to move to the third area.
  • the processor 120 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to move to the third area only when the nonvolatile memory is idle.
  • the processor 120 uses the non-volatile memory usage pattern indicating the number of writes and the number of reads of the non-volatile memory according to the operation of the electronic device 100 and the current operation of the electronic device 100. Based on this, it may be determined whether the nonvolatile memory is idle.
  • the processor 120 may determine whether the nonvolatile memory is idle by comparing the number of reads and writes indicated by the queue state of the nonvolatile memory, that is, the I / O queue state, with a threshold number of times. Determining whether the nonvolatile memory is idle will be described in detail later.
  • the processor 120 may set the determined at least one data to be less than or equal to the preset threshold size. It can be divided into, and can be controlled to sequentially move the divided data to the third area.
  • the processor 120 may set data corresponding to any one application to be less than or equal to a preset threshold size. It is also possible to divide and control the data to be sequentially moved to the third area of the nonvolatile memory.
  • the processor 120 may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory. That is, the processor 120 determines the number of reads and writes of the nonvolatile memory based on at least one of the usage pattern of the nonvolatile memory and the queue state, and the third area in the second area based on the number of reads and the number of writes. You can adjust the threshold size to limit the amount of data that moves.
  • the memory 130 may include volatile memory and nonvolatile memory.
  • the memory 130 may store instructions or data related to at least one other component of the electronic device 100.
  • the memory 130 may include a volatile memory including a first area and a second area and a non-volatile memory including a third area.
  • the first area may be a system memory area designated to temporarily store programs and execution-related data of the program for program execution.
  • the second area is a primary swap area designated to store programs related to execution of programs and programs that are not expected to be used at least temporarily to secure the usable capacity of the first area when the first area, which is a system memory area, is insufficient. Can be.
  • data stored in the second area may be compressed data.
  • the third area may be a secondary swap area designated to store at least one data determined to have a storage time equal to or greater than a critical storage time among data stored in the second area of the volatile memory.
  • the third area can store compressed data.
  • the sizes of the first area, the second area, and the third area may be fixed or variable.
  • the memory 130 may store software and / or programs 140.
  • the program 140 may include a kernel 141, middleware 142, an application programming interface (API) 143, or an application 144 (or application program).
  • API application programming interface
  • At least a portion of the kernel 141, middleware 142, or application programming interface (API) 143 may be referred to as an operating system (OS).
  • OS operating system
  • the kernel 141 may include system resources used to execute an operation or function implemented in other programs (eg, middleware 142, API 143, or application 144), such as a bus ( 110), the processor 120 or the memory 130, etc.) can be controlled or managed.
  • the kernel 141 may provide an interface for controlling or managing system resources by accessing individual components of the electronic device 100 in the middleware 142, the API 143, or the application 144.
  • the kernel 141 may control or manage the primary swap task and the secondary swap task using a swap program module for memory management.
  • the middleware 142 may act as an intermediary so that the API 143 or the application 144 communicates with the kernel 141 to exchange data. Also, the middleware 142 may process one or more job requests received from the application 144 according to priority. For example, the middleware 142 may use system resources (eg, the bus 110, the processor 120, or the memory 130, etc.) of the electronic device 100 for at least one of the applications 144. You can assign a ranking. For example, the middleware 142 may perform scheduling or load balancing for the one or more job requests by processing the one or more job requests according to the priority given to the at least one.
  • system resources eg, the bus 110, the processor 120, or the memory 130, etc.
  • the API 143 may be, for example, an application 144 as an interface for controlling functions provided by the kernel 141 or the middleware 142, for example, file control, window control, It may include at least one interface or function (eg, a command) for image processing or text control.
  • an application 144 as an interface for controlling functions provided by the kernel 141 or the middleware 142, for example, file control, window control, It may include at least one interface or function (eg, a command) for image processing or text control.
  • the input / output interface 150 may serve as an interface capable of transmitting commands or data input from a user or other external device to other component (s) of the electronic device 100. Also, the input / output interface 150 may output commands or data received from other component (s) of the electronic device 100 to a user or another external device.
  • the display 160 includes, for example, a liquid crystal display (LCD), a light-emitting diode (LED) display, and an organic light-emitting diode (OLED) display. , Or a microelectromechanical systems (MEMS) display, or an electronic paper display.
  • LCD liquid crystal display
  • LED light-emitting diode
  • OLED organic light-emitting diode
  • MEMS microelectromechanical systems
  • the display 160 may display various contents (eg, text, images, videos, icons, or symbols) to the user, for example.
  • the display 160 may include a touch screen, and may receive a touch, gesture, proximity, or hovering input using, for example, an electronic pen or a user's body part.
  • the display 160 may form a single touch screen in combination with a touch panel capable of detecting a touch input or a hovering input.
  • the communication interface 170 connects communication between the electronic device 100 and an external electronic device (eg, the first external electronic device 101, the second external electronic device 102, or the server 103). Can be.
  • the communication interface 170 may be connected to the network 105 through wireless communication or wired communication to communicate with an external electronic device.
  • Wireless communication is, for example, a cellular communication protocol, for example, long-term evolution (LTE), LTE Advance (LTE-A), code division multiple access (CDMA), wideband CDMA (WCDMA), universal (UMTS) Mobile telecommunications system), WiBro (Wireless Broadband), or GSM (Global System for Mobile Communications) may be used.
  • LTE long-term evolution
  • LTE-A LTE Advance
  • CDMA code division multiple access
  • WCDMA wideband CDMA
  • UMTS universal Mobile telecommunications system
  • WiBro Wireless Broadband
  • GSM Global System for Mobile Communications
  • the wireless communication may include, for example, short-range communication 104.
  • the short-range communication 104 includes, for example, wireless fidelity (WiFi), Bluetooth (Bluetooth), Bluetooth low energy (BLE), Zigbee, near field communication (NFC), magnetic secure transmission, It may include at least one of a radio frequency or a body area network.
  • the wireless communication may include a global navigation satellite system (GNSS).
  • GNSS global navigation satellite system
  • the GNSS can be, for example, a Global Positioning System (GPS), a Global Navigation Satellite System (Glonass), a Beidou Navigation Satellite System (Geidu) or an European global satellite-based navigation system (Gilelo).
  • GPS Global Positioning System
  • Glonass Global Navigation Satellite System
  • Geidu Beidou Navigation Satellite System
  • Gilelo European global satellite-based navigation system
  • Wired communication may include, for example, at least one of a universal serial bus (USB), a high definition multimedia interface (HDMI), a recommended standard-232 (RS-232), or a plain old telephone service (POTS).
  • USB universal serial bus
  • HDMI high definition multimedia interface
  • RS-232 recommended standard-232
  • POTS plain old telephone service
  • the network 105 may include at least one of a telecommunications network, for example, a computer network (eg, LAN or WAN), the Internet, or a telephone network.
  • a telecommunications network for example, a computer network (eg, LAN or WAN), the Internet, or a telephone network.
  • the server 103 may include a group of one or more servers. According to various embodiments, all or some of the operations executed in the electronic device 100 may be executed in another one or a plurality of electronic devices (eg, the electronic devices 101, 102, or the server 103). According to an example, when the electronic device 100 needs to perform a function or service automatically or by request, the electronic device 100 may execute the function or service itself, or in addition, at least associated therewith. Some functions may be requested from other devices (eg, electronic devices 101, 102, or server 103.) Other electronic devices (eg, electronic devices 101, 102, or server 103) may be requested. A function or an additional function may be executed, and the result may be transmitted to the electronic device 100. The electronic device 100 may provide the requested function or service by processing the received result as it is or additionally. For example, cloud computing, distributed computing, or client-server computing technology can be used.
  • FIG. 2 is a block diagram of an electronic device 100 including a volatile memory 131 and a nonvolatile memory 132 according to an embodiment of the present invention.
  • the electronic device 100 may include a processor 120, a volatile memory 131, a nonvolatile memory 132, and the like.
  • the processor 120 may include a memory management unit 121.
  • the memory manager 121 detects, for example, a memory allocation request according to application execution, and allocates at least a portion of the first region 210 corresponding to the system memory region in the volatile memory 131 to the corresponding application. Can be.
  • the memory management unit 121 may detect the termination of the execution of the application or the insufficient capacity of the first area 210, and release the allocation of some areas of the first area 210 previously allocated to the application. have.
  • the memory management unit 121 may include the movement management module 122.
  • the movement management module 122 determines that the first area 210 is insufficient and transmits data of the first area 210 to the volatile memory 131.
  • a primary swap performance for moving to the second region 220 on the top may be determined.
  • the threshold capacity may be a fixed value or a variable value.
  • the threshold capacity may always be a constant value, and may be changed according to an application requiring execution.
  • the threshold capacity may be set to 20 MB (megabyte).
  • the movement management module 122 may activate the primary movement task 123 when, for example, the available capacity of the first area 210 is less than or equal to the threshold capacity.
  • the movement management module 122 may select data that satisfies a preset condition among data in the first region 210 using the primary movement task 123.
  • the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
  • the movement management module 122 may select a page that has not been used for the longest time among the pages of the first region 210 and may move data of the selected page to the second region 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
  • the movement management module 122 may select a page corresponding to a preset application from among the pages of the first region 210 and move data of the selected page to the second region 220.
  • the primary movement task 123 may compress the data of the page selected in the first region 210 and then move the compressed data to the second region 220.
  • the primary movement task 123 may compress data of a page using a known algorithm such as a Lempel-Ziv-Oberhumer (LZO) algorithm or an LZO Variant (LZ4) algorithm.
  • LZO Lempel-Ziv-Oberhumer
  • LZ4 LZO Variant
  • the primary movement task 123 may move the data of the uncompressed page to the second region 220 without compressing the data of the page selected in the first region 210.
  • a unit of data moved from the first area 210 to the second area 220 by the primary movement task 123 may be a page, but is not limited thereto.
  • data moved from the first region 210 to the second region 220 by the primary movement task 123 may be a unit corresponding to a plurality of times of a page or a process unit.
  • the primary movement task 123 may assign attribute information to each data moved from the first region 210 to the second region 220.
  • the attribute information includes at least one of information on a storage time of the data to which the attribute information is assigned to the second region 220, information on a data type, information on a corresponding application, and information on a memory setting. can do.
  • the attribute information allocated to the data moving to the second area 220 is data to be subject to secondary swap indicating data movement from the second area 220 to the third area 230 of the nonvolatile memory 132. Can be used for calculation.
  • the movement management module 122 may generate the secondary movement task 124 when the operating system starts. For example, the movement management module 122 may display data of the second region 220 based on at least one of a storage time of each data stored in the second region 220 and a possibility of movement to the first region 210. Whether to activate the secondary swap function for moving to the third region 230 may be determined.
  • the movement management module 122 stores the storage time in the second region 220 of each data in the second region 220 based on the storage time information in the second region 220 included in the attribute information. can confirm.
  • the movement management module 122 determines at least one data of which the storage time is greater than or equal to a corresponding threshold storage time among data stored in the second area 220 based on the identified storage time, and the determined at least one You can decide to do a second swap on your data.
  • the threshold storage time can be set to 30 seconds.
  • the movement management module 122 uses the secondary movement task 124 to determine at least one data that satisfies a specified condition among compressed data temporarily stored in the second region 220 and , It is possible to move the determined at least one data to the third region 230.
  • the processor 120 identifies the data stored in the second area 220 for each application, and the storage time in the second area 220 of each of the identified data and the possibility of movement to the first area 210 Based on at least one of the data, it is possible to determine at least one data among the data stored in the second area 220 and determine whether to control the determined at least one data to be moved to the third area 230.
  • the secondary movement task 124 may adjust the threshold storage time based on the importance of each data stored in the second region 220. Specifically, the processor 120 determines the possibility of movement of each of the data stored in the second region 220 to the first region 210, and the second region (so as to be proportional to the probability of movement to the first region 210) A threshold storage time of each data stored in 220 may be determined.
  • the secondary movement task 124 determines the possibility of movement of the data stored in the second region 220 to the first region 210 based on the attribute information of each data stored in the second region 220. Can be.
  • the possibility of moving to the first area 210 is the probability that data stored in the second area 220 is moved (or returned) to the first area 210 corresponding to the system memory area by executing a corresponding application.
  • the secondary movement task 124 is proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second area 220.
  • the possibility of movement of the data stored in the second area 220 to the first area 210 may be determined.
  • the secondary movement task 124 may include the second area 220 based on the foreground state or the background state of the application corresponding to each data stored in the second area 220. ), It is possible to determine the possibility of movement of each data stored in the first region 210.
  • the secondary movement task 124 may correspond to information on a relationship between a preset application and a possibility of movement to the first region 210 and data stored in the second region 220, respectively. Based on the information on the application, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
  • the information on the relationship between the preset application and the possibility of movement to the first area 210 may include information about the possibility of movement to the first area 210 preset for each application. That is, the electronic device 100 may store the possibility of movement to the first region 210 of each application on the memory 130, and the possibility of movement to the first region 210 of each application may be stored in the design stage Or, it can be stored by the user or can be obtained from an external server.
  • the secondary movement task 124 may include information on a relationship between a preset data type and the possibility of movement to the first region 210 and data of each data stored in the second region 220. Based on the information on the type, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
  • the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type.
  • the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
  • the secondary movement task 124 may move to the first area 210 of each data stored in the second area 220 based on the memory setting of each data stored in the second area 220. Can determine the likelihood of movement.
  • the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory.
  • the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
  • the secondary movement task 124 may have a possibility that the memory setting moves from the second area 220 to the first area 210 based on the memory setting of each data stored in the second area 220. Moving to the third area 230 is prohibited for data indicating that there is, and for the data indicating that the memory setting is not likely to move from the second area 220 to the first area 210, the third area ( 230).
  • the secondary movement task 124 may determine the critical storage time of each data stored in the second region 220 in proportion to the possibility of movement to the first region 210.
  • the processor 120 varies the threshold storage time corresponding to the data of the application according to the possibility of movement to the first area 210, that is, the application feasibility, thereby storing the threshold corresponding to the data of the application having high feasibility.
  • the processor 120 By setting the time longer, data of an application with high feasibility may be stored in the second region 220 longer.
  • the processor 120 may set the threshold storage time corresponding to the data of the application having low feasibility to be shorter, so that the data of the application having low feasibility may be stored in the second region 220 shorter.
  • the data of the application with high feasibility may be stored in the second region 220 longer than the data of the application with low feasibility, and through this, when the application with high feasibility is executed, the second region ( The data stored in 220) may be immediately moved to the first area 210 corresponding to the system memory area.
  • the processor 120 may at least predict the movement of the data stored in the second region 220 to the first region 210 based on the possibility of movement to the first region 210.
  • One data may be prevented from moving to the third area 230 on the nonvolatile memory.
  • the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
  • the movement management module 122 may move (or return) data stored in the second region 220 to the first region 210 using the primary movement task 123. Also, the movement management module 122 according to an embodiment may move (or return) data stored in the third region 230 to the first region 210 using the secondary movement task 124. In various embodiments of the present invention, an operation of moving data stored in the second area 220 or the third area 230 to the first area 210 may be referred to as swap-in. Additionally, an operation of moving data in the first region 210 to the second region 220 and / or an operation of moving data stored in the second region 220 to the third region 230 is referred to as swap-out. Can refer to.
  • the corresponding data may be deleted in the specific area.
  • the movement management module 122 maps an address to a specific region in which the corresponding data is stored in the address mapping database Information can be deleted or updated.
  • the address mapping database may include address information directly accessible for each data stored in each area.
  • the address mapping database may include an index for each data stored in each area and a table for converting each index to actual address information. The mobile management module 122 may recognize that there is no data stored in the corresponding address by deleting the address mapping information for the specific area.
  • the movement management module 122 may information about the data stored in the second area 220.
  • the address mapping database to which address information for each data is mapped by deleting address mapping information for the first data, it can be recognized that there is no data in a specific area.
  • the movement management module 122 may include information on data stored in the third area 230.
  • the movement management module 122 may delete address mapping information for a specific region in which data corresponding to the terminated specific application is stored among data stored in the third region 230.
  • Volatile memory 131 is at least to secure the usable capacity of the first area 210 and the first area 210 designated to at least temporarily store programs and execution related data for the program execution. And a second region 220 designated to store programs and data related to execution of programs that are not expected to be temporarily used.
  • the first area 210 may be a system memory area
  • the second area 220 may be a compressed memory pool in which data (eg, page-level data) is compressed and stored.
  • the size or capacity of each of the first region 210 and the second region 220 may be fixed or variable.
  • the second region 220 may be configured as a physically contiguous memory region, or may be configured as a physically noncontiguous memory region.
  • the non-volatile memory 132 may store at least a program that is not expected to be temporarily used and data related to execution of the program in order to secure an available capacity of the second area 220 of the volatile memory 131.
  • the designated third region 230 may be included.
  • the size or capacity of the third region 230 may be fixed or variable.
  • the third area 230 may be managed by a file system.
  • the third region 230 may be configured as a physically contiguous memory region, or may be configured as a physically noncontiguous memory region.
  • FIG. 3 illustrates a two-step swap operation of the electronic device 100 according to an embodiment of the present invention
  • FIG. 4 shows attribute information 400 assigned to data by the electronic device 100 according to an embodiment of the present invention
  • FIG. 5 is a diagram illustrating a case in which the electronic device 100 controls secondary swap according to an embodiment of the present invention.
  • the movement management module 122 monitors a change in the usable capacity of the first area 210 of the volatile memory 131 and when the usable capacity of the first area 210 becomes smaller than the threshold capacity , The primary movement task 123 may be activated. The movement management module 122 compresses at least one page data stored in the first area 210 of the volatile memory 131 using the primary movement task 123, and then compresses the compressed data into the volatile memory 131. It can be moved to the second region (220).
  • the movement management module 122 uses the primary movement task 123 to set a preset condition among data in the first area 210. You can select data that satisfies. At this time, the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
  • the movement management module 122 may select a page that has not been used for the longest time among the pages of the first region 210 and may move data of the selected page to the second region 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
  • the movement management module 122 may select a page corresponding to a preset application from among the pages of the first region 210 and move data of the selected page to the second region 220.
  • the primary movement task 123 may assign attribute information 400 to each data moved from the first region 210 to the second region 220.
  • the attribute information 400 includes information 410 about a storage time point of the data to which the attribute information 400 is assigned to the second region 220, information 420 about the data type, and corresponding data. It may include at least one of information about the application (application Id) 430 and information about the memory setting 440.
  • the movement management module 122 may be referred to as 'kernel swap daemon (KSWAPD)', and the primary movement task 123 may be 'compressed swap (ZSWAP)' or 'compressed random access memory (Zram)' block device) '.
  • KSWAPD 'kernel swap daemon
  • ZSWAP 'compressed swap
  • Zram 'compressed random access memory
  • embodiments of the present invention are not limited thereto.
  • the movement management module 122 generates a secondary movement task 124 through the primary movement task 123, and uses the secondary movement task 124 to determine the active state of the secondary swap function. Can be controlled.
  • the secondary movement task 124 may be referred to as 'writeback'.
  • embodiments of the present invention are not limited now.
  • the secondary movement task 124 may move data satisfying a condition specified in the second region 220 of the volatile memory 131 to the third region 230 of the nonvolatile memory 132. have.
  • the movement management module 122 may store data in the second region 220 based on at least one of a storage time of each data stored in the second region 220 and a possibility of movement to the first region 210. It may be determined whether or not the secondary swap function for moving the data to the third region 230 is activated.
  • the movement management module 122 is based on the information 410 on the storage time in the second region 220 in the second region 220 of each data of the second region 220. You can check the storage time.
  • the movement management module 122 determines at least one data of which the storage time is greater than or equal to a corresponding threshold storage time among data stored in the second area 220 based on the identified storage time, and the determined at least one It may be determined to perform a secondary swap, that is, a movement from the second region 220 to the third region 230 on the data.
  • the threshold storage time can be set to 30 seconds.
  • the secondary movement task 124 may adjust the threshold storage time based on the importance of each data stored in the second region 220. Specifically, the processor 120 determines the possibility of movement of each of the data stored in the second region 220 to the first region 210, and the second region (so as to be proportional to the probability of movement to the first region 210) A threshold storage time of each data stored in 220 may be determined.
  • the secondary movement task 124 may be based on a reference threshold storage time (eg, 30 seconds) corresponding to a reference movement possibility to the first region 210, the first region 210
  • the threshold storage time may be adjusted to be longer than the reference threshold storage time when the mobility to the mobile station is greater than the reference mobility, and the threshold storage time may be referenced when the mobility to the first area 210 is less than the reference mobility. It can be adjusted to be shorter than the critical storage time.
  • the threshold storage time of the first data 510 in which the possibility of movement to the first area 210 corresponds to the reference mobility may be 30 seconds, and the first area ( The threshold storage time of the second data 520 in which the mobility to 210 is greater than the reference mobility may be 50 seconds, and the third data 530 in which the mobility to the first area 210 is less than the reference mobility ),
  • the critical storage time may be 20 seconds.
  • the example of the reference threshold storage time is an example for explanation, and may vary depending on the setting.
  • the difference between the determined threshold storage time and the reference threshold storage time may be proportional to the difference between the mobility to the first region 210 and the reference mobility.
  • the secondary movement task 124 may move to the first region 210 based on the possibility of movement of the data stored in the second region 220 to the first region 210. It is possible to prevent the expected at least one data from moving to the third area 230 on the nonvolatile memory.
  • the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
  • the secondary movement task 124 corresponds to a probability of movement to the first region 210 of data stored in the second region 220 equal to or greater than a preset threshold movement possibility.
  • the fourth data 540 it is determined that movement to the first region 210 is expected within a threshold time, and thus it is possible to prohibit the fourth data 540 from moving to the third region 230.
  • the processor 120 is based on at least one of a storage time in the second area 220 of each data stored in the second area 220 and a possibility of moving to the first area 210.
  • Each data stored in the second region 220 may be controlled to move to the third region 230 or may be controlled not to move to the third region 230.
  • the secondary movement task 124 of the processor 120 may determine the possibility of movement of the data stored in the second region 220 to the first region 210.
  • the secondary movement task 124 is proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second area 220.
  • the possibility of movement of the data stored in the second area 220 to the first area 210 may be determined.
  • the secondary movement task 124 compares at least one of the page fault ratio, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 with a corresponding threshold value. Accordingly, when the value is greater than or equal to a threshold, it is determined that the probability of the application being executed again is high, and it is determined that the data of the application is highly likely to move to the first region 210. In this case, the greater the difference from the threshold, the higher the probability of movement to the first region 210.
  • the secondary moving task 124 may perform a reference threshold storage time (eg, 30) so that data of a corresponding application having a high possibility of moving to the first area 210 may be stored in the second area 220 for a longer time. Seconds) may be adjusted to be longer in proportion to the possibility of movement to the first area 210 to determine a critical storage time corresponding to the data.
  • a reference threshold storage time eg, 30
  • the page fault causes the corresponding page stored in the second area 220 to be loaded as the page corresponding to the application does not exist in the first area 210 of the volatile memory 131 when the application is executed. It means the interruption that occurs accordingly. Accordingly, when the page fault rate of the application is high, the secondary movement task 124 may determine that the data stored in the second region 220 is highly likely to move to the first region 210.
  • the execution frequency means the number of application executions measured since the start of the operating system of the electronic device 100. Accordingly, when the execution frequency of the application is high, the secondary movement task 124 may determine that the possibility of movement of the corresponding data stored in the second region 220 to the first region 210 is high.
  • the CPU usage time refers to the CPU usage time of an application measured after the start of the operating system of the electronic device 100.
  • the corresponding application may correspond to an application that is idle or operates with a long period of time.
  • the application may have a low probability of using the system memory area, that is, the first area 210. Accordingly, when the CPU usage time of the application is high, the secondary movement task 124 may determine that the possibility of movement of the corresponding data stored in the second region 220 to the first region 210 is high.
  • the secondary movement task 124 determines at least one of the page fault rate, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 based on the information 430 about the application. It is possible to compare at least one of the page fault rate, the execution frequency and the CPU usage time with each threshold value corresponding to the reference mobility to the first area 210, and the critical storage time of the data corresponding to the application. Can decide.
  • the secondary moving task 124 is the first area 210 of data stored in the second area 220 corresponding to the application based on at least one of the page fault rate, execution frequency, and CPU usage time of the application.
  • the critical storage time is determined to be shorter than the reference threshold storage time, so that the corresponding data is faster than the third area 230 If the possibility of movement to the first area 210 is higher than the reference mobility, the critical storage time is determined to be longer than the reference threshold storage time, and the corresponding data is stored in the second area 220 longer. Control.
  • the secondary movement task 124 may include the second area 220 based on the foreground state or the background state of the application corresponding to each data stored in the second area 220. ), It is possible to determine the possibility of movement of each data stored in the first region 210.
  • the secondary movement task 124 determines that the probability that the data stored in the corresponding second region 220 moves to the first region 210 is greater than or equal to the critical movement probability. Data stored in the second region 220 may be prevented from moving to the third region 230.
  • the secondary movement task 124 determines that the data stored in the corresponding second region 220 is moved to the first region 210 as a reference mobility or less.
  • the corresponding threshold storage time may be determined as or less than the reference threshold storage time to control the data stored in the corresponding second area 220 to move to the third area 230 more quickly.
  • the secondary movement task 124 may correspond to information on a relationship between a preset application and a possibility of movement to the first region 210 and data stored in the second region 220, respectively. Based on the information 430 for the application, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
  • the information on the relationship between the preset application and the possibility of movement to the first area 210 may include a list of applications that are set to have the possibility of movement to the first area 210 to be greater than or equal to the critical mobility.
  • IME input method editor
  • a swap-in operation must be performed again, so that the user Reactivity may decrease. Therefore, it is necessary to allow movement to the second area 220 where the swap-in speed is relatively fast for the IME application, but to prohibit the movement to the third area 230 where the swap-in speed is relatively slow.
  • the second movement task 124 is based on information on the relationship between the preset application and the possibility of movement to the first region 210, and the second region 220 corresponding to the application included in the list of applications. ) May be prevented from moving to the third area 230.
  • information on the relationship between the preset application and the possibility of moving to the first area 210 may include information about the possibility of moving to the first area 210 according to the priority of the application.
  • the information on the relationship between the preset application and the mobility to the first area 210 may indicate that the mobility of the application with the reference priority or higher to the first area 210 is greater than or equal to the critical mobility.
  • the priority may be higher than other applications. That is, the priority of the security-related application may be greater than or equal to the reference priority set to correspond to the critical mobility. Therefore, the secondary movement task 124 may be configured for data corresponding to the security-related application stored in the second region 220 based on information on the relationship between the preset application and the possibility of movement to the first region 210. Movement to the third region 230 may be prohibited.
  • the secondary movement task 124 prioritizes the corresponding application of each data stored in the second region 220 based on information on a relationship between a preset application and a possibility of movement to the first region 210. Is determined, and it is determined that the probability of movement of data corresponding to an application having a priority higher than or equal to the reference priority is greater than or equal to the threshold movement probability, and the movement of the corresponding data to the third region 230 is determined. It can be banned.
  • Information about the relationship between the preset application and the possibility of moving to the first area 210 may be set by a system administrator in the design stage, or may be set by a user. In addition, information on a relationship between a preset application and a possibility of moving to the first area 210 may be obtained from an external server.
  • the secondary movement task 124 may include information on a relationship between a preset data type and the possibility of movement to the first region 210 and data of each data stored in the second region 220. Based on the information on the type, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
  • the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type.
  • the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
  • streaming data may continuously move to the first area 210 according to the user's application execution. Accordingly, information on the relationship between the preset data type and the mobility to the first area 210 may indicate that the mobility to the first area 210 is higher than the threshold mobility to the streaming data.
  • the secondary movement task 124 may include streaming data stored in the second region 220 based on information on a relationship between a preset data type and the possibility of movement to the first region 210. 230).
  • the secondary movement task 124 may determine the mobility of each of the data stored in the second region 220 based on information on the relationship between the preset data type and the mobility to the first region 210. In addition, a threshold storage time may be determined based on the possibility of movement of each data, or movement to the third region 230 may be prohibited.
  • the secondary movement task 124 may move to the first area 210 of each data stored in the second area 220 based on the memory setting of each data stored in the second area 220. Can determine the likelihood of movement.
  • the secondary movement task 124 includes information on a relationship between a preset memory setting and a possibility of moving to the first area 210 and information on each memory setting of data stored in the second area 220 ( Based on 440, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
  • information on the relationship between the preset memory setting and the possibility of moving to the first area 210 may indicate the possibility of moving to the first area 210 according to the memory setting.
  • the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory.
  • the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
  • data for login, session, and user information required in the login process is not executed while the image is being played, so data for login, session, and user information is the second area.
  • a flag value indicating that there is no possibility of movement from 220 to the first area 210 may be allocated, and the corresponding memory may be set accordingly.
  • the data for the menu screen, the video list, and the advertisement since the data for the menu screen, the video list, and the advertisement are not executed while the video is being played, the data for the menu screen, the video list, and the advertisement may move from the second area 220 to the first area 210. A flag value indicating this absence can be assigned, and the corresponding memory can be set accordingly.
  • a flag value indicating that there is no possibility of movement from the second area 220 to the first area 210 may be assigned, and the corresponding memory is It can be set accordingly.
  • the secondary movement task 124 based on the information on the relationship between the preset memory setting and the possibility of movement to the first area 210, the memory setting is the first area in the second area 220
  • the third region 230 is prohibited, and there is no possibility that the memory setting moves from the second region 220 to the first region 210. Moving to the third area 230 may be performed on the indicated data.
  • the secondary movement task 124 compares the data with the critical storage time for data indicating that the memory setting is not likely to move from the second region 220 to the first region 210. It can be controlled to immediately move to the third region 230 without. That is, the secondary moving task 124 sets the threshold storage time corresponding to the data to '0' for data indicating that the memory setting has no possibility of moving from the second area 220 to the first area 210. Can decide.
  • the secondary movement task 124 considers at least one of the storage time of each data stored in the second region 220 and the possibility of movement to the first region 210, and thus the data stored in the second region 220 Whether to move to each third region 230 may be determined.
  • data determined to stay in the second region 220 for a relatively long time may be moved to the third region 230 to secure the usable capacity of the second region 220, and may be applied according to the importance of the application.
  • the number of swap-ins from the third region 230 can be reduced to improve the application execution speed of the electronic device 100.
  • the secondary movement task 124 determines whether the nonvolatile memory 132 is in an idle state based on at least one of a usage pattern and a queue state of the nonvolatile memory 132, When the nonvolatile memory is in an idle state, at least one data determined to have a storage time equal to or greater than a threshold storage time may be controlled to move to the third area 230.
  • the secondary movement task 124 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to move to the third area 230 only when the nonvolatile memory is in an idle state.
  • the secondary movement task 124 uses patterns of the nonvolatile memory 132 indicating the number of writes and the number of reads of the nonvolatile memory 132 according to the operation of the electronic device 100 and Based on the current operation of the electronic device 100, it may be determined whether the nonvolatile memory 132 is in an idle state.
  • the usage pattern of the nonvolatile memory 132 may indicate that the number of reads is large for the operation of the electronic device 100 such as booting the electronic device 100 and executing an application that provides a streaming image. Also, the usage pattern of the nonvolatile memory 132 may indicate that the number of writes is large for the operation of the electronic device 100 such as application installation. However, the operation of the electronic device 100 is only an example, and a usage pattern of the nonvolatile memory 132 may be determined as an operation unit that can be performed by the electronic device 100.
  • the secondary movement task 124 determines whether the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number based on the usage pattern of the nonvolatile memory 132 , It is possible to determine the idle state of the nonvolatile memory 132.
  • the second movement task 124 corresponds to an operation in which the current operation of the electronic device 100 exceeds the threshold number of times based on the usage pattern of the nonvolatile memory 132
  • the movement of at least one data stored in the second region 220 determined as the storage time is greater than or equal to the threshold storage time may be suspended, and the current operation of the electronic device 100 may be performed based on the usage pattern of the nonvolatile memory 132.
  • the number of reads and the number of writes corresponds to an operation less than or equal to the threshold number, it is possible to control at least one data stored in the second area 220 determined as the storage time to be greater than or equal to the threshold storage time to move to the third area 230. have.
  • the secondary moving task 124 compares the number of reads and writes indicated by the queue state of the non-volatile memory 132, that is, the I / O queue state, with the threshold number to determine whether the non-volatile memory 132 is idle. I can judge.
  • the secondary movement task 124 when the number of reads and writes of the nonvolatile memory 132 corresponds to an operation exceeding a threshold number of times based on the queue state of the nonvolatile memory 132, the storage time The movement of at least one data stored in the second area 220 determined to be greater than or equal to the threshold storage time may be withheld, and the number of reads and writes of the nonvolatile memory 132 based on the queue state of the nonvolatile memory 132 When the number of times corresponds to an operation of less than or equal to the threshold number of times, it may be controlled to move at least one data stored in the second area 220 determined as the storage time is greater than or equal to the threshold storage time to the third area 230.
  • the secondary movement task 124 may set the determined at least one data to a preset threshold size. It can be divided into the following sizes and controlled to sequentially move the divided data to the third region 230.
  • the secondary movement task 124 may control the divided data to move to the third region 230 based on a preset time interval.
  • the secondary movement task 124 may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory 132. That is, the secondary move task 124 determines the number of reads and writes of the nonvolatile memory 132 based on at least one of the usage pattern and the queue state of the nonvolatile memory 132, and determines the number of reads and writes. Based on this, the threshold size limiting the amount of data moving from the second area 220 to the third area 230 may be adjusted.
  • FIG. 6 is a flowchart illustrating a case of determining data to be moved to the third area 230 on the nonvolatile memory 132 in the control method of the electronic device 100 according to an embodiment of the present invention.
  • the processor 120 of the electronic device 100 may select data satisfying a preset condition from among data in the first area 210 (operation 610).
  • the processor 120 uses the primary movement task 123 to set a preset condition among data in the first region 210. Satisfactory data can be selected.
  • the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
  • the processor 120 may select a page that has not been used for the longest time among the pages of the first area 210 and may move data of the selected page to the second area 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
  • the processor 120 may select a page corresponding to a preset application from among the pages of the first area 210 and move data of the selected page to the second area 220.
  • the processor 120 of the electronic device 100 may allocate attribute information 400 to each of the selected data (operation 620). Also, the processor 120 of the electronic device 100 according to an embodiment may control to move the selected data to the second region 220 (630). That is, the processor 120 may allocate attribute information 400 to each data moved from the first region 210 to the second region 220.
  • the attribute information 400 includes information 410 on the storage time of the data to which the attribute information 400 is assigned to the second area 220, information 420 on the data type, and a corresponding application. It may include at least one of information (application Id) 430 and information 440 for memory setting.
  • the processor 120 of the electronic device 100 may include a second area (based on at least one of a storage time of each data stored in the second area 220 and a possibility of moving to the first area 210. Whether to activate the secondary swap function for moving the data of 220) to the third region 230 may be determined.
  • the processor 120 identifies the data stored in the second area 220 for each application, and the storage time in the second area 220 of each of the identified data and the possibility of movement to the first area 210 Based on at least one of the data, it is possible to determine at least one data among the data stored in the second area 220 and determine whether to control the determined at least one data to be moved to the third area 230.
  • the processor 120 of the electronic device 100 may determine the possibility of movement of the data in the second region 220 to the first region 210 based on the attribute information 400. Yes (640).
  • the processor 120 of the electronic device 100 may determine a threshold storage time of each data in the second region 220 in proportion to the mobility of the first region 210 (650) ). That is, the processor 120 sets a critical storage time for data having a high probability of moving to the first region 210 as compared to data having a low probability of moving to the first region 210 according to execution of the application, Data having a high probability of movement to the first region 210 may be stored in the second region 220 for a longer time than data having a low probability of movement to the first region 210.
  • the processor 120 of the electronic device 100 may move to the first area 210 based on the possibility of movement of the data stored in the second area 220 to the first area 210. At least one data, which is expected to move, may be prevented from moving to the third area 230 on the nonvolatile memory.
  • the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
  • the processor 120 is based on at least one of a storage time in the second area 220 of each data stored in the second area 220 and a possibility of moving to the first area 210.
  • Each data stored in the second region 220 may be controlled to move to the third region 230 or may be controlled not to move to the third region 230.
  • the secondary movement task 124 of the processor 120 may determine the possibility of movement of the data stored in the second region 220 to the first region 210.
  • the processor 120 may be proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second region 220. It is possible to determine the possibility of movement of the data stored in 220 to the first region 210.
  • the processor 120 compares at least one of a page fault ratio, an execution frequency, and CPU usage time of an application corresponding to each data stored in the second area 220 with a corresponding threshold, and the threshold If the value is greater than or equal to the value, it is determined that the probability that the corresponding application will be executed again is high, and it is determined that the data of the corresponding application is highly likely to move to the first region 210. In this case, the greater the difference from the threshold, the higher the probability of movement to the first region 210.
  • the processor 120 may determine at least one of the page fault rate, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 based on the information 430 about the application, , By comparing at least one of the page fault rate, the execution frequency, and the CPU usage time with respective threshold values corresponding to the reference mobility to the first area 210, it is possible to determine the critical storage time of data corresponding to the application. have.
  • the processor 120 may move data stored in the second region 220 corresponding to the application to the first region 210 based on at least one of the application page fault rate, execution frequency, and CPU usage time.
  • the critical storage time is determined to be shorter than the reference threshold storage time to move the corresponding data to the third area 230 more quickly.
  • the critical storage time is determined to be longer than the reference threshold storage time to control the corresponding data to be stored in the second area 220 longer. Can be.
  • the processor 120 is stored in the second region 220 based on a foreground state or a background state of an application corresponding to each data stored in the second area 220. Each data may be moved to the first area 210.
  • the secondary movement task 124 determines that the probability that the data stored in the corresponding second region 220 moves to the first region 210 is greater than or equal to the critical movement probability. Data stored in the second region 220 may be prevented from moving to the third region 230.
  • the secondary movement task 124 determines that the data stored in the corresponding second region 220 is moved to the first region 210 as a reference mobility or less.
  • the corresponding threshold storage time may be determined as or less than the reference threshold storage time to control the data stored in the corresponding second area 220 to move to the third area 230 more quickly.
  • the processor 120 may include information about a relationship between a preset application and a possibility of moving to the first area 210 and a corresponding application of each data stored in the second area 220. Based on the information 430, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
  • the information on the relationship between the preset application and the possibility of movement to the first area 210 may include a list of applications that are set to have the possibility of movement to the first area 210 to be greater than or equal to the critical mobility.
  • the processor 120 based on the information on the relationship between the preset application and the possibility of moving to the first area 210, the data of the second area 220 corresponding to the application included in the list of applications. It may be forbidden to move to the third region 230.
  • information on the relationship between the preset application and the possibility of moving to the first area 210 may include information about the possibility of moving to the first area 210 according to the priority of the application.
  • the information on the relationship between the preset application and the mobility to the first area 210 may indicate that the mobility of the application with the reference priority or higher to the first area 210 is greater than or equal to the critical mobility.
  • the processor 120 determines the priority of the corresponding application of each of the data stored in the second area 220 based on the information on the relationship between the preset application and the possibility of moving to the first area 210 and , It is determined that the possibility of movement of data corresponding to an application having a priority higher than or equal to the reference priority to the first region 210 is greater than or equal to the threshold mobility, and thus the movement of the data to the third region 230 can be prohibited have.
  • Information about the relationship between the preset application and the possibility of moving to the first area 210 may be set by a system administrator in the design stage, or may be set by a user. In addition, information on a relationship between a preset application and a possibility of moving to the first area 210 may be obtained from an external server.
  • the processor 120 may include information about a relationship between a preset data type and a possibility of moving to the first area 210 and data types of each data stored in the second area 220. Based on the information, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
  • the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type.
  • the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
  • the processor 120 may determine the mobility of each of the data stored in the second area 220 based on the information on the relationship between the preset data type and the mobility to the first area 210, and the data A threshold storage time may be determined based on each mobility possibility, or movement to the third area 230 may be prohibited.
  • the processor 120 may move the data stored in the second area 220 to the first area 210 based on the memory setting of each data stored in the second area 220. Can decide.
  • the processor 120 includes information on a relationship between a preset memory setting and a possibility of moving to the first area 210 and information 440 on each memory setting of data stored in the second area 220. Based on this, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
  • information on the relationship between the preset memory setting and the possibility of moving to the first area 210 may indicate the possibility of moving to the first area 210 according to the memory setting.
  • the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory.
  • the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
  • the processor 120 may set the memory setting from the second area 220 to the first area 210 based on information on a relationship between a preset memory setting and a possibility of moving to the first area 210. For data indicating that there is a possibility of moving to, the movement to the third region 230 is prohibited, and the memory setting is set to data indicating that there is no possibility of movement from the second region 220 to the first region 210. The movement to the third region 230 may be performed.
  • the processor 120 immediately determines whether data corresponding to the memory setting has no possibility of moving from the second area 220 to the first area 210 without comparing the threshold storage time. It can be controlled to move to the third region 230. That is, the processor 120 may determine the threshold storage time corresponding to the corresponding data as '0' for data indicating that the memory setting has no possibility of moving from the second area 220 to the first area 210. .
  • the processor 120 of the electronic device 100 may check the storage time in the second region 220 for the data in the second region 220 based on the attribute information 400. (660). That is, the processor 120 stores the data stored in the second region 220 in the second region 220 based on the information 410 on the storage time in the second region on the attribute information 400. can confirm.
  • the processor 120 of the electronic device 100 may determine at least one data whose storage time in the second region 220 is greater than or equal to a corresponding threshold storage time (670). That is, the processor 120 may determine at least one data among the data stored in the second area 220, the storage time in the second area 220 being equal to or greater than a corresponding threshold storage time.
  • the processor 120 of the electronic device 100 may move the determined at least one data to the third region 230 (680). That is, the processor 120 determines at least one data of which the storage time in the second area 220 is greater than or equal to a threshold storage time among the data stored in the second area 220, and the at least one data is again in the first area Since the probability of moving to 210 is small, the available capacity of the second region 220 can be secured by moving the at least one data to the third region 230.
  • FIG. 7 is a flowchart illustrating a case in which data is moved to the third area 230 on the nonvolatile memory 132 in the control method of the electronic device 100 according to an embodiment of the present invention.
  • the processor 120 of the electronic device 100 may determine at least one data in which the storage time in the second region 220 is greater than or equal to the threshold storage time (710).
  • the processor 120 of the electronic device 100 sets the determined at least one data to a preset threshold size or less. It can be divided (730).
  • the processor 120 divides the determined at least one data into a size equal to or less than the preset threshold size, and the divided data is sequentially As a result, it may be controlled to move to the third region 230.
  • the determined at least one data may be controlled to move to the third area 230 without division.
  • the processor 120 may set data corresponding to any one application to be less than or equal to the preset threshold size It may be divided into the size of, and control the divided data to be sequentially moved to the third region 230 of the non-volatile memory.
  • the processor 120 of the electronic device 100 may determine whether the nonvolatile memory 132 is in an idle state based on at least one of a usage pattern and a queue state (740).
  • the processor 120 of the electronic device 100 may move data to the third region 230 when the nonvolatile memory 132 is in an idle state (YES in 750) (760). ).
  • the processor 120 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to be moved to the third area 230 only when the nonvolatile memory 132 is in an idle state.
  • the processor 120 determines the idle state of the non-volatile memory 132 continuously or in a predetermined time unit based on the usage pattern and the queue state can do.
  • the processor 120 uses the usage pattern and the electronic device of the nonvolatile memory 132 indicating the number of writes and the number of reads of the nonvolatile memory 132 according to the operation of the electronic device 100 ( Based on the current operation of 100), it may be determined whether the nonvolatile memory 132 is in an idle state.
  • the processor 120 determines whether the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number based on the usage pattern of the nonvolatile memory 132, and is nonvolatile
  • the idle state of the memory 132 may be determined.
  • the processor 120 when the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number of times based on the usage pattern of the nonvolatile memory 132, the processor 120 has a storage time. The movement of at least one data stored in the second region 220 determined to be greater than or equal to the threshold storage time may be withheld, and the current operation of the electronic device 100 may be read and read based on the usage pattern of the nonvolatile memory 132. When the number of writes corresponds to an operation less than or equal to the threshold number of times, it may be controlled to move at least one data stored in the second area 220 determined as the storage time is greater than or equal to the threshold storage time to the third area 230.
  • the processor 120 may determine whether the nonvolatile memory 132 is in an idle state by comparing the number of reads and writes indicated by the queue state of the nonvolatile memory 132, that is, the I / O queue state with a threshold number of times. have.
  • the processor 120 stores the storage time as a threshold.
  • the movement of at least one data stored in the second area 220 determined to be longer than time may be withheld, and the number of reads and writes of the nonvolatile memory 132 is critical based on the queue state of the nonvolatile memory 132.
  • the threshold storage time may be controlled to move to the third region 230.
  • the data controlled to move to the third area 230 may correspond to the divided data, and the processor 120 according to an embodiment may cause the divided data to sequentially move to the third area 230. Can be controlled.
  • the processor 120 of the electronic device 100 may determine whether all of the determined at least one data has moved to the third area 230, and the processor ( 120), if all of the determined at least one data is not moved to the third area 230 (No at 770), the idle state of the nonvolatile memory is determined to continuously move the divided data to the third area 230 I can do it. Thereafter, the processor 120 may end the procedure when all of the determined at least one data moves to the third area 230 (YES in 770).
  • the secondary movement task 124 may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory 132. That is, the secondary move task 124 determines the number of reads and writes of the nonvolatile memory 132 based on at least one of the usage pattern and the queue state of the nonvolatile memory 132, and determines the number of reads and writes. Based on this, the threshold size limiting the amount of data moving from the second area 220 to the third area 230 may be adjusted.
  • the disclosed embodiments may be implemented in the form of a recording medium that stores instructions executable by a computer. Instructions may be stored in the form of program code, and when executed by a processor, may generate program modules to perform operations of the disclosed embodiments.
  • the recording medium may be embodied as a computer-readable recording medium.
  • the computer-readable recording medium includes all kinds of recording media storing instructions that can be read by a computer.
  • a computer for example, there may be a read only memory (ROM), a random access memory (RAM), a magnetic tape, a magnetic disk, a flash memory, and an optical data storage device.
  • ROM read only memory
  • RAM random access memory
  • magnetic tape a magnetic tape
  • magnetic disk a magnetic disk
  • flash memory a flash memory
  • optical data storage device optical data storage device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Memory System (AREA)

Abstract

Provided are an electronic apparatus and a controlling method thereof, wherein the electronic apparatus may improve a processing speed of a device by using, as a swap area, an area of a volatile memory and an area of a non-volatile memory and moving, on the basis of a storage time, data stored in the area of the volatile memory used as the swap area to the area of the non-volatile memory used as the swap area. The electronic apparatus according to an embodiment comprises: a volatile memory; a non-volatile memory; and a processor for controlling, when an available capacity of a first area of the volatile memory is less than a threshold capacity, at least one piece of data of the first area to be moved to a second area of the volatile memory, and determining whether or not to control the data stored in the second area to be moved to the non-volatile memory, on the basis of at least one of a storage time, in the second area, of data stored in the second area and a possibility to move to the first area.

Description

전자 장치 및 그 제어방법Electronic device and control method thereof
본 발명은 장치 내 마련된 메모리를 관리하는 전자 장치 및 그 제어방법에 관한 것이다.The present invention relates to an electronic device managing a memory provided in the device and a control method thereof.
스마트 TV, 또는 서버 등과 같은 전자 장치의 운영체제는 어플리케이션을 실행하기 위해, CPU(central processing unit), 휘발성 메모리(volatile memory), 또는 비휘발성 메모리(non-volatile memory)와 같은 컴퓨팅 리소스를 어플리케이션에 할당한다.The operating system of an electronic device, such as a smart TV or a server, allocates computing resources such as a central processing unit (CPU), volatile memory, or non-volatile memory to an application to execute an application. do.
운영체제는 온 디맨드(on-demand) 메모리 할당 방식을 지원함으로써, 전자 장치의 주기억 장치로 이용되는 휘발성 메모리의 영역 이외의 영역을 어플리케이션에 할당할 수 있다. 예컨대, 운영체제는 전자 장치에서 주기억 장치의 메모리 영역이 부족한 경우, 어플리케이션에 기 할당된 메모리 영역의 데이터를 보조 기억 장치로 이용되는 비휘발성 메모리의 스왑(swap) 영역으로 이동시킴으로써, 메모리 부족 현상을 해소할 수 있다.The operating system supports an on-demand memory allocation method, so that an area other than the volatile memory area used as the main memory of the electronic device can be allocated to the application. For example, when the memory area of the main memory device in the electronic device is insufficient, the operating system solves the memory shortage phenomenon by moving the data of the memory area pre-allocated to the application to a swap area of the nonvolatile memory used as the auxiliary storage device. can do.
휘발성 메모리의 영역 및 비휘발성 메모리의 영역을 스왑(swap) 영역으로 이용하고, 스왑 영역으로 이용되는 휘발성 메모리의 영역에 저장된 데이터를 저장 시간에 기초하여 스왑 영역으로 이용되는 비휘발성 메모리의 영역에 이동시킴으로써, 장치의 처리 속도를 향상시킬 수 있는 전자 장치 및 그 제어방법을 제공한다.The area of the volatile memory and the area of the nonvolatile memory are used as a swap area, and data stored in the area of the volatile memory used as the swap area is moved to the area of the nonvolatile memory used as the swap area based on the storage time. By providing an electronic device capable of improving the processing speed of the device and a control method thereof.
일 실시예에 따른 전자 장치는, 휘발성 메모리; 비휘발성 메모리; 및 상기 휘발성 메모리의 제1 영역의 가용 용량이 임계 용량보다 작은 경우, 상기 제1 영역의 적어도 하나의 데이터가 상기 휘발성 메모리의 제2 영역으로 이동하도록 제어하고, 상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정하는 프로세서;를 포함한다.An electronic device according to an embodiment includes a volatile memory; Non-volatile memory; And when the usable capacity of the first area of the volatile memory is less than a threshold capacity, control at least one data in the first area to move to the second area of the volatile memory, and the data of the data stored in the second area is And a processor for determining whether to control data stored in the second area to be moved to the non-volatile memory based on at least one of a storage time in the second area and a possibility to move to the first area.
상기 프로세서는, 상기 제1 영역에서 상기 제2 영역으로 이동하는 데이터 각각에 상기 제2 영역에의 저장 시점에 대한 정보, 데이터 유형에 대한 정보, 대응하는 어플리케이션에 대한 정보 및 메모리 설정에 대한 정보 중 적어도 하나를 포함하는 속성 정보를 할당할 수 있다.The processor may include information on a storage time in the second area, information on a data type, information on a corresponding application, and information on a memory setting for each data moving from the first area to the second area. Property information including at least one may be assigned.
상기 프로세서는, 상기 속성 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하고, 상기 제1 영역으로의 이동 가능성에 비례하도록 상기 제2 영역에 저장된 데이터의 임계 저장 시간을 결정할 수 있다.The processor determines the probability of movement of data stored in the second region to the first region based on the attribute information, and thresholds the data stored in the second region to be proportional to the probability of movement to the first region The storage time can be determined.
상기 프로세서는, 상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간이 상기 결정된 임계 저장 시간 이상인 경우, 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하도록 제어할 수 있다.The processor may control data stored in the second region to be moved to the nonvolatile memory when the storage time in the second region of the data stored in the second region is equal to or greater than the determined threshold storage time.
상기 프로세서는, 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성에 기초하여, 상기 제1 영역으로의 이동이 예상되는 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하는 것을 금지할 수 있다.The processor is configured to move data stored in the second region, which is expected to move to the first region, to the nonvolatile memory based on the possibility of moving data stored in the second region to the first region. It can be banned.
상기 프로세서는, 상기 제2 영역에 저장된 데이터에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU(central processing unit) 사용시간 중 적어도 하나에 비례하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정할 수 있다.The processor may store data stored in the second area in proportion to at least one of a page fault ratio, an execution frequency, and a central processing unit (CPU) usage time of an application corresponding to data stored in the second area. The possibility of movement to the first region may be determined.
상기 프로세서는, 상기 제2 영역에 저장된 데이터에 대응하는 어플리케이션의 전경(foreground) 상태 또는 배경(background) 상태에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정할 수 있다.The processor may determine the possibility of movement of data stored in the second area to the first area based on a foreground state or a background state of an application corresponding to data stored in the second area. .
상기 프로세서는, 미리 설정된 어플리케이션과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 대응하는 어플리케이션에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정할 수 있다.The processor, based on information on a relationship between a preset application and a possibility of movement to the first area and information on a corresponding application of data stored in the second area, the processor may perform the first processing of data stored in the second area. The possibility of movement to one area can be determined.
상기 프로세서는, 미리 설정된 데이터 유형과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 데이터 유형에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정할 수 있다.The processor, based on information on a relationship between a preset data type and the likelihood of movement to the first area and information on a data type of data stored in the second area, the processor performs the first processing of the data stored in the second area. The possibility of movement to one area can be determined.
상기 프로세서는, 미리 설정된 메모리 설정과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 메모리 설정에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정할 수 있다.The processor, based on information on a relationship between a preset memory setting and a possibility of moving to the first area and information on a memory setting of data stored in the second area, the processor may perform the first processing of data stored in the second area. The possibility of movement to one area can be determined.
상기 프로세서는, 상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어하는 경우, 상기 비휘발성 메모리의 사용 패턴 및 큐(queue) 상태 중 적어도 하나에 기초하여 상기 비휘발성 메모리의 유휴 상태 여부를 판단하고, 상기 비휘발성 메모리가 유휴 상태인 경우, 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하도록 제어할 수 있다.When the processor controls to move data stored in the second area to the nonvolatile memory, whether the nonvolatile memory is idle based on at least one of a usage pattern and a queue state of the nonvolatile memory When the non-volatile memory is idle, it is possible to control data stored in the second area to be moved to the non-volatile memory.
상기 프로세서는, 상기 전자 장치의 동작에 따른 상기 비휘발성 메모리의 읽기(write) 횟수 및 쓰기(read) 횟수를 나타내는 상기 비휘발성 메모리의 사용 패턴 및 상기 전자 장치의 현재 동작에 기초하여 상기 비휘발성 메모리의 유휴 상태 여부를 판단할 수 있다.The processor is based on the usage pattern of the non-volatile memory indicating the number of writes and the number of reads of the non-volatile memory according to the operation of the electronic device and the current operation of the electronic device. It can be determined whether the idle state.
상기 프로세서는, 상기 제2 영역에 저장된 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 상기 제2 영역에 저장된 데이터를 상기 미리 설정된 임계 크기 이하의 크기로 분할하고, 상기 분할된 데이터가 순차적으로 상기 비휘발성 메모리로 이동하도록 제어할 수 있다.When the total data size of the data stored in the second area is greater than or equal to a preset threshold size, the processor divides the data stored in the second area into a size equal to or less than the preset threshold size, and the divided data is sequentially It can be controlled to move to the non-volatile memory.
상기 프로세서는, 상기 제2 영역에 저장된 데이터를 대응하는 어플리케이션 별로 식별하고, 상기 식별된 데이터 각각의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 상기 결정된 적어도 하나의 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정할 수 있다.The processor identifies the data stored in the second area for each application, and based on at least one of a storage time of the identified data in the second area and a possibility of moving to the first area. It is possible to determine at least one data among data stored in the two areas, and to determine whether to control the determined at least one data to be moved to the nonvolatile memory.
휘발성 메모리 및 비휘발성 메모리를 포함하는 일 실시예에 따른 전자 장치의 제어방법은, 상기 휘발성 메모리의 제1 영역의 가용 용량이 임계 용량보다 작은 경우, 상기 제1 영역의 적어도 하나의 데이터가 상기 휘발성 메모리의 제2 영역으로 이동하도록 제어하고; 상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정하는 것;을 포함할 수 있다.In a method of controlling an electronic device according to an embodiment including a volatile memory and a nonvolatile memory, when the available capacity of the first area of the volatile memory is less than a threshold capacity, at least one data in the first area is volatile Control to move to a second area of memory; Whether to control the data stored in the second area to be moved to the non-volatile memory based on at least one of the storage time in the second area and the possibility of movement to the first area of the data stored in the second area. Deciding; may include.
스왑 영역으로 이용되는 휘발성 메모리의 영역에 저장된 데이터를 저장 시간에 기초하여 스왑 영역으로 이용되는 비휘발성 메모리의 영역에 이동시킴으로써, 스왑 영역으로 이용되는 휘발성 메모리의 영역에 대한 부족을 사전에 방지할 수 있으며, 이에 따라 전자 장치의 처리 속도를 향상시킬 수 있다.By moving data stored in the area of the volatile memory used as the swap area to the area of the non-volatile memory used as the swap area based on the storage time, a shortage of the area of the volatile memory used as the swap area can be prevented in advance. Accordingly, the processing speed of the electronic device can be improved.
도 1은 본 발명의 일 실시예에 따른 전자 장치를 포함하는 네트워크 환경을 도시한다.1 illustrates a network environment including an electronic device according to an embodiment of the present invention.
도 2는 본 발명의 일 실시예에 따른 휘발성 메모리 및 비휘발성 메모리를 포함하는 전자 장치의 블록도를 도시한다.2 is a block diagram of an electronic device including a volatile memory and a nonvolatile memory according to an embodiment of the present invention.
도 3은 본 발명의 일 실시예에 따른 전자 장치의 2단계 스왑(swap) 동작을 도시한다.3 illustrates a two-step swap operation of an electronic device according to an embodiment of the present invention.
도 4는 본 발명의 일 실시예에 따른 전자 장치가 데이터에 할당하는 속성 정보를 나타내는 도면이다.4 is a diagram illustrating attribute information allocated to data by an electronic device according to an embodiment of the present invention.
도 5는 본 발명의 일 실시예에 따른 전자 장치가 2차 스왑을 제어하는 경우를 나타내는 도면이다.5 is a diagram illustrating a case in which an electronic device controls secondary swap according to an embodiment of the present invention.
도 6은 본 발명의 일 실시예에 따른 전자 장치의 제어방법에 있어서, 비휘발성 메모리 상의 제3 영역으로 이동시킬 데이터를 결정하는 경우에 관한 순서도이다.6 is a flowchart illustrating a case of determining data to be moved to a third area on a nonvolatile memory in a method of controlling an electronic device according to an embodiment of the present invention.
도 7은 본 발명의 일 실시예에 따른 전자 장치의 제어방법에 있어서, 데이터를 비휘발성 메모리 상의 제3 영역으로 이동시키는 경우에 관한 순서도이다.7 is a flowchart illustrating a case in which data is moved to a third area on a nonvolatile memory in a control method of an electronic device according to an embodiment of the present invention.
본 명세서에 기재된 실시예와 도면에 도시된 구성은 개시된 발명의 바람직한 일 예에 불과할 뿐이며, 본 출원의 출원시점에 있어서 본 명세서의 실시예와 도면을 대체할 수 있는 다양한 변형 예들이 있을 수 있다.The configuration shown in the embodiments and drawings described in this specification is only a preferred example of the disclosed invention, and at the time of filing of the present application, there may be various modifications that can replace the embodiments and drawings of the present specification.
본 명세서 전체에서, 어떤 부분이 다른 부분과 "연결"되어 있다고 할 때, 이는 직접적으로 연결되어 있는 경우뿐 아니라, 간접적으로 연결되어 있는 경우를 포함하고, 간접적인 연결은 무선 통신망을 통해 연결되는 것을 포함한다.Throughout this specification, when a part is "connected" to another part, this includes not only a case of being directly connected but also a case of being connected indirectly, and indirect connection is connected through a wireless communication network. Includes.
또한, 본 명세서에서 사용한 용어는 실시예를 설명하기 위해 사용된 것으로, 개시된 발명을 제한 및/또는 한정하려는 의도가 아니다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 명세서상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는다.In addition, the terms used in this specification are used to describe examples, and are not intended to limit and / or limit the disclosed invention. Singular expressions include plural expressions unless the context clearly indicates otherwise. In this specification, terms such as “include” or “have” are intended to indicate that a feature, number, step, operation, component, part, or combination thereof described in the specification exists, and that one or more other features are present. It does not preclude the existence or addition possibility of fields or numbers, steps, operations, components, parts or combinations thereof.
또한, 본 명세서에서 사용한 “제1”, “제2” 등과 같이 서수를 포함하는 용어는 다양한 구성요소들을 설명하는데 사용될 수 있지만, 상기 구성요소들은 상기 용어들에 의해 한정되지는 않으며, 상기 용어들은 하나의 구성요소를 다른 구성요소로부터 구별하는 목적으로만 사용된다. 예를 들어, 본 발명의 권리 범위를 벗어나지 않으면서 제1 구성요소는 제2 구성요소로 명명될 수 있고, 유사하게 제2 구성요소도 제1 구성요소로 명명될 수 있다.In addition, terms including an ordinal number such as “first”, “second”, and the like used herein may be used to describe various components, but the components are not limited by the terms, and the terms It is used only for the purpose of distinguishing one component from other components. For example, the first component may be referred to as a second component without departing from the scope of the present invention, and similarly, the second component may be referred to as a first component.
또한, "~부", "~기", "~블록", "~부재", "~모듈" 등의 용어는 적어도 하나의 기능이나 동작을 처리하는 단위를 의미할 수 있다. 예를 들어, 상기 용어들은 FPGA(field-programmable gate array)/ASIC(application specific integrated circuit) 등 적어도 하나의 하드웨어, 메모리에 저장된 적어도 하나의 소프트웨어 또는 프로세서에 의하여 처리되는 적어도 하나의 프로세스를 의미할 수 있다.In addition, terms such as "~ unit", "~ group", "~ block", "~ member", and "~ module" may refer to a unit that processes at least one function or operation. For example, the terms may mean at least one process processed by at least one hardware, at least one software or processor stored in memory, such as a field-programmable gate array (FPGA) / application specific integrated circuit (ASIC). have.
각 단계들에 붙여지는 부호는 각 단계들을 식별하기 위해 사용되는 것으로 이들 부호는 각 단계들 상호 간의 순서를 나타내는 것이 아니며, 각 단계들은 문맥상 명백하게 특정 순서를 기재하지 않는 이상 명기된 순서와 다르게 실시될 수 있다.The signs attached to the steps are used to identify the steps, and these signs do not indicate the order of each step, and the steps are performed differently from the order specified unless a specific order is clearly stated in the context. Can be.
이하에서는 본 발명에 따른 실시예를 첨부된 도면을 참조하여 상세히 설명한다.Hereinafter, embodiments according to the present invention will be described in detail with reference to the accompanying drawings.
도 1은 본 발명의 일 실시예에 따른 전자 장치(100)를 포함하는 네트워크 환경(10)을 도시한다.1 shows a network environment 10 including an electronic device 100 according to an embodiment of the present invention.
도 1을 참조하면, 전자 장치(100)는 버스(110), 프로세서(120), 메모리(130), 입출력 인터페이스(150), 디스플레이(160) 및 통신 인터페이스(170)를 포함할 수 있다. 본 발명의 다양한 실시예에 따르면, 전자 장치(100)는, 상술한 구성요소들 중 적어도 하나를 생략하거나 다른 구성 요소를 추가적으로 구비할 수 있다.Referring to FIG. 1, the electronic device 100 may include a bus 110, a processor 120, a memory 130, an input / output interface 150, a display 160, and a communication interface 170. According to various embodiments of the present disclosure, the electronic device 100 may omit at least one of the above-described components or additionally include other components.
본 발명의 다양한 실시예들에 따른 전자 장치(100)는, 예를 들면, 스마트폰(smartphone), 태블릿 PC(tablet personal computer), 이동 전화기(mobile phone), 영상 전화기, 전자책 리더기(e-book reader), 데스크탑 PC(desktop personal computer), 랩탑 PC(laptop personal computer), 넷북 컴퓨터(netbook computer), 워크스테이션(workstation), 서버, PDA(personal digital assistant), PMP(portable multimedia player), MP3 플레이어, 모바일 의료기기, 카메라(camera), 또는 웨어러블 장치(wearable device) 중 적어도 하나를 포함할 수 있다. 다양한 실시예에 따르면, 웨어러블 장치는 액세서리형(예: 시계, 반지, 팔찌, 발찌, 목걸이, 안경, 콘택트 렌즈, 또는 머리 착용형 장치(head-mounted-device, HMD)), 직물 또는 의류 일체형(예: 전자 의복), 신체 부착형(예: 스킨 패드(skin pad) 또는 문신), 또는 생체 이식형(예: implantable circuit) 중 적어도 하나를 포함할 수 있다.The electronic device 100 according to various embodiments of the present invention includes, for example, a smart phone, a tablet personal computer (PC), a mobile phone, a video phone, and an e-book reader (e- book reader), desktop personal computer (PC), laptop personal computer (PC), netbook computer, workstation, server, personal digital assistant (PDA), portable multimedia player (PMP), MP3 It may include at least one of a player, a mobile medical device, a camera, or a wearable device. According to various embodiments, the wearable device may be an accessory type (for example, a watch, ring, bracelet, anklet, necklace, glasses, contact lens, or head-mounted device (HMD)), a fabric, or an integrated garment ( Examples may include at least one of an electronic garment), a body attachment type (eg, a skin pad or tattoo), or a bio-implantable type (eg, an implantable circuit).
어떤 실시예들에서, 전자 장치(100)는 가전 제품(home appliance)일 수 있다. 가전 제품은, 예를 들면, 텔레비전, 스마트 TV, DVD(digital video disk) 플레이어, 오디오, 냉장고, 에어컨, 청소기, 오븐, 전자레인지, 세탁기, 공기 청정기, 셋톱 박스(set-top box), 홈 오토매이션 컨트롤 패널(home automation control panel), 보안 컨트롤 패널(security control panel), TV 박스(예: 삼성 HomeSyncTM, 애플TVTM, 또는 구글 TVTM), 게임 콘솔(예: XboxTM, PlayStationTM), 전자 사전, 전자 키, 캠코더(camcorder), 또는 전자 액자 중 적어도 하나를 포함할 수 있다.In some embodiments, the electronic device 100 may be a home appliance. Household appliances include, for example, televisions, smart TVs, digital video disk (DVD) players, audio, refrigerators, air conditioners, vacuum cleaners, ovens, microwave ovens, washing machines, air cleaners, set-top boxes, home autos every Orientation control panel (home automation control panel), the security control panel (security control panel), TV box (for example, Samsung HomeSync TM, Apple TV TM, or Google TV TM), game consoles (for example: Xbox TM, PlayStation TM) , An electronic dictionary, an electronic key, a camcorder, or at least one of an electronic picture frame.
다른 실시예에서, 전자 장치(100)는, 각종 의료기기(예: 각종 휴대용 의료측정기기(혈당 측정기, 심박 측정기, 혈압 측정기, 혈류량 측정기, 심박 측정기, 심전도 측정기, 근전도 측정기, 또는 체온 측정기 등), MRA(magnetic resonance angiography), MRI(magnetic resonance imaging), CT(computed tomography), 촬영기, 또는 초음파기 등), 네비게이션(navigation) 장치, 위성 항법 시스템(global navigation satellite system, GNSS), EDR(event data recorder), FDR(flight data recorder), 자동차 인포테인먼트(infotainment) 장치, 선박용 전자 장비(예: 선박용 항법 장치, 자이로 콤파스 등), 항공 전자기기(avionics), 보안 기기, 차량용 헤드 유닛(head unit), 산업용 또는 가정용 로봇, 금융 기관의 ATM(automatic teller's machine), 상점의 POS(point of sales), 또는 사물 인터넷 장치(internet of things)(예: 전구, 각종 센서, 전기 또는 가스 미터기, 스프링클러 장치, 화재경보기, 온도조절기(thermostat), 가로등, 토스터(toaster), 운동기구, 온수탱크, 히터, 보일러 등) 중 적어도 하나를 포함할 수 있다.In another embodiment, the electronic device 100 includes various medical devices (for example, various portable medical measurement devices (blood glucose meter, heart rate monitor, blood pressure meter, blood flow meter, heart rate meter, ECG meter, EMG meter, or body temperature meter) , Magnetic resonance angiography (MRA), magnetic resonance imaging (MRI), computed tomography (CT), imaging, or ultrasound), navigation devices, global navigation satellite system (GNSS), event data (EDR) Recorder), FDR (flight data recorder), automotive infotainment devices, marine electronic equipment (e.g. marine navigation devices, gyro compasses, etc.), avionics, security devices, head units for vehicles, Industrial or household robots, financial teller's machines (ATMs) in financial institutions, point of sales (POS) in stores, or Internet of things (e.g. light bulbs, various sensors, electricity or gas meters, sprinkler devices, fires) It may include at least one of an alarm, a thermostat, a street light, a toaster, exercise equipment, a hot water tank, a heater, a boiler, and the like.
어떤 실시예에 따르면, 전자 장치(100)는 가구(furniture) 또는 건물/구조물의 일부, 전자 보드(electronic board), 전자 사인 수신 장치(electronic signature receiving device), 프로젝터(projector), 또는 각종 계측 기기(예: 수도, 전기, 가스, 또는 전파 계측 기기 등) 중 적어도 하나를 포함할 수 있다. 다양한 실시예에서, 전자 장치(100)는 전술한 다양한 장치들 중 하나 또는 그 이상의 조합일 수 있다.According to some embodiments, the electronic device 100 may be a furniture or a part of a building / structure, an electronic board, an electronic signature receiving device, a projector, or various measuring devices. (For example, water, electricity, gas, or radio wave measurement devices, etc.). In various embodiments, the electronic device 100 may be a combination of one or more of the various devices described above.
어떤 실시예에 따른 전자 장치(100)는 플렉서블 전자 장치일 수 있다. 또한, 본 발명의 일 실시예에 따른 전자 장치(100)는 전술한 기기들에 한정되지 않으며, 기술 발전에 따른 새로운 전자 장치를 포함할 수 있다.The electronic device 100 according to an embodiment may be a flexible electronic device. Further, the electronic device 100 according to an embodiment of the present invention is not limited to the aforementioned devices, and may include a new electronic device according to the development of technology.
본 발명에서, 사용자라는 용어는 전자 장치(100)를 사용하는 사람 또는 전자 장치(100)를 사용하는 장치(예: 인공지능 전자 장치)를 지칭할 수 있다.In the present invention, the term user may refer to a person using the electronic device 100 or a device using the electronic device 100 (eg, an artificial intelligence electronic device).
일 실시예에 따른 버스(110)는 상술한 구성요소들(예: 프로세서(120), 메모리(130), 입출력 인터페이스(150), 디스플레이(160) 또는 통신 인터페이스(170) 등)을 서로 연결하고, 상술한 구성요소들 간의 통신(예: 제어 메시지 및/또는 데이터)을 전달하는 회로일 수 있다.The bus 110 according to an embodiment connects the above-described components (eg, the processor 120, the memory 130, the input / output interface 150, the display 160, or the communication interface 170) to each other and , It may be a circuit for transmitting communication (for example, control messages and / or data) between the above-described components.
일 실시예에 따른 프로세서(120)는, 중앙처리전자 장치(central processing unit, CPU), 어플리케이션 프로세서(application processor, AP), 또는 커뮤니케이션 프로세서(communication processor, CP) 중 하나 또는 그 이상을 포함할 수 있다. 프로세서(120)는, 예를 들면, 전자 장치(100)의 적어도 하나의 다른 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 실행할 수 있다.The processor 120 according to an embodiment may include one or more of a central processing unit (CPU), an application processor (AP), or a communication processor (CP). have. The processor 120 may perform, for example, calculation or data processing related to control and / or communication of at least one other component of the electronic device 100.
일 실시예에 따른 프로세서(120)는 어플리케이션 실행에 의한 메모리 할당 요구를 감지하고, 메모리(130)의 일부 영역을 해당 어플리케이션에 할당할 수 있다. 프로세서(120)는, 예를 들면, 휘발성 메모리의 제1 영역 중 다른 어플리케이션에 할당되지 않은 영역을 실행이 요구된 어플리케이션에 할당할 수 있다. 일 실시예에 따른 제1 영역은 프로그램 실행을 위해 프로그램 및 프로그램의 실행 관련 데이터를 적어도 일시적으로 저장하도록 지정된 시스템 메모리 영역일 수 있다.The processor 120 according to an embodiment may detect a memory allocation request by executing an application and allocate a portion of the memory 130 to the corresponding application. The processor 120 may allocate, for example, an area not allocated to another application among the first areas of the volatile memory to an application requiring execution. The first area according to an embodiment may be a system memory area designated to at least temporarily store a program and execution related data of the program for program execution.
일 실시예에 따른 프로세서(120)는 메모리 할당 시, 제1 영역의 가용 용량을 기반으로 1차 스왑이 필요한지 여부를 결정할 수 있다. 프로세서(120)는, 예를 들면, 제1 영역의 사용 가능한 가용 용량을 미리 설정된 임계 용량과 비교하고, 비교 결과에 따라 1차 스왑이 필요한지 여부를 결정할 수 있다.When allocating memory, the processor 120 according to an embodiment may determine whether primary swap is required based on the available capacity of the first area. The processor 120 may compare usable usable capacity of the first area with a preset threshold capacity, and determine whether primary swap is required according to the comparison result.
1차 스왑은 메모리(130) 내 휘발성 메모리의 제1 영역에 적어도 일시적으로 저장된 데이터를 휘발성 메모리의 제 2 영역으로 이동시켜 저장하는 것을 의미한다. 다른 예로, 1차 스왑은 메모리(130) 내 휘발성 메모리의 제1 영역에 적어도 일시적으로 저장된 데이터를 휘발성 메모리의 제2 영역에 복사하고, 제1 영역에 대한 메모리 할당을 해제하는 것을 의미할 수 있다.The primary swap means that data stored at least temporarily in the first area of the volatile memory in the memory 130 is moved to and stored in the second area of the volatile memory. As another example, the primary swap may mean copying data stored at least temporarily in the first area of the volatile memory in the memory 130 to the second area of the volatile memory and freeing memory allocation for the first area. .
일 실시예에 따른 제2 영역은 시스템 메모리 영역인 제1 영역이 부족할 경우, 제1 영역의 가용 용량을 확보하기 위해 적어도 일시적으로 이용되지 않을 것으로 예상되는 프로그램 및 프로그램의 실행 관련 데이터를 저장하도록 지정된 1차 스왑 영역일 수 있다.The second area according to an embodiment is designated to store programs related to execution of the program and programs that are not expected to be used at least temporarily to secure the usable capacity of the first area when the first area, which is the system memory area, is insufficient. It may be the primary swap area.
일 실시예에 따른 제2 영역에 저장된 데이터는 압축된 데이터일 수 있다. 예를 들어, 제2 영역은 페이지 단위의 데이터가 압축되어 저장되는 압축된 메모리 풀일 수 있다. 제2 영역의 크기는 고정될 수도 있고, 가변될 수도 있다.The data stored in the second area according to an embodiment may be compressed data. For example, the second area may be a compressed memory pool in which page-level data is compressed and stored. The size of the second region may be fixed or variable.
프로세서(120)는 제1 영역의 가용 용량이 임계 용량보다 작은 경우, 1차 스왑이 필요한 것으로 결정할 수 있다. 1차 스왑이 필요한 경우, 프로세서(120)는 휘발성 메모리의 제1 영역에 적어도 일시적으로 저장된 적어도 하나의 페이지 데이터를 압축한 후, 압축된 데이터를 휘발성 메모리의 제2 영역으로 이동시킬 수 있다.When the available capacity of the first region is less than the threshold capacity, the processor 120 may determine that primary swap is required. When primary swap is required, the processor 120 may compress at least one page data temporarily stored in the first area of the volatile memory, and then move the compressed data to the second area of the volatile memory.
이 때, 프로세서(120)는 휘발성 메모리의 제1 영역의 데이터 중 미리 설정된 조건을 만족하는 데이터를 선택하고, 선택된 데이터 각각에 속성 정보를 할당하여 휘발성 메모리의 제2 영역으로 이동시킬 수 있다.At this time, the processor 120 may select data that satisfies a preset condition among data in the first region of the volatile memory, and assign attribute information to each of the selected data to move to the second region of the volatile memory.
구체적으로, 프로세서(120)는 1차 스왑을 위해 제1 영역의 데이터들 중에서 가장 오랫동안 사용되지 않은 적어도 하나의 페이지 데이터를 선택할 수 있다. 프로세서(120)는 제1 영역에서 선택된 적어도 하나의 페이지 데이터를 압축하고, 압축된 데이터가 제2 영역에 이동되도록 처리할 수 있다.Specifically, the processor 120 may select at least one page data that has not been used for the longest time among the data in the first area for primary swap. The processor 120 compresses at least one page data selected in the first area, and processes the compressed data to be moved to the second area.
또한, 프로세서(120)는 1차 스왑을 위해 제1 영역의 데이터들 중에서 미리 설정된 어플리케이션에 대응하는 페이지 데이터를 선택할 수 있다. 프로세서(120)는 제1 영역에서 선택된 적어도 하나의 페이지 데이터를 압축하고, 압축된 데이터가 제2 영역에 이동되도록 처리할 수 있다.Also, the processor 120 may select page data corresponding to a preset application from among data in the first area for primary swap. The processor 120 compresses at least one page data selected in the first area, and processes the compressed data to be moved to the second area.
이 때, 속성 정보는, 속성 정보가 할당된 데이터의 제2 영역에의 저장 시점에 대한 정보, 데이터 유형에 대한 정보, 대응하는 어플리케이션에 대한 정보 및 메모리 설정에 대한 정보 중 적어도 하나를 포함할 수 있다. 제2 영역으로 이동하는 데이터에 할당된 속성 정보는 제2 영역에서 비휘발성 메모리의 제3 영역으로의 데이터 이동을 나타내는 2차 스왑의 대상이 되는 데이터 산출에 사용될 수 있다. 2차 스왑의 대상이 되는 데이터 산출에 관하여는 뒤에서 다시 자세하게 살펴보기로 한다.At this time, the attribute information may include at least one of information about a storage time point in the second area of data to which the attribute information is assigned, information about a data type, information about a corresponding application, and information about a memory setting. have. The attribute information allocated to the data moving to the second area may be used to calculate data that is the target of secondary swap indicating data movement from the second area to the third area of the nonvolatile memory. The calculation of the data to be subject to the secondary swap will be discussed in detail later.
일 실시예에 따른 프로세서(120)는 제2 영역으로 이동된 적어도 하나의 페이지 데이터가 저장되었던 제1 영역의 특정 영역에 대한 이전 할당을 해제하고, 할당이 해제된 특정 영역을 실행이 요구된 어플리케이션에 할당할 수 있다.The processor 120 according to an embodiment releases a previous allocation for a specific region of the first region in which at least one page data moved to the second region is stored, and an application requiring execution of the specific region in which the allocation is released Can be assigned to
또한, 프로세서(120)는 제1 영역의 가용 용량이 임계 용량보다 크거나 같을 경우, 1차 스왑이 필요하지 않은 것으로 결정할 수 있다. 1차 스왑이 필요하지 않은 경우, 프로세서(120)는 제1 영역의 사용 가능한 영역을 해당 어플리케이션에 할당한다. 임계 용량은 고정될 수도 있고, 실행이 요구된 어플리케이션에 따라 가변될 수도 있다.Also, when the available capacity of the first region is greater than or equal to the threshold capacity, the processor 120 may determine that primary swap is not required. When primary swap is not required, the processor 120 allocates an available area of the first area to the corresponding application. The threshold capacity may be fixed or may vary depending on the application for which execution is required.
일 실시예에 따른 프로세서(120)는 제2 영역에 저장된 데이터 각각의 제2 영역에서의 저장 시간 및 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 2차 스왑이 필요한지 여부를 결정할 수 있다. The processor 120 according to an embodiment may determine whether a secondary swap is necessary based on at least one of a storage time in a second area of each data stored in the second area and a possibility of moving to the first area.
2차 스왑은 메모리(130) 내 휘발성 메모리의 제 2 영역에 적어도 일시적으로 저장된 데이터를 비휘발성 메모리의 제 3 영역으로 이동시켜 저장하는 것을 의미한다. 다른 예로, 2차 스왑은 메모리(130) 내 휘발성 메모리의 제 2 영역에 적어도 일시적으로 저장된 데이터를 비휘발성 메모리의 제 3 영역에 복사하고, 제 2 영역에 대한 메모리 할당을 해제하는 것을 의미할 수 있다.Secondary swap means that data stored at least temporarily in the second area of the volatile memory in the memory 130 is moved to and stored in the third area of the nonvolatile memory. As another example, the secondary swap may mean copying data stored at least temporarily in the second area of the volatile memory in the memory 130 to the third area of the non-volatile memory, and freeing memory allocation for the second area. have.
구체적으로, 프로세서(120)는 제2 영역에 저장된 데이터 각각의 제2 영역에서의 저장 시간 및 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터를 비휘발성 메모리의 제3 영역으로 이동하도록 제어할 수 있다.Specifically, the processor 120 determines at least one data among the data stored in the second area based on at least one of a storage time in the second area and a possibility of moving to the first area of each data stored in the second area. And, it can be controlled to move the determined at least one data to the third area of the non-volatile memory.
프로세서(120)는 제2 영역에 저장된 데이터 각각의 제2 영역에의 저장 시간을 임계 저장 시간과 비교함으로써, 제2 영역에의 저장 시간이 임계 저장 시간 이상인 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터가 비휘발성 메모리의 제3 영역으로 이동하도록 제어할 수 있다.The processor 120 determines at least one data whose storage time in the second area is greater than or equal to the critical storage time by comparing the storage time in the second area of each data stored in the second area with the critical storage time, and the determined at least One data can be controlled to move to the third area of the non-volatile memory.
즉, 프로세서(120)는 제2 영역에 저장된 데이터를 대응하는 어플리케이션 별로 식별하고, 식별된 데이터 각각의 제2 영역에서의 저장 시간 및 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터를 비휘발성 메모리로 이동하도록 제어할지 여부를 결정할 수 있다.That is, the processor 120 identifies the data stored in the second area for each application, and the second area based on at least one of the storage time in the second area of each identified data and the possibility of moving to the first area. At least one of the data stored in the data may be determined, and it may be determined whether to control the determined at least one data to be moved to the non-volatile memory.
일반적으로, 제1 영역에서 제2 영역으로 이동된 데이터는 특정 시간(예: 30초에서 1분 사이) 내에 제1 영역으로 이동할 수 있다. 즉, 시스템 메모리 영역에 해당하는 휘발성 메모리의 제1 영역에서의 어플리케이션의 실행에 따라 제1 영역에서 제2 영역으로의 이동(스왑 아웃)과, 제2 영역에서 제1 영역으로의 이동(스왑 인)이 특정 시간 내에 수행될 수 있다.In general, data moved from the first area to the second area may be moved to the first area within a specific time (eg, 30 seconds to 1 minute). That is, according to the execution of the application in the first area of the volatile memory corresponding to the system memory area, the movement from the first area to the second area (swap out) and the movement from the second area to the first area (swap in) ) Can be performed within a certain time.
이에 기초하여, 프로세서(120)는 특정 시간 내에 다시 제1 영역으로 이동하지 않은 제2 영역의 데이터는 다시 제1 영역으로 이동하지 않을 것으로 판단하고, 해당 데이터를 비휘발성 메모리의 제3 영역으로 이동시킴으로써, 휘발성 메모리의 제2 영역의 가용 용량을 크게 확보할 수 있다. 이를 통해, 전자 장치(100)의 메모리(130) 상에서의 1차 스왑이 보다 빠르게 수행될 수 있으며, 이에 따라 어플리케이션 실행을 위한 시스템 메모리 즉, 제1 영역에서의 메모리 할당이 보다 신속하게 수행될 수 있다.Based on this, the processor 120 determines that data in the second area that has not moved back to the first area within a certain time will not move back to the first area, and moves the data to the third area of the non-volatile memory. By doing so, the usable capacity of the second area of the volatile memory can be largely secured. Through this, the primary swap on the memory 130 of the electronic device 100 can be performed more quickly, and accordingly, system memory for application execution, that is, memory allocation in the first area can be performed more quickly. have.
이를 위해, 프로세서(120)는 특정 시간을 임계 저장 시간으로 미리 설정하고, 임계 저장 시간 이상으로 제2 영역에 저장되는 적어도 하나의 데이터를 결정하여, 결정된 적어도 하나의 데이터가 비휘발성 메모리의 제3 영역으로 이동하도록 제어할 수 있다.To this end, the processor 120 presets a specific time as a threshold storage time, and determines at least one data stored in the second area beyond the threshold storage time, so that the determined at least one data is the third of the non-volatile memory. It can be controlled to move to an area.
이 때, 프로세서(120)는 제2 영역에 저장된 데이터 각각의 중요도에 기초하여 임계 저장 시간을 조정할 수 있다. 구체적으로, 프로세서(120)는 제2 영역에 저장된 데이터 각각의 제1 영역으로의 이동 가능성을 결정하고, 제1 영역으로의 이동 가능성에 비례하도록 제2 영역에 저장된 데이터 각각의 임계 저장 시간을 결정할 수 있다.At this time, the processor 120 may adjust the threshold storage time based on the importance of each data stored in the second area. Specifically, the processor 120 determines the probability of movement of each data stored in the second region to the first region, and determines the critical storage time of each data stored in the second region in proportion to the probability of movement to the first region Can be.
구체적으로, 프로세서(120)는 제2 영역에 저장된 데이터 각각의 속성 정보에 기초하여 제2 영역에 저장된 데이터 각각의 제1 영역으로의 이동 가능성을 결정할 수 있다.Specifically, the processor 120 may determine the possibility of movement of the data stored in the second area to the first area based on the attribute information of each data stored in the second area.
이 때, 제1 영역으로의 이동 가능성은 제2 영역에 저장된 데이터가 대응하는 어플리케이션 실행에 의하여 시스템 메모리 영역에 해당하는 제1 영역으로 이동될 확률일 수 있다. 제1 영역으로의 이동 가능성을 결정하는 것은 뒤에서 다시 자세하게 살펴보기로 한다.At this time, the possibility of moving to the first area may be a probability that data stored in the second area is moved to the first area corresponding to the system memory area by executing a corresponding application. Determining the possibility of movement to the first area will be described in detail again later.
즉, 어플리케이션의 실행 확률이 높아질수록, 해당 어플리케이션에 대응하는 데이터의 제1 영역으로의 이동 가능성이 높아질 수 있다.That is, the higher the probability of execution of an application, the higher the probability of movement of data corresponding to the application to the first area.
프로세서(120)는 제1 영역으로의 이동 가능성에 비례하도록 제2 영역에 저장된 데이터 각각의 임계 저장 시간을 결정할 수 있다.The processor 120 may determine a critical storage time of each data stored in the second area in proportion to the probability of movement to the first area.
이 때, 임계 저장 시간은 제2 영역에 저장된 데이터 각각의 제2 영역에서의 저장 시간과 비교되는 시간 값으로, 프로세서(120)는 제2 영역에 저장된 데이터 중 제2 영역에서의 저장 시간이 대응하는 임계 저장 시간 이상인 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터가 비휘발성 메모리 상의 제3 영역으로 이동하도록 제어할 수 있다.At this time, the threshold storage time is a time value compared to the storage time in each second area of data stored in the second area, and the processor 120 corresponds to the storage time in the second area among the data stored in the second area. At least one data that is equal to or greater than the critical storage time may be determined, and the determined at least one data may be controlled to move to the third area on the nonvolatile memory.
즉, 프로세서(120)는 제1 영역으로의 이동 가능성 즉, 어플리케이션의 실행 가능성에 따라 어플리케이션의 데이터에 대응하는 임계 저장 시간을 달리함으로써, 실행 가능성이 높은 어플리케이션의 데이터에 대응하는 임계 저장 시간을 보다 길게 설정하여 실행 가능성이 높은 어플리케이션의 데이터가 제2 영역에 보다 길게 저장되어 있을 수 있다.That is, the processor 120 changes the threshold storage time corresponding to the data of the application according to the possibility of moving to the first area, that is, the application feasibility, thereby viewing the critical storage time corresponding to the data of the application having high feasibility. By setting a long time, data of an application having high feasibility may be stored longer in the second area.
반대로, 프로세서(120)는 실행 가능성이 낮은 어플리케이션의 데이터에 대응하는 임계 저장 시간을 보다 짧게 설정하여 실행 가능성이 낮은 어플리케이션의 데이터는 제2 영역에 보다 짧게 저장되어 있을 수 있다.Conversely, the processor 120 may set the threshold storage time corresponding to the data of the application with low feasibility to be shorter, so that the data of the application with low feasibility to be stored in the second area may be shorter.
즉, 실행 가능성이 높은 어플리케이션의 데이터는 상대적으로 실행 가능성이 낮은 어플리케이션의 데이터 보다 제2 영역에 길게 저장되어 있을 수 있으며, 이를 통해, 실행 가능성이 높은 어플리케이션이 실행되는 경우 제2 영역에 저장된 해당 데이터가 시스템 메모리 영역에 해당하는 제1 영역으로 즉각적으로 이동될 수 있다.That is, the data of the application with high feasibility may be stored in the second region longer than the data of the application with low feasibility, and through this, when the application with high feasibility is executed, the corresponding data stored in the second region Can be immediately moved to the first area corresponding to the system memory area.
또한, 일 실시예에 따른 프로세서(120)는 제2 영역에 저장된 데이터 각각의 제1 영역으로의 이동 가능성에 기초하여, 제1 영역으로의 이동이 예상되는 적어도 하나의 데이터가 비휘발성 메모리 상의 제3 영역으로 이동하는 것을 금지할 수 있다.In addition, the processor 120 according to an embodiment may determine whether at least one data expected to move to the first area is based on the possibility of movement of the data stored in the second area to the first area. It is forbidden to move to 3 areas.
즉, 프로세서(120)는 결정되는 제2 영역에 저장된 데이터 각각의 제1 영역으로의 이동 가능성에 기초하여, 제1 영역으로의 이동이 예상되는 데이터의 경우에는 휘발성 메모리 상의 제2 영역에 저장되어 있도록 하여 신속한 제1 영역으로의 이동(스왑 인)을 보장할 수 있다.That is, the processor 120 is stored in the second region on the volatile memory in the case of data expected to move to the first region, based on the possibility of movement of the data stored in the determined second region to the first region. This ensures rapid movement to the first area (swap in).
또한, 일 실시예에 따른 프로세서(120)는 비휘발성 메모리의 사용 패턴 및 큐(queue) 상태 중 적어도 하나에 기초하여 비휘발성 메모리의 유휴 상태 여부를 판단하고, 비휘발성 메모리가 유휴 상태인 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터가 제3 영역으로 이동하도록 제어할 수 있다.In addition, the processor 120 according to an embodiment determines whether the nonvolatile memory is idle based on at least one of a usage pattern and a queue state of the nonvolatile memory, and when the nonvolatile memory is idle, At least one data determined to have a storage time equal to or greater than a threshold storage time may be controlled to move to the third area.
즉, 프로세서(120)는 비휘발성 메모리가 유휴 상태인 경우에만 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터가 제3 영역으로 이동하도록 제어할 수 있다.That is, the processor 120 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to move to the third area only when the nonvolatile memory is idle.
이를 위해, 프로세서(120)는 전자 장치(100)의 동작에 따른 비휘발성 메모리의 읽기(write) 횟수 및 쓰기(read) 횟수를 나타내는 비휘발성 메모리의 사용 패턴 및 전자 장치(100)의 현재 동작에 기초하여 비휘발성 메모리의 유휴 상태 여부를 판단할 수 있다.To this end, the processor 120 uses the non-volatile memory usage pattern indicating the number of writes and the number of reads of the non-volatile memory according to the operation of the electronic device 100 and the current operation of the electronic device 100. Based on this, it may be determined whether the nonvolatile memory is idle.
또한, 프로세서(120)는 비휘발성 메모리의 큐 상태 즉, I/O queue 상태가 나타내는 읽기 횟수 및 쓰기 횟수를 임계 횟수와 비교하여 비휘발성 메모리의 유휴 상태 여부를 판단할 수 있다. 비휘발성 메모리의 유휴 상태 여부를 판단하는 것은 뒤에서 다시 자세하게 살펴보기로 한다.Also, the processor 120 may determine whether the nonvolatile memory is idle by comparing the number of reads and writes indicated by the queue state of the nonvolatile memory, that is, the I / O queue state, with a threshold number of times. Determining whether the nonvolatile memory is idle will be described in detail later.
또한, 일 실시예에 따른 프로세서(120)는 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 결정된 적어도 하나의 데이터를 미리 설정된 임계 크기 이하의 크기로 분할하고, 분할된 데이터가 순차적으로 제3 영역으로 이동하도록 제어할 수 있다.In addition, when the total data size of the at least one data determined that the storage time is greater than or equal to the threshold storage time is greater than or equal to a preset threshold size, the processor 120 according to an embodiment may set the determined at least one data to be less than or equal to the preset threshold size. It can be divided into, and can be controlled to sequentially move the divided data to the third area.
프로세서(120)는 저장 시간이 임계 저장 시간 이상인 것으로 결정된 어느 하나의 어플리케이션에 대응하는 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 어느 하나의 어플리케이션에 대응하는 데이터를 미리 설정된 임계 크기 이하의 크기로 분할하고, 분할된 데이터가 순차적으로 비휘발성 메모리의 제3 영역으로 이동하도록 제어할 수도 있다.When the total data size of data corresponding to any one application determined that the storage time is greater than or equal to the threshold storage time is greater than or equal to a preset threshold size, the processor 120 may set data corresponding to any one application to be less than or equal to a preset threshold size. It is also possible to divide and control the data to be sequentially moved to the third area of the nonvolatile memory.
이 때, 일 실시예에 따른 프로세서(120)는 비휘발성 메모리의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 미리 설정된 임계 크기를 조정할 수 있다. 즉, 프로세서(120)는 비휘발성 메모리의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 비휘발성 메모리의 읽기 횟수 및 쓰기 횟수를 결정하고, 읽기 횟수 및 쓰기 횟수에 기초하여 제2 영역에서 제3 영역으로 이동하는 데이터 량을 제한하는 임계 크기를 조정할 수 있다.At this time, the processor 120 according to an embodiment may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory. That is, the processor 120 determines the number of reads and writes of the nonvolatile memory based on at least one of the usage pattern of the nonvolatile memory and the queue state, and the third area in the second area based on the number of reads and the number of writes. You can adjust the threshold size to limit the amount of data that moves.
일 실시예에 따른 메모리(130)는 휘발성 메모리 및 비휘발성 메모리를 포함할 수 있다. 메모리(130)는 전자 장치(100)의 적어도 하나의 다른 구성요소에 관련된 명령 또는 데이터를 저장할 수 있다.The memory 130 according to an embodiment may include volatile memory and nonvolatile memory. The memory 130 may store instructions or data related to at least one other component of the electronic device 100.
일 실시예에 따른 메모리(130)는 제 1 영역과 제 2 영역을 포함하는 휘발성 메모리와 제 3 영역을 포함하는 비휘발성 메모리로 구성될 수 있다. 제 1 영역은 프로그램 실행을 위해 프로그램 및 프로그램의 실행 관련 데이터를 적어도 일시적으로 저장하도록 지정된 시스템 메모리 영역일 수 있다. 제 2 영역은 시스템 메모리 영역인 제 1 영역이 부족할 경우, 제 1 영역의 가용 용량을 확보하기 위해 적어도 일시적으로 이용되지 않을 것으로 예상되는 프로그램 및 프로그램의 실행 관련 데이터를 저장하도록 지정된 1차 스왑 영역일 수 있다. 실시예에 따라, 제 2 영역에 저장된 데이터는 압축된 데이터일 수 있다. 제 3 영역은 휘발성 메모리의 제 2 영역에 저장된 데이터 중 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터를 저장하도록 지정된 2차 스왑 영역일 수 있다. 제 3 영역은 압축된 데이터를 저장할 수 있다. 제 1 영역, 제 2 영역, 및 제 3 영역의 크기는 고정될 수도 있고, 가변될 수도 있다.The memory 130 according to an embodiment may include a volatile memory including a first area and a second area and a non-volatile memory including a third area. The first area may be a system memory area designated to temporarily store programs and execution-related data of the program for program execution. The second area is a primary swap area designated to store programs related to execution of programs and programs that are not expected to be used at least temporarily to secure the usable capacity of the first area when the first area, which is a system memory area, is insufficient. Can be. According to an embodiment, data stored in the second area may be compressed data. The third area may be a secondary swap area designated to store at least one data determined to have a storage time equal to or greater than a critical storage time among data stored in the second area of the volatile memory. The third area can store compressed data. The sizes of the first area, the second area, and the third area may be fixed or variable.
일 실시예에 따른 메모리(130)는 소프트웨어 및/또는 프로그램(140)을 저장할 수 있다. 예를 들어, 프로그램(140)은 커널(141), 미들웨어(142), 응용프로그램 프로그래밍 인터페이스(API: application programming interface)(143) 또는 어플리케이션(144)(또는 어플리케이션 프로그램) 등을 포함할 수 있다. 커널(141), 미들웨어(142), 또는 응용프로그램 프로그래밍 인터페이스(API)(143)의 적어도 일부는 운영 시스템(OS: operating system)이라 불릴 수 있다.The memory 130 according to an embodiment may store software and / or programs 140. For example, the program 140 may include a kernel 141, middleware 142, an application programming interface (API) 143, or an application 144 (or application program). At least a portion of the kernel 141, middleware 142, or application programming interface (API) 143 may be referred to as an operating system (OS).
일 실시예에 따른 커널(141)은 다른 프로그램들(예: 미들웨어(142), API(143) 또는 어플리케이션(144))에 구현된 동작 또는 기능을 실행하는데 사용되는 시스템 리소스들(예: 버스(110), 프로세서(120) 또는 메모리(130) 등)을 제어 또는 관리할 수 있다. 커널(141)은 미들웨어(142), API(143) 또는 어플리케이션(144)에서 전자 장치(100)의 개별 구성요소에 접근함으로써, 시스템 리소스들을 제어 또는 관리할 수 있는 인터페이스를 제공할 수 있다. 커널(141)은 메모리 관리를 위해 스왑 프로그램 모듈을 이용하여 1차 스왑 태스크 및 2차 스왑 태스크를 제어 또는 관리할 수 있다.The kernel 141 according to an embodiment may include system resources used to execute an operation or function implemented in other programs (eg, middleware 142, API 143, or application 144), such as a bus ( 110), the processor 120 or the memory 130, etc.) can be controlled or managed. The kernel 141 may provide an interface for controlling or managing system resources by accessing individual components of the electronic device 100 in the middleware 142, the API 143, or the application 144. The kernel 141 may control or manage the primary swap task and the secondary swap task using a swap program module for memory management.
일 실시예에 따른 미들웨어(142)는 API(143) 또는 어플리케이션(144)이 커널(141)과 통신하여 데이터를 주고받을 수 있도록 중개 역할을 수행할 수 있다. 또한, 미들웨어(142)는 어플리케이션(144)으로부터 수신된 하나 이상의 작업 요청들을 우선 순위에 따라 처리할 수 있다. 예를 들면, 미들웨어(142)는 어플리케이션(144) 중 적어도 하나에 전자 장치(100)의 시스템 리소스(예: 버스(110), 프로세서(120), 또는 메모리(130) 등)를 사용할 수 있는 우선 순위를 부여할 수 있다. 예컨대, 미들웨어(142)는 상기 적어도 하나에 부여된 우선 순위에 따라 상기 하나 이상의 작업 요청들을 처리함으로써, 상기 하나 이상의 작업 요청들에 대한 스케쥴링 또는 로드 밸런싱 등을 수행할 수 있다.The middleware 142 according to an embodiment may act as an intermediary so that the API 143 or the application 144 communicates with the kernel 141 to exchange data. Also, the middleware 142 may process one or more job requests received from the application 144 according to priority. For example, the middleware 142 may use system resources (eg, the bus 110, the processor 120, or the memory 130, etc.) of the electronic device 100 for at least one of the applications 144. You can assign a ranking. For example, the middleware 142 may perform scheduling or load balancing for the one or more job requests by processing the one or more job requests according to the priority given to the at least one.
일 실시예에 따른 API(143)는, 예를 들면, 어플리케이션(144)이 커널(141) 또는 미들웨어(142)에서 제공되는 기능을 제어하기 위한 인터페이스로, 예를 들면, 파일 제어, 창 제어, 영상 처리, 또는 문자 제어 등을 위한 적어도 하나의 인터페이스 또는 함수(예: 명령어)를 포함할 수 있다.The API 143 according to an embodiment may be, for example, an application 144 as an interface for controlling functions provided by the kernel 141 or the middleware 142, for example, file control, window control, It may include at least one interface or function (eg, a command) for image processing or text control.
일 실시예에 따른 입출력 인터페이스(150)는 사용자 또는 다른 외부 기기로부터 입력된 명령 또는 데이터를 전자 장치(100)의 다른 구성요소(들)에 전달할 수 있는 인터페이스의 역할을 수행할 수 있다. 또한, 입출력 인터페이스(150)는 전자 장치(100)의 다른 구성요소(들)로부터 수신된 명령 또는 데이터를 사용자 또는 다른 외부 기기로 출력할 수 있다.The input / output interface 150 according to an embodiment may serve as an interface capable of transmitting commands or data input from a user or other external device to other component (s) of the electronic device 100. Also, the input / output interface 150 may output commands or data received from other component (s) of the electronic device 100 to a user or another external device.
일 실시예에 따른 디스플레이(160)는, 예를 들면, 액정 디스플레이(LCD: liquid crystal display), 발광 다이오드(LED: light-emitting diode) 디스플레이, 유기 발광 다이오드(OLED: organic light-emitting diode) 디스플레이, 또는 마이크로 전자기계 시스템(MEMS: microelectromechanical systems) 디스플레이, 또는 전자종이(electronic paper) 디스플레이를 포함할 수 있다.The display 160 according to an embodiment includes, for example, a liquid crystal display (LCD), a light-emitting diode (LED) display, and an organic light-emitting diode (OLED) display. , Or a microelectromechanical systems (MEMS) display, or an electronic paper display.
디스플레이(160)는, 예를 들면, 사용자에게 각종 콘텐츠(예: 텍스트, 이미지, 비디오, 아이콘, 또는 심볼 등)을 표시할 수 있다. 디스플레이(160)는, 터치 스크린을 포함할 수 있으며, 예를 들면, 전자 펜 또는 사용자의 신체의 일부를 이용한 터치, 제스쳐, 근접, 또는 호버링 입력을 수신할 수 있다. 예컨대, 디스플레이(160)는 터치 입력 또는 호버링 입력을 검출할 수 있는 터치 패널과 결합하여 하나의 터치 스크린을 구성할 수 있다.The display 160 may display various contents (eg, text, images, videos, icons, or symbols) to the user, for example. The display 160 may include a touch screen, and may receive a touch, gesture, proximity, or hovering input using, for example, an electronic pen or a user's body part. For example, the display 160 may form a single touch screen in combination with a touch panel capable of detecting a touch input or a hovering input.
일 실시예에 따른 통신 인터페이스(170)는 전자 장치(100)와 외부 전자 장치(예: 제1 외부 전자 장치(101), 제2 외부 전자 장치(102) 또는 서버(103))와의 통신을 연결할 수 있다. 예를 들어, 통신 인터페이스(170)는 무선 통신 또는 유선 통신을 통해서 네트워크(105)에 연결되어 외부 전자 장치와 통신할 수 있다.The communication interface 170 according to an embodiment connects communication between the electronic device 100 and an external electronic device (eg, the first external electronic device 101, the second external electronic device 102, or the server 103). Can be. For example, the communication interface 170 may be connected to the network 105 through wireless communication or wired communication to communicate with an external electronic device.
무선 통신은, 예를 들면, 셀룰러 통신 프로토콜로서, 예를 들면, LTE(long-term evolution), LTE-A(LTE Advance), CDMA(code division multiple access), WCDMA(wideband CDMA), UMTS(universal mobile telecommunications system), WiBro(Wireless Broadband), 또는 GSM(Global System for Mobile Communications) 등 중 적어도 하나를 사용할 수 있다.Wireless communication is, for example, a cellular communication protocol, for example, long-term evolution (LTE), LTE Advance (LTE-A), code division multiple access (CDMA), wideband CDMA (WCDMA), universal (UMTS) Mobile telecommunications system), WiBro (Wireless Broadband), or GSM (Global System for Mobile Communications) may be used.
또한, 무선 통신은, 예를 들면, 근거리 통신(104)을 포함할 수 있다. 근거리 통신(104)은, 예를 들면, WiFi(wireless fidelity), 블루투스(Bluetooth), BLE(bluetooth low energy), 지그비(Zigbee), NFC(near field communication), 자력 보안 전송(magnetic secure transmission), 무선 주파수(radio frequency), 또는 인체 영역 네트워크(body area network) 중 적어도 하나를 포함할 수 있다.Further, the wireless communication may include, for example, short-range communication 104. The short-range communication 104 includes, for example, wireless fidelity (WiFi), Bluetooth (Bluetooth), Bluetooth low energy (BLE), Zigbee, near field communication (NFC), magnetic secure transmission, It may include at least one of a radio frequency or a body area network.
일 실시 예에 따르면, 무선 통신은 GNSS(global navigation satellite system)를 포함할 수 있다. GNSS는, 예를 들면, GPS(Global Positioning System), Glonass(Global Navigation Satellite System), 북두(Beidou Navigation Satellite System) 또는 Galileo(European global satellite-based navigation system)일 수 있다.According to one embodiment, the wireless communication may include a global navigation satellite system (GNSS). The GNSS can be, for example, a Global Positioning System (GPS), a Global Navigation Satellite System (Glonass), a Beidou Navigation Satellite System (Geidu) or an European global satellite-based navigation system (Gilelo).
유선 통신은, 예를 들면, USB (universal serial bus), HDMI (high definition multimedia interface), RS-232 (recommended standard-232), 또는 POTS (plain old telephone service) 등 중 적어도 하나를 포함할 수 있다.Wired communication may include, for example, at least one of a universal serial bus (USB), a high definition multimedia interface (HDMI), a recommended standard-232 (RS-232), or a plain old telephone service (POTS). .
네트워크(105)는 통신 네트워크 (telecommunications network), 예를 들면, 컴퓨터 네트워크 (computer network)(예: LAN 또는 WAN), 인터넷, 또는 전화 망 (telephone network) 중 적어도 하나를 포함할 수 있다.The network 105 may include at least one of a telecommunications network, for example, a computer network (eg, LAN or WAN), the Internet, or a telephone network.
제1 및 제2 외부 전자 장치(101, 102) 각각은 전자 장치(100)와 동일한 또는 다른 종류의 장치일 수 있다. 일 실시예에 따른 서버(103)는 하나 또는 그 이상의 서버들의 그룹을 포함할 수 있다. 다양한 실시예에 따르면, 전자 장치(100)에서 실행되는 동작들의 전부 또는 일부는 다른 하나 또는 복수의 전자 장치(예: 전자 장치(101, 102), 또는 서버(103)에서 실행될 수 있다. 한 실시예에 따르면, 전자 장치(100)가 어떤 기능이나 서비스를 자동으로 또는 요청에 의하여 수행해야 할 경우에, 전자 장치(100)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 그와 연관된 적어도 일부 기능을 다른 장치(예: 전자 장치(101, 102), 또는 서버(103))에게 요청할 수 있다. 다른 전자 장치(예: 전자 장치(101, 102), 또는 서버(103))는 요청된 기능 또는 추가 기능을 실행하고, 그 결과를 전자 장치(100)로 전달할 수 있다. 전자 장치(100)는 수신된 결과를 그대로 또는 추가적으로 처리하여 요청된 기능이나 서비스를 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다.Each of the first and second external electronic devices 101 and 102 may be the same or a different type of device from the electronic device 100. The server 103 according to an embodiment may include a group of one or more servers. According to various embodiments, all or some of the operations executed in the electronic device 100 may be executed in another one or a plurality of electronic devices (eg, the electronic devices 101, 102, or the server 103). According to an example, when the electronic device 100 needs to perform a function or service automatically or by request, the electronic device 100 may execute the function or service itself, or in addition, at least associated therewith. Some functions may be requested from other devices (eg, electronic devices 101, 102, or server 103.) Other electronic devices (eg, electronic devices 101, 102, or server 103) may be requested. A function or an additional function may be executed, and the result may be transmitted to the electronic device 100. The electronic device 100 may provide the requested function or service by processing the received result as it is or additionally. For example, cloud computing, distributed computing, or client-server computing technology can be used.
도 2는 본 발명의 일 실시예에 따른 휘발성 메모리(131) 및 비휘발성 메모리(132)를 포함하는 전자 장치(100)의 블록도를 도시한다.2 is a block diagram of an electronic device 100 including a volatile memory 131 and a nonvolatile memory 132 according to an embodiment of the present invention.
도 2를 참조하면, 전자 장치(100)는 프로세서(120), 휘발성 메모리(131), 비휘발성 메모리(132) 등을 포함할 수 있다.Referring to FIG. 2, the electronic device 100 may include a processor 120, a volatile memory 131, a nonvolatile memory 132, and the like.
일 실시예에 따른 프로세서(120)는 메모리 관리부(121)를 포함할 수 있다. 메모리 관리부(121)는, 예를 들면, 어플리케이션 실행에 따른 메모리 할당 요구를 감지하고, 휘발성 메모리(131) 내 시스템 메모리 영역에 해당하는 제1 영역(210) 중 적어도 일부 영역을 해당 어플리케이션에 할당할 수 있다. 또한, 메모리 관리부(121)는 어플리케이션의 실행 종료 또는 제1 영역(210)의 가용 용량이 부족함을 감지하고, 해당 어플리케이션에 기 할당된 제1 영역(210)의 일부 영역에 대한 할당을 해제할 수 있다.The processor 120 according to an embodiment may include a memory management unit 121. The memory manager 121 detects, for example, a memory allocation request according to application execution, and allocates at least a portion of the first region 210 corresponding to the system memory region in the volatile memory 131 to the corresponding application. Can be. In addition, the memory management unit 121 may detect the termination of the execution of the application or the insufficient capacity of the first area 210, and release the allocation of some areas of the first area 210 previously allocated to the application. have.
일 실시예에 따른 메모리 관리부(121)는 이동 관리 모듈(122)을 포함할 수 있다. 이동 관리 모듈(122)은 제1 영역(210)의 가용 용량이 임계 용량보다 작거나 같을 경우, 제1 영역(210)이 부족한 것으로 결정하고 제1 영역(210)의 데이터를 휘발성 메모리(131) 상의 제2 영역(220)으로 이동시키기 위한 1차 스왑 수행을 결정할 수 있다. 임계 용량은 고정된 값일 수도 있고, 가변적인 값일 수도 있다. 예를 들어, 임계 용량은 항상 일정한 값일 수도 있으며, 실행이 요구된 어플리케이션에 따라 변경될 수도 있다. 예를 들어, 임계 용량은 20MB(megabyte)로 설정될 수 있다. 이러한 수치는 설명을 위한 예시적인 것으로서, 본 발명의 다양한 실시 예들은 이에 한정되지 않는다.The memory management unit 121 according to an embodiment may include the movement management module 122. When the usable capacity of the first area 210 is less than or equal to the threshold capacity, the movement management module 122 determines that the first area 210 is insufficient and transmits data of the first area 210 to the volatile memory 131. A primary swap performance for moving to the second region 220 on the top may be determined. The threshold capacity may be a fixed value or a variable value. For example, the threshold capacity may always be a constant value, and may be changed according to an application requiring execution. For example, the threshold capacity may be set to 20 MB (megabyte). These figures are illustrative only, and various embodiments of the present invention are not limited thereto.
이동 관리 모듈(122)은, 예를 들어, 제1 영역(210)의 가용 용량이 임계 용량보다 작거나 같을 경우, 1차 이동 태스크(123)를 활성화시킬 수 있다.The movement management module 122 may activate the primary movement task 123 when, for example, the available capacity of the first area 210 is less than or equal to the threshold capacity.
이동 관리 모듈(122)은 1차 이동 태스크(123)를 이용하여 제1 영역(210)의 데이터 중 미리 설정된 조건을 만족하는 데이터를 선택할 수 있다. 이 때, 미리 설정된 조건은 데이터의 제1 영역(210)에서의 저장 시간이 가장 오래된 데이터에 해당하는지 여부이거나, 미리 설정된 어플리케이션에 대응하는 데이터에 해당하는지 여부일 수 있다.The movement management module 122 may select data that satisfies a preset condition among data in the first region 210 using the primary movement task 123. At this time, the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
즉, 이동 관리 모듈(122)은 제1 영역(210)의 페이지들 중에서 가장 오랫동안 사용되지 않은 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다. 예를 들어, 제1 영역(210)의 페이지를 스캔하여, 가장 오랫동안 사용되지 않은 적어도 하나의 페이지를 선택할 수 있다.That is, the movement management module 122 may select a page that has not been used for the longest time among the pages of the first region 210 and may move data of the selected page to the second region 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
또한, 이동 관리 모듈(122)은 제1 영역(210)의 페이지들 중에서 미리 설정된 어플리케이션에 대응하는 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다.In addition, the movement management module 122 may select a page corresponding to a preset application from among the pages of the first region 210 and move data of the selected page to the second region 220.
일 실시예에 따른 1차 이동 태스크(123)는 제1 영역(210)에서 선택된 페이지의 데이터를 압축한 후, 압축된 데이터를 제2 영역(220)으로 이동시킬 수 있다. 일 실시예에 따른 1차 이동 태스크(123)는 LZO(Lempel-Ziv-Oberhumer) 알고리즘, 또는 LZ4(LZO Variant) 알고리즘 등과 같은 공지된 알고리즘을 이용하여 페이지의 데이터를 압축할 수 있다.The primary movement task 123 according to an embodiment may compress the data of the page selected in the first region 210 and then move the compressed data to the second region 220. The primary movement task 123 according to an embodiment may compress data of a page using a known algorithm such as a Lempel-Ziv-Oberhumer (LZO) algorithm or an LZO Variant (LZ4) algorithm.
본 발명의 다양한 실시 예에서는 제1 영역(210)의 데이터를 제2 영역(220)으로 이동시키는 경우, 제1 영역(210)에서 선택된 데이터를 압축하는 것을 예시로 설명하였으나, 본 발명의 다양한 실시예는 이에 한정되는 것은 아니다. 예를 들어, 1차 이동 태스크(123)는 제1 영역(210)에서 선택된 페이지의 데이터를 압축하지 않고, 압축되지 않은 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다.In various embodiments of the present invention, when the data in the first area 210 is moved to the second area 220, the data selected in the first area 210 is compressed as an example, but various embodiments of the present invention are described. The example is not limited to this. For example, the primary movement task 123 may move the data of the uncompressed page to the second region 220 without compressing the data of the page selected in the first region 210.
일 실시예에 따르면, 1차 이동 태스크(123)에 의해 제1 영역(210)에서 제2 영역(220)으로 이동되는 데이터의 단위는 페이지일 수도 있으나, 이에 한정되지는 않는다. 예를 들어, 1차 이동 태스크(123)에 의해 제1 영역(210)에서 제2 영역(220)으로 이동되는 데이터는 페이지의 복수 배에 대응되는 단위이거나, 프로세스 단위 등일 수 있다.According to an embodiment, a unit of data moved from the first area 210 to the second area 220 by the primary movement task 123 may be a page, but is not limited thereto. For example, data moved from the first region 210 to the second region 220 by the primary movement task 123 may be a unit corresponding to a plurality of times of a page or a process unit.
일 실시예에 따른 1차 이동 태스크(123)는 제1 영역(210)에서 제2 영역(220)으로 이동되는 데이터 각각에 속성 정보를 할당할 수 있다.The primary movement task 123 according to an embodiment may assign attribute information to each data moved from the first region 210 to the second region 220.
이 때, 속성 정보는, 속성 정보가 할당된 데이터의 제2 영역(220)에의 저장 시점에 대한 정보, 데이터 유형에 대한 정보, 대응하는 어플리케이션에 대한 정보 및 메모리 설정에 대한 정보 중 적어도 하나를 포함할 수 있다. 제2 영역(220)으로 이동하는 데이터에 할당된 속성 정보는 제2 영역(220)에서 비휘발성 메모리(132)의 제3 영역(230)으로의 데이터 이동을 나타내는 2차 스왑의 대상이 되는 데이터 산출에 사용될 수 있다.At this time, the attribute information includes at least one of information on a storage time of the data to which the attribute information is assigned to the second region 220, information on a data type, information on a corresponding application, and information on a memory setting. can do. The attribute information allocated to the data moving to the second area 220 is data to be subject to secondary swap indicating data movement from the second area 220 to the third area 230 of the nonvolatile memory 132. Can be used for calculation.
일 실시예에 따르면, 이동 관리 모듈(122)은 운영체제 시작 시에 2차 이동 태스크(124)를 생성할 수 있다. 예를 들어, 이동 관리 모듈(122)은 제2 영역(220)에 저장된 데이터 각각의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기반하여 제2 영역(220)의 데이터를 제3 영역(230)으로 이동시키기 위한 2차 스왑 기능 활성 여부를 결정할 수 있다.According to one embodiment, the movement management module 122 may generate the secondary movement task 124 when the operating system starts. For example, the movement management module 122 may display data of the second region 220 based on at least one of a storage time of each data stored in the second region 220 and a possibility of movement to the first region 210. Whether to activate the secondary swap function for moving to the third region 230 may be determined.
일 실시예에 따른 이동 관리 모듈(122)은 속성 정보에 포함되는 제2 영역(220)에의 저장 시점 정보에 기초하여 제2 영역(220)의 데이터 각각의 제2 영역(220)에서의 저장 시간을 확인할 수 있다. The movement management module 122 according to an embodiment stores the storage time in the second region 220 of each data in the second region 220 based on the storage time information in the second region 220 included in the attribute information. can confirm.
일 실시예에 따른 이동 관리 모듈(122)은 확인된 저장 시간에 기초하여 제2 영역(220)에 저장된 데이터 중 저장 시간이 대응하는 임계 저장 시간 이상인 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터에 대하여 2차 스왑을 수행할 것을 결정할 수 있다. 예를 들어, 임계 저장 시간은 30초로 설정될 수 있다. 그러나, 이러한 수치는 설명을 위한 예시적인 것으로서, 본 발명의 다양한 실시 예들은 이에 한정되지 않는다.The movement management module 122 according to an embodiment determines at least one data of which the storage time is greater than or equal to a corresponding threshold storage time among data stored in the second area 220 based on the identified storage time, and the determined at least one You can decide to do a second swap on your data. For example, the threshold storage time can be set to 30 seconds. However, these figures are illustrative only, and various embodiments of the present invention are not limited thereto.
일 실시예에 따른 이동 관리 모듈(122)은 2차 이동 태스크(124)를 이용하여, 제2 영역(220)에 일시적으로 저장된 압축된 데이터들 중 지정된 조건을 만족하는 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터를 제3 영역(230)으로 이동시킬 수 있다.The movement management module 122 according to an embodiment uses the secondary movement task 124 to determine at least one data that satisfies a specified condition among compressed data temporarily stored in the second region 220 and , It is possible to move the determined at least one data to the third region 230.
즉, 프로세서(120)는 제2 영역(220)에 저장된 데이터를 대응하는 어플리케이션 별로 식별하고, 식별된 데이터 각각의 제2 영역(220)에서의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역(220)에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터를 제3 영역(230)로 이동하도록 제어할지 여부를 결정할 수 있다.That is, the processor 120 identifies the data stored in the second area 220 for each application, and the storage time in the second area 220 of each of the identified data and the possibility of movement to the first area 210 Based on at least one of the data, it is possible to determine at least one data among the data stored in the second area 220 and determine whether to control the determined at least one data to be moved to the third area 230.
이 때, 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 중요도에 기초하여 임계 저장 시간을 조정할 수 있다. 구체적으로, 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정하고, 제1 영역(210)으로의 이동 가능성에 비례하도록 제2 영역(220)에 저장된 데이터 각각의 임계 저장 시간을 결정할 수 있다.At this time, the secondary movement task 124 may adjust the threshold storage time based on the importance of each data stored in the second region 220. Specifically, the processor 120 determines the possibility of movement of each of the data stored in the second region 220 to the first region 210, and the second region (so as to be proportional to the probability of movement to the first region 210) A threshold storage time of each data stored in 220 may be determined.
구체적으로, 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 속성 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.Specifically, the secondary movement task 124 determines the possibility of movement of the data stored in the second region 220 to the first region 210 based on the attribute information of each data stored in the second region 220. Can be.
이 때, 제1 영역(210)으로의 이동 가능성은 제2 영역(220)에 저장된 데이터가 대응하는 어플리케이션 실행에 의하여 시스템 메모리 영역에 해당하는 제1 영역(210)으로 이동(또는 복귀)될 확률일 수 있다.At this time, the possibility of moving to the first area 210 is the probability that data stored in the second area 220 is moved (or returned) to the first area 210 corresponding to the system memory area by executing a corresponding application. Can be
일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU 사용시간 중 적어도 하나에 비례하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.The secondary movement task 124 according to an embodiment is proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second area 220. The possibility of movement of the data stored in the second area 220 to the first area 210 may be determined.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 전경(foreground) 상태 또는 배경(background) 상태에 기초하여 제2 영역(220)에 저장된 데이터 각각의 상기 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment of the present disclosure may include the second area 220 based on the foreground state or the background state of the application corresponding to each data stored in the second area 220. ), It is possible to determine the possibility of movement of each data stored in the first region 210.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 대응하는 어플리케이션에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다. In addition, the secondary movement task 124 according to an embodiment may correspond to information on a relationship between a preset application and a possibility of movement to the first region 210 and data stored in the second region 220, respectively. Based on the information on the application, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
이 때, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는, 어플리케이션 각각의 미리 설정된 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 즉, 전자 장치(100)는 메모리(130) 상에 어플리케이션 각각의 제1 영역(210)으로의 이동 가능성을 저장할 수 있으며, 어플리케이션 각각의 제1 영역(210)으로의 이동 가능성은 설계 단계에서 저장되거나, 사용자에 의하여 저장될 수 있으며, 외부 서버로부터 획득될 수 있다.In this case, the information on the relationship between the preset application and the possibility of movement to the first area 210 may include information about the possibility of movement to the first area 210 preset for each application. That is, the electronic device 100 may store the possibility of movement to the first region 210 of each application on the memory 130, and the possibility of movement to the first region 210 of each application may be stored in the design stage Or, it can be stored by the user or can be obtained from an external server.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 데이터 유형에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may include information on a relationship between a preset data type and the possibility of movement to the first region 210 and data of each data stored in the second region 220. Based on the information on the type, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
이 때, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는, 데이터 유형 각각의 미리 설정된 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 즉, 전자 장치(100)는 메모리(130) 상에 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성을 저장할 수 있으며, 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성은 설계 단계에서 저장되거나, 사용자에 의하여 저장될 수 있으며, 외부 서버로부터 획득될 수 있다.In this case, the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type. . That is, the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may move to the first area 210 of each data stored in the second area 220 based on the memory setting of each data stored in the second area 220. Can determine the likelihood of movement.
구체적으로, 어플리케이션은 할당된 메모리에 대하여 madvise 시스템콜을 이용하여 메모리 어드바이스 설정이 가능하다. 즉, 어플리케이션은 시스템콜을 통하여 메모리 어드바이스를 설정하여, 할당된 메모리의 사용방식을 메모리(130)에 권고(advise)할 수 있다. 이 때, 메모리 설정은 할당된 메모리의 사용방식을 메모리(130)에 권고하는 플래그(flag) 값에 해당할 수 있으며, 설정에 따라 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내거나, 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타낼 수 있다.Specifically, the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory. At this time, the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
이 때, 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 기초하여, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 금지하고, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 수행할 수 있다.At this time, the secondary movement task 124 may have a possibility that the memory setting moves from the second area 220 to the first area 210 based on the memory setting of each data stored in the second area 220. Moving to the third area 230 is prohibited for data indicating that there is, and for the data indicating that the memory setting is not likely to move from the second area 220 to the first area 210, the third area ( 230).
이와 같이, 어플리케이션의 실행 확률이 높아질수록, 해당 어플리케이션에 대응하는 데이터의 제1 영역(210)으로의 이동 가능성이 높아질 수 있다. 이에 따라, 2차 이동 태스크(124)는 제1 영역(210)으로의 이동 가능성에 비례하도록 제2 영역(220)에 저장된 데이터 각각의 임계 저장 시간을 결정할 수 있다.As such, the higher the probability of execution of an application, the higher the probability of movement of data corresponding to the application to the first region 210. Accordingly, the secondary movement task 124 may determine the critical storage time of each data stored in the second region 220 in proportion to the possibility of movement to the first region 210.
즉, 프로세서(120)는 제1 영역(210)으로의 이동 가능성 즉, 어플리케이션의 실행 가능성에 따라 어플리케이션의 데이터에 대응하는 임계 저장 시간을 달리함으로써, 실행 가능성이 높은 어플리케이션의 데이터에 대응하는 임계 저장 시간을 보다 길게 설정하여 실행 가능성이 높은 어플리케이션의 데이터가 제2 영역(220)에 보다 길게 저장되어 있을 수 있다.That is, the processor 120 varies the threshold storage time corresponding to the data of the application according to the possibility of movement to the first area 210, that is, the application feasibility, thereby storing the threshold corresponding to the data of the application having high feasibility. By setting the time longer, data of an application with high feasibility may be stored in the second region 220 longer.
반대로, 프로세서(120)는 실행 가능성이 낮은 어플리케이션의 데이터에 대응하는 임계 저장 시간을 보다 짧게 설정하여 실행 가능성이 낮은 어플리케이션의 데이터는 제2 영역(220)에 보다 짧게 저장되어 있을 수 있다.Conversely, the processor 120 may set the threshold storage time corresponding to the data of the application having low feasibility to be shorter, so that the data of the application having low feasibility may be stored in the second region 220 shorter.
즉, 실행 가능성이 높은 어플리케이션의 데이터는 상대적으로 실행 가능성이 낮은 어플리케이션의 데이터 보다 제2 영역(220)에 길게 저장되어 있을 수 있으며, 이를 통해, 실행 가능성이 높은 어플리케이션이 실행되는 경우 제2 영역(220)에 저장된 해당 데이터가 시스템 메모리 영역에 해당하는 제1 영역(210)으로 즉각적으로 이동될 수 있다.That is, the data of the application with high feasibility may be stored in the second region 220 longer than the data of the application with low feasibility, and through this, when the application with high feasibility is executed, the second region ( The data stored in 220) may be immediately moved to the first area 210 corresponding to the system memory area.
또한, 일 실시예에 따른 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 적어도 하나의 데이터가 비휘발성 메모리 상의 제3 영역(230)으로 이동하는 것을 금지할 수 있다.In addition, the processor 120 according to an embodiment may at least predict the movement of the data stored in the second region 220 to the first region 210 based on the possibility of movement to the first region 210. One data may be prevented from moving to the third area 230 on the nonvolatile memory.
즉, 프로세서(120)는 결정되는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 데이터의 경우에는 휘발성 메모리(131) 상의 제2 영역(220)에 저장되어 있도록 하여 신속한 제1 영역(210)으로의 이동(스왑 인)을 보장할 수 있다.That is, the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
이러한 방식을 통해, 제2 영역(220)의 적어도 일부 영역을 회수하면서, 제3 영역(230)에 저장된 데이터가 제1 영역(210)으로 이동될 확률을 최소화시킬 수 있으며, 이를 통해 제3 영역(230)에 대한 읽기 횟수를 감소시키고, 제3 영역(230)의 수명이 빠른 시간 내에 단축되는 것을 방지할 수 있으며, 제2 영역(220)에서의 스왑 인을 보장하여 보다 신속한 어플리케이션 실행을 보장할 수 있다.Through this method, while recovering at least a portion of the second region 220, it is possible to minimize the probability that data stored in the third region 230 is moved to the first region 210, and through this, the third region The number of reads for the 230 is reduced, and the lifespan of the third area 230 can be prevented from being shortened within a short period of time, and the swap-in in the second area 220 is guaranteed to ensure faster application execution. can do.
일 실시예에 따른 이동 관리 모듈(122)은 1차 이동 태스크(123)를 이용하여 제2 영역(220)에 저장된 데이터를 제1 영역(210)으로 이동(또는 복귀)시킬 수 있다. 또한, 일 실시예에 따른 이동 관리 모듈(122)은 2차 이동 태스크(124)를 이용하여 제3 영역(230)에 저장된 데이터를 제1 영역(210)으로 이동(또는 복귀)시킬 수 있다. 본 발명의 다양한 실시예들에서 제2 영역(220), 또는 제3 영역(230)에 저장된 데이터를 제1 영역(210)으로 이동시키는 동작을 스왑 인이라 지칭할 수 있다. 추가로, 제1 영역(210)의 데이터를 제2 영역(220)으로 이동시키는 동작, 및/또는 제2 영역(220)에 저장된 데이터를 제3 영역(230)으로 이동시키는 동작을 스왑 아웃이라 지칭할 수 있다.The movement management module 122 according to an embodiment may move (or return) data stored in the second region 220 to the first region 210 using the primary movement task 123. Also, the movement management module 122 according to an embodiment may move (or return) data stored in the third region 230 to the first region 210 using the secondary movement task 124. In various embodiments of the present invention, an operation of moving data stored in the second area 220 or the third area 230 to the first area 210 may be referred to as swap-in. Additionally, an operation of moving data in the first region 210 to the second region 220 and / or an operation of moving data stored in the second region 220 to the third region 230 is referred to as swap-out. Can refer to.
본 발명의 다양한 실시예들에서 스왑 아웃 및/또는 스왑 인으로 인해 특정 영역에서 다른 영역으로 데이터가 이동되는 경우, 해당 데이터는 특정 영역에서 삭제될 수 있다. 본 발명의 다양한 실시예들에서 스왑 아웃 및/또는 스왑 인으로 인해 특정 영역에서 다른 영역으로 데이터가 이동되는 경우, 이동 관리 모듈(122)은 주소 매핑 데이터베이스에서 해당 데이터가 저장된 특정 영역에 대한 주소 매핑 정보를 삭제 또는 갱신할 수 있다. 실시예에 따라, 주소 매핑 데이터베이스는 각 영역에 저장된 데이터 별로 직접 접근 가능한 주소 정보를 포함할 수 있다. 또는, 주소 매핑 데이터베이스는 각 영역에 저장된 데이터별 인덱스와 각 인덱스를 실제 주소 정보로 변환하는 테이블을 포함할 수도 있다. 이동 관리 모듈(122)은 특정 영역에 대한 주소 매핑 정보를 삭제함으로써, 해당 주소에 저장된 데이터가 존재하지 않는 것으로 인식할 수 있다.When data is moved from one area to another area due to swap-out and / or swap-in in various embodiments of the present invention, the corresponding data may be deleted in the specific area. When data is moved from one region to another due to swap-out and / or swap-in in various embodiments of the present invention, the movement management module 122 maps an address to a specific region in which the corresponding data is stored in the address mapping database Information can be deleted or updated. According to an embodiment, the address mapping database may include address information directly accessible for each data stored in each area. Alternatively, the address mapping database may include an index for each data stored in each area and a table for converting each index to actual address information. The mobile management module 122 may recognize that there is no data stored in the corresponding address by deleting the address mapping information for the specific area.
예를 들어, 이동 관리 모듈(122)은 제2 영역(220)의 특정 영역에 저장된 제 1 데이터가 제3 영역(230)으로 이동될 경우, 제2 영역(220)에 저장된 데이터들에 대한 정보와 각 데이터들에 대한 주소 정보가 매핑된 주소 매핑 데이터베이스에서, 제 1 데이터에 대한 주소 매핑 정보를 삭제함으로써, 특정 영역에 데이터가 존재하지 않는 것으로 인식할 수 있다. 다른 예로, 이동 관리 모듈(122)은 제3 영역(230)의 특정 영역에 저장된 제 2 데이터가 제1 영역(210)으로 이동될 경우, 제3 영역(230)에 저장된 데이터들에 대한 정보와 각 데이터들에 대한 주소가 매핑된 주소 매핑 데이터베이스에서, 제 2 데이터에 대한 주소 매핑 정보를 삭제함으로써, 특정 영역에 데이터가 존재하지 않는 것으로 인식할 수 있다. 추가적으로, 이동 관리 모듈(122)은 특정 어플리케이션이 종료될 때, 제3 영역(230)에 저장된 데이터들 중에서 종료된 특정 어플리케이션에 대응되는 데이터가 저장된 특정 영역에 대한 주소 매핑 정보를 삭제할 수 있다.For example, when the first data stored in a specific area of the second area 220 is moved to the third area 230, the movement management module 122 may information about the data stored in the second area 220. In the address mapping database to which address information for each data is mapped, by deleting address mapping information for the first data, it can be recognized that there is no data in a specific area. As another example, when the second data stored in a specific area of the third area 230 is moved to the first area 210, the movement management module 122 may include information on data stored in the third area 230. In the address mapping database to which addresses for each data are mapped, it is possible to recognize that data does not exist in a specific area by deleting address mapping information for the second data. Additionally, when a specific application is terminated, the movement management module 122 may delete address mapping information for a specific region in which data corresponding to the terminated specific application is stored among data stored in the third region 230.
일 실시예에 따른 휘발성 메모리(131)는 프로그램 실행을 위해 프로그램 및 프로그램의 실행 관련 데이터를 적어도 일시적으로 저장하도록 지정된 제1 영역(210)과 제1 영역(210)의 가용 용량을 확보하기 위해 적어도 일시적으로 이용되지 않을 것으로 예상되는 프로그램 및 프로그램의 실행 관련 데이터를 저장하도록 지정된 제2 영역(220)을 포함할 수 있다. 제1 영역(210)은 시스템 메모리 영역일 수 있고, 제2 영역(220)은 데이터(예를 들어, 페이지 단위의 데이터)가 압축되어 저장되는 압축된 메모리 풀일 수 있다. 제1 영역(210), 및 제2 영역(220) 각각의 크기 또는 용량은 고정될 수도 있고, 가변될 수도 있다. 제2 영역(220)은 물리적으로 연속된 메모리 영역으로 구성될 수도 있고, 물리적으로 연속되지 않은 메모리 영역으로 구성될 수도 있다. Volatile memory 131 according to an embodiment is at least to secure the usable capacity of the first area 210 and the first area 210 designated to at least temporarily store programs and execution related data for the program execution. And a second region 220 designated to store programs and data related to execution of programs that are not expected to be temporarily used. The first area 210 may be a system memory area, and the second area 220 may be a compressed memory pool in which data (eg, page-level data) is compressed and stored. The size or capacity of each of the first region 210 and the second region 220 may be fixed or variable. The second region 220 may be configured as a physically contiguous memory region, or may be configured as a physically noncontiguous memory region.
일 실시예에 따른 비휘발성 메모리(132)는 휘발성 메모리(131)의 제2 영역(220)의 가용 용량을 확보하기 위해 적어도 일시적으로 이용되지 않을 것으로 예상되는 프로그램 및 프로그램의 실행 관련 데이터를 저장하도록 지정된 제3 영역(230)을 포함할 수 있다. 제3 영역(230)의 크기 또는 용량은 고정될 수도 있고, 가변될 수도 있다. 제3 영역(230)은 파일 시스템에 의해 관리될 수 있다. 제3 영역(230)은 물리적으로 연속된 메모리 영역으로 구성될 수도 있고, 물리적으로 연속되지 않은 메모리 영역으로 구성될 수도 있다.The non-volatile memory 132 according to an embodiment may store at least a program that is not expected to be temporarily used and data related to execution of the program in order to secure an available capacity of the second area 220 of the volatile memory 131. The designated third region 230 may be included. The size or capacity of the third region 230 may be fixed or variable. The third area 230 may be managed by a file system. The third region 230 may be configured as a physically contiguous memory region, or may be configured as a physically noncontiguous memory region.
도 3은 본 발명의 일 실시예에 따른 전자 장치(100)의 2단계 스왑 동작을 도시하고, 도 4는 본 발명의 일 실시예에 따른 전자 장치(100)가 데이터에 할당하는 속성 정보(400)를 나타내는 도면이고, 도 5는 본 발명의 일 실시예에 따른 전자 장치(100)가 2차 스왑을 제어하는 경우를 나타내는 도면이다.3 illustrates a two-step swap operation of the electronic device 100 according to an embodiment of the present invention, and FIG. 4 shows attribute information 400 assigned to data by the electronic device 100 according to an embodiment of the present invention ), And FIG. 5 is a diagram illustrating a case in which the electronic device 100 controls secondary swap according to an embodiment of the present invention.
도 3을 참조하면, 이동 관리 모듈(122)은 휘발성 메모리(131)의 제1 영역(210)의 가용 용량의 변화를 모니터하고, 제1 영역(210)의 가용 용량이 임계 용량보다 작아지는 경우, 1차 이동 태스크(123)를 활성화시킬 수 있다. 이동 관리 모듈(122)은 1차 이동 태스크(123)를 이용하여 휘발성 메모리(131)의 제1 영역(210)에 저장된 적어도 하나의 페이지 데이터를 압축한 후, 압축된 데이터를 휘발성 메모리(131)의 제2 영역(220)으로 이동시킬 수 있다.Referring to FIG. 3, the movement management module 122 monitors a change in the usable capacity of the first area 210 of the volatile memory 131 and when the usable capacity of the first area 210 becomes smaller than the threshold capacity , The primary movement task 123 may be activated. The movement management module 122 compresses at least one page data stored in the first area 210 of the volatile memory 131 using the primary movement task 123, and then compresses the compressed data into the volatile memory 131. It can be moved to the second region (220).
즉, 이동 관리 모듈(122)은, 제1 영역(210)의 가용 용량이 임계 용량보다 작아지는 경우, 1차 이동 태스크(123)를 이용하여, 제1 영역(210)의 데이터 중 미리 설정된 조건을 만족하는 데이터를 선택할 수 있다. 이 때, 미리 설정된 조건은 데이터의 제1 영역(210)에서의 저장 시간이 가장 오래된 데이터에 해당하는지 여부이거나, 미리 설정된 어플리케이션에 대응하는 데이터에 해당하는지 여부일 수 있다.That is, when the usable capacity of the first area 210 becomes smaller than the threshold capacity, the movement management module 122 uses the primary movement task 123 to set a preset condition among data in the first area 210. You can select data that satisfies. At this time, the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
즉, 이동 관리 모듈(122)은 제1 영역(210)의 페이지들 중에서 가장 오랫동안 사용되지 않은 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다. 예를 들어, 제1 영역(210)의 페이지를 스캔하여, 가장 오랫동안 사용되지 않은 적어도 하나의 페이지를 선택할 수 있다.That is, the movement management module 122 may select a page that has not been used for the longest time among the pages of the first region 210 and may move data of the selected page to the second region 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
또한, 이동 관리 모듈(122)은 제1 영역(210)의 페이지들 중에서 미리 설정된 어플리케이션에 대응하는 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다.In addition, the movement management module 122 may select a page corresponding to a preset application from among the pages of the first region 210 and move data of the selected page to the second region 220.
일 실시예에 따른 1차 이동 태스크(123)는 제1 영역(210)에서 제2 영역(220)으로 이동되는 데이터 각각에 속성 정보(400)를 할당할 수 있다.The primary movement task 123 according to an embodiment may assign attribute information 400 to each data moved from the first region 210 to the second region 220.
도 4를 참조하면, 속성 정보(400)는, 속성 정보(400)가 할당된 데이터의 제2 영역(220)에의 저장 시점에 대한 정보(410), 데이터 유형에 대한 정보(420), 대응하는 어플리케이션에 대한 정보(어플리케이션 Id)(430) 및 메모리 설정에 대한 정보(440) 중 적어도 하나를 포함할 수 있다.Referring to FIG. 4, the attribute information 400 includes information 410 about a storage time point of the data to which the attribute information 400 is assigned to the second region 220, information 420 about the data type, and corresponding data. It may include at least one of information about the application (application Id) 430 and information about the memory setting 440.
실시예에 따라, 이동 관리 모듈(122)은 'KSWAPD(kernel swap demon)'으로 지칭될 수 있고, 1차 이동 태스크(123)는 'ZSWAP(compressed swap)', 또는 'Zram(compressed random access memory block device)'으로 지칭될 수 있다. 그러나, 본 발명의 실시예들은 이에 한정되지 않는다.According to an embodiment, the movement management module 122 may be referred to as 'kernel swap daemon (KSWAPD)', and the primary movement task 123 may be 'compressed swap (ZSWAP)' or 'compressed random access memory (Zram)' block device) '. However, embodiments of the present invention are not limited thereto.
실시 예에 따라, 이동 관리 모듈(122)은 1차 이동 태스크(123)를 통해 2차 이동 태스크(124)를 생성하고, 2차 이동 태스크(124)를 이용하여 2차 스왑 기능의 활성 상태를 제어할 수 있다. 실시예에 따라, 2차 이동 태스크(124)는 'writeback'으로 지칭될 수 있다. 그러나, 본 발명의 실시예들은 이제 한정되지 않는다.According to an embodiment, the movement management module 122 generates a secondary movement task 124 through the primary movement task 123, and uses the secondary movement task 124 to determine the active state of the secondary swap function. Can be controlled. According to an embodiment, the secondary movement task 124 may be referred to as 'writeback'. However, embodiments of the present invention are not limited now.
일 실시예에 따른 2차 이동 태스크(124)는 휘발성 메모리(131)의 제2 영역(220)에서 지정된 조건을 만족하는 데이터를 비휘발성 메모리(132)의 제3 영역(230)로 이동시킬 수 있다.The secondary movement task 124 according to an embodiment may move data satisfying a condition specified in the second region 220 of the volatile memory 131 to the third region 230 of the nonvolatile memory 132. have.
일 실시예에 따른 이동 관리 모듈(122)은 제2 영역(220)에 저장된 데이터 각각의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기반하여 제2 영역(220)의 데이터를 제3 영역(230)으로 이동시키기 위한 2차 스왑 기능 활성 여부를 결정할 수 있다.The movement management module 122 according to an embodiment may store data in the second region 220 based on at least one of a storage time of each data stored in the second region 220 and a possibility of movement to the first region 210. It may be determined whether or not the secondary swap function for moving the data to the third region 230 is activated.
구체적으로, 일 실시예에 따른 이동 관리 모듈(122)은 제2 영역(220)에의 저장 시점에 대한 정보(410)에 기초하여 제2 영역(220)의 데이터 각각의 제2 영역(220)에서의 저장 시간을 확인할 수 있다.Specifically, the movement management module 122 according to an embodiment is based on the information 410 on the storage time in the second region 220 in the second region 220 of each data of the second region 220. You can check the storage time.
일 실시예에 따른 이동 관리 모듈(122)은 확인된 저장 시간에 기초하여 제2 영역(220)에 저장된 데이터 중 저장 시간이 대응하는 임계 저장 시간 이상인 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터에 대하여 2차 스왑 즉, 제2 영역(220)에서 제3 영역(230)으로의 이동을 수행할 것을 결정할 수 있다. 예를 들어, 임계 저장 시간은 30초로 설정될 수 있다. 그러나, 이러한 수치는 설명을 위한 예시적인 것으로서, 본 발명의 다양한 실시 예들은 이에 한정되지 않는다.The movement management module 122 according to an embodiment determines at least one data of which the storage time is greater than or equal to a corresponding threshold storage time among data stored in the second area 220 based on the identified storage time, and the determined at least one It may be determined to perform a secondary swap, that is, a movement from the second region 220 to the third region 230 on the data. For example, the threshold storage time can be set to 30 seconds. However, these figures are illustrative only, and various embodiments of the present invention are not limited thereto.
이 때, 일 실시예에 따른 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 중요도에 기초하여 임계 저장 시간을 조정할 수 있다. 구체적으로, 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정하고, 제1 영역(210)으로의 이동 가능성에 비례하도록 제2 영역(220)에 저장된 데이터 각각의 임계 저장 시간을 결정할 수 있다.In this case, the secondary movement task 124 according to an embodiment may adjust the threshold storage time based on the importance of each data stored in the second region 220. Specifically, the processor 120 determines the possibility of movement of each of the data stored in the second region 220 to the first region 210, and the second region (so as to be proportional to the probability of movement to the first region 210) A threshold storage time of each data stored in 220 may be determined.
구체적으로, 일 실시예에 따른 2차 이동 태스크(124)는 제1 영역(210)으로의 기준 이동 가능성에 대응하는 기준 임계 저장 시간(예: 30초)에 기초하여, 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성보다 큰 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 길어지도록 조정할 수 있으며, 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성보다 작은 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 짧아지도록 조정할 수 있다.Specifically, the secondary movement task 124 according to an embodiment may be based on a reference threshold storage time (eg, 30 seconds) corresponding to a reference movement possibility to the first region 210, the first region 210 The threshold storage time may be adjusted to be longer than the reference threshold storage time when the mobility to the mobile station is greater than the reference mobility, and the threshold storage time may be referenced when the mobility to the first area 210 is less than the reference mobility. It can be adjusted to be shorter than the critical storage time.
예를 들어, 도 5에 도시된 바와 같이, 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성에 해당하는 제1 데이터(510)의 임계 저장 시간은 30초가 될 수 있으며, 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성보다 큰 제2 데이터(520)의 임계 저장 시간은 50초가 될 수 있으며, 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성보다 작은 제3 데이터(530)의 임계 저장 시간은 20초가 될 수 있다. 다만, 기준 임계 저장 시간의 예는 설명을 위한 예시적인 것으로서, 설정에 따라 달라질 수 있다. 또한, 결정되는 임계 저장 시간과 기준 임계 저장 시간 사이의 차이는, 제1 영역(210)으로의 이동 가능성과 기준 이동 가능성 사이의 차이에 비례할 수 있다.For example, as illustrated in FIG. 5, the threshold storage time of the first data 510 in which the possibility of movement to the first area 210 corresponds to the reference mobility may be 30 seconds, and the first area ( The threshold storage time of the second data 520 in which the mobility to 210 is greater than the reference mobility may be 50 seconds, and the third data 530 in which the mobility to the first area 210 is less than the reference mobility ), The critical storage time may be 20 seconds. However, the example of the reference threshold storage time is an example for explanation, and may vary depending on the setting. In addition, the difference between the determined threshold storage time and the reference threshold storage time may be proportional to the difference between the mobility to the first region 210 and the reference mobility.
또한, 일 실시예에 따른 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 적어도 하나의 데이터가 비휘발성 메모리 상의 제3 영역(230)으로 이동하는 것을 금지할 수 있다.In addition, the secondary movement task 124 according to an embodiment may move to the first region 210 based on the possibility of movement of the data stored in the second region 220 to the first region 210. It is possible to prevent the expected at least one data from moving to the third area 230 on the nonvolatile memory.
즉, 프로세서(120)는 결정되는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 데이터의 경우에는 휘발성 메모리(131) 상의 제2 영역(220)에 저장되어 있도록 하여 신속한 제1 영역(210)으로의 이동(스왑 인)을 보장할 수 있다.That is, the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
예를 들어, 도 5에 도시된 바와 같이, 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 중 제1 영역(210)으로의 이동 가능성이 미리 설정된 임계 이동 가능성 이상에 해당하는 제4 데이터(540)의 경우, 임계 시간 내에 제1 영역(210)으로의 이동이 예상되는 것으로 판단하여, 제4 데이터(540)가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.For example, as illustrated in FIG. 5, the secondary movement task 124 corresponds to a probability of movement to the first region 210 of data stored in the second region 220 equal to or greater than a preset threshold movement possibility. In the case of the fourth data 540, it is determined that movement to the first region 210 is expected within a threshold time, and thus it is possible to prohibit the fourth data 540 from moving to the third region 230.
즉, 일 실시예에 따른 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제2 영역(220)에서의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역(220)에 저장된 데이터 각각을 제3 영역(230)으로 이동하도록 제어하거나 제3 영역(230)으로 이동하지 않도록 제어할 수 있다.That is, the processor 120 according to an embodiment is based on at least one of a storage time in the second area 220 of each data stored in the second area 220 and a possibility of moving to the first area 210. Each data stored in the second region 220 may be controlled to move to the third region 230 or may be controlled not to move to the third region 230.
이를 위해, 일 실시예에 따른 프로세서(120)의 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.To this end, the secondary movement task 124 of the processor 120 according to an embodiment may determine the possibility of movement of the data stored in the second region 220 to the first region 210.
일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU 사용시간 중 적어도 하나에 비례하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.The secondary movement task 124 according to an embodiment is proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second area 220. The possibility of movement of the data stored in the second area 220 to the first area 210 may be determined.
즉, 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU 사용시간 중 적어도 하나를 대응하는 임계값과 비교하여, 임계값 이상의 값을 갖는 경우 해당 어플리케이션이 다시 실행될 확률이 높은 것으로 판단하고, 해당 어플리케이션의 데이터들이 제1 영역(210)으로의 이동 가능성이 높은 것으로 판단할 수 있다. 이 경우, 임계값과의 차이가 클수록 제1 영역(210)으로의 이동 가능성이 높은 확률을 나타낼 수 있다.That is, the secondary movement task 124 compares at least one of the page fault ratio, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 with a corresponding threshold value. Accordingly, when the value is greater than or equal to a threshold, it is determined that the probability of the application being executed again is high, and it is determined that the data of the application is highly likely to move to the first region 210. In this case, the greater the difference from the threshold, the higher the probability of movement to the first region 210.
이 때, 2차 이동 태스크(124)는 제1 영역(210)으로의 이동 가능성이 높은 해당 어플리케이션의 데이터들이 제2 영역(220)에 보다 오랫동안 저장되어 있을 수 있도록 기준 임계 저장 시간(예: 30초)을 제1 영역(210)으로의 이동 가능성에 비례하여 길어지도록 조정하여 데이터에 대응하는 임계 저장 시간을 결정할 수 있다.At this time, the secondary moving task 124 may perform a reference threshold storage time (eg, 30) so that data of a corresponding application having a high possibility of moving to the first area 210 may be stored in the second area 220 for a longer time. Seconds) may be adjusted to be longer in proportion to the possibility of movement to the first area 210 to determine a critical storage time corresponding to the data.
이 때, 페이지 폴트는 어플리케이션의 실행에 있어 해당 어플리케이션에 대응하는 페이지가 휘발성 메모리(131)의 제1 영역(210)에 존재하지 않음에 따라 제2 영역(220)에 저장된 대응하는 페이지를 불러옴에 따라 발생하는 중단을 의미한다. 따라서, 2차 이동 태스크(124)는 어플리케이션의 페이지 폴트율이 높은 경우 제2 영역(220)에 저장된 해당 데이터의 제1 영역(210)으로의 이동 가능성이 높은 것으로 판단할 수 있다.At this time, the page fault causes the corresponding page stored in the second area 220 to be loaded as the page corresponding to the application does not exist in the first area 210 of the volatile memory 131 when the application is executed. It means the interruption that occurs accordingly. Accordingly, when the page fault rate of the application is high, the secondary movement task 124 may determine that the data stored in the second region 220 is highly likely to move to the first region 210.
또한, 실행 빈도는 전자 장치(100)의 운영체제의 시작 이후 측정되는 어플리케이션 실행 횟수를 의미한다. 따라서, 2차 이동 태스크(124)는 어플리케이션의 실행 빈도가 높은 경우 제2 영역(220)에 저장된 해당 데이터의 제1 영역(210)으로의 이동 가능성이 높은 것으로 판단할 수 있다.In addition, the execution frequency means the number of application executions measured since the start of the operating system of the electronic device 100. Accordingly, when the execution frequency of the application is high, the secondary movement task 124 may determine that the possibility of movement of the corresponding data stored in the second region 220 to the first region 210 is high.
또한, CPU 사용시간은 전자 장치(100)의 운영체제의 시작 이후 측정되는 어플리케이션의 CPU 사용시간을 의미한다. CPU 사용시간이 짧을수록 해당 어플리케이션은 유휴상태이거나 긴 시간을 주기로 동작하는 어플리케이션에 해당할 수 있다. 이 경우, 해당 어플리케이션은 시스템 메모리 영역 즉, 제1 영역(210)을 사용할 확률이 낮을 수 있다. 따라서, 2차 이동 태스크(124)는 어플리케이션의 CPU 사용시간가 높은 경우 제2 영역(220)에 저장된 해당 데이터의 제1 영역(210)으로의 이동 가능성이 높은 것으로 판단할 수 있다.In addition, the CPU usage time refers to the CPU usage time of an application measured after the start of the operating system of the electronic device 100. As the CPU usage time is shorter, the corresponding application may correspond to an application that is idle or operates with a long period of time. In this case, the application may have a low probability of using the system memory area, that is, the first area 210. Accordingly, when the CPU usage time of the application is high, the secondary movement task 124 may determine that the possibility of movement of the corresponding data stored in the second region 220 to the first region 210 is high.
이처럼, 2차 이동 태스크(124)는 어플리케이션에 대한 정보(430)에 기초하여 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나를 판단할 수 있으며, 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나를 제1 영역(210)으로의 기준 이동 가능성에 대응하는 각각의 임계값과 비교하여, 해당 어플리케이션에 대응하는 데이터의 임계 저장 시간을 결정할 수 있다.As such, the secondary movement task 124 determines at least one of the page fault rate, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 based on the information 430 about the application. It is possible to compare at least one of the page fault rate, the execution frequency and the CPU usage time with each threshold value corresponding to the reference mobility to the first area 210, and the critical storage time of the data corresponding to the application. Can decide.
즉, 2차 이동 태스크(124)는 어플리케이션의 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나에 기초하여 해당 어플리케이션에 대응하는 제2 영역(220)에 저장된 데이터의 제1 영역(210)으로의 이동 가능성을 판단할 수 있으며, 제1 영역(210)으로의 이동 가능성이 기준 이동가능성 보다 낮은 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 짧게 결정하여 해당 데이터가 보다 빠르게 제3 영역(230)으로 이동하게 제어하며, 제1 영역(210)으로의 이동 가능성이 기준 이동가능성 보다 높은 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 길게 결정하여 해당 데이터가 제2 영역(220)에 보다 오래 저장되어 있도록 제어할 수 있다.That is, the secondary moving task 124 is the first area 210 of data stored in the second area 220 corresponding to the application based on at least one of the page fault rate, execution frequency, and CPU usage time of the application. When the mobility of the first area 210 is lower than the reference mobility, the critical storage time is determined to be shorter than the reference threshold storage time, so that the corresponding data is faster than the third area 230 If the possibility of movement to the first area 210 is higher than the reference mobility, the critical storage time is determined to be longer than the reference threshold storage time, and the corresponding data is stored in the second area 220 longer. Control.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 전경(foreground) 상태 또는 배경(background) 상태에 기초하여 제2 영역(220)에 저장된 데이터 각각의 상기 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment of the present disclosure may include the second area 220 based on the foreground state or the background state of the application corresponding to each data stored in the second area 220. ), It is possible to determine the possibility of movement of each data stored in the first region 210.
구체적으로, 2차 이동 태스크(124)는 어플리케이션이 전경 상태인 경우에는 대응하는 제2 영역(220)에 저장된 데이터가 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 판단하고, 대응하는 제2 영역(220)에 저장된 데이터가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.Specifically, when the application is in the foreground state, the secondary movement task 124 determines that the probability that the data stored in the corresponding second region 220 moves to the first region 210 is greater than or equal to the critical movement probability. Data stored in the second region 220 may be prevented from moving to the third region 230.
또한, 2차 이동 태스크(124)는 어플리케이션이 배경 상태인 경우에는 대응하는 제2 영역(220)에 저장된 데이터가 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성 또는 그 이하인 것으로 판단하고, 대응하는 임계 저장 시간을 기준 임계 저장 시간 또는 그 이하로 결정하여 대응하는 제2 영역(220)에 저장된 데이터가 보다 빠르게 제3 영역(230)으로 이동하도록 제어할 수 있다.In addition, when the application is in the background state, the secondary movement task 124 determines that the data stored in the corresponding second region 220 is moved to the first region 210 as a reference mobility or less. The corresponding threshold storage time may be determined as or less than the reference threshold storage time to control the data stored in the corresponding second area 220 to move to the third area 230 more quickly.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 대응하는 어플리케이션에 대한 정보(430)에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may correspond to information on a relationship between a preset application and a possibility of movement to the first region 210 and data stored in the second region 220, respectively. Based on the information 430 for the application, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 설정된 어플리케이션의 리스트를 포함할 수 있다.The information on the relationship between the preset application and the possibility of movement to the first area 210 may include a list of applications that are set to have the possibility of movement to the first area 210 to be greater than or equal to the critical mobility.
예를 들어, 사용자의 입력을 입력받는 IME(input method editor) 어플리케이션의 경우 사용자 입력을 기다리는 동안 해당 어플리케이션에 대응하는 데이터가 제3 영역(230)으로 이동한다면 다시 스왑 인 동작이 수행되어야 하므로 사용자의 반응성이 저하될 수 있다. 따라서, IME 어플리케이션에 대하여 스왑 인 속도가 비교적 빠른 제2 영역(220)으로의 이동은 허용하되, 스왑 인 속도가 상대적으로 느린 제3 영역(230)으로의 이동은 금지시킬 필요가 있다.For example, in the case of an input method editor (IME) application that receives user input, if data corresponding to the application moves to the third area 230 while waiting for user input, a swap-in operation must be performed again, so that the user Reactivity may decrease. Therefore, it is necessary to allow movement to the second area 220 where the swap-in speed is relatively fast for the IME application, but to prohibit the movement to the third area 230 where the swap-in speed is relatively slow.
따라서, 2차 이동 태스크(124)는, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여, 어플리케이션의 리스트에 포함되는 어플리케이션에 대응하는 제2 영역(220)의 데이터가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.Accordingly, the second movement task 124 is based on information on the relationship between the preset application and the possibility of movement to the first region 210, and the second region 220 corresponding to the application included in the list of applications. ) May be prevented from moving to the third area 230.
또한, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 어플리케이션의 우선순위에 따른 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 구체적으로, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 기준 우선순위 이상의 어플리케이션의 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상임을 나타낼 수 있다.In addition, information on the relationship between the preset application and the possibility of moving to the first area 210 may include information about the possibility of moving to the first area 210 according to the priority of the application. Specifically, the information on the relationship between the preset application and the mobility to the first area 210 may indicate that the mobility of the application with the reference priority or higher to the first area 210 is greater than or equal to the critical mobility.
예를 들어, 실시간성을 요하는 보안 관련 어플리케이션의 경우 우선순위가 다른 어플리케이션 보다 높을 수 있다. 즉, 보안 관련 어플리케이션의 우선순위는 임계 이동 가능성과 대응하는 것으로 설정된 기준 우선순위 이상일 수 있다. 따라서, 2차 이동 태스크(124)는 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 보안 관련 어플리케이션에 대응하는 데이터에 대한 제3 영역(230)으로의 이동을 금지할 수 있다.For example, in the case of security-related applications requiring real-time performance, the priority may be higher than other applications. That is, the priority of the security-related application may be greater than or equal to the reference priority set to correspond to the critical mobility. Therefore, the secondary movement task 124 may be configured for data corresponding to the security-related application stored in the second region 220 based on information on the relationship between the preset application and the possibility of movement to the first region 210. Movement to the third region 230 may be prohibited.
즉, 2차 이동 태스크(124)는 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 대응하는 어플리케이션의 우선순위를 판단하고, 기준 우선순위 이상의 우선순위를 갖는 어플리케이션에 대응하는 데이터의 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 판단하여, 해당 데이터의 제3 영역(230)으로의 이동을 금지시킬 수 있다.That is, the secondary movement task 124 prioritizes the corresponding application of each data stored in the second region 220 based on information on a relationship between a preset application and a possibility of movement to the first region 210. Is determined, and it is determined that the probability of movement of data corresponding to an application having a priority higher than or equal to the reference priority is greater than or equal to the threshold movement probability, and the movement of the corresponding data to the third region 230 is determined. It can be banned.
미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 설계 단계에서 시스템 관리자(administrator)에 의하여 설정될 수 있으며, 사용자에 의하여 설정될 수도 있다. 또한, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 외부 서버로부터 획득될 수도 있다.Information about the relationship between the preset application and the possibility of moving to the first area 210 may be set by a system administrator in the design stage, or may be set by a user. In addition, information on a relationship between a preset application and a possibility of moving to the first area 210 may be obtained from an external server.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 데이터 유형에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may include information on a relationship between a preset data type and the possibility of movement to the first region 210 and data of each data stored in the second region 220. Based on the information on the type, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
이 때, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는, 데이터 유형 각각의 미리 설정된 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 즉, 전자 장치(100)는 메모리(130) 상에 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성을 저장할 수 있으며, 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성은 설계 단계에서 저장되거나, 사용자에 의하여 저장될 수 있으며, 외부 서버로부터 획득될 수 있다.In this case, the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type. . That is, the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
예를 들어, 스트리밍(streaming) 데이터는 사용자의 어플리케이션 실행에 따라 지속적으로 제1 영역(210)으로 이동할 수 있다. 따라서, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 스트리밍 데이터에 대하여 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성보다 높은 것으로 나타낼 수 있다.For example, streaming data may continuously move to the first area 210 according to the user's application execution. Accordingly, information on the relationship between the preset data type and the mobility to the first area 210 may indicate that the mobility to the first area 210 is higher than the threshold mobility to the streaming data.
이 경우, 2차 이동 태스크(124)는 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 스트리밍 데이터가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.In this case, the secondary movement task 124 may include streaming data stored in the second region 220 based on information on a relationship between a preset data type and the possibility of movement to the first region 210. 230).
즉, 2차 이동 태스크(124)는 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 이동 가능성을 결정할 수 있으며, 데이터 각각의 이동 가능성에 기초하여 임계 저장 시간을 결정하거나, 제3 영역(230)으로의 이동을 금지할 수 있다.That is, the secondary movement task 124 may determine the mobility of each of the data stored in the second region 220 based on information on the relationship between the preset data type and the mobility to the first region 210. In addition, a threshold storage time may be determined based on the possibility of movement of each data, or movement to the third region 230 may be prohibited.
또한, 일 실시예에 따른 2차 이동 태스크(124)는, 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may move to the first area 210 of each data stored in the second area 220 based on the memory setting of each data stored in the second area 220. Can determine the likelihood of movement.
즉, 2차 이동 태스크(124)는, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 대한 정보(440)에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.That is, the secondary movement task 124 includes information on a relationship between a preset memory setting and a possibility of moving to the first area 210 and information on each memory setting of data stored in the second area 220 ( Based on 440, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
이 때, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 메모리 설정에 따른 제1 영역(210)으로의 이동 가능성을 나타낼 수 있다.At this time, information on the relationship between the preset memory setting and the possibility of moving to the first area 210 may indicate the possibility of moving to the first area 210 according to the memory setting.
구체적으로, 어플리케이션은 할당된 메모리에 대하여 madvise 시스템콜을 이용하여 메모리 어드바이스 설정이 가능하다. 즉, 어플리케이션은 시스템콜을 통하여 메모리 어드바이스를 설정하여, 할당된 메모리의 사용방식을 메모리(130)에 권고(advise)할 수 있다. 이 때, 메모리 설정은 할당된 메모리의 사용방식을 메모리(130)에 권고하는 플래그(flag) 값에 해당할 수 있으며, 설정에 따라 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내거나, 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타낼 수 있다.Specifically, the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory. At this time, the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
예를 들어, 스트리밍으로 영상을 제공하는 어플리케이션에 있어서, 로그인 과정에서 필요한 로그인, 세션 및 사용자 정보에 대한 데이터는 영상이 재생되는 중에는 실행되지 않으므로, 로그인, 세션 및 사용자 정보에 대한 데이터는 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 플래그 값이 할당될 수 있으며, 해당 메모리가 그에 따라 설정될 수 있다.For example, in an application that provides an image by streaming, data for login, session, and user information required in the login process is not executed while the image is being played, so data for login, session, and user information is the second area. A flag value indicating that there is no possibility of movement from 220 to the first area 210 may be allocated, and the corresponding memory may be set accordingly.
또한, 영상이 재생되는 중에는 메뉴 화면, 영상 리스트 및 광고에 대한 데이터가 실행되지 않으므로, 메뉴 화면, 영상 리스트 및 광고에 대한 데이터는 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 플래그 값이 할당될 수 있으며, 해당 메모리가 그에 따라 설정될 수 있다.In addition, since the data for the menu screen, the video list, and the advertisement are not executed while the video is being played, the data for the menu screen, the video list, and the advertisement may move from the second area 220 to the first area 210. A flag value indicating this absence can be assigned, and the corresponding memory can be set accordingly.
또한, 영상이 재생되는 중 스트리밍 데이터는 계속적으로 실행되므로, 스트리밍 데이터는 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 플래그 값이 할당될 수 있으며, 해당 메모리가 그에 따라 설정될 수 있다.In addition, since the streaming data is continuously executed while the image is being played, a flag value indicating that there is no possibility of movement from the second area 220 to the first area 210 may be assigned, and the corresponding memory is It can be set accordingly.
이 때, 2차 이동 태스크(124)는, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 금지하고, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 수행할 수 있다.At this time, the secondary movement task 124, based on the information on the relationship between the preset memory setting and the possibility of movement to the first area 210, the memory setting is the first area in the second area 220 For data indicating that there is a possibility of movement to 210, movement to the third region 230 is prohibited, and there is no possibility that the memory setting moves from the second region 220 to the first region 210. Moving to the third area 230 may be performed on the indicated data.
일 실시예에 따라, 2차 이동 태스크(124)는 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 해당 데이터가 임계 저장 시간과의 비교없이 즉각적으로 제3 영역(230)으로의 이동하도록 제어할 수 있다. 즉, 2차 이동 태스크(124)는 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 해당 데이터에 대응하는 임계 저장 시간을 '0'으로 결정할 수 있다.According to one embodiment, the secondary movement task 124 compares the data with the critical storage time for data indicating that the memory setting is not likely to move from the second region 220 to the first region 210. It can be controlled to immediately move to the third region 230 without. That is, the secondary moving task 124 sets the threshold storage time corresponding to the data to '0' for data indicating that the memory setting has no possibility of moving from the second area 220 to the first area 210. Can decide.
이처럼, 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나를 고려하여, 제2 영역(220)에 저장된 데이터 각각의 제3 영역(230)으로의 이동 여부를 결정할 수 있다.As described above, the secondary movement task 124 considers at least one of the storage time of each data stored in the second region 220 and the possibility of movement to the first region 210, and thus the data stored in the second region 220 Whether to move to each third region 230 may be determined.
이를 통해, 제2 영역(220)에 상대적으로 오랫동안 머무르는 것으로 판단되는 데이터는 제3 영역(230)으로 이동시킴으로써, 제2 영역(220)의 가용 용량을 확보할 수 있으며, 어플리케이션의 중요도에 따라 제1 영역(210)으로의 이동 가능성이 높은 데이터에 대하여는 이동을 지연하거나 금지함으로써, 제3 영역(230)으로부터의 스왑 인 횟수를 줄여 전자 장치(100)의 어플리케이션 실행 속도를 향상시킬 수 있다.Through this, data determined to stay in the second region 220 for a relatively long time may be moved to the third region 230 to secure the usable capacity of the second region 220, and may be applied according to the importance of the application. By delaying or prohibiting the movement of data having a high possibility of moving to one region 210, the number of swap-ins from the third region 230 can be reduced to improve the application execution speed of the electronic device 100.
또한, 일 실시예에 따른 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴 및 큐(queue) 상태 중 적어도 하나에 기초하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단하고, 비휘발성 메모리가 유휴 상태인 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.In addition, the secondary movement task 124 according to an embodiment determines whether the nonvolatile memory 132 is in an idle state based on at least one of a usage pattern and a queue state of the nonvolatile memory 132, When the nonvolatile memory is in an idle state, at least one data determined to have a storage time equal to or greater than a threshold storage time may be controlled to move to the third area 230.
즉, 2차 이동 태스크(124)는 비휘발성 메모리가 유휴 상태인 경우에만 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.That is, the secondary movement task 124 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to move to the third area 230 only when the nonvolatile memory is in an idle state.
이를 위해, 2차 이동 태스크(124)는 전자 장치(100)의 동작에 따른 비휘발성 메모리(132)의 읽기(write) 횟수 및 쓰기(read) 횟수를 나타내는 비휘발성 메모리(132)의 사용 패턴 및 전자 장치(100)의 현재 동작에 기초하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단할 수 있다.To this end, the secondary movement task 124 uses patterns of the nonvolatile memory 132 indicating the number of writes and the number of reads of the nonvolatile memory 132 according to the operation of the electronic device 100 and Based on the current operation of the electronic device 100, it may be determined whether the nonvolatile memory 132 is in an idle state.
구체적으로, 비휘발성 메모리(132)의 사용 패턴은 전자 장치(100)의 부팅 및 스트리밍 영상을 제공하는 어플리케이션 실행 등의 전자 장치(100)의 동작에 대하여는 읽기 횟수가 많음을 나타낼 수 있다. 또한, 비휘발성 메모리(132)의 사용 패턴은 어플리케이션 설치 등의 전자 장치(100)의 동작에 대하여는 쓰기 횟수가 많음을 나타낼 수 있다. 다만, 상기 전자 장치(100)의 동작은 예시에 불과하며, 전자 장치(100)가 수행할 수 있는 동작 단위로 비휘발성 메모리(132)의 사용 패턴이 결정될 수 있다.Specifically, the usage pattern of the nonvolatile memory 132 may indicate that the number of reads is large for the operation of the electronic device 100 such as booting the electronic device 100 and executing an application that provides a streaming image. Also, the usage pattern of the nonvolatile memory 132 may indicate that the number of writes is large for the operation of the electronic device 100 such as application installation. However, the operation of the electronic device 100 is only an example, and a usage pattern of the nonvolatile memory 132 may be determined as an operation unit that can be performed by the electronic device 100.
즉, 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는지 여부를 판단하여, 비휘발성 메모리(132)의 유휴 상태를 판단할 수 있다.That is, the secondary movement task 124 determines whether the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number based on the usage pattern of the nonvolatile memory 132 , It is possible to determine the idle state of the nonvolatile memory 132.
다시 말해, 2차 이동 태스크(124)는, 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터의 이동을 보류할 수 있으며, 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수 이하의 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.In other words, when the second movement task 124 corresponds to an operation in which the current operation of the electronic device 100 exceeds the threshold number of times based on the usage pattern of the nonvolatile memory 132, The movement of at least one data stored in the second region 220 determined as the storage time is greater than or equal to the threshold storage time may be suspended, and the current operation of the electronic device 100 may be performed based on the usage pattern of the nonvolatile memory 132. When the number of reads and the number of writes corresponds to an operation less than or equal to the threshold number, it is possible to control at least one data stored in the second area 220 determined as the storage time to be greater than or equal to the threshold storage time to move to the third area 230. have.
또한, 2차 이동 태스크(124)는 비휘발성 메모리(132)의 큐 상태 즉, I/O queue 상태가 나타내는 읽기 횟수 및 쓰기 횟수를 임계 횟수와 비교하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단할 수 있다.In addition, the secondary moving task 124 compares the number of reads and writes indicated by the queue state of the non-volatile memory 132, that is, the I / O queue state, with the threshold number to determine whether the non-volatile memory 132 is idle. I can judge.
구체적으로, 2차 이동 태스크(124)는, 비휘발성 메모리(132)의 큐 상태 에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터의 이동을 보류할 수 있으며, 비휘발성 메모리(132)의 큐 상태 에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수가 임계 횟수 이하의 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.Specifically, the secondary movement task 124, when the number of reads and writes of the nonvolatile memory 132 corresponds to an operation exceeding a threshold number of times based on the queue state of the nonvolatile memory 132, the storage time The movement of at least one data stored in the second area 220 determined to be greater than or equal to the threshold storage time may be withheld, and the number of reads and writes of the nonvolatile memory 132 based on the queue state of the nonvolatile memory 132 When the number of times corresponds to an operation of less than or equal to the threshold number of times, it may be controlled to move at least one data stored in the second area 220 determined as the storage time is greater than or equal to the threshold storage time to the third area 230.
또한, 일 실시예에 따른 2차 이동 태스크(124)는 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 결정된 적어도 하나의 데이터를 미리 설정된 임계 크기 이하의 크기로 분할하고, 분할된 데이터가 순차적으로 제3 영역(230)으로 이동하도록 제어할 수 있다.In addition, when the total data size of at least one data determined that the storage time is greater than or equal to the threshold storage time is greater than or equal to a preset threshold size, the secondary movement task 124 according to an embodiment may set the determined at least one data to a preset threshold size. It can be divided into the following sizes and controlled to sequentially move the divided data to the third region 230.
이 때, 2차 이동 태스크(124)는 분할된 데이터가 미리 설정된 시간 간격에 기초하여 제3 영역(230)으로 이동하도록 제어할 수 있다.At this time, the secondary movement task 124 may control the divided data to move to the third region 230 based on a preset time interval.
또한, 일 실시예에 따른 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 미리 설정된 임계 크기를 조정할 수 있다. 즉, 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수를 결정하고, 읽기 횟수 및 쓰기 횟수에 기초하여 제2 영역(220)에서 제3 영역(230)으로 이동하는 데이터 량을 제한하는 임계 크기를 조정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory 132. That is, the secondary move task 124 determines the number of reads and writes of the nonvolatile memory 132 based on at least one of the usage pattern and the queue state of the nonvolatile memory 132, and determines the number of reads and writes. Based on this, the threshold size limiting the amount of data moving from the second area 220 to the third area 230 may be adjusted.
이하, 일 실시예에 따른 전자 장치(100)의 제어 방법을 설명하기로 한다. 후술하는 전자 장치(100)의 제어 방법에는 전술한 실시예에 따른 전자 장치(100)가 적용될 수 있다. 따라서, 앞서 도 1 내지 도 5를 참조하여 설명한 내용은 특별한 언급이 없더라도 일 실시예에 따른 전자 장치(100)의 제어 방법에도 동일하게 적용 가능하다.Hereinafter, a control method of the electronic device 100 according to an embodiment will be described. The electronic device 100 according to the above-described embodiment may be applied to a control method of the electronic device 100 described below. Therefore, the contents described with reference to FIGS. 1 to 5 are equally applicable to the control method of the electronic device 100 according to an embodiment even if there is no special mention.
도 6은 본 발명의 일 실시예에 따른 전자 장치(100)의 제어방법에 있어서, 비휘발성 메모리(132) 상의 제3 영역(230)으로 이동시킬 데이터를 결정하는 경우에 관한 순서도이다.6 is a flowchart illustrating a case of determining data to be moved to the third area 230 on the nonvolatile memory 132 in the control method of the electronic device 100 according to an embodiment of the present invention.
도 6을 참조하면, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제1 영역(210)의 데이터 중 미리 설정된 조건을 만족하는 데이터를 선택할 수 있다(610).Referring to FIG. 6, the processor 120 of the electronic device 100 according to an embodiment may select data satisfying a preset condition from among data in the first area 210 (operation 610).
구체적으로, 프로세서(120)는, 제1 영역(210)의 가용 용량이 임계 용량보다 작아지는 경우, 1차 이동 태스크(123)를 이용하여, 제1 영역(210)의 데이터 중 미리 설정된 조건을 만족하는 데이터를 선택할 수 있다. 이 때, 미리 설정된 조건은 데이터의 제1 영역(210)에서의 저장 시간이 가장 오래된 데이터에 해당하는지 여부이거나, 미리 설정된 어플리케이션에 대응하는 데이터에 해당하는지 여부일 수 있다.Specifically, when the usable capacity of the first region 210 becomes smaller than the threshold capacity, the processor 120 uses the primary movement task 123 to set a preset condition among data in the first region 210. Satisfactory data can be selected. At this time, the preset condition may be whether the storage time in the first area 210 of the data corresponds to the oldest data or whether it corresponds to data corresponding to the preset application.
즉, 프로세서(120)느 제1 영역(210)의 페이지들 중에서 가장 오랫동안 사용되지 않은 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다. 예를 들어, 제1 영역(210)의 페이지를 스캔하여, 가장 오랫동안 사용되지 않은 적어도 하나의 페이지를 선택할 수 있다.That is, the processor 120 may select a page that has not been used for the longest time among the pages of the first area 210 and may move data of the selected page to the second area 220. For example, a page of the first area 210 may be scanned to select at least one page that has not been used for the longest time.
또한, 프로세서(120)는 제1 영역(210)의 페이지들 중에서 미리 설정된 어플리케이션에 대응하는 페이지를 선택하고, 선택된 페이지의 데이터를 제2 영역(220)으로 이동시킬 수 있다.In addition, the processor 120 may select a page corresponding to a preset application from among the pages of the first area 210 and move data of the selected page to the second area 220.
일 실시예에 따른 전자 장치(100)의 프로세서(120)는 선택된 데이터 각각에 속성 정보(400)를 할당할 수 있다(620). 또한, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 선택된 데이터를 제2 영역(220)으로 이동하도록 제어할 수 있다(630). 즉, 프로세서(120)는 제1 영역(210)에서 제2 영역(220)으로 이동되는 데이터 각각에 속성 정보(400)를 할당할 수 있다. The processor 120 of the electronic device 100 according to an embodiment may allocate attribute information 400 to each of the selected data (operation 620). Also, the processor 120 of the electronic device 100 according to an embodiment may control to move the selected data to the second region 220 (630). That is, the processor 120 may allocate attribute information 400 to each data moved from the first region 210 to the second region 220.
이 때, 속성 정보(400)는, 속성 정보(400)가 할당된 데이터의 제2 영역(220)에의 저장 시점에 대한 정보(410), 데이터 유형에 대한 정보(420), 대응하는 어플리케이션에 대한 정보(어플리케이션 Id)(430) 및 메모리 설정에 대한 정보(440) 중 적어도 하나를 포함할 수 있다. At this time, the attribute information 400 includes information 410 on the storage time of the data to which the attribute information 400 is assigned to the second area 220, information 420 on the data type, and a corresponding application. It may include at least one of information (application Id) 430 and information 440 for memory setting.
일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기반하여 제2 영역(220)의 데이터를 제3 영역(230)으로 이동시키기 위한 2차 스왑 기능 활성 여부를 결정할 수 있다.The processor 120 of the electronic device 100 according to an embodiment may include a second area (based on at least one of a storage time of each data stored in the second area 220 and a possibility of moving to the first area 210. Whether to activate the secondary swap function for moving the data of 220) to the third region 230 may be determined.
즉, 프로세서(120)는 제2 영역(220)에 저장된 데이터를 대응하는 어플리케이션 별로 식별하고, 식별된 데이터 각각의 제2 영역(220)에서의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역(220)에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 결정된 적어도 하나의 데이터를 제3 영역(230)로 이동하도록 제어할지 여부를 결정할 수 있다.That is, the processor 120 identifies the data stored in the second area 220 for each application, and the storage time in the second area 220 of each of the identified data and the possibility of movement to the first area 210 Based on at least one of the data, it is possible to determine at least one data among the data stored in the second area 220 and determine whether to control the determined at least one data to be moved to the third area 230.
이를 위해, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 속성 정보(400)에 기초하여 제2 영역(220)의 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다(640).To this end, the processor 120 of the electronic device 100 according to an embodiment may determine the possibility of movement of the data in the second region 220 to the first region 210 based on the attribute information 400. Yes (640).
또한, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제1 영역(210)으로의 이동 가능성에 비례하여 제2 영역(220)의 데이터 각각의 임계 저장 시간을 결정할 수 있다(650). 즉, 프로세서(120)는 어플리케이션의 실행에 따라 제1 영역(210)으로의 이동 가능성이 높은 데이터에 대한 임계 저장 시간을 제1 영역(210)으로의 이동 가능성이 낮은 데이터에 비해 길게 설정함으로써, 제1 영역(210)으로의 이동 가능성이 높은 데이터가 제1 영역(210)으로의 이동 가능성이 낮은 데이터에 비해 제2 영역(220)에 오래 저장되게 할 수 있다.In addition, the processor 120 of the electronic device 100 according to an embodiment may determine a threshold storage time of each data in the second region 220 in proportion to the mobility of the first region 210 (650) ). That is, the processor 120 sets a critical storage time for data having a high probability of moving to the first region 210 as compared to data having a low probability of moving to the first region 210 according to execution of the application, Data having a high probability of movement to the first region 210 may be stored in the second region 220 for a longer time than data having a low probability of movement to the first region 210.
또한, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 적어도 하나의 데이터가 비휘발성 메모리 상의 제3 영역(230)으로 이동하는 것을 금지할 수 있다.Also, the processor 120 of the electronic device 100 according to an embodiment may move to the first area 210 based on the possibility of movement of the data stored in the second area 220 to the first area 210. At least one data, which is expected to move, may be prevented from moving to the third area 230 on the nonvolatile memory.
즉, 프로세서(120)는 결정되는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성에 기초하여, 제1 영역(210)으로의 이동이 예상되는 데이터의 경우에는 휘발성 메모리(131) 상의 제2 영역(220)에 저장되어 있도록 하여 신속한 제1 영역(210)으로의 이동(스왑 인)을 보장할 수 있다.That is, the processor 120 is based on the possibility of movement of each data stored in the determined second region 220 to the first region 210, in the case of data expected to move to the first region 210 By being stored in the second area 220 on the volatile memory 131, it is possible to ensure rapid movement to the first area 210 (swap in).
즉, 일 실시예에 따른 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각의 제2 영역(220)에서의 저장 시간 및 제1 영역(210)으로의 이동 가능성 중 적어도 하나에 기초하여 제2 영역(220)에 저장된 데이터 각각을 제3 영역(230)으로 이동하도록 제어하거나 제3 영역(230)으로 이동하지 않도록 제어할 수 있다.That is, the processor 120 according to an embodiment is based on at least one of a storage time in the second area 220 of each data stored in the second area 220 and a possibility of moving to the first area 210. Each data stored in the second region 220 may be controlled to move to the third region 230 or may be controlled not to move to the third region 230.
이를 위해, 일 실시예에 따른 프로세서(120)의 2차 이동 태스크(124)는 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.To this end, the secondary movement task 124 of the processor 120 according to an embodiment may determine the possibility of movement of the data stored in the second region 220 to the first region 210.
일 실시예에 따른 프로세서(120)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU 사용시간 중 적어도 하나에 비례하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.The processor 120 according to an embodiment may be proportional to at least one of a page fault ratio, an execution frequency, and a CPU usage time of an application corresponding to each data stored in the second region 220. It is possible to determine the possibility of movement of the data stored in 220 to the first region 210.
즉, 프로세서(120)는 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU 사용시간 중 적어도 하나를 대응하는 임계값과 비교하여, 임계값 이상의 값을 갖는 경우 해당 어플리케이션이 다시 실행될 확률이 높은 것으로 판단하고, 해당 어플리케이션의 데이터들이 제1 영역(210)으로의 이동 가능성이 높은 것으로 판단할 수 있다. 이 경우, 임계값과의 차이가 클수록 제1 영역(210)으로의 이동 가능성이 높은 확률을 나타낼 수 있다.That is, the processor 120 compares at least one of a page fault ratio, an execution frequency, and CPU usage time of an application corresponding to each data stored in the second area 220 with a corresponding threshold, and the threshold If the value is greater than or equal to the value, it is determined that the probability that the corresponding application will be executed again is high, and it is determined that the data of the corresponding application is highly likely to move to the first region 210. In this case, the greater the difference from the threshold, the higher the probability of movement to the first region 210.
이처럼, 프로세서(120)는 어플리케이션에 대한 정보(430)에 기초하여 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나를 판단할 수 있으며, 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나를 제1 영역(210)으로의 기준 이동 가능성에 대응하는 각각의 임계값과 비교하여, 해당 어플리케이션에 대응하는 데이터의 임계 저장 시간을 결정할 수 있다.As such, the processor 120 may determine at least one of the page fault rate, execution frequency, and CPU usage time of the application corresponding to each data stored in the second area 220 based on the information 430 about the application, , By comparing at least one of the page fault rate, the execution frequency, and the CPU usage time with respective threshold values corresponding to the reference mobility to the first area 210, it is possible to determine the critical storage time of data corresponding to the application. have.
즉, 프로세서(120)는 어플리케이션의 페이지 폴트율, 실행 빈도 및 CPU 사용시간 중 적어도 하나에 기초하여 해당 어플리케이션에 대응하는 제2 영역(220)에 저장된 데이터의 제1 영역(210)으로의 이동 가능성을 판단할 수 있으며, 제1 영역(210)으로의 이동 가능성이 기준 이동가능성 보다 낮은 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 짧게 결정하여 해당 데이터가 보다 빠르게 제3 영역(230)으로 이동하게 제어하며, 제1 영역(210)으로의 이동 가능성이 기준 이동가능성 보다 높은 경우에는 임계 저장 시간을 기준 임계 저장 시간보다 길게 결정하여 해당 데이터가 제2 영역(220)에 보다 오래 저장되어 있도록 제어할 수 있다.That is, the processor 120 may move data stored in the second region 220 corresponding to the application to the first region 210 based on at least one of the application page fault rate, execution frequency, and CPU usage time. When the possibility of moving to the first area 210 is lower than the reference mobility, the critical storage time is determined to be shorter than the reference threshold storage time to move the corresponding data to the third area 230 more quickly. When the mobility to the first area 210 is higher than the reference mobility, the critical storage time is determined to be longer than the reference threshold storage time to control the corresponding data to be stored in the second area 220 longer. Can be.
또한, 일 실시예에 따른 프로세서(120)는, 제2 영역(220)에 저장된 데이터 각각에 대응하는 어플리케이션의 전경(foreground) 상태 또는 배경(background) 상태에 기초하여 제2 영역(220)에 저장된 데이터 각각의 상기 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the processor 120 according to an embodiment is stored in the second region 220 based on a foreground state or a background state of an application corresponding to each data stored in the second area 220. Each data may be moved to the first area 210.
구체적으로, 2차 이동 태스크(124)는 어플리케이션이 전경 상태인 경우에는 대응하는 제2 영역(220)에 저장된 데이터가 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 판단하고, 대응하는 제2 영역(220)에 저장된 데이터가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.Specifically, when the application is in the foreground state, the secondary movement task 124 determines that the probability that the data stored in the corresponding second region 220 moves to the first region 210 is greater than or equal to the critical movement probability. Data stored in the second region 220 may be prevented from moving to the third region 230.
또한, 2차 이동 태스크(124)는 어플리케이션이 배경 상태인 경우에는 대응하는 제2 영역(220)에 저장된 데이터가 제1 영역(210)으로의 이동 가능성이 기준 이동 가능성 또는 그 이하인 것으로 판단하고, 대응하는 임계 저장 시간을 기준 임계 저장 시간 또는 그 이하로 결정하여 대응하는 제2 영역(220)에 저장된 데이터가 보다 빠르게 제3 영역(230)으로 이동하도록 제어할 수 있다.In addition, when the application is in the background state, the secondary movement task 124 determines that the data stored in the corresponding second region 220 is moved to the first region 210 as a reference mobility or less. The corresponding threshold storage time may be determined as or less than the reference threshold storage time to control the data stored in the corresponding second area 220 to move to the third area 230 more quickly.
또한, 일 실시예에 따른 프로세서(120)는, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 대응하는 어플리케이션에 대한 정보(430)에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the processor 120 according to an embodiment may include information about a relationship between a preset application and a possibility of moving to the first area 210 and a corresponding application of each data stored in the second area 220. Based on the information 430, it is possible to determine the possibility of movement of the data stored in the second area 220 to the first area 210.
미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 설정된 어플리케이션의 리스트를 포함할 수 있다.The information on the relationship between the preset application and the possibility of movement to the first area 210 may include a list of applications that are set to have the possibility of movement to the first area 210 to be greater than or equal to the critical mobility.
따라서, 프로세서(120)는, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여, 어플리케이션의 리스트에 포함되는 어플리케이션에 대응하는 제2 영역(220)의 데이터가 제3 영역(230)으로 이동하는 것을 금지할 수 있다.Accordingly, the processor 120, based on the information on the relationship between the preset application and the possibility of moving to the first area 210, the data of the second area 220 corresponding to the application included in the list of applications. It may be forbidden to move to the third region 230.
또한, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 어플리케이션의 우선순위에 따른 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 구체적으로, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 기준 우선순위 이상의 어플리케이션의 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상임을 나타낼 수 있다.In addition, information on the relationship between the preset application and the possibility of moving to the first area 210 may include information about the possibility of moving to the first area 210 according to the priority of the application. Specifically, the information on the relationship between the preset application and the mobility to the first area 210 may indicate that the mobility of the application with the reference priority or higher to the first area 210 is greater than or equal to the critical mobility.
즉, 프로세서(120)는 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 대응하는 어플리케이션의 우선순위를 판단하고, 기준 우선순위 이상의 우선순위를 갖는 어플리케이션에 대응하는 데이터의 제1 영역(210)으로의 이동 가능성이 임계 이동 가능성 이상인 것으로 판단하여, 해당 데이터의 제3 영역(230)으로의 이동을 금지시킬 수 있다.That is, the processor 120 determines the priority of the corresponding application of each of the data stored in the second area 220 based on the information on the relationship between the preset application and the possibility of moving to the first area 210 and , It is determined that the possibility of movement of data corresponding to an application having a priority higher than or equal to the reference priority to the first region 210 is greater than or equal to the threshold mobility, and thus the movement of the data to the third region 230 can be prohibited have.
미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 설계 단계에서 시스템 관리자(administrator)에 의하여 설정될 수 있으며, 사용자에 의하여 설정될 수도 있다. 또한, 미리 설정된 어플리케이션과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 외부 서버로부터 획득될 수도 있다.Information about the relationship between the preset application and the possibility of moving to the first area 210 may be set by a system administrator in the design stage, or may be set by a user. In addition, information on a relationship between a preset application and a possibility of moving to the first area 210 may be obtained from an external server.
또한, 일 실시예에 따른 프로세서(120)는, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 데이터 유형에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the processor 120 according to an embodiment may include information about a relationship between a preset data type and a possibility of moving to the first area 210 and data types of each data stored in the second area 220. Based on the information, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
이 때, 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는, 데이터 유형 각각의 미리 설정된 제1 영역(210)으로의 이동 가능성에 대한 정보를 포함할 수 있다. 즉, 전자 장치(100)는 메모리(130) 상에 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성을 저장할 수 있으며, 데이터 유형 각각의 제1 영역(210)으로의 이동 가능성은 설계 단계에서 저장되거나, 사용자에 의하여 저장될 수 있으며, 외부 서버로부터 획득될 수 있다.In this case, the information on the relationship between the preset data type and the possibility of movement to the first area 210 may include information about the possibility of movement to the preset first area 210 of each data type. . That is, the electronic device 100 may store the possibility of movement to the first area 210 of each data type on the memory 130, and the possibility of movement to the first area 210 of each data type is a design step It can be stored in, or stored by the user, or can be obtained from an external server.
즉, 프로세서(120)는 미리 설정된 데이터 유형과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여 제2 영역(220)에 저장된 데이터 각각의 이동 가능성을 결정할 수 있으며, 데이터 각각의 이동 가능성에 기초하여 임계 저장 시간을 결정하거나, 제3 영역(230)으로의 이동을 금지할 수 있다.That is, the processor 120 may determine the mobility of each of the data stored in the second area 220 based on the information on the relationship between the preset data type and the mobility to the first area 210, and the data A threshold storage time may be determined based on each mobility possibility, or movement to the third area 230 may be prohibited.
또한, 일 실시예에 따른 프로세서(120)는, 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.In addition, the processor 120 according to an embodiment may move the data stored in the second area 220 to the first area 210 based on the memory setting of each data stored in the second area 220. Can decide.
즉, 프로세서(120)는, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보 및 제2 영역(220)에 저장된 데이터 각각의 메모리 설정에 대한 정보(440)에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제1 영역(210)으로의 이동 가능성을 결정할 수 있다.That is, the processor 120 includes information on a relationship between a preset memory setting and a possibility of moving to the first area 210 and information 440 on each memory setting of data stored in the second area 220. Based on this, it is possible to determine the possibility of movement of each data stored in the second region 220 to the first region 210.
이 때, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보는 메모리 설정에 따른 제1 영역(210)으로의 이동 가능성을 나타낼 수 있다.At this time, information on the relationship between the preset memory setting and the possibility of moving to the first area 210 may indicate the possibility of moving to the first area 210 according to the memory setting.
구체적으로, 어플리케이션은 할당된 메모리에 대하여 madvise 시스템콜을 이용하여 메모리 어드바이스 설정이 가능하다. 즉, 어플리케이션은 시스템콜을 통하여 메모리 어드바이스를 설정하여, 할당된 메모리의 사용방식을 메모리(130)에 권고(advise)할 수 있다. 이 때, 메모리 설정은 할당된 메모리의 사용방식을 메모리(130)에 권고하는 플래그(flag) 값에 해당할 수 있으며, 설정에 따라 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내거나, 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타낼 수 있다.Specifically, the application can set the memory advice using the madvise system call for the allocated memory. That is, the application may set the memory advice through the system call, and recommend the memory 130 using the allocated memory. At this time, the memory setting may correspond to a flag value recommending the usage method of the allocated memory to the memory 130, and moving from the second area 220 to the first area 210 according to the setting It may indicate that there is a possibility, or it may indicate that there is no possibility of movement from the second region 220 to the first region 210.
이 때, 프로세서(120)는, 미리 설정된 메모리 설정과 제1 영역(210)으로의 이동 가능성 사이의 관계에 대한 정보에 기초하여, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 있음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 금지하고, 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 제3 영역(230)으로의 이동을 수행할 수 있다.At this time, the processor 120 may set the memory setting from the second area 220 to the first area 210 based on information on a relationship between a preset memory setting and a possibility of moving to the first area 210. For data indicating that there is a possibility of moving to, the movement to the third region 230 is prohibited, and the memory setting is set to data indicating that there is no possibility of movement from the second region 220 to the first region 210. The movement to the third region 230 may be performed.
일 실시예에 따라, 프로세서(120)는 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 해당 데이터가 임계 저장 시간과의 비교없이 즉각적으로 제3 영역(230)으로의 이동하도록 제어할 수 있다. 즉, 프로세서(120)는 메모리 설정이 제2 영역(220)에서 제1 영역(210)으로의 이동 가능성이 없음을 나타내는 데이터에 대하여는 해당 데이터에 대응하는 임계 저장 시간을 '0'으로 결정할 수 있다.According to an embodiment of the present disclosure, the processor 120 immediately determines whether data corresponding to the memory setting has no possibility of moving from the second area 220 to the first area 210 without comparing the threshold storage time. It can be controlled to move to the third region 230. That is, the processor 120 may determine the threshold storage time corresponding to the corresponding data as '0' for data indicating that the memory setting has no possibility of moving from the second area 220 to the first area 210. .
이처럼, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 속성 정보(400)에 기초하여 제2 영역(220)의 데이터에 대한 제2 영역(220)에서의 저장 시간을 확인할 수 있다(660). 즉, 프로세서(120)는 속성 정보(400) 상의 제2 영역에의 저장 시점에 대한 정보(410)에 기초하여 제2 영역(220)에 저장된 데이터 각각의 제2 영역(220)에서의 저장 시간을 확인할 수 있다.As such, the processor 120 of the electronic device 100 according to an embodiment may check the storage time in the second region 220 for the data in the second region 220 based on the attribute information 400. (660). That is, the processor 120 stores the data stored in the second region 220 in the second region 220 based on the information 410 on the storage time in the second region on the attribute information 400. can confirm.
또한, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제2 영역(220)에서의 저장 시간이 대응하는 임계 저장 시간 이상인 적어도 하나의 데이터를 결정할 수 있다(670). 즉, 프로세서(120)는 제2 영역(220)에 저장된 데이터 중 제2 영역(220)에서의 저장 시간이 대응하는 임계 저장 시간 이상인 적어도 하나의 데이터를 결정할 수 있다.Also, the processor 120 of the electronic device 100 according to an embodiment may determine at least one data whose storage time in the second region 220 is greater than or equal to a corresponding threshold storage time (670). That is, the processor 120 may determine at least one data among the data stored in the second area 220, the storage time in the second area 220 being equal to or greater than a corresponding threshold storage time.
일 실시예에 따른 전자 장치(100)의 프로세서(120)는 결정된 적어도 하나의 데이터를 제3 영역(230)으로 이동시킬 수 있다(680). 즉, 프로세서(120)는 제2 영역(220)에 저장된 데이터 중 제2 영역(220)에서의 저장 시간이 임계 저장 시간 이상인 적어도 하나의 데이터를 결정하고, 상기 적어도 하나의 데이터는 다시 제1 영역(210)으로 이동할 확률이 적을 것으로 보아, 상기 적어도 하나의 데이터를 제3 영역(230)으로 이동시켜 제2 영역(220)의 가용 용량을 확보할 수 있다.The processor 120 of the electronic device 100 according to an embodiment may move the determined at least one data to the third region 230 (680). That is, the processor 120 determines at least one data of which the storage time in the second area 220 is greater than or equal to a threshold storage time among the data stored in the second area 220, and the at least one data is again in the first area Since the probability of moving to 210 is small, the available capacity of the second region 220 can be secured by moving the at least one data to the third region 230.
도 7은 본 발명의 일 실시예에 따른 전자 장치(100)의 제어방법에 있어서, 데이터를 비휘발성 메모리(132) 상의 제3 영역(230)으로 이동시키는 경우에 관한 순서도이다.7 is a flowchart illustrating a case in which data is moved to the third area 230 on the nonvolatile memory 132 in the control method of the electronic device 100 according to an embodiment of the present invention.
도 7을 참조하면, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 제2 영역(220)에서의 저장 시간이 임계 저장 시간 이상인 적어도 하나의 데이터를 결정할 수 있다(710).Referring to FIG. 7, the processor 120 of the electronic device 100 according to an embodiment may determine at least one data in which the storage time in the second region 220 is greater than or equal to the threshold storage time (710).
일 실시예에 따른 전자 장치(100)의 프로세서(120)는 결정된 적어도 하나의 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우(720의 예), 결정된 적어도 하나의 데이터를 미리 설정된 임계 크기 이하로 분할할 수 있다(730).When the total data size of the determined at least one data is greater than or equal to a preset threshold size (YES in 720), the processor 120 of the electronic device 100 according to an embodiment sets the determined at least one data to a preset threshold size or less. It can be divided (730).
즉, 프로세서(120)는 결정된 적어도 하나의 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우(720의 예)에는 결정된 적어도 하나의 데이터를 미리 설정된 임계 크기 이하의 크기로 분할하여 분할된 데이터가 순차적으로 제3 영역(230)으로 이동하도록 제어할 수 있다. 또한, 결정된 적어도 하나의 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우(720의 아니오)에는 결정된 적어도 하나의 데이터가 분할없이 제3 영역(230)으로 이동하도록 제어할 수 있다.That is, when the total data size of the determined at least one data is greater than or equal to the preset threshold size (YES in 720), the processor 120 divides the determined at least one data into a size equal to or less than the preset threshold size, and the divided data is sequentially As a result, it may be controlled to move to the third region 230. In addition, when the total data size of the determined at least one data is equal to or greater than a preset threshold size (No of 720), the determined at least one data may be controlled to move to the third area 230 without division.
또한, 프로세서(120)는 저장 시간이 임계 저장 시간 이상인 것으로 결정된 어느 하나의 어플리케이션에 대응하는 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 어느 하나의 어플리케이션에 대응하는 데이터를 미리 설정된 임계 크기 이하의 크기로 분할하고, 분할된 데이터가 순차적으로 비휘발성 메모리의 제3 영역(230)으로 이동하도록 제어할 수도 있다.In addition, when the total data size of data corresponding to any one application determined that the storage time is greater than or equal to the threshold storage time is greater than or equal to a preset threshold size, the processor 120 may set data corresponding to any one application to be less than or equal to the preset threshold size It may be divided into the size of, and control the divided data to be sequentially moved to the third region 230 of the non-volatile memory.
일 실시예에 따른 전자 장치(100)의 프로세서(120)는 사용 패턴 및 큐(queue) 상태 중 적어도 하나에 기초하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단할 수 있다(740).The processor 120 of the electronic device 100 according to an embodiment may determine whether the nonvolatile memory 132 is in an idle state based on at least one of a usage pattern and a queue state (740).
또한, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 비휘발성 메모리(132)가 유휴 상태인 경우(750의 예), 데이터를 제3 영역(230)으로 이동시킬 수 있다(760).Also, the processor 120 of the electronic device 100 according to an embodiment may move data to the third region 230 when the nonvolatile memory 132 is in an idle state (YES in 750) (760). ).
즉, 프로세서(120)는 비휘발성 메모리(132)가 유휴 상태인 경우에만 저장 시간이 임계 저장 시간 이상인 것으로 결정된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.That is, the processor 120 may control at least one data determined to have a storage time equal to or greater than a threshold storage time to be moved to the third area 230 only when the nonvolatile memory 132 is in an idle state.
프로세서(120)는 비휘발성 메모리(132)가 유휴 상태에 있지 않은 경우(750의 아니오), 사용 패턴 및 큐 상태에 기초하여 비휘발성 메모리(132)의 유휴 상태를 지속적으로 또는 일정 시간 단위로 판단할 수 있다.When the non-volatile memory 132 is not in the idle state (No of 750), the processor 120 determines the idle state of the non-volatile memory 132 continuously or in a predetermined time unit based on the usage pattern and the queue state can do.
이를 위해, 프로세서(120)는 전자 장치(100)의 동작에 따른 비휘발성 메모리(132)의 읽기(write) 횟수 및 쓰기(read) 횟수를 나타내는 비휘발성 메모리(132)의 사용 패턴 및 전자 장치(100)의 현재 동작에 기초하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단할 수 있다.To this end, the processor 120 uses the usage pattern and the electronic device of the nonvolatile memory 132 indicating the number of writes and the number of reads of the nonvolatile memory 132 according to the operation of the electronic device 100 ( Based on the current operation of 100), it may be determined whether the nonvolatile memory 132 is in an idle state.
즉, 프로세서(120)는 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는지 여부를 판단하여, 비휘발성 메모리(132)의 유휴 상태를 판단할 수 있다.That is, the processor 120 determines whether the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number based on the usage pattern of the nonvolatile memory 132, and is nonvolatile The idle state of the memory 132 may be determined.
다시 말해, 프로세서(120)는, 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터의 이동을 보류할 수 있으며, 비휘발성 메모리(132)의 사용 패턴에 기초하여 전자 장치(100)의 현재 동작이 읽기 횟수 및 쓰기 횟수가 임계 횟수 이하의 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.In other words, when the current operation of the electronic device 100 corresponds to an operation in which the number of reads and the number of writes exceeds a threshold number of times based on the usage pattern of the nonvolatile memory 132, the processor 120 has a storage time. The movement of at least one data stored in the second region 220 determined to be greater than or equal to the threshold storage time may be withheld, and the current operation of the electronic device 100 may be read and read based on the usage pattern of the nonvolatile memory 132. When the number of writes corresponds to an operation less than or equal to the threshold number of times, it may be controlled to move at least one data stored in the second area 220 determined as the storage time is greater than or equal to the threshold storage time to the third area 230.
또한, 프로세서(120)는 비휘발성 메모리(132)의 큐 상태 즉, I/O queue 상태가 나타내는 읽기 횟수 및 쓰기 횟수를 임계 횟수와 비교하여 비휘발성 메모리(132)의 유휴 상태 여부를 판단할 수 있다.In addition, the processor 120 may determine whether the nonvolatile memory 132 is in an idle state by comparing the number of reads and writes indicated by the queue state of the nonvolatile memory 132, that is, the I / O queue state with a threshold number of times. have.
구체적으로, 프로세서(120)는, 비휘발성 메모리(132)의 큐 상태 에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수가 임계 횟수를 초과하는 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터의 이동을 보류할 수 있으며, 비휘발성 메모리(132)의 큐 상태 에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수가 임계 횟수 이하의 동작에 해당하는 경우, 저장 시간이 임계 저장 시간 이상인 것으로 결정된 제2 영역(220)에 저장된 적어도 하나의 데이터가 제3 영역(230)으로 이동하도록 제어할 수 있다.Specifically, when the number of reads and writes of the nonvolatile memory 132 corresponds to an operation exceeding a threshold number based on the queue state of the nonvolatile memory 132, the processor 120 stores the storage time as a threshold. The movement of at least one data stored in the second area 220 determined to be longer than time may be withheld, and the number of reads and writes of the nonvolatile memory 132 is critical based on the queue state of the nonvolatile memory 132. When the number of operations is less than or equal to the number of times, at least one data stored in the second region 220 determined as the storage time is greater than or equal to the threshold storage time may be controlled to move to the third region 230.
이 때, 제3 영역(230)으로 이동하도록 제어되는 데이터는 분할된 데이터에 해당할 수 있으며, 일 실시예에 따른 프로세서(120)는 분할된 데이터가 순차적으로 제3 영역(230)으로 이동하도록 제어할 수 있다.At this time, the data controlled to move to the third area 230 may correspond to the divided data, and the processor 120 according to an embodiment may cause the divided data to sequentially move to the third area 230. Can be controlled.
이를 위해, 일 실시예에 따른 전자 장치(100)의 프로세서(120)는 결정된 적어도 하나의 데이터 모두가 제3 영역(230)으로 이동하였는지 여부를 판단할 수 있으며, 전자 장치(100)의 프로세서(120)는 결정된 적어도 하나의 데이터 모두가 제3 영역(230)으로 이동하지 않은 경우(770의 아니오), 비휘발성 메모리의 유휴 상태를 판단하여 분할된 데이터를 계속적으로 제3 영역(230)으로 이동 시킬 수 있다. 이후, 프로세서(120)는 결정된 적어도 하나의 데이터 모두가 제3 영역(230)으로 이동하는 경우(770의 예) 절차를 종료할 수 있다.To this end, the processor 120 of the electronic device 100 according to an embodiment may determine whether all of the determined at least one data has moved to the third area 230, and the processor ( 120), if all of the determined at least one data is not moved to the third area 230 (No at 770), the idle state of the nonvolatile memory is determined to continuously move the divided data to the third area 230 I can do it. Thereafter, the processor 120 may end the procedure when all of the determined at least one data moves to the third area 230 (YES in 770).
또한, 일 실시예에 따른 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 미리 설정된 임계 크기를 조정할 수 있다. 즉, 2차 이동 태스크(124)는 비휘발성 메모리(132)의 사용 패턴 및 큐 상태 중 적어도 하나에 기초하여 비휘발성 메모리(132)의 읽기 횟수 및 쓰기 횟수를 결정하고, 읽기 횟수 및 쓰기 횟수에 기초하여 제2 영역(220)에서 제3 영역(230)으로 이동하는 데이터 량을 제한하는 임계 크기를 조정할 수 있다.In addition, the secondary movement task 124 according to an embodiment may adjust a preset threshold size based on at least one of a usage pattern and a queue state of the nonvolatile memory 132. That is, the secondary move task 124 determines the number of reads and writes of the nonvolatile memory 132 based on at least one of the usage pattern and the queue state of the nonvolatile memory 132, and determines the number of reads and writes. Based on this, the threshold size limiting the amount of data moving from the second area 220 to the third area 230 may be adjusted.
한편, 개시된 실시예들은 컴퓨터에 의해 실행 가능한 명령어를 저장하는 기록매체의 형태로 구현될 수 있다. 명령어는 프로그램 코드의 형태로 저장될 수 있으며, 프로세서에 의해 실행되었을 때, 프로그램 모듈을 생성하여 개시된 실시예들의 동작을 수행할 수 있다. 기록매체는 컴퓨터로 읽을 수 있는 기록매체로 구현될 수 있다.Meanwhile, the disclosed embodiments may be implemented in the form of a recording medium that stores instructions executable by a computer. Instructions may be stored in the form of program code, and when executed by a processor, may generate program modules to perform operations of the disclosed embodiments. The recording medium may be embodied as a computer-readable recording medium.
컴퓨터가 읽을 수 있는 기록매체로는 컴퓨터에 의하여 해독될 수 있는 명령어가 저장된 모든 종류의 기록 매체를 포함한다. 예를 들어, ROM(Read Only Memory), RAM(Random Access Memory), 자기 테이프, 자기 디스크, 플래쉬 메모리, 광 데이터 저장장치 등이 있을 수 있다.The computer-readable recording medium includes all kinds of recording media storing instructions that can be read by a computer. For example, there may be a read only memory (ROM), a random access memory (RAM), a magnetic tape, a magnetic disk, a flash memory, and an optical data storage device.
이상에서와 같이 첨부된 도면을 참조하여 개시된 실시예들을 설명하였다. 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자는 본 발명의 기술적 사상이나 필수적인 특징을 변경하지 않고도, 개시된 실시예들과 다른 형태로 본 발명이 실시될 수 있음을 이해할 것이다. 개시된 실시예들은 예시적인 것이며, 한정적으로 해석되어서는 안 된다.As described above, the disclosed embodiments have been described with reference to the accompanying drawings. Those of ordinary skill in the art to which the present invention pertains will understand that the present invention may be practiced in different forms from the disclosed embodiments without changing the technical spirit or essential features of the present invention. The disclosed embodiments are illustrative and should not be construed as limiting.

Claims (15)

  1. 휘발성 메모리;Volatile memory;
    비휘발성 메모리; 및Non-volatile memory; And
    상기 휘발성 메모리의 제1 영역의 가용 용량이 임계 용량보다 작은 경우, 상기 제1 영역의 적어도 하나의 데이터가 상기 휘발성 메모리의 제2 영역으로 이동하도록 제어하고, 상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정하는 프로세서;를 포함하는 전자 장치.When the usable capacity of the first area of the volatile memory is less than a threshold capacity, control to move at least one data of the first area to the second area of the volatile memory, and to control the data of the data stored in the second area. And a processor configured to determine whether to control data stored in the second region to be moved to the nonvolatile memory based on at least one of a storage time in the second region and a possibility to move to the first region.
  2. 제1항에 있어서,According to claim 1,
    상기 프로세서는,The processor,
    상기 제1 영역에서 상기 제2 영역으로 이동하는 데이터 각각에 상기 제2 영역에의 저장 시점에 대한 정보, 데이터 유형에 대한 정보, 대응하는 어플리케이션에 대한 정보 및 메모리 설정에 대한 정보 중 적어도 하나를 포함하는 속성 정보를 할당하는 전자 장치.Each of the data moving from the first area to the second area includes at least one of information on a storage time in the second area, information on a data type, information on a corresponding application, and information on a memory setting. An electronic device for allocating attribute information.
  3. 제2항에 있어서,According to claim 2,
    상기 프로세서는,The processor,
    상기 속성 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하고, 상기 제1 영역으로의 이동 가능성에 비례하도록 상기 제2 영역에 저장된 데이터의 임계 저장 시간을 결정하는 전자 장치.Based on the attribute information, a possibility of moving data stored in the second area to the first area is determined, and a critical storage time of data stored in the second area is determined in proportion to the probability of moving to the first area Electronic device.
  4. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간이 상기 결정된 임계 저장 시간 이상인 경우, 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하도록 제어하는 전자 장치.When the storage time in the second area of the data stored in the second area is equal to or greater than the determined threshold storage time, the electronic device controls to move the data stored in the second area to the nonvolatile memory.
  5. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성에 기초하여, 상기 제1 영역으로의 이동이 예상되는 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하는 것을 금지하는 전자 장치.An electronic device that prohibits data stored in the second area, which is expected to move to the first area, from being moved to the nonvolatile memory based on the possibility of moving the data stored in the second area to the first area .
  6. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터에 대응하는 어플리케이션의 페이지 폴트율(page fault ratio), 실행 빈도 및 CPU(central processing unit) 사용시간 중 적어도 하나에 비례하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하는 전자 장치.The first area of data stored in the second area in proportion to at least one of a page fault ratio, an execution frequency, and a central processing unit (CPU) usage time of an application corresponding to data stored in the second area. An electronic device that determines the likelihood of moving to.
  7. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터에 대응하는 어플리케이션의 전경(foreground) 상태 또는 배경(background) 상태에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하는 전자 장치.An electronic device that determines a possibility of moving data stored in the second area to the first area based on a foreground state or a background state of an application corresponding to data stored in the second area.
  8. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    미리 설정된 어플리케이션과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 대응하는 어플리케이션에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하는 전자 장치.Based on information on a relationship between a preset application and a possibility of movement to the first area and information on a corresponding application of data stored in the second area, data stored in the second area to the first area An electronic device that determines mobility.
  9. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    미리 설정된 데이터 유형과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 데이터 유형에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하는 전자 장치.Based on information on a relationship between a preset data type and a possibility of movement to the first area and information on a data type of data stored in the second area, data stored in the second area to the first area An electronic device that determines mobility.
  10. 제3항에 있어서,According to claim 3,
    상기 프로세서는,The processor,
    미리 설정된 메모리 설정과 상기 제1 영역으로의 이동 가능성 사이의 관계에 대한 정보 및 상기 제2 영역에 저장된 데이터의 메모리 설정에 대한 정보에 기초하여 상기 제2 영역에 저장된 데이터의 상기 제1 영역으로의 이동 가능성을 결정하는 전자 장치.Based on information on a relationship between a preset memory setting and a possibility of moving to the first area and information on a memory setting of data stored in the second area, data stored in the second area to the first area An electronic device that determines mobility.
  11. 제1항에 있어서,According to claim 1,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어하는 경우, 상기 비휘발성 메모리의 사용 패턴 및 큐(queue) 상태 중 적어도 하나에 기초하여 상기 비휘발성 메모리의 유휴 상태 여부를 판단하고, 상기 비휘발성 메모리가 유휴 상태인 경우, 상기 제2 영역에 저장된 데이터가 상기 비휘발성 메모리로 이동하도록 제어하는 전자 장치.When the data stored in the second area is controlled to move to the non-volatile memory, it is determined whether the non-volatile memory is idle based on at least one of the use pattern and the queue state of the non-volatile memory, When the nonvolatile memory is in an idle state, an electronic device that controls data stored in the second area to move to the nonvolatile memory.
  12. 제11항에 있어서,The method of claim 11,
    상기 프로세서는,The processor,
    상기 전자 장치의 동작에 따른 상기 비휘발성 메모리의 읽기(write) 횟수 및 쓰기(read) 횟수를 나타내는 상기 비휘발성 메모리의 사용 패턴 및 상기 전자 장치의 현재 동작에 기초하여 상기 비휘발성 메모리의 유휴 상태 여부를 판단하는 전자 장치.Whether the non-volatile memory is idle based on the use pattern of the non-volatile memory indicating the number of writes and the number of reads of the non-volatile memory according to the operation of the electronic device and the current operation of the electronic device. Electronic device for judging.
  13. 제11항에 있어서,The method of claim 11,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터의 총 데이터 크기가 미리 설정된 임계 크기 이상인 경우, 상기 제2 영역에 저장된 데이터를 상기 미리 설정된 임계 크기 이하의 크기로 분할하고, 상기 분할된 데이터가 순차적으로 상기 비휘발성 메모리로 이동하도록 제어하는 전자 장치.When the total data size of the data stored in the second area is greater than or equal to a preset threshold size, the data stored in the second area is divided into a size equal to or less than the preset threshold size, and the divided data is sequentially the nonvolatile memory Electronic device that controls to move to.
  14. 제1항에 있어서,According to claim 1,
    상기 프로세서는,The processor,
    상기 제2 영역에 저장된 데이터를 대응하는 어플리케이션 별로 식별하고, 상기 식별된 데이터 각각의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터 중 적어도 하나의 데이터를 결정하고, 상기 결정된 적어도 하나의 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정하는 전자 장치.Data stored in the second area is identified for each application, and stored in the second area based on at least one of a storage time of the identified data in the second area and a possibility of moving to the first area. An electronic device that determines at least one of the data and determines whether to control the determined at least one data to be moved to the nonvolatile memory.
  15. 휘발성 메모리 및 비휘발성 메모리를 포함하는 전자 장치의 제어방법에 있어서,In the control method of an electronic device including a volatile memory and a non-volatile memory,
    상기 휘발성 메모리의 제1 영역의 가용 용량이 임계 용량보다 작은 경우, 상기 제1 영역의 적어도 하나의 데이터가 상기 휘발성 메모리의 제2 영역으로 이동하도록 제어하고;When the available capacity of the first area of the volatile memory is less than a threshold capacity, control to move at least one data in the first area to the second area of the volatile memory;
    상기 제2 영역에 저장된 데이터의 상기 제2 영역에서의 저장 시간 및 상기 제1 영역으로의 이동 가능성 중 적어도 하나에 기초하여 상기 제2 영역에 저장된 데이터를 상기 비휘발성 메모리로 이동하도록 제어할지 여부를 결정하는 것;을 포함하는 전자 장치의 제어방법.Whether to control the data stored in the second area to be moved to the non-volatile memory based on at least one of the storage time in the second area and the possibility of movement to the first area of the data stored in the second area. Decision; Control method of an electronic device comprising a.
PCT/KR2019/014030 2018-11-14 2019-10-24 Electronic apparatus and controlling method thereof WO2020101211A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2018-0139889 2018-11-14
KR1020180139889A KR20200056046A (en) 2018-11-14 2018-11-14 Electronic device and controlling method thereof

Publications (1)

Publication Number Publication Date
WO2020101211A1 true WO2020101211A1 (en) 2020-05-22

Family

ID=70730633

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2019/014030 WO2020101211A1 (en) 2018-11-14 2019-10-24 Electronic apparatus and controlling method thereof

Country Status (2)

Country Link
KR (1) KR20200056046A (en)
WO (1) WO2020101211A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP4357903A1 (en) * 2021-12-23 2024-04-24 Samsung Electronics Co., Ltd. Method for managing memory and electronic device using same

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020776A (en) * 2007-07-13 2009-01-29 Panasonic Corp Swap-out control apparatus
JP2010211696A (en) * 2009-03-12 2010-09-24 Canon Inc Memory swap management method, device and program
JP2012159962A (en) * 2011-01-31 2012-08-23 Canon Inc Information processing system
KR20170092912A (en) * 2016-02-04 2017-08-14 삼성전자주식회사 Mehtod for managing memory and electronic device thereof
KR20180005858A (en) * 2016-07-07 2018-01-17 에스케이하이닉스 주식회사 Memory system and operating method of memory system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009020776A (en) * 2007-07-13 2009-01-29 Panasonic Corp Swap-out control apparatus
JP2010211696A (en) * 2009-03-12 2010-09-24 Canon Inc Memory swap management method, device and program
JP2012159962A (en) * 2011-01-31 2012-08-23 Canon Inc Information processing system
KR20170092912A (en) * 2016-02-04 2017-08-14 삼성전자주식회사 Mehtod for managing memory and electronic device thereof
KR20180005858A (en) * 2016-07-07 2018-01-17 에스케이하이닉스 주식회사 Memory system and operating method of memory system

Also Published As

Publication number Publication date
KR20200056046A (en) 2020-05-22

Similar Documents

Publication Publication Date Title
WO2018117739A1 (en) Method and apparatus for determining abnormal state of battery
WO2017142293A1 (en) Electronic device and method of application data display therefor
WO2018070716A1 (en) Electronic device having plurality of fingerprint sensing modes and method for controlling the same
WO2017030411A1 (en) Electronic device and method for wired and wireless charging in electronic device
WO2018026136A1 (en) Electronic device comprising antenna
WO2018038385A2 (en) Method for voice recognition and electronic device for performing same
WO2017135586A1 (en) Memory management method and electronic device therefor
WO2017142373A1 (en) Method of controlling the sharing of videos and electronic device adapted thereto
WO2017026709A1 (en) Method and device for adjusting resolution of electronic device
WO2017074078A1 (en) Method for operating electronic device and electronic device for supporting the same
WO2016085253A1 (en) Screen configuration method, electronic device, and storage medium
WO2016035901A1 (en) Method for recognizing iris and electronic device therefor
WO2018155893A1 (en) Interface providing method for multitasking and electronic device implementing the same
WO2016167620A1 (en) Apparatus and method for providing information via portion of display
WO2017209502A1 (en) Method for controlling connection between electronic device and charging device, and device for providing same
WO2018143696A1 (en) Electronic device for capturing moving image on basis of change between plurality of images and method for controlling same
WO2017155251A1 (en) Video streaming apparatus and method in electronic device
WO2017078480A1 (en) Electronic device, wearable device, and method for controlling object displayed through electronic device
WO2017069480A1 (en) Screen outputting method and electronic device supporting the same
WO2017003218A1 (en) Method for controlling multiple batteries and electronic device for implementing same
WO2017131469A1 (en) Electronic device for controlling application and operation method thereof
WO2018139857A1 (en) Electronic device and method for managing data in electronic device
WO2018135841A1 (en) Message generation method and wearable electronic device for supporting the same
WO2016013906A1 (en) Electronic apparatus for executing virtual machine and method for executing virtual machine
WO2018097683A1 (en) Electronic device, external electronic device and method for connecting electronic device and external electronic 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: 19883606

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19883606

Country of ref document: EP

Kind code of ref document: A1