KR20170026846A - Optimization of internal communication between applications in the Android Open Source Project based - Google Patents

Optimization of internal communication between applications in the Android Open Source Project based Download PDF

Info

Publication number
KR20170026846A
KR20170026846A KR1020150122284A KR20150122284A KR20170026846A KR 20170026846 A KR20170026846 A KR 20170026846A KR 1020150122284 A KR1020150122284 A KR 1020150122284A KR 20150122284 A KR20150122284 A KR 20150122284A KR 20170026846 A KR20170026846 A KR 20170026846A
Authority
KR
South Korea
Prior art keywords
application
communication
uds
index
aosp
Prior art date
Application number
KR1020150122284A
Other languages
Korean (ko)
Other versions
KR102371988B1 (en
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 KR1020150122284A priority Critical patent/KR102371988B1/en
Publication of KR20170026846A publication Critical patent/KR20170026846A/en
Application granted granted Critical
Publication of KR102371988B1 publication Critical patent/KR102371988B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/443

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present invention relates to a method of optimizing communication between internal applications based on an android open source project (AOSP), and more specifically, to a method of optimizing communication between internal applications based on an AOSP, in which when communication between mutually different applications is required on an Android-based operating system (OS), a file descriptor (hereinafter referred to as FD) based on a Unix domain socket (UDS) is generated, specific FD information among generated FD arrays is transmitted through the UDS to other applications requiring communication, and a duplication (dup) function for copying the FD is utilized to enable UDS-based bidirectional communication.

Description

AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법{Optimization of internal communication between applications in the Android Open Source Project based}[0001] The present invention relates to a method of optimizing communication between internal applications on an AOSP basis,

본 발명은 AOSP(Android Open Source Project) 기반에서 내부 어플리케이션 간 통신의 최적화 방법에 관한 것으로서, 더욱 상세하게는 안드로이드 기반의 OS(Operating System) 상에서 서로 다른 어플리케이션 간의 통신이 필요한 경우에 UDS(Unix Domain Socket)를 기반으로 하는 File Descriptor(이하 FD)를 생성 후, 통신이 필요한 다른 어플리케이션에게 생성된 FD 배열 중에서 특정 FD 정보를 상기 UDS를 통해 전달하고, 상기 FD를 복사하는 dup(Duplication)함수를 활용하여 UDS 기반의 양방향 통신을 가능하게 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법에 관한 것이다.
The present invention relates to a method of optimizing communication between internal applications on the basis of an Android Open Source Project (AOSP). More specifically, the present invention relates to a method of optimizing communications between different applications on an Android-based OS (Operating System) (Hereinafter, referred to as a FD) based on the UDS and transmits the specific FD information through the UDS among the FD arrays generated to other applications which need communication, and utilizes a dup (Duplication) function to copy the FD The present invention relates to a method of optimizing communication between internal applications on an AOSP-based basis enabling bi-directional communication based on UDS.

일반적으로 안드로이드는 Java 어플리케이션으로 개발하기 때문에 다른 어플리케이션과 통신을 하려면 Java가 인식할 수 있는 형태로 변환이 된 후 데이터 전송, 수신이 되어야 한다. 그러므로 Java 어플리케이션으로 개발이 된다 하더라도 네이티브(Native) 간에 직접 통신하는 방법을 사용하는 구조로 개발하는 데는 한계가 있다.Generally, Android is developed as a Java application, so in order to communicate with other applications, it must be converted into a format recognizable by Java and then transmitted and received. Therefore, although it is developed as a Java application, there is a limitation in developing a structure using a method of directly communicating between native languages.

이는 PDK(Platform Development Kit)을 통해 안드로이드(AOSP)가 포팅이 완료된 이후 개발자가 개발하여 설치하는 네이티브 기반의 일반 어플리케이션은 안드로이드의 권한 문제로 인해 framework class에서 제공하는 네이티브 서비스를 사용하는데 제약이 존재한다.This is because there are restrictions on the use of native services provided by the framework class due to the privilege problem of Android, which is a native-based general application developed and installed by a developer after the completion of porting of the Android (AOSP) through PDK (Platform Development Kit) .

또한, POSIX(Portable Operating System Interface)에서 제공되는 Shared Memory를 사용하는 방식은 어플리케이션 개발 시 코드의 복잡도가 높아지고 동기화의 관리의 어려움이 있다.In addition, the method using the shared memory provided in the POSIX (Portable Operating System Interface) has a high complexity in code development and difficulty in managing synchronization.

또한, 일반적인 Pipe는 Linux Kernel에서도 제공되는 IPC(Inter-process Communication)이지만, 단방향을 원칙으로 하기 때문에 다른 어플리케이션에서 응답을 받는 트랜잭션이 필요한 경우를 고려하면 효율적이지 않다.In addition, a general pipe is an IPC (Inter-process Communication) provided in Linux Kernel, but it is not effective considering a case where a transaction receiving a response is needed in another application because it is a unidirectional principle.

이에 FIFO(First In, First Out)는 양방향을 지원하는 a named pipe이긴 하나 다른 어플리케이션 간 통신 시, 다른 프로세스와 사용할 때 사용되는 메커니즘이 파일 기반으로 통신을 하는 것이 특징으로서, 이러한 파일 기반의 통신 기법이기 때문에 해당 파일이 생성되는 경로가 쓰기를 할 수 있는 권한이 있어야 하고 보안에 취약한 약점이 있다. 그러므로 다양한 모바일 기기에 포팅할 수 있는 어플리케이션을 고려하면 파일로 생성되는 경로를 갖는 FIFO로는 쓰기할 수 있는 권한이 있는지 여부를 파악 관리하기에는 현실적으로 어려움이 있다.FIFO (First In, First Out) is a named pipe that supports bidirectional communication. However, FIFO (First In, First Out) is a named pipe that supports bidirectional communication. The path where the file is created must have permission to write and there is a vulnerability that is vulnerable to security. Therefore, considering an application that can be ported to various mobile devices, it is practically difficult to know whether or not the FIFO having a file generated path has the right to write.

도 1은 종래의 기술에 다른 AIDL을 통한 통신 방식을 보여주는 개념도이고, 도시와 같이 종래의 AIDL을 통한 통신 방식은 AIDL의 중간에 Binder Driver라는 드라이버를 통해 통신을 하게 되는데, 상기 Binder Driver는 Third Party 개발업체가 직접적으로 접근할 수 없음으로 인하여 Proxy Class와 Stub Class를 별도로 정의하여 이 부분을 통해 다른 프로세스와 통신을 할 수 밖에 없는 구조로 되어 있다.FIG. 1 is a conceptual diagram illustrating a communication method using AIDL, which is different from the prior art. As shown in FIG. 1, a conventional communication method using AIDL communicates through a driver called Binder Driver in the middle of AIDL. Because the developer can not access directly, the proxy class and the stub class are separately defined and it is structured to communicate with other processes through this part.

이러한 AIDL을 통한 통신 방식의 문제점으로는 AIDL은 단방향이고, AIDL을 통해 개발하게 되면 Java에서 인식하는 데이터 타입으로 변환하는 작업이 필요하다.The problem with the communication method through AIDL is that the AIDL is unidirectional, and when it is developed through AIDL, it needs to be converted into a data type recognized by Java.

그러므로 AIDL, Messenger, Intent과 같은 Java 기반의 통신 방법은 C/C++에서 사용되는 구조체를 다른 어플리케이션에게 전달하는 과정이 복잡하고 개발이 된다 하더라도 유지보수 및 품질 확보가 어려운 문제점이 있다.Therefore, Java-based communication methods such as AIDL, Messenger, and Intent have a difficulty in maintenance and quality assurance even if the process of delivering the structure used in C / C ++ to other applications is complicated and developed.

상술한 문제점을 개선하기 위한 종래의 기술로서는 대한민국 공개특허공보 10-2012-0067865호에 공유 메모리 채널 다중화 방법 및 그 장치가 공지되어 있다.As a conventional technique for solving the above-mentioned problems, a shared memory channel multiplexing method and an apparatus thereof are disclosed in Korean Patent Publication No. 10-2012-0067865.

그러나 상기 종래의 기술은 공유 메모리의 채널을 다중화 함으로써, 잠금(lock) 기능에 의해 특정 시간 동안 특정 프로세스가 공유 메모리를 독점함으로써 발생하는 문제를 해결하는 것으로, 단순히 복수의 프로세스들이 공유 메모리에 동시 접속하여 데이터를 억세스할 수 있도록 하는 것이다.However, the above conventional technology solves the problem that a specific process is caused by monopolizing a shared memory for a specific time by a lock function by multiplexing channels of a shared memory, so that a plurality of processes are simultaneously connected to a shared memory So that the data can be accessed.

결론적으로 보안이 취약한 기존 FIFO방식을 보안하고, 파일 통신 가반의 Pipe, FIFO의 관리 한계점을 보안할 수 있으며 AOSP에서 제공되는 AIDL, Messenger, Intent, Native Service 보다 빠르고 안정적으로 다른 어플리케이션과 통신을 가능하게 해주는 기술이 요구되어진다.
In conclusion, it is possible to secure existing FIFO method with low security, to secure management limit of pipe and FIFO of file communication, and to communicate with other applications faster and more reliably than AIDL, Messenger, Intent and Native Service provided by AOSP Technology is required.

상기와 같은 종래 기술의 문제점을 해결하기 위하여 안출된 본 발명은 UDS 기반의 a named pipe형태로 구현한 FD 통하여 파일 통신 기반의 FIFO의 관리 한계점 및 보안이 취약한 기존 FIFO 방식을 보완할 수 있으며 AOSP에서 제공되는 AIDL 보다 빠르고 안정적으로 다른 어플리케이션과 통신을 가능하게 해주는 목적이 있다.In order to solve the above-mentioned problems of the prior art, the present invention can complement the existing FIFO method in which the management limit of the FIFO based on the file communication and the weakness of the security are weak through the FD implemented as a named pipe based on the UDS, It is intended to enable communication with other applications faster and more reliably than the AIDL provided.

또한, 본 발명은 UDS를 통한 양방향 통신 방식으로 Native 간에 직접 통신하는 방법을 사용하는 구조이므로 중간 중간에 거쳐야 하는 계층들을 생략 가능하여 FD를 통하여 네이티브 단에서 직접적인 통신을 제공하는 목적이 있다.In addition, since the present invention uses a direct communication method between Native in a bidirectional communication method using UDS, it is possible to omit hierarchies in the middle, and to provide direct communication from a native terminal through an FD.

또한, 본 발명은 메모리 기반의 통신 방법이 가능하기 때문에 기존 내부 어플리케이션간 통신 기법에 있어서 종래기술의 한계점을 극복 가능하게 하는 것에 다른 목적이 있다.
Another object of the present invention is to provide a memory-based communication method capable of overcoming the limitations of the prior art in existing internal application communication techniques.

본 발명의 상기 목적을 달성하기 위하여 AOSP를 기반으로 하는 서로 다른 어플리케이션의 통신 방법에 있어서, 제1어플리케이션과 제2어플리케이션을 실행하는 제1단계, 상기 제1어플리케이션과 상기 제2어플리케이션의 리소스를 초기화하는 제2단계, 상기 제1어플리케이션에서 UDS(Unix Domain Socket) 기반의 SocketPair 함수를 호출하여 a named pipe 방식으로 인덱스 0과 인덱스 1의 FD(File Descriptor)배열을 생성하는 제3단계, 상기 제3단계에서 생성된 FD 배열에서 상기 FD 배열의 인덱스 0번째의 FD를 대상으로 읽기 전용 FD[0]과 쓰기 전용 FD[0]을 생성하는 제4단계, 상기 제2어플리케이션에서 제1어플리케이션에 UDS 정보를 요청하는 제5단계, 상기 제5단계의 UDS의 요청에 따라 상기 제1어플리케이션은 상기 인덱스 1의 FD를 UDS의 응답으로 송신하는 제6단계 및 상기 제6단계의 UDS의 응답에 따라 상기 제2어플리케이션에서 인덱스 1번째의 FD를 대상으로 읽기 전용 FD[1]과 쓰기 전용 FD[1]을 생성하는 제7단계를 통하여 AOSP 기반에서 서로 다른 어플리케이션 간에 UDS 기반으로 양방향 통신을 수행하게 하는 것을 통하여 달성되어진다.
In order to achieve the above-mentioned object of the present invention, there is provided a communication method of different applications based on AOSP, comprising: a first step of executing a first application and a second application; A third step of generating a FD (File Descriptor) array of an index 0 and an index 1 by a named pipe method by calling a UDP (Unix Domain Socket) based SocketPair function in the first application, And a write-only FD [0] on the FD of the FD array generated in the step (a) to the 0th FD of the FD array, A fifth step of requesting the UDS of the fifth step, the first application transmitting the FD of the index 1 in response to the UDS, And a seventh step of generating a read-only FD [1] and a write-only FD [1] with respect to the first FD of the index in the second application according to the response of the UDS, Communication is performed.

따라서 본 발명의 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법은 AOSP 기반에서 Unix Domain Socket(이하UDS)를 a named pipe형태로 구현한 본 발명을 통해 보안이 취약한 기존 FIFO방식을 보안하고, 파일 통신 기반의 Pipe, FIFO의 관리 한계점을 보안할 수 있는 효과가 있다.Therefore, the method of optimizing communication between internal applications in the AOSP-based communication system of the present invention is based on the AOSP-based Unix Domain Socket (UDS) implemented as a named pipe, Pipe, and FIFO management thresholds.

또한, 본 발명은 AOSP에서 제공되는 AIDL, Messenger, Intent, Native Service 보다 빠르고 안정적으로 다른 어플리케이션과 통신을 가능하게 해주는 효과가 있다.Further, the present invention has the effect of enabling communication with other applications faster and more reliably than AIDL, Messenger, Intent, and Native Service provided in AOSP.

또한, 본 발명은 Java 어플리케이션으로 개발이 된다 하더라도 Native 간에 직접 통신하는 방법을 사용하는 구조로 개발할 수 있다.
Further, although the present invention is developed as a Java application, the present invention can be developed in a structure using direct communication between Native.

도 1은 종래의 기술에 다른 AIDL을 통한 통신 방식을 보여주는 개념도이고,
도 2는 본 발명에 따른 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법의 흐름을 나타내는 흐름도이고,
도 3은 본 발명의 일실시예에 따른 UDS를 통하여 생성되어진 FD 배열을 나타내는 예시도,
도 4는 본 발명의 일실시예에 따른 AOSP 기반에서 음성인식과 내비게이션간의 어플리케이션 간 통신 방법의 적용 개념도,
도 5는 본 발명의 일실시예에 따른 UDS를 통한 통신 방식을 보여주는 개념도이다.
FIG. 1 is a conceptual diagram illustrating a communication method using AIDL, which is different from the prior art,
FIG. 2 is a flowchart illustrating a flow of a method for optimizing internal application communication in an AOSP-based communication system according to the present invention,
3 is an exemplary diagram illustrating an FD array generated through a UDS according to an embodiment of the present invention,
4 is a conceptual diagram illustrating an application of an inter-application communication method between voice recognition and navigation in an AOSP-based communication system according to an embodiment of the present invention.
5 is a conceptual diagram illustrating a communication method using UDS according to an embodiment of the present invention.

본 명세서 및 청구범위에 사용된 용어나 단어는 통상적이거나 사전적인 의미로 한정해서 해석되어서는 아니 되며, 발명자는 그 자신의 발명을 가장 최선의 방법으로 설명하기 위해 용어의 개념을 적절하게 정의할 수 있다는 원칙에 입각하여 본 발명의 기술적 사상에 부합하는 의미와 개념으로 해석되어야만 한다.The terms and words used in the present specification and claims should not be construed as limited to ordinary or dictionary terms and the inventor may appropriately define the concept of the term in order to best describe its invention It should be construed as meaning and concept consistent with the technical idea of the present invention.

따라서 본 명세서에 기재된 실시예와 도면에 도시된 구성은 본 발명의 가장 바람직한 일 실시예에 불과할 뿐이고 본 발명의 기술적 사상을 모두 대변하는 것은 아니므로, 본 출원시점에 있어서 이들을 대체할 수 있는 다양한 균등물과 변형예들이 있을 수 있음을 이해하여야 한다.Therefore, the embodiments described in the present specification and the configurations shown in the drawings are merely the most preferred embodiments of the present invention and are not intended to represent all of the technical ideas of the present invention. Therefore, various equivalents It should be understood that water and variations may be present.

이하 첨부된 도면을 참조하여 본 발명의 바람직한 실시예를 상세히 설명하기로 한다.Hereinafter, preferred embodiments of the present invention will be described in detail with reference to the accompanying drawings.

도 2는 본 발명에 따른 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법의 흐름을 나타내는 흐름도이다.FIG. 2 is a flowchart illustrating a flow of a method for optimizing intra-application communication in an AOSP-based communication system according to the present invention.

도시와 같이 본 발명은 AOSP를 기반으로 하는 서로 다른 어플리케이션의 통신 방법에 있어서, 서로 다른 어플리케이션을 실행하는 제1단계(S100), 상기 서로 다른 어플리케이션의 리소스를 초기화하는 제2단계(S200), 제1어플리케이션에서 FD(File Descriptor)배열을 생성하는 제3단계(S300), 상기 FD 배열에서 인덱스 0번째의 FD를 대상으로 읽기 전용 FD[0]과 쓰기 전용 FD[0]을 생성하는 제4단계(S400), 상기 제2어플리케이션에서 UDS 정보를 요청하는 제5단계(S500), 상기 제1어플리케이션이 상기 인덱스 1의 FD를 상기 제2어플리케이션에 전달하는 제6단계(S600) 및 상기 제2어플리케이션이 인덱스 1번째의 FD를 대상으로 읽기 전용 FD[1]과 쓰기 전용 FD[1]을 생성하는 제7단계(S600)를 통하여 AOSP 기반에서 서로 다른 어플리케이션 간에 UDS 기반의 양방향 통신을 수행하게 된다.As shown in the figure, the present invention provides a communication method of different applications based on AOSP, including a first step (S100) of executing different applications, a second step (S200) of initializing resources of the different applications, A third step (S300) of generating an FD (File Descriptor) array in an application, a fourth step (S300) of generating a read only FD [0] and a write-only FD [0] (S500) of requesting the UDS information in the second application (S500); a sixth step (S600) of the first application transmitting the FD of the index 1 to the second application (S400) UDS-based bidirectional communication is performed between different applications on the AOSP basis through a seventh step (S600) of generating a read-only FD [1] and a write-only FD [1] with respect to the first FD of the index.

상기 제1단계(S100)는 사용자가 펌웨어(HW)상에서 어플리케이션을 실행하는 단계로, 상기 어플리케이션이란 안드로이드 프레임워크(Android Framework) 상에서 존재하는 서로 다른 프로세스를 의미한다.In the first step S100, the user executes an application on the firmware HW, and the application refers to a different process existing on the Android framework.

본 발명에서는 UDS 함수를 호출하여 FD 배열을 생성하고 이를 다른 프로세스에게 전달하는 역할을 하는 프로세스를 제1어플리케이션, UDS를 요청하고 상기 FD를 수신하여 상기 제1어플리케이션과 통신하는 프로세스를 제2어플리케이션으로 정의한다.In the present invention, a process of calling a UDS function to generate an FD array and transferring the FD array to another process is called a first application, a UDS is requested, a process of receiving the FD and communicating with the first application is called a second application define.

이후 상기 제2단계(S200)에서는 상기 제1어플리케이션과 상기 제2어플리케이션의 리소스를 초기화한다.In the second step S200, the resources of the first application and the second application are initialized.

상기 제3단계(S300)는 상기 제1어플리케이션에서 BSD, POSIX.1-2001에서 제정한 UDS(Unix Domain Socket) 기반의 SocketPair 함수를 호출하여 a named pipe 방식으로 인덱스 0과 인덱스 1의 FD(File Descriptor)배열을 생성하는 단계이다.In the third step S300, a SocketPair function based on UDS (Unix Domain Socket) established by BSD and POSIX.1-2001 is called in the first application, and an FD (File Descriptor) array.

상기 FD는 정수형으로 int fd[2]로 정의된다.The FD is an integer type and is defined as int fd [2].

도 3은 본 발명에 따른 UDS를 통하여 생성되어진 FD 배열을 나타내는 예시도로서, 도시와 같은 인덱스를 갖는 FD 배열을 생성하고 사용하게 되는 것이다.FIG. 3 is a diagram illustrating an FD array generated through a UDS according to the present invention, wherein an FD array having an index as shown in FIG. 3 is generated and used.

여기서 상기 인덱스 0의 FD는 상기 제1어플리케이션이 상기 제2어플리케이션과의 통신을 위한 것이고, 상기 인덱스 1의 FD는 상기 제2어플리케이션이 상기 제1어플리케이션과의 통신을 위해 사용하기 위한 FD이다.Here, the FD of the index 0 is for the first application to communicate with the second application, and the FD of the index 1 is an FD for the second application to use for communication with the first application.

상기 제4단계(S400)는 상기 제3단계(S300)에서 생성된 FD 배열에서 상기 FD 배열의 인덱스 0번째의 FD를 대상으로 읽기 전용 FD[0]과 쓰기 전용 FD[0]을 생성하는 단계로서, 상기 읽기 전용 FD[0]는 상기 제2어플리케이션이 데이터를 보내고 있는지 감지하는 FD이고, 상기 쓰기 전용 FD[0]는 상기 제2어플리케이션으로 데이터를 보내기 위하여 사용하는 FD인 것을 특징으로 한다.In the fourth step S400, a read-only FD [0] and a write-only FD [0] are generated for the 0th FD of the FD array in the FD array generated in the third step S300 Wherein the read only FD [0] is an FD for detecting whether the second application is transmitting data, and the write only FD [0] is an FD used for transmitting data to the second application.

상기 인덱스 0번째의 FD를 대상으로 읽기 전용 FD[0]과 쓰기 전용 FD[0]는 dup(fd[0])함수를 이용한다.The read (0) and read (2) FD (0) functions are used for the 0th FD of the index.

또한, 상기 제5단계(S500)는 상기 제2어플리케이션에서 제1어플리케이션에 UDS 정보를 요청하는 단계이다.The fifth step S500 is a step of requesting UDS information from the second application to the first application.

상기 제6단계(S600)는 상기 제1어플리케이션에서 상기 인덱스 1의 FD를 UDS의 응답으로 송신하는 단계이다.In the sixth step S600, the FD of the index 1 is transmitted in response to the UDS in the first application.

이때, 상기 제2어플리케이션에서의 UDS 정보 요청에 따라 상기 제1어플리케이션은 상기 인덱스 1의 FD를 상기 제2어플리케이션에 전달하기 위하여 AIDL(Android Interface Definition Language)의 정의 및 RPC(Remote Procedure Call) 통신을 위한 스터브(stub) 코드를 정의하여야 한다.At this time, according to the UDS information request in the second application, the first application defines the AIDL (Android Interface Definition Language) and RPC (Remote Procedure Call) communication to deliver the FD of the index 1 to the second application The stub code for the stub.

서버가 클라이언트에게 데이터를 요청할 때 클라이언트는 전달하고자 하는 데이터와 메시지를 받을 스레드를 식별하기 위하여 해당 소켓 을 ID 그리고 해당 데이터의 크기, 타입, 그리고 플래그 등의 메시지를 생성하고 이러한 메시지를 전송하게 된다. 이때, 상기 AIDL의 컴파일러에 의하여 상기 요소들이 생성이 된다. 이때 이러한 메시지를 전송하기 위하여 사용하는 것이 AIDL(Android Interface Definition Language)이다.When a server requests data from a client, the client generates a message such as a size, a type, and a flag of the corresponding ID and the corresponding data in order to identify the data to be transmitted and a thread to receive the message. At this time, the elements are generated by the AIDL compiler. At this time, AIDL (Android Interface Definition Language) is used to transmit these messages.

또한, 상기 스터브 코드란 내부 통신을 위해 메세지를 만들고 서비스를 요청하는 코드들이 상기 AIDL 컴파일러에 의해서 자동적으로 생성이 되는 코드를 의미한다.The stub code is a code for creating a message for internal communication and automatically requesting a service by the AIDL compiler.

상기 제7단계(S700)는 상기 제6단계(S600)의 UDS의 응답에 따라 상기 제2어플리케이션에서 인덱스 1번째의 FD를 대상으로 읽기 전용 FD[1]과 쓰기 전용 FD[1]을 생성하는 단계이다.In the seventh step S700, a read-only FD [1] and a write-only FD [1] are generated for the first FD of the index in the second application according to the response of the UDS of the sixth step S600 .

이때도 상기 제7단계(S700)의 읽기 전용 FD[1]은 상기 제1어플리케이션이 데이터를 보내고 있는지 감지하는 FD이고, 쓰기 전용 FD[1]은 상기 제1어플리케이션으로 데이터를 보내기 위하여 사용하는 FD 임을 알 수 있다.In this case, the read only FD [1] of the seventh step S700 is an FD for detecting whether the first application is transmitting data, and the write only FD [1] is an FD for transmitting data to the first application .

도 4는 본 발명의 일실시예에 따른 AOSP 기반에서 음성인식과 내비게이션간의 어플리케이션 간 통신 방법의 적용 개념도이다.FIG. 4 is a conceptual diagram of an application of an inter-application communication method between voice recognition and navigation in an AOSP-based system according to an embodiment of the present invention.

도시에서는 본 발명의 제1어플리케이션을 음성인식 어플리케이션으로 제2어플리케이션을 내비게이션 어플리케이션으로 정의한다.In a city, a first application of the present invention is defined as a voice recognition application, and a second application is defined as a navigation application.

그러므로 상기 음성인식 어플리케이션에서 사용자가 인식한 정보를 내비게이션 어플리케이션으로 전달하기 위해 UDS를 기반으로 통신하기 위해 진행되는 Flow를 시간적인 순서에 따라 설명하면 다음과 같다.Therefore, in order to transmit the information recognized by the user in the voice recognition application to the navigation application, the flow proceeding to communicate based on the UDS will be described in time sequence as follows.

먼저 펌웨어(HW)에서는 상기 음성인식 어플리케이션을 실행하게 된다(1). 실행되는 음성인식 어플리케이션에서는 리소스들의 초기화를 진행(2)하게 되는데, 이 과정이 끝나면 상기 음성인식은 SocketPair를 호출하여 UDS에 대한 FD 배열을 생성(3)한다. 여기서 SocketPair은 BSD, POSIX,1-2001에서 제정한 표준API로 UDS를 생성하는 기능을 제공한다.First, the firmware HW executes the speech recognition application (1). In the speech recognition application to be executed, initialization of resources is proceeded (2). When the process is completed, the speech recognition calls SocketPair to generate an FD array for UDS (3). Here SocketPair provides the ability to generate UDS with the standard APIs established in BSD, POSIX, 1-2001.

상술한 과정이 끝나면 음성인식 어플리케이션은 다른 프로세스와 통신하기 위해 FD[0]에 대해 FD 복사 함수인 dup를 사용하여 file descriptor(이하 fd)를 생성하게 된다(4). 이 때 생성된 fd는 총 2개를 생성하는데, 다른 어플리케이션과 통신 시 데이터를 송신/수신하는 목적으로 각각을 생성하는 것이다.After the above process is completed, the speech recognition application generates a file descriptor (fd) using dup, which is an FD copy function for FD [0], to communicate with other processes (4). In this case, the generated fd generates a total of two, which are generated for each purpose of transmitting / receiving data when communicating with other applications.

이후 펌웨어에서는 내비게이션 어플리케이션을 실행한다(5). 이때 실행되는 내비게이션은 초기화 과정(6)이 끝나면 음성인식에게 UDS를 요청하는 과정(7)을 진행하게 된다.Then, the firmware application executes the navigation application (5). When the initialization process 6 is completed, navigation performed at this time proceeds to a step 7 of requesting UDS to voice recognition.

상기 음성인식 어플리케이션에서는 내비게이션 어플리케이션에게 상기 (3)단계에서 생성한 FD[1]을 전달하게 된다(8).In the speech recognition application, FD [1] generated in the step (3) is transmitted to the navigation application (8).

그리고 내비게이션 어플리케이션은 전달받은 FD[1]을 통해 음성인식과 통신을 위한 송신/수신하는 목적으로 각각에 대한 FD를 생성한다(9).Then, the navigation application generates the FD for each of the transmitted and received signals for voice recognition and communication through the received FD [1] (9).

이후 UDS를 기반으로 하는 FD를 이용하여 상기 음성인식과 내비게이션 어플리케이션간 통신이 이루어지게 되는 것이다.Thereafter, communication between the voice recognition and the navigation application is performed using the FD based on the UDS.

도 5는 본 발명의 일실시예에 따른 UDS를 통한 통신 방식을 보여주는 개념도이다.5 is a conceptual diagram illustrating a communication method using UDS according to an embodiment of the present invention.

도시와 같이 본 발명은 AOSP 기반 위에서 서로 다른 어플리케이션끼리 데이터를 주고받는 통신 시에 양방향의 UDS를 기반으로 하는 FD의 생성과 이를 활용한 통신 방법에 의하여 종래의 기술에서 발생하는 중간 과정에서 발생하는 계층들을 생략할 수 있어서 네이티브단에서 서로 다른 어플리케이션간의 직접적인 통신을 이루는 진보적인 기술임을 알 수 있다.As shown in the drawing, according to the present invention, by generating an FD based on a bidirectional UDS and communicating using the UDS in data communication between different applications on an AOSP basis, Can be omitted, so that it can be seen that this is a progressive technology that makes direct communication between different applications in the native terminal.

본 발명은 이상에서 살펴본 바와 같이 바람직한 실시예를 들어 도시하고 설명하였으나, 상기한 실시예에 한정되지 아니하며 본 발명의 정신을 벗어나지 않는 범위 내에서 당해 발명이 속하는 기술분야에서 통상의 지식을 가진 자에 의해 다양한 변경과 수정이 가능할 것이다.While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is clearly understood that the same is by way of illustration and example only and is not to be taken by way of limitation, Various changes and modifications will be possible.

Claims (5)

AOSP를 기반으로 하는 서로 다른 어플리케이션의 통신 방법에 있어서,
제1어플리케이션과 제2어플리케이션을 실행하는 제1단계,
상기 제1어플리케이션과 상기 제2어플리케이션의 리소스를 초기화하는 제2단계,
상기 제1어플리케이션에서 UDS(Unix Domain Socket) 기반의 SocketPair 함수를 호출하여 a named pipe 방식으로 인덱스 0과 인덱스 1의 FD(File Descriptor)배열을 생성하는 제3단계,
상기 제3단계에서 생성된 FD 배열에서 상기 FD 배열의 인덱스 0번째의 FD를 대상으로 읽기 전용 FD[0]과 쓰기 전용 FD[0]을 생성하는 제4단계,
상기 제2어플리케이션에서 제1어플리케이션에 UDS 정보를 요청하는 제5단계,
상기 제5단계의 UDS의 요청에 따라 상기 제1어플리케이션은 상기 인덱스 1의 FD를 UDS의 응답으로 송신하는 제6단계 및
상기 제6단계의 UDS의 응답에 따라 상기 제2어플리케이션에서 인덱스 1번째의 FD를 대상으로 읽기 전용 FD[1]과 쓰기 전용 FD[1]을 생성하는 제7단계를 통하여 AOSP 기반에서 서로 다른 어플리케이션 간에 UDS 기반으로 양방향 통신을 수행하게 하는 것을 특징으로 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법.
In a communication method of different applications based on AOSP,
A first step of executing a first application and a second application,
A second step of initializing resources of the first application and the second application,
A third step of creating a FD (File Descriptor) array of an index 0 and an index 1 by a named pipe method by calling a UFS (Unix Domain Socket) based SocketPair function in the first application,
A fourth step of generating a read-only FD [0] and a write-only FD [0] with respect to an FD of the index 0 of the FD array in the FD array generated in the third step,
A fifth step of requesting UDS information from the second application to the first application,
The first application transmits the FD of the index 1 in response to the UDS according to the request of the UDS of the fifth step,
And a seventh step of generating a read-only FD [1] and a write-only FD [1] with respect to the first FD of the index in the second application according to the response of the UDS in the sixth step, Way communication based on the UDS. The method for optimizing communication between internal applications is based on AOSP.
제1 항에 있어서,
상기 제3단계에서 상기 인덱스 0의 FD는 상기 제1어플리케이션이 상기 제2어플리케이션과의 통신을 위한 것이고, 상기 인덱스 1의 FD는 상기 제2어플리케이션이 상기 제1어플리케이션과의 통신을 위해 사용하기 위한 FD인 것을 특징으로 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법.
The method according to claim 1,
In the third step, the FD of the index 0 is for the first application to communicate with the second application, and the FD of the index 1 is used for communicating with the first application FD is an AOSP-based method for optimizing communication between internal applications.
제1 항에 있어서,
상기 제5단계에서 상기 제2어플리케이션에서 UDS 정보의 요청에 따라 상기 제1어플리케이션은 상기 인덱스 1의 FD를 상기 제2어플리케이션에 전달하기 위하여 AIDL(Android Interface Definition Language)의 정의 및 RPC(Remote Procedure Call) 통신을 위한 스터브(stub) 코드를 정의하는 것을 특징으로 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법.
The method according to claim 1,
In response to a request for UDS information from the second application in the fifth step, the first application defines an Android Interface Definition Language (AIDL) and an RPC (Remote Procedure Call) to forward the FD of the index 1 to the second application. ) Stub code for communication between the internal application and the external device.
제1 항에 있어서,
상기 제4단계의 읽기 전용 FD[0]는 상기 제2어플리케이션이 데이터를 보내고 있는지 감지하는 FD이고, 상기 쓰기 전용 FD[0]는 상기 제2어플리케이션으로 데이터를 보내기 위하여 사용하는 FD인 것을 특징으로 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법.
The method according to claim 1,
The read-only FD [0] of the fourth step is an FD for detecting whether the second application is transmitting data, and the write-only FD [0] is an FD used for transmitting data to the second application To optimize communication between internal applications on the AOSP basis.
제1 항에 있어서,
상기 제7단계의 읽기 전용 FD[1]은 상기 제1어플리케이션이 데이터를 보내고 있는지 감지하는 FD이고, 쓰기 전용 FD[1]은 상기 제1어플리케이션으로 데이터를 보내기 위하여 사용하는 FD인 것을 특징으로 하는 AOSP 기반에서 내부 어플리케이션 간 통신의 최적화 방법.
The method according to claim 1,
The read-only FD [1] of the seventh step is an FD for detecting whether the first application is transmitting data, and the write-only FD [1] is an FD used for transmitting data to the first application A method of optimizing communication between internal applications on AOSP base.
KR1020150122284A 2015-08-31 2015-08-31 Optimization of internal communication between applications in the Android Open Source Project based KR102371988B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020150122284A KR102371988B1 (en) 2015-08-31 2015-08-31 Optimization of internal communication between applications in the Android Open Source Project based

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020150122284A KR102371988B1 (en) 2015-08-31 2015-08-31 Optimization of internal communication between applications in the Android Open Source Project based

Publications (2)

Publication Number Publication Date
KR20170026846A true KR20170026846A (en) 2017-03-09
KR102371988B1 KR102371988B1 (en) 2022-03-11

Family

ID=58402305

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020150122284A KR102371988B1 (en) 2015-08-31 2015-08-31 Optimization of internal communication between applications in the Android Open Source Project based

Country Status (1)

Country Link
KR (1) KR102371988B1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928562A (en) * 2019-10-30 2020-03-27 江苏东大集成电路系统工程技术有限公司 Software upgrading method for Android box
WO2024072117A1 (en) * 2022-09-30 2024-04-04 삼성전자 주식회사 Electronic device and communication method between applications

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20050079189A (en) * 2004-02-04 2005-08-09 삼성전자주식회사 Apparatus method of exchange packet in socket communication processor
KR100941113B1 (en) * 2001-11-20 2010-02-10 유니버샬 일렉트로닉스 인코포레이티드 User interface for a remote control application
CN103135980A (en) * 2011-12-05 2013-06-05 英顺源(上海)科技有限公司 System of animation play of interface procedure set on hand-held type device and method thereof
US20150245215A1 (en) * 2014-02-24 2015-08-27 Sierra Wireless, Inc. Wireless device customization resources

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100941113B1 (en) * 2001-11-20 2010-02-10 유니버샬 일렉트로닉스 인코포레이티드 User interface for a remote control application
KR20050079189A (en) * 2004-02-04 2005-08-09 삼성전자주식회사 Apparatus method of exchange packet in socket communication processor
CN103135980A (en) * 2011-12-05 2013-06-05 英顺源(上海)科技有限公司 System of animation play of interface procedure set on hand-held type device and method thereof
US20150245215A1 (en) * 2014-02-24 2015-08-27 Sierra Wireless, Inc. Wireless device customization resources

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928562A (en) * 2019-10-30 2020-03-27 江苏东大集成电路系统工程技术有限公司 Software upgrading method for Android box
WO2024072117A1 (en) * 2022-09-30 2024-04-04 삼성전자 주식회사 Electronic device and communication method between applications

Also Published As

Publication number Publication date
KR102371988B1 (en) 2022-03-11

Similar Documents

Publication Publication Date Title
US20220308941A1 (en) Sharing extension points to allow an application to share content via a sharing extension
CN108595970B (en) Configuration method and device of processing assembly, terminal and storage medium
US11334660B2 (en) Authenticated discoverability of Universal Windows Applications to Win32 desktop applications
US20160352665A1 (en) Tracking object across processes
US10754717B2 (en) Fast and accurate identification of message-based API calls in application binaries
CN113239377B (en) Authority control method, device, equipment and storage medium
US6754819B1 (en) Method and system for providing cryptographic services in a distributed application
CN112231124B (en) Inter-application communication method and device based on privacy protection
US20220245005A1 (en) Methods, devices and computer storage media for inter-mini program platform discovery
KR20170026846A (en) Optimization of internal communication between applications in the Android Open Source Project based
CN107066888B (en) Extensible trusted user interface, method and electronic device
US20230177315A1 (en) Using Deep Learning Models to Obfuscate and Optimize Communications
US11443058B2 (en) Processing requests at a remote service to implement local data classification
US20230068880A1 (en) Function-based service framework with trusted execution platform
CN112134938B (en) Message processing method, device, terminal and computer readable storage medium
WO2020187008A1 (en) Service invocation control method, service invocation method, device, and terminal
CN113076371A (en) Service management method, device and system based on language prediction machine-as-a-service platform
Wu et al. A context-aware kernel ipc firewall for android
US11683686B2 (en) Method for authentication, user terminal and authentication server for executing the same
CN111666581A (en) Data protection method, device, equipment and medium
JP7106778B1 (en) BLOCKCHAIN SYSTEM EXECUTION METHOD, APPARATUS, DEVICE, AND STORAGE MEDIUM
CN116049809B (en) Drive calling method and device
WO2023103890A1 (en) Capacity expansion method and apparatus, and electronic device
CN112134910A (en) Network request debugging method, device, equipment and storage medium
CN115174204A (en) Data transmission method, device and system

Legal Events

Date Code Title Description
A201 Request for examination
E902 Notification of reason for refusal
E701 Decision to grant or registration of patent right
GRNT Written decision to grant