WO2022186460A1 - 보안 데이터 처리 방법 및 장치 - Google Patents

보안 데이터 처리 방법 및 장치 Download PDF

Info

Publication number
WO2022186460A1
WO2022186460A1 PCT/KR2021/019959 KR2021019959W WO2022186460A1 WO 2022186460 A1 WO2022186460 A1 WO 2022186460A1 KR 2021019959 W KR2021019959 W KR 2021019959W WO 2022186460 A1 WO2022186460 A1 WO 2022186460A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
update
security
database file
electronic device
Prior art date
Application number
PCT/KR2021/019959
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 CN202180095205.0A priority Critical patent/CN116897351A/zh
Priority to EP21929322.2A priority patent/EP4290398A1/en
Publication of WO2022186460A1 publication Critical patent/WO2022186460A1/ko
Priority to US18/455,224 priority patent/US20230409733A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6227Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database where protection concerns the structure of data, e.g. records, types, queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • 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
    • G06F16/162Delete operations
    • 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/235Update request formulation
    • 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/2365Ensuring data consistency and integrity
    • 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/25Integrating or interfacing systems involving database management 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/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/55Detecting local intrusion or implementing counter-measures
    • G06F21/56Computer malware detection or handling, e.g. anti-virus arrangements
    • G06F21/562Static detection
    • G06F21/565Static detection by checking file integrity

Definitions

  • a transaction may include an update operation such as modification, deletion, or addition of an application (or application data). Atomicity may mean that the results of all operations related to one transaction are reflected in the database or not reflected at all.
  • a database may use a journal technique to ensure data integrity and transaction atomicity.
  • the journal technique may be a technique to generate and utilize a write ahead log (WAL) file or a rollback journal file in addition to a database file for storing application data.
  • WAL write ahead log
  • the update-related processing result can be saved in the WAL file before the database file is updated.
  • the update processing result related to the specific page may be recorded in the form of being appended to the WAL file.
  • data requested to be deleted may still remain in the database file or the WAL file.
  • the method and apparatus for processing so that the updated security data does not remain in the database file or WAL file may be disclosed.
  • An electronic device includes a display, a memory, and a processor operatively connected to the display or the memory, wherein the processor receives a request to update security data in which a security attribute is set among application data. , identify the status of the additional file corresponding to the security data, and if the status of the identified additional file is invalid, determine a first security data processing process, or if the status of the identified additional file is valid state, it may be configured to determine a second security data processing process, and to update the security data according to the determined security data processing process.
  • An operation method of an electronic device includes an operation of receiving a request for update of security data in which a security attribute is set among application data, an operation of identifying a state of an additional file corresponding to the security data, and the identified additional file. determining a first secure data processing process when the status of the file is an invalid status, determining a second security data processing process when the status of the identified additional file is a valid status, and the determined security data and performing an update of the security data according to a processing process.
  • security attributes are set for the entire database or a specified area (eg, tables, columns), security attributes are set in a specific range using SQL syntax, or application programming interface (API) syntax is used.
  • API application programming interface
  • FIG. 1 is a block diagram of an electronic device in a network environment according to various embodiments of the present disclosure
  • FIG. 2 is a diagram illustrating a program block diagram of an electronic device according to various embodiments of the present disclosure
  • FIG. 3 is a flowchart illustrating a method of operating an electronic device according to various embodiments of the present disclosure
  • FIG. 4 is a flowchart illustrating a method of performing a first secure data processing process in an electronic device according to various embodiments of the present disclosure
  • FIG. 5 is a diagram illustrating a database structure of an electronic device according to various embodiments of the present disclosure.
  • FIG. 6 is a flowchart illustrating a method of performing a second secure data processing process in an electronic device according to various embodiments of the present disclosure
  • FIGS. 7A and 7B are diagrams illustrating examples of a database file and a WAL file according to various embodiments.
  • FIG. 8 is a flowchart illustrating a method of performing a third secure data processing process in an electronic device according to various embodiments of the present disclosure
  • 9A and 9B are flowcharts illustrating a method of setting security data in an electronic device according to various embodiments of the present disclosure
  • FIG. 10 is a flowchart illustrating another operating method of an electronic device according to various embodiments of the present disclosure.
  • FIG. 11 is a flowchart illustrating a method of setting security data in an application layer of an electronic device according to various embodiments of the present disclosure
  • FIG. 1 is a block diagram of an electronic device 101 in a network environment 100 according to various embodiments.
  • the electronic device 101 communicates with the electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or a second network 199 . It may communicate with at least one of the electronic device 104 and the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 .
  • the electronic device 101 includes a processor 120 , a memory 130 , an input module 150 , a sound output module 155 , a display module 160 , an audio module 170 , and a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or an antenna module 197 .
  • at least one of these components eg, the connection terminal 178
  • some of these components are integrated into one component (eg, display module 160 ). can be
  • the processor 120 for example, executes software (eg, a program 140) to execute at least one other component (eg, a hardware or software component) of the electronic device 101 connected to the processor 120. It can control and perform various data processing or operations. According to one embodiment, as at least part of data processing or operation, the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 . may be stored in , process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • software eg, a program 140
  • the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 .
  • the volatile memory 132 may be stored in , process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 .
  • the processor 120 is the main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor).
  • the main processor 121 eg, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor.
  • the main processor 121 e.g, a central processing unit or an application processor
  • a secondary processor 123 eg, a graphic processing unit, a neural network processing unit (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a
  • the secondary processor 123 may, for example, act on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or when the main processor 121 is active (eg, executing an application). ), together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states.
  • the coprocessor 123 eg, an image signal processor or a communication processor
  • may be implemented as part of another functionally related component eg, the camera module 180 or the communication module 190 ). have.
  • the auxiliary processor 123 may include a hardware structure specialized for processing an artificial intelligence model.
  • Artificial intelligence models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself on which the artificial intelligence model is performed, or may be performed through a separate server (eg, the server 108).
  • the learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but in the above example not limited
  • the artificial intelligence model may include a plurality of artificial neural network layers.
  • Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the above example.
  • the artificial intelligence model may include, in addition to, or alternatively, a software structure in addition to the hardware structure.
  • the memory 130 may store various data used by at least one component (eg, the processor 120 or the sensor module 176 ) of the electronic device 101 .
  • the data may include, for example, input data or output data for software (eg, the program 140 ) and instructions related thereto.
  • the memory 130 may include a volatile memory 132 or a non-volatile memory 134 .
  • the program 140 may be stored as software in the memory 130 , and may include, for example, an operating system 142 , middleware 144 , or an application 146 .
  • the input module 150 may receive a command or data to be used by a component (eg, the processor 120 ) of the electronic device 101 from the outside (eg, a user) of the electronic device 101 .
  • the input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).
  • the sound output module 155 may output a sound signal to the outside of the electronic device 101 .
  • the sound output module 155 may include, for example, a speaker or a receiver.
  • the speaker can be used for general purposes such as multimedia playback or recording playback.
  • the receiver can be used to receive incoming calls. According to one embodiment, the receiver may be implemented separately from or as part of the speaker.
  • the display module 160 may visually provide information to the outside (eg, a user) of the electronic device 101 .
  • the display module 160 may include, for example, a control circuit for controlling a display, a hologram device, or a projector and a corresponding device.
  • the display module 160 may include a touch sensor configured to sense a touch or a pressure sensor configured to measure the intensity of a force generated by the touch.
  • the audio module 170 may convert a sound into an electric signal or, conversely, convert an electric signal into a sound. According to an embodiment, the audio module 170 acquires a sound through the input module 150 , or an external electronic device (eg, a sound output module 155 ) connected directly or wirelessly with the electronic device 101 .
  • the electronic device 102) eg, a speaker or headphones
  • the electronic device 102 may output a sound.
  • the sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, a user state), and generates an electrical signal or data value corresponding to the sensed state. can do.
  • the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, It may include a temperature sensor, a humidity sensor, or an illuminance sensor.
  • the interface 177 may support one or more specified protocols that may be used by the electronic device 101 to directly or wirelessly connect with an external electronic device (eg, the electronic device 102 ).
  • the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.
  • the connection terminal 178 may include a connector through which the electronic device 101 can be physically connected to an external electronic device (eg, the electronic device 102 ).
  • the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).
  • the haptic module 179 may convert an electrical signal into a mechanical stimulus (eg, vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic sense.
  • the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.
  • the camera module 180 may capture still images and moving images. According to an embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.
  • the power management module 188 may manage power supplied to the electronic device 101 .
  • the power management module 188 may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).
  • PMIC power management integrated circuit
  • the battery 189 may supply power to at least one component of the electronic device 101 .
  • battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.
  • the communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). It can support establishment and communication performance through the established communication channel.
  • the communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication.
  • the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : It may include a local area network (LAN) communication module, or a power line communication module).
  • a wireless communication module 192 eg, a cellular communication module, a short-range communication module, or a global navigation satellite system (GNSS) communication module
  • GNSS global navigation satellite system
  • wired communication module 194 eg, : It may include a local area network (LAN) communication module, or a power line communication module.
  • a corresponding communication module among these communication modules is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a first network 198 eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)
  • a second network 199 eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN).
  • a telecommunication network
  • the wireless communication module 192 uses subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199 .
  • subscriber information eg, International Mobile Subscriber Identifier (IMSI)
  • IMSI International Mobile Subscriber Identifier
  • the electronic device 101 may be identified or authenticated.
  • the wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, a new radio access technology (NR).
  • NR access technology includes high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and access to multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency) -latency communications)).
  • eMBB enhanced mobile broadband
  • mMTC massive machine type communications
  • URLLC ultra-reliable and low-latency
  • the wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example.
  • a high frequency band eg, mmWave band
  • the wireless communication module 192 uses various techniques for securing performance in a high-frequency band, for example, beamforming, massive multiple-input and multiple-output (MIMO), all-dimensional multiplexing. It may support technologies such as full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna.
  • the wireless communication module 192 may support various requirements defined in the electronic device 101 , an external electronic device (eg, the electronic device 104 ), or a network system (eg, the second network 199 ).
  • the wireless communication module 192 may include a peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency for realizing URLLC ( Example: Downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less) can be supported.
  • a peak data rate eg, 20 Gbps or more
  • loss coverage eg, 164 dB or less
  • U-plane latency for realizing URLLC
  • the antenna module 197 may transmit or receive a signal or power to the outside (eg, an external electronic device).
  • the antenna module 197 may include an antenna including a conductor formed on a substrate (eg, a PCB) or a radiator formed of a conductive pattern.
  • the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is connected from the plurality of antennas by, for example, the communication module 190 . can be selected. A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna.
  • other components eg, a radio frequency integrated circuit (RFIC)
  • RFIC radio frequency integrated circuit
  • the antenna module 197 may form a mmWave antenna module.
  • the mmWave antenna module comprises a printed circuit board, an RFIC disposed on or adjacent to a first side (eg, bottom side) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, an array antenna) disposed on or adjacent to a second side (eg, top or side) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.
  • peripheral devices eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)
  • GPIO general purpose input and output
  • SPI serial peripheral interface
  • MIPI mobile industry processor interface
  • the command or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 .
  • Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 .
  • all or a part of operations executed in the electronic device 101 may be executed in one or more external electronic devices 102 , 104 , or 108 .
  • the electronic device 101 may perform the function or service itself instead of executing the function or service itself.
  • one or more external electronic devices may be requested to perform at least a part of the function or the service.
  • One or more external electronic devices that have received the request may execute at least a part of the requested function or service, or an additional function or service related to the request, and transmit a result of the execution to the electronic device 101 .
  • the electronic device 101 may process the result as it is or additionally and provide it as at least a part of a response to the request.
  • cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used.
  • the electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing.
  • the external electronic device 104 may include an Internet of things (IoT) device.
  • the server 108 may be an intelligent server using machine learning and/or neural networks.
  • the external electronic device 104 or the server 108 may be included in the second network 199 .
  • the electronic device 101 may be applied to an intelligent service (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.
  • FIG. 2 is a diagram illustrating a program block diagram of an electronic device according to various embodiments of the present disclosure
  • an electronic device eg, the electronic device 101 of FIG. 1
  • the program 140 may include middleware or various applications (eg, the application 210 ) running on the operating system.
  • the operating system may be, for example, an operating system such as Android, iOS, Windows, symbian, tizen, or bada. At least a part of the program 140 may be preloaded on the electronic device 101 or may be downloaded from an external electronic device (eg, the electronic devices 102 and 104 or the server 108 ).
  • the program 140 may include an application 210 , a database framework 220 , a database manager 230 , a file system 240 , or a database 250 .
  • the application 210 may include various types of applications (eg, phone calls, text messages, alarms, and contacts) installed in the electronic device 101 .
  • the database framework 220 provides functions commonly required by the applications 210 or provides various functions so that the applications 210 can efficiently use the limited system resources inside the electronic device 101 to the applications 210 . can be provided as
  • the database manager 230 may provide various functions to the application 210 so that functions or information provided from one or more resources of the electronic device 101 may be used by the application 210 .
  • the file system 240 may refer to a system for managing files stored in an auxiliary storage device or a database 250 (eg, the memory 130 of FIG. 1 ) in an operating system.
  • the database 250 may include a database file 251 , an index file 253 , or an additional file 255 .
  • the database 250 may include a relational database (rdb), not only sql (NoSQL), a hierarchical database, and/or a network type database.
  • the database 250 may include Oracle, MySQL (oracle), MS-SQL (microsoft), DB2, Infomix (IBM), Maria DB (sun microsystems), Derby (aqpache), and/or SQLite (opensource).
  • MySQL oracle
  • MS-SQL Microsoft
  • IBM Infomix
  • Maria DB un microsystems
  • Derby aqpache
  • SQLite opensource
  • the electronic device 101 may manage data stored in a storage based on the nonvolatile memory 134 based on the file system 240 .
  • the electronic device 101 may manage a location in which data (eg, a file) of the database file 251 is stored by using the file system 240 .
  • File system 240 may be included in operating system 142 .
  • the electronic device 101 may set at least a portion of the volatile memory 132 and/or the nonvolatile memory 134 of the memory 130 as storage.
  • the storage may correspond to a storage area in which data related to the electronic device 101 is stored.
  • the memory may refer to a portion of the volatile memory 132 and/or the non-volatile memory 134 that is distinct from the storage area.
  • the memory may correspond to a work area for processing data related to the electronic device 101 .
  • the electronic device 101 may manage data related to the application 146 based on the database file 251 .
  • the database file 251 is a set of structured data, and may refer to a set of data stored in a storage based on a specified list or data structure.
  • Applications and services installed in the electronic device 101 may operate based on the database file 251 .
  • the database file 251 may be frequently accessed by a plurality of different applications and services.
  • the number of database files 251 stored in the storage of the electronic device 101 may be plural.
  • a journal technique may be applied to the database 250 to ensure data integrity and transaction atomicity.
  • the journal technique may be a technique to generate and utilize an additional file 255 in addition to the database file 251 for storing application data.
  • the database file 251 stores application data, and may include a database header, a database schema, database contents, or a data structure.
  • the additional file 255 may include a write ahead log (WAL) file or a rollback journal file. For example, when an update of application data occurs in the WAL file, processing results related to the update may be stored before the database file 251 is updated. If the update condition of the WAL file is met, the contents stored in the WAL file may be reflected in the database file.
  • WAL write ahead log
  • the original application data when application data is updated, the original application data may be stored before the database file is updated.
  • the rollback journal file may be a backup of application data.
  • the WAL file and the rollback journal file may have different data saved, but may update the database file similarly.
  • the database manager 230 may add content related to the update to the WAL file in the form of a frame.
  • a transaction is a logical unit of work (LUW) of operations related to data in the database file 251 , and may be a unit of interaction between the application 146 and the database file 251 .
  • LW logical unit of work
  • the operation related to the data of the database file 251 is, for example, based on a query language (structured query language, SQL) such as OPEN, SELECT, INSERT, DELETE, UPDATE, CLOSE, the operation of accessing the database file 251 can mean
  • a transaction may refer to a set of one or more operations and/or query words related to data in the database file 251 .
  • a transactional operation may include a read transaction (or operation), an add transaction, a modify (or change) transaction, or a delete transaction.
  • the index file 253 may be a file (eg, a WAL index file) storing mapping information of a result stored in the additional file 255 and a portion of the database file 251 .
  • the mapping information may indicate in which part of the database file 251 the result stored in the additional file 255 should be included.
  • the mapping information may be information that matches the changed data stored in the additional file 255 and the location of a portion of the database file 251 related to the data.
  • Data stored in the database file 251 may be managed, for example, based on a page unit having a specified size (eg, a size between 512 Byte and 64 MByte).
  • the additional file 255 is data of the database file 251 that is changed based on a transaction based on a frame unit having a size based on the page (eg, a size combining the size of the page and the size of the frame header) can be saved.
  • the mapping information stored in the index file 253 may indicate which page of the database file 251 corresponds to which frame of the additional file 255 data stored.
  • the electronic device 101 searches a hash table included in the mapping information of the index file 253 based on an identifier (eg, a page number) of a page of the database file 251 , so that the A portion (eg, a frame) of the additional file 255 corresponding to the page having the identifier may be identified. For example, the electronic device 101 may identify the frame number of the additional file 255 corresponding to the designated page number.
  • the index file 253 may include an area related to update permission (eg, file lock) for preventing and/or controlling one or more transactions concurrently accessing the database file 251 .
  • the update permission may be used to prevent errors that may occur when a plurality of transactions simultaneously access the database file 251 .
  • the electronic device (eg, the electronic device of FIG. 1 ) according to various embodiments includes a display (eg, the display module 160 of FIG. 1 ), a memory (eg, the memory 130 of FIG. 1 ), and the display or and a processor (eg, the processor 120 of FIG. 1 ) operatively connected to the memory, wherein the processor receives a request to update security data in which a security attribute is set among application data, and an additional file corresponding to the security data and determine a first secure data processing process if the status of the identified additional file is invalid, or process a second secure data if the status of the identified additional file is valid It may be configured to determine a process, and to update the security data according to the determined security data processing process.
  • a display eg, the display module 160 of FIG. 1
  • a memory eg, the memory 130 of FIG. 1
  • the display or and a processor eg, the processor 120 of FIG. 1
  • the processor receives a request to update security data in which a security
  • the first secure data processing process is to obtain an update right of the database file stored in the memory, update the database file in response to the secure data without the additional file, and return the update right when the update is completed may be set.
  • the second secure data processing process determines whether a page structure of the database file stored in the memory is changed, and if the page structure is not changed, it is determined whether a page corresponding to the secure data exists in the additional file. and, when the page corresponding to the security data does not exist in the additional file, acquire the update authority of the database file, update the database file in response to the security data without the additional file, and the update is completed If it is, it may be set to return the update right.
  • the processor may be configured to perform a third secure data processing process when the first secure data processing process or the second secure data processing process fails.
  • the third security data processing process adds a frame corresponding to the security data to the additional file, creates a thread for processing the security data, and based on a life cycle set in the security data, the security It may be configured to update the database file corresponding to data, and to invalidate an additional file corresponding to the security data when the update is completed.
  • the processor waits for the update operation for as long as the life cycle, and after the life cycle elapses, determines whether an update condition of the additional file is satisfied, and responds to the update condition. If it is satisfied, it acquires the update authority for the database file and attempts to update the database file in response to the security data. It may be determined whether or not and when the update condition is satisfied, it may be configured to acquire an update authority for the database file and attempt to update the database file in response to the security data.
  • the processor determines whether a set condition is satisfied, and when the set condition is satisfied, the processor waits for the update until obtaining the update authority, and obtains the update authority It may be configured to update the database file in response to the security data.
  • the processor may be configured to reduce the size of the additional file corresponding to the security data or to invalidate the additional file by overwriting a frame of the additional file.
  • the processor may be configured to perform any one of an operation of reducing the size of the additional file or overwriting a frame of the additional file based on the storage space of the memory.
  • the processor may be configured to perform the overwrite operation when the storage space of the memory is equal to or greater than a set size, and to perform the reduction operation when the storage space of the memory is less than a set size.
  • the processor determines whether a security attribute is set in the storage for the database file, and when the security attribute is set in the storage, to apply the security attribute to the entire opened database file can be set.
  • the processor determines whether a security attribute is set in the memory, and when the security attribute is set in the memory, reads the value set in the memory and performs an update corresponding to the security data and the security attribute of the storage has a characteristic that the security attribute is maintained until an application corresponding to the database file is deleted, and the security attribute of the memory is maintained in response to the connection of the database file. It can be set to have the characteristics to be
  • the security attribute may be set to at least one of the entire database file and a table or column of the database file.
  • FIG. 3 is a flowchart 300 illustrating a method of operating an electronic device according to various embodiments of the present disclosure.
  • a processor eg, processor 120 of FIG. 1 of an electronic device (eg, electronic device 101 of FIG. 1 ) according to various embodiments requests an update of security data.
  • the security data means data for which a security attribute is set among application data, and may mean data requiring secure deletion so that the deleted security data does not exist in storage when deleted.
  • the security attribute secures only the specified transaction when the entire database file 251 or a desired area (eg, a specified table and column of the database file 251 of FIG. 2 ) is set by an application developer or when security data update operation is performed It can be set to perform a delete function.
  • the security attribute may be set in memory (eg, volatile memory 132 of FIG. 1 ) or storage (eg, non-volatile memory 134 of FIG. 1 ).
  • the processor 120 may confirm the security data update request by analyzing a query to determine which table or column of the database file 251 changes the security data, or to change or delete a query.
  • the update refers to a transaction, and the transaction may include an operation of reading, adding, deleting, or modifying application data.
  • the update request may be generated by a user or according to a setting of the electronic device 101 .
  • previous security data may not remain in the database file 251 or the WAL file (eg, the additional file 255 of FIG. 2 ).
  • previous security data may remain in the database file 251 or the WAL file.
  • the present invention processes so that the previous security data does not remain in the database file or the WAL file, and operation 301 may include an operation (or transaction) of modifying or deleting the security data.
  • the processor 120 stores the contents of the WAL file in the existing WAL mode (eg, when the update condition of the WAL file is satisfied by adding a frame corresponding to the page requested to be updated to the WAL file). operation of reflecting in the file 251) may be performed.
  • the processor 120 may identify the state of the WAL file corresponding to the security data.
  • a journal technique may be applied to the memory of the electronic device 101 (eg, the memory 130 of FIG. 1 ) to ensure data integrity and transaction atomicity.
  • the journal technique may be a technique to generate and utilize a write ahead log (WAL) file or a rollback journal file as an additional file in addition to a database file for storing application data.
  • the database file eg, the database file 251 of FIG. 2
  • stores application data and may include a database header, a database schema, database contents, or a data structure.
  • the additional file eg, the additional file 255 of FIG.
  • the WAL file may include a WAL header and at least one WAL frame.
  • the WAL header includes basic information about the WAL file. For example, it may include at least one of an identification number, a file format version, a page size, the number of updates, a frame error check, and a WAL header error check.
  • the identification number may include a magic number for recognizing a WAL file.
  • the file format version may have a fixed value as the format version for the WAL file.
  • the database file 251 is managed separately with a predetermined size, and a chunk divided with a predetermined size can be interpreted as a page.
  • the page size may correspond to a page stored in the database file 251 .
  • the number of updates may mean the number of times the frame stored in the WAL file is reflected in the database file. Reflecting the frame stored in the WAL file to the database file 251 may be referred to as an update or checkpoint. Whenever a frame stored in the WAL file is reflected in the database file 251 , the number of updates may increase (eg, +1).
  • the frame error check may mean an arbitrary value (eg, a salt value) generated when the WAL file is initialized.
  • the value included in the frame error check is a value included in the header error check included in the WAL frame
  • the WAL frame may be recognized as a normal frame.
  • the WAL header error check may include a value (eg, checksum) for determining whether there is an error in the WAL header.
  • the information included in the WAL header is an example for helping understanding of the present invention, and does not limit the present invention.
  • the WAL frame may include changes (eg, modification, deletion, addition) of application data stored in the database file 251 .
  • the WAL frame may include a WAL frame header and a page.
  • a frame of the WAL file is mapped to a page stored in the database file 251 , and a page number mapped to the WAL frame header may be recorded.
  • the WAL frame may include at least one of a WAL frame header, a page number, bCommit, a header error check, a WAL frame error check, and a database page.
  • the page number may mean a page number with a change.
  • the bCommit may indicate the size of the database file 251 in the case of a Commit frame, or may be set to 0 in the case of another frame.
  • the WAL frame error check may include a value (eg, checksum) for determining whether there is an error in the WAL frame.
  • the database page may include a page to which changes are reflected.
  • the content included in the WAL frame is an example for helping understanding of the present invention, and does not limit the present invention.
  • the processor 120 adds a frame of the WAL file (eg, a WAL frame) in response to the updated page of the database file 251 .
  • a frame of the WAL file eg, a WAL frame
  • the processor 120 may add a frame including the number of the updated page to the WAL file.
  • the processor 120 receives a frame ( Example: The first frame corresponding to the first page and the second frame corresponding to the third page) may be added to the WAL file.
  • the state of the WAL file may include a state in which the WAL file is valid or invalid.
  • the valid state of the WAL file may mean a state in which the WAL header of the WAL file is valid and at least one WAL frame is included in the WAL file.
  • WAL file invalid status can include at least one of no WAL file, no WAL file size, zero WAL header of WAL file (eg zero filled), or no valid WAL frame. have.
  • the processor 120 may determine different processing processes based on the state of the WAL file. For example, the processor 120 may determine to perform a first secure data processing process when the WAL file is in an invalid state, and determine to perform a second secure data processing process when the WAL file is in a valid state. .
  • the first secure data processing process may be to obtain the update authority of the database file 251, perform an update to the database file 251 without a WAL file, and return the update authority when the update is completed. have.
  • the first secure data processing process will be described in detail below with reference to FIG. 4 .
  • the second secure data processing process acquires the update authority of the database file 251 when the page structure of the database file 251 is not changed and the page to be updated does not exist in the WAL file, and the database file ( 251), and returning the update authority when the update is completed may be performed.
  • the second secure data processing process will be described in detail below with reference to FIG. 6 .
  • the processor 120 may determine to perform the first security processing process or the second security processing process according to the state of the WAL file.
  • the processor 120 may update the security data according to the determined processing process.
  • the processor 120 may perform security data update according to the first security processing process or the second security processing process.
  • the processor 120 may perform a third secure data processing process.
  • the third security data processing process adds a frame corresponding to the updated security data to the WAL file, creates a thread for processing the security data, waits as long as the security data life cycle, and then the database file 251 ) is attempted, and if the update is successful, the WAL file corresponding to the updated security data may be invalidated. If the update fails, the third security data processing process waits until it acquires the update authority, updates the database file 251 based on the WAL file, and then invalidates the WAL file corresponding to the updated security data. It may be to perform an action.
  • FIG. 4 is a flowchart 400 illustrating a method of performing a first secure data processing process in an electronic device according to various embodiments of the present disclosure.
  • FIG. 4 may embody the operation of performing operation 307 of FIG. 3 .
  • the processor 120 of FIG. 1 of the electronic device eg, the electronic device 101 of FIG. 1
  • the processor 120 may directly apply the update corresponding to the security data to the database file (eg, the database file 251 of FIG. 2 ) without the WAL file.
  • the update permission may be required to access the database file 251 .
  • the update permission may mean a file lock set to prevent one or more transactions from simultaneously accessing a database file (eg, the database file 251 of FIG. 2 ).
  • a transaction may include a read transaction (or operation), an add transaction, a modify (or change) transaction, or a delete transaction. If a delete transaction is performed while a read transaction is being performed, an error may occur in the database file 251 .
  • the right to control access to the database file 251 by only one transaction may be interpreted as the update authority.
  • the update right may be included in a WAL index file (eg, the index file 253 of FIG. 2 ).
  • the update authority may mean having full authority corresponding to all transactions (eg, read, add, modify, delete).
  • the processor 120 may determine whether the update authority has been acquired. When performing an update on the security data, the processor 120 may update the security data after acquiring an update authority. The processor 120 may perform operation 405 when obtaining the update authority, and perform FIG. 8 when the update authority is not obtained. FIG. 8 is performed when the first secure data processing process cannot be performed, and may be a third secure data processing process.
  • the processor 120 may perform the update without the WAL file.
  • a journal technique eg, WAL mode
  • the database eg, the database 250 of FIG. 2
  • the journal technique when application data is updated, the update-related processing results before updating the database file 251 . are stored in the WAL file, and if the update condition of the WAL file is satisfied, the contents stored in the WAL file may be reflected in the database file 251 . Even after the contents stored in the WAL file are reflected in the database file 251 , the contents stored in the WAL file may remain without being deleted.
  • the security deletion function prevents the security data from remaining in the WAL file or the database file 251 . may include
  • the processor 120 may use the atomic write mode after converting to the atomic write mode at runtime.
  • the atomic write mode may be a technology that can be used for a write transaction in the electronic device 101 providing a flash friendly file system (F2FS).
  • the atomic write mode may be a mode in which in-place update is possible without a separate WAL file.
  • update-related processing results are stored in the WAL file.
  • the updated application data can be directly reflected in the database file 251 without the WAL file.
  • the processor 120 can directly reflect the update in the database file 251 without a WAL file for security data. .
  • the processor 120 may determine whether the update is complete.
  • the processor 120 may perform operation 407 when the update is completed, and may perform FIG. 8 when the update is not completed.
  • the processor 120 may fail the update by directly reflecting the update to the database file 251 without the WAL file. If the update fails, the processor 120 may perform a third secure data processing process by performing FIG. 8 .
  • the processor 120 may return the update authority.
  • the processor 120 may have the update authority while updating, and return the update authority when the update is completed.
  • the update permission is a full permission to access the database file 251 , and can be returned when the update is completed.
  • FIG. 5 is a diagram illustrating a database structure of an electronic device according to various embodiments of the present disclosure.
  • a database of an electronic device includes a database file 510 (eg, the database file 251 of FIG. 2 ), an index file ( 530) (eg, the index file 253 of FIG. 2 ), and a WAL file 550 (eg, the additional file 255 of FIG. 2 ).
  • the database file 510 , the index file 530 , and the WAL file 550 are based on a file system (eg, the file system 240 of FIG. 2 ), and non-volatile memory (eg, the non-volatile memory (eg, the non-volatile memory) of FIG. 134))).
  • the database file 510 may include at least one page.
  • the size of each of the plurality of files related to the database file 510 may be, for example, 4 KB or more, which is the size of a page.
  • the size of each of the plurality of files may be changed to a value different from the size of a page by the file system 240 and/or a database manager (eg, the database manager 230 of FIG. 2 ).
  • the database file 510 may include a first page 512 , a second page 513 , a third page 514 , and a fourth page 515 .
  • the first page 512 may include a header 511 of the database file 510 and a database schema.
  • the header 511 may include a plurality of parameters indicating properties of the database file 510 .
  • the data structure of the second page 513 to the fourth page 515 may have a data structure for faster data retrieval of the database file 510 .
  • the WAL file 550 may store data changed based on a transaction in the WAL mode. Data included in the WAL file 550 may be distinguished in units of frames. The size of the frame may correspond to a combination of the size of the page and the size of the frame header used to distinguish data and/or information included in the database file 510 .
  • the WAL file 550 may include a header 551 and a plurality of frames (eg, a first frame 552 , a second frame 553 , a third frame 554 , and a fourth frame 555 ). have.
  • the electronic device 101 determines an update condition of the WAL file 550 based on the size of the WAL file 550 and/or the number of a plurality of frames included in the WAL file 550, and when the update condition is satisfied A frame stored in the WAL file 550 may be reflected in a page of the database file 510 .
  • the index file 530 may be used to identify where changed data of the database file 510 stored in the WAL file 550 is located in which part, which file or location of the database file 510 .
  • the index file 530 may include update permission (eg, file lock) to prevent concurrent access to the database file 510 .
  • the index file 530 may include mapping information that matches which page of the database file 510 corresponds to a frame stored in the WAL file 550 .
  • the electronic device 101 may identify that the first page 512 of the database file 510 matches the second frame 553 of the WAL file 550 based on the mapping information.
  • the electronic device 101 identifies that the fourth page 515 corresponds to the third frame 554 and the third page 514 corresponds to the first frame 552 based on the index file 530 . can do.
  • the mapping information may be used when the electronic device 101 changes data of the database file 510 based on the WAL file 550 .
  • the electronic device 101 changes the first page 512 of the database file 510 based on the second frame 553 of the WAL file 550 , and changes the first page 512 of the database file 510 based on the third frame 554 .
  • the fourth page 515 of the database file 510 may be changed, and the third page 514 of the database file 510 may be changed based on the first frame 552 .
  • FIG. 6 is a flowchart 600 illustrating a method of performing a second secure data processing process in an electronic device according to various embodiments of the present disclosure.
  • FIG. 6 may embody the operation of performing operation 307 of FIG. 3 .
  • the processor 120 of FIG. 1 of the electronic device (eg, the electronic device 101 of FIG. 1 ) according to various embodiments generates a database file (eg, FIG. 1 ). It may be determined whether the page structure of the database file 251 of 2) has been changed. When the state of the WAL file is valid, the processor 120 may directly apply the update corresponding to the security data to the database file (eg, the database file 251 of FIG. 2 ) without the WAL file only when a specified condition is satisfied. .
  • the specified condition may include a case in which the page structure of the database file 251 is not changed and a page corresponding to security data does not exist in the WAL file.
  • the processor 120 may determine whether the specified condition is satisfied based on the index file (eg, the index file 530 of FIG. 5 ).
  • the database file 251 is configured in units of pages, and each page may be a node of a B-tree.
  • B-tree is a kind of tree data structure widely used in databases and file systems. By extending a binary tree, the maximum number of child nodes that a node can have is a tree structure that is greater than 2.
  • the B-tree configuration may be changed. For example, when a large number of pages are deleted, a change in the tree structure may occur in order to balance the B tree structure.
  • the operation of changing the tree structure may mean a rebalancing operation.
  • the position of the page corresponding to the node of the B-tree may be changed. Since a frame corresponding to a page of the database file 251 exists in a WAL file (eg, the WAL file 550 of FIG. 5 ), the frame may include a page structure of the database file 251 . When the page structure of the database file 251 is changed, and the processor 120 applies an update to the database file 251 without a WAL file, an error may occur.
  • a WAL file eg. the WAL file 550 of FIG. 5
  • the processor 120 may perform FIG. 8 , and if the page structure of the database file 251 is not changed, the processor 120 may perform operation 603 .
  • the processor 120 may determine whether an updated page exists in the WAL file.
  • the update page (or the latest update page) may refer to a page corresponding to the security data requested to be updated in operation 301 of FIG. 3 .
  • the WAL file may include one or more frames corresponding to one page. For example, after the first frame corresponding to the first page is generated by one transaction, the second frame corresponding to the third page and the third frame corresponding to the first page may be generated by another transaction.
  • the processor 120 updates the frame of the WAL file in the database file 251 , the last stored frame may be reflected.
  • the processor 120 may reflect the third frame to the first page of the database file 251 . For example, if the frame corresponding to the update page already exists in the WAL file, the most recent update is directly reflected in the database file 251 without the WAL file. A problem of reflecting an already existing frame in the database file 251 may occur.
  • the processor 120 may determine whether an update page exists in the WAL file based on mapping information stored in the index file 530 .
  • the processor 120 may perform FIG. 8 , and if the update page does not exist in the WAL file, perform operation 605 .
  • operation 601 is performed first and operation 603 is performed later
  • operation 603 may be performed first and operation 601 may be performed later
  • operation 601 and operation 603 may be performed simultaneously. This is only an example to help the understanding of the invention, but does not limit the present invention.
  • the processor 120 may attempt to acquire update authority.
  • the update permission may mean a file lock set to prevent one or more transactions from simultaneously accessing a database file (eg, the database file 251 of FIG. 2 ).
  • the update right may be included in a WAL index file (eg, the index file 253 of FIG. 2 ).
  • the update authority may mean having full authority corresponding to all transactions (eg, read, add, modify, delete). Since operation 605 is the same as or similar to operation 401 of FIG. 4 , a detailed description thereof may be omitted.
  • the processor 120 may determine whether the update authority has been acquired. When performing an update on the security data, the processor 120 may update the security data after acquiring an update authority. The processor 120 may perform operation 609 when obtaining the update authority, and perform FIG. 8 when the update authority is not obtained. FIG. 8 is performed when the second secure data processing process cannot be performed, and may be a third secure data processing process. Since operation 607 is the same as or similar to operation 403 of FIG. 4 , a detailed description thereof may be omitted.
  • the processor 120 may perform the update without the WAL file. Even after the contents stored in the WAL file are reflected in the database file 251 , the contents stored in the WAL file may remain without being deleted.
  • the second secure data processing (or deletion) process is a secure deletion function to prevent the secure data from remaining in the WAL file or the database file 251 when application data (eg, secure data) having a secure attribute is changed or deleted. may include In the WAL mode, when the content stored in the WAL file meets the update condition, it is reflected in the database file 251, and the processor 120 can directly reflect the update in the database file 251 without a WAL file for security data. . Since operation 609 is the same as or similar to operation 405 of FIG. 4 , a detailed description thereof may be omitted.
  • the processor 120 may determine whether the update is complete.
  • the processor 120 may perform operation 613 when the update is completed, and may perform FIG. 8 when the update is not complete.
  • the processor 120 may fail the update by directly reflecting the update to the database file 251 without the WAL file. If the update fails, the processor 120 may perform a third secure data processing process by performing FIG. 8 . Since operation 611 is the same as or similar to operation 407 of FIG. 4 , a detailed description thereof may be omitted.
  • the processor 120 may return the update authority.
  • the processor 120 may have the update authority while updating, and return the update authority when the update is completed.
  • the update permission is a full permission to access the database file 251 , and can be returned when the update is completed. Since operation 613 is the same as or similar to operation 409 of FIG. 4 , a detailed description thereof may be omitted.
  • FIGS. 7A and 7B are diagrams illustrating examples of a database file and a WAL file according to various embodiments.
  • FIG. 7A is a diagram illustrating a page structure of a database file according to various embodiments of the present disclosure.
  • a database file 700 (eg, the database file 251 of FIG. 2 ) of an electronic device (eg, the electronic device 101 of FIG. 1 ) according to various embodiments includes one or more pages. and each page may be a node of a B-tree.
  • the database file 700 includes a first page 711 , a second page 712 and a third page 713 as child nodes of the first page 711 , and a second page A fourth page 714 and a fifth page 715 may be included as child nodes of the 712 , and a sixth page 716 may be included as a child node of the third page 713 .
  • the update-requested security data may correspond to the fifth page 715 .
  • the electronic device 101 does not change the page structure of the database file 700 while the WAL file (eg, the WAL file 550 of FIG. 5 ) is valid, and the frame corresponding to the fifth page 715 is the WAL file If it does not exist in , a second secure data processing process (eg, flowchart 600 of FIG. 6 ) may be performed.
  • the WAL file eg, the WAL file 550 of FIG. 5
  • the frame corresponding to the fifth page 715 is the WAL file If it does not exist in , a second secure data processing process (eg, flowchart 600 of FIG. 6 ) may be performed.
  • the tree structure of the database file 700 may be changed.
  • the database file 730 in which the tree structure has been changed includes a first page 731 , and includes a fourth page 734 and a sixth page 736 as child nodes of the first page 731 , and , a second page 732 may be included as a child node of the fourth page 734 , and a fifth page 735 and a third page 733 may be included as child nodes of the sixth page 736 .
  • the update-requested security data may correspond to the fifth page 735 .
  • the electronic device 101 may not be able to perform the second secure data processing process.
  • FIG. 7B is a diagram illustrating an internal structure of a WAL file according to various embodiments.
  • the database file 710 may include a first page 711 , a second page 712 , a third page 713 , a fourth page 714 , and a fifth page 715 . have.
  • the database file 710 of FIG. 7B may have a page structure of the database file 700 of FIG. 7A .
  • the update-requested security data may correspond to the fifth page 715 .
  • the WAL file 750 is in a valid state, and the WAL header 751, the third A first frame 752 corresponding to the page 713 and a second frame 755 corresponding to the second page 712 may be added.
  • the first frame 752 may include a change 754 corresponding to the WAL frame header 753 and the third page 713 .
  • the second frame 755 may include a change 757 corresponding to the WAL frame header 756 and the second page 712 . Since the electronic device 101 does not change the page structure of the database file 710 while the WAL file 750 is valid, and a frame corresponding to the fifth page 715 requested to be updated does not exist in the WAL file 750 . , the second secure data processing process may be performed.
  • a first frame 752 corresponding to the third page 713 and a second frame 755 corresponding to the fifth page 715 may be added.
  • the first frame 752 may include a change 754 corresponding to the WAL frame header 753 and the third page 713 .
  • the second frame 755 may include a change 772 corresponding to the WAL frame header 771 and the fifth page 715 .
  • the electronic device 101 does not change the page structure of the database file 710 while the WAL file 750 is valid, but a frame corresponding to the fifth page 715 requested to be updated in the WAL file 750 (eg: If the second frame 755 is present, the second secure data processing process may not be performed.
  • FIG. 8 is a flowchart 800 illustrating a method of performing a third secure data processing process in an electronic device according to various embodiments of the present disclosure.
  • FIG. 8 may embody the operation of performing operation 307 of FIG. 3 .
  • the processor eg, the processor 120 of FIG. 1
  • the electronic device eg, the electronic device 101 of FIG. 1
  • Corresponding frames can be added.
  • a WAL file corresponding to the security data eg, : In order to delete the WAL file 770 of FIG. 7B
  • an operation of reflecting the frame stored in the WAL file to the database file eg, the database file 710 of FIG.
  • the processor 120 may add a frame corresponding to the secure data to the WAL file according to a conventional journal technique.
  • the update-requested security data may correspond to a fifth page (eg, a fifth page 715 of FIG. 7B ) of the database file 710.
  • the processor 120 stores the fifth page in the WAL file.
  • a frame corresponding to 715 may be added.
  • the processor 120 may create a thread for processing secure data.
  • the processor 120 may create a thread corresponding to the requested update.
  • the processor 120 may create a separate thread other than the thread corresponding to the requested update.
  • the generated thread may be a thread operating in the background.
  • the processor 120 may determine whether a life cycle is set in the security data. Logic to delete secure data may incur additional overhead compared to WAL mode operation. The processor 120 may set the life cycle so that the secure data deletion is performed within a predetermined time without immediately removing the secure data in order to reduce the overhead.
  • the life cycle may be set in storage or memory. The value set in the memory may be deleted when the connection of the database file 251 is terminated, like the volatile memory (eg, the volatile memory 132 of FIG. 1 ).
  • the life cycle may be set by an application developer.
  • the application layer eg, application
  • the life cycle may be set in various ways according to the provision of the framework.
  • the life cycle may be set in the database file 251 , a designated table of the database 250 , and a designated column of the database 250 using an application programming interface (API) or SQL syntax.
  • API application programming interface
  • the life cycle may be set through secure write transaction execution using API statements or secure write transaction execution using SQL statements.
  • the processor 120 may perform operation 807 if a life cycle is set in the security data, and may perform operation 809 if the life cycle is not set in the security data.
  • the processor 120 may wait as long as the life cycle time. If the update of the security data occurs repeatedly within a short time, an additional process may be required due to the repetitive checkpoint operation. The processor 120 may wait as long as the life cycle time so as not to repeatedly perform the checkpoint operation.
  • the processor 120 may attempt to reflect the contents of the WAL file to the database file 710 (eg, a checkpoint operation).
  • a checkpoint operation the processor 120 determines whether an update condition of the WAL file is satisfied after the life cycle elapses, and when the update condition is satisfied, obtains an update authority for the database file Thus, the checkpoint operation may be attempted.
  • the processor 120 determines whether an update condition of the WAL file is satisfied, and when the update condition is satisfied, obtains an update authority for the database file to perform the checkpoint operation can try
  • the update condition of the WAL file may be that the size of the WAL file corresponds to a set size, or the number of frames included in the WAL file corresponds to a set number. Since the size per frame is limited, when the number of frames corresponds to the set number, the size of the WAL file may be interpreted as corresponding to the set size.
  • it may be necessary to wait until all currently operated transactions (eg, read, add, modify, delete) are terminated and update permission is acquired.
  • the checkpoint operation attempted in operation 809 may fail as a read transaction occurs.
  • the processor 120 may determine whether the update is successful. When the processor 120 attempts the checkpoint operation after all transactions are completed, the update may be successful. The processor 120 may perform operation 819 if the update is successful, and may perform operation 813 if the update fails.
  • the processor 120 may determine whether a set condition is satisfied.
  • the set condition may include a set time or a set number of times (eg, 3 times, 5 times, 10 times) based on the life cycle. For example, the processor 120 may attempt the checkpoint operation for twice the life cycle time, and when twice the life cycle time has elapsed, it may be determined that the set condition is satisfied.
  • the processor 120 may count the number of times the checkpoint operation is attempted, and when the counted number exceeds the set number, it may be determined that the set condition is satisfied. If the set condition is satisfied, the processor 120 may perform operation 815 , and if the set condition is not satisfied, the processor 120 may return to operation 809 . If the set condition is not satisfied, the processor 120 may return to operation 809 to repeat the checkpoint operation for a predetermined number of times.
  • the processor 120 may wait until an update right is acquired. In order to perform the checkpoint operation without failure, it may be necessary to wait until all currently operating transactions are terminated and update authority is acquired.
  • the processor 120 may update the database file 710 based on the WAL file 770 by acquiring the update authority. Operation 817 may perform a checkpoint operation by acquiring the update permission, and operation 809 may attempt a checkpoint operation regardless of whether the update permission is acquired.
  • the processor 120 may reflect the frame stored in the WAL file 770 to the database file 710 . For example, the processor 120 reflects the first frame 752 stored in the WAL file 770 in the third page 713 of the database file 710, and the second frame 752 stored in the WAL file 770 ( 755 ) may be reflected in the fifth page 715 of the database file 710 .
  • the processor 120 may invalidate the WAL file corresponding to the security data.
  • the operation of invalidating the WAL file may include deleting the WAL file corresponding to the security data after the checkpoint operation is successful.
  • the operation of invalidating the WAL file may include an operation of reducing the size of the WAL file to zero (truncate) or an operation of overwriting a frame of the WAL file corresponding to security data with zero.
  • the processor 120 may perform any one of a reduction operation or an overwrite operation based on the storage space of the memory of the electronic device 101 (eg, the memory 130 of FIG. 1 ).
  • the reducing operation may reduce the size of the WAL file to 0, and the overwriting operation may include overwriting a frame of the WAL file corresponding to the security data with 0 while maintaining the size of the WAL file.
  • the storage space of the memory 130 may mean a free space that can be stored in the memory 130 .
  • the processor 120 may perform an overwrite operation when the storage space of the memory 130 is equal to or greater than a set size, and may perform a reduction operation when the storage space of the memory 130 is less than the set size.
  • 9A is a flowchart 900 illustrating a method of setting security data in an electronic device according to various embodiments of the present disclosure.
  • the processor eg, the processor 120 of FIG. 1
  • the electronic device eg, the electronic device 101 of FIG. 1
  • the processor generates a database file (eg, FIG. 1 ) 2, the database file 251) can open a connection.
  • an application or update eg, read, add, modify, or delete
  • the processor 120 may determine whether a security attribute is set in the memory for the opened database file 251 .
  • Security can be set for the entire database file 251 , a specified table of the database file 251 , or a specified column of the database file 251 .
  • the application developer may assign security attributes to the entire database file 251 , a specified table of the database file 251 , or a specified column of the database file 251 .
  • the security attribute may be updated in a memory (eg, the volatile memory 132 of FIG. 1 ) or stored in a storage (eg, the non-volatile memory 134 of FIG. 1 ) according to a value set by the application developer.
  • the processor 120 may perform operation 905 when security is set in memory for the opened database file 251 , and may perform operation 907 when security is not set in memory with respect to the open database file 251 . .
  • the processor 120 sets the entire open database file 251 or a set area (eg, a designated table of the database file 251) in the memory.
  • a security attribute may be applied to a designated column of the database file 251).
  • the processor 120 may apply a security attribute to be set in table 1 (eg, SQLiteDatabase. openDatabase(secure_data: table1)) of the database file 251 .
  • the security attribute may be stored in a designated location in memory. The storage location may vary depending on the type of security attribute set (eg, the entire database file 251, a specified table, and a specified column of the table).
  • the processor 120 may determine whether it is set in the storage. The processor 120 may perform operation 911 if it is set in the storage, and may perform FIG. 9B if it is not set in the storage.
  • the processor 120 in the storage in the entire database file 251 opened in the storage or a set area (eg, a specified table of the database file 251 or the database file 251)
  • Security attributes can be applied to the specified column). If the security attribute is maintained only in memory, the security attribute must be set again whenever a connection of the database file 251 is newly created. Also, the setting of the security attribute may be different in various connections of the database file 251 .
  • the set security attribute may be shared by all connections to the database file 251 , and may be valid until the set target (eg, application) is deleted.
  • a method of setting the security attribute in the storage there may be a method of writing the corresponding information in a designated location of an existing database file (eg, a database header), or a method of storing the corresponding information in a new file.
  • 9B is a flowchart 950 illustrating a method of setting security data in an application layer of an electronic device according to various embodiments of the present disclosure.
  • the processor 120 may set security data through a write transaction. If you do not set the security attribute on storage or memory, you can set the current write transaction to proceed as a secure write transaction.
  • the write transaction may correspond to a transaction for updating or deleting.
  • the secure write transaction may be to delete secure data.
  • the application layer (or application) may be able to set the setting unit or setting timing (eg, life cycle) of the security attribute.
  • the setting unit may include at least one of the entire database file 251 , a designated table of the database file 251 , or a designated column of the database file 251 .
  • the processor 120 may set a security attribute in the database file 251 .
  • the processor 120 may set a security attribute in the connection to the database file 251 before the start of the write transaction.
  • the processor 120 may set a security attribute in the database file 251 .
  • the processor 120 may perform a write transaction.
  • the application layer (or application) may perform a secure delete function when the user calls the corresponding API.
  • the processor 120 may execute a secure write transaction using an API syntax such as SQLiteDatabase.secure_delete().
  • Security settings apply security attributes to the entire database file (251) or to a set area (such as a specified table in the database file (251) (such as SQLiteDatabase.setSecureData("table name”)) or a specified column in the database file 251). can be applied.
  • the processor 120 may add a reserved word to the query.
  • the reserved words may be such as update and delete.
  • the secure delete function is implemented. can be set.
  • the secure deletion function can be set by composing SQL by inserting a phrase (eg, by Secure Transaction) related to the security attribute in the last position related to the transaction.
  • the application layer eg, application
  • security attributes in a specific range (eg, add SECURE_DATA Constraint at CREATE TABLE) using SQL statements.
  • Security settings may apply security attributes to the entire database file 251 or a set area (eg, a specified table of the database file 251 or a specified column of the database file 251 ).
  • the application layer eg, an application
  • An application can set security on a column of the database file 251 with "CREATE TABLE table1 (a SECURE_DATA TEXT ...)".
  • Write transactions can be executed. The corresponding delete operation may be performed as a secure write transaction.
  • the processor 120 may set the secure data not to be used. For example, the processor 120 may cancel the security attribute setting when the write transaction is completed.
  • FIG. 10 is a flowchart 1000 illustrating another operating method of an electronic device according to various embodiments of the present disclosure.
  • FIG. 10 may include an operation when the additional file (eg, the additional file 255 of FIG. 2 ) is a rollback journal file.
  • a processor eg, the processor 120 of FIG. 1 of an electronic device (eg, the electronic device 101 of FIG. 1 ) according to various embodiments requests an update of security data.
  • the security data means security-set data among application data, and the entire database file 251 or a desired area (eg, a designated table and column of the database file 251 of FIG. 2 ) is set by an application developer, or security
  • data update When data update is performed, it can be set to perform a secure delete function only for a specified transaction.
  • the update refers to a transaction, and the transaction may include an operation of reading, adding, deleting, or modifying application data.
  • the update request may include an operation of modifying or deleting security data.
  • the processor 120 may determine whether the rollback journal mode is the persist mode.
  • the persist mode can be a mode that invalidates only the header file among the rollback journal files created for the transaction. If only the header part is deleted, security data may remain in the rollback journal file.
  • the processor 120 may perform operations 1003 to 1007 below.
  • the processor 120 performs an operation of the existing rollback journal mode (eg, rollbacks the application data stored in the database file 251 before updating) in response to a request for update of application data other than the persist mode or the rollback journal mode of the rollback journal mode or security data. After backing up to a journal file and updating the database file 251, an operation of invalidating the rollback journal file) may be performed.
  • the processor 120 may back up the original application data to a rollback journal file (or an additional file) based on the update request.
  • the journal technique may be a technique for generating and utilizing a rollback journal file (eg, an additional file 255 of FIG. 2 ) in addition to a database file (eg, the database file 251 of FIG. 2 ) storing application data.
  • the additional file is a rollback journal file
  • the processor 120 may back up the application data stored in the database file 251 to the rollback journal file before updating the database file 251 .
  • the processor 120 may update the database file 251 . Updating the database file 251 is a checkpoint operation, and may mean reflecting changes in the database file 251 according to an update request. When the additional file is a rollback journal file, the processor 120 may update the database file 251 whenever an update request is made.
  • the processor 120 may invalidate the rollback journal file corresponding to the security data.
  • the operation of invalidating the rollback journal file may include deleting the rollback journal file corresponding to the security data after the checkpoint operation is successful.
  • the operation of invalidating the rollback journal file may include an operation of reducing the size of the rollback journal file to zero (truncate) or an operation of overwriting the rollback journal file corresponding to security data with zero.
  • the processor 120 may perform any one of a reduction operation or an overwrite operation based on the storage space of the memory of the electronic device 101 (eg, the memory 130 of FIG. 1 ).
  • the reducing operation may reduce the size of the rollback journal file to 0, and the overwriting operation may include overwriting the rollback journal file corresponding to the security data with 0 while maintaining the size of the rollback journal file.
  • the storage space of the memory 130 may mean a free space that can be stored in the memory 130 .
  • the processor 120 may perform an overwrite operation when the storage space of the memory 130 is equal to or greater than a set size, and may perform a reduction operation when the storage space of the memory 130 is less than the set size.
  • FIG. 11 is a flowchart 1110 illustrating a method of setting security data in an application layer of an electronic device according to various embodiments of the present disclosure.
  • the processor determines whether a secure write transaction is can
  • the secure write transaction may be to delete secure data.
  • the processor 120 may perform operation 1103 if it is a secure write transaction, and may perform operation 1105 if it is not a secure write transaction.
  • operation 1101 is performed first and operation 1105 is performed later, operation 1105 may be performed before operation 1101 or operation 1101 and operation 1105 may be performed simultaneously.
  • operation 1105 may be performed before operation 1101 or operation 1101 and operation 1105 may be performed simultaneously. This is merely an example, and the present invention is not limited by the description.
  • the processor 120 may execute a secure write transaction using an API statement or an SQL statement.
  • the application layer eg the application
  • the application layer can execute a secure write transaction using SQL statements such as SECURE_DATA DELETE data from table1.
  • the processor 120 may determine whether it is a security setting through an API.
  • the processor 120 may perform operation 1107 in the case of security setting through the API, and may perform operation 1109 if the security setting is not through the API.
  • the processor 120 may set security in a designated area using the API.
  • the application layer e.g. application
  • a security attribute can be set on a specified table or a specified column of the database file 251).
  • the processor 120 may set security in a designated area using an SQL syntax.
  • the application layer eg application
  • Properties can be set, for example, the application layer (eg, application) adds a SECURE_DATA constraint when CREATE TABLE, and secures the specified table (eg, table 1) in the database file 251, such as CREATE SECURE_DATA TABLE table1.
  • the processor 120 may set the life cycle in the same manner as in FIG. 11 .
  • the application layer eg, application
  • the life cycle may be set in the database file 251 , a designated table of the database 250 , and a designated column of the database 250 using API or SQL syntax.
  • the life cycle may be set through secure write transaction execution using API statements or secure write transaction execution using SQL statements.
  • a method of operating an electronic device includes an operation of receiving a request to update security data in which a security attribute is set among application data, and a state of an additional file corresponding to the security data. determining a first secure data processing process when the status of the identified additional file is invalid, and performing a second secure data processing process when the status of the identified additional file is valid. determining, and updating the security data according to the determined security data processing process.
  • the first secure data processing process includes an operation of acquiring an update permission of a database file stored in the memory, an operation of updating the database file in response to the security data without the additional file, and the update permission when the update is completed may include an operation to return
  • the second secure data processing process includes an operation of determining a change in the page structure of the database file stored in the memory, and when the page structure is not changed, determining whether a page corresponding to the secure data exists in the additional file determining, if the page corresponding to the security data does not exist in the additional file, acquiring an update right of the database file, updating the database file in response to the security data without the additional file; and returning the update authority when the update is completed.
  • the performing may further include performing a third secure data processing process when the first secure data processing process or the second secure data processing process fails.
  • the third security data processing process includes an operation of adding a frame corresponding to the security data to the additional file, an operation of creating a thread for processing the security data, and when a life cycle is set in the security data, the life cycle waits for the update operation for as long as, after the life cycle has elapsed, it is determined whether the update condition of the additional file is satisfied, and if the update condition is satisfied, the update authority for the database file is obtained In response to an operation of attempting to update the database file in response to, when a life cycle is not set in the security data, it is determined whether an update condition of the additional file is satisfied, and when the update condition is satisfied, the database file and attempting to update the database file in response to the security data by obtaining an update right for the .
  • the invalidating operation may include reducing the size of the additional file corresponding to the security data based on the storage space of the memory, or performing any one of an operation of overwriting a frame of the additional file to add the additional file. It may include actions that invalidate the file.
  • the operation of determining whether a security attribute is set in the storage for the database file when the database file stored in the memory is opened, the operation of determining whether a security attribute is set in the storage for the database file, if the security attribute is set in the storage, the security attribute is applied to the entire opened database file operation, when the security attribute is not set in the storage, the operation of determining whether the security attribute is set in the memory, and when the security attribute is set in the memory, read the value set in the memory and update corresponding to the security data
  • the method further includes performing an operation, wherein the security attribute of the storage has a characteristic that the security attribute is maintained until an application corresponding to the database file is deleted, and the security attribute of the memory corresponds to the connection of the database file. Thus, the security attribute may be maintained.
  • the electronic device may have various types of devices.
  • the electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device.
  • a portable communication device eg, a smart phone
  • a computer device e.g., a smart phone
  • a portable multimedia device e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a camera e.g., a portable medical device
  • a wearable device e.g., a smart bracelet
  • a home appliance device e.g., a home appliance
  • first”, “second”, or “first” or “second” may simply be used to distinguish the component from other such components, and refer to those components in other aspects (e.g., importance or order) is not limited. It is said that one (eg, first) component is “coupled” or “connected” to another (eg, second) component, with or without the terms “functionally” or “communicatively”. When referenced, it means that one component can be connected to the other component directly (eg by wire), wirelessly, or through a third component.
  • module used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logic block, component, or circuit.
  • a module may be an integrally formed part or a minimum unit or a part of the part that performs one or more functions.
  • the module may be implemented in the form of an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • Various embodiments of the present document include one or more instructions stored in a storage medium (eg, internal memory 136 or external memory 138) readable by a machine (eg, electronic device 101).
  • a storage medium eg, internal memory 136 or external memory 138
  • the processor eg, the processor 120
  • the device eg, the electronic device 101
  • the one or more instructions may include code generated by a compiler or code executable by an interpreter.
  • the device-readable storage medium may be provided in the form of a non-transitory storage medium.
  • 'non-transitory' only means that the storage medium is a tangible device and does not contain a signal (eg, electromagnetic wave), and this term is used in cases where data is semi-permanently stored in the storage medium and It does not distinguish between temporary storage cases.
  • a signal eg, electromagnetic wave
  • the method according to various embodiments disclosed in this document may be provided as included in a computer program product.
  • Computer program products may be traded between sellers and buyers as commodities.
  • the computer program product is distributed in the form of a machine-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play Store TM ) or on two user devices ( It can be distributed (eg downloaded or uploaded) directly, online between smartphones (eg: smartphones).
  • a portion of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium such as a memory of a server of a manufacturer, a server of an application store, or a memory of a relay server.
  • each component eg, a module or a program of the above-described components may include a singular or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. have.
  • one or more components or operations among the above-described corresponding components may be omitted, or one or more other components or operations may be added.
  • a plurality of components eg, a module or a program
  • the integrated component may perform one or more functions of each component of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. .
  • operations performed by a module, program, or other component are executed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations are executed in a different order, or omitted. , or one or more other operations may be added.

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)
  • Computer Security & Cryptography (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Mathematical Physics (AREA)
  • Human Computer Interaction (AREA)
  • Virology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Communication Control (AREA)

Abstract

본 발명의 다양한 실시 예들은 디스플레이, 메모리, 및 상기 디스플레이 또는 상기 메모리와 작동적으로 연결된 프로세서를 포함하고, 상기 프로세서는, 어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받고, 상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하고, 상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하거나, 또는 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하고, 상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하도록 설정된 방법 및 장치에 관하여 개시한다. 다양한 실시 예들이 가능하다.

Description

보안 데이터 처리 방법 및 장치
본 발명의 다양한 실시예들은 보안 데이터 처리 방법 및 장치에 관하여 개시한다.
디지털 기술의 발달과 함께 이동통신 단말기, PDA(personal digital assistant), 전자수첩, 스마트 폰, 태블릿 PC(personal computer), 또는 웨어러블 디바이스(wearable device)와 같은 다양한 유형의 전자 장치가 널리 사용되고 있다. 이러한, 전자 장치는 기능 지지 및 증대를 위해, 전자 장치의 하드웨어적인 부분 및/또는 소프트웨어적인 부분이 지속적으로 개량되고 있다.
한편, 전자 장치는 어플리케이션의 정상적인 동작을 위해, 데이터베이스에 저장된 어플리케이션 데이터에 대한 트랜잭션(transaction)의 원자성(atomicity) 및 데이터베이스에 항상 정상적인 데이터를 유지하는 데이터 무결성(data integrity)을 보장할 필요가 있다. 트랜잭션이란 어플리케이션(또는 어플리케이션 데이터)의 수정, 삭제, 추가와 같은 업데이트 동작을 포함할 수 있다. 원자성이란, 하나의 트랜잭션과 관련된 모든 연산들의 결과를 데이터베이스에 모두 반영하거나, 전혀 반영하지 않는 것을 의미할 수 있다. 데이터베이스는 데이터 무결성과 트랜잭션의 원자성을 보장하기 위해, 저널 기법을 사용할 수 있다. 저널 기법은 어플리케이션 데이터를 저장하는 데이터베이스 파일 외에 WAL(write ahead log) 파일 또는 롤백 저널(rollback journal) 파일을 생성하여 활용하는 기법일 수 있다.
WAL 저널 모드는 데이터베이스 파일의 업데이트가 발생하면, 데이터베이스 파일을 업데이트하기 전에 업데이트와 관련된 처리 결과를 WAL 파일에 저장할 수 있다. 예를 들어, 데이터베이스 파일의 특정 페이지를 업데이트하는 경우, 특정 페이지에 관련된 업데이트 처리 결과가 WAL 파일에 덧붙여지는 형태로 기록될 수 있다. 업데이트 처리 결과가 WAL 파일에 덧붙여지는 형태로 기록됨으로써, 삭제 요청된 데이터가 데이터베이스 파일이나 WAL 파일에 여전히 남아있을 수 있다.
다양한 실시예들에서는, 데이터베이스 파일에 저장된 데이터 중 보안 데이터의 업데이트(예: 수정, 삭제) 발생시, 업데이트된 보안 데이터가 데이터베이스 파일 또는 WAL 파일에 남아있지 않도록 처리하는 방법 및 장치에 관하여 개시할 수 있다.
본 발명의 다양한 실시예들에 따른 전자 장치는 디스플레이, 메모리, 및 상기 디스플레이 또는 상기 메모리와 작동적으로 연결된 프로세서를 포함하고, 상기 프로세서는, 어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받고, 상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하고, 상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하거나, 또는 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하고, 상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하도록 설정될 수 있다.
본 발명의 다양한 실시예들에 따른 전자 장치의 동작 방법은 어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받는 동작, 상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하는 동작, 상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하고, 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하는 동작, 및 상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하는 동작을 포함할 수 있다.
다양한 실시예들에 따르면, 업데이트된 보안 데이터가 데이터베이스 파일 또는 WAL 파일에 남아있지 않도록 처리함으로써, 보안 이슈를 해결할 수 있다.
다양한 실시예들에 따르면, 업데이트된 보안 데이터에 대응하는 WAL 파일의 상태에 기반하여 처리 프로세스를 다르게 적용함으로써, 보안 데이터에 대응하는 데이터베이스 파일 또는 WAL 파일내의 페이지들을 안전하게 삭제할 수 있다.
다양한 실시예들에 따르면, 보안 데이터에 대응하는 데이터베이스 파일 또는 WAL 파일 내의 페이지들을 전자 장치에서 완전히 삭제함으로써, 추후 포렌식(forensic) 기법에 의해 삭제된 보안 데이터가 복원되지 않도록 할 수 있다.
다양한 실시예들에 따르면, 데이터베이스 전체 또는 지정된 영역(예: 테이블, 컬럼)에 대하여 보안 속성을 설정하거나, SQL 구문을 이용하여 특정 범위에 보안 속성을 설정하거나, API(application programming interface) 구문을 이용하여 보안 쓰기 트랜잭션을 실행하거나, 전자 장치의 메모리 또는 스토리지에 대하여 보안 속성을 설정함으로써, 보안 속성으로 설정된 데이터의 업데이트 시 삭제 처리할 수 있다.
다양한 실시예들에 따르면, 보안 데이터에 대응하는 데이터베이스 파일 또는 WAL 파일 삭제에 의해 발생하는 성능 저하 또는 전자 장치의 메모리 사용에 관한 비효율적인 로직을 감소시킬 수 있다.
도 1은 다양한 실시예들에 따른 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 다양한 실시예들에 따른 전자 장치의 프로그램 블록도를 도시한 도면이다.
도 3은 다양한 실시예들에 따른 전자 장치의 동작 방법을 도시한 흐름도이다.
도 4는 다양한 실시예들에 따른 전자 장치에서 제1 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도이다.
도 5는 다양한 실시예들에 따른 전자 장치의 데이터베이스 구조를 도시한 도면이다.
도 6은 다양한 실시예들에 따른 전자 장치에서 제2 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도이다.
도 7a 및 도 7b는 다양한 실시예들에 따른 데이터베이스 파일과 WAL 파일의 예시를 도시한 도면들이다.
도 8은 다양한 실시예들에 따른 전자 장치에서 제3 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도이다.
도 9a 및 도 9b는 다양한 실시예들에 따른 전자 장치에서 보안 데이터를 설정하는 방법을 도시한 흐름도이다.
도 10은 다양한 실시예들에 따른 전자 장치의 다른 동작 방법을 도시한 흐름도이다.
도 11은 다양한 실시예들에 따른 전자 장치의 응용계층에서 보안 데이터를 설정하는 방법을 도시한 흐름도이다.
도 1은 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다.
도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108) 중 적어도 하나와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.
프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.
보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능 모델이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.
메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다.
프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다.
입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다.
음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.
디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다.
오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.
센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다.
인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.
연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.
햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.
카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.
전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.
배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.
통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제1 네트워크(198) 또는 제2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다.
무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.
안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제1 네트워크(198) 또는 제2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다.
다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.
상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.
일실시예에 따르면, 명령 또는 데이터는 제2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다.
도 2는 다양한 실시예들에 따른 전자 장치의 프로그램 블록도를 도시한 도면이다.
도 2를 참조하면, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))는 전자 장치(101)와 관련된 자원을 제어하는 운영 체제(operating sys-tem(OS)), 미들웨어 또는 상기 운영 체제 상에서 구동되는 다양한 어플리케이션(예: 어플리케이션(210))을 포함하는 프로그램(140)을 포함할 수 있다. 운영 체제는, 예를 들면, 안드로이드(android), iOS, 윈도우즈(windows), 심비안(symbian), 타이젠(tizen), 또는 바다(bada)와 같은 운영 체제일 수 있다. 프로그램(140)의 적어도 일부는 전자 장치(101) 상에 프리로드(preload) 되거나, 외부 전자 장치(예: 전자 장치(102, 104), 또는 서버(108))로부터 다운로드(download) 가능하다.
프로그램(140)은 어플리케이션(210), 데이터베이스 프레임워크(220), 데이터베이스 매니저(230), 파일 시스템(240) 또는 데이터베이스(250)를 포함할 수 있다. 어플리케이션(210)은 전자 장치(101)에 설치된 다양한 종류의 어플리케이션(예: 전화, 문자, 알람, 연락처)을 포함할 수 있다. 데이터베이스 프레임워크(220)는 어플리케이션(210)이 공통적으로 필요로 하는 기능을 제공하거나, 어플리케이션(210)이 전자 장치(101) 내부의 제한된 시스템 자원을 효율적으로 사용할 수 있도록 다양한 기능들을 어플리케이션(210)으로 제공할 수 있다. 데이터베이스 매니저(230)는 전자 장치(101)의 하나 이상의 리소스들로부터 제공되는 기능 또는 정보가 어플리케이션(210)에 의해 사용될 수 있도록 다양한 기능들을 어플리케이션(210)으로 제공할 수 있다. 파일 시스템(240)은 운영 체제에서 보조 기억 장치 또는 데이터베이스(250)(예: 도 1의 메모리(130))에 저장된 파일을 관리하는 시스템을 의미할 수 있다. 데이터베이스(250)는 데이터베이스 파일(251), 인덱스 파일(253) 또는 부가 파일(255)을 포함할 수 있다.
다양한 실시예들에 따르면, 데이터베이스(250)는 관계형 데이터베이스(rdb, relational database), NoSQL(not only sql), 계층형 데이터베이스, 및/또는 네트워크형 데이터베이스를 포함할 수 있다. 예를 들어, 데이터베이스(250)는 Oracle, MySQL(oracle), MS-SQL(microsoft), DB2, Infomix(IBM), Maria DB(sun microsystems), Derby(aqpache), 및/또는 SQLite(opensource)를 포함할 수 있다.
다양한 실시예들에 따르면, 전자 장치(101)는 파일 시스템(240)에 기반하여, 예를 들어, 비휘발성 메모리(134)에 기반하는 스토리지에 저장된 데이터를 관리할 수 있다. 예를 들어, 전자 장치(101)는 파일 시스템(240)을 이용하여 데이터베이스 파일(251)의 데이터(예: 파일)가 저장된 위치를 관리할 수 있다. 파일 시스템(240)은 운영 체제(142)에 포함될 수 있다. 전자 장치(101)는 메모리(130)의 휘발성 메모리(132) 및/또는 비휘발성 메모리(134) 중 적어도 일부를 스토리지로 설정할 수 있다. 스토리지는 전자 장치(101)와 관련된 데이터가 보존되는 저장 영역에 대응할 수 있다. 이하에서는, 메모리는 상기 스토리지 영역과 구별되는 휘발성 메모리(132) 및/또는 비휘발성 메모리(134)의 일부분을 의미할 수 있다. 예를 들어, 메모리는 전자 장치(101)와 관련된 데이터를 처리하기 위한 작업 영역에 대응할 수 있다.
다양한 실시예들에 따른 전자 장치(101)는 데이터베이스 파일(251)에 기반하여, 어플리케이션(146)과 관련된 데이터를 관리할 수 있다. 데이터베이스 파일(251)은 체계화된 데이터의 집합으로, 지정된 리스트 또는 데이터 구조에 기반하여, 스토리지 내에 저장된 데이터의 집합을 의미할 수 있다. 전자 장치(101) 내에 설치된 어플리케이션 및 서비스는 데이터베이스 파일(251)에 기반하여 작동할 수 있다. 이 경우, 전자 장치(101)가 작동하는 상태에서, 서로 다른 복수의 어플리케이션들 및 서비스에 의한 데이터베이스 파일(251)의 접근이 빈번하게 발생될 수 있다. 전자 장치(101)의 스토리지 내에 저장된 데이터베이스 파일(251)의 개수는 복수 개일 수 있다.
다양한 실시예들에 따르면, 데이터베이스(250)에는 데이터 무결성과 트랜잭션의 원자성을 보장하기 위해, 저널 기법이 적용될 수 있다. 저널 기법은 어플리케이션 데이터를 저장하는 데이터베이스 파일(251) 외에 부가 파일(255)을 생성하여 활용하는 기법일 수 있다. 데이터베이스 파일(251)은 어플리케이션 데이터가 저장되며, 데이터베이스 헤더, 데이터베이스 스키마, 데이터베이스 내용 또는 자료 구조로 구성될 수 있다. 부가 파일(255)은 WAL(write ahead log) 파일 또는 롤백 저널(rollback journal) 파일을 포함할 수 있다. 예를 들어, WAL 파일은 어플리케이션 데이터의 업데이트가 발생하면, 데이터베이스 파일(251)을 업데이트하기 전에 업데이트와 관련된 처리 결과들이 저장될 수 있다. WAL 파일의 업데이트 조건에 해당되면, WAL 파일에 저장된 내용이 데이터베이스 파일에 반영될 수 있다. 예를 들어, 롤백 저널 파일은 어플리케이션 데이터의 업데이트가 발생하면, 데이터베이스 파일을 업데이트하기 전에 원본 어플리케이션 데이터가 저장될 수 있다. 롤백 저널 파일은 어플리케이션 데이터를 백업한 것일 수 있다. WAL 파일과 롤백 저널 파일은 저장하는 데이터가 상이할 뿐, 데이터베이스 파일을 업데이트하는 방식이 유사할 수 있다.
다양한 실시예들에 따르면, 데이터베이스 매니저(230)는 어플리케이션 데이터의 업데이트(예: 수정, 삭제, 추가)가 발생하면, WAL 파일에 업데이트와 관련된 내용을 프레임 형태로 추가할 수 있다. 트랜잭션은 데이터베이스 파일(251)의 데이터와 관련된 동작들의 논리적 작업 단위(LUW, Logical Units of Work)로, 어플리케이션(146) 및 데이터베이스 파일(251)사이의 상호 작용의 단위일 수 있다. 데이터베이스 파일(251)의 데이터와 관련된 동작은, 예를 들어, OPEN, SELECT, INSERT, DELETE, UPDATE, CLOSE와 같은 질의어(structured query Language, SQL)에 기반하여, 데이터베이스 파일(251)에 접근하는 동작을 의미할 수 있다. 일 실시예에서, 하나의 트랜잭션은 데이터베이스 파일(251)의 데이터와 관련된 하나 이상의 동작 및/또는 질의어의 집합을 의미할 수 있다. 일 실시예에서, 트랜잭션 동작은 읽기 트랜잭션(또는 동작), 추가 트랜잭션, 수정(또는 변경) 트랜잭션 또는 삭제 트랜잭션을 포함할 수 있다.
인덱스 파일(253)은 부가 파일(255)에 저장된 결과 및 데이터베이스 파일(251)의 부분의 매핑 정보를 저장하는 파일(예: WAL 인덱스 파일)일 수 있다. 일 실시예에서, 상기 매핑 정보는 부가 파일(255)에 저장된 결과가 데이터베이스 파일(251)의 어느 부분에 포함되어야 하는지를 나타낼 수 있다. 예를 들어, 상기 매핑 정보는 부가 파일(255)에 저장된 변경된 데이터 및 상기 데이터와 관련된 데이터베이스 파일(251)의 일부분의 위치를 매칭한 정보일 수 있다. 데이터베이스 파일(251) 내에 저장된 데이터는, 예를 들어, 지정된 크기(예를 들어, 512 Byte 내지 64 MByte 사이의 크기)를 가지는 페이지 단위에 기반하여 관리될 수 있다. 부가 파일(255)은 상기 페이지에 기반하는 크기(예를 들어, 상기 페이지의 크기 및 프레임 헤더의 크기를 결합한 크기)를 가지는 프레임 단위에 기반하여, 트랜잭션에 기반하여 변경된 데이터베이스 파일(251)의 데이터를 저장할 수 있다. 인덱스 파일(253) 내에 저장되는 매핑 정보는, 부가 파일(255)의 어느 프레임에 저장된 데이터가 데이터베이스 파일(251)의 어느 페이지에 대응하는지를 나타낼 수 있다.
일 실시예에서, 전자 장치(101)는 데이터베이스 파일(251)의 페이지의 식별자(예를 들어, 페이지 번호)에 기반하여, 인덱스 파일(253)의 매핑 정보에 포함된 해시 테이블을 탐색함으로써, 상기 식별자를 가지는 페이지에 대응하는 부가 파일(255)의 일부분(예를 들어, 프레임)을 식별할 수 있다. 예를 들어, 전자 장치(101)는 지정된 페이지 번호에 대응하는 부가 파일(255)의 프레임 번호를 식별할 수 있다. 인덱스 파일(253)은 하나 이상의 트랜잭션들이 동시에 데이터베이스 파일(251)에 접근하는 것을 방지하거나 및/또는 제어하기 위한 업데이트 권한(예: 파일 잠금)과 관련된 영역을 포함할 수 있다. 상기 업데이트 권한은 복수의 트랜잭션들이 동시에 데이터베이스 파일(251)에 접근할 때 발생될 수 있는 오류를 방지하는데 이용될 수 있다.
다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치))는 디스플레이(예: 도 1의 디스플레이 모듈(160)), 메모리(예: 도 1의 메모리(130)), 및 상기 디스플레이 또는 상기 메모리와 작동적으로 연결된 프로세서(예: 도 1의 프로세서(120))를 포함하고, 상기 프로세서는, 어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받고, 상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하고, 상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하거나, 또는 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하고, 상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하도록 설정될 수 있다.
상기 제1 보안 데이터 처리 프로세스는, 상기 메모리에 저장된 데이터베이스 파일의 업데이트 권한을 획득하고, 상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고, 상기 업데이트가 완료되면 상기 업데이트 권한을 반납하도록 설정되는 것일 수 있다.
상기 제2 보안 데이터 처리 프로세스는, 상기 메모리에 저장된 데이터베이스 파일의 페이지 구조의 변경을 판단하고, 상기 페이지 구조가 변경되지 않은 경우, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하는지 여부를 판단하고, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하지 않는 경우, 상기 데이터베이스 파일의 업데이트 권한을 획득하고, 상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고, 상기 업데이트가 완료되면 상기 업데이트 권한을 반납하도록 설정되는 것일 수 있다.
상기 프로세서는, 상기 제1 보안 데이터 처리 프로세스 또는 상기 제2 보안 데이터 처리 프로세스를 실패한 경우, 제3 보안 데이터 처리 프로세스를 수행하도록 설정될 수 있다.
상기 제3 보안 데이터 처리 프로세스는, 상기 부가 파일에 상기 보안 데이터에 대응하는 프레임을 추가하고, 상기 보안 데이터 처리를 위한 스레드(thread)를 생성하고, 상기 보안 데이터에 설정된 생명 주기에 기반하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고, 상기 업데이트가 완료되면 상기 보안 데이터에 대응하는 부가 파일을 무효화하도록 설정되는 것일 수 있다.
상기 프로세서는, 상기 보안 데이터에 생명 주기가 설정된 경우, 상기 생명 주기만큼 상기 업데이트 동작을 대기하고, 상기 생명 주기가 지난 후, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하고, 상기 보안 데이터에 생명 주기가 설정되지 않은 경우, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하도록 설정될 수 있다.
상기 프로세서는, 상기 시도한 업데이트가 실패하는 경우, 설정된 조건에 만족하는지 여부를 판단하고, 상기 설정된 조건에 만족하는 경우, 상기 업데이트 권한을 획득할 때까지 상기 업데이트를 대기하고, 상기 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하도록 설정될 수 있다.
상기 프로세서는, 상기 보안 데이터에 대응하는 상기 부가 파일의 크기를 줄이거나, 상기 부가 파일의 프레임을 덮어쓰기 하여 상기 부가 파일을 무효화하도록 설정될 수 있다.
상기 프로세서는, 상기 메모리의 저장 공간에 기반하여 상기 부가 파일의 크기를 줄이거나, 상기 부가 파일의 프레임을 덮어쓰기 하는 동작 중 어느 하나의 동작을 수행하도록 설정될 수 있다.
상기 프로세서는, 상기 메모리의 저장 공간이 설정된 크기 이상인 경우, 상기 덮어쓰기 동작을 수행하고, 상기 메모리의 저장 공간이 설정된 크기 미만인 경우, 상기 줄이는 동작을 수행하도록 설정될 수 있다.
상기 프로세서는, 상기 메모리에 저장된 데이터베이스 파일을 오픈하면, 상기 데이터베이스 파일에 대한 스토리지에 보안 속성이 설정되었는지 판단하고, 상기 스토리지에 보안 속성이 설정된 경우, 상기 오픈된 데이터베이스 파일 전체에 보안 속성을 적용하도록 설정될 수 있다.
상기 프로세서는, 상기 스토리지에 보안 속성이 설정되지 않은 경우, 메모리에 보안 속성이 설정되었는지 판단하고, 상기 메모리에 보안 속성이 설정된 경우, 상기 메모리에 설정된 값을 리드하여 보안 데이터에 대응하는 업데이트를 수행하고, 상기 스토리지의 보안 속성은, 상기 데이터베이스 파일에 대응하는 어플리케이션이 삭제될 때까지 상기 보안 속성이 유지되는 특성을 갖고, 상기 메모리의 보안 속성은 상기 데이터베이스 파일의 연결에 대응하여 상기 보안 속성이 유지되는 특성을 갖도록 설정될 수 있다.
상기 보안 속성은, 상기 데이터베이스 파일의 전체, 상기 데이터베이스 파일의 테이블 또는 컬럼 중 적어도 하나에 설정되는 것일 수 있다.
도 3은 다양한 실시예들에 따른 전자 장치의 동작 방법을 도시한 흐름도(300)이다.
도 3을 참조하면, 동작 301에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 보안 데이터의 업데이트를 요청받을 수 있다. 상기 보안 데이터는 어플리케이션 데이터 중 보안 속성이 설정된 데이터를 의미하는 것으로, 삭제될 때 삭제된 보안 데이터가 스토리지 상에 존재하지 않도록 보안 삭제가 필요한 데이터를 의미할 수 있다. 상기 보안 속성은 데이터베이스 파일(251) 전체 또는 원하는 영역(예: 도 2의 데이터베이스 파일(251)의 지정된 테이블, 컬럼)이 어플리케이션 개발자에 의해 설정되거나, 보안 데이터의 업데이트 동작할 때 지정된 트랜잭션에 한해 보안 삭제 기능을 수행하도록 설정될 수 있다. 보안 삭제 기능을 제공하기 위해서는 보안 데이터가 변경된 내용이 존재하는지 감지할 수 있는 기능이 필요할 수 있다. 보안 속성은 메모리(예: 도 1의 휘발성 메모리(132)) 또는 스토리지(예: 도 1의 비휘발성 메모리(134))에 설정될 수 있다. 프로세서(120)는 데이터베이스 파일(251)의 어떤 테이블 또는 어떤 컬럼에 보안 데이터 변경이 일어나는지는 또는 변경, 삭제하는 쿼리를 분석함으로써 보안 데이터 업데이트 요청을 확인할 수 있다.
어플리케이션 데이터에 보안 설정하는 방법은 하기 도 9를 통해 상세히 설명하기로 한다. 상기 업데이트는 트랜잭션을 의미하는 것으로, 트랜잭션은 어플리케이션 데이터에 대한 읽기, 추가, 삭제 또는 수정하는 동작을 포함할 수 있다. 상기 업데이트 요청은 사용자에 의해 발생되거나, 전자 장치(101)의 설정에 따라 발생할 수 있다. 보안 데이터를 읽거나, 추가하는 동작(또는 트랜잭션)은 데이터베이스 파일(251) 또는 WAL 파일(예: 도 2의 부가 파일(255))에 이전 보안 데이터가 남지 않을 수 있다. 보안 데이터를 수정(또는 변경)하거나, 삭제하는 동작은 데이터베이스 파일(251) 또는 WAL 파일에 이전 보안 데이터가 남아 있을 수 있다.
본 발명은 이전 보안 데이터가 데이터베이스 파일 또는 WAL 파일에 남아있지 않도록 처리하는 것으로, 동작 301은 보안 데이터를 수정 또는 삭제하는 동작(또는 트랜잭션)을 포함할 수 있다. 프로세서(120)는 보안 데이터가 아닌 어플리케이션 데이터의 업데이트 요청에 대해서는 기존 WAL 모드(예: 업데이트 요청된 페이지에 대응하는 프레임을 WAL 파일에 추가하여 WAL 파일의 업데이트 조건에 만족하면 WAL 파일의 내용을 데이터베이스 파일(251)에 반영하는 동작)를 수행할 수 있다.
동작 303에서, 프로세서(120)는 상기 보안 데이터에 대응하는 WAL 파일의 상태를 식별할 수 있다. 전자 장치(101)의 메모리(예: 도 1의 메모리(130))에는 데이터 무결성과 트랜잭션의 원자성을 보장하기 위해, 저널 기법이 적용될 수 있다. 저널 기법은 어플리케이션 데이터를 저장하는 데이터베이스 파일 외에 부가 파일로서, WAL(write ahead log) 파일 또는 롤백 저널(rollback journal) 파일을 생성하여 활용하는 기법일 수 있다. 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))은 어플리케이션 데이터가 저장되며, 데이터베이스 헤더, 데이터베이스 스키마, 데이터베이스 내용 또는 자료 구조로 구성될 수 있다. 도 3에서는 부가 파일(예: 도 2의 부가 파일(255))이 WAL 파일인 경우를 예로 들어 설명하지만, 설명에 의해 본 발명이 제한되는 것은 아니다. 예를 들어, 상기 WAL 파일은 WAL 헤더와 적어도 하나의 WAL 프레임으로 구성될 수 있다. WAL 헤더에는 WAL 파일에 대한 기본적인 정보가 포함되는데, 예를 들어, 식별 번호, 파일 포맷 버전, 페이지 사이즈, 업데이트 횟수, 프레임 오류 체크, 또는 WAL 헤더 오류 체크 중 적어도 하나를 포함할 수 있다.
다양한 실시예들에 따르면, 상기 식별 번호는 WAL 파일을 인식하기 위한 Magic Number가 포함될 수 있다. 상기 파일 포맷 버전은 WAL 파일에 대한 포맷 버전으로 고정된 값을 가질 수 있다. 데이터베이스 파일(251)은 일정한 크기의 구분하여 관리되는데, 일정한 크기로 구분된 덩어리는 페이지로 해석할 수 있다. 상기 페이지 사이즈는 데이터베이스 파일(251)에 저장된 페이지에 대응하는 것일 수 있다. 상기 업데이트 횟수는 WAL 파일에 저장된 프레임이 데이터베이스 파일에 반영되는 횟수를 의미할 수 있다. WAL 파일에 저장된 프레임을 데이터베이스 파일(251)에 반영하는 것을 업데이트 또는 체크포인트(checkpoint)라 할 수 있다. WAL 파일에 저장된 프레임이 데이터베이스 파일(251)에 반영될 때마다 상기 업데이트 횟수는 증가(예: +1)할 수 있다. 상기 프레임 오류 체크는 WAL 파일을 초기화할 때 생성하는 임의의 값(예: Salt 값)을 의미할 수 있다, 상기 프레임 오류 체크에 포함된 값이 상기 WAL 프레임에 포함된 헤더 오류 체크에 포함된 값과 동일한 경우 WAL 프레임은 정상적인 프레임으로 인식될 수 있다. 상기 WAL 헤더 오류 체크는 WAL 헤더에 오류가 있는지 판단하기 위한 값(예: checksum)을 포함할 수 있다. 상기 WAL 헤더에 포함되는 정보는 발명의 이해를 돕기 위한 예시로서, 본 발명을 제한하는 것은 아니다.
상기 WAL 프레임은 데이터베이스 파일(251)에 저장된 어플리케이션 데이터에 대한 변경 사항(예: 수정, 삭제, 추가)을 포함할 수 있다. 상기 WAL 프레임은 WAL 프레임 헤더와 페이지로 구성될 수 있다. WAL 파일의 프레임은 데이터베이스 파일(251)에 저장된 페이지와 매핑되어 있으며, WAL 프레임 헤더에 매핑되는 페이지 번호가 기록될 수 있다. 예를 들어, 상기 WAL 프레임은 WAL 프레임 헤더, 페이지 번호, bCommit, 헤더 오류 체크, WAL 프레임 오류 체크, 또는 데이터베이스 페이지 중 적어도 하나를 포함할 수 있다. 상기 페이지 번호는 변경 사항이 있는 페이지 번호를 의미할 수 있다. 상기 bCommit은 Commit 프레임인 경우, 데이터베이스 파일(251)의 사이즈가 표시되거나, 다른 프레임인 경우 0으로 설정될 수 있다. 상기 헤더 오류 체크는 상기 WAL 헤더에 포함된 프레임 오류 체크에 포함된 값과 동일한 값이 저장될 수 있다. 상기 WAL 프레임 오류 체크는 WAL 프레임에 오류가 있는지 판단하기 위한 값(예: checksum)을 포함할 수 있다. 상기 데이터베이스 페이지는 변경 사항이 반영된 페이지를 포함할 수 있다. 상기 WAL 프레임에 포함되는 내용은 발명의 이해를 돕기 위한 예시로서, 본 발명을 제한하는 것은 아니다.
프로세서(120)는 메모리(130)에 저장된 데이터베이스 파일(251)에 대한 업데이트 요청이 발생하면, 데이터베이스 파일(251)의 상기 업데이트된 페이지에 대응하여 WAL 파일의 프레임(예: WAL 프레임)을 추가할 수 있다. 예를 들어, 프로세서(120)는 데이터베이스 파일(251)의 하나의 페이지에 대응하는 업데이트가 요청된 경우, 업데이트된 페이지의 번호를 포함하는 프레임을 상기 WAL 파일에 추가할 수 있다. 또는, 프로세서(120)는 데이터베이스 파일(251)의 두 개의 페이지에 대응하는 업데이트가 요청된 경우(예: 제1 페이지, 제3 페이지), 업데이트된 두 개의 서로 다른 페이지의 번호를 포함하는 프레임(예: 제1 페이지에 대응하는 제1 프레임, 제3 페이지에 대응하는 제2 프레임)을 상기 WAL 파일에 추가할 수 있다.
WAL 파일의 상태는 WAL 파일이 유효한 상태 또는 무효인 상태를 포함할 수 있다. WAL 파일이 유효한 상태는 WAL 파일의 WAL 헤더가 유효하고, WAL 파일에 적어도 하나의 WAL 프레임이 포함된 상태를 의미할 수 있다. WAL 파일이 무효한 상태는 WAL 파일 없음, WAL 파일의 크기가 0, WAL 파일의 WAL 헤더가 유효하지 않음(예: Zero filled), 또는 유효한 WAL 프레임이 존재하지 않은 상태 중 적어도 하나를 포함할 수 있다.
동작 305에서, 프로세서(120)는 WAL 파일의 상태에 기반하여 서로 다른 처리 프로세스를 결정할 수 있다. 예를 들어, 프로세서(120)는 WAL 파일이 무효한 상태인 경우, 제1 보안 데이터 처리 프로세스가 수행되도록 결정하고, WAL 파일이 유효한 상태인 경우, 제2 보안 데이터 처리 프로세스가 수행되도록 결정할 수 있다. 상기 제1 보안 데이터 처리 프로세스는 데이터베이스 파일(251)의 업데이트 권한을 획득하고, WAL 파일 없이 데이터베이스 파일(251)에 업데이트를 수행하고, 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 수행하는 것일 수 있다. 상기 제1 보안 데이터 처리 프로세스는 이하 도 4를 통해 자세히 설명하기로 한다.
상기 제2 보안 데이터 처리 프로세스는 데이터베이스 파일(251)의 페이지 구조가 변경되지 않고, 업데이트할 페이지가 WAL 파일에 존재하지 않는 경우 데이터베이스 파일(251)의 업데이트 권한을 획득하고, WAL 파일 없이 데이터베이스 파일(251)에 업데이트를 수행하고, 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 수행하는 것일 수 있다. 상기 제2 보안 데이터 처리 프로세스는 이하 도 6을 통해 자세히 설명하기로 한다. 프로세서(120)는 상기 WAL 파일의 상태에 따라 상기 제1 보안 처리 프로세스 또는 상기 제2 보안 처리 프로세스를 수행하도록 결정할 수 있다.
동작 307에서, 프로세서(120)는 상기 결정된 처리 프로세스에 따라 보안 데이터 업데이트를 수행할 수 있다. 프로세서(120)는 상기 제1 보안 처리 프로세스 또는 상기 제2 보안 처리 프로세스에 따라 보안 데이터 업데이트를 수행할 수 있다. 프로세서(120)는 상기 제1 보안 데이터 처리 프로세스 및 상기 제2 보안 데이터 처리 프로세스를 수행할 수 없는 경우, 제3 보안 데이터 처리 프로세스를 수행할 수 있다. 상기 제3 보안 데이터 처리 프로세스는 WAL 파일에 상기 업데이트된 보안 데이터에 대응하는 프레임을 추가하고, 보안 데이터 처리를 위한 스레드(thread)를 생성하고, 보안 데이터 생명 주기만큼 대기한 후, 데이터베이스 파일(251) 업데이트를 시도하고, 업데이트가 성공하면 상기 업데이트된 보안 데이터에 대응하는 WAL 파일을 무효화시키는 것일 수 있다. 상기 제3 보안 데이터 처리 프로세스는 상기 업데이트가 실패하면 업데이트 권한을 획득할 때까지 대기하고, WAL 파일에 기반하여 데이터베이스 파일(251)을 업데이트한 후, 상기 업데이트된 보안 데이터에 대응하는 WAL 파일을 무효화시키는 동작을 수행하는 것일 수 있다.
도 4는 다양한 실시예들에 따른 전자 장치에서 제1 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도(400)이다. 도 4는 도 3의 동작 307을 수행하는 동작을 구체화한 것일 수 있다.
도 4를 참조하면, 동작 401에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 업데이트 권한 획득을 시도할 수 있다. 프로세서(120)는 WAL 파일의 상태가 무효한 경우, 보안 데이터에 대응하는 업데이트를 WAL 파일 없이 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))에 바로 적용할 수 있다. 데이터베이스 파일(251)에 접근하기 위해서는 상기 업데이트 권한이 필요할 수 있다. 상기 업데이트 권한이란 하나 이상의 트랜잭션들이 동시에 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))에 접근하는 것을 방지하기 위해 설정된 파일 잠금을 의미할 수 있다.
예를 들어, 트랜잭션은 읽기 트랜잭션(또는 동작), 추가 트랜잭션, 수정(또는 변경) 트랜잭션 또는 삭제 트랜잭션을 포함할 수 있다. 읽기 트랜잭션을 수행하는 동안 삭제 트랜잭션이 수행되는 경우, 데이터베이스 파일(251)에 오류가 발생할 수 있다. 데이터베이스 파일(251)의 오류를 방지하기 위해 하나의 트랜잭션만 데이터베이스 파일(251)에 접근하도록 제어하는 권한을 상기 업데이트 권한으로 해석할 수 있다. 상기 업데이트 권한은 WAL 인덱스 파일(예: 도 2의 인덱스 파일(253))에 포함될 수 있다. 상기 업데이트 권한은 모든 트랜잭션(예: 읽기, 추가, 수정, 삭제)에 대응하는 전체 권한을 갖는 것을 의미할 수 있다.
동작 403에서, 프로세서(120)는 업데이트 권한을 획득하였는지 판단할 수 있다. 프로세서(120)는 보안 데이터에 대한 업데이트 수행 시, 업데이트 권한을 획득한 후, 상기 보안 데이터에 대한 업데이트를 수행할 수 있다. 프로세서(120)는 상기 업데이트 권한을 획득한 경우 동작 405를 수행하고, 상기 업데이트 권한을 획득하지 못한 경우 도 8을 수행할 수 있다. 도 8은 상기 제1 보안 데이터 처리 프로세스를 수행할 수 없는 경우 수행되는 것으로, 제3 보안 데이터 처리 프로세스일 수 있다.
상기 업데이트 권한을 획득한 경우 동작 405에서, 프로세서(120)는 WAL 파일 없이 업데이트를 수행할 수 있다. 데이터베이스(예: 도 2의 데이터베이스(250))에는 저널 기법(예: WAL 모드)이 적용되며, 저널 기법은 어플리케이션 데이터의 업데이트가 발생하면, 데이터베이스 파일(251)을 업데이트하기 전에 업데이트와 관련된 처리 결과들을 WAL 파일에 저장하고, WAL 파일의 업데이트 조건에 해당되면, WAL 파일에 저장된 내용을 데이터베이스 파일(251)에 반영하는 것일 수 있다. WAL 파일에 저장된 내용을 데이터베이스 파일(251)에 반영한 이후에도 WAL 파일에 저장된 내용이 삭제되지 않고 남아있을 수 있다. 상기 제1 보안 데이터 처리(또는 삭제) 프로세스는 보안 속성을 갖는 어플리케이션 데이터(예: 보안 데이터)가 변경 또는 삭제된 경우, 보안 데이터가 WAL 파일 또는 데이터베이스 파일(251)에 남아있지 않도록 하는 보안 삭제 기능을 포함할 수 있다.
다양한 실시예들에 따르면, 프로세서(120)는 WAL 모드에서 보안 데이터에 대응하는 쓰기 트랜잭션(예: 수정 또는 삭제 트랜잭션)이 발생하는 경우, 런타임 상 Atomic Write 모드로 변환 후, Atomic Write 모드를 사용할 수 있다. Atomic Write 모드는 F2FS(flash friendly file system)을 제공하는 전자 장치(101)에서 쓰기 트랜잭션에 사용할 수 있는 기술일 수 있다. Atomic Write 모드는 별도의 WAL 파일 없이 in-place update가 가능한 모드일 수 있다. WAL 모드에서는 업데이트와 관련된 처리 결과들이 WAL 파일에 저장되는데, Atomic Write 모드는 WAL 파일 없이 업데이트된 어플리케이션 데이터를 데이터베이스 파일(251)에 바로 반영할 수 있다. WAL 모드에서는 WAL 파일에 저장된 내용이 업데이트 조건에 해당되면, 데이터베이스 파일(251)에 반영하게 되는데, 프로세서(120)는 보안 데이터에 대하여 WAL 파일 없이 데이터베이스 파일(251)에 바로 업데이트를 반영할 수 있다.
동작 407에서, 프로세서(120)는 업데이트가 완료되었는지 여부를 판단할 수 있다. 프로세서(120)는 업데이트가 완료되는 경우 동작 407을 수행하고, 업데이트가 완료되지 않은 경우 도 8을 수행할 수 있다. 프로세서(120)는 WAL 파일 없이 데이터베이스 파일(251)에 업데이트를 바로 반영함으로써, 업데이트를 실패할 수 있다. 프로세서(120)는 업데이트를 실패하면, 도 8을 수행하여 제3 보안 데이터 처리 프로세스를 수행할 수 있다.
업데이트가 완료되는 경우 동작 409에서, 프로세서(120)는 상기 업데이트 권한을 반납할 수 있다. 프로세서(120)는 업데이트하는 동안 상기 업데이트 권한을 가지고, 업데이트가 완료되면 상기 업데이트 권한을 반납할 수 있다. 상기 업데이트 권한은 데이터베이스 파일(251)에 접근할 수 있는 전체 권한으로, 업데이트가 완료되면 반환할 수 있다.
도 5는 다양한 실시예들에 따른 전자 장치의 데이터베이스 구조를 도시한 도면이다.
도 5를 참조하면, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 데이터베이스는 데이터베이스 파일(510)(예: 도 2의 데이터베이스 파일(251)), 인덱스 파일(530)(예: 도 2의 인덱스 파일(253)), 및 WAL 파일(550)(예: 도 2의 부가 파일(255))을 포함할 수 있다. 데이터베이스 파일(510), 인덱스 파일(530), 및 WAL 파일(550)은 파일 시스템(예: 도 2의 파일 시스템(240))에 기반하고, 비휘발성 메모리(예: 도 1의 비휘발성 메모리(134))에 적어도 일부 대응하는 스토리지 내에 저장될 수 있다. 데이터베이스 파일(510)은 적어도 하나의 페이지를 포함할 수 있다. 데이터베이스 파일(510)과 관련된 복수의 파일 각각의 크기는, 예를 들어, 페이지의 크기인 4 KB 크기 이상일 수 있다. 상기 복수의 파일 각각의 크기는, 파일 시스템(240) 및/또는 데이터베이스 매니저(예: 도 2의 데이터베이스 매니저(230))에 의해 페이지의 크기와 구별되는 다른 값으로 변경될 수 있다.
데이터베이스 파일(510)는 제1 페이지(512), 제2 페이지(513), 제3 페이지(514) 및 제4 페이지(515)를 포함할 수 있다. 제1 페이지(512)는 데이터베이스 파일(510)의 헤더(511) 및 데이터베이스 스키마를 포함할 수 있다. 헤더(511)는 데이터베이스 파일(510)의 속성을 나타내는 복수의 파라미터들을 포함할 수 있다. 제2 페이지(513) 내지 제4 페이지(515)의 데이터 구조는, 데이터베이스 파일(510)의 데이터의 검색을 보다 빠르게 하기 위한 데이터 구조를 가질 수 있다.
WAL 파일(550)은 WAL 모드 내에서 트랜잭션에 기반하여 변경된 데이터가 저장될 수 있다. WAL 파일(550)에 포함된 데이터는 프레임 단위로 구별될 수 있다. 상기 프레임의 크기는 데이터베이스 파일(510)에 포함된 데이터 및/또는 정보를 구별하는데 이용되는 페이지의 크기 및 프레임 헤더의 크기의 결합에 대응할 수 있다. WAL 파일(550)은 헤더(551) 및 복수의 프레임들(예: 제1 프레임(552), 제2 프레임(553), 제3 프레임(554), 제4 프레임(555))을 포함할 수 있다. 전자 장치(101)는 WAL 파일(550)의 크기 및/또는 WAL 파일(550) 내에 포함된 복수의 프레임들의 개수에 기반하여, WAL 파일(550)의 업데이트 조건을 결정하고, 업데이트 조건에 만족하면 WAL 파일(550)에 저장된 프레임을 데이터베이스 파일(510)의 페이지에 반영할 수 있다.
인덱스 파일(530)은 WAL 파일(550)에 저장된 데이터베이스 파일(510)의 변경된 데이터가, 데이터베이스 파일(510)의 어느 부분, 어느 파일 또는 어느 위치에 있는지 식별하기 위해 이용될 수 있다. 인덱스 파일(530)은 데이터베이스 파일(510)에 대한 동시 접근(concurrent access)을 방지하기 위한 업데이트 권한(예: 파일 잠금)을 포함할 수 있다. 인덱스 파일(530)은 WAL 파일(550)에 저장된 프레임이 데이터베이스 파일(510)의 어느 페이지에 대응하는 것인지 매칭한 매핑 정보를 포함할 수 있다. 전자 장치(101)는 상기 매핑 정보에 기반하여, 데이터베이스 파일(510)의 제1 페이지(512)가 WAL 파일(550)의 제2 프레임(553)에 매칭됨을 식별할 수 있다. 전자 장치(101)는 인덱스 파일(530)에 기반하여, 제4 페이지(515)가 제3 프레임(554)에 대응되고, 제3 페이지(514)가 제1 프레임(552)에 대응하는 것을 식별할 수 있다.
상기 매핑 정보는, 전자 장치(101)가 WAL 파일(550)에 기반하여 데이터베이스 파일(510)의 데이터를 변경할 때에 이용될 수 있다. 예를 들어, 전자 장치(101)는 WAL 파일(550)의 제2 프레임(553)에 기반하여 데이터베이스 파일(510)의 제1 페이지(512)를 변경하고, 제3 프레임(554)에 기반하여 데이터베이스 파일(510)의 제4 페이지(515)를 변경하고, 제1 프레임(552)에 기반하여 데이터베이스 파일(510)의 제3 페이지(514)를 변경할 수 있다.
도 6은 다양한 실시예들에 따른 전자 장치에서 제2 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도(600)이다. 도 6은 도 3의 동작 307을 수행하는 동작을 구체화한 것일 수 있다.
도 6을 참조하면, 동작 601에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))의 페이지 구조가 변경되었는지 판단할 수 있다. 프로세서(120)는 WAL 파일의 상태가 유효한 경우, 지정된 조건에 해당하는 경우에만 보안 데이터에 대응하는 업데이트를 WAL 파일 없이 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))에 바로 적용할 수 있다. 상기 지정된 조건은 데이터베이스 파일(251)의 페이지 구조가 변경되지 않고, WAL 파일에 보안 데이터에 대응하는 페이지가 존재하지 않는 경우를 포함할 수 있다. 프로세서(120)는 WAL 파일의 상태가 유효한 경우, 인덱스 파일(예: 도 5의 인덱스 파일(530))에 기반하여 상기 지정된 조건에 해당하는지 여부를 판단할 수 있다.
다양한 실시예들에 따르면, 데이터베이스 파일(251)은 페이지 단위로 구성되며, 각 페이지는 B 트리(B - tree)의 노드일 수 있다. B 트리는 데이터베이스와 파일 시스템에서 널리 사용되는 트리 자료 구조의 일종으로, 이진 트리를 확장해 하나의 노드가 가질 수 있는 자식 노드의 최대 숫자가 2보다 큰 트리 구조일 수 있다. B 트리의 노드에 대응하는 데이터베이스 파일(251)의 페이지가 수정되면, B 트리 구성이 변경될 수 있다. 예를 들어, 많은 수의 페이지가 삭제되는 경우, B 트리 구조의 밸런스를 맞추기 위해, 트리 구조의 변경이 발생할 수 있다. 트리 구조를 변경하는 동작은 리 밸런싱(re balancing) 동작을 의미할 수 있다. 트리 구조가 변경되면, B 트리의 노드에 대응하는 페이지의 위치가 변경될 수 있다. WAL 파일(예: 도 5의 WAL 파일(550))에는 데이터베이스 파일(251)의 페이지에 대응하는 프레임이 존재하므로, 프레임에는 데이터베이스 파일(251)의 페이지 구조가 포함될 수 있다. 프로세서(120)는 데이터베이스 파일(251)의 페이지 구조가 변경된 경우, WAL 파일 없이 데이터베이스 파일(251)에 업데이트를 적용할 경우 오류가 발생할 수 있다.
프로세서(120)는 데이터베이스 파일(251)의 페이지 구조가 변경된 경우, 도 8을 수행하고, 데이터베이스 파일(251)의 페이지 구조가 변경되지 않은 경우, 동작 603을 수행할 수 있다.
데이터베이스 파일(251)의 페이지 구조가 변경되지 않은 경우, 동작 603에서, 프로세서(120)는 업데이트 페이지가 WAL 파일에 존재하는지 여부를 판단할 수 있다. 상기 업데이트 페이지(또는 최신 업데이트 페이지)는 도 3의 동작 301에서 업데이트 요청된 보안 데이터에 대응하는 페이지를 의미할 수 있다. WAL 파일에는 하나의 페이지에 대응하는 하나 이상의 프레임이 포함될 수 있다. 예를 들어, 한번의 트랜잭션으로 제1 페이지에 대응하는 제1 프레임이 생성된 후, 다른 트랜잭션으로 제3 페이지에 대응하는 제2 프레임 및 제1 페이지에 대응하는 제3 프레임이 생성될 수 있다. 프로세서(120)는 WAL 파일의 프레임을 데이터베이스 파일(251)에 업데이트할 때, 가장 마지막에 저장된 프레임이 반영될 수 있다.
예를 들어, 동일한 제1 페이지에 대한 프레임이 제1 프레임 및 제3 프레임이 존재하는 경우, 프로세서(120)는 제3 프레임을 데이터베이스 파일(251)의 제1 페이지에 반영할 수 있다. 예를 들어, 업데이트 페이지에 대응하는 프레임이 WAL 파일에 이미 존재하는 경우, 가장 최신의 업데이트를 WAL 파일 없이 데이터베이스 파일(251)에 바로 반영하였지만, 이후 WAL 파일의 업데이트 조건에 만족하면, WAL 파일에 이미 존재하는 프레임을 데이터베이스 파일(251)에 반영하는 문제가 발생할 수 있다. 프로세서(120)는 인덱스 파일(530)에 저장된 매핑 정보에 기반하여 업데이트 페이지가 WAL 파일에 존재하는지 여부를 판단할 수 있다.
프로세서(120)는 업데이트 페이지가 WAL 파일에 존재하는 경우, 도 8을 수행하고, 업데이트 페이지가 WAL 파일에 존재하지 않은 경우, 동작 605를 수행할 수 있다.
도면에서는 동작 601이 먼저 수행되고, 동작 603이 나중에 수행되는 것으로 도시하고 있지만, 동작 603이 먼저 수행되고, 동작 601이 나중에 수행되거나, 동작 601 및 동작 603이 동시에 수행될 수도 있다. 이는, 발명의 이해를 돕기 위한 예시일 뿐, 본 발명을 제한하는 것은 아니다.
업데이트 페이지가 WAL 파일에 존재하지 않은 경우, 동작 605에서, 프로세서(120)는 업데이트 권한 획득을 시도할 수 있다. 상기 업데이트 권한이란 하나 이상의 트랜잭션들이 동시에 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251))에 접근하는 것을 방지하기 위해 설정된 파일 잠금을 의미할 수 있다. 상기 업데이트 권한은 WAL 인덱스 파일(예: 도 2의 인덱스 파일(253))에 포함될 수 있다. 상기 업데이트 권한은 모든 트랜잭션(예: 읽기, 추가, 수정, 삭제)에 대응하는 전체 권한을 갖는 것을 의미할 수 있다. 동작 605는 도 4의 동작 401과 동일 또는 유사하므로 자세한 설명을 생략할 수 있다.
동작 607에서, 프로세서(120)는 업데이트 권한을 획득하였는지 판단할 수 있다. 프로세서(120)는 보안 데이터에 대한 업데이트 수행 시, 업데이트 권한을 획득한 후, 상기 보안 데이터에 대한 업데이트를 수행할 수 있다. 프로세서(120)는 상기 업데이트 권한을 획득한 경우 동작 609를 수행하고, 상기 업데이트 권한을 획득하지 못한 경우 도 8을 수행할 수 있다. 도 8은 상기 제2 보안 데이터 처리 프로세스를 수행할 수 없는 경우 수행되는 것으로, 제3 보안 데이터 처리 프로세스일 수 있다. 동작 607은 도 4의 동작 403과 동일 또는 유사하므로 자세한 설명을 생략할 수 있다.
상기 업데이트 권한을 획득한 경우 동작 609에서, 프로세서(120)는 WAL 파일 없이 업데이트를 수행할 수 있다. WAL 파일에 저장된 내용을 데이터베이스 파일(251)에 반영한 이후에도 WAL 파일에 저장된 내용이 삭제되지 않고 남아있을 수 있다. 상기 제2 보안 데이터 처리(또는 삭제) 프로세스는 보안 속성을 갖는 어플리케이션 데이터(예: 보안 데이터)가 변경 또는 삭제된 경우, 보안 데이터가 WAL 파일 또는 데이터베이스 파일(251)에 남아있지 않도록 하는 보안 삭제 기능을 포함할 수 있다. WAL 모드에서는 WAL 파일에 저장된 내용이 업데이트 조건에 해당되면, 데이터베이스 파일(251)에 반영하게 되는데, 프로세서(120)는 보안 데이터에 대하여 WAL 파일 없이 데이터베이스 파일(251)에 바로 업데이트를 반영할 수 있다. 동작 609는 도 4의 동작 405와 동일 또는 유사하므로 자세한 설명을 생략할 수 있다.
동작 611에서, 프로세서(120)는 업데이트가 완료되었는지 여부를 판단할 수 있다. 프로세서(120)는 업데이트가 완료되는 경우 동작 613을 수행하고, 업데이트가 완료되지 않은 경우 도 8을 수행할 수 있다. 프로세서(120)는 WAL 파일 없이 데이터베이스 파일(251)에 업데이트를 바로 반영함으로써, 업데이트를 실패할 수 있다. 프로세서(120)는 업데이트를 실패하면, 도 8을 수행하여 제3 보안 데이터 처리 프로세스를 수행할 수 있다. 동작 611은 도 4의 동작 407과 동일 또는 유사하므로 자세한 설명을 생략할 수 있다.
업데이트가 완료되는 경우 동작 613에서, 프로세서(120)는 상기 업데이트 권한을 반납할 수 있다. 프로세서(120)는 업데이트하는 동안 상기 업데이트 권한을 가지고, 업데이트가 완료되면 상기 업데이트 권한을 반납할 수 있다. 상기 업데이트 권한은 데이터베이스 파일(251)에 접근할 수 있는 전체 권한으로, 업데이트가 완료되면 반환할 수 있다. 동작 613은 도 4의 동작 409와 동일 또는 유사하므로 자세한 설명을 생략할 수 있다.
도 7a 및 도 7b는 다양한 실시예들에 따른 데이터베이스 파일과 WAL 파일의 예시를 도시한 도면들이다.
도 7a는 다양한 실시예들에 따른 데이터베이스 파일의 페이지 구조를 도시한 도면이다.
도 7a를 참조하면, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 데이터베이스 파일(700)(예: 도 2의 데이터베이스 파일(251))은 하나 이상의 페이지들을 포함하고, 각 페이지는 B 트리(B - tree)의 노드일 수 있다. 예를 들어, 데이터베이스 파일(700)은 제1 페이지(711)를 포함하고, 제1 페이지(711)의 자식 노드로 제2 페이지(712) 및 제3 페이지(713)를 포함하고, 제2 페이지(712)의 자식 노드로 제4 페이지(714) 및 제5 페이지(715)를 포함하고, 제3 페이지(713)의 자식 노드로 제6 페이지(716)를 포함할 수 있다. 업데이트 요청된 보안 데이터는 제5 페이지(715)에 대응하는 것일 수 있다. 전자 장치(101)는 WAL 파일(예: 도 5의 WAL 파일(550))이 유효한 상태에서 데이터베이스 파일(700)의 페이지 구조가 변경되지 않고, 제5 페이지(715)에 대응하는 프레임이 WAL 파일에 존재하지 않는 경우, 제2 보안 데이터 처리 프로세스(예: 도 6의 흐름도(600))를 수행할 수 있다.
다양한 실시예들에 따르면, 데이터베이스 파일(700)의 트리 구조가 변경될 수 있다. 예를 들어, 트리 구조가 변경된 데이터베이스 파일(730)은 제1 페이지(731)를 포함하고, 제1 페이지(731)의 자식 노드로 제4 페이지(734) 및 제6 페이지(736)를 포함하고, 제4 페이지(734)의 자식 노드로 제2 페이지(732)를 포함하고, 제6 페이지(736)의 자식 노드로 제5 페이지(735) 및 제3 페이지(733)를 포함할 수 있다. 업데이트 요청된 보안 데이터는 제5 페이지(735)에 대응하는 것일 수 있다. 전자 장치(101)는 WAL 파일(예: 도 5의 WAL 파일(550))이 유효한 상태에서 데이터베이스 파일(730)의 페이지 구조가 변경된 경우, 상기 제2 보안 데이터 처리 프로세스를 수행하지 못할 수 있다.
도 7b는 다양한 실시예들에 따른 WAL 파일의 내부 구조를 도시한 도면이다.
도 7b를 참조하면, 데이터베이스 파일(710)은 제1 페이지(711), 제2 페이지(712), 제3 페이지(713), 제4 페이지(714) 및 제5 페이지(715)를 포함할 수 있다. 도 7b의 데이터베이스 파일(710)은 도 7a의 데이터베이스 파일(700)의 페이지 구조를 가질 수 있다. 업데이트 요청된 보안 데이터는 제5 페이지(715)에 대응하는 것일 수 있다. 예를 들어, 데이터베이스 파일(710)의 제3 페이지(713) 및 제2 페이지(712)의 업데이트가 순차적으로 요청된 경우, WAL 파일(750)은 유효한 상태로서, WAL 헤더(751), 제3 페이지(713)에 대응하는 제1 프레임(752), 제2 페이지(712)에 대응하는 제2 프레임(755)이 추가될 수 있다. 제1 프레임(752)은 WAL 프레임 헤더(753) 및 제3 페이지(713)에 대응하는 변경 사항(754)이 포함될 수 있다. 제2 프레임(755)은 WAL 프레임 헤더(756) 및 제2 페이지(712)에 대응하는 변경 사항(757)이 포함될 수 있다. 전자 장치(101)는 WAL 파일(750)이 유효한 상태에서 데이터베이스 파일(710)의 페이지 구조가 변경되지 않고 WAL 파일(750)에 업데이트 요청된 제5 페이지(715)에 대응하는 프레임이 존재하지 않으므로, 상기 제2 보안 데이터 처리 프로세스를 수행할 수 있다.
다양한 실시예들에 따르면, 데이터베이스 파일(710)의 제3 페이지(713) 및 제5 페이지(715)의 업데이트가 순차적으로 요청된 경우, WAL 파일(770)은 유효한 상태로서, WAL 헤더(751), 제3 페이지(713)에 대응하는 제1 프레임(752), 제5 페이지(715)에 대응하는 제2 프레임(755)이 추가될 수 있다. 제1 프레임(752)은 WAL 프레임 헤더(753) 및 제3 페이지(713)에 대응하는 변경 사항(754)이 포함될 수 있다. 제2 프레임(755)은 WAL 프레임 헤더(771) 및 제5 페이지(715)에 대응하는 변경 사항(772)이 포함될 수 있다. 전자 장치(101)는 WAL 파일(750)이 유효한 상태에서 데이터베이스 파일(710)의 페이지 구조가 변경되지 않았지만, WAL 파일(750)에 업데이트 요청된 제5 페이지(715)에 대응하는 프레임(예: 제2 프레임(755))이 존재하는 경우, 상기 제2 보안 데이터 처리 프로세스를 수행하지 못할 수 있다.
도 8은 다양한 실시예들에 따른 전자 장치에서 제3 보안 데이터 처리 프로세스를 수행하는 방법을 도시한 흐름도(800)이다. 도 8은 도 3의 동작 307을 수행하는 동작을 구체화한 것일 수 있다.
도 8을 참조하면, 동작 801에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 WAL 파일에 보안 데이터에 대응하는 프레임을 추가할 수 있다. 제1 보안 데이터 처리 프로세스(예: 도 4의 흐름도(400)) 및 제2 보안 데이터 처리 프로세스(예: 도 6의 흐름도(600)를 모두 수행하지 못한 경우, 보안 데이터에 대응하는 WAL 파일(예: 도 7b의 WAL 파일(770))을 삭제하기 위해서는 WAL 파일의 업데이트 조건에 따라 WAL 파일에 저장된 프레임을 데이터베이스 파일(예: 도 7b의 데이터베이스 파일(710))에 반영하는 동작(예: 체크포인트 동작)을 수행해야 할 수 있다. 프로세서(120)는 상기 제1 및 상기 제2 보안 데이터 처리 프로세스를 실패한 경우, 종래의 저널 기법에 따라 WAL 파일에 보안 데이터에 대응하는 프레임을 추가할 수 있다. 예를 들어, 업데이트 요청된 보안 데이터는 데이터베이스 파일(710)의 제5 페이지(예: 도 7b의 제5 페이지(715))에 대응하는 것일 수 있다. 프로세서(120)는 WAL 파일에 제5 페이지(715)에 대응하는 프레임을 추가할 수 있다.
동작 803에서, 프로세서(120)는 보안 데이터 처리를 위한 스레드(thread)를 생성할 수 있다. 업데이트가 요청되면(예: 트랜잭션이 발생하면), 프로세서(120)는 요청된 업데이트에 대응하는 스레드를 생성할 수 있다. 프로세서(120)는 요청된 업데이트에 대응하는 스레드가 아닌 별도의 스레드를 생성할 수 있다. 상기 생성된 스레드는 백그라운드에서 동작하는 스레드일 수 있다.
동작 805에서, 프로세서(120)는 보안 데이터에 생명 주기가 설정되었는지 판단할 수 있다. 보안 데이터를 삭제하는 로직은 WAL 모드 동작에 비해 부가적인 오버헤드(overhead)를 유발할 수 있다. 프로세서(120)는 오버헤드를 줄이기 위해 보안 데이터를 즉시 제거하지 않고, 일정 시간 안에 보안 데이터 삭제가 수행되도록 상기 생명 주기를 설정할 수 있다. 상기 생명 주기는 스토리지 또는 메모리에 설정될 수 있다. 메모리에 설정되는 값은 휘발성 메모리(예: 도 1의 휘발성 메모리(132))와 같이 데이터베이스 파일(251)의 연결이 종료되면 삭제되는 것일 수 있다.
상기 생명 주기는 어플리케이션 개발자에 의해 설정될 수 있다. 또는, 응용 계층(예: 어플리케이션)은 프레임워크의 제공에 따라 다양한 방법으로 상기 생명 주기를 설정할 수 있다. 상기 생명 주기는 API(application programming interface), 또는 SQL 구문을 이용하여 데이터베이스 파일(251), 데이터베이스(250)의 지정된 테이블, 데이터베이스(250)의 지정된 컬럼에 설정될 수 있다. 상기 생명 주기는 API 구문을 이용한 보안 쓰기 트랜잭션 실행 또는 SQL 구문을 이용하여 보안 쓰기 트랜잭션 실행을 통해 설정될 수 있다.
프로세서(120)는 보안 데이터에 생명 주기가 설정된 경우 동작 807을 수행하고, 보안 데이터에 생명 주기가 설정되지 않은 경우 동작 809를 수행할 수 있다.
보안 데이터에 생명 주기가 설정된 경우 동작 807에서, 프로세서(120)는 생명 주기의 시간만큼 대기할 수 있다. 보안 데이터에 대한 업데이트가 빠른 시간 내에 반복적으로 발생하게 되는 경우 반복적인 체크포인트 동작을 수행하는 것으로 인해 추가적인 프로세스가 소요될 수 있다. 프로세서(120)는 상기 상기 체크포인트 동작을 반복적으로 수행하지 않도록 생명 주기의 시간만큼 대기할 수 있다.
동작 809에서, 프로세서(120)는 WAL 파일의 내용을 데이터베이스 파일(710)에 반영(예: 체크포인트 동작)하도록 시도할 수 있다. 프로세서(120)는 상기 생명 주기가 설정된 경우, 상기 생명 주기가 지난 후, 상기 WAL 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 체크포인트 동작을 시도할 수 있다. 프로세서(120)는 상기 생명 주기가 설정되지 않은 경우, 상기 WAL 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 체크포인트 동작을 시도할 수 있다.
상기 WAL 파일의 업데이트 조건은 상기 WAL 파일의 크기가 설정된 크기에 해당하거나, 또는 상기 WAL 파일에 포함된 프레임의 개수가 설정된 개수에 해당하는 것일 수 있다. 프레임 하나당 크기가 제한적이므로, 프레임의 개수가 설정된 개수에 해당하는 경우, 상기 WAL 파일의 크기가 설정된 크기에 해당하는 것으로 해석될 수 있다. 상기 체크포인트 동작을 실패 없이 수행하기 위해서는 현재 동작하는 모든 트랜잭션(예: 읽기, 추가, 수정, 삭제)이 종료되어 업데이트 권한을 획득할 때까지 대기해야 할 수 있다. 동작 809에서 시도하는 체크포인트 동작은 읽기 트랜잭션이 발생함에 의해 실패할 수 있다.
동작 811에서, 프로세서(120)는 업데이트가 성공된 것인지 판단할 수 있다. 프로세서(120)가 모든 트랜잭션이 종료된 후, 상기 체크포인트 동작을 시도한 경우 업데이트가 성공할 수 있다. 프로세서(120)는 업데이트가 성공한 경우 동작 819를 수행하고, 업데이트가 실패한 경우 동작 813를 수행할 수 있다.
동작 813에서, 프로세서(120)는 설정된 조건에 만족하는지 여부를 판단할 수 있다. 상기 설정된 조건은 상기 생명 주기에 기반하여 설정된 시간 또는 설정된 횟수(예: 3회, 5회, 10회)를 포함할 수 있다. 예를 들어, 프로세서(120)는 상기 생명 주기의 2배 시간 동안 상기 체크포인트 동작을 시도하고, 상기 생명 주기의 2배 시간이 지난 경우 상기 설정된 조건에 만족하는 것으로 판단할 수 있다. 프로세서(120)는 상기 체크포인트 동작을 시도한 횟수를 카운트하고, 카운트한 횟수가 상기 설정된 횟수를 초과하는 경우, 상기 설정된 조건에 만족하는 것으로 판단할 수 있다. 프로세서(120)는 설정된 조건에 만족하는 경우, 동작 815를 수행하고, 설정된 조건에 만족하지 않는 경우, 동작 809로 리턴할 수 있다. 프로세서(120)는 설정된 조건에 만족하지 않는 경우, 동작 809로 리턴하여 일정 횟수 동안 반복하여 상기 체크포인트 동작을 시도할 수 있다.
설정된 조건에 만족하는 경우, 동작 815에서, 프로세서(120)는 업데이트 권한을 획득할 때까지 대기할 수 있다. 상기 체크포인트 동작을 실패 없이 수행하기 위해서는 현재 동작하는 모든 트랜잭션이 종료되어 업데이트 권한을 획득할 때까지 대기해야 할 수 있다.
동작 817에서, 프로세서(120)는 상기 업데이트 권한을 획득하여 WAL 파일(770)에 기반하여 데이터베이스 파일(710)을 업데이트할 수 있다. 동작 817은 상기 업데이트 권한을 획득하여 체크포인트 동작을 수행하는 것이고, 동작 809는 상기 업데이트 권한 획득 여부와 상관없이 체크포인트 동작을 시도하는 것일 수 있다. 프로세서(120)는 WAL 파일(770)에 저장된 프레임을 데이터베이스 파일(710)에 반영할 수 있다. 예를 들어, 프로세서(120)는 WAL 파일(770)에 저장된 제1 프레임(752)을 데이터베이스 파일(710)의 제3 페이지(713)에 반영하고, WAL 파일(770)에 저장된 제2 프레임(755)을 데이터베이스 파일(710)의 제5 페이지(715)에 반영할 수 있다.
동작 819에서, 프로세서(120)는 보안 데이터에 대응하는 WAL 파일을 무효화할 수 있다. WAL 파일을 무효화하는 동작은 상기 체크포인트 동작을 성공한 후, 보안 데이터에 대응하는 WAL 파일을 삭제하는 것일 수 있다. WAL 파일을 무효화하는 동작은 WAL 파일의 크기를 0으로 줄이는 동작(truncate), 또는 보안 데이터에 대응하는 WAL 파일의 프레임을 0으로 덮어쓰기 하는 동작을 포함할 수 있다. 프로세서(120)는 전자 장치(101)의 메모리(예: 도 1의 메모리(130))의 저장 공간에 기반하여 줄이는 동작 또는 덮어쓰기 동작 중 어느 하나의 동작을 수행할 수 있다. 상기 줄이는 동작은 WAL 파일의 크기를 0으로 줄이는 것이고, 상기 덮어쓰기 동작은 WAL 파일의 크기는 유지한 상태에서 보안 데이터에 대응하는 WAL 파일의 프레임을 0으로 덮어쓰기 하는 것일 수 있다. 메모리(130)의 저장 공간은 메모리(130)에 저장할 수 있는 여유 공간을 의미할 수 있다. 프로세서(120)는 메모리(130)의 저장 공간이 설정된 크기 이상인 경우, 덮어쓰기 동작을 수행하고, 메모리(130)의 저장 공간이 설정된 크기 미만인 경우, 줄이는 동작을 수행할 수 있다.
도 9a는 다양한 실시예들에 따른 전자 장치에서 보안 데이터를 설정하는 방법을 도시한 흐름도(900)이다.
도 9a를 참조하면, 동작 901에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251)) 연결을 오픈할 수 있다. 어플리케이션을 실행하거나, 어플리케이션 데이터를 업데이트(예: 읽기, 추가, 수정, 삭제)하기 위해서는 데이터베이스 파일(251)을 오픈해야 할 수 있다.
동작 903에서, 프로세서(120)는 상기 오픈한 데이터베이스 파일(251)에 대하여 메모리에 보안 속성이 설정되었는지 여부를 판단할 수 있다. 데이터베이스 파일(251)의 전체, 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼에 보안 설정할 수 있다. 어플리케이션 개발자는 데이터베이스 파일(251)의 전체, 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼에 보안 속성을 부여할 수 있다. 보안 속성은 어플리케이션 개발자가 설정된 값에 따라 메모리(예: 도 1의 휘발성 메모리(132))에 업데이트되거나, 스토리지(예: 도 1의 비휘발성 메모리(134))에 저장될 수 있다.
프로세서(120)는 상기 오픈한 데이터베이스 파일(251)에 대하여 메모리에 보안 설정된 경우 동작 905를 수행하고, 상기 오픈한 데이터베이스 파일(251)에 대하여 메모리에 보안 설정되지 않은 경우 동작 907을 수행할 수 있다.
상기 오픈한 데이터베이스 파일(251)에 대하여 메모리에 보안 설정된 경우 동작 905에서, 프로세서(120)는 상기 메모리에 상기 오픈한 데이터베이스 파일(251) 전체 또는 설정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 적용할 수 있다. 예를 들어, 프로세서(120)는 데이터베이스 파일(251)의 테이블 1(예: SQLiteDatabase. openDatabase(secure_data: table1))에 보안 속성이 설정되도록 적용할 수 있다. 보안 속성은 메모리 상의 지정된 위치에 저장될 수 있다. 저장되는 위치는 보안 속성이 설정된 종류(예: 데이터베이스 파일(251) 전체, 지정된 테이블, 테이블의 지정된 컬럼)에 따라서 다를 수 있다. 메모리 상에 저장되는 내용은 데이터베이스 파일(251)을 오픈하면, 생성되는 데이터베이스 연결과 동일한 생명 주기를 가질 수 있다. 오픈한 데이터베이스 파일(251)의 연결에 대해 보안 데이터 설정이 한번 완료되면, 해당 연결을 사용한 변경 및 삭제 작업에서 보안 삭제가 보장될 수 있다.
상기 오픈한 데이터베이스 파일(251)에 대하여 메모리에 보안 설정되지 않은 경우 동작 911에서, 프로세서(120)는 스토리지에 설정되었는지 판단할 수 있다. 프로세서(120)는 스토리지에 설정된 경우 동작 911을 수행하고, 스토리지에 설정되지 않은 경우 도 9B를 수행할 수 있다.
상기 스토리지에 설정된 경우 동작 913에서, 프로세서(120)는 상기 스토리지에 상기 스토리지에 상기 오픈한 데이터베이스 파일(251) 전체 또는 설정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 적용할 수 있다. 보안 속성을 메모리 상에만 유지하는 경우, 데이터베이스 파일(251)의 연결이 새로 생성될 때 마다 보안 속성을 다시 설정해야 한다. 또한, 데이터베이스 파일(251)의 여러 연결에서 보안 속성의 설정이 다를 수 있다. 스토리지에 보안 속성이 저장된 경우, 설정한 보안 속성은 데이터베이스 파일(251)에 대한 모든 연결에서 해당 설정을 공유할 수 있고, 설정한 대상(예: 어플리케이션)의 삭제가 이루어지기 전까지 유효할 수 있다. 스토리지에 보안 속성을 설정하는 방법은 기존 데이터베이스 파일의 지정된 위치에 해당 정보를 작성하는 방안(예: 데이터베이스 헤더), 새로운 파일에 해당 정보를 저장하는 방안이 있을 수 있다.
도 9b는 다양한 실시예들에 따른 전자 장치의 응용 계층에서 보안 데이터를 설정하는 방법을 도시한 흐름도(950)이다.
도 9b를 참조하면, 프로세서(120)는 스토리지 및 메모리에 보안 속성이 설정되지 않은 경우 쓰기 트랜잭션을 통해 보안 데이터를 설정할 수 있다. 스토리지 또는 메모리에 보안 속성을 설정하지 않은 경우, 현재 진행할 쓰기 트랜잭션을 보안 쓰기 트랜잭션으로 진행하도록 설정할 수 있다. 상기 쓰기 트랜잭션은 변경(update) 또는 삭제(delete)하는 트랜잭션에 해당할 수 있다. 상기 보안 쓰기 트랜잭션은 보안 설정된 데이터를 삭제하는 것일 수 있다. 응용 계층(또는 어플리케이션)은 보안 속성의 설정 단위 또는 설정 타이밍(예: 생명 주기)를 설정 가능할 수 있다. 상기 설정 단위는 데이터베이스 파일(251) 전체, 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼 중 적어도 하나를 포함할 수 있다.
동작 961에서, 프로세서(120)는 데이터베이스 파일(251)에 보안 속성을 설정할 수 있다. 프로세서(120)는 쓰기 트랜잭션 시작 전 데이터베이스 파일(251) 연결에 보안 속성을 설정할 수 있다. 프로세서(120)는 API를 통한 쓰기 트랜잭션, 또는 보안 쿼리를 통한 쓰기 트랜잭션인 경우, 데이터베이스 파일(251)에 보안 속성을 설정할 수 있다.
동작 963에서, 프로세서(120)는 쓰기 트랜잭션을 진행할 수 있다. 응용 계층(또는 어플리케이션)은 보안 쓰기 트랜잭션을 호출하는 API에 따라, 해당 API를 사용자가 호출하면 보안 삭제 기능을 수행하도록 할 수 있다. 예를 들어, 프로세서(120)는 SQLiteDatabase.secure_delete(...)와 같이 API 구문을 이용하여 보안 쓰기 트랜잭션 실행할 수 있다. 보안 설정은 데이터베이스 파일(251) 전체 또는 설정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블(예: SQLiteDatabase.setSecureData("table name")) 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 적용할 수 있다.
보안 쿼리를 통한 쓰기 트랜잭션인 경우 프로세서(120)는 쿼리에 약속된 예약어를 추가할 수 있다. 상기 예약어는 update, delete와 같은 것일 수 있다. 설정된 쿼리(예: update, delete)의 약속된 위치(예: 쿼리 앞 또는 뒤)에 보안 속성과 관련된 설정 값(예: secure)을 삽입하여 SQL(structured query language)을 구성함으로써, 보안 삭제 기능을 설정할 수 있다. 또는, 트랜잭션과 관련된 가장 마지막 위치에 보안 속성과 관련된 문구(예: by Secure Transaction)를 삽입하여 SQL을 구성함으로써, 보안 삭제 기능을 설정할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 SQL 구문을 이용하여 특정 범위에 보안 속성 설정(예: CREATE TABLE 시에 SECURE_DATA Contraint 를 추가)할 수 있다.
보안 설정은 데이터베이스 파일(251) 전체 또는 설정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 적용할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 "CREATE SECURE_DATA TABLE table1"으로 데이터베이스 파일(251)의 테이블 1에 보안 설정할 수 있다. 어플리케이션은 "CREATE TABLE table1 (a SECURE_DATA TEXT ...)"로 데이터베이스 파일(251)의 컬럼에 보안 설정할 수 있다.응용 계층(예: 어플리케이션)은 SECURE_DATA DELETE data from table1와 같이 SQL 구문을 이용하여 보안 쓰기 트랜잭션을 실행할 수 있다. 해당 삭제 동작은 보안 쓰기 트랜잭션으로 수행될 수 있다.
동작 965에서, 프로세서(120)는 보안 데이터 사용 안함으로 설정할 수 있다. 예를 들어, 프로세서(120)는 상기 쓰기 트랜잭션이 완료되면 보안 속성 설정을 취소할 수 있다.
도 10은 다양한 실시예들에 따른 전자 장치의 다른 동작 방법을 도시한 흐름도(1000)이다. 도 10은 부가 파일(예: 도 2의 부가 파일(255))이 롤백 저널 파일인 경우의 동작을 포함할 수 있다.
도 10을 참조하면, 동작 1001에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 보안 데이터의 업데이트를 요청받을 수 있다. 상기 보안 데이터는 어플리케이션 데이터 중 보안 설정된 데이터를 의미하는 것으로, 데이터베이스 파일(251) 전체 또는 원하는 영역(예: 도 2의 데이터베이스 파일(251)의 지정된 테이블, 컬럼)이 어플리케이션 개발자에 의해 설정되거나, 보안 데이터의 업데이트 동작할 때 지정된 트랜잭션에 한해 보안 삭제 기능을 수행하도록 설정될 수 있다. 상기 업데이트는 트랜잭션을 의미하는 것으로, 트랜잭션은 어플리케이션 데이터에 대한 읽기, 추가, 삭제 또는 수정하는 동작을 포함할 수 있다. 상기 업데이트 요청은 보안 데이터를 수정 또는 삭제하는 동작을 포함할 수 있다.
다양한 실시예들에 따르면, 프로세서(120)는 롤백 저널 모드가 persist 모드인지 여부를 판단할 수 있다. persist 모드는 트랜잭션을 위해 작성한 롤백 저널 파일 중 헤더 파일만 무효화시키는 모드일 수 있다. 헤더 부분만 삭제했을 경우 보안 데이터가 롤백 저널 파일에 남아있을 수 있다. 프로세서(120)는 롤백 저널 모드가 persist 모드인 경우 이하 동작 1003 내지 동작 1007을 수행할 있다. 프로세서(120)는 롤백 저널 모드가 persist 모드가 아니거나, 보안 데이터가 아닌 어플리케이션 데이터의 업데이트 요청에 대해서는 기존 롤백 저널 모드의 동작(예: 업데이트하기 전에 데이터베이스 파일(251)에 저장된 어플리케이션 데이터를 상기 롤백 저널 파일에 백업하고, 데이터베이스 파일(251)을 업데이트한 후, 롤백 저널 파일을 무효화시키는 동작)을 수행할 수 있다.
동작 1003에서, 프로세서(120)는 상기 업데이트 요청에 기반하여 롤백 저널 파일(또는 부가 파일)에 원본 어플리케이션 데이터를 백업할 수 있다. 저널 기법은 어플리케이션 데이터를 저장하는 데이터베이스 파일(예: 도 2의 데이터베이스 파일(251)) 외에 롤백 저널 파일(예: 도 2의 부가 파일(255))을 생성하여 활용하는 기법일 수 있다. 부가 파일이 롤백 저널 파일인 경우, 프로세서(120)는 데이터베이스 파일(251)을 업데이트하기 전에 데이터베이스 파일(251)에 저장된 어플리케이션 데이터를 상기 롤백 저널 파일에 백업할 수 있다.
동작 1005에서, 프로세서(120)는 데이터베이스 파일(251)을 업데이트할 수 있다. 데이터베이스 파일(251) 업데이트는 체크포인트 동작으로, 업데이트 요청에 따라 변경된 사항을 데이터베이스 파일(251)에 반영하는 것을 의미할 수 있다. 부가 파일이 롤백 저널 파일인 경우, 프로세서(120)는 업데이트 요청 시마다 데이터베이스 파일(251)을 업데이트할 수 있다.
동작 1007에서, 프로세서(120)는 보안 데이터에 대응하는 롤백 저널 파일을 무효화할 수 있다. 롤백 저널 파일을 무효화하는 동작은 상기 체크포인트 동작을 성공한 후, 보안 데이터에 대응하는 롤백 저널 파일을 삭제하는 것일 수 있다. 롤백 저널 파일을 무효화하는 동작은 롤백 저널 파일의 크기를 0으로 줄이는 동작(truncate), 또는 보안 데이터에 대응하는 롤백 저널 파일을 0으로 덮어쓰기 하는 동작을 포함할 수 있다. 프로세서(120)는 전자 장치(101)의 메모리(예: 도 1의 메모리(130))의 저장 공간에 기반하여 줄이는 동작 또는 덮어쓰기 동작 중 어느 하나의 동작을 수행할 수 있다. 상기 줄이는 동작은 롤백 저널 파일의 크기를 0으로 줄이는 것이고, 상기 덮어쓰기 동작은 롤백 저널 파일의 크기는 유지한 상태에서 보안 데이터에 대응하는 롤백 저널 파일을 0으로 덮어쓰기 하는 것일 수 있다. 메모리(130)의 저장 공간은 메모리(130)에 저장할 수 있는 여유 공간을 의미할 수 있다. 프로세서(120)는 메모리(130)의 저장 공간이 설정된 크기 이상인 경우, 덮어쓰기 동작을 수행하고, 메모리(130)의 저장 공간이 설정된 크기 미만인 경우, 줄이는 동작을 수행할 수 있다.
도 11은 다양한 실시예들에 따른 전자 장치의 응용계층에서 보안 데이터를 설정하는 방법을 도시한 흐름도(1110)이다.
도 11을 참조하면, 동작 1101에서, 다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 1의 프로세서(120))는 보안 쓰기 트랜잭션인지 판단할 수 있다. 상기 보안 쓰기 트랜잭션은 보안 설정된 데이터를 삭제하는 것일 수 있다. 프로세서(120)는 보안 쓰기 트랜잭션인 경우 동작 1103을 수행하고, 보안 쓰기 트랜잭션이 아닌 경우 동작 1105를 수행할 수 있다.
도면에서는 동작 1101을 먼저 수행하고, 동작 1105를 나중에 수행하는 것으로 도시하고 있지만, 동작 1105는 동작 1101보다 먼저 수행되거나, 동작 1101 및 동작 1105는 동시에 수행될 수도 있다. 이는 예시에 불과할 뿐, 설명에 의해 본 발명이 제한되는 것은 아니다.
보안 쓰기 트랜잭션인 경우 동작 1103에서, 프로세서(120)는 API 구문 또는 SQL 구문을 이용하여 보안 쓰기 트랜잭션을 실행할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 SQLiteDatabase.secure_delete(...)와 같이 API 구문을 이용하여 보안 쓰기 트랜잭션 실행할 수 있다. 또는, 응용 계층은 SECURE_DATA DELETE data from table1와 같이 SQL 구문을 이용하여 보안 쓰기 트랜잭션 실행할 수 있다.
보안 쓰기 트랜잭션이 아닌 경우 동작 1105에서, 프로세서(120)는 API를 통한 보안 설정인지 판단할 수 있다. 프로세서(120)는 API를 통한 보안 설정인 경우, 동작 1107을 수행하고, API를 통한 보안 설정이 아닌 경우, 동작 1109를 수행할 수 있다.
API를 통한 보안 설정인 경우, 동작 1107에서, 프로세서(120)는 API를 이용하여 지정된 영역에 보안 설정할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 SQLiteDatabase.setSecureData("table name")와 같이 API 를 이용하여 지정된 영역(예: 데이터베이스 파일(251) 전체 또는 지정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 설정할 수 있다.
API를 통한 보안 설정이 아닌 경우, 동작 1109에서, 프로세서(120)는 SQL 구문을 이용하여 지정된 영역에 보안 설정할 수 있다. 응용 계층(예: 어플리케이션)은 SQL 구문을 이용하여 지정된 영역(예: 데이터베이스 파일(251) 전체 또는 지정된 영역(예: 데이터베이스 파일(251)의 지정된 테이블 또는 데이터베이스 파일(251)의 지정된 컬럼)에 보안 속성을 설정할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 CREATE TABLE 시에 SECURE_DATA Contraint 를 추가하고, CREATE SECURE_DATA TABLE table1과 같이 데이터베이스 파일(251)의 지정된 테이블(예: 테이블 1)에 보안 속성을 설정하거나, CREATE TABLE table1 (a SECURE_DATA TEXT ...)와 같이 데이터베이스 파일(251)의 지정된 컬럼에 보안 속성을 설정할 수 있다.
다양한 실시예들에 따르면, 프로세서(120)는 생명 주기에 대해서 도 11과 동일한 방법으로 설정할 수 있다. 예를 들어, 응용 계층(예: 어플리케이션)은 프레임워크의 제공에 따라 다양한 방법으로 상기 생명 주기를 설정할 수 있다. 상기 생명 주기는 API, 또는 SQL 구문을 이용하여 데이터베이스 파일(251), 데이터베이스(250)의 지정된 테이블, 데이터베이스(250)의 지정된 컬럼에 설정될 수 있다. 상기 생명 주기는 API 구문을 이용한 보안 쓰기 트랜잭션 실행 또는 SQL 구문을 이용하여 보안 쓰기 트랜잭션 실행을 통해 설정될 수 있다.
다양한 실시예들에 따른 전자 장치(예: 도 1의 전자 장치(101))의 동작 방법은 어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받는 동작, 상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하는 동작, 상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하고, 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하는 동작, 및 상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하는 동작을 포함할 수 있다.
상기 제1 보안 데이터 처리 프로세스는, 상기 메모리에 저장된 데이터베이스 파일의 업데이트 권한을 획득하는 동작, 상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하는 동작, 및 상기 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 포함할 수 있다.
상기 제2 보안 데이터 처리 프로세스는, 상기 메모리에 저장된 데이터베이스 파일의 페이지 구조의 변경을 판단하는 동작, 상기 페이지 구조가 변경되지 않은 경우, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하는지 여부를 판단하는 동작, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하지 않는 경우, 상기 데이터베이스 파일의 업데이트 권한을 획득하는 동작, 상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하는 동작, 및 상기 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 포함할 수 있다.
상기 수행하는 동작은, 상기 제1 보안 데이터 처리 프로세스 또는 상기 제2 보안 데이터 처리 프로세스를 실패한 경우, 제3 보안 데이터 처리 프로세스를 수행하는 동작을 더 포함할 수 있다.
상기 제3 보안 데이터 처리 프로세스는, 상기 부가 파일에 상기 보안 데이터에 대응하는 프레임을 추가하는 동작, 상기 보안 데이터 처리를 위한 스레드를 생성하는 동작, 상기 보안 데이터에 생명 주기가 설정된 경우, 상기 생명 주기만큼 상기 업데이트 동작을 대기하고, 상기 생명 주기가 지난 후, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하는 동작, 상기 보안 데이터에 생명 주기가 설정되지 않은 경우, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하는 동작, 및 상기 업데이트가 완료되면 상기 보안 데이터에 대응하는 부가 파일을 무효화하는 동작을 포함할 수 있다.
상기 무효화하는 동작은, 상기 메모리의 저장 공간에 기반하여 상기 보안 데이터에 대응하는 상기 부가 파일의 크기를 줄이는 동작, 또는 상기 부가 파일의 프레임을 덮어쓰기 하는 동작 중 어느 하나의 동작을 수행하여 상기 부가 파일을 무효화하는 동작을 포함할 수 있다.
상기 방법은, 상기 메모리에 저장된 데이터베이스 파일을 오픈하면, 상기 데이터베이스 파일에 대한 스토리지에 보안 속성이 설정되었는지 판단하는 동작, 상기 스토리지에 보안 속성이 설정된 경우, 상기 오픈된 데이터베이스 파일 전체에 보안 속성을 적용하는 동작, 상기 스토리지에 보안 속성이 설정되지 않은 경우, 메모리에 보안 속성이 설정되었는지 판단하는 동작, 및 상기 메모리에 보안 속성이 설정된 경우, 상기 메모리에 설정된 값을 리드하여 보안 데이터에 대응하는 업데이트를 수행하는 동작을 더 포함하고, 상기 스토리지의 보안 속성은, 상기 데이터베이스 파일에 대응하는 어플리케이션이 삭제될 때까지 상기 보안 속성이 유지되는 특성을 갖고, 상기 메모리의 보안 속성은 상기 데이터베이스 파일의 연결에 대응하여 상기 보안 속성이 유지되는 특성을 갖는 것일 수 있다.
본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.
본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제1", "제2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제1) 구성요소가 다른(예: 제2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.
본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다.
본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, '비일시적'은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.
일실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.
다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.
본 명세서와 도면에 개시된 본 발명의 다양한 실시 예들은 본 발명의 기술 내용을 쉽게 설명하고 본 발명의 이해를 돕기 위해 특정 예를 제시한 것일 뿐이며, 본 발명의 범위를 한정하고자 하는 것은 아니다. 따라서 본 발명의 범위는 여기에 개시된 실시 예들 이외에도 본 발명의 기술적 사상을 바탕으로 도출되는 모든 변경 또는 변형된 형태가 본 발명의 범위에 포함되는 것으로 해석되어야 한다.

Claims (15)

  1. 전자 장치에 있어서,
    디스플레이;
    메모리; 및
    상기 디스플레이 또는 상기 메모리와 작동적으로 연결된 프로세서를 포함하고, 상기 프로세서는,
    어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받고,
    상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하고,
    상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하거나, 또는 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하고,
    상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하도록 설정된 전자 장치.
  2. 제1항에 있어서, 상기 제1 보안 데이터 처리 프로세스는,
    상기 메모리에 저장된 데이터베이스 파일의 업데이트 권한을 획득하고,
    상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고,
    상기 업데이트가 완료되면 상기 업데이트 권한을 반납하도록 설정된 전자 장치.
  3. 제1항에 있어서, 상기 제2 보안 데이터 처리 프로세스는,
    상기 메모리에 저장된 데이터베이스 파일의 페이지 구조의 변경을 판단하고,
    상기 페이지 구조가 변경되지 않은 경우, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하는지 여부를 판단하고,
    상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하지 않는 경우, 상기 데이터베이스 파일의 업데이트 권한을 획득하고,
    상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고,
    상기 업데이트가 완료되면 상기 업데이트 권한을 반납하도록 설정된 전자 장치.
  4. 제1항에 있어서, 상기 프로세서는,
    상기 제1 보안 데이터 처리 프로세스 또는 상기 제2 보안 데이터 처리 프로세스를 실패한 경우, 제3 보안 데이터 처리 프로세스를 수행하도록 설정된 전자 장치.
  5. 제4항에 있어서, 상기 제3 보안 데이터 처리 프로세스는,
    상기 부가 파일에 상기 보안 데이터에 대응하는 프레임을 추가하고,
    상기 보안 데이터 처리를 위한 스레드를 생성하고,
    상기 보안 데이터에 설정된 생명 주기에 기반하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하고,
    상기 업데이트가 완료되면 상기 보안 데이터에 대응하는 부가 파일을 무효화하도록 설정된 전자 장치.
  6. 제5항에 있어서, 상기 프로세서는,
    상기 보안 데이터에 생명 주기가 설정된 경우, 상기 생명 주기만큼 상기 업데이트 동작을 대기하고, 상기 생명 주기가 지난 후, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하고,
    상기 보안 데이터에 생명 주기가 설정되지 않은 경우, 상기 부가 파일의 업데이트 조건에 만족하는지 여부를 판단하고, 상기 업데이트 조건에 만족하는 경우, 상기 데이터베이스 파일에 대한 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일의 업데이트를 시도하도록 설정된 전자 장치.
  7. 제6항에 있어서, 상기 프로세서는,
    상기 시도한 업데이트가 실패하는 경우, 설정된 조건에 만족하는지 여부를 판단하고,
    상기 설정된 조건에 만족하는 경우, 상기 업데이트 권한을 획득할 때까지 상기 업데이트를 대기하고,
    상기 업데이트 권한을 획득하여 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하도록 설정된 전자 장치.
  8. 제5항에 있어서, 상기 프로세서는,
    상기 보안 데이터에 대응하는 상기 부가 파일의 크기를 줄이거나, 상기 부가 파일의 프레임을 덮어쓰기 하여 상기 부가 파일을 무효화하도록 설정된 전자 장치.
  9. 제8항에 있어서, 상기 프로세서는,
    상기 메모리의 저장 공간에 기반하여 상기 부가 파일의 크기를 줄이거나, 상기 부가 파일의 프레임을 덮어쓰기 하는 동작 중 어느 하나의 동작을 수행하도록 설정된 전자 장치.
  10. 제9항에 있어서, 상기 프로세서는,
    상기 메모리의 저장 공간이 설정된 크기 이상인 경우, 상기 덮어쓰기 동작을 수행하고,
    상기 메모리의 저장 공간이 설정된 크기 미만인 경우, 상기 줄이는 동작을 수행하도록 설정된 전자 장치.
  11. 제1항에 있어서, 상기 프로세서는,
    상기 메모리에 저장된 데이터베이스 파일을 오픈하면, 상기 데이터베이스 파일에 대한 스토리지에 보안 속성이 설정되었는지 판단하고,
    상기 스토리지에 보안 속성이 설정된 경우, 상기 오픈된 데이터베이스 파일 전체에 보안 속성을 적용하도록 설정된 전자 장치.
  12. 제11항에 있어서, 상기 프로세서는,
    상기 스토리지에 보안 속성이 설정되지 않은 경우, 메모리에 보안 속성이 설정되었는지 판단하고,
    상기 메모리에 보안 속성이 설정된 경우, 상기 메모리에 설정된 값을 리드하여 보안 데이터에 대응하는 업데이트를 수행하고,
    상기 스토리지의 보안 속성은, 상기 데이터베이스 파일에 대응하는 어플리케이션이 삭제될 때까지 상기 보안 속성이 유지되는 특성을 갖고,
    상기 메모리의 보안 속성은 상기 데이터베이스 파일의 연결에 대응하여 상기 보안 속성이 유지되는 특성을 갖도록 설정된 전자 장치.
  13. 제12항에 있어서, 상기 보안 속성은,
    상기 데이터베이스 파일의 전체, 상기 데이터베이스 파일의 테이블 또는 컬럼 중 적어도 하나에 설정되는 것인 전자 장치.
  14. 전자 장치의 동작 방법에 있어서,
    어플리케이션 데이터 중 보안 속성이 설정된 보안 데이터의 업데이트를 요청받는 동작;
    상기 보안 데이터에 대응하는 부가 파일의 상태를 식별하는 동작;
    상기 식별된 부가 파일의 상태가 무효인 상태인 경우, 제1 보안 데이터 처리 프로세스를 결정하고, 상기 식별된 부가 파일의 상태가 유효인 상태인 경우, 제2 보안 데이터 처리 프로세스를 결정하는 동작; 및
    상기 결정된 보안 데이터 처리 프로세스에 따라 상기 보안 데이터의 업데이트를 수행하는 동작을 포함하는 방법.
  15. 제14항에 있어서,
    상기 제1 보안 데이터 처리 프로세스는,
    상기 메모리에 저장된 데이터베이스 파일의 업데이트 권한을 획득하는 동작;
    상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하는 동작; 및
    상기 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 포함하고,
    상기 제2 보안 데이터 처리 프로세스는,
    상기 메모리에 저장된 데이터베이스 파일의 페이지 구조의 변경을 판단하는 동작;
    상기 페이지 구조가 변경되지 않은 경우, 상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하는지 여부를 판단하는 동작;
    상기 보안 데이터에 대응하는 페이지가 상기 부가 파일에 존재하지 않는 경우, 상기 데이터베이스 파일의 업데이트 권한을 획득하는 동작;
    상기 부가 파일 없이 상기 보안 데이터에 대응하여 상기 데이터베이스 파일을 업데이트하는 동작; 및
    상기 업데이트가 완료되면 상기 업데이트 권한을 반납하는 동작을 포함하는 방법.
PCT/KR2021/019959 2021-03-05 2021-12-27 보안 데이터 처리 방법 및 장치 WO2022186460A1 (ko)

Priority Applications (3)

Application Number Priority Date Filing Date Title
CN202180095205.0A CN116897351A (zh) 2021-03-05 2021-12-27 安全性数据处理方法和装置
EP21929322.2A EP4290398A1 (en) 2021-03-05 2021-12-27 Security data processing method and device
US18/455,224 US20230409733A1 (en) 2021-03-05 2023-08-24 Security data processing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR10-2021-0029539 2021-03-05
KR1020210029539A KR20220125557A (ko) 2021-03-05 2021-03-05 보안 데이터 처리 방법 및 장치

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US18/455,224 Continuation US20230409733A1 (en) 2021-03-05 2023-08-24 Security data processing method and device

Publications (1)

Publication Number Publication Date
WO2022186460A1 true WO2022186460A1 (ko) 2022-09-09

Family

ID=83155405

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2021/019959 WO2022186460A1 (ko) 2021-03-05 2021-12-27 보안 데이터 처리 방법 및 장치

Country Status (5)

Country Link
US (1) US20230409733A1 (ko)
EP (1) EP4290398A1 (ko)
KR (1) KR20220125557A (ko)
CN (1) CN116897351A (ko)
WO (1) WO2022186460A1 (ko)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090111850A (ko) * 2007-01-23 2009-10-27 인터내셔널 비지네스 머신즈 코포레이션 트랜잭션 시스템에서의 보안 데이터 삭제
KR101442489B1 (ko) * 2013-12-16 2014-09-26 주식회사 시큐브 보안키를 이용한 스마트기기의 보안파일 접근 제어 장치 및 방법
KR20170019799A (ko) * 2015-08-12 2017-02-22 삼성전자주식회사 파일 시스템을 제어하는 전자 장치 및 그 동작 방법
US20170083254A1 (en) * 2015-09-19 2017-03-23 Qualcomm Incorporated Secure transaction management techniques
US20210026831A1 (en) * 2019-07-23 2021-01-28 Hewlett Packard Enterprise Development Lp Updating subscriber nodes with replication logs that increase scalability

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20090111850A (ko) * 2007-01-23 2009-10-27 인터내셔널 비지네스 머신즈 코포레이션 트랜잭션 시스템에서의 보안 데이터 삭제
KR101442489B1 (ko) * 2013-12-16 2014-09-26 주식회사 시큐브 보안키를 이용한 스마트기기의 보안파일 접근 제어 장치 및 방법
KR20170019799A (ko) * 2015-08-12 2017-02-22 삼성전자주식회사 파일 시스템을 제어하는 전자 장치 및 그 동작 방법
US20170083254A1 (en) * 2015-09-19 2017-03-23 Qualcomm Incorporated Secure transaction management techniques
US20210026831A1 (en) * 2019-07-23 2021-01-28 Hewlett Packard Enterprise Development Lp Updating subscriber nodes with replication logs that increase scalability

Also Published As

Publication number Publication date
US20230409733A1 (en) 2023-12-21
KR20220125557A (ko) 2022-09-14
EP4290398A1 (en) 2023-12-13
CN116897351A (zh) 2023-10-17

Similar Documents

Publication Publication Date Title
EP3843356A1 (en) Management method for model files and terminal device
WO2022030903A1 (ko) 어플리케이션 설치 방법 및 이를 지원하는 전자 장치
WO2022186460A1 (ko) 보안 데이터 처리 방법 및 장치
WO2023149647A1 (ko) 전자 장치 및 이의 동작 방법
WO2023058860A1 (ko) 멀티 서명된 apk 파일을 처리하는 전자 장치 및 그 동작 방법
WO2022097973A1 (ko) 전자 장치 및 이를 이용한 스토리지 관리 방법
WO2022154414A1 (ko) 전자 장치 및 전자 장치의 스토리지 운영 방법
WO2022177162A1 (ko) 어플리케이션의 모델 파일을 초기화하는 프로세서 및 이를 포함하는 전자 장치
WO2022154262A1 (ko) 예약 공간에 기반한 데이터베이스 업데이트 방법 및 장치
WO2022080652A1 (ko) 저널 파일을 관리하는 전자 장치 및 이의 동작 방법
WO2022240031A1 (ko) 전자 장치 및 전자 장치의 파일 관리 방법
WO2023101195A1 (ko) 전자 장치 및 전자 장치의 파일 시스템 운영 방법
WO2022191454A1 (ko) 블록 장치 이미지에 대한 런타임 체크섬 검증을 수행하는 전자 장치 및 이의 동작 방법
WO2023153768A1 (ko) 전자 장치에서 데이터베이스 파일을 복구하는 방법
WO2023085619A1 (ko) 데이터베이스를 복구하는 전자 장치 및 그 동작 방법
WO2023113251A1 (ko) 파일 탐색을 위한 전자 장치의 동작 방법 및 그 전자 장치
WO2024136341A1 (ko) 전자 시스템과 상기 전자 시스템을 관리하는 방법
WO2024112034A1 (ko) 전자 장치 및 전자 장치의 파일 시스템 운영 방법
WO2024034841A1 (ko) 지정된 이벤트에 기반하여 파일을 컴파일하기 위한 전자 장치 및 그 방법
WO2022191455A1 (ko) 파일 리댁션을 수행하는 전자 장치 및 이의 동작 방법
WO2023101294A1 (ko) 저장 공간을 관리하기 위한 전자 장치 및 전자 장치의 동작 방법
WO2023075086A1 (ko) 캐시 손상을 관리하는 장치 및 그 동작 방법
WO2022211285A1 (ko) 메모리를 관리하기 위한 전자 장치 및 그의 동작 방법
WO2023085589A1 (ko) 전자 장치의 초기화 상황에서 데이터 보존 방법 및 그 전자 장치
WO2022119110A1 (ko) 하이퍼바이저를 이용한 가상 머신 모니터링 방법 및 이를 지원하는 전자 장치

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

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180095205.0

Country of ref document: CN

ENP Entry into the national phase

Ref document number: 2021929322

Country of ref document: EP

Effective date: 20230905

NENP Non-entry into the national phase

Ref country code: DE