WO2017209508A1 - 전자 장치 및 전자 장치의 파일 데이터 저널링 방법 - Google Patents

전자 장치 및 전자 장치의 파일 데이터 저널링 방법 Download PDF

Info

Publication number
WO2017209508A1
WO2017209508A1 PCT/KR2017/005682 KR2017005682W WO2017209508A1 WO 2017209508 A1 WO2017209508 A1 WO 2017209508A1 KR 2017005682 W KR2017005682 W KR 2017005682W WO 2017209508 A1 WO2017209508 A1 WO 2017209508A1
Authority
WO
WIPO (PCT)
Prior art keywords
memory
data
file
electronic device
journal
Prior art date
Application number
PCT/KR2017/005682
Other languages
English (en)
French (fr)
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 삼성전자 주식회사
Priority to US16/099,557 priority Critical patent/US20190155792A1/en
Priority to EP17807001.7A priority patent/EP3451193B1/en
Publication of WO2017209508A1 publication Critical patent/WO2017209508A1/ko

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1441Resetting or repowering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • G06F11/1451Management of the data involved in backup or backup restore by selection of backup contents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0638Combination of memories, e.g. ROM and RAM such as to permit replacement or supplementing of words in one module by words in another module
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/1805Append-only file systems, e.g. using logs or journals to store data
    • G06F16/1815Journaling file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2358Change logging, detection, and notification
    • 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/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Definitions

  • the present disclosure relates to an electronic device, and more particularly, to an electronic device capable of journaling file data.
  • Portable electronic devices such as smart phones and tablets, may store various data to provide various user experiences.
  • the electronic device includes a storage layer including main memory (for example, random access memory (RAM)) and storage, which is a mass storage device, as in a conventional computer system. They can construct a file system of directory structure.
  • main memory for example, random access memory (RAM)
  • storage which is a mass storage device, as in a conventional computer system. They can construct a file system of directory structure.
  • the file system may be modified to reflect changes in files and / or directories.
  • the file system may be modified. Some data may be corrupted.
  • the electronic device may implement a journaling file system in preparation for such a situation.
  • the journaling file system is a file system for tracking changes by logging changes in memory before reflecting changes to the main file system.
  • the file data may be updated each time an operation is performed, and the journaling file system of the conventional electronic device performs a journaling operation every time such an operation is performed.
  • This journaling operation primarily causes I / O (input / output) to the storage and can also cause secondary I / O to the main file system. As a result, excessively occurring storage I / O can degrade storage performance and lifespan.
  • Various embodiments of the present invention aim to reduce storage I / O by performing selective journaling of file data, thereby preventing degradation of storage performance and lifespan.
  • An electronic device may include a first memory configured to store file data; A second memory having a different property from the first memory; And a processor, wherein the processor is further configured to store journal data associated with a change to at least some file data of the file data in the second memory, and, if a specified condition is satisfied, based at least on the journal data.
  • the at least some file data stored in the first memory may be set to be updated.
  • a method of journaling file data in an electronic device may include detecting change of at least some file data stored in a first memory; Storing journal data associated with the change in a second memory having a different attribute from the first memory; And updating the at least some file data stored in the first memory based at least on the journal data when a specified condition is satisfied.
  • FIG. 1 illustrates an electronic device in a network environment in various embodiments.
  • FIG. 2 is a block diagram of an electronic device according to various embodiments of the present disclosure.
  • FIG. 3 is a block diagram of a program module according to various embodiments of the present disclosure.
  • FIG. 4 is a block diagram of an electronic device according to various embodiments of the present disclosure.
  • FIG. 5 is a diagram illustrating a program module according to one of various embodiments of the present disclosure.
  • FIG. 6 is a diagram illustrating a program module according to one of various embodiments of the present disclosure.
  • FIG. 7 is a diagram illustrating data stored in a first memory and a second memory, according to various embodiments.
  • 8A and 8B illustrate a checkpoint operation in accordance with some of the various embodiments of the present invention.
  • 9A and 9B illustrate a checkpoint operation in accordance with some of the various embodiments of the present invention.
  • FIG. 10 illustrates a checkpoint time point according to various embodiments of the present disclosure.
  • FIG. 11 is a flowchart illustrating a file data journaling method of an electronic device according to various embodiments of the present disclosure.
  • FIG. 12 is a flowchart illustrating a file data journaling method of an electronic device according to various embodiments of the present disclosure.
  • the expression “device configured to” may mean that the device “can” together with other devices or components.
  • processor configured (or configured to) perform A, B, and C may be implemented by executing a dedicated processor (eg, an embedded processor) to perform its operation, or one or more software programs stored in a memory device. It may mean a general purpose processor (eg, a CPU or an application processor) capable of performing the corresponding operations.
  • An electronic device may be, for example, a smartphone, a tablet PC, a mobile phone, a video phone, an e-book reader, a desktop PC, a laptop PC, a netbook computer, a workstation, a server, a PDA, a PMP. It may include at least one of a portable multimedia player, an MP3 player, a medical device, a camera, or a wearable device. Wearable devices may be accessory (e.g. watches, rings, bracelets, anklets, necklaces, eyeglasses, contact lenses, or head-mounted-devices (HMDs), textiles or clothing integrated (e.g.
  • HMDs head-mounted-devices
  • an electronic device may comprise, for example, a television, a digital video disk (DVD) player, Audio, Refrigerator, Air Conditioner, Cleaner, Oven, Microwave, Washing Machine, Air Purifier, Set Top Box, Home Automation Control Panel, Security Control Panel, Media Box (e.g. Samsung HomeSyncTM, Apple TVTM, or Google TVTM), Game Console (Eg, XboxTM, PlayStationTM), an electronic dictionary, an electronic key, a camcorder, or an electronic picture frame.
  • DVD digital video disk
  • the electronic device may include a variety of medical devices (e.g., various portable medical measuring devices such as blood glucose meters, heart rate monitors, blood pressure meters, or body temperature meters), magnetic resonance angiography (MRA), magnetic resonance imaging (MRI), Computed tomography (CT), cameras or ultrasounds), navigation devices, global navigation satellite systems (GNSS), event data recorders (EDRs), flight data recorders (FDRs), automotive infotainment devices, ship electronics (E.g., various portable medical measuring devices such as blood glucose meters, heart rate monitors, blood pressure meters, or body temperature meters), magnetic resonance angiography (MRA), magnetic resonance imaging (MRI), Computed tomography (CT), cameras or ultrasounds), navigation devices, global navigation satellite systems (GNSS), event data recorders (EDRs), flight data recorders (FDRs), automotive infotainment devices, ship electronics (E.g.
  • various portable medical measuring devices such as blood glucose meters, heart rate monitors, blood pressure meters, or body temperature meters
  • MRA magnetic resonance angiography
  • an electronic device may be a part of a furniture, building / structure or automobile, an electronic board, an electronic signature receiving device, a projector, or various measuring devices (eg, water, electricity, Gas, or a radio wave measuring instrument).
  • the electronic device may be flexible or a combination of two or more of the aforementioned various devices.
  • Electronic devices according to embodiments of the present disclosure are not limited to the above-described devices.
  • the term user may refer to a person who uses an electronic device or a device (eg, an artificial intelligence electronic device) that uses an electronic device.
  • the electronic device 101 may include a bus 110, a processor 120, a memory 130, an input / output interface 150, a display 160, and a communication interface 170.
  • the electronic device 101 may omit at least one of the components or additionally include other components.
  • the bus 110 may include circuitry that connects the components 110-170 to each other and transfers communication (eg, control messages or data) between the components.
  • the processor 120 may include one or more of a central processing unit, an application processor, or a communication processor (CP).
  • the processor 120 may execute, for example, an operation or data processing related to control and / or communication of at least one other component of the electronic device 101.
  • the memory 130 may include volatile and / or nonvolatile memory.
  • the memory 130 may store, for example, commands or data related to at least one other element of the electronic device 101.
  • the memory 130 may store software and / or a program 140.
  • the program 140 may include, for example, a kernel 141, middleware 143, an application programming interface (API) 145, an application program (or “application”) 147, or the like.
  • API application programming interface
  • application or “application”
  • At least a portion of kernel 141, middleware 143, or API 145 may be referred to as an operating system.
  • the kernel 141 may be a system resource (eg, used to execute an action or function implemented in, for example, other programs (eg, middleware 143, API 145, or application program 147).
  • the bus 110, the processor 120, or the memory 130 may 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 101 from the middleware 143, the API 145, or the application program 147. Can be.
  • the middleware 143 may serve as an intermediary for allowing the API 145 or the application program 147 to communicate with the kernel 141 to exchange data.
  • the middleware 143 may process one or more work requests received from the application program 147 according to priority.
  • the middleware 143 may use system resources (eg, the bus 110, the processor 120, or the memory 130, etc.) of the electronic device 101 for at least one of the application programs 147. Prioritize and process the one or more work requests.
  • the API 145 is an interface for the application 147 to control functions provided by the kernel 141 or the middleware 143.
  • the API 145 may include at least the following: file control, window control, image processing, or character control. It can contain one interface or function (eg command).
  • the input / output interface 150 may transmit, for example, a command or data input from a user or another external device to other component (s) of the electronic device 101, or other components of the electronic device 101 ( Commands or data received from the device) can be output to the user or other external device.
  • Display 160 may be, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, or a microelectromechanical system (MEMS) display, or an electronic paper display. It may include.
  • the display 160 may display, for example, various types of content (eg, text, images, videos, icons, and / or symbols, etc.) to the user.
  • the display 160 may include a touch screen and may receive, for example, a touch, gesture, proximity, or hovering input using an electronic pen or a part of a user's body.
  • the communication interface 170 may establish communication between the electronic device 101 and an external device (eg, the first external electronic device 102, the second external electronic device 104, or the server 106). Can be.
  • the communication interface 170 may be connected to the network 162 through wireless or wired communication to communicate with an external device (eg, the second external electronic device 104 or the server 106).
  • the wireless communication may be, for example, LTE, LTE Advance (LTE-A), code division multiple access (CDMA), wideband CDMA (WCDMA), universal mobile telecommunications system (UMTS), wireless broadband (WiBro), or global network (GSM).
  • 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 network
  • the wireless communication may include, for example, wireless fidelity (WiFi), Bluetooth, Bluetooth low power (BLE), Zigbee, near field communication (NFC), magnetic secure transmission, and radio. It may include at least one of a frequency (RF) or a body area network (BAN).
  • GNSS GNSS.
  • the GNSS may be, for example, a Global Positioning System (GPS), a Global Navigation Satellite System (Glonass), a Beidou Navigation Satellite System (hereinafter referred to as “Beidou”) or Galileo, the European global satellite-based navigation system.
  • GPS Global Positioning System
  • Glonass Global Navigation Satellite System
  • Beidou Beidou Navigation Satellite System
  • Wired communication may include, for example, at least one of a universal serial bus (USB), a high definition multimedia interface (HDMI), a standard standard232 (RS-232), a power line communication, a plain old telephone service (POTS), and the like.
  • the network 162 may comprise a telecommunications network, for example at least one of a computer network (eg, LAN or WAN), the Internet, or a telephone network.
  • Each of the first and second external electronic devices 102 and 104 may be a device of the same or different type as the electronic device 101. According to various embodiments of the present disclosure, all or part of operations executed in the electronic device 101 may be executed in another or a plurality of electronic devices (for example, the electronic devices 102 and 104 or the server 106). According to this, when the electronic device 101 needs to perform a function or service automatically or by request, the electronic device 101 may instead execute or execute the function or service by itself, or at least some function associated therewith.
  • the other electronic device may request the requested function or The additional function may be executed and the result may be transmitted to the electronic device 101.
  • the electronic device 101 may provide the requested function or service by processing the received result as it is or additionally.
  • Cloud computing distributed computing, or client-server computing techniques can be used.
  • the electronic device 201 may include, for example, all or part of the electronic device 101 illustrated in FIG. 1.
  • the electronic device 201 may include one or more processors (eg, an AP) 210, a communication module 220, a subscriber identification module 224, a memory 230, a sensor module 240, an input device 250, and a display. 260, an interface 270, an audio module 280, a camera module 291, a power management module 295, a battery 296, an indicator 297, and a motor 298.
  • the 210 may control a plurality of hardware or software components connected to the processor 210 by running an operating system or an application program, and may perform various data processing and operations.
  • the processor 210 may further include a graphic processing unit (GPU) and / or an image signal processor. 210 may include at least some of the components shown in FIG. 2 (eg, cellular module 221). The processor 210 other components: processing by loading the command or data received from at least one (e.g., non-volatile memory) in the volatile memory) and can store the result data into the nonvolatile memory.
  • a graphic processing unit GPU
  • an image signal processor may include at least some of the components shown in FIG. 2 (eg, cellular module 221).
  • the processor 210 other components: processing by loading the command or data received from at least one (e.g., non-volatile memory) in the volatile memory) and can store the result data into the nonvolatile memory.
  • the communication module 220 may include, for example, a cellular module 221, a WiFi module 223, a Bluetooth module 225, a GNSS module 227, an NFC module 228, and an RF module 229. have.
  • the cellular module 221 may provide, for example, a voice call, a video call, a text service, or an internet service through a communication network.
  • the cellular module 221 may perform identification and authentication of the electronic device 201 in a communication network by using a subscriber identification module (eg, a SIM card) 224.
  • the cellular module 221 may perform at least some of the functions that the processor 210 may provide.
  • the cellular module 221 may include a communication processor (CP).
  • CP communication processor
  • at least some (eg, two or more) of the cellular module 221, the WiFi module 223, the Bluetooth module 225, the GNSS module 227, or the NFC module 228 may be one integrated chip. (IC) or in an IC package.
  • the RF module 229 may transmit / receive a communication signal (for example, an RF signal), for example.
  • the RF module 229 may include, for example, a transceiver, a power amp module (PAM), a frequency filter, a low noise amplifier (LNA), an antenna, or the like.
  • PAM power amp module
  • LNA low noise amplifier
  • At least one of the cellular module 221, the WiFi module 223, the Bluetooth module 225, the GNSS module 227, or the NFC module 228 may transmit and receive an RF signal through a separate RF module.
  • Subscriber identification module 224 may include, for example, a card or embedded SIM that includes a subscriber identification module, and may include unique identification information (eg, integrated circuit card identifier (ICCID)) or subscriber information (eg, IMSI). (international mobile subscriber identity)).
  • ICCID integrated circuit card identifier
  • IMSI international mobile subscriber identity
  • the memory 230 may include, for example, an internal memory 232 or an external memory 234.
  • the internal memory 232 may include, for example, volatile memory (for example, DRAM, SRAM, or SDRAM), nonvolatile memory (for example, one time programmable ROM (OTPROM), PROM, EPROM, EEPROM, mask ROM, flash ROM).
  • the flash memory may include at least one of a flash memory, a hard drive, or a solid state drive (SSD)
  • the external memory 234 may be a flash drive, for example, a compact flash (CF) or a secure digital (SD). ), Micro-SD, Mini-SD, extreme digital (xD), multi-media card (MMC), memory stick, etc.
  • the external memory 234 may be functionally connected to the electronic device 201 through various interfaces. Or physically connected.
  • the sensor module 240 may measure, for example, a physical quantity or detect an operation state of the electronic device 201 and convert the measured or detected information into an electrical signal.
  • the sensor module 240 includes, for example, a gesture sensor 240A, a gyro sensor 240B, an air pressure sensor 240C, a magnetic sensor 240D, an acceleration sensor 240E, a grip sensor 240F, and a proximity sensor ( 240G), color sensor 240H (e.g., red (green, blue) sensor), biometric sensor 240I, temperature / humidity sensor 240J, illuminance sensor 240K, or UV (ultra violet) ) May include at least one of the sensors 240M.
  • sensor module 240 may include, for example, an e-nose sensor, an electromyography (EMG) sensor, an electrocardiogram (EEG) sensor, an electrocardiogram (ECG) sensor, Infrared (IR) sensors, iris sensors and / or fingerprint sensors.
  • the sensor module 240 may further include a control circuit for controlling at least one or more sensors belonging therein.
  • the electronic device 201 further includes a processor configured to control the sensor module 240 as part of or separately from the processor 210, while the processor 210 is in a sleep state. The sensor module 240 may be controlled.
  • the input device 250 may include, for example, a touch panel 252, a (digital) pen sensor 254, a key 256, or an ultrasonic input device 258.
  • the touch panel 252 may use at least one of capacitive, resistive, infrared, or ultrasonic methods, for example.
  • the touch panel 252 may further include a control circuit.
  • the touch panel 252 may further include a tactile layer to provide a tactile response to the user.
  • the (digital) pen sensor 254 may be, for example, part of a touch panel or may include a separate recognition sheet.
  • the key 256 may include, for example, a physical button, an optical key, or a keypad.
  • the ultrasonic input device 258 may detect ultrasonic waves generated by an input tool through a microphone (for example, the microphone 288) and check data corresponding to the detected ultrasonic waves.
  • Display 260 may include panel 262, hologram device 264, projector 266, and / or control circuitry to control them.
  • the panel 262 may be implemented to be, for example, flexible, transparent, or wearable.
  • the panel 262 may be configured with the touch panel 252 and one or more modules.
  • panel 262 may include a pressure sensor (or force sensor) capable of measuring the strength of the pressure on the user's touch.
  • the pressure sensor may be integrally implemented with the touch panel 252 or one or more sensors separate from the touch panel 252.
  • the hologram 264 may show a stereoscopic image in the air by using interference of light.
  • the projector 266 may display an image by projecting light onto a screen.
  • the screen may be located inside or outside the electronic device 201.
  • the interface 270 may include, for example, an HDMI 272, a USB 274, an optical interface 276, or a D-subminiature 278.
  • the interface 270 may be included in, for example, the communication interface 170 illustrated in FIG. 1.
  • interface 270 may include, for example, a mobile high-definition link (MHL) interface, an SD card / multi-media card (MMC) interface, or an infrared data association (IrDA) compliant interface. have.
  • MHL mobile high-definition link
  • MMC Secure Digital Card
  • IrDA infrared data association
  • the audio module 280 may bidirectionally convert, for example, a sound and an electrical signal. At least some components of the audio module 280 may be included in, for example, the input / output interface 145 illustrated in FIG. 1.
  • the audio module 280 may process sound information input or output through, for example, a speaker 282, a receiver 284, an earphone 286, a microphone 288, or the like.
  • the camera module 291 is, for example, a device capable of capturing still images and moving images. According to one embodiment, the camera module 291 is one or more image sensors (eg, a front sensor or a rear sensor), a lens, an image signal processor (ISP) Or flash (eg, LED or xenon lamp, etc.).
  • ISP image signal processor
  • flash eg, LED or xenon lamp, etc.
  • the power management module 295 may manage power of the electronic device 201, for example.
  • the power management module 295 may include a power management integrated circuit (PMIC), a charger IC, or a battery or fuel gauge.
  • the PMIC may have a wired and / or wireless charging scheme.
  • the wireless charging method may include, for example, a magnetic resonance method, a magnetic induction method, an electromagnetic wave method, or the like, and may further include additional circuits for wireless charging, such as a coil loop, a resonance circuit, a rectifier, and the like. have.
  • the battery gauge may measure, for example, the remaining amount of the battery 296, the voltage, the current, or the temperature during charging.
  • the battery 296 may include, for example, a rechargeable cell and / or a solar cell.
  • the indicator 297 may display a specific state of the electronic device 201 or a part thereof (for example, the processor 210), for example, a booting state, a message state, or a charging state.
  • the motor 298 may convert electrical signals into mechanical vibrations, and may generate vibrations or haptic effects.
  • the electronic device 201 may be, for example, a mobile TV supporting device capable of processing media data according to a standard such as digital multimedia broadcasting (DMB), digital video broadcasting (DVB), or mediaFloTM. GPU).
  • DMB digital multimedia broadcasting
  • DVD digital video broadcasting
  • GPU mediaFloTM.
  • Each of the components described in this document may be composed of one or more components, and the names of the corresponding components may vary depending on the type of electronic device.
  • the electronic device eg, the electronic device 201) may include some components, omit additional components, or combine some of the components to form a single entity. It is possible to perform the same function of the previous corresponding components.
  • the program module 310 may include an operating system and / or various applications running on the operating system for controlling resources related to the electronic device (eg, the electronic device 101).
  • the application program 147 may be included.
  • the operating system may include, for example, Android TM, iOS TM, Windows TM, Symbian TM, Tizen TM, or Bada TM.
  • the program module 310 may include the kernel 320 (eg, the kernel 141), the middleware 330 (eg, the middleware 143), and the API 360 (eg, the API 145).
  • At least a portion of the program module 310 may be preloaded on the electronic device or may be an external electronic device (eg, an electronic device ( 102, 104, server 106, etc.).
  • the kernel 320 may include, for example, a system resource manager 321 and / or a device driver 323.
  • the system resource manager 321 may perform control, allocation, or retrieval of system resources.
  • the system resource manager 321 may include a process manager, a memory manager, or a file system manager.
  • the device driver 323 may include, for example, a display driver, a camera driver, a Bluetooth driver, a shared memory driver, a USB driver, a keypad driver, a WiFi driver, an audio driver, or an inter-process communication (IPC) driver.
  • the middleware 330 may provide various functions through the API 360, for example, to provide functions commonly required by the application 370, or to allow the application 370 to use limited system resources inside the electronic device.
  • the middleware 330 may include a runtime library 335, an application manager 341, a window manager 342, a multimedia manager 343, a resource manager 344, a power manager 345, and a database manager ( 346, a package manager 347, a connectivity manager 348, a notification manager 349, a location manager 350, a graphic manager 351, or a security manager 352.
  • the runtime library 335 may include, for example, a library module that the compiler uses to add new functionality through the programming language while the application 370 is running.
  • the runtime library 335 may perform input / output management, memory management, or arithmetic function processing.
  • the application manager 341 may manage, for example, the life cycle of the application 370.
  • the window manager 342 may manage GUI resources used on the screen.
  • the multimedia manager 343 may identify a format necessary for playing the media files, and may encode or decode the media file using a codec suitable for the format.
  • the resource manager 344 may manage space of source code or memory of the application 370.
  • the power manager 345 may manage, for example, the capacity or power of the battery and provide power information necessary for the operation of the electronic device.
  • the power manager 345 may interwork with a basic input / output system (BIOS).
  • the database manager 346 may create, retrieve, or change a database to be used, for example, in the application 370.
  • the package manager 347 may manage installation or update of an application distributed in the form of a package file.
  • the connectivity manager 348 may manage, for example, a wireless connection.
  • the notification manager 349 may provide the user with events such as, for example, an arrival message, an appointment, a proximity notification, and the like.
  • the location manager 350 may manage location information of the electronic device, for example.
  • the graphic manager 351 may manage, for example, graphic effects to be provided to the user or a user interface related thereto.
  • the security manager 352 may provide system security or user authentication, for example.
  • the middleware 330 may include a telephony manager for managing a voice or video call function of the electronic device or a middleware module capable of forming a combination of functions of the above-described components. .
  • the middleware 330 may provide a module specialized for each type of operating system.
  • the middleware 330 may dynamically delete some of the existing components or add new components.
  • API 360 is, for example, a set of API programming functions, which may be provided in different configurations depending on the operating system. For example, in the case of Android or iOS, one API set may be provided for each platform, and in Tizen, two or more API sets may be provided for each platform.
  • the application 370 is, for example, a home 371, a dialer 372, an SMS / MMS 373, an instant message (IM) 374, a browser 375, a camera 376, an alarm 377. , Contacts 378, voice dials 379, emails 380, calendars 381, media players 382, albums 383, watches 384, health care (e.g., measures exercise or blood sugar) Or an application for providing environmental information (eg, barometric pressure, humidity, or temperature information).
  • the application 370 may include an information exchange application capable of supporting information exchange between the electronic device and the external electronic device.
  • the information exchange application may include, for example, a notification relay application for delivering specific information to the external electronic device, or a device management application for managing the external electronic device.
  • the notification delivery application may deliver notification information generated by another application of the electronic device to the external electronic device, or receive notification information from the external electronic device and provide the notification information to the user.
  • the device management application may be, for example, the ability of an external electronic device to communicate with the electronic device (e.g. turn-on / turn-off of the external electronic device itself (or some component) or the brightness (or resolution) of the display). Control), or install, delete, or update an application running on the external electronic device.
  • the application 370 may include an application (eg, a health care application of a mobile medical device) designated according to an attribute of the external electronic device.
  • the application 370 may include an application received from an external electronic device.
  • At least a portion of the program module 310 may be implemented (eg, executed) in software, firmware, hardware (eg, the processor 210), or a combination of at least two or more thereof, and a module for performing one or more functions; It can include a program, routine, instruction set, or process.
  • module includes a unit composed of hardware, software, or firmware, and may be used interchangeably with terms such as logic, logic blocks, components, or circuits.
  • the module may be an integrally formed part or a minimum unit or part of performing one or more functions.
  • Modules may be implemented mechanically or electronically, for example, application-specific integrated circuit (ASIC) chips, field-programmable gate arrays (FPGAs), or known or future developments that perform certain operations. It can include a programmable logic device.
  • ASIC application-specific integrated circuit
  • FPGAs field-programmable gate arrays
  • At least a portion of an apparatus (eg, modules or functions thereof) or method (eg, operations) according to various embodiments may be stored on a computer-readable storage medium (eg, memory 130) in the form of a program module. It can be implemented as.
  • Computer-readable recording media include hard disks, floppy disks, magnetic media (e.g. magnetic tape), optical recording media (e.g. CD-ROM, DVD, magnetic-optical media (e.g. floppy disks), internal memory, etc.
  • Instructions may include code generated by a compiler or code executable by an interpreter Modules or program modules according to various embodiments may include at least one or more of the above-described components. In some embodiments, operations performed by a module, a program module, or another component may be executed sequentially, in parallel, repeatedly, or heuristically, or at least, or may include other components. Some operations may be executed in a different order, omitted, or other operations may be added.
  • journaling file system refers to a file system for tracking changes by logging changes in memory before reflecting changes to the primary file system, wherein journal data refers to changes in file data. It may include data related to.
  • the file data may include metadata and data blocks.
  • the data block is composed of actual data included in the corresponding file data
  • the metadata may include information related to the data block.
  • the electronic device may generate the change of the meta data and / or the change of the data block as journal data.
  • FIG. 4 is a block diagram of an electronic device according to various embodiments of the present disclosure.
  • the electronic device 400 may include a processor 410, a first memory 420, and a second memory 430, and various elements of the present invention may be omitted even if at least some of the illustrated components are omitted or replaced. There will be no problem in implementing the embodiments.
  • the electronic device 400 may include at least some of the configurations of the electronic device 101 of FIG. 1 and / or the electronic device 200 of FIG. 2 in addition to the illustrated configuration.
  • the processor 410 is an element that can perform calculation or data processing related to control and / or communication of each component of the electronic device 400, and includes a first memory 420 and a second memory 430. It may be electrically connected to various components of the electronic device 400.
  • the processor 410 may include at least some of the components of the processor 120 of FIG. 1 and / or the application processor 210 of FIG. 2, or may perform at least some of functions that may be performed. Operations of the processor 410 may be performed by loading instructions stored in the first memory 420 or the second memory 430.
  • Journaling related operations of the processor 410 may be performed by a journaling module in a file system manager included in a program module.
  • the first memory 420 may be a non-volatile memory and may be a large storage device.
  • the first memory 420 may include at least one of one time programmable ROM (OTPROM), PROM, EPROM, EEPROM, mask ROM, flash ROM, flash memory, hard drive, or solid state drive (SSD). Can be.
  • OTPROM time programmable ROM
  • PROM PROM
  • EPROM EPROM
  • EEPROM electrically erasable programmable ROM
  • mask ROM mask ROM
  • flash ROM flash memory
  • flash memory hard drive
  • SSD solid state drive
  • SSD solid state drive
  • the second memory 430 may be a memory having a different property from the first memory 420. According to various embodiments of the present disclosure, at least some regions of the second memory 430 are allocated to main memory, so that the processor 410 loads file data of the first memory 420 into the second memory 430. Alternatively, you can save and process operations on file data. According to various embodiments of the present disclosure, at least some regions of the second memory 430 may be allocated as storage devices, and the processor 410 may read the file journal data corresponding to the file data of the first memory 420. In general, the type of memory used in the main memory may be supplied to the electronic device as volatile memory such as dynamic random access memory (DRAM), static RAM (SRAM), or synchronous dynamic RAM (SDRAM).
  • DRAM dynamic random access memory
  • SRAM static RAM
  • SDRAM synchronous dynamic RAM
  • the second memory 430 which is a main memory, may retain data at least temporarily even when a sudden power off occurs in the electronic device 400. Can be.
  • the second memory 430 may be continuously supplied with power to a partial region of the battery-integrated electronic device, or a separate auxiliary battery may be provided in the second memory 430 to power off the electronic device 400.
  • Power may be supplied to the second memory 430 from the auxiliary battery, at least temporarily RAM, or nonvolatile memory (NVRAM), which is a nonvolatile memory.
  • NVRAM nonvolatile memory
  • some regions of the second memory 430 may be designated regions used for journaling.
  • the designated area may be designated as a physical or virtual address of the second memory 430.
  • the second memory 430 may include a plurality of memories, and the plurality of memories may be the same kind or different kinds.
  • the electronic device 400 may perform a journaling function on file data stored in the first memory 420.
  • the processor 410 generates the journal data related to the change of the file data of at least some of the file data stored in the first memory 420 and stores the journal data in the second memory 430. It may be set to update at least some file data stored in the memory 420.
  • the specified condition may be an example of a case in which power supply of the electronic device 400 is suddenly cut off or a system crash occurs.
  • the journaling file system is a file system for tracking changes by logging changes in memory before reflecting changes to the main file system. Journaling file systems can use the journal data to bring the file system online more quickly in the event of a power off or system failure, and reduce the chance of file data corruption.
  • the electronic device 400 may journal only meta data included in file data, or may journal all file data including metadata and data blocks.
  • general journaling mode which only journals the metadata of the file system
  • the integrity of the data block which is a general data area
  • the data journaling mode for journaling the entire file data can guarantee the integrity of the entire data.
  • the size of the journaling area of the second memory 430 is limited, which is a problem. Accordingly, various embodiments of the present invention may perform journaling on all file data for file data corresponding to a specified attribute, and generate journal data only for changes of metadata for the remaining file data.
  • the operation of the processor 410 storing the journal data in the second memory 430 may be a commit operation.
  • the commit operation may be an operation of writing file data, which is the subject of journaling, in a journaling area of the second memory 430 in a transaction unit.
  • the processor 410 may perform a check point operation in which journal data of a transaction unit recorded in the journaling area where the commit is completed is recorded in the main file system area of the first memory 420. According to the check point, journaling related logs recorded in the journaling area of the second memory 430 may be changed into a deleteable state.
  • checkpoints have passed a period of time (e.g. dirty expiration time, which can be set to 2 seconds on some operating systems) after insufficient journaling space or available main memory is available, or file data has been modified on main memory. If you can proceed.
  • the check point generates I / O to the first memory 420, and the I / O of the first memory 420 that is excessively generated due to frequent check points may degrade the performance and lifespan of the first memory 420. Can be. Accordingly, the electronic device 400 according to various embodiments may minimize the I / O generated in the first memory 420 by delaying the point of time of the checkpoint as much as possible.
  • the processor 410 may journal the file data in a data journaling mode if the file data (or journal data) belongs to a specified attribute. That is, the second memory 420 may be configured to store the metadata of the file data belonging to the designated attribute and the journal data related to the change of at least a part of the data block.
  • the specified attribute indicates that when the file deletion operation is performed after the file data (or journal data) is updated and synchronized, the data for the same area of the file data (or journal data) is repeatedly synchronized several times. Cases are examples.
  • the processor 410 may journal in a data journaling mode for a file whose file size is smaller than a certain threshold.
  • the processor 410 may perform journaling in a data journaling mode for a file whose file size is smaller than a specific threshold among the file data belonging to the designated attribute as described above. The operation will be described in more detail with reference to FIGS. 8 and 9.
  • the processor 410 may perform journaling in a general journaling mode when the file data does not belong to a specified attribute. That is, the processor 410 may be configured to store journal data related to a change of at least a part of the metadata of the corresponding file data in the second memory.
  • the processor 410 may perform a checkpoint on the journal data according to the available capacity of the second memory 430.
  • the processor 410 may perform a foreground checkpoint when the available capacity is within the first limit value and perform a background checkpoint when the available capacity is within the second limit value. Performance of the checkpoint according to the available capacity of the second memory 430 will be described in detail later with reference to FIG. 10.
  • FIG. 5 is a diagram illustrating a program module according to one of various embodiments of the present disclosure.
  • a first memory for storing main file data and a second memory for storing journal data are implemented on one storage device 520 in a hardware plane.
  • the program module 510 may be divided into a user space and a kernel space, where the user space includes an application 512, and the kernel space is an operating system 514. system), a file management module 516 (file management module) and a driver 518 (driver).
  • the user space includes an application 512
  • the kernel space is an operating system 514. system
  • file management module 516 file management module
  • driver 518 driver
  • a file management module 516 including journaling module 517 on program module 510 is operated and file system data and journal data on on-disk file system 522 of storage are operated. Can be stored.
  • the program module 510 is implemented on main memory (system memory) and may cache or buffer file data and journal data.
  • the application 512 may include a plurality of applications 512 running on the electronic device.
  • the application 512 may read and write files to the storage device 520 through the operating system 514. Examples of the application 512 may vary, but a database manager may be used to create and manage db files, db backup files, and the like.
  • Operating system 514 is the core software layer that handles system calls associated with the file system.
  • the operating system 514 can provide a general-purpose interface between different file systems.
  • the file management module 516 may perform an operation of managing a file system.
  • the file management module 516 is connected to the operating system 514 and may process operation instructions such as write, fsync, and unlink for a file sent by the operating system 514.
  • the file management module 516 includes a journaling module 517, which can manage (create and commit) journal data on a transaction basis and adjust checkpoint timing of transactions.
  • the driver 518 may include a block device device driver coupled to the storage device 520.
  • the driver 518 may be connected to the file system and the journaling module 517 to perform data input / output corresponding to file input / output.
  • the driver 518 may include a block layer that virtualizes a portion of the storage device 520 as a block device.
  • journaling module 517 can store journal data in a journaling area of the storage device 520. Each time an operation of the file system is performed, it is written to the metadata and / or data block of the file, and journaling module 517 generates (and / or commits) journal data associated with the file as it is changed by each operation. To be stored in the storage device 520.
  • journal data generated according to the operation may cause primary I / O to the storage device 520 through a commit operation, and may cause secondary I / O to the main file system at checkpoint. Generation of excessive I / O to the storage device 520 may degrade the performance and lifespan of the storage.
  • FIG. 6 is a diagram illustrating a program module according to one of various embodiments of the present disclosure.
  • This embodiment includes a first memory 620 and a second memory 630 having different attributes in hardware compared to the embodiment of FIG. 5, and the main file system 622 includes the first memory 620.
  • the journal data may be stored in the journaling area 632 of the second memory 630.
  • file data is stored (or cached) in the file management module 616 of the program module 610, and journal data is stored (or buffered) in the journaling module 617 within the file management module 616.
  • Journal data buffered in the journaling module 617 is stored on the second memory 630 by a commit operation. When a checkpoint operation occurs later, the file data cached in the file management module 616 corresponding to the journal data is stored. It may be stored in the main file system 622 of the first memory 620.
  • the application 612 may select a file corresponding to a specified attribute among a plurality of files on the file system and set the data journaling mode.
  • the data journaling mode is a mode for journaling the entire file data including the metadata and data blocks of the file system.
  • the application 612 may include a file or file size in which data for the same area of the file or journal data performing file deletion after file update and synchronization is repeatedly performed multiple times. You can set a file with) smaller than a certain threshold in data journaling mode, for example the ioctl method.
  • the application 612 may set a file having a specific directory or a specific file name or a specific extension to the data journaling mode.
  • the file management module 616 may apply an appropriate journaling mode on a file basis according to the setting of the application 612.
  • a file performing a file deletion operation after file update and synchronization is file backup data such as a DB used to ensure file integrity in a database manager, for example, a delete mode of a database manager (for example, SQLite).
  • file backup data such as a DB used to ensure file integrity in a database manager, for example, a delete mode of a database manager (for example, SQLite).
  • a truncate mode DB rollback journal file and a backup file with a .bak extension of the Android AtomicFile class can be stored in the database manager's persist mode DB rollback journal file, write-ahead logging (WAL) mode DB journal file, DB file, and AtomicFile in the Android AtomicFile class.
  • WAL write-ahead logging
  • the application 612 may perform a journaling operation in a general journaling mode in which journaling is performed only on metadata for a file that does not correspond to the specified attribute as described above. According to an embodiment, the application 612 may classify a file to be journaled in a data journaling mode by referring to a file attribute such as a file extension.
  • the operating system 614 is a core software layer that handles system calls associated with the file system and the operation of the operating system 614 may be the same as the embodiment of the operating system 514 of FIG. 5.
  • the first block device 618 is a device driver connected to the first memory 620 and connected to a file system to perform data input / output corresponding to file input / output. According to an embodiment, the first block device 618 may be generated by virtualizing a partial area of the first memory 620.
  • the second block device 619 is a device driver connected to the second memory 630. According to an embodiment, the second block device 619 may be generated by virtualizing a partial area of the second memory 630. .
  • the file management module 616 includes a journaling module 617, and the journal data generated (or cached) in the journaling module 617 is transferred to the journaling area (2) of the second memory 630 through the second block device 619. 632 may be stored (or committed). In addition, the file data of the main file system may be stored (or checkpointed) in the main file system area 622 on the first memory 620 through the first block device 618. According to an embodiment, the journaling module 617 may adjust the checkpoint timing of the committed transactions based on the capacity of the second block device 619.
  • the processor may be configured to access the journal data stored in the second memory 630 by the file management module 616.
  • the second memory 630 functions as a main memory.
  • the second memory 630 may retain the data for at least a predetermined time even if a sudden power off occurs in the electronic device.
  • the second memory 630 may be continuously supplied with power to a partial region of the battery integrated electronic device, or a separate auxiliary battery may be provided in the second memory 630 to prevent the second memory 630 from being supplied from the auxiliary battery.
  • Power may be supplied to the second memory 630, at least temporarily RAM, or non-volatile RAM (NVRAM) may be used.
  • NVRAM non-volatile RAM
  • FIG. 7 is a diagram illustrating data stored in a first memory and a second memory, according to various embodiments.
  • the first memory 710 may be a non-volatile memory and may be a large storage device.
  • the second memory 720 may be a memory in which a main memory is stored and may have a different property from that of the first memory 710.
  • File data may be stored in the first memory 710.
  • the processor may store (or commit) journal data related to the change of the file data stored in the first memory 710 in the second memory 720.
  • the second memory 720 stores at least some of the metadata and the data block (data associated with the DB / AtomicFile), and when the designated interrupt (eg, sudden power off) occurs, the second memory ( The file data of the first memory 710 may be updated (or recovered) based on the journal data stored in 720.
  • the second memory 720 may include a first area for journaling and a second area physically or logically separated from the first area, and the processor may include journal data in the first area when the journal data is generated. At least a portion of the buffer may be buffered, and at least one journal data buffered in the first area in a predetermined transaction unit may be journaled in the second area. In this case, when updating the file data of the first memory 710, the processor stores the file data stored in the first memory 710 based at least on the journal data buffered in the first area or the journal data journaled in the second area. Can be updated.
  • the second memory 720 includes a plurality of random access memories, at least some of the plurality of random access memories correspond to the first region, and at least some of the other random access memories correspond to the second region. Can be.
  • FIGS. 8A and 8B illustrate a checkpoint operation in accordance with some of the various embodiments of the present invention.
  • 8A and 8B illustrate a commit and checkpoint operation when an unlink operation is performed after a write and fsync operation on file data is performed, and FIGS. 8A and 8B respectively constitute another embodiment.
  • FIG. 8A illustrates an embodiment in which a journaling area is provided in a first memory 810 that is a storage device.
  • a record of a write operation may be added to metadata.
  • the processor may commit journal data related to the write operation in the journaling area of the first memory 810 and write (or cache) data related to the write operation in the main file system area.
  • journal data related to the unlink operation may be committed to the journaling area, and the data deletion processing operation (or discard) may be performed in the main file system area.
  • I / O to the first memory 810 occurs while writes for write and fsync operations and unlink operations are recorded on the journal data, and then additional I / O by the checkpoint operation is generated. May occur.
  • FIG. 8B illustrates an embodiment in which a journaling area is provided on the second memory 840. As shown, in the present embodiment, the checkpoints of the first transaction for write and fsync operations and the second transaction for unlink operations may be merged and processed.
  • journal data (MW-metadata write) 852 related to the operation may be added to the journaling area of the second memory 840.
  • the journal data may be metadata related to a write operation.
  • journal data related to the unlink operation (MU-metadata update) 854 may be committed to the journaling area.
  • the journal data may be metadata related to an unlink operation (metadatunlink (MU)).
  • the processor delays the point of time of the checkpoint, does not checkpoint the first transaction for write and fsync operations, and performs the checkpoint after the second transaction for the unlink operation is committed ( Example: You can trigger it.
  • writes for write and fsync operations may be recorded only in the second memory 840, and may not be recorded in the first memory 830.
  • Only the metadata of the last version from which the file is deleted may be stored in the main file system area of the first memory 830. That is, only the record (MU) 832 for the unlink operation may be stored in the metadata of the journal data checked in the first memory 830. For this reason, as compared with FIG. 8A, since the I / O to the first memory 830 occurs only at the check point of the second transaction, the I / O to the first memory 830 may be reduced.
  • the electronic device may perform journaling on file backup data such as a DB used to guarantee the integrity of a file in a database management program according to the embodiment of FIG. 8B.
  • the electronic device performs a file deletion operation after updating and synchronizing the file with respect to the file, and the file may be, for example, a delete mode and a truncate mode DB rollback journal file of a database manager (for example, SQLite), and an Android AtomicFile class.
  • a backup file with a .bak extension For example, a backup file with a .bak extension.
  • transactions can be deleted in the order in which the commit was completed by updating the pointer in the ring buffer of the journaling area.
  • the buffers belonging to the transaction where the commit is completed are forced to I / O only by the parts not processed by the kworker kernel thread, and then the corresponding transaction in the journaling area can be deleted.
  • 9A and 9B illustrate a checkpoint operation in accordance with some of the various embodiments of the present invention.
  • 9A and 9B illustrate commit and checkpoint operations when an unlink operation is repeatedly performed after a write and fsync operation is performed on the same area of a file.
  • 9A and 9B constitute another embodiment.
  • FIG. 9A illustrates an embodiment in which a journaling area is provided in a first memory 910 that is a storage device.
  • a particular file may perform write and fsync operations repeatedly (N times) on the same region.
  • the metadata may be added to each write and fsync operation, and N transactions may be committed as each operation is performed.
  • the general data related to the operation may be repeatedly recorded in the main file system area of the first memory 910.
  • FIG. 9B illustrates an embodiment in which a journaling area is provided on the second memory. As shown, in the present embodiment, checkpoints of a plurality of transactions for repeated write and fsync operations may be merged and processed.
  • journal data MW related to the operation may be added to the journaling area of the second memory 950. Thereafter, when the second write and fsync operations are performed on the same area of the file, journal data (MW) related to the operation may be added again. That is, the second transaction 954 may add data due to the second write and fsync operations in the meta data of the first transaction 952.
  • the processor may merge the checkpoints of a plurality of transactions in a manner that delays the time of the checkpoint. For example, without checkpointing each of the transactions for repeated write and fsync operations.
  • the checkpoint is triggered by insufficient space in the journaling area of the second memory 950, only the last version of the transaction 932 may be recorded in the first memory 930.
  • the electronic device may perform journaling on files that frequently update data on the same area of the file and repeatedly perform synchronization according to the embodiment of FIG. 9B.
  • the files may include, for example, a persist mode DB rollback journal file of a database manager, a write-ahead logging (WAL) mode DB journal file, a DB file, and an AtomicFile file of an Android AtomicFile class.
  • WAL write-ahead logging
  • FIG. 10 illustrates a checkpoint time point according to various embodiments of the present disclosure.
  • FIG. 10 illustrates usable capacity of the journaling area of the second memory, and illustrates a state in which data stored in the second memory increases, that is, available capacity decreases from left to right.
  • checkpoints are individually and / or sporadically executed through kworker kernel threads for data that has been committed to the journaling area of the first memory (or storage device) when a memory shortage condition or a specific period occurs.
  • I / O due to the check point was forced to be forced depending on the situation.
  • An electronic device may perform a foreground check point and a background check point according to available capacities of the second memory.
  • the data associated with the journal data may be configured to store (or checkpoint) the journal data in the first memory. That is, when journal data is committed to the second memory and the usable capacity of the journaling area decreases within the first limit value, the check point is performed in a process context that attempts to journal the first limit value of the available capacity of the journaling area. The above can be ensured. As such, performing a checkpoint in relation to a process context is called a foreground checkpoint.
  • the electronic device attempts to reduce process operation delay by reducing the occurrence frequency of the foreground check point through the background check point.
  • the electronic device eg, the processor 410) further includes a checkpoint performing module that performs (eg, triggers) a checkpoint in a kernel context (ie, a thread included in kernel space) instead of a process context.
  • a checkpoint performing module that performs (eg, triggers) a checkpoint in a kernel context (ie, a thread included in kernel space) instead of a process context. can do.
  • a checkpoint dedicated thread or task
  • performing a checkpoint in a kernel context rather than a process context is called a background checkpoint.
  • the processor when the available capacity of the second memory is within the second limit value TH2, stores the journal data in the first memory using a kernel thread related to storing the journal data (or checkpoint). It can be set to.
  • the second limit value is greater than the first limit value, and the processor initiates a background check point when the available capacity of the second memory is within the second limit value, thereby setting the available capacity of the second memory to the third limit value. (TH3) or more can be secured.
  • Background checkpoints unlike foreground checkpoints, can be performed in the context of kworker kernel threads that involve the storage of journal data.
  • the committed commit journal data may not be exposed to the kworker kernel thread in order to postpone the checkpoint. If the available capacity of the journaling area of the second memory decreases within the second limit in accordance with the storage of the journal data, the background checkpoint is enabled until the available capacity reaches the third limit by enabling the kernel thread that performs the checkpoint. Can be performed.
  • An electronic device may include a first memory configured to store file data; A second memory having a different property from the first memory; And a processor, wherein the processor is configured to store journal data associated with a change to at least some file data of the file data in the second memory, and the storing is performed in the first area of the second memory. Buffering at least a portion of data and journaling at least a portion of the journal data in a second region of the second memory, and if the specified condition is satisfied, based on at least the journal data; The at least some file data stored in the memory may be set to be updated.
  • the updating may include updating the at least some file data stored in the first memory based at least on the buffered journal data or the journaled journal data.
  • the second memory may include a plurality of random access memories including a first random access memory corresponding to the first region and a second random access memory corresponding to the second region.
  • the processor may be configured to store, in the second memory, journal data associated with a change of at least a portion of the data block and metadata of the file data if the file data belongs to a specified attribute. have.
  • the processor when the file data does not belong to the designated attribute, the processor may be configured to store journal data associated with a change to at least a part of the metadata of the file data in the second memory. .
  • the processor may be configured to determine whether the processor belongs to the specified attribute based on at least one of a directory, a file name, an extension, and a file size to which the file data belongs.
  • the processor may be configured to store the journal data in the first memory using a process related to the journal data when the available capacity of the second memory is within a first limit value.
  • the processor when the available capacity of the second memory is within a second limit value that is greater than the first limit value, the processor reads the journal data using a kernel thread related to storing the journal data. It may be set to store in the first memory.
  • the second memory may include at least one random access memory, and at least one of the second memories may retain data when the electronic device is powered off.
  • the processor is configured to update the at least some file data stored in the first memory based at least on the journal data when the power supply of the electronic device is cut off or when a system crash occurs. Can be.
  • FIG. 11 is a flowchart illustrating a file data journaling method of an electronic device according to various embodiments of the present disclosure.
  • the illustrated method may be performed by the electronic device described above with reference to FIGS. 1 through 10, and the description thereof will be omitted below.
  • the electronic device may include a first memory for storing file data and a second memory having a different property from the first memory.
  • the first memory is a non-volatile memory, and may be a large storage device.
  • the first memory may include at least one of a one time programmable ROM (OTPROM), a PROM, an EPROM, an EEPROM, a mask ROM, a flash ROM, a flash memory, a hard drive, or a solid state drive (SSD).
  • the second memory may be a memory having a different property from the first memory.
  • the second memory may include a main memory, and the second memory may retain data for at least a predetermined time even when a sudden power off occurs in the electronic device.
  • the second memory may include a battery integrated electronic device. Power is supplied to some areas continuously, or a separate auxiliary battery is provided in the second memory to supply power to the second memory from the auxiliary battery even when the electronic device is powered off, or at least temporarily store data.
  • NVRAM non-volatile RAM or non-volatile RAM
  • the electronic device may detect a change to at least some of the file data stored in the first memory.
  • the electronic device may check whether the corresponding file data has a specified attribute. According to an embodiment, it may be checked whether a file has a specified property by referring to an extension or a file size of the file.
  • the application of the electronic device may refer to an extension of a file, and may set an attribute for performing a data journaling operation on the file through the file system call ioctl interface. Can be specified.
  • the electronic device may journal the file in a data journaling mode.
  • the data journaling mode is a mode for journaling an entire file including metadata and data blocks.
  • the electronic device may journal the file in a normal journaling mode.
  • journaling is performed only for metadata of file data.
  • an application of an electronic device may include a file in which a file deletion operation is performed after file update and synchronization, a file in which data for the same region of journal data is repeatedly synchronized multiple times, or a file size has a specific threshold value.
  • a file performing a file deletion operation after file update and synchronization is file backup data such as a DB used to ensure file integrity in a database manager, for example, a delete mode of a database manager (for example, SQLite).
  • files that synchronize data for the same area repeatedly multiple times can be used in the database manager's persist mode DB rollback journal file, write-ahead logging (WAL) mode DB journal file, DB file, For example, the AtomicFile file.
  • WAL write-ahead logging
  • the electronic device may store journal data related to the change of the file data in the second memory.
  • journal data may be stored in a transaction unit in a designated journaling area of the second memory.
  • the storing may include buffering at least a portion of journal data in a first region of a second memory and journaling at least a portion of journal data in a second region different from the first region of the second memory. May include an action.
  • the second memory may include a plurality of random access memories, wherein the first region may correspond to the first random access memory, and the second region may correspond to the second random access memory.
  • the electronic device may detect an event that triggers a checkpoint.
  • the electronic device may store (or checkpoint) at least some data of the journal data in the first memory.
  • the checkpoint method for the file data belonging to the specified attribute may be the same as described above with reference to FIGS. 8 to 9.
  • the electronic device may determine whether the specified condition is satisfied.
  • the specified condition may be, for example, a case in which the power supply of the electronic device is suddenly cut off or a system crash occurs.
  • the electronic device may update file data stored in the first memory based on the journal data.
  • FIG. 12 is a flowchart illustrating a file data journaling method of an electronic device according to various embodiments of the present disclosure.
  • the electronic device may detect a change to at least some file data stored in the first memory and store journal data related to the change in a journaling area of the second memory.
  • the electronic device may check whether the available capacity of the second memory is within the first limit value.
  • the electronic device may perform a foreground check point on the journal data stored in the second memory.
  • the foreground checkpoint performs the checkpoint in the process context in which journaling is attempted, thereby ensuring an available capacity of the journaling area above the first limit value.
  • the electronic device may check whether the available capacity of the second memory is within the second limit value.
  • the second limit value may be greater than the first limit value.
  • the electronic device may perform a background check point.
  • Background checkpoints unlike foreground checkpoints, can be performed in the context of kworker kernel threads that involve the storage of journal data.
  • the committed commit journal data may not be exposed to the kworker kernel thread in order to postpone the checkpoint.
  • the background checkpoint is enabled until the available capacity reaches the third limit by enabling the kernel thread that performs the checkpoint. Can be performed.
  • the foreground check point and the background check point may be the same as described with reference to FIG. 10.
  • a method of journaling file data in an electronic device may include detecting change of at least some file data stored in a first memory; Storing journal data associated with the change in a second memory having a different attribute from the first memory; And updating the at least some file data stored in the first memory based at least on the journal data when a specified condition is satisfied, wherein the storing is performed in the first area of the second memory. Buffering at least a portion of data and journaling at least a portion of the journal data in a second area of the second memory.
  • the updating may include updating the at least some file data stored in the first memory based at least on the buffered journal data or the journaled journal data.
  • the second memory may include a plurality of random access memories including a first random access memory corresponding to the first region and a second random access memory corresponding to the second region.
  • the method may further include determining whether the file data belongs to a specified attribute, and when the file data belongs to the specified attribute, the metadata of the file data and the data block may be determined. And storing the journal data related to the change of at least a part in the second memory.
  • the storing of the journal data related to a change to at least a part of the metadata of the file data is performed in the second memory. It may include.
  • the operation of determining whether the file data belongs to a specified attribute may include determining whether the file data belongs to the specified attribute based on at least one of a directory, a file name, an extension, and a file size to which the file data belongs. May include an action.
  • the storing of the journal data in the first memory may include storing the journal data in the first memory using a process related to the journal data when an available capacity of the second memory is within a first limit value. It may include an operation to.
  • the storing of the first memory may include using a kernel thread related to storing the journal data when the available capacity of the second memory is within a second limit value that is larger than the first limit value. And storing the journal data in the first memory.
  • the second memory may include at least one random access memory, and at least one of the second memories may retain data when the electronic device is powered off.
  • the updating operation may include at least some file data stored in the first memory based at least on the journal data when the power supply of the electronic device is cut off or when a system crash occurs. It may include an operation of updating.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Quality & Reliability (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

본 발명의 다양한 실시예에 따른 전자장치는, 파일 데이터를 저장하기 위한 제1메모리; 상기 제1메모리와 다른 속성을 갖는 제2메모리; 및 프로세서를 포함하고, 상기 프로세서는, 상기 파일 데이터의 적어도 일부 파일 데이터에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하고, 및 지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정될 수 있다. 그 밖에 다양한 실시예들이 가능하다.

Description

전자 장치 및 전자 장치의 파일 데이터 저널링 방법
본 명세서는 전자 장치에 관한 것으로서, 보다 상세하게는 파일 데이터를 저널링(journaling) 할 수 있는 전자 장치에 관한 것이다.
스마트 폰(Smart Phone) 및 태블릿(Tablet) 등의 휴대용 전자 장치(이하, 전자 장치)는 다양한 사용자 경험을 제공하기 위해, 다양한 데이터들을 저장할 수 있다. 다양한 데이터의 운용을 위해서는 전자 장치는 종래의 컴퓨터 시스템과 마찬가지로 주 메모리(예를 들어, RAM(Random Access Memory)) 및 대용량 저장 장치인 스토리지(storage)를 포함하는 저장 장치 계층을 포함하며, 다양한 데이터들은 디렉토리 구조의 파일 시스템을 구성할 수 있다.
전자 장치의 동작 중에 파일 시스템은 파일 및/또는 디렉토리의 변경을 반영하여 수정될 수 있으며, 전자 장치 상에서 예상하지 못한 전원 문제 또는 시스템 크래시(system crash)로 인터럽트(interrupt)가 발생하는 경우, 파일 시스템의 일부 데이터가 손상되는 문제가 발생할 수 있다. 통상적으로, 전자 장치는 이러한 상황에 대비하여, 저널링(journaling) 파일 시스템을 구현할 수 있다. 저널링 파일 시스템은 주 파일 시스템에 변경 사항을 반영하기 이전에 메모리 안에 변경 사항을 로깅하여 변경사항을 추적하기 위한 파일 시스템이다.
파일 데이터는 오퍼레이션이 수행될 때마다 갱신될 수 있으며, 종래의 전자 장치의 저널링 파일 시스템은 이와 같은 오퍼레이션 수행 시마다 저널링 동작을 수행하였다. 이와 같은 저널링 동작은 일차적으로 스토리지에 I/O(input/output)를 유발하며, 주 파일 시스템에도 이차적인 I/O를 유발할 수 있다. 이에 따라 과도하게 발생하는 스토리지의 I/O는 스토리지의 성능 및 수명을 저하시킬 수 있다.
본 발명의 다양한 실시예들은 선택적인 파일 데이터의 저널링을 수행함으로써, 스토리지 I/O를 감소 시켜, 스토리지의 성능 및 수명 저하를 방지함에 그 목적이 있다.
본 발명의 다양한 실시예에 따른 전자장치는, 파일 데이터를 저장하기 위한 제1메모리; 상기 제1메모리와 다른 속성을 갖는 제2메모리; 및 프로세서를 포함하고, 상기 프로세서는, 상기 파일 데이터의 적어도 일부 파일 데이터에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하고, 및 지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정될 수 있다.
본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법은, 제1메모리에 저장된 적어도 일부 파일 데이터에 대한 변경을 감지하는 동작; 상기 변경과 관련된 저널 데이터를 상기 제1메모리와 다른 속성을 갖는 제2메모리에 저장하는 동작; 및 지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트 하는 동작을 포함할 수 있다.
상술한 본 발명에 따르면, 선택적인 파일 데이터의 저널링을 수행함으로써, 스토리지 I/O를 감소 시켜, 스토리지의 성능 및 수명 저하를 방지할 수 있다.
도 1은 다양한 실시예에서의, 네트워크 환경 내의 전자 장치를 도시한 것이다.
도 2는 다양한 실시예에 따른 전자 장치의 블록도이다.
도 3은 다양한 실시예에 따른 프로그램 모듈의 블록도이다.
도 4는 본 발명이 다양한 실시예에 따른 전자 장치의 블록도이다.
도 5는 본 발명의 다양한 실시예 중 일 실시예에 따른 프로그램 모듈을 도시하고 있다.
도 6은 본 발명의 다양한 실시예 중 일 실시예에 따른 프로그램 모듈을 도시하고 있다.
도 7은 다양한 실시예에 따른 제1메모리 및 제2메모리에 저장되는 데이터를 도시한 것이다.
도 8a 및 8b는 본 발명의 다양한 실시예 중 일부 실시예에 따른 체크포인트 동작을 도시한 것이다.
도 9a 및 9b는 본 발명의 다양한 실시예 중 일부 실시예에 따른 체크포인트 동작을 도시한 것이다.
도 10은 본 발명의 다양한 실시예에 따른 체크 포인트 시점을 도시한 것이다.
도 11은 본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법의 흐름도이다.
도 12는 본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법의 흐름도이다.
이하, 본 문서의 다양한 실시예들이 첨부된 도면을 참조하여 기재된다. 실시예 및 이에 사용된 용어들은 본 문서에 기재된 기술을 특정한 실시 형태에 대해 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 및/또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함할 수 있다. 본 문서에서, "A 또는 B" 또는 "A 및/또는 B 중 적어도 하나" 등의 표현은 함께 나열된 항목들의 모든 가능한 조합을 포함할 수 있다. "제 1," "제 2," "첫째," 또는 "둘째,"등의 표현들은 해당 구성요소들을, 순서 또는 중요도에 상관없이 수식할 수 있고, 한 구성요소를 다른 구성요소와 구분하기 위해 사용될 뿐 해당 구성요소들을 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에 "(기능적으로 또는 통신적으로) 연결되어" 있다거나 "접속되어" 있다고 언급된 때에는, 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로 연결되거나, 다른 구성요소(예: 제 3 구성요소)를 통하여 연결될 수 있다.
본 문서에서, "~하도록 구성된(또는 설정된)(configured to)"은 상황에 따라, 예를 들면, 하드웨어적 또는 소프트웨어적으로 "~에 적합한," "~하는 능력을 가지는," "~하도록 변경된," "~하도록 만들어진," "~를 할 수 있는," 또는 또는 "~하도록 설계된"과 상호 호환적으로(interchangeably) 사용될 수 있다. 어떤 상황에서는, "~하도록 구성된 장치"라는 표현은, 그 장치가 다른 장치 또는 부품들과 함께 "~할 수 있는" 것을 의미할 수 있다. 예를 들면, 문구 "A, B, 및 C를 수행하도록 구성된(또는 설정된) 프로세서"는 해당 동작을 수행하기 위한 전용 프로세서(예: 임베디드 프로세서), 또는 메모리 장치에 저장된 하나 이상의 소프트웨어 프로그램들을 실행함으로써, 해당 동작들을 수행할 수 있는 범용 프로세서(예: CPU 또는 application processor)를 의미할 수 있다.
본 문서의 다양한 실시예들에 따른 전자 장치는, 예를 들면, 스마트폰, 태블릿 PC, 이동 전화기, 영상 전화기, 전자책 리더기, 데스크탑 PC, 랩탑 PC, 넷북 컴퓨터, 워크스테이션, 서버, PDA, PMP(portable multimedia player), MP3 플레이어, 의료기기, 카메라, 또는 웨어러블 장치 중 적어도 하나를 포함할 수 있다. 웨어러블 장치는 액세서리형(예: 시계, 반지, 팔찌, 발찌, 목걸이, 안경, 콘택트 렌즈, 또는 머리 착용형 장치(head-mounted-device(HMD)), 직물 또는 의류 일체형(예: 전자 의복), 신체 부착형(예: 스킨 패드 또는 문신), 또는 생체 이식형 회로 중 적어도 하나를 포함할 수 있다. 어떤 실시예들에서, 전자 장치는, 예를 들면, 텔레비전, DVD(digital video disk) 플레이어, 오디오, 냉장고, 에어컨, 청소기, 오븐, 전자레인지, 세탁기, 공기 청정기, 셋톱 박스, 홈 오토매이션 컨트롤 패널, 보안 컨트롤 패널, 미디어 박스(예: 삼성 HomeSyncTM, 애플TVTM, 또는 구글 TVTM), 게임 콘솔(예: XboxTM, PlayStationTM), 전자 사전, 전자 키, 캠코더, 또는 전자 액자 중 적어도 하나를 포함할 수 있다.
다른 실시예에서, 전자 장치는, 각종 의료기기(예: 각종 휴대용 의료측정기기(혈당 측정기, 심박 측정기, 혈압 측정기, 또는 체온 측정기 등), MRA(magnetic resonance angiography), MRI(magnetic resonance imaging), CT(computed tomography), 촬영기, 또는 초음파기 등), 네비게이션 장치, 위성 항법 시스템(GNSS(global navigation satellite system)), EDR(event data recorder), FDR(flight data recorder), 자동차 인포테인먼트 장치, 선박용 전자 장비(예: 선박용 항법 장치, 자이로 콤파스 등), 항공 전자기기(avionics), 보안 기기, 차량용 헤드 유닛(head unit), 산업용 또는 가정용 로봇, 드론(drone), 금융 기관의 ATM, 상점의 POS(point of sales), 또는 사물 인터넷 장치 (예: 전구, 각종 센서, 스프링클러 장치, 화재 경보기, 온도조절기, 가로등, 토스터, 운동기구, 온수탱크, 히터, 보일러 등) 중 적어도 하나를 포함할 수 있다. 어떤 실시예에 따르면, 전자 장치는 가구, 건물/구조물 또는 자동차의 일부, 전자 보드(electronic board), 전자 사인 수신 장치(electronic signature receiving device), 프로젝터, 또는 각종 계측 기기(예: 수도, 전기, 가스, 또는 전파 계측 기기 등) 중 적어도 하나를 포함할 수 있다. 다양한 실시예에서, 전자 장치는 플렉서블하거나, 또는 전술한 다양한 장치들 중 둘 이상의 조합일 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다. 본 문서에서, 사용자라는 용어는 전자 장치를 사용하는 사람 또는 전자 장치를 사용하는 장치(예: 인공지능 전자 장치)를 지칭할 수 있다.
도 1을 참조하여, 다양한 실시예에서의, 네트워크 환경(100) 내의 전자 장치(101)가 기재된다. 전자 장치(101)는 버스(110), 프로세서(120), 메모리(130), 입출력 인터페이스(150), 디스플레이(160), 및 통신 인터페이스(170)를 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)는, 구성요소들 중 적어도 하나를 생략하거나 다른 구성요소를 추가적으로 구비할 수 있다. 버스(110)는 구성요소들(110-170)을 서로 연결하고, 구성요소들 간의 통신(예: 제어 메시지 또는 데이터)을 전달하는 회로를 포함할 수 있다. 프로세서(120)는, 중앙처리장치, 어플리케이션 프로세서, 또는 커뮤니케이션 프로세서(communication processor(CP)) 중 하나 또는 그 이상을 포함할 수 있다. 프로세서(120)는, 예를 들면, 전자 장치(101)의 적어도 하나의 다른 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 실행할 수 있다.
메모리(130)는, 휘발성 및/또는 비휘발성 메모리를 포함할 수 있다. 메모리(130)는, 예를 들면, 전자 장치(101)의 적어도 하나의 다른 구성요소에 관계된 명령 또는 데이터를 저장할 수 있다. 한 실시예에 따르면, 메모리(130)는 소프트웨어 및/또는 프로그램(140)을 저장할 수 있다. 프로그램(140)은, 예를 들면, 커널(141), 미들웨어(143), 어플리케이션 프로그래밍 인터페이스(API)(145), 및/또는 어플리케이션 프로그램(또는 "어플리케이션")(147) 등을 포함할 수 있다. 커널(141), 미들웨어(143), 또는 API(145)의 적어도 일부는, 운영 시스템으로 지칭될 수 있다. 커널(141)은, 예를 들면, 다른 프로그램들(예: 미들웨어(143), API(145), 또는 어플리케이션 프로그램(147))에 구현된 동작 또는 기능을 실행하는 데 사용되는 시스템 리소스들(예: 버스(110), 프로세서(120), 또는 메모리(130) 등)을 제어 또는 관리할 수 있다. 또한, 커널(141)은 미들웨어(143), API(145), 또는 어플리케이션 프로그램(147)에서 전자 장치(101)의 개별 구성요소에 접근함으로써, 시스템 리소스들을 제어 또는 관리할 수 있는 인터페이스를 제공할 수 있다.
미들웨어(143)는, 예를 들면, API(145) 또는 어플리케이션 프로그램(147)이 커널(141)과 통신하여 데이터를 주고받을 수 있도록 중개 역할을 수행할 수 있다. 또한, 미들웨어(143)는 어플리케이션 프로그램(147)으로부터 수신된 하나 이상의 작업 요청들을 우선 순위에 따라 처리할 수 있다. 예를 들면, 미들웨어(143)는 어플리케이션 프로그램(147) 중 적어도 하나에 전자 장치(101)의 시스템 리소스(예: 버스(110), 프로세서(120), 또는 메모리(130) 등)를 사용할 수 있는 우선 순위를 부여하고, 상기 하나 이상의 작업 요청들을 처리할 수 있다. API(145)는 어플리케이션(147)이 커널(141) 또는 미들웨어(143)에서 제공되는 기능을 제어하기 위한 인터페이스로, 예를 들면, 파일 제어, 창 제어, 영상 처리, 또는 문자 제어 등을 위한 적어도 하나의 인터페이스 또는 함수(예: 명령어)를 포함할 수 있다. 입출력 인터페이스(150)는, 예를 들면, 사용자 또는 다른 외부 기기로부터 입력된 명령 또는 데이터를 전자 장치(101)의 다른 구성요소(들)에 전달하거나, 또는 전자 장치(101)의 다른 구성요소(들)로부터 수신된 명령 또는 데이터를 사용자 또는 다른 외부 기기로 출력할 수 있다.
디스플레이(160)는, 예를 들면, 액정 디스플레이(LCD), 발광 다이오드(LED) 디스플레이, 유기 발광 다이오드(OLED) 디스플레이, 또는 마이크로 전자기계 시스템 (MEMS) 디스플레이, 또는 전자종이(electronic paper) 디스플레이를 포함할 수 있다. 디스플레이(160)는, 예를 들면, 사용자에게 각종 콘텐츠(예: 텍스트, 이미지, 비디오, 아이콘, 및/또는 심볼 등)을 표시할 수 있다. 디스플레이(160)는, 터치 스크린을 포함할 수 있으며, 예를 들면, 전자 펜 또는 사용자의 신체의 일부를 이용한 터치, 제스쳐, 근접, 또는 호버링 입력을 수신할 수 있다. 통신 인터페이스(170)는, 예를 들면, 전자 장치(101)와 외부 장치(예: 제 1 외부 전자 장치(102), 제 2 외부 전자 장치(104), 또는 서버(106)) 간의 통신을 설정할 수 있다. 예를 들면, 통신 인터페이스(170)는 무선 통신 또는 유선 통신을 통해서 네트워크(162)에 연결되어 외부 장치(예: 제 2 외부 전자 장치(104) 또는 서버(106))와 통신할 수 있다.
무선 통신은, 예를 들면, LTE, 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) 등 중 적어도 하나를 사용하는 셀룰러 통신을 포함할 수 있다. 한 실시예에 따르면, 무선 통신은, 예를 들면, WiFi(wireless fidelity), 블루투스, 블루투스 저전력(BLE), 지그비(Zigbee), NFC(near field communication), 자력 시큐어 트랜스미션(Magnetic Secure Transmission), 라디오 프리퀀시(RF), 또는 보디 에어리어 네트워크(BAN) 중 적어도 하나를 포함할 수 있다. 한실시예에 따르면, 무선 통신은 GNSS를 포함할 수 있다. GNSS는, 예를 들면, GPS(Global Positioning System), Glonass(Global Navigation Satellite System), Beidou Navigation Satellite System(이하 “Beidou”) 또는 Galileo, the European global satellite-based navigation system일 수 있다. 이하, 본 문서에서는, “GPS”는 “GNSS”와 상호 호환적으로 사용될 수 있다. 유선 통신은, 예를 들면, USB(universal serial bus), HDMI(high definition multimedia interface), RS-232(recommended standard232), 전력선 통신, 또는 POTS(plain old telephone service) 등 중 적어도 하나를 포함할 수 있다. 네트워크(162)는 텔레커뮤니케이션 네트워크, 예를 들면, 컴퓨터 네트워크(예: LAN 또는 WAN), 인터넷, 또는 텔레폰 네트워크 중 적어도 하나를 포함할 수 있다.
제 1 및 제 2 외부 전자 장치(102, 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 다양한 실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 다른 하나 또는 복수의 전자 장치(예: 전자 장치(102,104), 또는 서버(106)에서 실행될 수 있다. 한 실시예에 따르면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로 또는 요청에 의하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 그와 연관된 적어도 일부 기능을 다른 장치(예: 전자 장치(102, 104), 또는 서버(106))에게 요청할 수 있다. 다른 전자 장치(예: 전자 장치(102, 104), 또는 서버(106))는 요청된 기능 또는 추가 기능을 실행하고, 그 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 수신된 결과를 그대로 또는 추가적으로 처리하여 요청된 기능이나 서비스를 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다.
도 2는 다양한 실시예에 따른 전자 장치(201)의 블록도이다. 전자 장치(201)는, 예를 들면, 도 1에 도시된 전자 장치(101)의 전체 또는 일부를 포함할 수 있다. 전자 장치(201)는 하나 이상의 프로세서(예: AP)(210), 통신 모듈(220), (가입자 식별 모듈(224), 메모리(230), 센서 모듈(240), 입력 장치(250), 디스플레이(260), 인터페이스(270), 오디오 모듈(280), 카메라 모듈(291), 전력 관리 모듈(295), 배터리(296), 인디케이터(297), 및 모터(298) 를 포함할 수 있다. 프로세서(210)는, 예를 들면, 운영 체제 또는 응용 프로그램을 구동하여 프로세서(210)에 연결된 다수의 하드웨어 또는 소프트웨어 구성요소들을 제어할 수 있고, 각종 데이터 처리 및 연산을 수행할 수 있다. 프로세서(210)는, 예를 들면, SoC(system on chip) 로 구현될 수 있다. 한 실시예에 따르면, 프로세서(210)는 GPU(graphic processing unit) 및/또는 이미지 신호 프로세서를 더 포함할 수 있다. 프로세서(210)는 도 2에 도시된 구성요소들 중 적어도 일부(예: 셀룰러 모듈(221))를 포함할 수도 있다. 프로세서(210) 는 다른 구성요소들(예: 비휘발성 메모리) 중 적어도 하나로부터 수신된 명령 또는 데이터를 휘발성 메모리에 로드)하여 처리하고, 결과 데이터를 비휘발성 메모리에 저장할 수 있다.
통신 모듈(220)(예: 통신 인터페이스(170))와 동일 또는 유사한 구성을 가질 수 있다. 통신 모듈(220)은, 예를 들면, 셀룰러 모듈(221), WiFi 모듈(223), 블루투스 모듈(225), GNSS 모듈(227), NFC 모듈(228) 및 RF 모듈(229)를 포함할 수 있다. 셀룰러 모듈(221)은, 예를 들면, 통신망을 통해서 음성 통화, 영상 통화, 문자 서비스, 또는 인터넷 서비스 등을 제공할 수 있다. 한 실시예에 따르면, 셀룰러 모듈(221)은 가입자 식별 모듈(예: SIM 카드)(224)을 이용하여 통신 네트워크 내에서 전자 장치(201)의 구별 및 인증을 수행할 수 있다. 한 실시예에 따르면, 셀룰러 모듈(221)은 프로세서(210)가 제공할 수 있는 기능 중 적어도 일부 기능을 수행할 수 있다. 한 실시예에 따르면, 셀룰러 모듈(221)은 커뮤니케이션 프로세서(CP)를 포함할 수 있다. 어떤 실시예에 따르면, 셀룰러 모듈(221), WiFi 모듈(223), 블루투스 모듈(225), GNSS 모듈(227) 또는 NFC 모듈(228) 중 적어도 일부(예: 두 개 이상)는 하나의 integrated chip(IC) 또는 IC 패키지 내에 포함될 수 있다. RF 모듈(229)은, 예를 들면, 통신 신호(예: RF 신호)를 송수신할 수 있다. RF 모듈(229)은, 예를 들면, 트랜시버, PAM(power amp module), 주파수 필터, LNA(low noise amplifier), 또는 안테나 등을 포함할 수 있다. 다른 실시예에 따르면, 셀룰러 모듈(221), WiFi 모듈(223), 블루투스 모듈(225), GNSS 모듈(227) 또는 NFC 모듈(228) 중 적어도 하나는 별개의 RF 모듈을 통하여 RF 신호를 송수신할 수 있다. 가입자 식별 모듈(224)은, 예를 들면, 가입자 식별 모듈을 포함하는 카드 또는 임베디드 SIM을 포함할 수 있으며, 고유한 식별 정보(예: ICCID(integrated circuit card identifier)) 또는 가입자 정보(예: IMSI(international mobile subscriber identity))를 포함할 수 있다.
메모리(230)(예: 메모리(130))는, 예를 들면, 내장 메모리(232) 또는 외장 메모리(234)를 포함할 수 있다. 내장 메모리(232)는, 예를 들면, 휘발성 메모리(예: DRAM, SRAM, 또는 SDRAM 등), 비휘발성 메모리(예: OTPROM(one time programmable ROM), PROM, EPROM, EEPROM, mask ROM, flash ROM, 플래시 메모리, 하드 드라이브, 또는 솔리드 스테이트 드라이브 (SSD) 중 적어도 하나를 포함할 수 있다. 외장 메모리(234)는 플래시 드라이브(flash drive), 예를 들면, CF(compact flash), SD(secure digital), Micro-SD, Mini-SD, xD(extreme digital), MMC(multi-media card) 또는 메모리 스틱 등을 포함할 수 있다. 외장 메모리(234)는 다양한 인터페이스를 통하여 전자 장치(201)와 기능적으로 또는 물리적으로 연결될 수 있다.
센서 모듈(240)은, 예를 들면, 물리량을 계측하거나 전자 장치(201)의 작동 상태를 감지하여, 계측 또는 감지된 정보를 전기 신호로 변환할 수 있다. 센서 모듈(240)은, 예를 들면, 제스처 센서(240A), 자이로 센서(240B), 기압 센서(240C), 마그네틱 센서(240D), 가속도 센서(240E), 그립 센서(240F), 근접 센서(240G), 컬러(color) 센서(240H)(예: RGB(red, green, blue) 센서), 생체 센서(240I), 온/습도 센서(240J), 조도 센서(240K), 또는 UV(ultra violet) 센서(240M) 중의 적어도 하나를 포함할 수 있다. 추가적으로 또는 대체적으로, 센서 모듈(240)은, 예를 들면, 후각(e-nose) 센서, 일렉트로마이오그라피(EMG) 센서, 일렉트로엔씨팔로그램(EEG) 센서, 일렉트로카디오그램(ECG) 센서, IR(infrared) 센서, 홍채 센서 및/또는 지문 센서를 포함할 수 있다. 센서 모듈(240)은 그 안에 속한 적어도 하나 이상의 센서들을 제어하기 위한 제어 회로를 더 포함할 수 있다. 어떤 실시예에서는, 전자 장치(201)는 프로세서(210)의 일부로서 또는 별도로, 센서 모듈(240)을 제어하도록 구성된 프로세서를 더 포함하여, 프로세서(210)가 슬립(sleep) 상태에 있는 동안, 센서 모듈(240)을 제어할 수 있다.
입력 장치(250)는, 예를 들면, 터치 패널(252), (디지털) 펜 센서(254), 키(256), 또는 초음파 입력 장치(258)를 포함할 수 있다. 터치 패널(252)은, 예를 들면, 정전식, 감압식, 적외선 방식, 또는 초음파 방식 중 적어도 하나의 방식을 사용할 수 있다. 또한, 터치 패널(252)은 제어 회로를 더 포함할 수도 있다. 터치 패널(252)은 택타일 레이어(tactile layer)를 더 포함하여, 사용자에게 촉각 반응을 제공할 수 있다. (디지털) 펜 센서(254)는, 예를 들면, 터치 패널의 일부이거나, 별도의 인식용 쉬트를 포함할 수 있다. 키(256)는, 예를 들면, 물리적인 버튼, 광학식 키, 또는 키패드를 포함할 수 있다. 초음파 입력 장치(258)는 마이크(예: 마이크(288))를 통해, 입력 도구에서 발생된 초음파를 감지하여, 상기 감지된 초음파에 대응하는 데이터를 확인할 수 있다.
디스플레이(260)(예: 디스플레이(160))는 패널(262), 홀로그램 장치(264), 프로젝터(266), 및/또는 이들을 제어하기 위한 제어 회로를 포함할 수 있다. 패널(262)은, 예를 들면, 유연하게, 투명하게, 또는 착용할 수 있게 구현될 수 있다. 패널(262)은 터치 패널(252)과 하나 이상의 모듈로 구성될 수 있다. 한 실시예에 따르면, 패널(262)은 사용자의 터치에 대한 압력의 세기를 측정할 수 있는 압력 센서(또는 포스 센서)를 포함할 수 있다. 상기 압력 센서는 터치 패널(252)과 일체형으로 구현되거나, 또는 터치 패널(252)과는 별도의 하나 이상의 센서로 구현될 수 있다. 홀로그램 장치(264)는 빛의 간섭을 이용하여 입체 영상을 허공에 보여줄 수 있다. 프로젝터(266)는 스크린에 빛을 투사하여 영상을 표시할 수 있다. 스크린은, 예를 들면, 전자 장치(201)의 내부 또는 외부에 위치할 수 있다. 인터페이스(270)는, 예를 들면, HDMI(272), USB(274), 광 인터페이스(optical interface)(276), 또는 D-sub(D-subminiature)(278)를 포함할 수 있다. 인터페이스(270)는, 예를 들면, 도 1에 도시된 통신 인터페이스(170)에 포함될 수 있다. 추가적으로 또는 대체적으로, 인터페이스(270)는, 예를 들면, MHL(mobile high-definition link) 인터페이스, SD카드/MMC(multi-media card) 인터페이스, 또는 IrDA(infrared data association) 규격 인터페이스를 포함할 수 있다.
오디오 모듈(280)은, 예를 들면, 소리와 전기 신호를 쌍방향으로 변환시킬 수 있다. 오디오 모듈(280)의 적어도 일부 구성요소는, 예를 들면, 도 1 에 도시된 입출력 인터페이스(145)에 포함될 수 있다. 오디오 모듈(280)은, 예를 들면, 스피커(282), 리시버(284), 이어폰(286), 또는 마이크(288) 등을 통해 입력 또는 출력되는 소리 정보를 처리할 수 있다. 카메라 모듈(291)은, 예를 들면, 정지 영상 및 동영상을 촬영할 수 있는 장치로서, 한 실시예에 따르면, 하나 이상의 이미지 센서(예: 전면 센서 또는 후면 센서), 렌즈, 이미지 시그널 프로세서(ISP), 또는 플래시(예: LED 또는 xenon lamp 등)를 포함할 수 있다. 전력 관리 모듈(295)은, 예를 들면, 전자 장치(201)의 전력을 관리할 수 있다. 한 실시예에 따르면, 전력 관리 모듈(295)은 PMIC(power management integrated circuit), 충전 IC, 또는 배터리 또는 연료 게이지를 포함할 수 있다. PMIC는, 유선 및/또는 무선 충전 방식을 가질 수 있다. 무선 충전 방식은, 예를 들면, 자기공명 방식, 자기유도 방식 또는 전자기파 방식 등을 포함하며, 무선 충전을 위한 부가적인 회로, 예를 들면, 코일 루프, 공진 회로, 또는 정류기 등을 더 포함할 수 있다. 배터리 게이지는, 예를 들면, 배터리(296)의 잔량, 충전 중 전압, 전류, 또는 온도를 측정할 수 있다. 배터리(296)는, 예를 들면, 충전식 전지 및/또는 태양 전지를 포함할 수 있다.
인디케이터(297)는 전자 장치(201) 또는 그 일부(예: 프로세서(210))의 특정 상태, 예를 들면, 부팅 상태, 메시지 상태 또는 충전 상태 등을 표시할 수 있다. 모터(298)는 전기적 신호를 기계적 진동으로 변환할 수 있고, 진동, 또는 햅틱 효과 등을 발생시킬 수 있다. 전자 장치(201)는, 예를 들면, DMB(digital multimedia broadcasting), DVB(digital video broadcasting), 또는 미디어플로(mediaFloTM) 등의 규격에 따른 미디어 데이터를 처리할 수 있는 모바일 TV 지원 장치(예: GPU)를 포함할 수 있다. 본 문서에서 기술된 구성요소들 각각은 하나 또는 그 이상의 부품(component)으로 구성될 수 있으며, 해당 구성요소의 명칭은 전자 장치의 종류에 따라서 달라질 수 있다. 다양한 실시예에서, 전자 장치(예: 전자 장치(201))는 일부 구성요소가 생략되거나, 추가적인 구성요소를 더 포함하거나, 또는, 구성요소들 중 일부가 결합되어 하나의 개체로 구성되되, 결합 이전의 해당 구성요소들의 기능을 동일하게 수행할 수 있다.
도 3은 다양한 실시예에 따른 프로그램 모듈의 블록도이다. 한 실시예에 따르면, 프로그램 모듈(310)(예: 프로그램(140))은 전자 장치(예: 전자 장치(101))에 관련된 자원을 제어하는 운영 체제 및/또는 운영 체제 상에서 구동되는 다양한 어플리케이션(예: 어플리케이션 프로그램(147))을 포함할 수 있다. 운영 체제는, 예를 들면, AndroidTM, iOSTM, WindowsTM, SymbianTM, TizenTM, 또는 BadaTM를 포함할 수 있다. 도 3을 참조하면, 프로그램 모듈(310)은 커널(320)(예: 커널(141)), 미들웨어(330)(예: 미들웨어(143)), (API(360)(예: API(145)), 및/또는 어플리케이션(370)(예: 어플리케이션 프로그램(147))을 포함할 수 있다. 프로그램 모듈(310)의 적어도 일부는 전자 장치 상에 프리로드 되거나, 외부 전자 장치(예: 전자 장치(102, 104), 서버(106) 등)로부터 다운로드 가능하다.
커널(320)은, 예를 들면, 시스템 리소스 매니저(321) 및/또는 디바이스 드라이버(323)를 포함할 수 있다. 시스템 리소스 매니저(321)는 시스템 리소스의 제어, 할당, 또는 회수를 수행할 수 있다. 한 실시예에 따르면, 시스템 리소스 매니저(321)는 프로세스 관리부, 메모리 관리부, 또는 파일 시스템 관리부를 포함할 수 있다. 디바이스 드라이버(323)는, 예를 들면, 디스플레이 드라이버, 카메라 드라이버, 블루투스 드라이버, 공유 메모리 드라이버, USB 드라이버, 키패드 드라이버, WiFi 드라이버, 오디오 드라이버, 또는 IPC(inter-process communication) 드라이버를 포함할 수 있다. 미들웨어(330)는, 예를 들면, 어플리케이션(370)이 공통적으로 필요로 하는 기능을 제공하거나, 어플리케이션(370)이 전자 장치 내부의 제한된 시스템 자원을 사용할 수 있도록 API(360)를 통해 다양한 기능들을 어플리케이션(370)으로 제공할 수 있다. 한 실시예에 따르면, 미들웨어(330) 는 런타임 라이브러리(335), 어플리케이션 매니저(341), 윈도우 매니저(342), 멀티미디어 매니저(343), 리소스 매니저(344), 파워 매니저(345), 데이터베이스 매니저(346), 패키지 매니저(347), 커넥티비티 매니저(348), 노티피케이션 매니저(349), 로케이션 매니저(350), 그래픽 매니저(351), 또는 시큐리티 매니저(352) 중 적어도 하나를 포함할 수 있다.
런타임 라이브러리(335)는, 예를 들면, 어플리케이션(370)이 실행되는 동안에 프로그래밍 언어를 통해 새로운 기능을 추가하기 위해 컴파일러가 사용하는 라이브러리 모듈을 포함할 수 있다. 런타임 라이브러리(335)는 입출력 관리, 메모리 관리, 또는 산술 함수 처리를 수행할 수 있다. 어플리케이션 매니저(341)는, 예를 들면, 어플리케이션(370)의 생명 주기를 관리할 수 있다. 윈도우 매니저(342)는 화면에서 사용되는 GUI 자원을 관리할 수 있다. 멀티미디어 매니저(343)는 미디어 파일들의 재생에 필요한 포맷을 파악하고, 해당 포맷에 맞는 코덱을 이용하여 미디어 파일의 인코딩 또는 디코딩을 수행할 수 있다. 리소스 매니저(344)는 어플리케이션(370)의 소스 코드 또는 메모리의 공간을 관리할 수 있다. 파워 매니저(345)는, 예를 들면, 배터리의 용량 또는 전원을 관리하고, 전자 장치의 동작에 필요한 전력 정보를 제공할 수 있다. 한 실시예에 따르면, 파워 매니저(345)는 바이오스(BIOS: basic input/output system)와 연동할 수 있다. 데이터베이스 매니저(346)는, 예를 들면, 어플리케이션(370)에서 사용될 데이터베이스를 생성, 검색, 또는 변경할 수 있다. 패키지 매니저(347)는 패키지 파일의 형태로 배포되는 어플리케이션의 설치 또는 갱신을 관리할 수 있다.
커넥티비티 매니저(348)는, 예를 들면, 무선 연결을 관리할 수 있다. 노티피케이션 매니저(349)는, 예를 들면, 도착 메시지, 약속, 근접성 알림 등의 이벤트를 사용자에게 제공할 수 있다. 로케이션 매니저(350)는, 예를 들면, 전자 장치의 위치 정보를 관리할 수 있다. 그래픽 매니저(351)는, 예를 들면, 사용자에게 제공될 그래픽 효과 또는 이와 관련된 사용자 인터페이스를 관리할 수 있다. 보안 매니저(352)는, 예를 들면, 시스템 보안 또는 사용자 인증을 제공할 수 있다. 한 실시예에 따르면, 미들웨어(330)는 전자 장치의 음성 또는 영상 통화 기능을 관리하기 위한 통화(telephony) 매니저 또는 전술된 구성요소들의 기능들의 조합을 형성할 수 있는 하는 미들웨어 모듈을 포함할 수 있다. 한 실시예에 따르면, 미들웨어(330)는 운영 체제의 종류 별로 특화된 모듈을 제공할 수 있다. 미들웨어(330)는 동적으로 기존의 구성요소를 일부 삭제하거나 새로운 구성요소들을 추가할 수 있다. API(360)는, 예를 들면, API 프로그래밍 함수들의 집합으로, 운영 체제에 따라 다른 구성으로 제공될 수 있다. 예를 들면, 안드로이드 또는 iOS의 경우, 플랫폼 별로 하나의 API 셋을 제공할 수 있으며, 타이젠의 경우, 플랫폼 별로 두 개 이상의 API 셋을 제공할 수 있다.
어플리케이션(370)은, 예를 들면, 홈(371), 다이얼러(372), SMS/MMS(373), IM(instant message)(374), 브라우저(375), 카메라(376), 알람(377), 컨택트(378), 음성 다이얼(379), 이메일(380), 달력(381), 미디어 플레이어(382), 앨범(383), 와치(384), 헬스 케어(예: 운동량 또는 혈당 등을 측정), 또는 환경 정보(예: 기압, 습도, 또는 온도 정보) 제공 어플리케이션을 포함할 수 있다. 한 실시예에 따르면, 어플리케이션(370)은 전자 장치와 외부 전자 장치 사이의 정보 교환을 지원할 수 있는 정보 교환 어플리케이션을 포함할 수 있다. 정보 교환 어플리케이션은, 예를 들면, 외부 전자 장치에 특정 정보를 전달하기 위한 노티피케이션 릴레이 어플리케이션, 또는 외부 전자 장치를 관리하기 위한 장치 관리 어플리케이션을 포함할 수 있다. 예를 들면, 알림 전달 어플리케이션은 전자 장치의 다른 어플리케이션에서 발생된 알림 정보를 외부 전자 장치로 전달하거나, 또는 외부 전자 장치로부터 알림 정보를 수신하여 사용자에게 제공할 수 있다. 장치 관리 어플리케이션은, 예를 들면, 전자 장치와 통신하는 외부 전자 장치의 기능(예: 외부 전자 장치 자체(또는, 일부 구성 부품)의 턴-온/턴-오프 또는 디스플레이의 밝기(또는, 해상도) 조절), 또는 외부 전자 장치에서 동작하는 어플리케이션을 설치, 삭제, 또는 갱신할 수 있다. 한 실시예에 따르면, 어플리케이션(370)은 외부 전자 장치의 속성에 따라 지정된 어플리케이션(예: 모바일 의료 기기의 건강 관리 어플리케이션)을 포함할 수 있다. 한 실시예에 따르면, 어플리케이션(370)은 외부 전자 장치로부터 수신된 어플리케이션을 포함할 수 있다. 프로그램 모듈(310)의 적어도 일부는 소프트웨어, 펌웨어, 하드웨어(예: 프로세서(210)), 또는 이들 중 적어도 둘 이상의 조합으로 구현(예: 실행)될 수 있으며, 하나 이상의 기능을 수행하기 위한 모듈, 프로그램, 루틴, 명령어 세트 또는 프로세스를 포함할 수 있다.
본 문서에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구성된 유닛을 포함하며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로 등의 용어와 상호 호환적으로 사용될 수 있다. "모듈"은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는 최소 단위 또는 그 일부가 될 수 있다. "모듈"은 기계적으로 또는 전자적으로 구현될 수 있으며, 예를 들면, 어떤 동작들을 수행하는, 알려졌거나 앞으로 개발될, ASIC(application-specific integrated circuit) 칩, FPGAs(field-programmable gate arrays), 또는 프로그램 가능 논리 장치를 포함할 수 있다. 다양한 실시예에 따른 장치(예: 모듈들 또는 그 기능들) 또는 방법(예: 동작들)의 적어도 일부는 프로그램 모듈의 형태로 컴퓨터로 판독 가능한 저장 매체(예:메모리(130))에 저장된 명령어로 구현될 수 있다. 상기 명령어가 프로세서(예: 프로세서(120))에 의해 실행될 경우, 프로세서가 상기 명령어에 해당하는 기능을 수행할 수 있다. 컴퓨터로 판독 가능한 기록 매체는, 하드디스크, 플로피디스크, 마그네틱 매체(예: 자기테이프), 광기록 매체(예: CD-ROM, DVD, 자기-광 매체 (예: 플롭티컬 디스크), 내장 메모리 등을 포함할 수 있다. 명령어는 컴파일러에 의해 만들어지는 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 다양한 실시예에 따른 모듈 또는 프로그램 모듈은 전술한 구성요소들 중 적어도 하나 이상을 포함하거나, 일부가 생략되거나, 또는 다른 구성요소를 더 포함할 수 있다. 다양한 실시예에 따른, 모듈, 프로그램 모듈 또는 다른 구성요소에 의해 수행되는 동작들은 순차적, 병렬적, 반복적 또는 휴리스틱하게 실행되거나, 적어도 일부 동작이 다른 순서로 실행되거나, 생략되거나, 또는 다른 동작이 추가될 수 있다.
본 발명의 다양한 실시예에 있어서, 저널링 파일 시스템은 주 파일 시스템에 변경 사항을 반영하기 이전에 메모리 안에 변경 사항을 로깅하여 변경사항을 추적하기 위한 파일 시스템을 의미하며, 저널 데이터는 파일 데이터의 변경에 관련된 데이터를 포함할 수 있다.
본 발명의 다양한 실시예에 있어서, 파일 데이터는 메타 데이터 및 데이터 블록을 포함할 수 있다. 데이터 블록은 해당 파일 데이터가 포함하는 실제 데이터로 구성되며, 메타 데이터는 데이터 블록에 관련된 정보를 포함할 수 있다. 다양한 실시예에 따르면, 전자 장치는 메타 데이터의 변경 사항 및/또는 데이터 블록의 변경 사항을 저널 데이터로 생성할 수 있다.
도 4는 본 발명이 다양한 실시예에 따른 전자 장치의 블록도이다.
도시된 바와 같이, 전자 장치(400)는 프로세서(410), 제1메모리(420) 및 제2메모리(430)를 포함할 수 있으며, 도시된 구성 중 적어도 일부가 생략 또는 치환 되더라도 본 발명의 다양한 실시예들을 구현하는 데에는 지장이 없을 것이다. 전자 장치(400)는 도시된 구성 이외에도 도 1의 전자 장치(101) 및/또는 도 2의 전자 장치(200)의 구성 중 적어도 일부를 포함할 수 있다.
프로세서(410)는 전자 장치(400)의 각 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 수행할 수 있는 구성으로써, 제1메모리(420) 및 제2메모리(430)를 포함하는 전자 장치(400)의 다양한 구성들과 전기적으로 연결될 수 있다. 프로세서(410)는 도 1의 프로세서(120) 및/또는 도 2의 어플리케이션 프로세서(210)의 구성 중 적어도 일부를 포함하거나, 수행할 수 있는 기능 중 적어도 일부를 수행 할 수 있다. 프로세서(410)의 동작들은 제1메모리(420) 또는 제2메모리(430)에 저장된 인스트럭션(instruction)들을 로딩(loading)함으로써 수행될 수 있다.
본 명세서에서는 다양한 실시예에 따라 파일 데이터의 저널링을 수행하는 프로세서(410)의 기능에 대해 상세히 설명하기로 하며, 그 외 프로세서(410)가 수행 가능한 공지의 기술에 대해서는 그 설명을 생략하기로 한다. 프로세서(410)의 저널링 관련 동작들은 프로그램 모듈에 포함된 파일 시스템 관리자 내의 저널링 모듈에 의해 수행될 수 있다.
제1메모리(420)는 비휘발성 메모리(non-volatile memory)로써, 대용량의 스토리지(storage) 장치일 수 있다. 예를 들어, 제1메모리(420)는 OTPROM(one time programmable ROM), PROM, EPROM, EEPROM, mask ROM, flash ROM, 플래시 메모리, 하드 드라이브, 또는 솔리드 스테이트 드라이브 (SSD) 중 적어도 하나를 포함할 수 있다. 제1메모리(420)는 다양한 파일 데이터들을 저장할 수 있으며, 프로세서(410)의 동작에 따라 저장된 파일 데이터들은 업데이트 될 수 있다.
제2메모리(430)는 제1메모리(420)와 다른 속성을 갖는 메모리일 수 있다. 다양한 실시예에 따르면, 제2메모리(430)의 적어도 일부 영역은 주 메모리(main memory)로 할당되어, 프로세서(410)는 제1메모리(420)의 파일 데이터를 제2메모리(430)에 로딩 또는 저장하여 파일 데이터에 대한 연산을 처리할 수 있다. 다양한 실시예에 따르면, 제 2메모리(430)의 적어도 일부 영역은 저장 장치(storage device)로 할당되어, 프로세서(410)는 제1메모리(420)의 파일 데이터에 대응되는 파일 저널 데이터를 제2메모리(430)에 저장할 수 있다.일반적으로 주 메모리에 사용되는 메모리의 종류는 DRAM(dynamic random access memory), SRAM(static RAM), 또는 SDRAM(synchronous dynamic RAM) 등 휘발성 메모리리로써 전자 장치에 공급되는 전원이 차단되면 기록된 데이터가 삭제되나, 본 발명의 다양한 실시예에 따르면, 주 메모리인 제2메모리(430)는 전자 장치(400)에 갑작스런 파워 오프가 발생하더라도 적어도 일시적으로 데이터를 보존할 수 있다. 예를 들어, 제2메모리(430)는, 배터리 일체형 전자 장치의 일부 영역으로 전원이 계속해서 공급되거나, 제2메모리(430)에 별도의 보조 배터리가 마련되어 전자 장치(400)의 파워 오프 시에도 보조 배터리로부터 제2메모리(430)에 전원이 공급되거나, 적어도 일시적으로 데이터를 보존할 수 있는 특성을 가진 RAM이거나, 비휘발성 메모리인 NVRAM(non-volatile RAM) 등이 사용될 수 있다.
다양한 실시예에 따르면, 제2메모리(430)의 일부 영역은 저널링에 사용되는 지정된 영역일 수 있다. 지정된 영역은 제2메모리(430)의 물리적 또는 가상의 어드레스로 지정될 수 있다. 일 실시예에 따르면, 제2메모리(430)는 복수의 메모리를 포함할 수 있으며, 복수의 메모리는 동일한 종류이거나, 다른 종류일 수도 있다.
다양한 실시예에 따르면, 전자 장치(400)는 제1메모리(420)에 저장된 파일 데이터에 대한 저널링 기능을 수행할 수 있다. 프로세서(410)는 제1메모리(420)에 저장된 파일 데이터 중 적어도 일부의 파일 데이터에 대한 변경과 관련된 저널 데이터를 생성하여 제2메모리(430)에 저장하고, 지정된 조건이 만족되는 경우, 제1메모리(420)에 저장된 적어도 일부 파일 데이터를 업데이트하도록 설정될 수 있다. 여기서, 지정된 조건은 갑작스럽게 전자 장치(400)의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash)가 발생하는 경우를 예로 들 수 있다.
저널링 파일 시스템은 주 파일 시스템에 변경 사항을 반영하기 이전에 메모리 안에 변경 사항을 로깅하여 변경사항을 추적하기 위한 파일 시스템이다. 저널링 파일 시스템은 파워 오프 또는 시스템 오류 등이 발생하면 저널 데이터를 이용해 파일 시스템을 더 빠르게 온라인 상태로 전환할 수 있고, 파일 데이터의 손상 가능성을 줄일 수 있다.
다양한 실시예에 따르면, 전자 장치(400)는 파일 데이터에 포함된 메타 데이터만을 저널링 하거나, 메타 데이터 및 데이터 블록을 포함하는 전체 파일 데이터에 대해 저널링을 수행할 수 있다. 파일 시스템의 메타 데이터에 대해서만 저널링을 수행하는 일반 저널링 모드에서는 일반 데이터 영역인 데이터 블록에 대한 무결성은 보장하지 않으나, 파일 시스템의 메타 데이터 간 불일치를 방지하여 메타 데이터의 무결성은 보장할 수 있다. 전체 파일 데이터에 대한 저널링을 수행하는 데이터 저널링 모드는 전체 데이터에 대한 무결성을 보장할 수 있으나, 제2메모리(430)의 저널링 영역의 크기가 한정될 수 밖에 없어 문제가 된다. 이에, 본 발명의 다양한 실시예들은 지정된 속성에 해당하는 파일 데이터에 대해서는 전체 파일 데이터에 대한 저널링을 수행하고, 나머지 파일 데이터에 대해서는 메타 데이터의 변경 사항에 대해서만 저널 데이터를 생성할 수 있다.
프로세서(410)가 저널 데이터를 제2메모리(430)에 저장하는 동작은 커밋(commit) 동작일 수 있다. 커밋 동작은 저널링의 대상이 되는 파일 데이터들을 트랜잭션(transaction) 단위로 제2메모리(430)의 저널링 영역에 기록하는 동작일 수 있다.
프로세서(410)는 커밋이 완료된 저널링 영역에 기록된 트랜잭션 단위의 저널 데이터들을 제1메모리(420)의 주 파일 시스템 영역에 기록하는 체크 포인트(check point) 동작을 수행할 수 있다. 체크 포인트에 따라 제2메모리(430)의 저널링 영역에 기록된 저널링 관련 로그들은 삭제 가능한 상태로 변경될 수 있다. 일반적으로, 체크 포인트는 저널링 공간 또는 주 메모리 전체의 가용 공간이 부족하거나 파일 데이터들이 주 메모리 상에서 수정된 후 일정시간(예를 들어, dirty expiration time, 일부 운영체제 상에서는 2초로 설정될 수 있음)이 경과되면 진행될 수 있다. 체크 포인트는 제1메모리(420)로의 I/O를 발생 시키며, 빈번한 체크 포인트로 인해 과도하게 발생하는 제1메모리(420)의 I/O는 제1메모리(420)의 성능 및 수명을 저하시킬 수 있다. 이에 따라, 다양한 실시예에 따른 전자 장치(400)는 체크 포인트의 시점을 최대한 지연 시켜 제1메모리(420)에 발생하는 I/O를 최소화 할 수 있다.
다양한 실시예에 따르면, 프로세서(410)는 파일 데이터(또는 저널 데이터)가 지정된 속성에 속하면 해당 파일 데이터를 데이터 저널링 모드로 저널링 할 수 있다. 즉, 지정된 속성에 속한 파일 데이터의 메타 데이터 및 데이터 블록의 적어도 일부에 대한변경과 관련된 저널 데이터를 제2메모리(420)에 저장하도록 설정될 수 있다. 여기서, 지정된 속성은 파일 데이터(또는 저널 데이터)가 파일 갱신 및 동기화 후 파일 삭제 동작이 수행되는 경우, 파일 데이터(또는 저널 데이터)의 동일 영역에 대한 데이터가 복수회에 걸쳐 반복적으로 동기화를 수행하는 경우 경우를 예로 들 수 있다. 일 실시예에 따르면, 프로세서(410)는 파일 크기(file size)가 특정 임계값보다 작은 파일에 대해 데이터 저널링 모드로 저널링을 수행할 수 있다. 일 실시예에 따르면, 프로세서(410)는 상기와 같이 지정된 속성에 속한 파일 데이터 중 파일 크기(file size)가 특정 임계값보다 작은 파일에 대해 데이터 저널링 모드로 저널링을 수행할 수 있다. 상기 동작에 대해서는 도 8 및 도 9를 통해 보다 상세히 설명하기로 한다.
다양한 실시예에 따르면, 프로세서(410)는 파일 데이터가 지정된 속성에 속하지 않는 경우, 일반 저널링 모드로 저널링을 수행할 수 있다. 즉, 프로세서(410)는 해당 파일 데이터의 메타 데이터의 적어도 일부에 대한 변경과 관련된 저널 데이터를 제2메모리에 저장하도록 설정될 수 있다.
다양한 실시예에 따르면, 프로세서(410)는 제2메모리(430)의 가용 용량에 따라 저널 데이터에 대한 체크 포인트를 수행할 수 있다. 프로세서(410)는 가용 용량이 제1한계값 이내인 경우 포 그라운드 체크포인트(foreground checkpoint)를 수행하고, 제2한계값 이내인 경우 백 그라운드 체크포인트(background checkpoint)를 수행할 수 있다. 제2메모리(430)의 가용 용량에 따른 체크포인트의 수행에 대해서는 도 10을 통해 보다 상세히 후술하기로 한다.
도 5는 본 발명의 다양한 실시예 중 일 실시예에 따른 프로그램 모듈을 도시하고 있다.
도 5에서는 하드웨어 평면에서 주 파일 데이터를 저장하는 제1메모리와 저널 데이터를 저장하는 제2메모리가 하나의 스토리지 장치(520) 상에 구현된 것을 도시하고 있다.
도시된 바와 같이, 프로그램 모듈(510)은 사용자 스페이스(user space) 및 커널 스페이스(kernel space)로 분리될 수 있으며, 사용자 스페이스는 어플리케이션(512)을 포함하고, 커널 스페이스는 운영체제(514)(operating system), 파일 관리 모듈(516)(file management module) 및 드라이버(518)(driver)를 포함할 수 있다.
다양한 실시예에 따르면, 프로그램 모듈(510) 상에 저널링 모듈(517)을 포함하는 파일 관리 모듈(516)이 동작되고, 스토리지의 on-disk 파일 시스템(522) 상에 파일 시스템 데이터 및 저널 데이터가 저장될 수 있다. 프로그램 모듈(510)은 주 메모리(시스템 메모리) 상에 구현되며, 파일 데이터 및 저널 데이터를 캐싱 또는 버퍼링 할 수 있다.
어플리케이션(512)은 전자 장치 상에서 동작하는 복수의 어플리케이션(512)들을 포함할 수 있다. 어플리케이션(512)은 운영체제(514)를 통해 스토리지 장치(520)에 파일을 읽고 쓸 수 있다. 어플리케이션(512)의 예는 다양하나, 데이터베이스 관리 프로그램을 예로 들면, db파일, db 백업 파일 등을 생성하고 관리할 수 있다.
운영체제(514)는 파일 시스템과 관련된 시스템 호출(system call)을 처리하는 핵심 소프트웨어 계층이다. 운영체제(514)는 서로 다른 파일 시스템들의 사이에서 범용 인터페이스(general-purpose interface)를 제공할 수 있다.
파일 관리 모듈(516)은 파일 시스템을 관리하는 동작을 수행할 수 있다. 파일 관리 모듈(516)은 운영체제(514)에 연결되어 있으며, 운영체제(514)가 보낸 파일에 대한 write, fsync, unlink 등의 연산 명령어(operation instruction)을 처리할 수 있다. 파일 관리 모듈(516)은 저널링 모듈(517)을 포함하며, 저널링 모듈(517)은 트랜잭션 단위로 저널 데이터를 관리(생성 및 커밋)하고, 트랜잭션들의 체크포인트 시점을 조절할 수 있다.
드라이버(518)는 스토리지 장치(520)에 연결된 블록 장치 디바이스 드라이버를 포함할 수 있다. 드라이버(518)는 파일 시스템과 저널링 모듈(517)에 연결되어, 파일 입출력에 대응하는 데이터 입출력을 수행할 수 있다. 드라이버(518)는 스토리지 장치(520)의 일부 영역을 블록 장치로 가상화 해주는 블록 계층을 포함할 수 있다.
도 5의 구조에서, 저널링 모듈(517)은 스토리지 장치(520)의 저널링 영역에 저널 데이터를 저장할 수 있다. 파일 시스템의 연산이 수행될 때마다, 해당 파일 의 메타 데이터 및/또는 데이터 블록에 기록되며, 저널링 모듈(517)은 각 연산으로 인해 파일이 변경되면 이와 관련된 저널 데이터를 생성(및/또는 커밋)하여 스토리지 장치(520)에 저장할 수 있다.
이와 같이, 연산 수행에 따라 생성되는 저널 데이터들은 커밋 동작을 통해 스토리지 장치(520)에 일차적인 I/O를 유발하고, 체크포인트 시 주 파일 시스템에도 이차적인 I/O를 유발할 수 있다. 스토리지 장치(520)에 대한 과다한 I/O의 발생은 스토리지의 성능 및 수명을 저하시킬 수 있다.
도 6은 본 발명의 다양한 실시예 중 일 실시예에 따른 프로그램 모듈을 도시하고 있다.
본 실시예는 도 5의 실시예와 비교하여, 하드웨어 적으로 서로 다른 속성의 제1메모리(620) 및 제2메모리(630)를 포함하고, 주 파일 시스템(622)은 제1메모리(620)에 저장되며, 저널 데이터는 제2메모리(630)의 저널링 영역(632) 에 저장될 수 있다. 다양한 실시예에 따르면, 프로그램 모듈(610)의 파일 관리 모듈(616)에는 파일 데이터가 저장(또는 캐싱)되며, 파일 관리 모듈(616) 내의 저널링 모듈(617)에는 저널 데이터가 저장(또는 버퍼링)될 수 있다. 저널링 모듈(617)에 버퍼링 된 저널 데이터는 커밋 동작에 의해 제2메모리(630) 상에 저장되고, 이후 체크 포인트 동작이 발생하면 저널 데이터에 대응되는 파일 관리 모듈(616)에 캐싱 된 파일 데이터가 제1메모리(620)의 주 파일 시스템(622)에 저장될 수 있다.
어플리케이션(612)은 파일 시스템 상의 복수의 파일 중 지정된 속성에 해당하는 파일을 선택하여 데이터 저널링 모드로 설정할 수 있다. 여기서, 데이터 저널링 모드는 파일시스템의 메타 데이터 및 데이터 블록을 포함하는 파일 데이터 전체의 저널링을 수행하는 모드이다.
일 실시예에 따르면, 어플리케이션(612)은 파일 갱신 및 동기화 후 파일 삭제 동작을 수행하는 파일 또는 저널 데이터의 동일 영역에 대한 데이터가 복수회에 걸쳐 반복적으로 동기화를 수행하는 파일 또는 파일 크기(file size)가 특정 임계 값보다 작은 파일을 데이터 저널링 모드로, 예를 들어, ioctl 방식으로 설정할 수 있다.
일 실시예에 따르면, 어플리케이션(612)은 특정 디렉토리(directory) 또는 특정 파일 이름 또는 특정 확장자를 가진 파일을 데이터 저널링 모드로 설정할 수 있다. 파일 관리 모듈(616)은 어플리케이션(612)의 설정에 따라 파일 단위로 적합한 저널링 모드를 적용할 수 있다.
파일 갱신 및 동기화 후 파일 삭제 동작을 수행하는 파일은 데이터베이스 관리 프로그램 등에서 파일의 무결성 보장을 위해 사용되는 DB 등의 파일 백업 데이터로써, 예를 들어, 데이터베이스 관리 프로그램(예를 들어, SQLite)의 delete 모드 및 truncate 모드 DB 롤백 저널 파일, Android AtomicFile 클래스의 .bak 확장자의 백업 파일을 예로 들 수 있다. 또한, 동일 영역에 대한 데이터가 복수회에 걸쳐 반복적으로 동기화 되도록 설정된 데이터는 데이터베이스 관리 프로그램의 persist 모드 DB 롤백 저널 파일, WAL(write-ahead logging) 모드 DB 저널 파일, DB 파일, Android AtomicFile 클래스의 AtomicFile 파일을 예로 들 수 있다.
어플리케이션(612)은 상기와 같이 지정된 속성에 해당하지 않는 파일에대해서는 메타 데이터에 대해서만 저널링을 수행하는 일반 저널링 모드로 저널링 동작을 수행할 수 있다. 일 실시예에 따르면, 어플리케이션(612)은 파일의 확장자 등 파일의 속성을 참고 하여, 데이터 저널링 모드로 저널링을 수행할 파일을 분류할 수 있다.
운영체제(614)는 파일 시스템과 관련된 시스템 호출(system call)을 처리하는 핵심 소프트웨어 계층으로 운영체제(614)의 동작은 도 5의 운영체제(514)의 실시예와 동일할 수 있다.
제1블록장치(618)는 제1메모리(620)에 연결된 디바이스 드라이버로써, 파일 시스템에 연결되어 파일 입출력에 대응하는 데이터 입출력을 수행할 수 있다. 일 실시예에 따르면, 제1블록장치(618)는 제1메모리(620)의 일부 영역을 가상화 하여 생성될 수 있다.
제2블록장치(619)는 제2메모리(630)에 연결된 디바이스 드라이버이며, 일 실시예에 따르면, 제2블록장치(619)는 제2메모리(630)의 일부 영역을 가상화 하여 생성될 수 있다.
파일 관리 모듈(616)은 저널링 모듈(617)을 포함하며, 저널링 모듈(617)에서 생성(또는 캐싱) 된 저널 데이터는 제2블록장치(619)를 통해 제2메모리(630)의 저널링 영역(632)에 저장(또는 커밋)될 수 있다. 또한, 주 파일 시스템의 파일 데이터들은 제1블록장치(618)를 통해 제1메모리(620) 상의 주 파일 시스템 영역(622)에 저장(또는 체크포인트) 될 수 있다. 일 실시예에 따르면, 저널링 모듈(617)은 제2블록장치(619)의 가용량에 근거하여 커밋 된 트랜잭션들의 체크포인트 시점을 조절할 수 있다.
프로세서는 제2메모리(630)에 저장된 저널 데이터를 파일 관리 모듈(616)에 의해 액세스 가능하도록 설정될 수 있다.
다양한 실시예에 따르면, 제2메모리(630)는 주 메모리의 기능을 수행하나, 종래의 전자 장치와 달리 전자 장치에 갑작스런 파워 오프가 발생하더라도 적어도 일정 시간 동안은 데이터를 그대로 보존할 수 있다. 예를 들어, 제2메모리(630)는, 배터리 일체형 전자 장치의 일부 영역으로 전원이 계속해서 공급되거나, 제2메모리(630)에 별도의 보조 배터리가 마련되어 전자 장치의 파워 오프 시에도 보조 배터리로부터 제2메모리(630)에 전원이 공급되거나, 적어도 일시적으로 데이터를 보존할 수 있는 특성을 가진 RAM이거나, 비휘발성 메모리인 NVRAM(non-volatile RAM)이 사용될 수 있다.
도 7은 다양한 실시예에 따른 제1메모리 및 제2메모리에 저장되는 데이터를 도시한 것이다.
다양한 실시예에 따르면, 제1메모리(710)는 비휘발성 메모리(non-volatile memory)로써, 대용량의 스토리지(storage) 장치일 수 있다. 또한, 제2메모리(720)는 주 메모리가 저장되는 메모리로써 제1메모리(710)와 다른 속성을 갖는 메모리 일 수 있다.
제1메모리(710)에는 파일 데이터가 저장될 수 있다. 프로세서는 제2메모리(720)에 제1메모리(710)에 저장된 파일 데이터의 변경과 관련된 저널 데이터를 저장(또는 커밋)할 수 있다. 도시된 바와 같이, 제2메모리(720)는 메타 데이터와 데이터 블록 중 적어도 일부(DB/AtomicFile과 연관된 데이터)를 저장하며, 지정된 인터럽트(예를 들어, sudden power off)가 발생하면 제2메모리(720)에 저장된 저널 데이터에 기초하여 제1메모리(710)의 파일 데이터를 업데이트(또는 recovery)할 수 있다.
일 실시예에 따르면, 제2메모리(720)는 저널링을 위한 제1영역 및 제1영역과 물리적 또는 논리적으로 분리된 제2영역을 포함하며, 프로세서는 저널 데이터의 생성 시 제1영역에 저널 데이터의 적어도 일부를 버퍼링 하고, 소정의 트랜잭션 단위로 제1영역에 버퍼링 된 적어도 하나의 저널 데이터를 제2영역에 저널링 할 수 있다. 이 경우, 제1메모리(710)의 파일 데이터를 업데이트 할 시, 프로세서는 제1영역에 버퍼링 된 저널 데이터 또는 제2영역에 저널링 된 저널 데이터에 적어도 기반하여 제1메모리(710)에 저장된 파일 데이터를 업데이트 할 수 있다.
일 실시예에 따르면, 제2메모리(720)는 복수의 랜덤 액세스 메모리를 포함하며, 복수의 랜덤 액세스 메모리 중 적어도 일부는 상기 제1영역에 대응되고, 다른 적어도 일부는 상기 제2영역에 대응될 수 있다.
도 8a 및 8b는 본 발명의 다양한 실시예 중 일부 실시예에 따른 체크포인트 동작을 도시한 것이다. 도 8a 및 8b는 파일 데이터에 대한 write 및 fsync 연산(operation)이 수행된 후 unlink 연산이 수행된 경우의 커밋 및 체크포인트 동작을 예시하며, 도 8a 및 8b는 각각 다른 실시예를 구성한다.
도 8a는 스토리지 장치인 제1메모리(810) 내에 저널링 영역을 마련한 실시예에 대해 도시하고 있다.
어플리케이션에서 파일의 I/O가 발생하고, 운영체제의 동작에 따라 파일의 write 및 fsync 연산이 차례대로 수행되는 경우, 메타 데이터에 write 연산에 대한 기록이 추가될 수 있다. 프로세서는 제1메모리(810)의 저널링 영역에 write 연산과 관련된 저널 데이터를 커밋 하고, 주 파일 시스템 영역에 write 연산에 관련된 데이터를 기록(또는 캐싱)할 수 있다.
이 후, 해당 파일에 대한 unlink 연산이 수행되면, 저널링 영역에 unlink 연산과 관련된 저널 데이터를 커밋 하고, 주 파일 시스템 영역에서 데이터 삭제 처리 동작(또는 discard)을 수행할 수 있다.
본 실시예에 따르면, write 및 fsync 연산 및 unlink 연산에 대한 기록이 저널 데이터 상에 기록되면서 제1메모리(810)에 대한 I/O가 발생하고, 이 후 체크포인트 동작에 의한 추가적인 I/O가 발생할 수 있다.
도 8b는 제2메모리(840) 상에 저널링 영역을 마련한 실시예에 대해 도시하고 있다. 도시된 바와 같이, 본 실시예에서는 write 및 fsync 연산에 대한 제1트랜잭션 및 unlink 연산에 대한 제2트랜잭션의 체크 포인트가 병합되어 처리될 수 있다.
파일 데이터에 대한 write 및 fsync 연산이 수행되면, 제2메모리(840)의 저널링 영역에는 해당 연산과 관련된 저널 데이터(MW -metadata write, 852)가 추가될 수 있다. 예를 들어, 이 때 저널 데이터는 write 연산에 관련된 메타 데이터 일 수 있다. 이 후, 파일 데이터에 대한 unlink 연산이 수행되면, 저널링 영역에 unlink 연산과 관련된 저널 데이터(MU- metadata update, 854))를 커밋 할 수 있다. 예를 들어, 이 때 저널 데이터는 unlink 연산에 관련된 메타 데이터(metadatunlink, 이하 MU)일 수 있다.
일 실시예에 따르면, 프로세서는 체크 포인트의 시점을 지연하여, write 및 fsync 연산에 대한 제1트랜잭션에 대해서는 체크 포인트 하지 않고, unlink 연산에 대한 제2트랜잭션이 커밋 된 이후 시점에 체크 포인트를 수행(예:트리거(trigger)) 할 수 있다.
이에 따르면, write 및 fsync 연산에 대한 기록은 제2메모리(840) 상에만 기록되며, 제1메모리(830)에는 기록되지 않을 수 있다. 제1메모리(830)의 주 파일 시스템 영역에는 파일이 삭제된 최종 버전의 메타 데이터만이 저장될 수 있다. 즉, 제1메모리(830)에 체크 포인트 되는 저널 데이터의 메타 데이터에는 unlink 연산에 대한 기록(MU, 832)만이 저장될 수 있다. 이로 인해, 도 8a와 비교할 때, 제1메모리(830)에 대한 I/O는 제2트랜잭션의 체크 포인트에 대해서만 발생하므로, 제1메모리(830)에 대한 I/O를 감소 시킬 수 있다.
일 실시예에 따르면, 전자 장치는 데이터베이스 관리 프로그램 등에서 파일의 무결성 보장을 위해 사용되는 DB 등의 파일 백업 데이터들에 대해 도 8b의 실시예에 따라 저널링을 수행할 수 있다. 전자 장치는 상기 파일에 대해 파일 갱신 및 동기화 후 연이어 파일 삭제 동작을 수행하며, 상기 파일은 예를 들어 데이터베이스 관리 프로그램(예를 들어, SQLite)의 delete 모드 및 truncate 모드 DB 롤백 저널 파일, Android AtomicFile 클래스의 .bak 확장자의 백업 파일을 예로 들 수 있다.
체크 포인트가 완료 되면, 저널링 영역의 링 버퍼의 포인터 갱신을 통해, 커밋이 완료된 순서대로 트랜잭션들을 삭제할 수 있다. 이 때, 먼저 커밋이 완료된 트랜잭션에 속해 있는 버퍼들이 kworker 커널 스레드에 의해 처리되지 못한 부분들만 강제로 I/O 처리를 해주고, 그 후 저널링 영역의 해당 트랜잭션을 삭제할 수 있다.
도 9a 및 9b는 본 발명의 다양한 실시예 중 일부 실시예에 따른 체크포인트 동작을 도시한 것이다.
도 9a 및 9b는 파일의 동일한 영역에 대해 write 및 fsync 연산(operation)이 수행된 후 unlink 연산이 반복적으로 수행되는 경우의 커밋 및 체크포인트 동작을 예시하며. 도 9a 및 9b는 다른 실시예를 구성한다.
도 9a는 스토리지 장치인 제1메모리(910) 내에 저널링 영역을 마련한 실시예에 대해 도시하고 있다.
도시된 바와 같이, 특정 파일은 동일 영역에 대해 write 및 fsync 연산을 반복적(N회)으로 수행할 수 있다. 이 경우, 메타 데이터는 각각의 write 및 fsync 연산에 대한 기록이 추가될 수 있으며, 각 연산의 수행에 따라 N개의 트랜잭션이 커밋 될 수 있다. 이와 적어도 일부 동시에, 제1메모리(910)의 주 파일 시스템 영역에도 상기 연산에 관련된 일반 데이터가 반복적으로 기록될 수 있다.
도 9b는 제2메모리 상에 저널링 영역을 마련한 실시예에 대해 도시하고 있다. 도시된 바와 같이, 본 실시예에서는 반복되는 write 및 fsync 연산에 대한 복수의 트랜잭션들의 체크 포인트가 병합되어 처리될 수 있다.
파일에 대한 첫번째 write 및 fsync 연산이 수행되면, 제2메모리(950)의 저널링 영역에는 해당 연산과 관련된 저널 데이터(MW)가 추가될 수 있다. 이 후, 파일의 동일한 영역에 대한 두번째 write 및 fsync 연산이 수행되면 해당 연산과 관련된 저널 데이터(MW)가 다시 추가될 수 있다. 즉, 제2트랜잭션(954)은 제1트랜잭션(952)의 메타 데이터에서 두번째 write 및 fsync 연산으로 인한 데이터가 추가될 수 있다.
일 실시예에 따르면, 프로세서는 체크 포인트의 시점을 지연하는 방식으로 복수의 트랜잭션의 체크포인트를 병합할 수 있다.예를 들어 반복적으로 수행되는 write 및 fsync 연산에 대한 각각의 트랜잭션들을 체크포인트 하지 않고, 제2메모리(950)의 저널링 영역의 공간 부족에 의해 체크 포인트가 트리거 될 때, 최종 버전의 트랜잭션(932)만이 제1메모리(930)에 기록될 수 있다.
이에 따르면, 최종 버전의 트랜잭션(932) 전의 write 및 fsync 연산에 대한 기록은 제2메모리(950) 상에만 기록되며, 제1메모리(930)에는 기록되지 않을 수 있다. 이로 인해, 도 9a와 비교할 때, 제1메모리(930)에 대한 I/O는 마지막 트랜잭션의 체크 포인트에 대해서만 발생하므로, 제1메모리(930)에 대한 I/O를 감소 시킬 수 있다.
일 실시예에 따르면, 전자 장치는 파일의 동일 영역에 대한 데이터를 빈번히 갱신하며 연이어 동기화를 반복 수행하는 파일들에 대해 도 9b의 실시예에 따라 저널링을 수행할 수 있다. 상기 파일들은 예를 들어, 데이터베이스 관리 프로그램의 persist 모드 DB 롤백 저널 파일, WAL(write-ahead logging) 모드 DB 저널 파일, DB 파일, Android AtomicFile 클래스의 AtomicFile 파일을 예로 들 수 있다.
도 10은 본 발명의 다양한 실시예에 따른 체크 포인트 시점을 도시한 것이다.
도 10은 제2메모리의 저널링 영역의 가용 용량을 도시한 것이며, 좌측에서 우측으로 갈수록 제2메모리에 저장된 데이터가 증가, 즉 가용 용량이 감소한 상태를 도시하고 있다.
기존의 런타임 체크포인트 방식은 메모리 부족 상황 또는 특정 주기가 되었을 경우, 제1메모리(또는 스토리지 장치)의 저널링 영역에 커밋 완료된 데이터들을 kworker 커널 스레드를 통해 개별적 및/또는 산발적으로 체크 포인트를 수행 하였다. 이로 인해, 메모리의 저널링 영역의 공간에 여유가 있더라도 체크 포인트에 의한 I/O가 상황에 따라 강제될 수 밖에 없었다.
본 발명의 다양한 실시예에 따른 전자 장치는 제2메모리의 가용 용량에 따라 포 그라운드 체크 포인트 및 백 그라운드 체크 포인트를 수행할 수 있다.
다양한 실시예에 따르면, 프로세서(예: 도 4의 프로세서(410))는 제2메모리(예: 도 4의 제2메모리(430))의 가용 용량이 제1한계값(TH1) 이내인 경우, 저널 데이터와 관련된 프로세스를 이용해 저널 데이터를 제1메모리에 저장(또는 체크 포인트)하도록 설정될 수 있다. 즉, 제2메모리에 저널 데이터들이 커밋 되어 저널링 영역의 가용 용량이 제1한계값 이내로 감소 하면, 저널링을 시도하는 프로세스 문맥(context)에서 체크 포인트를 수행하여 저널링 영역의 가용 용량을 제1한계값 이상으로 확보할 수 있다. 이와 같이 프로세스 문맥과 관련하여 체크 포인트를 수행하는 것을 포 그라운드(foreground) 체크 포인트라고 한다.
포 그라운드 체크 포인트의 경우, 프로세스 문맥에서 수행되므로, 프로세스의 실행을 일시적으로 중지할 수 밖에 없으며, 이에 따라 프로세스 동작 지연이 발생할 수 있다. 이를 위해, 본 발명의 다양한 실시예에 따른 전자 장치는 백 그라운드 체크 포인트를 통해 포 그라운드 체크 포인트의 발생 빈도를 감소 시켜, 프로세스 동작 지연을 줄이고자 한다.
다양한 실시 예에 따르면, 전자 장치(예: 프로세서(410))는 프로세스 문맥 대신 커널 문맥(즉, 커널 스페이스에 포함되는 스레드)에서 체크 포인트를 수행(예:trigger)하는 체크포인트 수행 모듈을 더 포함할 수 있다. 예를 들어, 체크포인트가 필요할 때, 체크포인트 전용 스레드(또는 태스크)가 구동되어 체크 포인트를 수행할 수 있다. 이와 같이 프로세스 문맥이 아닌 커널 문맥에서 체크 포인트를 수행하는 것을 백 그라운드(background) 체크 포인트라고 한다.
다양한 실시예에 따르면, 프로세서는 제2메모리의 가용 용량이 제2한계값(TH2) 이내인 경우, 저널 데이터의 저장과 관련된 커널 스레드를 이용하여 저널 데이터를 제1메모리에 저장(또는 체크 포인트)하도록 설정될 수 있다. 여기서, 제2한계값은 제1한계값 보다 큰 값이며, 프로세서는 제2메모리의 가용 용량이 제2한계값 이내인 경우 백 그라운드 체크 포인트를 개시하여 제2메모리의 가용 용량을 제3한계값(TH3) 이상으로 확보할 수 있다.
백 그라운드 체크 포인트는 포 그라운드 체크 포인트와 달리, 저널 데이터의 저장과 관련된 kworker 커널 스레드 문맥에서 수행될 수 있다. 일 실시예에 따르면 저널링 영역에 여유가 있는 상황에서는 체크 포인트 시점을 가급적 연기하기 위해, 커밋이 완료된 저널 데이터들을 kworker 커널 스레드에 노출시키지 않을 수 있다. 저널 데이터의 저장에 따라 제2메모리의 저널링 영역의 가용 용량이 제2한계값 이내로 감소 하면, 체크 포인트를 수행하는 커널 스레드를 인에이블 하여 가용 용량이 제3한계값이 될 때까지 백 그라운드 체크 포인트를 수행할 수 있다.
백 그라운드 체크 포인트는 프로세스 문맥이 아닌 커널 스레드 문맥에서 체크 포인트를 수행하므로, 프로세스의 수행 지연을 유발하지 않을 수 있다.
본 발명의 다양한 실시예에 따른 전자장치는, 파일 데이터를 저장하기 위한 제1메모리; 상기 제1메모리와 다른 속성을 갖는 제2메모리; 및 프로세서를 포함하고, 상기 프로세서는, 상기 파일 데이터의 적어도 일부 파일 데이터에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하고, 상기 저장하는 동작은 상기 제2메모리의 제1영역에 상기 저널 데이터의 적어도 일부를 버퍼링 하는 동작 및 상기 제2메모리의 제2영역에 상기 저널 데이터의 적어도 일부를 저널링하는 동작을 포함하고, 및 지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 업데이트 하는 동작은 상기 버퍼링 된 저널 데이터 또는 상기 저널링 된 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 제2메모리는 상기 제1영역에 대응하는 제1랜덤 엑세스 메모리와 상기2영역에 대응하는 제2랜덤 엑세스 메모리를 포함하는 복수의 랜덤 엑세스 메모리들을 포함할 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 파일 데이터가 지정된 속성에 속하면, 상기 파일 데이터의 메타 데이터 및 데이터 블록의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 파일 데이터가 상기 지정된 속성에 속하지 않는 경우, 상기 파일 데이터의 메타 데이터의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 파일 데이터가 속한 디렉토리, 파일 명, 확장자, 파일 크기 중 중 적어도 하나에 기초하여 상기 지정된 속성에 속하는 지 여부를 확인하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 제2메모리의 가용 용량이 제1한계값 이내인 경우, 상기 저널 데이터와 관련된 프로세스를 이용해 상기 저널 데이터를 상기 제1메모리에 저장하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 상기 제2메모리의 가용 용량이 상기 제1한계값 보다 큰 제2한계값 이내인 경우, 상기 저널 데이터의 저장과 관련된 커널 스레드를 이용하여 상기 저널 데이터를 상기 제1메모리에 저장하도록 설정될 수 있다.
다양한 실시예에 따르면, 상기 제2메모리는 적어도 하나의 랜덤 액세스 메모리를 포함하며, 상기 제2메모리 중 적어도 하나는, 전자 장치의 파워 오프 시 데이터가 보존될 수 있다.
다양한 실시예에 따르면, 상기 프로세서는, 전자 장치의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash) 발생 시 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정될 수 있다.
도 11은 본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법의 흐름도이다.
도시된 방법은 앞서 도 1 내지 도 10을 통해 설명한 전자 장치에 의해 수행될 수 있으며, 이미 설명한 바 있는 기술적 특징에 대해서는 이하에서 그 설명을 생략하기로 한다.
다양한 실시예에 따르면, 전자 장치는 파일 데이터를 저장하는 제1메모리 및 제1메모리와 다른 속성을 갖는 제2메모리를 포함할 수 있다. 제1메모리는 비휘발성 메모리(non-volatile memory)로써, 대용량의 스토리지(storage) 장치일 수 있다. 예를 들어, 제1메모리는 OTPROM(one time programmable ROM), PROM, EPROM, EEPROM, mask ROM, flash ROM, 플래시 메모리, 하드 드라이브, 또는 솔리드 스테이트 드라이브 (SSD) 중 적어도 하나를 포함할 수 있다. 제2메모리는 제1메모리와 다른 속성을 갖는 메모리일 수 있다. 제2메모리는 주 메모리(main memory)를 포함하며, 전자 장치에 갑작스런 파워 오프가 발생하더라도 적어도 일정 시간 동안은 데이터를 그대로 보존할 수 있는, 예를 들어, 제2메모리는, 배터리 일체형 전자 장치의 일부 영역으로 전원이 계속해서 공급되거나, 제2메모리에 별도의 보조 배터리가 마련되어 전자 장치의 파워 오프 시에도 보조 배터리로부터 제2메모리에 전원이 공급되거나, 적어도 일시적으로 데이터를 보존할 수 있는 특성을 가진 RAM이거나, 비휘발성 메모리인 NVRAM(non-volatile RAM)이 사용될 수 있다.
동작 1110에서, 전자 장치는 제1메모리에 저장된 파일 데이터 중 적어도 일부에 대한 변경을 감지할 수 있다.
동작 1120에서, 전자 장치(예: 어플리케이션)는 해당 파일 데이터가 지정된 속성을 갖는 지 확인할 수 있다. 일 실시예에 따르면, 파일의 확장자 또는 파일 크기 등을 참고 하여 파일이 지정된 속성을 갖는지 확인할 수 있다. 일 실시예에 따르면, 전자 장치의 어플리케이션(예: 도 6의 어플리케이션(612))은 파일의 확장자 등을 참고 하여, 해당 파일에 대해 데이터 저널링 동작을 수행하도록 하는 속성을 파일 시스템 콜 ioctl 인터페이스를 통해 지정할 수 있다.
파일이 지정된 속성을 갖는 경우, 동작 1130에서, 전자 장치는 해당 파일을 데이터 저널링 모드로 저널링 할 수 있다. 데이터 저널링 모드는 메타 데이터 및 데이터 블록을 포함하는 파일 전체의 저널링을 수행하는 모드이다.
이와 달리, 파일이 지정된 속성을 갖지 않는 경우, 동작 1140에서, 전자 장치는 해당 파일을 일반 저널링 모드로 저널링 할 수 있다. 일반 저널링 모드에는 파일 데이터의 메타 데이터에 대해서만 저널링을 수행하는 모드이다.
일 실시예에 따르면, 전자 장치의 어플리케이션은 파일 갱신 및 동기화 후 파일 삭제 동작이 수행되는 파일, 저널 데이터의 동일 영역에 대한 데이터가 복수회에 걸쳐 반복적으로 동기화 되는 파일, 또는 파일 크기가 특정 임계값보다 작은 파일을 데이터 저널링 모드로 저널링을 수행할 수 있다. 파일 갱신 및 동기화 후 파일 삭제 동작을 수행하는 파일은 데이터베이스 관리 프로그램 등에서 파일의 무결성 보장을 위해 사용되는 DB 등의 파일 백업 데이터로써, 예를 들어, 데이터베이스 관리 프로그램(예를 들어, SQLite)의 delete 모드 및 truncate 모드 DB 롤백 저널 파일, Android AtomicFile 클래스의 .bak 확장자의 백업 파일을 예로 들 수 있다. 또한, 동일 영역에 대한 데이터가 복수회에 걸쳐 반복적으로 동기화를 수행하는파일은 데이터베이스 관리 프로그램의 persist 모드 DB 롤백 저널 파일, WAL(write-ahead logging) 모드 DB 저널 파일, DB 파일, Android AtomicFile 클래스의 AtomicFile 파일을 예로 들 수 있다.
동작 1150에서, 전자 장치는 파일 데이터의 변경과 관련된 저널 데이터를 제2메모리에 저장할 수 있다. 이 때, 제2메모리의 지정된 저널링 영역에 트랜잭션 단위로 저널 데이터를 저장할 수 있다.
일 실시예에 따르면, 상기 저장하는 동작은 제2메모리의 제1영역에 저널 데이터의 적어도 일부를 버퍼링하는 동작 및 제2메모리의 제1영역과 다른 제2영역에 저널 데이터의 적어도 일부를 저널링 하는 동작을 포함할 수 있다. 일 실시예에 따르면, 제2메모리는 복수의 랜덤 액세스 메모리를 포함하며, 상기 제1영역은 제1랜덤 액세스 메모리에 대응하여, 제2영역은 제2랜덤 액세스 메모리에 대응할 수 있다.
동작 1160에서, 전자 장치는 체크 포인트를 트리거 하는 이벤트를 감지할 수 있다.
동작 1170에서, 이벤트 감지에 따라 전자 장치는 저널 데이터의 적어도 일부 데이터를 제1메모리에 저장(또는 체크 포인트) 할 수 있다. 여기서, 지정된 속성에 속하는 파일 데이터에 대한 체크 포인트 방법은 앞서 도 8 내지 9를 통해 설명한 바와 같을 수 있다.
동작 1180에서, 전자 장치는 지정된 조건이 만족되는 지 확인할 수 있다. 여기서, 지정된 조건은 갑작스럽게 전자 장치의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash)가 발생하는 경우를 예로 들 수 있다.
동작 1190에서, 전자 장치는 저널 데이터에 기반하여 제1메모리에 저장된 파일 데이터를 업데이트 할 수 있다.
도 12는 본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법의 흐름도이다.
이하에서는 앞서 도 1 내지 도 11을 통해 설명한 바 있는 기술적 특징에 대해서는 그 설명을 생략하기로 한다.
동작 1210에서, 전자 장치는 제1메모리에 저장된 적어도 일부 파일 데이터에 대한 변경을 감지하고, 상기 변경과 관련된 저널 데이터를 제2메모리의 저널링 영역에 저장할 수 있다.
동작 1220에서, 전자 장치는 제2메모리의 가용 용량이 제1한계값 이내인 지 확인할 수 있다.
제2메모리의 가용 용량이 제1한계값 이내인 경우, 동작 1230에서, 전자 장치는 제2메모리에 저장된 저널 데이터에 대해 포 그라운드 체크 포인트를 수행할 수 있다. 포 그라운드 체크 포인트는 저널링을 시도하는 프로세스 문맥(context)에서 체크 포인트를 수행하는 것으로, 이에 따라 저널링 영역의 가용 용량을 제1한계값 이상으로 확보할 수 있다.
동작 1240에서, 전자 장치는 제2메모리의 가용 용량이 제2한계값 이내인 지 확인할 수 있다. 제2한계값은 제1한계값보다 큰 값일 수 있다.
제2메모리의 가용 용량이 제2한계값 이내인 경우, 동작 1250에서, 전자 장치는 백 그라운드 체크 포인트를 수행할 수 있다. 백 그라운드 체크 포인트는 포 그라운드 체크 포인트와 달리, 저널 데이터의 저장과 관련된 kworker 커널 스레드 문맥에서 수행될 수 있다. 일 실시예에 따르면 저널링 영역에 여유가 있는 상황에서는 체크 포인트 시점을 가급적 연기하기 위해, 커밋이 완료된 저널 데이터들을 kworker 커널 스레드에 노출시키지 않을 수 있다. 저널 데이터의 저장에 따라 제2메모리의 저널링 영역의 가용 용량이 제2한계값 이내로 감소 하면, 체크 포인트를 수행하는 커널 스레드를 인에이블 하여 가용 용량이 제3한계값이 될 때까지 백 그라운드 체크 포인트를 수행할 수 있다.
포 그라운드 체크 포인트 및 백 그라운드 체크 포인트 동작에 대해서는 앞서도 10을 통해 설명한 바와 같을 수 있다.
본 발명의 다양한 실시예에 따른 전자 장치의 파일 데이터 저널링 방법은, 제1메모리에 저장된 적어도 일부 파일 데이터에 대한 변경을 감지하는 동작; 상기 변경과 관련된 저널 데이터를 상기 제1메모리와 다른 속성을 갖는 제2메모리에 저장하는 동작; 및 지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트 하는 동작을 포함하며, 상기 저장하는 동작은 상기 제2메모리의 제1영역에 상기 저널 데이터의 적어도 일부를 버퍼링 하는 동작 및 상기 제2메모리의 제2영역에 상기 저널 데이터의 적어도 일부를 저널링하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 업데이트 하는 동작은 상기 버퍼링 된 저널 데이터 또는 상기 저널링 된 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 제2메모리는 상기 제1영역에 대응하는 제1랜덤 엑세스 메모리와 상기2영역에 대응하는 제2랜덤 엑세스 메모리를 포함하는 복수의 랜덤 엑세스 메모리들을 포함할 수 있다.
다양한 실시예에 따르면, 상기 파일 데이터가 지정된 속성에 속하는지 판단하는 동작을 더 포함하며, 상기 저장하는 동작은, 상기 파일 데이터가 상기 지정된 속성에 속하는 경우, 상기 파일 데이터의 메타 데이터 및 데이터 블록의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 저장하는 동작은, 상기 파일 데이터가 상기 지정된 속성에 속하지 않는 경우, 상기 파일 데이터의 메타 데이터의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 파일 데이터가 지정된 속성에 속하는지 판단하는 동작은, 파일 데이터가 속한 디렉토리, 파일 명, 확장자, 파일 크기 중 중 적어도 하나에 기초하여 상기 지정된 속성에 속하는 지 여부를 확인하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 제1메모리에 저장하는 동작은, 상기 제2메모리의 가용 용량이 제1한계값 이내인 경우, 상기 저널 데이터와 관련된 프로세스를 이용해 상기 저널 데이터를 상기 제1메모리에 저장하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 제1메모리에 저장하는 동작은, 상기 제2메모리의 가용 용량이 상기 제1한계값 보다 큰 제2한계값 이내인 경우, 상기 저널 데이터의 저장과 관련된 커널 스레드를 이용하여 상기 저널 데이터를 상기 제1메모리에 저장하는 동작을 포함할 수 있다.
다양한 실시예에 따르면, 상기 제2메모리는 적어도 하나의 랜덤 액세스 메모리를 포함하며, 상기 제2메모리 중 적어도 하나는, 전자 장치의 파워 오프 시 데이터가 보존될 수 있다.
다양한 실시예에 따르면, 상기 업데이트 하는 동작은, 상기 전자 장치의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash) 발생 시 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함할 수 있다.

Claims (20)

  1. 전자장치에 있어서,
    파일 데이터를 저장하기 위한 제1메모리;
    상기 제1메모리와 다른 속성을 갖는 제2메모리; 및
    프로세서를 포함하고, 상기 프로세서는,
    상기 파일 데이터의 적어도 일부 파일 데이터에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하고, 상기 저장하는 동작은 상기 제2메모리의 제1영역에 상기 저널 데이터의 적어도 일부를 버퍼링 하는 동작 및 상기 제2메모리의 제2영역에 상기 저널 데이터의 적어도 일부를 저널링하는 동작을 포함하고, 및
    지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정된 전자 장치.
  2. 제 1항에 있어서,
    상기 업데이트 하는 동작은 상기 버퍼링 된 저널 데이터 또는 상기 저널링 된 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함하는 것을 특징으로 하는 전자 장치.
  3. 제 2항에 있어서,
    상기 제2메모리는 상기 제1영역에 대응하는 제1랜덤 엑세스 메모리와 상기2영역에 대응하는 제2랜덤 엑세스 메모리를 포함하는 복수의 랜덤 엑세스 메모리들을 포함하는 전자 장치.
  4. 제 1항에 있어서,
    상기 프로세서는,
    상기 파일 데이터가 지정된 속성에 속하면, 상기 파일 데이터의 메타 데이터 및 데이터 블록의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하도록 설정된 전자 장치.
  5. 제 1항에 있어서,
    상기 프로세서는, 상기 파일 데이터가 상기 지정된 속성에 속하지 않는 경우, 상기 파일 데이터의 메타 데이터의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하도록 설정된 전자 장치.
  6. 제 4항에 있어서,
    상기 프로세서는,
    파일 데이터가 속한 디렉토리, 파일 명, 확장자, 파일 크기 중 중 적어도 하나에 기초하여 상기 지정된 속성에 속하는 지 여부를 확인하도록 설정된 전자 장치.
  7. 제 1항에 있어서,
    상기 프로세서는,
    상기 제2메모리의 가용 용량이 제1한계값 이내인 경우, 상기 저널 데이터와 관련된 프로세스를 이용해 상기 저널 데이터를 상기 제1메모리에 저장하도록 설정된 전자 장치.
  8. 제 7항에 있어서,
    상기 프로세서는,
    상기 제2메모리의 가용 용량이 상기 제1한계값 보다 큰 제2한계값 이내인 경우, 상기 저널 데이터의 저장과 관련된 커널 스레드를 이용하여 상기 저널 데이터를 상기 제1메모리에 저장하도록 설정된 전자 장치.
  9. 제 1항에 있어서,
    상기 제2메모리는 적어도 하나의 랜덤 액세스 메모리를 포함하며,
    상기 제2메모리 중 적어도 하나는, 전자 장치의 파워 오프 시 데이터가 보존되는 것을 특징으로 하는 전자 장치.
  10. 제 1항에 있어서,
    상기 프로세서는,
    전자 장치의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash) 발생 시 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하도록 설정된 전자 장치.
  11. 전자 장치의 파일 데이터 저널링 방법에 있어서,
    제1메모리에 저장된 적어도 일부 파일 데이터에 대한 변경을 감지하는 동작;
    상기 변경과 관련된 저널 데이터를 상기 제1메모리와 다른 속성을 갖는 제2메모리에 저장하는 동작; 및
    지정된 조건이 만족되는 경우, 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트 하는 동작을 포함하며,
    상기 저장하는 동작은 상기 제2메모리의 제1영역에 상기 저널 데이터의 적어도 일부를 버퍼링 하는 동작 및 상기 제2메모리의 제2영역에 상기 저널 데이터의 적어도 일부를 저널링하는 동작을 포함하는 방법.
  12. 제 11항에 있어서,
    상기 업데이트 하는 동작은 상기 버퍼링 된 저널 데이터 또는 상기 저널링 된 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함하는 것을 특징으로 하는 방법.
  13. 제 12항에 있어서,
    상기 제2메모리는 상기 제1영역에 대응하는 제1랜덤 엑세스 메모리와 상기2영역에 대응하는 제2랜덤 엑세스 메모리를 포함하는 복수의 랜덤 엑세스 메모리들을 포함하는 방법.
  14. 제 11항에 있어서,
    상기 파일 데이터가 지정된 속성에 속하는지 판단하는 동작을 더 포함하며,
    상기 저장하는 동작은,
    상기 파일 데이터가 상기 지정된 속성에 속하는 경우, 상기 파일 데이터의 메타 데이터 및 데이터 블록의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하는 동작을 포함하는 방법.
  15. 제 14항에 있어서,
    상기 저장하는 동작은,
    상기 파일 데이터가 상기 지정된 속성에 속하지 않는 경우, 상기 파일 데이터의 메타 데이터의 적어도 일부에 대한 변경과 관련된 저널 데이터를 상기 제2메모리에 저장하는 동작을 포함하는 방법.
  16. 제 14항에 있어서,
    상기 파일 데이터가 지정된 속성에 속하는지 판단하는 동작은,
    파일 데이터가 속한 디렉토리, 파일 명, 확장자, 파일 크기 중 중 적어도 하나에 기초하여 상기 지정된 속성에 속하는 지 여부를 확인하는 동작을 포함하는 방법.
  17. 제 11항에 있어서,
    상기 제1메모리에 저장하는 동작은,
    상기 제2메모리의 가용 용량이 제1한계값 이내인 경우, 상기 저널 데이터와 관련된 프로세스를 이용해 상기 저널 데이터를 상기 제1메모리에 저장하는 동작을 포함하는 방법.
  18. 제 11항에 있어서,
    상기 제1메모리에 저장하는 동작은,
    상기 제2메모리의 가용 용량이 상기 제1한계값 보다 큰 제2한계값 이내인 경우, 상기 저널 데이터의 저장과 관련된 커널 스레드를 이용하여 상기 저널 데이터를 상기 제1메모리에 저장하는 동작을 포함하는 방법.
  19. 제 11항에 있어서,
    상기 제2메모리는 적어도 하나의 랜덤 액세스 메모리를 포함하며,
    상기 제2메모리 중 적어도 하나는, 전자 장치의 파워 오프 시 데이터가 보존되는 것을 특징으로 하는 방법.
  20. 제 11항에 있어서,
    상기 업데이트 하는 동작은,
    상기 전자 장치의 전원 공급이 차단되는 경우 또는 시스템 오류(system crash) 발생 시 상기 저널 데이터에 적어도 기반하여 상기 제1메모리에 저장된 상기 적어도 일부 파일 데이터를 업데이트하는 동작을 포함하는 방법.
PCT/KR2017/005682 2016-06-01 2017-05-31 전자 장치 및 전자 장치의 파일 데이터 저널링 방법 WO2017209508A1 (ko)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US16/099,557 US20190155792A1 (en) 2016-06-01 2017-05-31 Electronic device and file data journaling method of electronic device
EP17807001.7A EP3451193B1 (en) 2016-06-01 2017-05-31 Electronic device and file data journaling method of electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2016-0068358 2016-06-01
KR1020160068358A KR102637757B1 (ko) 2016-06-01 2016-06-01 전자 장치 및 전자 장치의 파일 데이터 저널링 방법

Publications (1)

Publication Number Publication Date
WO2017209508A1 true WO2017209508A1 (ko) 2017-12-07

Family

ID=60477571

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2017/005682 WO2017209508A1 (ko) 2016-06-01 2017-05-31 전자 장치 및 전자 장치의 파일 데이터 저널링 방법

Country Status (4)

Country Link
US (1) US20190155792A1 (ko)
EP (1) EP3451193B1 (ko)
KR (1) KR102637757B1 (ko)
WO (1) WO2017209508A1 (ko)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101969799B1 (ko) * 2016-09-07 2019-04-17 울산과학기술원 전자 장치 및 제어 방법
KR20190074840A (ko) 2017-12-20 2019-06-28 단국대학교 산학협력단 파일 시스템 저널링을 이용한 랜섬웨어 방지를 위한 시스템 및 방법
KR102534744B1 (ko) * 2018-02-23 2023-05-22 삼성전자주식회사 메모리를 제어하는 전자 장치 및 제어 방법
KR102052312B1 (ko) * 2018-05-08 2019-12-05 주식회사 애포샤 캐싱 장치 및 방법
CN111046007B (zh) * 2018-10-12 2023-08-18 伊姆西Ip控股有限责任公司 管理存储系统的方法、装置和计算机程序产品
CN111538712B (zh) * 2020-04-30 2023-07-21 恒生电子股份有限公司 日志的记录方法及处理节点、电子设备、存储介质
US11983440B2 (en) 2020-12-30 2024-05-14 Samsung Electronics Co., Ltd. Storage device including memory controller implementing journaling and operating method of the memory controller
TWI811674B (zh) * 2021-05-06 2023-08-11 大陸商北京集創北方科技股份有限公司 快閃記憶體的操作方法、系統單晶片及資訊處理裝置
CN114168401B (zh) * 2021-10-26 2023-08-18 苏州浪潮智能科技有限公司 一种日志记录方法、装置及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140118519A (ko) * 2013-03-29 2014-10-08 이화여자대학교 산학협력단 비휘발성 메모리에 기반하여 저널링 기능을 통합한 버퍼 캐시 장치, 저널링 파일 시스템 및 저널링 방법
KR20150018682A (ko) * 2013-08-08 2015-02-24 삼성전자주식회사 스토리지 시스템 및 그것의 쓰기 방법
JP2015043178A (ja) * 2013-08-26 2015-03-05 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
KR20150141073A (ko) * 2014-06-09 2015-12-17 삼성전자주식회사 데이터 처리 방법 및 전자 장치
KR20160002109A (ko) * 2014-06-30 2016-01-07 성균관대학교산학협력단 순서 모드 저널링 파일 시스템을 위한 블록 그룹 단위 저널링 방법 및 장치

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9501492B2 (en) * 2006-10-24 2016-11-22 Marvell World Trade Ltd. Combination journaling/non-journaling file system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20140118519A (ko) * 2013-03-29 2014-10-08 이화여자대학교 산학협력단 비휘발성 메모리에 기반하여 저널링 기능을 통합한 버퍼 캐시 장치, 저널링 파일 시스템 및 저널링 방법
KR20150018682A (ko) * 2013-08-08 2015-02-24 삼성전자주식회사 스토리지 시스템 및 그것의 쓰기 방법
JP2015043178A (ja) * 2013-08-26 2015-03-05 キヤノン株式会社 情報処理装置、情報処理方法及びプログラム
KR20150141073A (ko) * 2014-06-09 2015-12-17 삼성전자주식회사 데이터 처리 방법 및 전자 장치
KR20160002109A (ko) * 2014-06-30 2016-01-07 성균관대학교산학협력단 순서 모드 저널링 파일 시스템을 위한 블록 그룹 단위 저널링 방법 및 장치

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3451193A4 *

Also Published As

Publication number Publication date
EP3451193B1 (en) 2021-09-08
KR20170136366A (ko) 2017-12-11
US20190155792A1 (en) 2019-05-23
EP3451193A4 (en) 2020-07-29
KR102637757B1 (ko) 2024-02-19
EP3451193A1 (en) 2019-03-06

Similar Documents

Publication Publication Date Title
WO2017209508A1 (ko) 전자 장치 및 전자 장치의 파일 데이터 저널링 방법
WO2018143673A1 (ko) 전자 장치 및 전자 장치의 지문 인식 방법
WO2017188577A1 (ko) 배터리의 충전을 제어하기 위한 방법 및 그 전자 장치
WO2017142309A1 (en) Electronic device and method for controlling application and component
WO2017116052A1 (ko) 컨텐트 인식 장치 및 그 동작 방법
WO2017142195A1 (ko) 전자 장치 및 그 어플리케이션 전환 및 정렬 방법
WO2018139752A1 (ko) 복수의 카메라를 제어하는 방법 및 전자 장치
WO2018155928A1 (ko) 복수의 생체 센서를 이용하여 인증을 수행하기 위한 전자 장치 및 그의 동작 방법
WO2018117560A1 (ko) 사용자의 시선 및 입력에 기반하여 제어되는 전자 장치, 모바일 전자 장치 및 디스플레이 장치
WO2016137297A1 (en) Method and device for controlling payment function
WO2018128509A1 (en) Electronic device and method for sensing fingerprints
WO2017073941A1 (ko) 제스처 감지 방법 및 이를 지원하는 전자 장치
WO2018117589A1 (en) Electronic device and method for displaying web page using the same
WO2017023040A1 (en) Screen controlling method and electronic device for supporting the same
WO2017175962A1 (ko) 화면을 표시하는 전자 장치 및 그 제어 방법
WO2016163826A1 (en) Method and apparatus for operating sensor of electronic device
WO2018034416A1 (ko) 전자 장치 및 전자 장치의 이미지 표시 방법
WO2017111313A1 (ko) 웹푸시를 이용한 푸시 서비스 제공 방법 및 이를 지원하는 전자 장치
WO2018038526A1 (en) Electronic device and method for measuring heart rate based on infrared rays sensor using the same
WO2018199432A1 (ko) 객체에 대응하는 콘텐트를 출력하기 위한 방법 및 그 전자 장치
WO2017126767A1 (ko) 전자 장치 및 전자 장치의 동작 방법
WO2018169304A2 (ko) 도어락 장치 및 도어락 장치의 제어 방법
WO2017183930A1 (ko) 전자 장치 및 그 제어 방법
WO2017135764A1 (ko) 애플리케이션을 상호 연동하는 전자 장치 및 이를 위한 방법
WO2018084651A1 (en) Electronic device and control method thereof

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: 17807001

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2017807001

Country of ref document: EP

Effective date: 20181130