KR20240044287A - Electronic device and method for protecting data using the same - Google Patents

Electronic device and method for protecting data using the same Download PDF

Info

Publication number
KR20240044287A
KR20240044287A KR1020220146318A KR20220146318A KR20240044287A KR 20240044287 A KR20240044287 A KR 20240044287A KR 1020220146318 A KR1020220146318 A KR 1020220146318A KR 20220146318 A KR20220146318 A KR 20220146318A KR 20240044287 A KR20240044287 A KR 20240044287A
Authority
KR
South Korea
Prior art keywords
data file
model
hash value
space
model data
Prior art date
Application number
KR1020220146318A
Other languages
Korean (ko)
Inventor
황보람
이상우
이은택
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to PCT/KR2023/014703 priority Critical patent/WO2024071927A1/en
Publication of KR20240044287A publication Critical patent/KR20240044287A/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/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/06Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols the encryption apparatus using shift registers or memories for block-wise or stream coding, e.g. DES systems or RC4; Hash functions; Pseudorandom sequence generators
    • H04L9/0643Hash functions, e.g. MD5, SHA, HMAC or f9 MAC
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2221/00Indexing scheme relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/21Indexing scheme relating to G06F21/00 and subgroups addressing additional information or applications relating to security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F2221/2141Access rights, e.g. capability lists, access control lists, access tables, access matrices

Abstract

본 개시의 다양한 실시예들에 따른 전자 장치는, 메모리, 및 상기 메모리와 작동적으로 연결된 프로세서를 포함하며, 상기 메모리는, 실행될 때, 상기 프로세서가, 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하고, 하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하고, 커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하고, 상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하고, 상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하도록 하는 인스트럭션들(instructions)을 저장할 수 있다. 본 개시의 다양한 실시예들 이외의 다른 다양한 실시예가 가능하다.An electronic device according to various embodiments of the present disclosure includes a memory and a processor operatively connected to the memory, wherein when the memory is executed, the processor performs an operation according to application execution based on a model data file. When started, the model data file is loaded from the memory, a hash value for the model data file is calculated in the hypervisor space, stored together with model-related information about the model data file, and based on a timer created in the kernel space. Calculate the hash value of the loaded model data file in the hypervisor space, compare the calculated hash value with the stored hash value to confirm identity, and if the hash values are not the same according to the comparison, the model You can store instructions that determine whether a data file has been modified. Various other embodiments other than the various embodiments of the present disclosure are possible.

Description

전자 장치 및 이를 이용한 데이터 보호 방법 {ELECTRONIC DEVICE AND METHOD FOR PROTECTING DATA USING THE SAME}Electronic devices and data protection methods using the same {ELECTRONIC DEVICE AND METHOD FOR PROTECTING DATA USING THE SAME}

본 발명의 다양한 실시예는, 전자 장치 및 이를 이용한 데이터 보호 방법에 관한 것이다.Various embodiments of the present invention relate to electronic devices and data protection methods using the same.

최근 스마트 폰, 태블릿 PC와 같은 휴대형 전자 장치가 대중화됨에 따라 전자 장치의 하드웨어 및 소프트웨어 또한 비약적으로 발전하여 휴대형 전자 장치의 사용 환경은 PC와 유사해지고 있다. 또한, 인터넷, 앱 스토어 등으로부터 다양한 애플리케이션을 다운로드하여 사용자가 원하는 편리한 기능이 제공되고 있다. Recently, as portable electronic devices such as smart phones and tablet PCs have become popular, the hardware and software of electronic devices have also developed dramatically, and the use environment of portable electronic devices is becoming similar to that of a PC. In addition, convenient functions desired by users are provided by downloading various applications from the Internet, app stores, etc.

이러한 전자 장치는 인공 신경망에 기초한 딥러닝(deep learning) 또는 기계 학습(machine learning)을 통해 학습된 머신 러닝 모델 데이터에 기초하여 다양한 애플리케이션을 실행할 수 있다. These electronic devices can run various applications based on machine learning model data learned through deep learning or machine learning based on artificial neural networks.

그러나, 다양한 애플리케이션이 다운로드 됨에 따라 악성코드, 스파이웨어 를 포함하는 악성 애플리케이션이 휴대형 전자 장치로 유입되어 네트워크 트래픽, 시스템 성능 저하, 파일 삭제, 개인 정보 유출 등의 사이버 공격의 피해를 입히고 있다.However, as various applications are downloaded, malicious applications, including malware and spyware, are introduced into portable electronic devices, causing damage from cyber attacks such as network traffic, system performance degradation, file deletion, and personal information leakage.

특히 학습된 머신 러닝 모델 데이터 파일에 대한 사이버 공격은 애플리케이션의 실행 오류를 일으킬 수 있으며 이에 따라 안전에 위협이 발생하는 것과 같은 치명적인 결과로 이어질 수 있다.In particular, cyber attacks on learned machine learning model data files can cause application execution errors, which can lead to fatal consequences such as safety threats.

본 개시의 다양한 실시예들에 따른 전자 장치는, 메모리 및 상기 메모리와 작동적으로 연결된 프로세서를 포함하며, 상기 메모리는, 실행될 때, 상기 프로세서가, 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하고, 하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하고, 커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하고, 상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하고, 상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하도록 하는 인스트럭션들(instructions)을 저장할 수 있다. An electronic device according to various embodiments of the present disclosure includes a memory and a processor operatively connected to the memory, and when the memory is executed, the processor starts an operation according to the execution of an application based on a model data file. Then, the model data file is loaded from the memory, a hash value for the model data file is calculated in the hypervisor space, stored together with model-related information for the model data file, and based on a timer generated in the kernel space. Calculate the hash value of the loaded model data file in the hypervisor space, compare the calculated hash value with the stored hash value to confirm identity, and if the hash values are not identical according to the comparison, the model data You can store instructions that determine whether a file has been modified.

본 개시의 다양한 실시예들에 따른 전자 장치의 방법은, 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하는 동작, 하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하는 동작, 커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하는 동작, 상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하는 동작, 및 상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하는 동작을 포함할 수 있다.A method of an electronic device according to various embodiments of the present disclosure includes the operation of loading the model data file from the memory when an operation according to execution of an application based on the model data file begins, and the operation of loading the model data file in the hypervisor space. An operation of calculating a hash value and storing it together with model-related information about the model data file, an operation of calculating a hash value of the loaded model data file in the hypervisor space based on a timer generated in the kernel space, the calculation It may include an operation of comparing the hash value with the stored hash value to confirm identity, and an operation of determining that the model data file has been modified if the hash values are not the same according to the comparison.

도 1은, 다양한 실시예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는, 다양한 실시예들에 따른, 전자 장치에서 실행되는 운영 체제의 구조를 도시한 도면이다.
도 3은, 다양한 실시예들에 따른, 전자 장치에서 실행되는 운영 체제 구조의 기능 모듈을 도시한 블록도이다.
도 4는, 다양한 실시예들에 따른, 전자 장치에서 실행되는 운영 체제 구조의 기능 모듈을 도시한 블록도이다.
도 5는 다양한 실시예에 따른, 전자 장치의 데이터 보호 방법을 설명하기 위한 도면이다.
도 6은, 다양한 실시예들에 따른, 전자 장치의 데이터 보호 방법을 도시한 흐름도이다.
도 7은, 다양한 실시예들에 따른, 전자 장치의 데이터 보호 방법을 도시한 흐름도이다.
1 is a block diagram of an electronic device in a network environment, according to various embodiments.
FIG. 2 is a diagram illustrating the structure of an operating system running on an electronic device, according to various embodiments.
FIG. 3 is a block diagram illustrating functional modules of an operating system structure running on an electronic device, according to various embodiments.
FIG. 4 is a block diagram illustrating functional modules of an operating system structure running on an electronic device, according to various embodiments.
FIG. 5 is a diagram for explaining a method of protecting data in an electronic device, according to various embodiments.
FIG. 6 is a flowchart illustrating a method for protecting data in an electronic device, according to various embodiments.
FIG. 7 is a flowchart illustrating a method for protecting data in an electronic device, according to various embodiments.

도 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))로 통합될 수 있다.1 is a block diagram of an electronic device 101 in a network environment 100, according to various embodiments. Referring to FIG. 1, in the network environment 100, the electronic device 101 communicates with the electronic device 102 through a first network 198 (e.g., a short-range wireless communication network) or a second network 199. It is possible to communicate with at least one of the electronic device 104 or the server 108 through (e.g., a long-distance wireless communication network). According to one embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108. According to one embodiment, the electronic device 101 includes a processor 120, a memory 130, an input module 150, an audio 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 may include an antenna module 197. In some embodiments, at least one of these components (eg, the connection terminal 178) may be omitted or one or more other components may be added to the electronic device 101. In some embodiments, some of these components (e.g., sensor module 176, camera module 180, or antenna module 197) are integrated into one component (e.g., display module 160). It can be.

프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.The processor 120, for example, executes software (e.g., program 140) to operate at least one other component (e.g., hardware or software component) of the electronic device 101 connected to the processor 120. It can be controlled and various data processing or calculations can be performed. According to one embodiment, as at least part of data processing or computation, the processor 120 stores commands or data received from another component (e.g., sensor module 176 or communication module 190) in volatile memory 132. The commands or data stored in the volatile memory 132 can be processed, and the resulting data can be stored in the non-volatile memory 134. According to one embodiment, the processor 120 includes a main processor 121 (e.g., a central processing unit or an application processor) or an auxiliary processor 123 that can operate independently or together (e.g., a graphics processing unit, a neural network processing unit ( It may include a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, if the electronic device 101 includes a main processor 121 and a secondary processor 123, the secondary processor 123 may be set to use lower power than the main processor 121 or be specialized for a designated function. You can. The auxiliary processor 123 may be implemented separately from the main processor 121 or as part of it.

보조 프로세서(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) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다. The auxiliary processor 123 may, for example, act on behalf of the main processor 121 while the main processor 121 is in an inactive (e.g., sleep) state, or while the main processor 121 is in an active (e.g., application execution) state. ), together with the main processor 121, at least one of the components of the electronic device 101 (e.g., the display module 160, the sensor module 176, or the communication module 190) At least some of the functions or states related to can be controlled. According to one embodiment, co-processor 123 (e.g., image signal processor or communication processor) may be implemented as part of another functionally related component (e.g., camera module 180 or communication module 190). there is. According to one embodiment, the auxiliary processor 123 (eg, neural network processing unit) may include a hardware structure specialized for processing artificial intelligence models. Artificial intelligence models can be created through machine learning. For example, such learning may be performed in the electronic device 101 itself on which the artificial intelligence model is performed, or may be performed through a separate server (e.g., server 108). Learning algorithms may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but It is not limited. An artificial intelligence model may include multiple artificial neural network layers. Artificial neural networks include deep neural network (DNN), convolutional neural network (CNN), recurrent neural network (RNN), restricted boltzmann machine (RBM), belief deep network (DBN), bidirectional recurrent deep neural network (BRDNN), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the examples described above. In addition to hardware structures, artificial intelligence models may additionally or alternatively include software structures.

메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다. 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. Data may include, for example, input data or output data for software (e.g., program 140) and instructions related thereto. Memory 130 may include volatile memory 132 or non-volatile memory 134.

프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다. The program 140 may be stored as software in the memory 130 and may include, for example, an operating system 142, middleware 144, or application 146.

입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다. The input module 150 may receive commands or data to be used in a component of the electronic device 101 (e.g., the processor 120) from outside the electronic device 101 (e.g., a user). The input module 150 may include, for example, a microphone, mouse, keyboard, keys (eg, buttons), or digital pen (eg, stylus pen).

음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.The sound output module 155 may output sound signals to the outside of the electronic device 101. The sound output module 155 may include, for example, a speaker or a receiver. Speakers 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 the speaker or as part of it.

디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다. The display module 160 can visually provide information to the outside of the electronic device 101 (eg, a user). The display module 160 may include, for example, a display, a hologram device, or a projector, and a control circuit for controlling the device. According to one embodiment, the display module 160 may include a touch sensor configured to detect a touch, or a pressure sensor configured to measure the intensity of force generated by the touch.

오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.The audio module 170 can convert sound into an electrical signal or, conversely, convert an electrical signal into sound. According to one embodiment, the audio module 170 acquires sound through the input module 150, the sound output module 155, or an external electronic device (e.g., directly or wirelessly connected to the electronic device 101). Sound may be output through the electronic device 102 (e.g., speaker or headphone).

센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다. The sensor module 176 detects the operating state (e.g., power or temperature) of the electronic device 101 or the external environmental state (e.g., user state) and generates an electrical signal or data value corresponding to the detected state. can do. According to one embodiment, the sensor module 176 includes, for example, a gesture sensor, a gyro sensor, an air 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, humidity sensor, or light sensor.

인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.The interface 177 may support one or more designated protocols that can be used to connect the electronic device 101 directly or wirelessly with an external electronic device (eg, the electronic device 102). According to one embodiment, 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.

연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.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). According to one embodiment, 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).

햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.The haptic module 179 can convert electrical signals into mechanical stimulation (e.g., vibration or movement) or electrical stimulation that the user can perceive through tactile or kinesthetic senses. According to one embodiment, the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.The camera module 180 can capture still images and moving images. According to one embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.

전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.The power management module 188 can manage power supplied to the electronic device 101. According to one embodiment, the power management module 188 may be implemented as at least a part of, for example, a power management integrated circuit (PMIC).

배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.Battery 189 may supply power to at least one component of electronic device 101. According to one embodiment, the battery 189 may include, for example, a non-rechargeable primary battery, a rechargeable secondary battery, or a fuel cell.

통신 모듈(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)를 확인 또는 인증할 수 있다. Communication module 190 is configured to provide a direct (e.g., wired) communication channel or wireless communication channel between electronic device 101 and an external electronic device (e.g., electronic device 102, electronic device 104, or server 108). It can support establishment and communication through established communication channels. Communication module 190 operates independently of processor 120 (e.g., an application processor) and may include one or more communication processors that support direct (e.g., wired) communication or wireless communication. According to one embodiment, the communication module 190 is a wireless communication module 192 (e.g., a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (e.g., : LAN (local area network) communication module, or power line communication module) may be included. Among these communication modules, the corresponding communication module is a first network 198 (e.g., a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (e.g., legacy It may communicate with an external electronic device 104 through a telecommunication network such as a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (e.g., LAN or WAN). These various types of communication modules may be integrated into one component (e.g., a single chip) or may be implemented as a plurality of separate components (e.g., multiple chips). The wireless communication module 192 uses subscriber information (e.g., 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. The electronic device 101 can be confirmed or authenticated.

무선 통신 모듈(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 이하)를 지원할 수 있다.The wireless communication module 192 may support 5G networks after 4G networks and next-generation communication technologies, for example, NR access technology (new radio access technology). NR access technology provides 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)) can be supported. The wireless communication module 192 may support high frequency bands (eg, mmWave bands), for example, to achieve high data rates. The wireless communication module 192 uses various technologies to secure performance in high frequency bands, for example, beamforming, massive array multiple-input and multiple-output (MIMO), and full-dimensional multiplexing. It can support technologies such as input/output (FD-MIMO: full dimensional MIMO), array antenna, analog beam-forming, or large scale antenna. The wireless communication module 192 may support various requirements specified in the electronic device 101, an external electronic device (e.g., electronic device 104), or a network system (e.g., second network 199). According to one embodiment, the wireless communication module 192 supports Peak data rate (e.g., 20 Gbps or more) for realizing eMBB, loss coverage (e.g., 164 dB or less) for realizing mmTC, or U-plane latency (e.g., 164 dB or less) for realizing URLLC. Example: Downlink (DL) and uplink (UL) each of 0.5 ms or less, or round trip 1 ms or less) can be supported.

안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다. The antenna module 197 may transmit or receive signals or power to or from the outside (eg, an external electronic device). According to one embodiment, the antenna module 197 may include an antenna including a radiator made of a conductor or a conductive pattern formed on a substrate (eg, PCB). According to one embodiment, 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 to the plurality of antennas by, for example, the communication module 190. can be selected Signals or power may be transmitted or received between the communication module 190 and an external electronic device through the at least one selected antenna. According to some embodiments, in addition to the radiator, other components (eg, radio frequency integrated circuit (RFIC)) may be additionally formed as part of the antenna module 197.

다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.According to various embodiments, the antenna module 197 may form a mmWave antenna module. According to one embodiment, a mmWave antenna module includes: a printed circuit board, an RFIC disposed on or adjacent to a first side (e.g., bottom side) of the printed circuit board and capable of supporting a designated high frequency band (e.g., mmWave band); And a plurality of antennas (e.g., array antennas) disposed on or adjacent to the second side (e.g., top or side) of the printed circuit board and capable of transmitting or receiving signals in the designated high frequency band. can do.

상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.At least some of the components are connected to each other through a communication method between peripheral devices (e.g., bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)) and signal ( (e.g. commands or data) can be exchanged with each other.

일실시예에 따르면, 명령 또는 데이터는 제 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 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다. . According to one embodiment, commands 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 of the same or different type as the electronic device 101. According to one embodiment, all or part of the operations performed in the electronic device 101 may be executed in one or more of the external electronic devices 102, 104, or 108. For example, when the electronic device 101 needs to perform a certain function or service automatically or in response to a request from a user or another device, the electronic device 101 may perform the function or service instead of executing the function or service on its own. Alternatively, or additionally, one or more external electronic devices may be requested to perform at least part of the function or service. One or more external electronic devices that have received the request may execute at least part of the requested function or service, or an additional function or service related to the request, and transmit the result of the execution to the electronic device 101. The electronic device 101 may process the result as is or additionally and provide it as at least part of a response to the request. For this purpose, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology can be used. The electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing. In another embodiment, the external electronic device 104 may include an Internet of Things (IoT) device. Server 108 may be an intelligent server using machine learning and/or neural networks. According to one embodiment, the external electronic device 104 or server 108 may be included in the second network 199. The electronic device 101 may be applied to intelligent services (e.g., smart home, smart city, smart car, or healthcare) based on 5G communication technology and IoT-related technology. .

본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.Electronic devices according to various embodiments disclosed in this document may be of various types. Electronic devices may include, for example, portable communication devices (e.g., smartphones), computer devices, portable multimedia devices, portable medical devices, cameras, wearable devices, or home appliances. Electronic devices according to embodiments of this document are not limited to the above-described devices.

본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.The various embodiments of this document and the terms used herein are not intended to limit the technical features described in this document to specific embodiments, and should be understood to include various changes, equivalents, or replacements of the embodiments. In connection with the description of the drawings, similar reference numbers may be used for similar or related components. The singular form of a noun corresponding to an item may include one or more of the above items, unless the relevant context clearly indicates otherwise. As used herein, “A or B”, “at least one of A and B”, “at least one of A or B”, “A, B or C”, “at least one of A, B and C”, and “A Each of phrases such as “at least one of , B, or C” may include any one of the items listed together in the corresponding phrase, or any possible combination thereof. Terms such as "first", "second", or "first" or "second" may be used simply to distinguish one component from another, and to refer to that component in other respects (e.g., importance or order) is not limited. One (e.g., first) component is said to be “coupled” or “connected” to another (e.g., second) component, with or without the terms “functionally” or “communicatively.” When mentioned, it means that any of the components can be connected to the other components directly (e.g. wired), wirelessly, or through a third component.

본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다. The term “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 logic, logic block, component, or circuit, for example. It can be used as A module may be an integrated part or a minimum unit of the parts or a part thereof that performs one or more functions. For example, according to one embodiment, the module may be implemented in the form of an application-specific integrated circuit (ASIC).

본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, ‘비일시적’은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.Various embodiments of the present document are one or more instructions stored in a storage medium (e.g., built-in memory 136 or external memory 138) that can be read by a machine (e.g., electronic device 101). It may be implemented as software (e.g., program 140) including these. For example, a processor (e.g., processor 120) of a device (e.g., electronic device 101) may call at least one command among one or more commands stored from a storage medium and execute it. This allows the device to be operated to perform at least one function according to the at least one instruction called. The one or more instructions may include code generated by a compiler or code that can be executed by an interpreter. A storage medium that can be read by a device may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' only means that the storage medium is a tangible device and does not contain signals (e.g. electromagnetic waves), and this term refers to cases where data is semi-permanently stored in the storage medium. There is no distinction between temporary storage cases.

일실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.According to one embodiment, methods according to various embodiments disclosed in this document may be provided and included in a computer program product. Computer program products are commodities and can be traded between sellers and buyers. The computer program product may be distributed in the form of a machine-readable storage medium (e.g. compact disc read only memory (CD-ROM)) or through an application store (e.g. Play StoreTM) or on two user devices (e.g. It can be distributed (e.g. downloaded or uploaded) directly between smart phones) or online. In the case of online distribution, at least a portion of the computer program product may be at least temporarily stored or temporarily created in a machine-readable storage medium, such as the memory of a manufacturer's server, an application store's server, or a relay server.

다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다. According to various embodiments, each component (e.g., module or program) of the above-described components may include a single or plural entity, and some of the plurality of entities may be separately placed in other components. there is. According to various embodiments, one or more of the components or operations described above may be omitted, or one or more other components or operations may be added. Alternatively or additionally, multiple components (eg, modules or programs) may be integrated into a single component. In this case, the integrated component may perform one or more functions of each component of the plurality of components in the same or similar manner as those performed by the corresponding component of the plurality of components prior to the integration. . According to various embodiments, operations performed by a module, program, or other component may be executed sequentially, in parallel, iteratively, or heuristically, or one or more of the operations may be executed in a different order, or omitted. Alternatively, one or more other operations may be added.

도 2는, 다양한 실시예들에 따른, 전자 장치(예: 도 1의 전자 장치(101)) 의 프로세서(120)(예: 도 1의 프로세서(120))에 의해 실행되는 운영 체제의 구조를 나타낼 수 있다. FIG. 2 shows the structure of an operating system executed by the processor 120 (e.g., the processor 120 of FIG. 1) of an electronic device (e.g., the electronic device 101 of FIG. 1) according to various embodiments. It can be expressed.

일 실시예에 따르면, 프로세서(120)는 메인 프로세서(예: 도 1의 메인 프로세서(121))(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(예: 도 1의 보조 프로세서(123))(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다.According to one embodiment, the processor 120 is a main processor (e.g., the main processor 121 in FIG. 1) (e.g., a central processing unit or an application processor) or a secondary processor that can operate independently or together with the main processor (e.g., the main processor 121 in FIG. 1). may include an auxiliary processor 123 (e.g., a graphics processing unit, a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor).

일 실시예에 따르면 프로세서(120)는 메모리(예: 도 1의 메모리(130))와 작동적으로 연결되어, 메모리(130)에 저장된 운영 체제, 미들 웨어 또는 다양한 어플리케이션과 관련된 권한 또는 속성이 설정된 다양한 명령어 또는 프로세스를 포함하는 명령어들을 실행하여 이에 따라 관련된 다양한 데이터를 로딩하고 다양한 동작을 수행할 수 있다. 예를 들어 프로세서(120)는 머신 러닝 모델을 이용하여 추론을 수행하고 그 결과를 이용하는 다양한 어플리케이션과 관련된 다양한 명령을 실행하기 위해 메모리(130)에 저장된 머신 러닝 모델과 관련된 다양한 데이터를 로딩하고 실행할 수 있다. According to one embodiment, the processor 120 is operatively connected to a memory (e.g., the memory 130 of FIG. 1), and permissions or properties related to an operating system, middleware, or various applications stored in the memory 130 are set. By executing instructions including various instructions or processes, various related data can be loaded and various operations can be performed. For example, the processor 120 may load and execute various data related to the machine learning model stored in the memory 130 to perform inference using the machine learning model and execute various instructions related to various applications using the results. there is.

일 실시예에 따르면 프로세서(120)는 메모리(130)에 저장된 운영 체제를 실행할 수 있으며, 이에 따른 운영 체제 구조는 사용자 공간(user space)(210), 커널 공간(kernel space)(220) 및 하이퍼바이저(hypervisor) 공간(230)을 포함할 수 있다. 프로세서(120)에서 실행되는 운영 체제 구조에 따르면, 메모리(130)에 저장된 명령어들의 실행 권한 또는 속성에 대해, 사용자 공간(210), 커널 공간(220) 및 하이퍼바이저 공간(230)의논리적 분리 구조를 통해 명령어들 또는 프로세스가 실행되도록 할 수 있다. 프로세서(120)는 이러한 운영 체제 구조 하에서 머신 러닝 모델을 이용하는 다양한 어플리케이션을 실행하도록 할 수 있으며, 머신 러닝 모델 데이터에 대한 외부 공격을 차단하여 데이터의 무결성을 보장할 수 있다. According to one embodiment, the processor 120 may execute an operating system stored in the memory 130, and the operating system structure accordingly includes a user space 210, a kernel space 220, and a hyper It may include a hypervisor space 230. According to the operating system structure running on the processor 120, a logical separation structure of the user space 210, kernel space 220, and hypervisor space 230 with respect to execution rights or properties of instructions stored in memory 130. You can cause commands or processes to be executed. The processor 120 can run various applications using machine learning models under this operating system structure and can block external attacks on machine learning model data to ensure the integrity of the data.

다양한 실시예에 따르면 사용자 공간(210)은 특정 어플리케이션이 실행됨에 따라 머신 러닝 모델을 통해 추론이 시작되면, 머신 러닝 모델과 관련된 정보를 커널 공간(220)로 전달할 수 있다. 예를 들면 모델 관련 정보는 모델 식별자(identifier)를 포함할 수 있다. According to various embodiments, when inference begins through a machine learning model as a specific application is executed, the user space 210 may transmit information related to the machine learning model to the kernel space 220. For example, model-related information may include a model identifier.

다양한 실시예에 따르면 어플리케이션은 예를 들면 “com.sec.android.app.sbrowser”와 같은 어플리케이션의 명칭 string에 의해 식별될 수 있다. 다양한 실시예에 따르면 러닝 머신 모델은 예를 들면 “mobilenet”와 같이 모델 명칭 string에 의해 식별될 수 있다. 사용자 공간(210)에서는 다음의 표 1과 같이 특정 어플리케이션이 사용할 수 있는 러닝 머신 모델의 리스트를 관리할 수 있으며, 러닝 머신 모델의 모델 식별자로서 예를 들면 0에서 100까지 비사용중인 숫자가 할당될 수 있다. According to various embodiments, an application may be identified by a name string of the application, such as “com.sec.android.app.sbrowser”. According to various embodiments, a learning machine model may be identified by a model name string, for example, “mobilenet”. In the user space 210, a list of learning machine models that can be used by a specific application can be managed as shown in Table 1 below, and an unused number from 0 to 100, for example, can be assigned as a model identifier for the learning machine model. You can.

IdID appapp modelmodel 00 com.sec.android.app.sbrowsercom.sec.android.app.sbrowser mobilenetmobilenet 1One com.sec.android.app.cameracom.sec.android.app.camera ResnetResnet 22 com.sec.android.app.cameracom.sec.android.app.camera MobilenetMobilenet ...... ...... ......

다양한 실시예에 따르면 사용자 공간(210)에서 러닝 머신 모델이 새로 실행되면, 상술한 리스트에서 어플리케이션 명칭(app string)과 모델 명칭(model string)을 검색할 수 있다. 검색에 따라 해당하는 어플리케이션 명칭과 모델 명칭이 리스트에 없으면 이들 쌍에 대해 새로운 식별자를 부여할 수 있다. According to various embodiments, when a learning machine model is newly executed in the user space 210, the application name (app string) and model name (model string) can be searched from the above-described list. If the corresponding application name and model name are not in the list according to the search, a new identifier can be assigned to this pair.

검색에 따라 해당하는 어플리케이션 명칭과 모델 명칭의 쌍이 리스트에 있으며, 해당 어플리케이션 실행에 따라 해당 모델에 대한 정보를 사용할 수 있다. 또한 해당 어플리케이션이 종료하면 해당 어플리케이션 종료시 해당 어플리케이션(app string)과 관련된 항목 리스트에서 해당 모델에 대한 정보를 삭제할 수 있다. 예를 들어 카메라 앱 종료시 상술한 표 1의 리스트에서 1번 및 2번 항목이 삭제될 수 있다. Depending on the search, pairs of the corresponding application name and model name are in the list, and information about the corresponding model can be used depending on the execution of the application. Additionally, when the application is terminated, information about the model can be deleted from the list of items related to the application (app string). For example, when the camera app is terminated, items 1 and 2 may be deleted from the list in Table 1 described above.

다양한 실시예에 따르면 디바이스 드라이버 또는 syscall은 사용자 공간(210)로부터 전달된 모델 관련 정보를 수신하여 커널 공간(220)으로 전달할 수 있다. According to various embodiments, a device driver or syscall may receive model-related information transmitted from the user space 210 and transmit it to the kernel space 220.

다양한 실시예에 따르면 커널 공간(220)는 사용자 공간(210)으로부터 전달된 모델 관련 정보에 기초하여 머신 러닝 모델 데이터 파일의 속성을 읽기 전용(read only)로 변경하고, 모델 관련 정보를 하이퍼바이저 공간(230)에 전달할 수 있다. According to various embodiments, the kernel space 220 changes the properties of the machine learning model data file to read only based on the model-related information transmitted from the user space 210 and stores the model-related information in the hypervisor space. It can be delivered to (230).

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 모델 관련 정보에 기초하여 머신 러닝 모델 데이터 파일에 대한 해시(hash) 값을 산출하고, 산출된 해시값을 모델 관련 정보와 함께 저장할 수 있다. 하이퍼바이저 공간(230)에서는 산출된 해시값을 예를 들면 메모리(130)에 저장할 수 있다. According to various embodiments, the hypervisor space 230 may calculate a hash value for the machine learning model data file based on model-related information and store the calculated hash value along with the model-related information. In the hypervisor space 230, the calculated hash value can be stored in the memory 130, for example.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 저장된 해시값에 대한 커널 공간(220)의 접근을 차단하도록 할 수 있다.According to various embodiments, the hypervisor space 230 may block access of the kernel space 220 to the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 내부 메모리(240)에 대한 커널 공간(220)의 메모리 관리 테이블의 엔트리 값을 변경함으로써 커널 공간(220)의 접근을 차단할 수 있다. According to various embodiments, the hypervisor space 230 may block access to the kernel space 220 by changing the entry value of the memory management table of the kernel space 220 for the internal memory 240.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 지정된 시간 경과 시 머신 러닝 모델 데이터 파일에 대한 해시값을 새로 생성하고 저장된 해시값과 비교할 수 있다. According to various embodiments, the hypervisor space 230 may generate a new hash value for the machine learning model data file over a specified period of time and compare it with the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 상술한 바와 같은 해시값 비교 동작을 주기적으로 수행할 수 있다. According to various embodiments, the hash value comparison operation as described above may be periodically performed in the hypervisor space 230.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시값 비교 동작을 통해 해시값이 동일한지 여부에 따라 모델 데이터 파일에 대한 인증을 수행할 수 있다. According to various embodiments, authentication of the model data file may be performed based on whether the hash values are the same through a hash value comparison operation in the hypervisor space 230.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시값 비교 동작에 따라 해시값이 일치하지 않으면, 지정된 횟수(예: 3회)만큼 해시값 생성 및 비교 동작을 다시 수행할 수 있다. According to various embodiments, if the hash values do not match according to the hash value comparison operation in the hypervisor space 230, the hash value generation and comparison operations may be performed again a specified number of times (e.g., 3 times).

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시값 비교 동작에 따라 모델 데이터 파일에 대한 인증이 실패하면, 사용자 공간(210)을 통해 모델 데이터 파일을 다시 로딩하도록 하거나 현재 실행중인 어플리케이션을 종료하도록 할 수 있다. According to various embodiments, if authentication of the model data file fails according to the hash value comparison operation in the hypervisor space 230, the model data file is reloaded through the user space 210 or the currently running application is terminated. can do.

도 3은 다양한 실시예들에 따른, 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 2의 프로세서(200))에 의해 실행되는 운영 체제 구조의 기능 모듈을 도시한 블록도이다. FIG. 3 illustrates a functional module of an operating system structure executed by a processor (e.g., processor 200 of FIG. 2) of an electronic device (e.g., electronic device 101 of FIG. 1) according to various embodiments. It is a block diagram.

일 실시예에 따르면, 도 3의 운영 체제 구조는 사용자 공간(예: 도 2의 사용자 공간(210)), 커널 공간(예: 도 2의 커널 공간(220)) 및 하이퍼바이저 공간(예: 도 2의 하이퍼바이저 공간(230))을 포함할 수 있다. According to one embodiment, the operating system architecture of Figure 3 includes user space (e.g., user space 210 of Figure 2), kernel space (e.g., kernel space 220 of Figure 2), and hypervisor space (e.g., Figure 2). It may include 2 hypervisor spaces (230).

다양한 실시예에 따르면 메모리(예: 도 2의 메모리(130))에 저장된 프로그램 또는 어플리케이션이 실행됨에 따라 프로그램 또는 어플리케이션 명령어에 기초하여 프로세서(예: 도 2의 프로세서(120))는 머신 러닝 프레임워크(211)(예: tflite, caffee, pytorch, keras와 같은 머신 러닝 라이브러리)를 실행하고 이에 따라 로딩된 머신 러닝 모델(212)을 통해 추론이 수행될 수 있다. According to various embodiments, as a program or application stored in a memory (e.g., memory 130 of FIG. 2) is executed, the processor (e.g., processor 120 of FIG. 2) uses a machine learning framework based on the program or application instructions. (211) (e.g., machine learning libraries such as tflite, caffee, pytorch, keras) can be executed and inference may be performed through the loaded machine learning model (212).

다양한 실시예에 따르면 사용자 공간(210)의 모델 추론 모듈(예: inference model module)(213)은 머신 러닝 모델(212)에 의한 추론이 시작되기 전 머신 러닝 데이터 파일의 속성을 변경하기 위해 커널 공간(220)에서 실행 가능한 명령어를 호출할 수 있다. According to various embodiments, the model inference module (e.g., inference model module) 213 in the user space 210 is used in the kernel space to change the properties of the machine learning data file before inference by the machine learning model 212 begins. An executable command can be called at (220).

다양한 실시예에 따르면 모델 추론 모듈(213)은 머신 러닝 데이터 파일을 읽고(read) 모델 관련 정보를 커널 공간(220)으로 전달할 수 있다. According to various embodiments, the model inference module 213 may read a machine learning data file and transfer model-related information to the kernel space 220.

다양한 실시예에 따르면 모델 추론 모듈(213)은 머신 러닝 모델(212)의 추론이 종료되기 전에 관련된 동작들을 중단하고 정리하기 위해 커널 공간(220)을 호출할 수 있다. According to various embodiments, the model inference module 213 may call the kernel space 220 to stop and organize related operations before the inference of the machine learning model 212 is terminated.

다양한 실시예에 따르면 모델 추론 모듈(213)은 상술한 동작들을 수행하기 위해 다음의 표 2에 기재된 바와 같은 ioctl을 사용하거나 syscall을 구현할 수 있다. According to various embodiments, the model inference module 213 may use ioctl or implement syscall as shown in Table 2 below to perform the above-described operations.

ioctl 사용Use ioctl syscall 구현syscall implementation #define CMD_CHMOD 0#define CMD_START 1
#define CMD_END 2

ioctl(CMD_CHMOD, File)
fd = open(File, O_RDONLY)
read(fd, buf, size)
ioctl(CMD_START, fd, size, model_id)
..
~ inference ~
...
ioctl(CMD_END, model_id)
exit()
#define CMD_CHMOD 0#define CMD_START 1
#define CMD_END 2

ioctl(CMD_CHMOD, File)
fd = open(File, O_RDONLY)
read(fd, buf, size)
ioctl(CMD_START, fd, size, model_id)
..
~inference~
...
ioctl(CMD_END, model_id)
exit()




model_chmod(File)
fd = open(File, O_RDONLY)
read(fd, buf, size)
model_start(fd, sizse, model_id)
..
~ inference ~
...
model_end(model_id)
exit()




model_chmod(File)
fd = open(File, O_RDONLY)
read(fd, buf, size)
model_start(fd, size, model_id)
..
~inference~
...
model_end(model_id)
exit()

도 3은 모델 추론 모듈(213)이 상술한 동작들을 수행하기 위해 ioctl을 사용하는 예를 나타낼 수 있다. 이경우 모델 추론 모듈(213)이 사용자 공간(210)과 커널 공간(220) 간의 통신을 수행하기 위해 디바이스 드라이버(예: /dev/protect_ml)(221)가 구현될 수 있다. 디바이스 드라이버(221)는 예를 들면 커널 공간(220)에 포함될 수 있다. 한편, syscall이 구현되는 경우 사용자 공간(210)과 커널 공간(220) 간의 통신은 syscall로 구현될 수 있어 디바이스 드라이버(221)가 생략될 수 있다. FIG. 3 may show an example in which the model inference module 213 uses ioctl to perform the above-described operations. In this case, a device driver (e.g., /dev/protect_ml) 221 may be implemented in order for the model inference module 213 to communicate between the user space 210 and the kernel space 220. The device driver 221 may be included in the kernel space 220, for example. Meanwhile, when syscall is implemented, communication between the user space 210 and kernel space 220 can be implemented with syscall, so the device driver 221 can be omitted.

다양한 실시예에 따르면 커널 공간(220)의 모델 보호 모듈(222)은 수신된모델 관련 정보에 기초하여 메모리(예: 도 1의 메모리(130))에 저장된 모델 데이터 파일의 속성을 읽기 전용(read only)로 변경할 수 있다. According to various embodiments, the model protection module 222 of the kernel space 220 read-only (reads) the properties of the model data file stored in memory (e.g., memory 130 in FIG. 1) based on the received model-related information. can be changed to only).

다양한 실시예에 따르면 모델 보호 모듈(222)은 타이머(timer)(223)를 생성할 수 있다. 예를 들면 모델 보호 모듈(222)은 타이머(223)에서 주기적으로 알림이 생성되면 하이퍼바이저 공간(230)의 해시 비교 모듈(232)로 알림이 생성되었음을 전달할 수 있다. According to various embodiments, the model protection module 222 may generate a timer 223. For example, when a notification is periodically generated in the timer 223, the model protection module 222 may transmit that a notification has been created to the hash comparison module 232 in the hypervisor space 230.

일 실시예에 따르면 모델 보호 모듈(222)은 change_ro(), register_timer(), hvc_for_hash(), clean()의 총 네 개의 함수를 포함할 수 있다. According to one embodiment, the model protection module 222 may include a total of four functions: change_ro(), register_timer(), hvc_for_hash(), and clean().

일 실시예에 따르면, 사용자 공간(210)에서 ioctl(예: ioctl(CMD_CHMOD)) 또는 syscall(예: model_chmod syscall)이 수신되면 모델 보호 모듈(222)은 change_ro() 함수에 의해 해당 모델 데이터 파일의 inode 접근 권한 속성을 읽기 전용인(r--r--r--)으로 변경할 수 있다. According to one embodiment, when an ioctl (e.g., ioctl(CMD_CHMOD)) or syscall (e.g., model_chmod syscall) is received in the user space 210, the model protection module 222 changes the corresponding model data file by the change_ro() function. You can change the inode access permission property to read-only (r--r--r--).

일 실시예에 따르면 모델 보호 모듈(222)의 register_timer()와 hvc_for_hash() 함수는 사용자 공간(220)에서 ioctl(예: ioctl(CMD_START)) 또는 syscall(예: model_start syscall)이 수신되는 경우 동작할 수 있다. According to one embodiment, the register_timer() and hvc_for_hash() functions of the model protection module 222 operate when an ioctl (e.g., ioctl(CMD_START)) or syscall (e.g., model_start syscall) is received in the user space 220. You can.

일 실시예에 따르면 register_timer() 함수는 지정된 시간 간격(예: 5분)으로 알림(예: 인터럽트)을 생성하는 타이머를 생성할 수 있다. According to one embodiment, the register_timer() function can create a timer that generates a notification (e.g., interrupt) at a specified time interval (e.g., 5 minutes).

일 실시예에 따르면 hvc_for_hash() 함수는 hypervisor call(hvc)를 통해 알림이 발생하였음을 해시 관리 모듈(231)로 전달하여 해시 등록 및/또는 관리를 요청할 수 있다. 예를 들면 hvc call은 fd(file descriptor), 크기(size), 모델 식별자와 같은 모델 관련 정보를 해시 관리 모듈(231)로 전달할 수 있다. According to one embodiment, the hvc_for_hash() function may transmit the notification that a notification has occurred through a hypervisor call (hvc) to the hash management module 231 to request hash registration and/or management. For example, the hvc call can transmit model-related information such as fd (file descriptor), size, and model identifier to the hash management module 231.

일 실시예에 따르면 clean() 함수는 사용자 공간(210)으로부터의 ioctl(예: ioctl(CMD_END)) 또는 syscall(예: model_end syscall) 수신에 따라 생성된 타이머(223)를 종료시킬 수 있다. 타이머(223)가 종료되었음은 hvc call을 통해 하이퍼바이저 공간(230)으로 전달되어 해시 관리 모듈(231)이 해시 값에 대한 관리를 종료하도록 할 수 있다. According to one embodiment, the clean() function may terminate the timer 223 created upon receipt of an ioctl (e.g., ioctl(CMD_END)) or syscall (e.g., model_end syscall) from the user space 210. The expiration of the timer 223 may be communicated to the hypervisor space 230 through an hvc call, allowing the hash management module 231 to end management of the hash value.

일 실시예에 따르면 타이머(223)는 지정된 시점(예: 5분 마다) 마다 한번씩 동작하도록 할 수 있다. 타이머(223)의 동작에 따라 인터럽트(interrupt)를 수신하면 hvc call을 통해 하이퍼바이저 공간(230)에 전달하여 해시 관리 모듈(231)은 해시값을 산출하고, 해시 비교 모듈(232)은 산출된 해시값을 저장된 해시값과 비교하여 모델 파일의 무결성을 검증할 수 있다.According to one embodiment, the timer 223 may operate once at a designated time point (e.g., every 5 minutes). When an interrupt is received according to the operation of the timer 223, it is transmitted to the hypervisor space 230 through an hvc call, the hash management module 231 calculates the hash value, and the hash comparison module 232 calculates the calculated hash value. The integrity of the model file can be verified by comparing the hash value with the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(231)은 모델 관련 정보에 기초하여 현재 메모리에 로딩된 머신 러닝 모델 데이터 파일에 대한 해시(hash) 값을 산출하고, 산출된 해시값을 모델 관련 정보와 함께 저장할 수 있다. 해시 관리 모듈(231)은 산출된 해시값을 예를 들면 메모리(130)에 저장할 수 있다. According to various embodiments, the hash management module 231 in the hypervisor space 230 calculates a hash value for the machine learning model data file currently loaded in memory based on model-related information, and the calculated hash value. can be saved along with model-related information. The hash management module 231 may store the calculated hash value in, for example, the memory 130.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(231)은 저장된 해시값에 대한 커널 공간(220)의 접근을 차단하도록 할 수 있다.According to various embodiments, the hash management module 231 in the hypervisor space 230 may block access of the kernel space 220 to the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(231)은 내부 메모리(240)에 대한 커널 공간(220)의 메모리 관리 테이블의 엔트리 값을 변경함으로써, 커널 공간(220)이 해시값이 저장된 메모리 공간에 접근하는 것을 차단할 수 있다. According to various embodiments, the hash management module 231 in the hypervisor space 230 changes the entry value of the memory management table of the kernel space 220 for the internal memory 240, so that the kernel space 220 changes the hash value. Access to this stored memory space can be blocked.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서는 지정된 시간 경과 시 현재 메모리 상에 로딩되어 있는 모델 데이터 파일에 대한 해시값을 새로 생성하고 저장된 해시값과 비교할 수 있다. 타이머(223)는 지정된 시점(예: 5분 마다) 마다 한번씩 동작하도록 할 수 있다. 타이머(223)의 동작에 따라 인터럽트(interrupt)를 수신하면 hvc call을 통해 하이퍼바이저 공간(230)에서 해시 관리 모듈(231)은 해시값을 산출하고, 해시 비교 모듈(232)은 산출된 해시값을 저장된 해시값과 비교하여 모델 파일의 무결성을 검증하도록 할 수 있다.According to various embodiments, the hypervisor space 230 may generate a new hash value for the model data file currently loaded in memory when a specified time has elapsed and compare it with the stored hash value. The timer 223 can be set to operate once at a designated time point (e.g., every 5 minutes). When an interrupt is received according to the operation of the timer 223, the hash management module 231 calculates a hash value in the hypervisor space 230 through an hvc call, and the hash comparison module 232 calculates the calculated hash value. The integrity of the model file can be verified by comparing it with the stored hash value.

일 실시예에 따르면 해시 관리 모듈(231)은 create_hash 함수, delete_hash 함수를 포함할 수 있으며, 해시 비교 모듈(232)은 compare_hash 함수를 포함할 수 있다. According to one embodiment, the hash management module 231 may include a create_hash function and a delete_hash function, and the hash comparison module 232 may include a compare_hash function.

일 실시예에 따르면 create_hash 함수는 ioctl과 hvc를 통해 전달받은 파일 디스크립터(fd), 파일 크기(size)와 같은 모델 관련 정보를 이용해 어플리케이션의 사용자 프로세스가 사용하고 있는 모델 파일의 해시 값 (예: SHA-256)을 계산할 수 있다. 산출된 해시 값은 모델 식별자(model id)와 함께 쌍(pair) 형태로 저장될 수 있다. 저장된 해시 값은 이후 파일 데이터 무결성을 검증하기 위한 값으로 사용될 수 있으며, 이에 따라 커널 공간(220)이 보안에 취약하여 공격을 받더라도 커널 공간(220)에서 해시 값이 저장된 메모리에 접근하여 해시 값을 수정하지 못하도록 커널 공간(220)의 접근을 막을 수 있다. 이를 위해 해시 관리 모듈(231)은 커널 공간(220)의 가상 주소 테이블에서 해시 값이 저장된 가상 주소를 지시하는 값을 무효로 설정하여 해시 값이 저장된 메모리 위치로의 접근을 차단할 수 있다.According to one embodiment, the create_hash function uses model-related information such as file descriptor (fd) and file size (size) received through ioctl and hvc to create a hash value (e.g. SHA) of the model file being used by the user process of the application. -256) can be calculated. The calculated hash value can be stored in the form of a pair along with the model identifier (model id). The stored hash value can later be used as a value to verify the integrity of file data. Accordingly, even if the kernel space 220 is vulnerable to security and is attacked, the hash value is retrieved by accessing the memory where the hash value is stored in the kernel space 220. Access to the kernel space 220 can be blocked to prevent modification. To this end, the hash management module 231 may block access to the memory location where the hash value is stored by setting the value indicating the virtual address where the hash value is stored in the virtual address table of the kernel space 220 to invalid.

도 4는 다양한 실시예들에 따른, 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 2의 프로세서(120))에 의해 실행되는 논리적 동작 모듈의 구조를 도시한 블록도이다. FIG. 4 is a block diagram illustrating the structure of a logical operation module executed by a processor (e.g., processor 120 of FIG. 2) of an electronic device (e.g., electronic device 101 of FIG. 1) according to various embodiments. It is also a degree.

일 실시예에 따르면, 도 4의 프로세서 구조는 사용자 공간(예: 도 2의 사용자 공간(210)), 커널 공간(예: 도 2의 커널 공간(220)) 및 하이퍼바이저 공간(예: 도 2의 하이퍼바이저 공간(230))으을 포함할 수 있다. According to one embodiment, the processor architecture of Figure 4 includes user space (e.g., user space 210 in Figure 2), kernel space (e.g., kernel space 220 in Figure 2), and hypervisor space (e.g., Figure 2). It may include a hypervisor space (230).

다양한 실시예에 따르면 메모리(예: 도 2의 메모리(130))에 저장된 프로그램 또는 어플리케이션이 실행됨에 따라 프로그램 또는 어플리케이션 명령어에 기초하여 프로세서(예: 도 2의 프로세서(120))는 머신 러닝 프레임워크(311)(예: tflite, caffee, pytorch, keras와 같은 머신 러닝 라이브러리)를 실행하고 이에 따라 로딩된 머신 러닝 모델(312)을 통해 추론이 수행될 수 있다. According to various embodiments, as a program or application stored in a memory (e.g., memory 130 of FIG. 2) is executed, the processor (e.g., processor 120 of FIG. 2) uses a machine learning framework based on the program or application instructions. 311 (e.g., machine learning libraries such as tflite, caffee, pytorch, keras) can be executed and inference may be performed through the loaded machine learning model 312.

다양한 실시예에 따르면 사용자 공간(210)의 모델 추론 모듈(예: inference model module)(313)은 머신 러닝 모델(312)에 의한 추론이 시작되기 전 커널 공간(220)을 호출하여 머신 러닝 데이터 파일의 속성을 변경하도록 할 수 있다. According to various embodiments, the model inference module (e.g., inference model module) 313 of the user space 210 calls the kernel space 220 before inference by the machine learning model 312 starts to file a machine learning data file. You can change the properties of .

다양한 실시예에 따르면 모델 추론 모듈(313)은 머신 러닝 데이터 파일을 읽고(read) 커널 공간(220)을 호출할 수 있다. According to various embodiments, the model inference module 313 may read a machine learning data file and call the kernel space 220.

다양한 실시예에 따르면 모델 추론 모듈(313)은 머신 러닝 모델(312)의 어플리케이션이 종료되기 전에 관련된 동작들을 중단하고 정리하기 위해 커널 공간(220)을 호출할 수 있다. According to various embodiments, the model inference module 313 may call the kernel space 220 to stop and organize related operations before the application of the machine learning model 312 is terminated.

다양한 실시예에 따르면 모델 추론 모듈(313)은 상술한 동작들을 수행하기 위해 상술한 표 2에 기재된 바와 같은 syscall을 구현할 수 있다. According to various embodiments, the model inference module 313 may implement a syscall as described in Table 2 above to perform the above-described operations.

일 실시예에 따르면, 도 4는 모델 추론 모듈(313)이 상술한 동작들을 수행하기 위해 syscall을 사용하는 예를 나타낼 수 있다. 이경우 모델 추론 모듈(313)이 사용자 공간(210)과 커널 공간(220) 간의 통신을 수행하기 위해 syscall을 사용할 수 있다. 이에 따라 도 3에 도시된 바와 같은 디바이스 드라이버(221)가 생략될 수 있다. 도 4의 구성은 디바이스 드라이버(221)를 제외하고는 도 3의 구성의 기능과 유사할 수 있으며, 상세한 설명은 이하 생략할 수 있다.According to one embodiment, Figure 4 may show an example in which the model inference module 313 uses a syscall to perform the above-described operations. In this case, the model inference module 313 may use a syscall to perform communication between the user space 210 and the kernel space 220. Accordingly, the device driver 221 as shown in FIG. 3 may be omitted. The configuration of FIG. 4 may be similar in function to the configuration of FIG. 3 except for the device driver 221, and detailed descriptions may be omitted below.

다양한 실시예에 따르면 커널 공간(220)의 모델 보호 모듈(322)은 수신된모델 관련 정보에 기초하여 메모리(예: 도 2의 내부 메모리(240))에 저장된 모델 데이터 파일의 속성을 읽기 전용(read only)로 변경할 수 있다. According to various embodiments, the model protection module 322 of the kernel space 220 read-only (read-only) properties of a model data file stored in memory (e.g., internal memory 240 of FIG. 2) based on the received model-related information. You can change it to read only).

다양한 실시예에 따르면 모델 보호 모듈(322)은 타이머(timer)(323)를 생성할 수 있다. 타이머(323)에서 주기적으로 생성되는 알림은 하이퍼바이저 공간(230)의 해시 비교 모듈(332)로 전달될 수 있다. According to various embodiments, the model protection module 322 may generate a timer 323. A notification periodically generated by the timer 323 may be delivered to the hash comparison module 332 in the hypervisor space 230.

일 실시예에 따르면 모델 보호 모듈(322)은 change_ro(), register_timer(), hvc_for_hash(), clean()의 총 네 개의 함수로 구성될 수 있다. 네 개의 함수의 기능은 도 2를 참조하여 설명한 기능과 유사하며 여기서는 그 상세한 설명은 생략한다. According to one embodiment, the model protection module 322 may be composed of a total of four functions: change_ro(), register_timer(), hvc_for_hash(), and clean(). The functions of the four functions are similar to those described with reference to FIG. 2, and detailed descriptions thereof are omitted here.

일 실시예에 따르면, 사용자 공간(210)에서 syscall(예: model_chmod syscall)이 수신되면 모델 보호 모듈(322)은 해당 모델 데이터 파일의 inode 접근 권한 속성을 읽기 전용인(r--r--r--)으로 변경하고, hvc call을 통해 fd(), 크기(size), 모델 식별자와 같은 모델 관련 정보를 해시 관리 모듈(331)로 전달할 수 있다. According to one embodiment, when a syscall (e.g., model_chmod syscall) is received from the user space 210, the model protection module 322 sets the inode access permission attribute of the corresponding model data file to read-only (r--r--r). --), and model-related information such as fd(), size, and model identifier can be transmitted to the hash management module 331 through hvc call.

일 실시예에 따르면 타이머(323)는 지정된 시점(예: 5분 마다) 마다 한번씩 동작하여, 하이퍼바이저 공간(230)에서 해시 관리 모듈(331)은 새로 산출하는 해시값을 해시 비교 모듈(332)이 저장된 해시값과 비교하도록 하여 모델 파일의 무결성을 검증하도록 할 수 있다.According to one embodiment, the timer 323 operates once at a designated point in time (e.g., every 5 minutes), and the hash management module 331 in the hypervisor space 230 compares the newly calculated hash value to the hash comparison module 332. The integrity of the model file can be verified by comparing it with the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(331)은 모델 관련 정보에 기초하여 머신 러닝 모델 데이터 파일에 대한 해시(hash) 값을 산출하고, 산출된 해시값을 모델 관련 정보와 함께 저장할 수 있다. 해시 관리 모듈(231)은 산출된 해시값을 예를 들면 내부 메모리(240)에 저장할 수 있다. According to various embodiments, the hash management module 331 in the hypervisor space 230 calculates a hash value for the machine learning model data file based on model-related information, and combines the calculated hash value with model-related information and You can save them together. The hash management module 231 may store the calculated hash value in, for example, the internal memory 240.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(331)은 저장된 해시값에 대한 커널 공간(220)의 접근을 차단하도록 할 수 있다.According to various embodiments, the hash management module 331 in the hypervisor space 230 may block access of the kernel space 220 to the stored hash value.

다양한 실시예에 따르면 하이퍼바이저 공간(230)에서 해시 관리 모듈(331)은 내부 메모리(240)에 대한 커널 공간(220)의 메모리 관리 테이블의 엔트리 값을 변경함으로써, 커널 공간(220)이 해시값이 저장된 메모리 공간에 접근하는 것을 차단할 수 있다. According to various embodiments, the hash management module 331 in the hypervisor space 230 changes the entry value of the memory management table of the kernel space 220 for the internal memory 240, so that the kernel space 220 changes the hash value. Access to this stored memory space can be blocked.

다양한 실시예에 따라 학습된 머신 러닝 모델 데이터 파일과 같은 전자 장치가 저장하는 데이터에 대한 커널(Kernel) 공격에 대응하여 데이터의 무결성(integrity)를 보장해야 할 필요성이 있다. There is a need to ensure the integrity of data in response to kernel attacks on data stored by electronic devices, such as machine learning model data files learned according to various embodiments.

본 문서에서 이루고자 하는 기술적 과제는 이상에서 언급한 기술적 과제로 제한되지 않으며, 언급되지 않은 또다른 기술적 과제들은 아래의 기재로부터 본 발명이 속하는 기술분야에서 통상의 지식을 가진 자에게 명확하게 이해될 수 있을 것이다. The technical problem to be achieved in this document is not limited to the technical problem mentioned above, and other technical problems not mentioned can be clearly understood by those skilled in the art from the description below. There will be.

다양한 실시예에 따른 전자 장치는, 메모리(예: 도 1의 메모리(130)), 및 상기 메모리와 작동적으로 연결된 프로세서(예: 도 1의 프로세서(120))를 포함하며, 상기 메모리는, 실행될 때, 상기 프로세서가, 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하고, 하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하고, 커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하고, 상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하고, 상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하도록 하는 인스트럭션들(instructions)을 저장할 수 있다. An electronic device according to various embodiments includes a memory (e.g., memory 130 of FIG. 1) and a processor (e.g., processor 120 of FIG. 1) operatively connected to the memory, wherein the memory includes, When executed, the processor loads the model data file from the memory when an operation according to application execution based on the model data file begins, calculates a hash value for the model data file in the hypervisor space, and generates the model data file. Store it with model-related information, calculate the hash value of the loaded model data file in the hypervisor space based on a timer generated in the kernel space, and compare the calculated hash value with the stored hash value. Instructions may be stored to confirm identity and determine that the model data file has been modified if the hash values are not identical according to the comparison.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 하이퍼바이저 공간이 상기 커널 공간의 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, the memory may store instructions that, when executed, cause the processor to block access of the hypervisor space to the hash value storage location in the kernel space.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 커널 공간의 페이지 테이블의 엔트리를 변경하여 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, the memory may store instructions that, when executed, cause the processor to block access to the hash value storage location by changing an entry in a page table of the kernel space.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 커널 공간의 상기 페이지 테이블의 상기 엔트리를 무효(invalid)로 변경하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, the memory may store instructions that, when executed, cause the processor to change the entry of the page table in the kernel space to invalid.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 모델 데이터 파일의 속성을 읽기 전용으로 변경하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, the memory, when executed, may store instructions that cause the processor to change the properties of the model data file to read-only when an operation according to execution of an application based on the model data file begins. .

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하여 상기 하이퍼바이저 공간에서 상기 해시값 산출 및 저장 동작을 수행하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, when the memory is executed, the processor transfers the model-related information about the model data file from the kernel space to the hypervisor space to calculate and store the hash value in the hypervisor space. You can store instructions that allow you to perform actions.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 디바이스 드라이버 또는 syscall을 통해 상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하도록 하는 인스트럭션들을 저장 할 수 있다. According to various embodiments, the memory may store instructions that, when executed, cause the processor to transfer the model-related information for the model data file from the kernel space to the hypervisor space through a device driver or syscall. You can.

다양한 실시예에 따르면, 상기 메모리는, 실행될 때, 상기 프로세서가, 상기 커널 공간에서 생성된 상기 타이머에 의해 발생하는 알림을 상기 하이퍼바이저 공간으로 전달하여 상기 해시값 비교 동작을 수행하도록 하는 인스트럭션들을 저장할 수 있다. According to various embodiments, the memory may store instructions that, when executed, cause the processor to transmit a notification generated by the timer generated in the kernel space to the hypervisor space to perform the hash value comparison operation. You can.

도 5는 다양한 실시예에 따른, 전자 장치의 데이터 보호 방법을 설명하기 위한 도면이다.FIG. 5 is a diagram for explaining a method of protecting data in an electronic device according to various embodiments.

다양한 실시예에 따르면 ARM(Advance RISC Machine)으로 디자인된 프로세서(예: 도 2의 프로세서(120))는 익셉션 발생시 이를 처리하기 위해 4개의 익셉션 레벨(Exception Level)로 구성될 수 있으며 각 레벨은 서로 다른 특권(privilege)을 가질 수 있다. According to various embodiments, a processor designed as an Advance RISC Machine (ARM) (e.g., processor 120 in FIG. 2) may be configured with four exception levels to handle exceptions when they occur, and each level is connected to each other. You may have other privileges.

일 실시예에서 ARM의 익셉션 레벨은 EL0, EL1, EL2, EL3로 구분될 수 있으며, 오퍼레이션은 이들 중 하나의 익셉션 레벨에서 수행될 수 있다. 4개의 레벨 EL3, EL2, EL1, EL0은 순서대로, 예를 들면 EL1 보다 EL2의 보안 수준이 높고, 특권 수준(Privilege level)이 높고 자원에 접근할 수 있는 권한 레벨도 높을 수 있다. In one embodiment, ARM's exception levels can be divided into EL0, EL1, EL2, and EL3, and an operation can be performed at one of these exception levels. The four levels EL3, EL2, EL1, and EL0 are in that order. For example, the security level of EL2 is higher than that of EL1, the privilege level is high, and the level of authority to access resources may also be higher.

일 실시예에 따르면 EL1인 커널 공간 보다 EL2인 하이퍼바이저 공간이 권한이 높을 수 있다. According to one embodiment, the hypervisor space, which is EL2, may have higher privileges than the kernel space, which is EL1.

일 실시예에 따르면 하이퍼바이저 공간(예: 도 2, 도 3 또는 도 4의 하이퍼바이저 공간(230)의 해시 관리 모듈(예: 도 3 또는 도 4의 해시 관리 모듈(231 또는 331))은 create_hash 함수, delete_hash 함수를 포함할 수 있으며, 해시 비교 모듈(232)은 compare_hash 함수를 포함할 수 있다. According to one embodiment, the hash management module of the hypervisor space (e.g., the hypervisor space 230 of Figures 2, 3, or 4 (e.g., the hash management module 231 or 331 of Figure 3 or 4)) creates_hash It may include a function, delete_hash function, and the hash comparison module 232 may include a compare_hash function.

일 실시예에 따르면 create_hash 함수는 ioctl, syscall 및/또는 hvc를 통해 전달되는 fd, size를 이용해 어플리케이션의 사용자 프로세스가 사용하고 있는 모델 파일의 해시 값 (예: SHA-256)을 계산하여 메모리(530)(예: 도 2의 내부 메모리(240))에 저장할 수 있다. 산출된 해시 값은 모델 식별자(model id)와 함께 쌍(pair) 형태로 저장될 수 있다. 저장된 해시 값은 이후 파일 데이터 무결성을 검증하기 위한 값으로 사용될 수 있으며, 이에 따라 커널 공간(예: 도 2, 도 3 또는 도 4의 커널 공간(220))에서 해시 값이 저장된 메모리 위치(531)에 대한 접근을 차단할 수 있다. According to one embodiment, the create_hash function calculates the hash value (e.g., SHA-256) of the model file used by the user process of the application using fd and size passed through ioctl, syscall, and/or hvc to create memory 530. ) (e.g., internal memory 240 of FIG. 2). The calculated hash value can be stored in the form of a pair along with the model identifier (model id). The stored hash value can later be used as a value to verify file data integrity, and accordingly, the memory location 531 where the hash value is stored in the kernel space (e.g., the kernel space 220 in FIG. 2, FIG. 3, or FIG. 4) Access to can be blocked.

일 실시예에 따르면 EL2 레벨인 하이퍼바이저 공간의 해시 관리 모듈(231 또는 331)은, EL1 레벨인 커널 공간(220)의 페이지 테이블의 마지막 페이지 테이블(511) 엔트리(page table entry)(513)를 무효(invalid)로 설정하여 커널 공간에 대해 메모리 위치(531)로의 접근을 차단할 수 있다. According to one embodiment, the hash management module 231 or 331 of the hypervisor space at the EL2 level creates the last page table 511 entry 513 of the page table of the kernel space 220 at the EL1 level. By setting it to invalid, access to the memory location 531 in the kernel space can be blocked.

도 6은, 다양한 실시예들에 따른, 전자 장치의 데이터 보호 방법을 도시한 흐름도이다. FIG. 6 is a flowchart illustrating a method for protecting data in an electronic device, according to various embodiments.

다양한 실시예들에 따른, 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 2, 도 3 또는 도 4의 프로세서(120))는 동작 601에서, 특정 러닝 머신 모델과 관련된 다양한 데이터를 로딩할 수 있다. According to various embodiments, in operation 601, a processor (e.g., processor 120 of FIG. 2, FIG. 3, or FIG. 4) of an electronic device (e.g., electronic device 101 of FIG. 1) generates a specific learning machine model and A variety of related data can be loaded.

일 실시예에 따르면 프로세서는 사용자 공간(예: 도 2, 도 3 또는 도 4의 사용자 공간(210))에서 특정 어플리케이션을 실행하고 다양한 명령을 수행하기 위해 연산을 시작하고, 특정 어플리케이션에서 사용하는 러닝 머신 모델 관련 데이터 파일을 메모리에 로딩할 수 있다.According to one embodiment, the processor executes a specific application in user space (e.g., user space 210 in Figures 2, 3, or 4), starts operations to perform various instructions, and runs a running program used by the specific application. Data files related to the machine model can be loaded into memory.

다양한 실시예에 따르면 사용자 공간은 특정 어플리케이션이 실행됨에 따라 머신 러닝 모델을 통해 추론이 시작되면, 머신 러닝 모델과 관련된 정보를 커널 공간(예: 도 2, 도 3 또는 도 4의 커널 공간(220))으로 전달할 수 있다. 예를 들면 모델 관련 정보는 모델 식별자(identifier)를 포함할 수 있다. According to various embodiments, when inference begins through a machine learning model as a specific application is executed, the user space stores information related to the machine learning model in the kernel space (e.g., kernel space 220 of Figures 2, 3, or 4). ) can be transmitted. For example, model-related information may include a model identifier.

다양한 실시예에 따르면 프로세서는 커널 공간에서 타이머를 생성할수 있다. 커널 공간에서 생성되는 타이머는 모델 데이터 파일의 보안을 위해 모델 데이터 파일의 무결성을 확인하는 시점에 알림(예: 프롬프트)을 생성할 수 있다. According to various embodiments, the processor may create a timer in kernel space. A timer created in kernel space can generate notifications (e.g. prompts) at points when the integrity of the model data file is verified to ensure the security of the model data file.

다양한 실시예에 따르면 프로세서는 커널 공간에서 모델 관련 정보에 기초하여 머신 러닝 모델 데이터 파일의 속성을 읽기 전용(read only)로 변경하고, 모델 관련 정보를 하이퍼바이저 공간(예: 도 2, 도 3 또는 도 4의 하이퍼바이저 공간(230))에 전달할 수 있다. According to various embodiments, the processor changes the properties of the machine learning model data file to read only based on model-related information in kernel space and stores the model-related information in hypervisor space (e.g., Figure 2, Figure 3, or It can be delivered to the hypervisor space 230 in FIG. 4.

다양한 실시예에 따르면 프로세서는 동작 603에서, 커널 공간으로부터 전달된 모델 관련 정보에 기초하여 하이퍼바이저 공간에서 머신 러닝 모델 데이터 파일에 대한 해시(hash) 값을 산출하고, 산출된 해시값을 모델 관련 정보와 함께 저장할 수 있다. 하이퍼바이저 공간(230)에서는 산출된 해시값을 예를 들면 내부 메모리(예: 도 2의 내부 메모리(240))에 저장할 수 있다. According to various embodiments, in operation 603, the processor calculates a hash value for the machine learning model data file in the hypervisor space based on model-related information transmitted from the kernel space, and stores the calculated hash value as model-related information. You can save it with . In the hypervisor space 230, the calculated hash value can be stored in, for example, internal memory (eg, internal memory 240 in FIG. 2).

다양한 실시예에 따르면 프로세서는, 커널 공간이 공격 받은 경우에 이에 따라 해시값을 수정할 수 없도록, 하이퍼바이저 공간에서 저장된 해시값에 대한 커널 공간의 접근을 차단하도록 할 수 있다. According to various embodiments, the processor may block kernel space access to the hash value stored in the hypervisor space so that the hash value cannot be modified accordingly if the kernel space is attacked.

다양한 실시예에 따르면 프로세서는, 커널 공간에서 생성된 타이머에 기초하여 지정된 시점에 동작 605에서 하이퍼바이저 공간에서 머신 러닝 모델 데이터 파일에 대한 해시값을 새로 생성할 수 있다. According to various embodiments, the processor may generate a new hash value for the machine learning model data file in the hypervisor space at operation 605 at a designated time based on a timer generated in the kernel space.

다양한 실시예에 따르면 프로세서는 동작 607에서 하이퍼바이저 공간에서 생성된 해시값과 저장된 해시값을 비교할 수 있다. According to various embodiments, the processor may compare the generated hash value and the stored hash value in the hypervisor space in operation 607.

다양한 실시예에 따르면 프로세서는 하이퍼바이저 공간에서 해시값 비교 동작에 따라 해시값이 일치하지 않으면, 지정된 횟수(예: 3회)만큼 해시값 생성 및 비교 동작을 다시 수행할 수 있다. According to various embodiments, if the hash values do not match according to the hash value comparison operation in the hypervisor space, the processor may re-perform the hash value generation and comparison operation a specified number of times (e.g., 3 times).

다양한 실시예에 따르면 프로세서는 동작 609에서 해시값이 동일하지 않은 경우 모델 데이터 파일이 수정된 것으로 결정할 수 있다. According to various embodiments, the processor may determine in operation 609 that the model data file has been modified if the hash values are not the same.

다양한 실시예에 따르면 프로세서는 하이퍼바이저 공간에서 해시값 비교 동작을 주기적으로 수행할 수 있다. According to various embodiments, the processor may periodically perform a hash value comparison operation in the hypervisor space.

다양한 실시예에 따르면 하이퍼바이저 공간에서 해시값 비교 동작을 통해 해시값이 동일한지 여부에 따라 모델 데이터 파일에 대한 인증을 수행할 수 있다. According to various embodiments, authentication of a model data file can be performed based on whether the hash values are the same through a hash value comparison operation in the hypervisor space.

다양한 실시예에 따르면 프로세서는 하이퍼바이저 공간에서 해시값 비교 동작에 따라 모델 데이터 파일에 대한 인증이 실패하면, 사용자 공간을 통해 모델 데이터 파일을 다시 로딩하도록 하거나 현재 실행중인 어플리케이션을 종료하도록 할 수 있다. According to various embodiments, if authentication of the model data file fails according to a hash value comparison operation in the hypervisor space, the processor may reload the model data file through user space or terminate the currently running application.

도 7은, 다양한 실시예들에 따른, 전자 장치의 데이터 보호 방법을 도시한 흐름도이다.FIG. 7 is a flowchart illustrating a method for protecting data in an electronic device, according to various embodiments.

다양한 실시예들에 따른, 전자 장치(예: 도 1의 전자 장치(101))의 프로세서(예: 도 2, 도 3 또는 도 4의 프로세서(120))는 동작 601에서, 특정 러닝 머신 모델과 관련된 다양한 데이터를 로딩할 수 있다. According to various embodiments, in operation 601, a processor (e.g., processor 120 of FIG. 2, FIG. 3, or FIG. 4) of an electronic device (e.g., electronic device 101 of FIG. 1) generates a specific learning machine model and A variety of related data can be loaded.

일 실시예에 따르면 프로세서는 사용자 공간(예: 도 2, 도 3 또는 도 4의 사용자 공간(210))에서 특정 어플리케이션을 실행하고 다양한 명령을 수행하기 위해 연산을 시작하여, 특정 어플리케이션에서 사용하는 러닝 머신 모델 관련 데이터 파일을 메모리에 로딩할 수 있다. According to one embodiment, the processor executes a specific application in user space (e.g., user space 210 in Figures 2, 3, or 4) and starts operations to perform various commands, Data files related to the machine model can be loaded into memory.

다양한 실시예에 따르면, 머신 러닝 프레임워크(machine learning frameworks)(예: 도 3 또는 도 4의 머신 러닝 프레임워크(211 또는 311))에서 생성된 모델은 학습 단계에서 훈련될 수 있으며, 훈련된 모델은 최적화된 웨이트(weight) 정보를 포함할 수 있다. According to various embodiments, models generated from machine learning frameworks (e.g., machine learning framework 211 or 311 of Figure 3 or Figure 4) may be trained in the learning step, and the trained model may include optimized weight information.

다양한 실시예에 따르면 모델 추론 단계에서는 모델의 트리 구조와 웨이트를 포함하는 모델 데이터들을 로딩할 수 있다. 머신 러닝 프레임 워크의 종류에 따라 명령어 또는 함수의 언어 표현의 차이는 있을 수 있으나, 머신 러닝 모델을 사용하여 추론을 수행하기 위해서는 모델 데이터를 open()하고 read()하는 과정을 포함할 수 있다. 일 실시예에 따르면 모델의 무결성 검사를 위해 디바이스 드라이버(예: /dev/protect_ml)를 생성할 수 있다. According to various embodiments, in the model inference step, model data including the tree structure and weights of the model may be loaded. There may be differences in the language expression of commands or functions depending on the type of machine learning framework, but performing inference using a machine learning model may include the process of open() and read() the model data. According to one embodiment, a device driver (e.g., /dev/protect_ml) can be created to check the integrity of the model.

일 실시예에 다르면 각 모델은 자체 모델 식별자(model id)를 가질 수 있다. According to one embodiment, each model may have its own model identifier (model id).

다양한 실시예에 따르면 프로세서는 동작 701에서, 사용자 공간에서 특정 어플리케이션이 실행됨에 따라 머신 러닝 모델을 통해 추론을 시작할 수 있으며, 이에 따라 머신 러닝 모델과 관련된 정보를 커널 공간(예: 도 2, 도 3 또는 도 4의 커널 공간(220))으로 전달할 수 있다. According to various embodiments, in operation 701, the processor may initiate inference through a machine learning model as a specific application is executed in user space, thereby sending information related to the machine learning model to kernel space (e.g., FIGS. 2 and 3 Alternatively, it can be delivered to the kernel space 220 of FIG. 4).

일 실시예에 따르면 모델을 통해 추론(inference)이 시작되면 프로세서는 모델 데이터 파일을 오픈(open())하기 전 예를 들면 ioctl로 모델의 추론이 시작되었음을 알리는 CMD_ID 0과 파일을 디바이스 드라이버(예: /dev/protect_ml)에 쓸 수 있다. 파일 오픈 및 읽기가 수행된 후 예를 들면 ioctl을 통해 모델의 추론이 시작되었음을 알리는 CMD_ID 1과 모델 파일의 파일 디스크립터(file descriptor), 파일 크기(size), 또는 모델 식별자(model id)와 같은 모델 관련 정보를 디바이스 드라이버에 쓸 수 있다.According to one embodiment, when inference begins through a model, the processor sends a device driver (e.g. : /dev/protect_ml). After the file open and read is performed, CMD_ID 1 to indicate that inference of the model has started, for example via ioctl, and the model file's file descriptor, file size, or model identifier (model id). Related information can be written to the device driver.

다양한 실시예에 따르면 프로세서는 동작 703에서 커널 공간에서 모델 관련 정보에 기초하여 머신 러닝 모델 데이터 파일의 속성을 읽기 전용(read only)로 변경하고, 모델 관련 정보를 하이퍼바이저 공간(예: 도 2, 도 3 또는 도 4의 하이퍼바이저 공간(230))에 전달할 수 있다. 예를 들면 모델의 추론이 시작되었음을 알리는 CMD_ID 0과 파일을 디바이스 드라이버(예: /dev/protect_ml)를 통해 수신한 커널 공간에서는 파일의 속성을 바꾸기 위해 chage_ro() 함수를 실행하여 해당 모델 데이터 파일에 대한 inode 속성을 r--r--r-- 로 변경할 수 있다. 따라서, 외부에서 해당 모델 데이터 파일에 대한 쓰기(write) 시도를 차단할 수 있으며, 데이터 파일 오픈 시에도 읽기 전용(read-only)로만 열 수 있도록 할 수있다. According to various embodiments, in operation 703, the processor changes the properties of the machine learning model data file to read only based on model-related information in kernel space and stores the model-related information in hypervisor space (e.g., Figure 2, It can be delivered to the hypervisor space 230 of Figure 3 or Figure 4. For example, in the kernel space that receives CMD_ID 0 and a file indicating that model inference has started through a device driver (e.g. /dev/protect_ml), the chage_ro() function is executed to change the file's properties to change the file's properties to the corresponding model data file. You can change the inode attribute to r--r--r--. Therefore, attempts to write to the model data file from the outside can be blocked, and even when the data file is opened, it can be opened as read-only.

일 실시예에 따르면 데이터 파일의 inode 속성을 읽기 전용(read-only)으로 변경하면, 이후 사용자 공간에서 모델 추론을 위해 파일을 오픈(예: open(FILE, O_RDONLY))하는 경우, 쓰기 권한으로 파일에 접근하면 파일의 속성이 read only이므로 이러한 접근은 불허(fail)될 수 있다. According to one embodiment, if the inode property of a data file is changed to read-only, then when the file is opened for model inference in user space (e.g., open(FILE, O_RDONLY)), the file is opened with write permission. When accessing , such access may fail because the file's attribute is read only.

한편, 루트(root) 권한을 획득하면 inode가 읽기 전용(read only)으로 설정된 경우 파일에 쓰기(write)가 가능할 수 있어, 이를 위해 추가적인 보호 동작으로서 해시 비교 동작을 수행할 수 있다. 다양한 실시예에 따르면 프로세서는 동작 705에서 읽기 전용으로 모델 데이터 파일을 오픈할 수 있으며, 동작 707에서, 오픈된 모델 데이터 파일로부터 파일을 모델 데이터 파일을 읽을 수 있다. Meanwhile, if root permission is obtained, it may be possible to write to a file if the inode is set to read only, and for this purpose, a hash comparison operation can be performed as an additional protection operation. According to various embodiments, the processor may open a model data file for read-only in operation 705 and may read a model data file from the open model data file in operation 707.

일 실시예에 따르면 서로 다른 어플리케이션 또는 서로 다른 프로세스에서 동일한 모델 파일을 로딩할 수 있다. 서로 다른 어플리케이션 또는 사용자 프로세스 마다 서로 다른 모델 식별자를 가질 수 있다. According to one embodiment, the same model file may be loaded in different applications or different processes. Different applications or user processes can have different model identifiers.

다양한 실시예에 따르면 프로세서는, 머신 러닝 모델을 통해 추론이 시작되면, 이에 따라 동작 709에서 커널 공간에서 타이머를 생성할 수 있다. 예를 들면 모델의 추론이 시작되었음을 알리는 CMD_ID 0을 디바이스 드라이버(예: /dev/protect_ml)를 통해 수신한 커널 공간에서는 모델 데이터 파일의 추론을 시작하는 시점에 기초하여 타이머를 생성하고 생성된 타이머는 예를 들면 주기적으로 알림(예: 프롬프트)을 생성할 수 있다. 커널 공간에서는 모델 추론이 시작되었음을 확인하고 예를 들며 5분에 한번씩 동작하는 타이머를 생성하여 등록할 수 있다. 커널 공간은 hvc call을 통해 하이퍼바이저 공간에 fd, file size, model id와 같은 모델 관련 정보를 전달하며 모델의 추론이 시작되었음을 알릴 수 있다.According to various embodiments, when inference begins through a machine learning model, the processor may generate a timer in kernel space in operation 709 accordingly. For example, in the kernel space that receives CMD_ID 0, which indicates that model inference has started, through the device driver (e.g. /dev/protect_ml), a timer is created based on the start point of model data file inference, and the created timer is For example, you can periodically generate notifications (e.g. prompts). In kernel space, you can confirm that model inference has started and create and register a timer that runs once every 5 minutes, for example. The kernel space can transmit model-related information such as fd, file size, and model id to the hypervisor space through the hvc call and notify that model inference has begun.

다양한 실시예에 따르면 프로세서는, 동작 711에서, 커널 공간에서 생성된 타이머에 기초하여 주기적으로 해시 값을 체크할 수 있다. 프로세서는, 커널 공간에서 생성된 타이머에 기초하여 주기적으로 하이퍼바이저 공간에서 머신 러닝 모델 데이터 파일에 대한 해시값을 새로 생성하고, 하이퍼바이저 공간에서 생성된 해시값과 저장된 해시값을 비교할 수 있다. 등록된 커널 공간의 타이머는 예를 들면 5분에 한번씩 타이머 인터럽트(timer interrupt)를 발생하고 hvc를 통해 하이퍼바이저 공간에서 해시 값을 비교하는 함수(예: Compare_hash())를 호출할 수 있다. 하이퍼바이저 공간에서는 compare_hash()를 통해 사용자 공간에서 접근 가능한 메모리의 모델 데이터 파일에 대한 해시 연산을 수행하고 저장된 해시 값과 비교할 수 있다. According to various embodiments, in operation 711, the processor may periodically check the hash value based on a timer generated in kernel space. The processor may periodically generate a new hash value for the machine learning model data file in the hypervisor space based on a timer generated in the kernel space and compare the hash value generated in the hypervisor space with the stored hash value. The timer in the registered kernel space can generate a timer interrupt, for example, once every 5 minutes and call a function (e.g. Compare_hash()) that compares hash values in the hypervisor space through hvc. In the hypervisor space, you can perform a hash operation on the model data file in memory accessible in the user space through compare_hash() and compare it with the stored hash value.

다양한 실시예에 따르면 프로세서는 동작 713에서, 하이퍼바이저 공간에서 해시값 비교 동작에 따라 해시값이 일치하지 않는(동작 711의 fail) 횟수가 지정된 횟수(예: 3회) 이상 수행되었는지 확인할 수 있다. 해시값 비교 동작에 따라 지정된 횟수가 도과하지 않은 경우 동작 711로 회귀하여 해시값 생성 및 비교 동작을 다시 수행하도록 할 수 있다. 예를 들면 하이퍼바이저 공간의 compare_hash() 함수는 해시 값이 동일하면 파일의 무결성을 알리는 값을 전달(예: 0를 return)할 수 있다. According to various embodiments, in operation 713, the processor may check whether the hash value mismatch (fail in operation 711) has been performed more than a specified number of times (e.g., 3 times) according to the hash value comparison operation in the hypervisor space. If the specified number of times has not been exceeded according to the hash value comparison operation, the operation returns to operation 711 and the hash value generation and comparison operation can be performed again. For example, the compare_hash() function in hypervisor space can deliver a value indicating the integrity of the file (e.g., return 0) if the hash values are the same.

다양한 실시예에 따르면 프로세서는 동작 713에서 해시값이 동일하지 않음을 지정된 횟수 이상 확인한 경우, 모델 데이터 파일이 수정된 것으로 결정하고, 동작 715에서 어플리케이션을 종료하는 경우에 해당하는 지 판단할 수 있다. 모델 데이터 파일이 수정된 것으로 결정되면 모델 데이터 파일을 다시 로딩하거나 어플리케이션을 종료할 수 있다. 두개의 해시 값이 서로 상이하면 해시 연산 시 오동작 가능성을 고려하여 지정된 횟수, 예를 들어 3번 재 시도(retry)를 하도록 할 수 있다. 이에 따라 3번 모두 해시 값이 서로 상이한 경우에는 프로세서는 파일이 수정된 것으로 판단할 수 있다. 이 경우 경우에 따라 파일을 새로 로딩할 수도 있으나, 예를 들면 생체 인식 시스템과 같이 보안에 매우 민감한 어플리케이션의 경우 시스템을 오프할 수도 있다. According to various embodiments, if the processor confirms in operation 713 that the hash values are not the same more than a specified number of times, the processor determines that the model data file has been modified, and determines whether the application is terminated in operation 715. If it is determined that the model data file has been modified, the model data file can be reloaded or the application can be terminated. If the two hash values are different, the hash operation can be retried a specified number of times, for example, 3 times, taking into account the possibility of malfunction. Accordingly, if the hash values are different all three times, the processor can determine that the file has been modified. In this case, a new file may be loaded depending on the case, but for applications that are very sensitive to security, such as a biometric recognition system, the system may be turned off.

다양한 실시예에 따르면 프로세서는 지정된 횟수 이상 해시 값 비교 결과 동일하지 않으나, 어플리케이션을 종료하는 경우에 해당하지 않으면(동작 715- No), 동작 717에서 모델 데이터 파일을 다시 로딩하여 훼손된 데이터를 복구할 수 있다. According to various embodiments, if the result of comparing the hash values more than a specified number of times is not the same, but this does not correspond to the case of terminating the application (operation 715 - No), the processor may recover the damaged data by reloading the model data file in operation 717. there is.

다양한 실시예에 따르면 프로세서는 동작 719에서, 커널 공간으로부터 전달된 모델 관련 정보에 기초하여 하이퍼바이저 공간에서 머신 러닝 모델 데이터 파일에 대한 해시(hash) 값을 산출하고, 산출된 해시값을 모델 관련 정보와 함께 저장할 수 있다. 예를 들면 산출된 해시 값은 모델 식별자와 함께 저장될 수 있다. 프로세서는 저장된 해시 값을 주기적으로 사용자 프로세스가 접근 가능한 메모리에 로딩된 파일과 비교함으로써 무결성을 입증할 수 있다. According to various embodiments, in operation 719, the processor calculates a hash value for the machine learning model data file in the hypervisor space based on model-related information transmitted from the kernel space, and stores the calculated hash value in the model-related information. You can save it with . For example, the calculated hash value can be stored along with the model identifier. The processor can verify integrity by periodically comparing the stored hash value with a file loaded in memory accessible to the user process.

다양한 실시예에 따르면 프로세서는 동작 721에서 하이퍼바이저 공간에서 저장된 해시값에 대한 커널 공간의 접근을 차단하도록 할 수 있다. 하이퍼바이저 공간에서는 커널 공간의 페이지 테이블 값을 변경하여 해시 값이 저장된 메모리에 접근할 수 없도록 할 수 있다. 하이퍼바이저 공간에서는 예를 들면 커널 공간의 페이지 테이블의 엔트리를 무효(invalid)로 변경하여 unmap할 수 있다. 이에 따라 커널 공간이 공격당하여 파일 내용을 수정하고 해시 값을 새로 계산하여 저장할 수 없도록 할 수 있다. 따라서, 커널 공간이 공격당하는 경우 메모리에 로딩된 파일의 내용을 변경하더라도 하이퍼바이저에서 관리하는 해시 값은 수정하지 못할 수 있다. According to various embodiments, in operation 721, the processor may block kernel space access to the hash value stored in the hypervisor space. In the hypervisor space, the page table value in the kernel space can be changed to make the memory where the hash value is stored inaccessible. In the hypervisor space, for example, an entry in the page table in the kernel space can be changed to invalid to unmap it. As a result, the kernel space can be attacked, making it impossible to modify the file contents and recalculate and save the hash value. Therefore, if the kernel space is attacked, the hash value managed by the hypervisor may not be modified even if the contents of the file loaded in memory are changed.

다양한 실시예에 따르면 프로세서는 하이퍼바이저 공간에서 해시 값을 저장하고 커널 공간의 페이지 테이블을 unmap 한 이후, 동작 723에서 사용자 공간을 통해 모델 추론을 시작할 수 있다. According to various embodiments, the processor may store the hash value in hypervisor space and unmap the page table in kernel space, and then start model inference through user space in operation 723.

다양한 실시예에 따르면 모델의 추론이 종료되어 해당 프로세스가 종료되는 경우 프로세서는 동작 725에서, 사용자 공간에서 프로세스 종료 전 알림을 커널 공간에 전달할 수 있다. 예를 들면 사용자 공간은 ioctl을 통해 종료를 알리는 CMD_ID 2와 model id를 쓸 수 있으며, 커널 공간은 동작 727에서 이에 따라 타이머를 종료시킬 수 있으며, hvc를 통해 알림을 전달하여, 하이퍼바이저에서 동작 729에서 저장된 해시 값을 삭제하는 동작을 수행하도록 할 수 있다. According to various embodiments, when the model inference is terminated and the corresponding process is terminated, the processor may transmit a notification before process termination from the user space to the kernel space in operation 725. For example, the user space can use CMD_ID 2 and model id to notify termination through ioctl, and the kernel space can terminate the timer accordingly in operation 727, and deliver notification through hvc to execute operation 729 in the hypervisor. You can perform an operation to delete the stored hash value.

다양한 실시예에 따르면 프로세서는 메인 프로세서와 보조 프로세서를 포함하며, 상술한 실시예들에 따른 복수의 머신 러닝 모델이 동작하여 모델 추론 동작이 두 개 이상의 프로세서에 의해 수행되는 경우, 복수의 머신 러닝 모델에 대해 상술한 타이머를 하나(global timer)만 생성하여 운용하도록 할 수 있다. 예를 머신 러닝 모델의 추론이 시작되면 상술한 실시예들에서 타이머 생성 동작을 제외한 모든 동작은 각각 동일 또는 유사하게 수행될 수 있다. 경우에 따라 보안을 위해 특정 모델에 대해서는 인터벌 타임을 조정하여 타이머를 별도로 등록할 수도 있다. 복수의 모델들에 대해 글로벌 타이머가 주기적으로 인터럽트를 발행하면, 하이퍼바이저 공간에서는 현재 사용되는 모델 파일의 해시 값을 연산하고 이를 저장된 해시값과 비교할 수 있다. According to various embodiments, the processor includes a main processor and an auxiliary processor, and when a plurality of machine learning models according to the above-described embodiments operate and a model inference operation is performed by two or more processors, a plurality of machine learning models It is possible to create and operate only one timer (global timer) described above. For example, when inference of a machine learning model begins, all operations except the timer creation operation in the above-described embodiments may be performed in the same or similar manner. In some cases, for security reasons, a timer may be registered separately by adjusting the interval time for a specific model. When the global timer periodically issues interrupts for multiple models, the hash value of the currently used model file can be calculated in the hypervisor space and compared with the stored hash value.

본 문서에 개시된 실시 예들은 기술 내용을 쉽게 설명하고 이해를 돕기 위한 예로서 제시한 것일 뿐이며, 본 문서에 개시된 기술의 범위를 한정하고자 하는 것은 아니다. 따라서 본 문서에 개시된 기술의 범위는 여기에 개시된 실시 예들 이외에도 본 문서에 개시된 다양한 실시 예의 기술적 사상을 바탕으로 도출되는 모든 변경 또는 변형된 형태를 포함되는 것으로 해석되어야 한다.The embodiments disclosed in this document are merely presented as examples to easily explain the technical content and aid understanding, and are not intended to limit the scope of the technology disclosed in this document. Therefore, the scope of the technology disclosed in this document should be interpreted as including all changes or modified forms derived based on the technical idea of the various embodiments disclosed in this document in addition to the embodiments disclosed herein.

Claims (20)

전자 장치에 있어서,
메모리; 및
상기 메모리와 작동적으로 연결된 프로세서를 포함하며,
상기 메모리는, 실행될 때, 상기 프로세서가,
모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하고,
하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하고,
커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하고,
상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하고,
상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하도록 하는 인스트럭션들(instructions)을 저장하는 전자 장치.
In electronic devices,
Memory; and
comprising a processor operatively connected to the memory,
The memory, when executed, causes the processor to:
When the calculation according to the execution of the application based on the model data file starts, the model data file is loaded from the memory,
Calculating a hash value for the model data file in the hypervisor space and storing it together with model-related information about the model data file,
Calculating a hash value of the loaded model data file in the hypervisor space based on a timer generated in the kernel space,
Compare the calculated hash value with the stored hash value to confirm identity,
An electronic device that stores instructions for determining that the model data file has been modified if the hash values are not identical according to the comparison.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 하이퍼바이저 공간이 상기 커널 공간의 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
An electronic device that stores instructions that allow the hypervisor space to block access to the hash value storage location in the kernel space.
제2항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 커널 공간의 페이지 테이블의 엔트리를 변경하여 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 2,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for blocking access to the hash value storage location by changing an entry in a page table of the kernel space.
제3항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 커널 공간의 상기 페이지 테이블의 상기 엔트리를 무효(invalid)로 변경하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 3,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for changing the entry of the page table in the kernel space to invalid.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 모델 데이터 파일의 속성을 읽기 전용으로 변경하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for changing the properties of the model data file to read-only when an operation according to execution of an application based on the model data file begins.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 해시값들이 동일하지 않으면, 상기 하이퍼바이저 공간에서 상기 타이머에 따라 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 ID와 함께 저장된 상기 해쉬값과 동일한지 비교하는 동작을 지정된 횟수만큼 수행하도록 설정하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
If the hash values are not the same, the operation of calculating the hash value for the model data file according to the timer in the hypervisor space and comparing whether it is the same as the hash value stored with the model ID is performed a specified number of times. An electronic device that stores instructions.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 모델 데이터 파일이 수정된 것으로 결정되면, 상기 메모리로부터 상기 모델 데이터 파일을 다시 로딩하거나 상기 어플리케이션을 종료하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for reloading the model data file from the memory or terminating the application when it is determined that the model data file has been modified.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하여 상기 하이퍼바이저 공간에서 상기 해시값 산출 및 저장 동작을 수행하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for transferring the model-related information about the model data file from the kernel space to the hypervisor space to perform the hash value calculation and storage operations in the hypervisor space.
제8항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
디바이스 드라이버를 통해 상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to clause 8,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for transferring the model-related information about the model data file from the kernel space to the hypervisor space through a device driver.
제1항에 있어서,
상기 메모리는, 실행될 때, 상기 프로세서가,
상기 커널 공간에서 생성된 상기 타이머에 의해 발생하는 알림을 상기 하이퍼바이저 공간으로 전달하여 상기 해시값 비교 동작을 수행하도록 하는 인스트럭션들을 저장하는 전자 장치.
According to paragraph 1,
The memory, when executed, causes the processor to:
An electronic device that stores instructions for transmitting a notification generated by the timer generated in the kernel space to the hypervisor space to perform the hash value comparison operation.
전자 장치의 방법에 있어서,
모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 메모리로부터 상기 모델 데이터 파일을 로딩하는 동작;
하이퍼바이저 공간에서 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 데이터 파일에 대한 모델 관련 정보와 함께 저장하는 동작;
커널 공간에서 생성된 타이머에 기초하여 상기 하이퍼바이저 공간에서 상기 로딩된 모델 데이터 파일의 해시값을 산출하는 동작;
상기 산출된 해시값을 상기 저장된 해시값과 비교하여 동일성을 확인하는 동작; 및
상기 비교에 따라 상기 해쉬값들이 동일하지 않으면 상기 모델 데이터 파일이 수정된 것으로 결정하는 동작을 포함하는 방법.
In the method of the electronic device,
loading the model data file from the memory when an operation according to execution of an application based on the model data file begins;
An operation of calculating a hash value for the model data file in the hypervisor space and storing it together with model-related information for the model data file;
calculating a hash value of the loaded model data file in the hypervisor space based on a timer generated in the kernel space;
Comparing the calculated hash value with the stored hash value to confirm identity; and
A method comprising determining that the model data file has been modified if the hash values are not identical according to the comparison.
제11항에 있어서,
상기 하이퍼바이저 공간이, 상기 커널 공간의 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 동작을 더 포함하는 방법.
According to clause 11,
The method further includes an operation of allowing the hypervisor space to block access to the hash value storage location in the kernel space.
제12항에 있어서,
상기 커널 공간의 페이지 테이블의 엔트리를 변경하여 상기 해시값 저장 위치에 대한 접근을 차단하도록 하는 동작을 더 포함하는 방법.
According to clause 12,
The method further includes an operation of blocking access to the hash value storage location by changing an entry in the page table of the kernel space.
제13항에 있어서,
상기 차단 동작은, 상기 커널 공간의 상기 페이지 테이블의 상기 엔트리를 무효(invalid)로 변경하는 방법.
According to clause 13,
The blocking operation changes the entry of the page table in the kernel space to invalid.
제11항에 있어서,
상기 모델 데이터 파일에 기초한 어플리케이션 실행에 따른 연산이 시작되면 상기 모델 데이터 파일의 속성을 읽기 전용으로 변경하는 동작을 더 포함하는 방법.
According to clause 11,
The method further includes changing the properties of the model data file to read-only when an operation according to execution of an application based on the model data file begins.
제11항에 있어서,
상기 해시값들이 동일하지 않으면, 상기 하이퍼바이저 공간에서 상기 타이머에 따라 상기 모델 데이터 파일에 대한 해시값을 산출하여 상기 모델 ID와 함께 저장된 상기 해쉬값과 동일한지 비교하는 동작을 지정된 횟수만큼 수행하는 동작을 더 포함하는 방법.
According to clause 11,
If the hash values are not the same, an operation of calculating a hash value for the model data file according to the timer in the hypervisor space and comparing whether it is the same as the hash value stored with the model ID a specified number of times. How to include more.
제11항에 있어서,
상기 모델 데이터 파일이 수정된 것으로 결정되면, 상기 메모리로부터 상기 모델 데이터 파일을 다시 로딩하거나 상기 어플리케이션을 종료하도록 하는 동작을 더 포함하는 방법.
According to clause 11,
If it is determined that the model data file has been modified, the method further includes reloading the model data file from the memory or terminating the application.
제11항에 있어서,
상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하여 상기 하이퍼바이저 공간에서 상기 해시값 산출 및 저장 동작을 수행하도록 하는 동작을 더 포함하는 방법.
According to clause 11,
The method further includes transferring the model-related information about the model data file from the kernel space to the hypervisor space to perform the hash value calculation and storage operation in the hypervisor space.
제18항에 있어서,
디바이스 드라이버를 통해 상기 커널 공간으로부터 상기 모델 데이터 파일에 대한 상기 모델 관련 정보를 상기 하이퍼바이저 공간으로 전달하는 동작을 더 포함하는 방법.
According to clause 18,
The method further includes transferring the model-related information about the model data file from the kernel space to the hypervisor space through a device driver.
제11항에 있어서,
상기 커널 공간에서 생성된 상기 타이머에 의해 발생하는 알림을 상기 하이퍼바이저 공간으로 전달하여 상기 해시값 비교 동작을 수행하도록 하는 동작을 더 포함하는 방법.
According to clause 11,
The method further includes transmitting a notification generated by the timer generated in the kernel space to the hypervisor space to perform the hash value comparison operation.
KR1020220146318A 2022-09-28 2022-11-04 Electronic device and method for protecting data using the same KR20240044287A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/KR2023/014703 WO2024071927A1 (en) 2022-09-28 2023-09-25 Electronic device and data protection method using same

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1020220123763 2022-09-28
KR20220123763 2022-09-28

Publications (1)

Publication Number Publication Date
KR20240044287A true KR20240044287A (en) 2024-04-04

Family

ID=90637800

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020220146318A KR20240044287A (en) 2022-09-28 2022-11-04 Electronic device and method for protecting data using the same

Country Status (1)

Country Link
KR (1) KR20240044287A (en)

Similar Documents

Publication Publication Date Title
US20230185554A1 (en) Application installation method and electronic device for supporting same
KR20240044287A (en) Electronic device and method for protecting data using the same
US20220138739A1 (en) Electronic device for generating transaction including internal data and operating method thereof
KR20220094847A (en) Method of processing secure data and electronic device supporting the same
WO2024071927A1 (en) Electronic device and data protection method using same
KR20220057005A (en) Electronic device and method for protecting memory using the same
US20240134742A1 (en) Memory management method for security and electronic device therefor
US20240118887A1 (en) Method for updating application and electronic device thereof
US20230359530A1 (en) Electronic device for supporting data backup, and operation method thereof
US20230145690A1 (en) Method for preserving data in electronic device initialization situation and electronic device therefor
KR20230139262A (en) Electronic device including the controller for system booting and method
WO2024075929A1 (en) Electronic device for providing trusted execution environment
US20230252598A1 (en) Method and apparatus for editing video in electronic device
WO2023085589A1 (en) Method for preserving data in initialization situation of electronic device and electronic device thereof
US20230042496A1 (en) Electronic device for performing different login process according to authentication type and control method thereof
KR20230068230A (en) Electronic device and method for preserving data in factory reset of the electronic device
KR20220166675A (en) Memory managing method for security and electronic device therefor
US20230289157A1 (en) Electronic device and method for changing binary
US20230029025A1 (en) Electronic device and method of backing up secure element
WO2022191454A1 (en) Electronic device for performing runtime checksum verification on block device images, and operating method therefor
KR20240047263A (en) Electronic device for providing trusted execution environment
KR20230021342A (en) Electronic device using division permission and operation method thereof
KR20240032591A (en) Electronic device for storing encrypted data in non-volatile memory and method thereof
KR20240034076A (en) Electronic device providing security mode and operating method of the electronic deivce thereof
KR20240045934A (en) Electronic device including secure element and method of operating the same