KR102388083B1 - Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware - Google Patents

Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware Download PDF

Info

Publication number
KR102388083B1
KR102388083B1 KR1020200071630A KR20200071630A KR102388083B1 KR 102388083 B1 KR102388083 B1 KR 102388083B1 KR 1020200071630 A KR1020200071630 A KR 1020200071630A KR 20200071630 A KR20200071630 A KR 20200071630A KR 102388083 B1 KR102388083 B1 KR 102388083B1
Authority
KR
South Korea
Prior art keywords
event
communication
response
main thread
synchronization object
Prior art date
Application number
KR1020200071630A
Other languages
Korean (ko)
Other versions
KR20210154525A (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 KR1020200071630A priority Critical patent/KR102388083B1/en
Publication of KR20210154525A publication Critical patent/KR20210154525A/en
Application granted granted Critical
Publication of KR102388083B1 publication Critical patent/KR102388083B1/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/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
    • H04L67/32
    • H04L67/42
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Computer And Data Communications (AREA)

Abstract

이벤트 기반 비동기식 통신 프레임워크에서의 직접 및 간접 동기식 통신 방법 및 장치가 개시된다. 일 실시예에 따른 통신 방법은, 이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어에서의 통신 방법에 있어서, 메인 스레드(main thread)가 현재 태스크(task)에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록하는 단계와, 상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계와, 프로세싱 스레드(processing thread)가 상기 응답 조건 및 서버로부터 수신한 응답 이벤트에 기초하여 상기 이벤트 동기화 객체를 통해 상기 현재 태스크의 다음 태스크를 수행하기 위한 상기 메인 스레드의 상기 동작 상태를 전환하는 단계를 포함한다.A method and apparatus for direct and indirect synchronous communication in an event-based asynchronous communication framework are disclosed. A communication method according to an embodiment is a communication method in communication middleware supporting event-based asynchronous communication, wherein a main thread sets a response condition of a request event for a current task to an event synchronization object ( registering with an event synchronizer, the main thread transitioning the operating state of the main thread through the event synchronization object, and a processing thread based on the response condition and the response event received from the server. and switching the operating state of the main thread for performing the next task of the current task through the event synchronization object.

Description

이벤트 기반 비동기식 통신 미들웨어에서의 직접 및 간접 동기식 통신 방법 및 장치{METHOD AND APPARATUS FOR DIRECTLY AND INDIRECTLY SYNCHRONOUS COMMUNICATION IN EVENT-BASED ASYNCHRONOUS COMMUNICATION MIDDLEWARE}METHOD AND APPARATUS FOR DIRECTLY AND INDIRECTLY SYNCHRONOUS COMMUNICATION IN EVENT-BASED ASYNCHRONOUS COMMUNICATION MIDDLEWARE

아래 실시예들은 이벤트 기반 비동기식 통신 프레임워크에서의 직접 및 간접 동기식 통신 방법 및 장치에 관한 것이다.The embodiments below relate to a method and apparatus for direct and indirect synchronous communication in an event-based asynchronous communication framework.

온라인 게임, SNS, 클라우드 서비스, 및 IoT 등 대부분의 분산 시스템(distributed system) 어플리케이션은 통신 구조로 클라이언트-서버 또는 피어-피어 모델을 사용하여 노드 간의 통신을 수행한다.Most distributed system applications such as online games, SNS, cloud services, and IoT perform communication between nodes using a client-server or peer-peer model as a communication structure.

클라이언트-서버 모델의 분산 시스템에서는 클라이언트 어플리케이션이 서버 어플리케이션에게 서비스를 요청하고, 서버가 클라이언트에게 요청에 대한 응답을 하는 요청-응답(request-reply) 패턴으로 노드 간의 상호작용이 일어난다. 이때, 클라이언트 어플리케이션과 서버 어플리케이션 사이의 통신 방식은 다시 동기식(synchronous) 또는 비동기식(asynchronous) 방식으로 나누어진다.In a distributed system of the client-server model, interaction between nodes occurs in a request-reply pattern in which a client application requests a service to a server application, and the server responds to the request to the client. At this time, the communication method between the client application and the server application is again divided into a synchronous (synchronous) or asynchronous (asynchronous) method.

동기식 방식에서는 클라이언트가 서버에게 현재 태스크(task)에 대한 서비스를 요청한 후에 서버의 응답을 받을 때까지 다음 태스크를 수행하지 않고 실행 대기 상태에 들어간다. 클라이언트가 서버의 응답을 수신하면, 클라이언트는 다음 태스크의 수행을 진행한다. 비동기식 방식에서는 클라이언트가 서버에게 현재 태스크에 대한 서비스를 요청한 후에 실행 대기 상태에 들어가지 않고 바로 다음 태스크를 진행한다.In the synchronous method, after a client requests a service for a current task from the server, the next task is not performed until a response from the server is received and the client enters the execution standby state. When the client receives the server's response, the client proceeds with the next task. In the asynchronous method, after the client requests the service for the current task from the server, the next task is immediately proceeded without entering the execution waiting state.

어플리케이션이 필요로 하는 통신 기능은 어플리케이션 개발자가 직접 개발할 수도 있지만, 통신 미들웨어(Communication Middleware, CM)의 서비스를 이용함으로써 어플리케이션 개발 효율을 높일 수 있다. 하지만, 기존의 통신 미들웨어 또는 프레임워크(framework)는 범용 또는 타겟 어플리케이션에 특화된 다양한 통신 서비스를 제공하지만, 서비스별 통신 방식에 있어서는 동기식 및 비동기식 통신을 모두 지원하지 않는다.The communication function required by the application may be directly developed by the application developer, but application development efficiency can be increased by using the service of Communication Middleware (CM). However, the existing communication middleware or framework provides various communication services specialized for general purpose or target application, but does not support both synchronous and asynchronous communication in the communication method for each service.

실시예들은 이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어에서 메인 스레드와 프로세싱 스레드에 이벤트 동기화 객체(event synchronizer)를 통한 동기화 메카니즘을 적용함으로써, 사용자의 요구사항에 따라 이벤트 기반의 비동기식 통신 미들웨어에서 비동기식 통신과 동기식 통신을 함께 이용할 수 있는 기술을 제공할 수 있다.Embodiments apply a synchronization mechanism through an event synchronizer to a main thread and a processing thread in a communication middleware that supports event-based asynchronous communication, so that asynchronous communication in an event-based asynchronous communication middleware according to user requirements and synchronous communication can be provided.

다만, 기술적 과제는 상술한 기술적 과제들로 한정되는 것은 아니며, 또 다른 기술적 과제들이 존재할 수 있다.However, the technical tasks are not limited to the above-described technical tasks, and other technical tasks may exist.

일 실시예에 따른 통신 방법은, 이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어에서의 통신 방법에 있어서, 메인 스레드(main thread)가 현재 태스크(task)에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록하는 단계와, 상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계와, 프로세싱 스레드(processing thread)가 상기 응답 조건 및 서버로부터 수신한 응답 이벤트에 기초하여 상기 이벤트 동기화 객체를 통해 상기 현재 태스크의 다음 태스크를 수행하기 위한 상기 메인 스레드의 상기 동작 상태를 전환하는 단계를 포함한다.A communication method according to an embodiment is a communication method in communication middleware supporting event-based asynchronous communication, wherein a main thread sets a response condition of a request event for a current task to an event synchronization object ( registering with an event synchronizer, the main thread transitioning the operating state of the main thread through the event synchronization object, and a processing thread based on the response condition and the response event received from the server. and switching the operating state of the main thread for performing the next task of the current task through the event synchronization object.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입을 등록하는 단계를 포함할 수 있다.The registering may include registering an event type of a response event to the request event as the response condition.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가 상기 이벤트 타입과 동일한지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operation state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type; The method may include registering an event in the event synchronization object, and switching the operation state of the main thread through the event synchronization object according to a determination result.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입 및 상기 요청 이벤트가 전송되는 응답 대상 클라이언트 장치를 등록하는 단계를 포함할 수 있다.The registering may include registering, as the response condition, an event type of a response event to the request event and a response target client device to which the request event is transmitted.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치로부터 전송되었는지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operating state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type and transmitted from the response target client device; , registering the received response event to the event synchronization object according to a determination result, and switching the operation state of the main thread through the event synchronization object according to the determination result.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입, 상기 요청 이벤트가 전송되는 복수의 응답 대상 클라이언트 장치들 및 최소 응답 이벤트 수를 등록하는 단계를 포함할 수 있다.The registering may include registering, as the response condition, an event type of a response event to the request event, a plurality of response target client devices to which the request event is transmitted, and a minimum number of response events.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 복수의 응답 대상 클라이언트 장치들 중에서 어느 하나로부터 전송되었는지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라 응답 이벤트 수를 카운트하는 단계와, 카운트 결과가 상기 최소 응답 이벤트 수를 만족하는 때, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operating state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type and is transmitted from one of the plurality of response target client devices determining whether or not, registering the received response event to the event synchronization object according to the determination result; counting the number of response events according to the determination result; When doing, it may include the step of switching the operating state of the main thread through the event synchronization object.

상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계와, 상기 락을 획득한 상기 프로세싱 스레드가 상기 메인 스레드의 동작 상태를 실행 상태로 전환하는 단계와, 상기 메인 스레드를 실행 상태로 전환시킨 상기 프로세싱 스레드가 상기 락을 놓는 단계를 포함할 수 있다.The step of switching the operating state of the main thread through the event synchronization object includes: acquiring a lock exclusive of ownership of the event synchronization object; It may include transitioning the operational state of a thread to the running state, and releasing the lock by the processing thread that has switched the main thread to the running state.

상기 방법은, 상기 프로세싱 스레드에 의해 동작 상태가 전환된 상기 메인 스레드가 상기 이벤트 동기화 객체에 등록된 응답 이벤트를 추출하는 단계와, 상기 메인 스레드가 상기 추출한 응답 이벤트에 포함된 상기 요청 이벤트에 대한 요청 결과 값을 애플리케이션으로 리턴하는 단계를 더 포함할 수 있다.The method includes: extracting, by the main thread whose operation state has been changed by the processing thread, a response event registered in the event synchronization object; and the main thread requesting the request event included in the extracted response event The method may further include returning a result value to the application.

상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 동작 상태를 전환하는 단계는, 상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계와, 상기 락을 획득한 상기 메인 스레드가 상기 메인 스레드의 동작 상태를 실행 대기 상태로 전환하는 단계와, 상기 실행 대기 상태로 전환된 상기 메인 스레드가 상기 락을 놓는 단계를 포함할 수 있다.The step of the main thread changing the operating state through the event synchronization object includes: acquiring a lock that monopolizes a state of ownership of the event synchronization object; The method may include changing an operation state of a thread to an execution standby state, and releasing the lock by the main thread switched to the execution standby state.

일 실시예에 따른 통신 장치는, 이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어와, 상기 통신 미들웨어를 실행하기 위한 프로세서를 포함하고, 상기 통신 미들웨어가 상기 프로세서에 의해 실행될 때, 상기 통신 미들웨어는, 메인 스레드(main thread)가 현재 태스크(task)에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록하는 단계와, 상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계와, 프로세싱 스레드(processing thread)가 상기 응답 조건 및 서버로부터 수신한 응답 이벤트에 기초하여 상기 이벤트 동기화 객체를 통해 상기 현재 태스크의 다음 태스크를 수행하기 위한 상기 메인 스레드의 상기 동작 상태를 전환하는 단계를 수행한다.A communication device according to an embodiment includes communication middleware supporting event-based asynchronous communication, and a processor for executing the communication middleware, and when the communication middleware is executed by the processor, the communication middleware is a main A step in which a thread (main thread) registers a response condition of a request event for a current task in an event synchronizer, and the main thread switches an operation state of the main thread through the event synchronization object and, by a processing thread, transitioning the operational state of the main thread to perform the next task of the current task through the event synchronization object based on the response condition and the response event received from the server. Follow the steps.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입을 등록하는 단계를 포함할 수 있다.The registering may include registering an event type of a response event to the request event as the response condition.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가 상기 이벤트 타입과 동일한지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operation state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type; The method may include registering an event in the event synchronization object, and switching the operation state of the main thread through the event synchronization object according to a determination result.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입 및 상기 요청 이벤트가 전송되는 응답 대상 클라이언트 장치를 등록하는 단계를 포함할 수 있다.The registering may include registering, as the response condition, an event type of a response event to the request event and a response target client device to which the request event is transmitted.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치로부터 전송되었는지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operating state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type and transmitted from the response target client device; , registering the received response event to the event synchronization object according to a determination result, and switching the operation state of the main thread through the event synchronization object according to the determination result.

상기 등록하는 단계는, 상기 응답 조건으로, 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입, 상기 요청 이벤트가 전송되는 복수의 응답 대상 클라이언트 장치들 및 최소 응답 이벤트 수를 등록하는 단계를 포함할 수 있다.The registering may include registering, as the response condition, an event type of a response event to the request event, a plurality of response target client devices to which the request event is transmitted, and a minimum number of response events.

상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 서버로부터 응답 이벤트를 수신하는 단계와, 상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 복수의 응답 대상 클라이언트 장치들 중에서 어느 하나로부터 전송되었는지 여부를 판단하는 단계와, 판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계와, 판단 결과에 따라 응답 이벤트 수를 카운트하는 단계와, 카운트 결과가 상기 최소 응답 이벤트 수를 만족하는 때, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계를 포함할 수 있다.The step of switching the operating state of the main thread includes: receiving a response event from the server; determining whether the received response event is the same as the event type and is transmitted from one of the plurality of response target client devices determining whether or not, registering the received response event to the event synchronization object according to the determination result; counting the number of response events according to the determination result; When doing, it may include the step of switching the operating state of the main thread through the event synchronization object.

상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계는, 상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계와, 상기 락을 획득한 상기 프로세싱 스레드가 상기 메인 스레드의 동작 상태를 실행 상태로 전환하는 단계와, 상기 메인 스레드를 실행 상태로 전환시킨 상기 프로세싱 스레드가 상기 락을 놓는 단계를 포함할 수 있다.The step of switching the operating state of the main thread through the event synchronization object includes: acquiring a lock exclusive of ownership of the event synchronization object; It may include transitioning the operational state of a thread to the running state, and releasing the lock by the processing thread that has switched the main thread to the running state.

상기 통신 미들웨어는, 상기 프로세싱 스레드에 의해 동작 상태가 전환된 상기 메인 스레드가 상기 이벤트 동기화 객체에 등록된 응답 이벤트를 추출하는 단계와, 상기 메인 스레드가 상기 추출한 응답 이벤트에 포함된 상기 요청 이벤트에 대한 요청 결과 값을 애플리케이션으로 리턴하는 단계를 더 수행할 수 있다.The communication middleware may include: extracting, by the main thread whose operation state is changed by the processing thread, a response event registered in the event synchronization object; The step of returning the request result value to the application may be further performed.

상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 동작 상태를 전환하는 단계는, 상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계와, 상기 락을 획득한 상기 메인 스레드가 상기 메인 스레드의 동작 상태를 실행 대기 상태로 전환하는 단계와, 상기 실행 대기 상태로 전환된 상기 메인 스레드가 상기 락을 놓는 단계를 포함할 수 있다.The step of the main thread changing the operating state through the event synchronization object includes: acquiring a lock that monopolizes a state of ownership of the event synchronization object; The method may include changing an operation state of a thread to an execution standby state, and releasing the lock by the main thread switched to the execution standby state.

도 1 및 도 2는 동기식 통신과 비동기식 통신을 설명하기 위한 도면이다.
도 3 및 도 4는 간접 동기식 통신 방식을 설명하기 위한 도면이다.
도 5는 통신 미들웨어를 설명하기 위한 도면이다.
도 6 및 도 7은 통신 미들웨어를 통한 클라이언트-서버의 단일 서버-단일 연결 구조 및 다중 서버-다중 연결 구조의 일 예를 나타낸 도면이다.
도 8은 통신 미들웨어의 통신 서비스 및 옵션의 일 예를 나타내는 도면이다.
도 9는 이벤트 기반의 동기식 통신 미들웨어를 설명하기 위한 도면이다.
도 10은 통신 미들웨어의 다중 스레드 구조에 의해 클라이언트와 서버 사이에 수행되는 비동기식 통신 방법을 설명하기 위한 도면이다.
도 11은 일 실시예에 따른 통신 시스템을 나타낸다.
도 12는 도 11에 도시된 제1 통신 장치를 개략적으로 나타낸 도면이다.
도 13은 도 11에 도시된 서버를 개략적으로 나타낸 도면이다.
도 14는 도 11에 도시된 제2 통신 장치를 개략적으로 나타낸 도면이다.
도 15는 제1 통신 장치 및 서버 간 비동기식 통신 미들웨어에서의 직접 동기식 통신 방법의 일 예를 설명하기 위한 도면이다.
도 16은 제1 통신 장치, 서버 및 제2 통신 장치 간의 비동기식 통신 미들웨어에서의 일대일 간접 동기식 통신 방법 및 일대다 간접 동기식 통신 방법의 일 예를 설명하기 위한 도면이다.
도 17은 도 15 및 도 16에 도시된 이벤트 동기화 객체의 클래스 및 관련 클래스 다이어그램을 나타낸 도면이다.
도 18은 제1 통신 장치의 통신 미들웨어의 내부 상태 정보 관리 클래스들을 나타낸 도면이다.
도 19는 제1 통신 장치의 통신 미들웨어의 동기식 애플리케이션 프로그래밍 인터페이스를 설명하기 위한 도면이다.
도 20은 sendrecv() 함수의 동작 알고리즘을 나타낸다.
도 21은 제1 통신 장치의 프로세싱 스레드가 수행하는 동기식 통신 처리 알고리즘의 일 예를 나타낸다.
도 22는 비동기식 API 함수의 리턴 지연 시간의 일 예를 나타낸 도면이다.
도 23 및 도 24는 클라이언트가 통신 미들웨어 서비스를 요청하는 경우 직접 동기식 통신과 비동기식 통신을 사용했을 때의 서버 응답 시간을 측정한 결과의 일 예를 나타낸다.
도 25는 직접 동기식 및 간접 동기식 sendrecv() API와 비동기식 버전의 응답 지연 시간의 일 예를 나타낸다.
도 26은 일대다 간접 동기식 castrecv() API와 비동기식 버전의 응답 지연 시간의 일 예를 나타낸다.
1 and 2 are diagrams for explaining synchronous communication and asynchronous communication.
3 and 4 are diagrams for explaining an indirect synchronous communication method.
5 is a diagram for explaining communication middleware.
6 and 7 are diagrams illustrating an example of a single server-single connection structure of a client-server and a multi-server-multi-connection structure through communication middleware.
8 is a diagram illustrating an example of communication services and options of communication middleware.
9 is a diagram for explaining an event-based synchronous communication middleware.
FIG. 10 is a diagram for explaining an asynchronous communication method performed between a client and a server by a multi-threaded structure of communication middleware.
11 illustrates a communication system according to an embodiment.
12 is a diagram schematically illustrating the first communication device shown in FIG. 11 .
13 is a diagram schematically illustrating the server shown in FIG. 11 .
14 is a diagram schematically illustrating the second communication device shown in FIG. 11 .
15 is a diagram for explaining an example of a direct synchronous communication method in asynchronous communication middleware between a first communication device and a server.
16 is a diagram for explaining an example of a one-to-one indirect synchronous communication method and a one-to-many indirect synchronous communication method in asynchronous communication middleware between a first communication device, a server, and a second communication device.
17 is a diagram illustrating a class and related class diagram of the event synchronization object shown in FIGS. 15 and 16 .
18 is a diagram illustrating internal state information management classes of communication middleware of the first communication device.
19 is a view for explaining a synchronous application programming interface of the communication middleware of the first communication device.
20 shows the operation algorithm of the sendrecv() function.
21 shows an example of a synchronous communication processing algorithm performed by a processing thread of a first communication device.
22 is a diagram illustrating an example of a return delay time of an asynchronous API function.
23 and 24 show an example of the result of measuring the server response time when the direct synchronous communication and the asynchronous communication are used when the client requests the communication middleware service.
25 shows an example of response latency of a direct synchronous and indirect synchronous sendrecv() API and an asynchronous version.
26 shows an example of response latency of a one-to-many indirect synchronous castrecv() API and an asynchronous version.

이하에서, 첨부된 도면을 참조하여 실시예들을 상세하게 설명한다. 그러나, 실시예들에는 다양한 변경이 가해질 수 있어서 특허출원의 권리 범위가 이러한 실시예들에 의해 제한되거나 한정되는 것은 아니다. 실시예들에 대한 모든 변경, 균등물 내지 대체물이 권리 범위에 포함되는 것으로 이해되어야 한다.Hereinafter, embodiments will be described in detail with reference to the accompanying drawings. However, since various changes may be made to the embodiments, the scope of the patent application is not limited or limited by these embodiments. It should be understood that all modifications, equivalents and substitutes for the embodiments are included in the scope of the rights.

실시예에서 사용한 용어는 단지 설명을 목적으로 사용된 것으로, 한정하려는 의도로 해석되어서는 안된다. 단수의 표현은 문맥상 명백하게 다르게 뜻하지 않는 한, 복수의 표현을 포함한다. 본 명세서에서, "포함하다" 또는 "가지다" 등의 용어는 명세서 상에 기재된 특징, 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것이 존재함을 지정하려는 것이지, 하나 또는 그 이상의 다른 특징들이나 숫자, 단계, 동작, 구성요소, 부품 또는 이들을 조합한 것들의 존재 또는 부가 가능성을 미리 배제하지 않는 것으로 이해되어야 한다.The terms used in the examples are used for the purpose of description only, and should not be construed as limiting. The singular expression includes the plural expression unless the context clearly dictates otherwise. In this specification, terms such as "comprise" or "have" are intended to designate that a feature, number, step, operation, component, part, or a combination thereof described in the specification exists, but one or more other features It should be understood that this does not preclude the existence or addition of numbers, steps, operations, components, parts, or combinations thereof.

다르게 정의되지 않는 한, 기술적이거나 과학적인 용어를 포함해서 여기서 사용되는 모든 용어들은 실시예가 속하는 기술 분야에서 통상의 지식을 가진 자에 의해 일반적으로 이해되는 것과 동일한 의미를 가지고 있다. 일반적으로 사용되는 사전에 정의되어 있는 것과 같은 용어들은 관련 기술의 문맥 상 가지는 의미와 일치하는 의미를 가지는 것으로 해석되어야 하며, 본 출원에서 명백하게 정의하지 않는 한, 이상적이거나 과도하게 형식적인 의미로 해석되지 않는다.Unless otherwise defined, all terms used herein, including technical or scientific terms, have the same meaning as commonly understood by one of ordinary skill in the art to which the embodiment belongs. Terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with the meaning in the context of the related art, and should not be interpreted in an ideal or excessively formal meaning unless explicitly defined in the present application. does not

또한, 첨부 도면을 참조하여 설명함에 있어, 도면 부호에 관계없이 동일한 구성 요소는 동일한 참조부호를 부여하고 이에 대한 중복되는 설명은 생략하기로 한다. 실시예를 설명함에 있어서 관련된 공지 기술에 대한 구체적인 설명이 실시예의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우 그 상세한 설명을 생략한다.In addition, in the description with reference to the accompanying drawings, the same components are given the same reference numerals regardless of the reference numerals, and the overlapping description thereof will be omitted. In describing the embodiment, if it is determined that a detailed description of a related known technology may unnecessarily obscure the gist of the embodiment, the detailed description thereof will be omitted.

또한, 실시 예의 구성 요소를 설명하는 데 있어서, 제1, 제2, A, B, (a), (b) 등의 용어를 사용할 수 있다. 이러한 용어는 그 구성 요소를 다른 구성 요소와 구별하기 위한 것일 뿐, 그 용어에 의해 해당 구성 요소의 본질이나 차례 또는 순서 등이 한정되지 않는다. 어떤 구성 요소가 다른 구성요소에 "연결", "결합" 또는 "접속"된다고 기재된 경우, 그 구성 요소는 그 다른 구성요소에 직접적으로 연결되거나 접속될 수 있지만, 각 구성 요소 사이에 또 다른 구성 요소가 "연결", "결합" 또는 "접속"될 수도 있다고 이해되어야 할 것이다.In addition, in describing the components of the embodiment, terms such as first, second, A, B, (a), (b), etc. may be used. These terms are only for distinguishing the elements from other elements, and the essence, order, or order of the elements are not limited by the terms. When it is described that a component is "connected", "coupled" or "connected" to another component, the component may be directly connected or connected to the other component, but another component is between each component. It will be understood that may also be "connected", "coupled" or "connected".

어느 하나의 실시 예에 포함된 구성요소와, 공통적인 기능을 포함하는 구성요소는, 다른 실시 예에서 동일한 명칭을 사용하여 설명하기로 한다. 반대되는 기재가 없는 이상, 어느 하나의 실시 예에 기재한 설명은 다른 실시 예에도 적용될 수 있으며, 중복되는 범위에서 구체적인 설명은 생략하기로 한다.Components included in one embodiment and components having a common function will be described using the same names in other embodiments. Unless otherwise stated, descriptions described in one embodiment may be applied to other embodiments as well, and detailed descriptions within the overlapping range will be omitted.

본 명세서에서의 모듈(module) 은 본 명세서에서 설명되는 각 명칭에 따른 기능과 동작을 수행할 수 있는 하드웨어를 의미할 수도 있고, 특정 기능과 동작을 수행할 수 있는 컴퓨터 프로그램 코드를 의미할 수도 있고, 또는 특정 기능과 동작을 수행시킬 수 있는 컴퓨터 프로그램 코드가 탑재된 전자적 기록 매체, 예를 들어 프로세서 또는 마이크로 프로세서를 의미할 수 있다. 다시 말해, 모듈이란 본 발명의 기술적 사상을 수행하기 위한 하드웨어 및/또는 하드웨어를 구동하기 위한 소프트웨어의 기능적 및/또는 구조적 결합을 의미할 수 있다.A module in the present specification may mean hardware capable of performing functions and operations according to each name described in this specification, or may mean computer program code capable of performing specific functions and operations, , or an electronic recording medium on which a computer program code capable of performing specific functions and operations is loaded, for example, may refer to a processor or a microprocessor. In other words, a module may mean a functional and/or structural combination of hardware for carrying out the technical idea of the present invention and/or software for driving the hardware.

도 1 및 도 2는 동기식 통신과 비동기식 통신을 설명하기 위한 도면이다.1 and 2 are diagrams for explaining synchronous communication and asynchronous communication.

클라이언트-서버 방식의 애플리케이션에서 클라이언트(100)와 서버(200) 사이의 통신 방식은 대개 요청-응답(request-reply)패턴을 따를 수 있다. 클라이언트-서버 방식의 애플리케이션에서는 클라이언트(100)의 요청과 이에 대한 서버(200)의 응답 메시지들이 모여 상호 작용을 이루며 여러가지 서비스를 진행할 수 있다.In a client-server application, a communication method between the client 100 and the server 200 may generally follow a request-reply pattern. In the client-server type application, the request of the client 100 and the response messages of the server 200 to the request are gathered to form an interaction, and various services can be performed.

이러한 클라이언트(100)와 서버(200) 사이의 통신 방식은 도 1과 같이 동기식 또는 도 2와 같이 비동기식으로 구분할 수 있다. 도 1에 도시된 동기식 통신 방식의 경우, 클라이언트(100)는 서버(200)에게 서비스 요청 메시지를 전송하고, 서버(200)가 응답 메시지를 보낼 때까지 다른 태스크를 수행하지 않고 블록 상태로 대기할 수 있다. 클라이언트(100)는 서버(200)로부터 응답 메시지를 받은 후에, 다음 태스크를 계속 진행할 수 있다.The communication method between the client 100 and the server 200 may be divided into synchronous as shown in FIG. 1 or asynchronous as shown in FIG. 2 . In the case of the synchronous communication method shown in FIG. 1, the client 100 transmits a service request message to the server 200, and waits in a block state without performing other tasks until the server 200 sends a response message. can After receiving the response message from the server 200 , the client 100 may proceed with the next task.

도 2에 도시된 비동기식 통신 방식에서는, 클라이언트(100)는 서버(200)에게 요청 메시지를 보낸 후에도 서버(200)의 응답을 기다리지 않고 다른 태스크를 수행할 수 있다. 예를 들어, 클라이언트(100)는 서버(200)의 응답을 기다리는 동안 사용자로부터 다음 로컬 입력의 처리가 가능할 수 있다. 대신, 비동기 통신에서는 클라이언트(100)가 다른 태스크를 수행하는 것과 독립적으로 서버(200)의 응답 메시지를 비동기적으로 수신할 수 있는 메카니즘이 필요할 수 있다.In the asynchronous communication method shown in FIG. 2 , the client 100 may perform another task without waiting for a response from the server 200 even after sending the request message to the server 200 . For example, the client 100 may be able to process the next local input from the user while waiting for a response from the server 200 . Instead, in asynchronous communication, a mechanism for asynchronously receiving a response message from the server 200 independently of the client 100 performing other tasks may be required.

클라이언트(100)와 서버(200) 사이의 통신을 동기식으로 할지 비동기식으로 할지는 애플리케이션 특성에 따라 일괄적으로 정할 수도 있다. 하지만, 클라이언트(100)와 서버(200)의 통신 상호 작용에 대한 성능 향상을 위해서는 클라이언트(100)가 요청하는 서비스의 종류와 특성에 따라 동기식 또는 비동기식 중 적합한 방식을 선택적으로 결정하는 것이 효과적일 수 있다.Whether the communication between the client 100 and the server 200 is performed synchronously or asynchronously may be determined collectively according to application characteristics. However, in order to improve the performance of the communication interaction between the client 100 and the server 200, it may be effective to selectively determine a suitable method, either synchronous or asynchronous, according to the type and characteristics of the service requested by the client 100. there is.

통신 방식을 결정하는 주된 기준은 클라이언트(100)가 서비스 요청 결과를 기다리는 동안 수행할 다른 태스크가 있는지의 여부일 수 있다. 클라이언트(100)가 서비스를 요청하고 이 응답을 받아야 다른 태스크를 수행할 수 있다면 동기식 통신 방식을 사용하는 것이 효과적일 수 있다. 클라이언트(100)가 요청 결과를 기다리는 동안 수행해야할 다른 태스크가 존재한다면 비동기식 통신 방식을 사용하는 것이 더 효과적일 수 있다. 예를 들어, 클라이언트(100)가 파일전송 서비스를 요청하는 경우, 클라이언트(100)가 파일 전송 완료 후에 이 파일을 이용해서 다음 태스크를 수행해야 한다면 동기식 통신 방식이 간단할 수 있다. 반대로, 클라이언트(100)가 파일이 전송되는 동안 수행해야하는 다른 태스크가 있다면 비동기식으로 파일 전송 서비스를 요청하는 것이 바람직할 수 있다.The main criterion for determining the communication method may be whether there is another task to be performed while the client 100 waits for the result of the service request. If the client 100 requests a service and receives this response to perform another task, it may be effective to use a synchronous communication method. If there is another task to be performed while the client 100 waits for the request result, it may be more effective to use the asynchronous communication method. For example, when the client 100 requests a file transfer service, the synchronous communication method may be simple if the client 100 needs to perform the following task using the file after the file transfer is completed. Conversely, if the client 100 has other tasks to perform while the file is being transferred, it may be desirable to request the file transfer service asynchronously.

도 3 및 도 4는 간접 동기식 통신 방식을 설명하기 위한 도면이다.3 and 4 are diagrams for explaining an indirect synchronous communication method.

클라이언트-서버 방식의 애플리케이션에서 동기식 통신 방식은 직접 동기식 통신(directly synchronous communication)과 간접 동기식 통신(indirectly synchronous communication)으로 구분할 수 있다.In a client-server type application, the synchronous communication method can be divided into direct synchronous communication and indirectly synchronous communication.

직접 동기식 통신은 클라이언트(100)와 채널로 직접 연결된 서버(200) 사이의 동기식 방식을 의미할 수 있다. 직접 동기식 통신은 일반적인 요청-응답 패턴 통신에 적용될 수 있다.Direct synchronous communication may refer to a synchronous method between the client 100 and the server 200 directly connected through a channel. Direct synchronous communication can be applied to general request-response pattern communication.

간접 동기식 통신은 클라이언트들(100-1 및 100-2)이 서로 서버(200)의 중개를 통해 동기식 통신을 수행하는 경우를 의미할 수 있다. 예를 들어, 제1 클라이언트(100-1)가 수행하는 일련의 태스크 수행 과정에서 제2 클라이언트(100-2)의 확인을 수신한 후에 다음 태스크를 진행해야할 때 간접 동기식 통신 방식을 사용할 수 있다.Indirect synchronous communication may mean a case in which the clients 100 - 1 and 100 - 2 perform synchronous communication with each other through the mediation of the server 200 . For example, an indirect synchronous communication method may be used when the next task needs to be performed after receiving the confirmation of the second client 100 - 2 in the process of performing a series of tasks performed by the first client 100 - 1 .

도 3은 제1 클라이언트(100-1) 및 제2 클라이언트(100-2)가 일대일로 간접 동기식 통신을 수행하는 과정의 일 예이다. 먼저, 제1 클라이언트(100-1)가 제2 클라이언트(100-2)에게 요청 메시지를 전송할 수 있다. 요청 메시지는 서버(200)를 통해 제2 클라이언트(100-2)에게 전달될 수 있다.3 is an example of a process in which a first client 100-1 and a second client 100-2 perform indirect synchronous communication on a one-to-one basis. First, the first client 100 - 1 may transmit a request message to the second client 100 - 2 . The request message may be delivered to the second client 100 - 2 through the server 200 .

제2 클라이언트(100-2)는 제1 클라이언트(100-1)의 요청을 처리하여 생성한 응답 메시지를 전송할 수 있다. 제2 클라이언트(100-2)는 응답 메시지를 서버(200)를 통해 제1 클라이언트(100-1)로 전달할 수 있다. 제1 클라이언트(100-1)는 제2 클라이언트(100-2)의 응답 메시지를 수신할 때까지 대기할 수 있다.The second client 100 - 2 may transmit a response message generated by processing the request of the first client 100 - 1 . The second client 100 - 2 may transmit the response message to the first client 100 - 1 through the server 200 . The first client 100-1 may wait until it receives a response message from the second client 100-2.

도 4를 참조하면, 도 4와 같이 제1 클라이언트(100-1)가 복수의 클라이언트들(100-2 내지 100-n)을 대상으로 동기식 통신을 수행하는 경우를 일대다 간접 동기식 통신이라고 정의할 수 있다. 일대다 간접 동기식 통신 방식에서는 제1 클라이언트(100-1)가 서버(200)를 거쳐 복수의 클라이언트들(100-2 내지 100-n)에게 요청 메시지를 전송할 수 있다.Referring to FIG. 4 , as shown in FIG. 4 , a case in which the first client 100-1 performs synchronous communication with a plurality of clients 100-2 to 100-n is defined as one-to-many indirect synchronous communication. can In the one-to-many indirect synchronous communication method, the first client 100-1 may transmit a request message to the plurality of clients 100-2 to 100-n via the server 200 .

요청 메시지를 수신한 복수의 클라이언트들(100-2 내지 100-n)은 각각 서버(200)를 거쳐 응답 메시지를 제1 클라이언트(100-1)에게 전송할 수 있다. 제1 클라이언트(100-1)는 n개의 응답 메시지를 수신할 때까지 대기한 후, 다음 태스크를 실행할 수 있다.The plurality of clients 100 - 2 to 100 - n that have received the request message may each transmit a response message to the first client 100 - 1 through the server 200 . After waiting until receiving n response messages, the first client 100 - 1 may execute the next task.

일대다 간접 동기식 통신 방식에서 추가적으로 고려할 사항은 요청 메시지를 전송한 제1 클라이언트(100-1)가 복수의 클라이언트들(100-2 내지 100-n) 중 몇 개의 응답 메시지를 수신할 때까지 대기할 것인지 결정하는 문제일 수 있다. 즉, 제1 클라이언트(100-1)는 요구 상황에 따라 최소 응답 메시지 수를 결정할 수 있다. 예를 들어, 모든 클라이언트로부터의 응답이 필요하면 n+1개의 응답 메시지를 수신할 때까지 대기해야 하고, 과반수의 클라이언트로부터 응답만 필요하면 (n+1)/2개의 응답 메시지를 수신할 때 까지만 대기할 수 있다.An additional consideration in the one-to-many indirect synchronous communication method is to wait until the first client 100-1 that has transmitted the request message receives several response messages from among the plurality of clients 100-2 to 100-n. It may be a matter of deciding whether That is, the first client 100 - 1 may determine the minimum number of response messages according to the request situation. For example, if you need responses from all clients, you have to wait until n+1 response messages are received. can wait

도 5는 통신 미들웨어를 설명하기 위한 도면이다.5 is a diagram for explaining communication middleware.

통신 미들웨어(Communication Middleware, CM)는 분산 애플리케이션 개발을 위한 통신 프레임워크일 수 있다. 애플리케이션 개발자는 통신 미들웨어에서 제공하는 API와 설정파일을 이용하여, 애플리케이션이 다른 CM 노드(통신 미들웨어의 통신 서비스를 사용하는 애플리케이션)와 상호작용할 수 있는 여러 통신 기능을 쉽게 구현할 수 있다.Communication Middleware (CM) may be a communication framework for developing distributed applications. Application developers can easily implement various communication functions that allow applications to interact with other CM nodes (applications using communication services of communication middleware) by using APIs and configuration files provided by communication middleware.

통신 미들웨어의 통신 서비스를 이용하여 CM 노드는 CM 클라이언트 노드와 CM 서버 노드로 구분할 수 있다. CM 클라이언트 노드는 CM 서버 노드에 등록, 연결, 로긴, CM 이벤트 작성 및 송신, CM 이벤트 수신 및 처리 등 기본적인 통신 기능을 CM을 통해 간단히 이용할 수 있다. 그 외에도CM 노드는 파일 전송, SNS 콘텐츠 관리, 네트워크 상태 확인, 통신 채널 관리 등 서비스를 이용할 수 있다.A CM node can be divided into a CM client node and a CM server node by using the communication service of the communication middleware. The CM client node can simply use basic communication functions such as registration, connection, login, CM event creation and transmission, and CM event reception and processing through CM to the CM server node. In addition, the CM node can use services such as file transfer, SNS content management, network status check, and communication channel management.

도 5를 참조하면, 클라이언트(100)가 사용하는 CM(110) 서비스는 모두 요청-응답 패턴으로 구성될 수 있다. 예를 들어, 클라이언트(100)는 서비스를 요청할 수 있다(5100).Referring to FIG. 5 , all of the CM 110 services used by the client 100 may be configured in a request-response pattern. For example, the client 100 may request a service ( 5100 ).

클라이언트(100)가 서비스를 요청하면 클라이언트 CM(110)은 요청 메시지를 생성하여 서버 CM(210)으로 전송할 수 있다(5200).When the client 100 requests a service, the client CM 110 may generate a request message and transmit it to the server CM 210 ( 5200 ).

서버 CM(210)은 수신한 요청 메시지를 요청 이벤트로 변환할 수 있다. 서버 CM(210)은 요청 이벤트를 서버(200)로 전달할 수 있다(5300).The server CM 210 may convert the received request message into a request event. The server CM 210 may transmit a request event to the server 200 ( 5300 ).

서버(200)는 요청 이벤트에 따른 요청을 처리할 수 있다(5400).The server 200 may process a request according to the request event ( 5400 ).

서버(200)는 요청이 처리된 결과를 응답 이벤트로 생성할 수 있다. 서버(200)는 응답 이벤트를 서버 CM(210)으로 전달할 수 있다(5500).The server 200 may generate a result of processing the request as a response event. The server 200 may transmit a response event to the server CM 210 ( 5500 ).

서버 CM(210)은 응답 이벤트를 응답 메시지로 변환하여 클라이언트 CM(110)으로 전송할 수 있다(5600).The server CM 210 may convert the response event into a response message and transmit it to the client CM 110 ( 5600 ).

클라이언트 CM(110)은 수신한 응답 메시지를 응답 이벤트로 변환할 수 있다. 클라이언트 CM110)은 응답 이벤트를 클라이언트(100)로 전달할 수 있다(5700).The client CM 110 may convert the received response message into a response event. The client CM110 may transmit a response event to the client 100 ( 5700 ).

도 6 및 도 7은 통신 미들웨어를 통한 클라이언트-서버의 단일 서버-단일 연결 구조 및 다중 서버-다중 연결 구조의 일 예를 나타낸 도면이고, 도 8은 통신 미들웨어의 통신 서비스 및 옵션의 일 예를 나타내는 도면이다.6 and 7 are diagrams illustrating an example of a single server-single connection structure and a multi-server-multi-connection structure of a client-server through a communication middleware, and FIG. 8 is a diagram illustrating an example of a communication service and options of the communication middleware It is a drawing.

통신 미들웨어는 다양한 통신 서비스를 제공하는 것뿐만 아니라, 각각의 서비스 또한 애플리케이션의 요구사항에 따라 다양한 옵션을 제공함으로써, 보다 유연한 통신 서비스를 제공할 수 있다.Communication middleware can provide more flexible communication services by not only providing various communication services, but also providing various options according to application requirements for each service.

통신 미들웨어의 다양한 통신 서비스와 옵션을 활용하면, 간단한 구조부터 복잡한 구조의 분산 애플리케이션을 요구사항에 맞게 쉽게 개발할 수 있다. 예를 들어, 도 6과 같이 클라이언트-서버 애플리케이션도 단일 통신 채널을 통해 단일 서버에 DB를 사용하지 않는 간단한 구조를 개발할 수 있다.By utilizing various communication services and options of communication middleware, distributed applications with simple to complex structures can be easily developed according to requirements. For example, as shown in FIG. 6 , a client-server application can also develop a simple structure that does not use a DB for a single server through a single communication channel.

또한, 도 7과 같이 다중 통신 채널을 통해 다중 서버에 DB까지 사용한 복잡한 구조의 애플리케이션을 통신 미들웨어 설정 파일 조정과 서비스 API 호출로 빠른 시간에 개발할 수 있다.In addition, as shown in FIG. 7 , an application having a complex structure using multiple servers and DB through multiple communication channels can be developed in a short time by adjusting the communication middleware setting file and calling the service API.

애플리케이션 개발자는 통신 미들웨어가 애플리케이션 사이의 통신기능 대부분을 맡아서 처리하기 때문에, 통신 기능 이외에 애플리케이션 고유의 기능 개발에 더 집중하여 애플리케이션 개발 효율을 향상시킬 수 있다.Since the communication middleware handles most of the communication functions between applications, application developers can improve application development efficiency by focusing more on developing application-specific functions in addition to communication functions.

도 8을 참조하면, 도 8의 표는 통신 미들웨어의 핵심 통신 서비스를 요약한 것일 수 있다. 통신 미들웨어를 사용하는 애플리케이션의 연결은 통신 미들웨어의 설정 파일(Communication management)을 간단히 변경함으로써 클라이언트-서버 구조 또는 피어-피어구조로 결정할 수 있다.Referring to FIG. 8 , the table of FIG. 8 may summarize core communication services of communication middleware. The connection of the application using the communication middleware can be determined in the client-server structure or the peer-peer structure by simply changing the communication management of the communication middleware.

또한, 통신 미들웨어는 CM 설정 파일(Persistency management)의 내용에 따라, 애플리케이션이 내부적으로 DB를 사용할지의 여부를 결정할 수 있다. 통신 미들웨어는 사용자 관리(User management)에서, 사용자가 통신 미들웨어 네트워크에 참여하기 위해 사용자 인증 과정을 거칠 것인지 여부를 결정할 수 있다.In addition, the communication middleware may determine whether the application uses the DB internally according to the contents of the CM setting file (Persistency management). The communication middleware may determine, in user management, whether or not the user will go through a user authentication process in order to participate in the communication middleware network.

통신 미들웨어는 사용자 친구 관리(Friend management)에서, 사용자가 요청한 모든 상대 사용자를 (단방향) 친구로 정의하던지, 또는 양쪽 모두 동의한 경우에만 (양방향) 친구로 정의할 수 있다. 통신 미들웨어는 SNS 콘텐츠 관리(SNS management)에서, 사용자가 업로드하는 콘텐츠에 임의의 파일을 첨부할 수 있으며, 콘텐츠의 공개 범위를 다양하게 지정할 수 있다. 통신 미들웨어는 파일 전송 서비스(File transfer management)에서 push 방식 또는 pull 방식을 선택할 수 있다. 통신 미들웨어는 이벤트 전송 서비스(Event management)에서 신뢰적 전송 (TCP) 또는 비신뢰적 전송(UDP)을 선택하여 일대일 또는 일대다 전송을 선택할 수 있다.The communication middleware can define all other users requested by the user as (unidirectional) friends, or (two-way) friends only when both parties agree in Friend management. Communication middleware can attach arbitrary files to content uploaded by a user in SNS content management, and can variously designate a content disclosure range. The communication middleware may select a push method or a pull method in file transfer management. The communication middleware may select one-to-one or one-to-many transmission by selecting reliable transmission (TCP) or unreliable transmission (UDP) in the event management.

도 9는 이벤트 기반의 동기식 통신 미들웨어를 설명하기 위한 도면이다.9 is a diagram for explaining an event-based synchronous communication middleware.

기존의 통신 미들웨어는 내부적으로 이벤트 기반 비동기식 방식으로 통신할 수 있다. 동기식 방식과 비교해서 비동기식 통신 방식의 장점은 요청 이벤트에 대한 응답 이벤트를 계속 기다리지 않아도 된다는 점일 수 있다. 따라서, 통신 미들웨어 애플리케이션은 통신 미들웨어의 통신 서비스를 요청한 후에 이에 대한 응답을 기다리지 않고 다른 태스크를 수행할 수 있다.Existing communication middleware can communicate internally in an event-based asynchronous manner. An advantage of the asynchronous communication method over the synchronous method may be that it does not have to constantly wait for a response event for a request event. Accordingly, the communication middleware application may perform another task without waiting for a response after requesting the communication service of the communication middleware.

대신, 애플리케이션은 다른 태스크를 수행하는 도중에 언제든지 통신 미들웨어로부터 이전 요청에 대한 응답을 받을 수 있도록 이벤트 수신 전용 콜백 메소드(또는 함수)를 통신 미들웨어에 등록할 수 있다. 통신 미들웨어는 이벤트를 수신할 때마다 등록된 콜백 메소드를 호출해 주기 때문에, 애플리케이션은 통신 미들웨어 서비스 요청 후 임의의 순간에 수신된 응답 이벤트를 처리할 수 있다.Instead, the application can register a callback method (or function) dedicated to receiving an event in the communication middleware so that it can receive a response to a previous request from the communication middleware at any time while performing other tasks. Since the communication middleware calls the registered callback method whenever an event is received, the application can process the received response event at any moment after the communication middleware service request.

도 9를 참조하면, 이러한 이벤트 기반의 비동기식 통신 방식을 지원하기 위해, 통신 미들웨어는 다중 스레드인 메인 스레드(211), 송신 스레드(212), 수신 스레드(213) 및 프로세싱 스레드(214)로 실행될 수 있다. 먼저 애플리케이션의 메인 스레드(211)가 통신 미들웨어를 구동하면 통신 미들웨어에서 송신 스레드(212), 수신 스레드(213), 및 프로세싱 스레드(214)를 시작할 수 있다.Referring to FIG. 9 , in order to support this event-based asynchronous communication method, the communication middleware may be executed as a multi-threaded main thread 211 , a sending thread 212 , a receiving thread 213 , and a processing thread 214 . there is. First, when the main thread 211 of the application runs the communication middleware, the transmission thread 212 , the receiving thread 213 , and the processing thread 214 may be started in the communication middleware.

메인 스레드(211)는 애플리케이션 사용자로부터의 로컬 이벤트 처리를 담당할 수 있다. 프로세싱 스레드(214)는 수신 스레드(213)로부터 수신된 CM 이벤트를 전달받아 처리하는 역할을 담당할 수 있다.The main thread 211 may be responsible for processing a local event from an application user. The processing thread 214 may be responsible for receiving and processing the CM event received from the receiving thread 213 .

CM 이벤트의 처리는 통신 미들웨어가 내부적으로 처리하는 경우와 애플리케이션이 처리하는 두 가지 경우로 나누어질 수 있다. 애플리케이션은 CM 이벤트를 처리하기 위해서 이벤트 처리 메소드를 포함한 이벤트 핸들러 객체를 통신 미들웨어에 등록할 수 있다.The processing of CM events can be divided into two cases: the case where the communication middleware processes internally and the case where the application processes it. An application can register an event handler object including an event handling method in the communication middleware to handle CM events.

프로세싱 스레드(214)는 필요한 경우에 수신한 CM 이벤트를 먼저 통신 미들웨어 내부적으로 처리한 후, 애플리케이션 이벤트 핸들러의 이벤트 처리 메소드를 호출함으로써 애플리케이션이 필요한 별도의 수신 이벤트 처리가 가능할 수 있다.If necessary, the processing thread 214 first processes the received CM event internally in the communication middleware, and then calls the event processing method of the application event handler to process a separate received event required by the application.

송신 스레드(212)는 메인 스레드(211)나 프로세싱 스레드(214)가 작성한 CM 이벤트를 저레벨 바이트 메시지로 변환하여 네트워크로 전송하는 역할을 담당할 수 있다.The sending thread 212 may play a role in converting the CM event created by the main thread 211 or the processing thread 214 into a low-level byte message and transmitting it to the network.

메인 스레드(211)나 프로세싱 스레드(214)는 원격 노드로 메시지를 전송해야할 때, 필요한 CM이벤트를 작성하여 이를 송신 큐에 넣어서 송신 스레드(212)로 전달할 수 있다.When the main thread 211 or the processing thread 214 needs to transmit a message to a remote node, it can create a necessary CM event, put it in a transmission queue, and deliver it to the transmission thread 212 .

수신 스레드(213)는 네트워크에서 바이트 메시지를 수신할 수 있다. 수신 스레드(213)는 바이트 메시지를 CM이벤트로 변환하여 프로세싱 스레드(214)로 전달할 수 있다. 수신 스레드(213)는 수신한 CM 이벤트를 수신 큐에 넣어 프로세싱 스레드(214)로 전달할 수 있다. 프로세싱 스레드(214)는 전달받은 CM 이벤트를 처리할 수 있다.The receiving thread 213 may receive a byte message in the network. The receiving thread 213 may convert the byte message into a CM event and forward it to the processing thread 214 . The receiving thread 213 may put the received CM event in a receive queue and deliver it to the processing thread 214 . The processing thread 214 may process the received CM event.

도 10은 통신 미들웨어의 다중 스레드 구조에 의해 클라이언트와 서버 사이에 수행되는 비동기식 통신 방법을 설명하기 위한 도면이다.FIG. 10 is a diagram for explaining an asynchronous communication method performed between a client and a server by a multi-threaded structure of communication middleware.

사용자는 클라이언트(100)를 이용하여 로컬 또는 원격 서비스를 요청할 수 있다(1010). 클라이언트의 메인 스레드(111)는 사용자의 요청을 처리할 수 있다.The user may request a local or remote service by using the client 100 ( 1010 ). The client's main thread 111 may process a user's request.

클라이언트의 메인 스레드(111)는 원격 서비스 요청을 처리하기 위해서 요청 이벤트를 작성하여 송신 스레드(112)로 전달할 수 있다(1020).The main thread 111 of the client may create a request event to process the remote service request and transmit it to the sending thread 112 ( 1020 ).

송신 스레드(112)는 요청 이벤트를 요청 메시지로 변환할 수 있다. 송신 스레드(112)는 요청 메시지를 서버의 수신 스레드(213)로 송신할 수 있다(1030). 예를 들어, 클라이언트(100)의 메인 스레드(111)는 요청 이벤트에 대한 응답 이벤트를 기다리지 않고, 사용자의 다음 요청도 바로 처리할 수 있다. 그 사이에 서버(200)는 요청 이벤트를 처리할 수 있다.The sending thread 112 may convert the request event into a request message. The sending thread 112 may transmit the request message to the receiving thread 213 of the server (1030). For example, the main thread 111 of the client 100 may immediately process a user's next request without waiting for a response event to the request event. In the meantime, the server 200 may process the request event.

서버(200)의 수신 스레드(213)는 수신한 요청 메시지를 요청 이벤트로 변환할 수 있다. 수신 스레드(213)는 요청 이벤트를 프로세싱 스레드(214)로 전달할 수 있다(1040).The receiving thread 213 of the server 200 may convert the received request message into a request event. The receiving thread 213 may forward the request event to the processing thread 214 ( 1040 ).

프로세싱 스레드(214)는 요청 이벤트를 처리하여 응답 이벤트를 생성할 수 있다. 프로세싱 스레드(214)는 응답 이벤트를 송신 스레드(212)로 전달할 수 있다(1050).Processing thread 214 may process the request event to generate a response event. The processing thread 214 may forward the response event to the sending thread 212 ( 1050 ).

송신 스레드(212)는 응답 이벤트를 응답 메시지로 변환할 수 있다. 송신 스레드(212)는 응답 메시지를 클라이언트의 수신 스레드(113)로 전송할 수 있다(1060).The sending thread 212 may convert the response event into a response message. The sending thread 212 may transmit the response message to the receiving thread 113 of the client ( 1060 ).

클라이언트의 수신 스레드(113)는 수신한 응답 메시지를 응답 이벤트로 변환할 수 있다. 수신 스레드(113)는 응답 이벤트를 프로세싱 스레드(114)로 전달할 수 있다(1070).The receiving thread 113 of the client may convert the received response message into a response event. The receiving thread 113 may forward the response event to the processing thread 114 ( 1070 ).

프로세싱 스레드(114)는 응답 이벤트를 처리할 수 있다. 프로세싱 스레드(114)와는 독립적으로, 메인 스레드(111)는 계속 사용자의 여러 요청을 처리하고 있는 상황일 수 있다.The processing thread 114 may process the response event. Independent of the processing thread 114 , the main thread 111 may be in a situation where it is still processing various requests from users.

도 11은 일 실시예에 따른 통신 시스템을 나타낸다.11 illustrates a communication system according to an embodiment.

통신 시스템(50)은 제1 통신 장치(500) 및 서버(600)를 포함한다. 통신 시스템(50)은 제2 통신 장치(700)를 더 포함할 수 있다.The communication system 50 includes a first communication device 500 and a server 600 . The communication system 50 may further include a second communication device 700 .

통신 시스템(50)은 제1 통신 장치(500) 및 서버(600)가 네트워크상으로 연결되어 비동기식 통신 미들웨어를 통한 통신을 수행할 때, 비동기식 통신과 직접 동기식 통신을 모두 제공할 수 있다.The communication system 50 may provide both asynchronous communication and direct synchronous communication when the first communication device 500 and the server 600 are connected over a network to perform communication through the asynchronous communication middleware.

통신 시스템(50)은 제1 통신 장치(500) 및 서버(600), 서버(600) 및 제2 통신 장치(700)가 네트워크상으로 연결되어 비동기식 통신 미들웨어를 통한 통신을 수행할 때, 비동기식 통신과 직접 동기식 통신 및/또는 간접 동기식 통신을 모두 제공할 수 있다.The communication system 50 performs asynchronous communication when the first communication device 500 and the server 600, the server 600, and the second communication device 700 are connected over a network to perform communication through the asynchronous communication middleware. and direct synchronous communication and/or indirect synchronous communication may be provided.

제1 통신 장치(500)는 이벤트 기반 비동기식 통신 미들웨어를 통한 통신에서 비동기식 통신과, 직접 및/또는 간접 동기식 통신을 모두 지원할 수 있다. 제1 통신 장치(500)는 현재 태스크에 대한 요청 이벤트에 대응하는 응답 이벤트를 수신하여 다음 태스크를 수행하는 요청 클라이언트 장치일 수 있다.The first communication device 500 may support both asynchronous communication and direct and/or indirect synchronous communication in communication through the event-based asynchronous communication middleware. The first communication device 500 may be a requesting client device that receives a response event corresponding to the request event for the current task and performs the next task.

제1 통신 장치(500)는 사용자의 서비스 요청에 따라 수행되는 현재 태스크에 대한 요청 이벤트를 서버(600)로 송신할 수 있다. 제1 통신 장치(500)는 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록할 수 있다. 예를 들어, 응답 조건은 요청 이벤트에 대한 응답 이벤트의 이벤트 타입, 응답 이벤트가 요청 이벤트의 응답 대상 클라이언트 장치 또는 복수의 응답 대상 클라이언트 장치들로부터 전송된 것인지 여부 및 복수의 응답 대상 클라이언트 장치들로부터 전송된 최소 응답 이벤트 수 중에서 적어도 하나 이상을 포함할 수 있다. 즉, 제1 통신 장치(500)는 이벤트 동기화 객체에 등록한 응답 조건에 따라 비동기식 통신 미들웨어를 통한 통신에서 직접 동기식 통신, 일대일 간접 동기식 통신 및 일대다 간접 동기식 통신을 모두 제공할 수 있다.The first communication device 500 may transmit a request event for the current task performed according to the user's service request to the server 600 . The first communication device 500 may register a response condition of the request event in an event synchronizer. For example, the response condition may include an event type of a response event to the request event, whether the response event is transmitted from a response target client device or a plurality of response target client devices of the request event, and transmission from a plurality of response target client devices It may include at least one of the minimum number of response events. That is, the first communication device 500 may provide all of direct synchronous communication, one-to-one indirect synchronous communication, and one-to-many indirect synchronous communication in communication through the asynchronous communication middleware according to a response condition registered in the event synchronization object.

제1 통신 장치(500)는 서버(600)로부터 요청 이벤트에 대한 응답 이벤트를 수신할 수 있다.The first communication device 500 may receive a response event to the request event from the server 600 .

제1 통신 장치(500)는 요청 이벤트에 대한 응답 이벤트가 응답 조건을 만족하는 때, 이벤트 동기화 객체를 통한 프로세싱 스레드 및 메인 스레드의 동기화를 통해 현재 태스크의 다음 태스크를 수행할 수 있다.When the response event to the request event satisfies the response condition, the first communication device 500 may perform the next task of the current task through synchronization of the processing thread and the main thread through the event synchronization object.

서버(600)는 요청 이벤트를 수신할 수 있다. 서버(600)는 요청 이벤트를 처리하여 응답 이벤트를 생성할 수 있다.The server 600 may receive the request event. The server 600 may generate a response event by processing the request event.

서버(600)는 요청 이벤트를 제2 통신 장치(700)로 송신할 수 있다. 서버(600)는 제2 통신 장치(700)로부터 응답 이벤트를 수신할 수 있다.The server 600 may transmit the request event to the second communication device 700 . The server 600 may receive a response event from the second communication device 700 .

서버(600)는 응답 이벤트를 제1 통신 장치(500)로 송신할 수 있다.The server 600 may transmit a response event to the first communication device 500 .

제2 통신 장치(700)는 서버(600)로부터 요청 이벤트를 수신할 수 있다. 제2 통신 장치(700)는 요청 이벤트를 처리하여 응답 이벤트를 생성할 수 있다. 제2 통신 장치(700)는 응답 이벤트를 서버(600)로 전송할 수 있다.The second communication device 700 may receive a request event from the server 600 . The second communication device 700 may generate a response event by processing the request event. The second communication device 700 may transmit a response event to the server 600 .

제2 통신 장치(700)는 제1 통신 장치(500)로부터 수신한 요청 이벤트를 처리하여 응답 이벤트를 송신하는 응답 대상 클라이언트 장치일 수 있다. 제2 통신 장치(700)는 복수개로 구현될 수 있다. 제2 통신 장치(700)는 제1 통신 장치(500)와 동일한 동작을 수행할 수 있다.The second communication device 700 may be a response target client device that transmits a response event by processing the request event received from the first communication device 500 . A plurality of second communication devices 700 may be implemented. The second communication device 700 may perform the same operation as the first communication device 500 .

도 12는 도 11에 도시된 제1 통신 장치를 개략적으로 나타낸 도면이다.12 is a diagram schematically illustrating the first communication device shown in FIG. 11 .

제1 통신 장치(500)는 통신 모듈(510), 프로세서(520), 및 메모리(530)를 포함한다. 제1 통신 장치(500)는 통신 모듈(510)을 통해 네트워크에 연결되고, 서버(600)와 통신할 수 있다.The first communication device 500 includes a communication module 510 , a processor 520 , and a memory 530 . The first communication device 500 may be connected to a network through the communication module 510 and communicate with the server 600 .

통신 모듈(510)은 무선 통신 또는 유선 통신을 통해서 네트워크(1000)에 연결되어 서버(600)와 통신할 수 있다.The communication module 510 may be connected to the network 1000 through wireless communication or wired communication to communicate with the server 600 .

프로세서(520)는 중앙처리장치, 어플리케이션 프로세서, 또는 커뮤니케이션 프로세서(communication processor) 중 하나 또는 그 이상을 포함할 수 있다.The processor 520 may include one or more of a central processing unit, an application processor, and a communication processor.

프로세서(520)는 제1 통신 장치(500)의 적어도 하나의 다른 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 실행할 수 있다. 예를 들어, 프로세서(520)는 메모리(530)에 저장된 어플리케이션(540) 및/또는 통신 미들웨어(550) 등을 실행할 수 있다.The processor 520 may execute an operation or data processing related to control and/or communication of at least one other component of the first communication device 500 . For example, the processor 520 may execute the application 540 and/or the communication middleware 550 stored in the memory 530 .

메모리(530)는 휘발성 및/또는 비휘발성 메모리를 포함할 수 있다. 메모리(530)는, 제1 통신 장치(500)의 적어도 하나의 다른 구성요소에 관계된 명령 및/또는 데이터를 저장할 수 있다.Memory 530 may include volatile and/or non-volatile memory. The memory 530 may store commands and/or data related to at least one other component of the first communication device 500 .

메모리(530)는 소프트웨어(software) 및/또는 프로그램(program) 등을 저장할 수 있다. 예를 들어, 메모리(530)는 어플리케이션(540) 및 통신 미들웨어(550)를 저장할 수 있다.The memory 530 may store software and/or a program. For example, the memory 530 may store the application 540 and the communication middleware 550 .

통신 미들웨어(550)는 어플리케이션(440)이 네트워크와 통신하여 데이터를 주고받을 수 있도록 중개 역할을 수행할 수 있다. 즉, 통신 미들웨어(550)는 어플리케이션(540)과 다른 어플리케이션들(예를 들어, 서버(600)의 어플리케이션)과의 통신 기능을 처리할 수 있다.The communication middleware 550 may perform an intermediary role so that the application 440 may communicate with the network to send and receive data. That is, the communication middleware 550 may process a communication function between the application 540 and other applications (eg, an application of the server 600 ).

도 13은 도 11에 도시된 서버를 개략적으로 나타낸 도면이다.13 is a diagram schematically illustrating the server shown in FIG. 11 .

서버(600)는 통신 모듈(610), 프로세서(620), 및 메모리(630)를 포함한다.The server 600 includes a communication module 610 , a processor 620 , and a memory 630 .

서버(600)는 통신 모듈(610)을 통해 네트워크에 연결되고, 제1 통신 장치(500) 및/또는 제2 통신 장치(700)와 통신할 수 있다. 서버(600)는 이벤트 기반 비동기식 통신 미들웨어를 통한 통신에서 비동기식 통신과 동기식 통신을 모두 지원할 수 있다.The server 600 may be connected to a network through the communication module 610 and communicate with the first communication device 500 and/or the second communication device 700 . The server 600 may support both asynchronous communication and synchronous communication in communication through the event-based asynchronous communication middleware.

통신 모듈(610)은 무선 통신 또는 유선 통신을 통해서 네트워크에 연결되어 제1 통신 장치(500) 및/또는 제2 통신 장치(700)와 통신할 수 있다.The communication module 610 may be connected to a network through wireless communication or wired communication to communicate with the first communication device 500 and/or the second communication device 700 .

프로세서(620)는 중앙처리장치, 어플리케이션 프로세서, 또는 커뮤니케이션 프로세서(communication processor) 중 하나 또는 그 이상을 포함할 수 있다.The processor 620 may include one or more of a central processing unit, an application processor, and a communication processor.

프로세서(620)는, 서버(600)의 적어도 하나의 다른 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 실행할 수 있다. 예를 들어, 프로세서(620)는 메모리(630)에 저장된 어플리케이션(640) 및/또는 통신 미들웨어(650) 등을 실행할 수 있다.The processor 620 may execute an operation or data processing related to control and/or communication of at least one other component of the server 600 . For example, the processor 620 may execute the application 640 and/or the communication middleware 650 stored in the memory 630 .

메모리(630)는 휘발성 및/또는 비휘발성 메모리를 포함할 수 있다. 메모리(630)는, 서버(600)의 적어도 하나의 다른 구성요소에 관계된 명령 및/또는 데이터를 저장할 수 있다.Memory 630 may include volatile and/or non-volatile memory. The memory 630 may store commands and/or data related to at least one other component of the server 600 .

메모리(630)는 소프트웨어(software) 및/또는 프로그램(program) 등을 저장할 수 있다. 예를 들어, 메모리(630)는 어플리케이션(640) 및 통신 미들웨어(650)를 저장할 수 있다.The memory 630 may store software and/or a program. For example, the memory 630 may store the application 640 and the communication middleware 650 .

통신 미들웨어(650)는 어플리케이션(640)이 네트워크와 통신하여 데이터를 주고받을 수 있도록 중개 역할을 수행할 수 있다. 즉, 통신 미들웨어(650)는 어플리케이션(640)과 다른 어플리케이션들(예를 들어, 제1 통신 장치(500) 및/또는 제2 통신 장치(700)의 어플리케이션)과의 통신 기능을 처리할 수 있다.The communication middleware 650 may perform an intermediary role so that the application 640 communicates with the network to send and receive data. That is, the communication middleware 650 may process a communication function between the application 640 and other applications (eg, an application of the first communication device 500 and/or the second communication device 700 ). .

도 14는 도 11에 도시된 제2 통신 장치를 개략적으로 나타낸 도면이다.14 is a diagram schematically illustrating the second communication device shown in FIG. 11 .

제2 통신 장치(700)는 통신 모듈(710), 프로세서(720), 및 메모리(730)를 포함한다. 제2 통신 장치(700)는 통신 모듈(710)을 통해 네트워크에 연결되고, 서버(600)와 통신할 수 있다.The second communication device 700 includes a communication module 710 , a processor 720 , and a memory 730 . The second communication device 700 may be connected to a network through the communication module 710 and communicate with the server 600 .

통신 모듈(710)은 무선 통신 또는 유선 통신을 통해서 네트워크에 연결되어 서버(600)와 통신할 수 있다.The communication module 710 may be connected to a network through wireless communication or wired communication to communicate with the server 600 .

프로세서(720)는 중앙처리장치, 어플리케이션 프로세서, 또는 커뮤니케이션 프로세서(communication processor) 중 하나 또는 그 이상을 포함할 수 있다.The processor 720 may include one or more of a central processing unit, an application processor, and a communication processor.

프로세서(720)는 제2 통신 장치(700)의 적어도 하나의 다른 구성요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 실행할 수 있다. 예를 들어, 프로세서(720)는 메모리(730)에 저장된 어플리케이션(740) 및/또는 통신 미들웨어(750) 등을 실행할 수 있다.The processor 720 may execute an operation or data processing related to control and/or communication of at least one other component of the second communication device 700 . For example, the processor 720 may execute the application 740 and/or the communication middleware 750 stored in the memory 730 .

메모리(730)는 휘발성 및/또는 비휘발성 메모리를 포함할 수 있다. 메모리(730)는, 제2 통신 장치(700)의 적어도 하나의 다른 구성요소에 관계된 명령 및/또는 데이터를 저장할 수 있다.Memory 730 may include volatile and/or non-volatile memory. The memory 730 may store commands and/or data related to at least one other component of the second communication device 700 .

메모리(730)는 소프트웨어(software) 및/또는 프로그램(program) 등을 저장할 수 있다. 예를 들어, 메모리(730)는 어플리케이션(740) 및 통신 미들웨어(750)를 저장할 수 있다.The memory 730 may store software and/or a program. For example, the memory 730 may store the application 740 and the communication middleware 750 .

통신 미들웨어(750)는 어플리케이션(740)이 네트워크와 통신하여 데이터를 주고받을 수 있도록 중개 역할을 수행할 수 있다. 즉, 통신 미들웨어(750)는 어플리케이션(740)과 다른 어플리케이션들(예를 들어, 서버(600)의 어플리케이션)과의 통신 기능을 처리할 수 있다.The communication middleware 750 may perform an intermediary role so that the application 740 communicates with the network to send and receive data. That is, the communication middleware 750 may process a communication function between the application 740 and other applications (eg, an application of the server 600 ).

통신 미들웨어(550, 650 및 750) 및/또는 어플리케이션(540, 640 및 740)이 프로세서(520, 620 및 720)에 의해 실행될 때의 상세한 동작은 도 15 및 도 16에서 살펴보기로 한다.Detailed operations when the communication middleware 550 , 650 and 750 and/or the applications 540 , 640 and 740 are executed by the processors 520 , 620 and 720 will be described with reference to FIGS. 15 and 16 .

도 15는 제1 통신 장치 및 서버 간 비동기식 통신 미들웨어에서의 직접 동기식 통신 방법의 일 예를 설명하기 위한 도면이다.15 is a diagram for explaining an example of a direct synchronous communication method in asynchronous communication middleware between a first communication device and a server.

사용자는 제1 통신 장치(500)를 통해 통신 미들웨어를 통한 통신 서비스를 동기식으로 요청할 수 있다(1510).The user may synchronously request a communication service through the communication middleware through the first communication device 500 ( 1510 ).

통신 미들웨어(550)의 메인 스레드(551)는 사용자의 서비스 요청에 해당하는 요청 이벤트를 생성할 수 있다. 메인 스레드(551)는 요청 이벤트를 메시지 송신 큐를 통해 송신 스레드(552)로 전달할 수 있다(1515).The main thread 551 of the communication middleware 550 may generate a request event corresponding to a user's service request. The main thread 551 may forward the request event to the send thread 552 through the message send queue ( 1515 ).

메인 스레드(551)는 사용자의 서비스 요청에 따라 수행되는 현재 태스크에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(555; event synchronizer)에 등록할 수 있다. 예를 들어, 통신 미들웨어(550)가 일대일 직접 동기식 통신을 수행하는 경우, 메인 스레드(551)는 응답 조건으로 요청 이벤트에 대한 응답 이벤트의 이벤트 타입을 이벤트 동기화 객체(555)에 등록할 수 있다.The main thread 551 may register a response condition of a request event for a current task performed according to a user's service request in an event synchronization object 555 (event synchronizer). For example, when the communication middleware 550 performs one-to-one direct synchronous communication, the main thread 551 may register an event type of a response event to a request event in the event synchronization object 555 as a response condition.

메인 스레드(551)는 이벤트 동기화 객체(555)를 통해 메인 스레드의 동작 상태를 전환할 수 있다. 예를 들어, 메인 스레드(551)는 이벤트 동기화 객체(555)에 대한 소유 상태를 독점하는 락(lock)을 획득할 수 있다. 메인 스레드(551)는 락을 획득한 후 wait() 함수 호출을 통해 동작 상태를 실행 대기 상태로 전환할 수 있다. 메인 스레드(551)는 실행 대기 상태로 전환한 후 락을 놓을 수 있다(1520). 사용자는 메인 스레드(551)가 실행 대기 상태로 동작 상태가 전환된 이후, 다른 서비스 요청이 불가할 수 있다.The main thread 551 may switch the operation state of the main thread through the event synchronization object 555 . For example, the main thread 551 may acquire a lock that monopolizes the ownership state for the event synchronization object 555 . After acquiring the lock, the main thread 551 may change the operation state to the execution standby state by calling the wait() function. The main thread 551 may release the lock after switching to the execution standby state ( 1520 ). The user may not be able to request another service after the main thread 551 is switched to the execution standby state.

송신 스레드(552)는 요청 이벤트를 요청 메시지로 변환할 수 있다. 송신 스레드(552)는 요청 메시지를 비블록킹 소켓 채널(557)을 통해 서버(600)로 송신할 수 있다(1525 및 1530).The sending thread 552 may convert the request event into a request message. The sending thread 552 may send the request message to the server 600 over the non-blocking socket channel 557 (1525 and 1530).

통신 미들웨어(650)의 수신 스레드(653)는 셀렉터(658)를 모니터링하다가 요청 메시지를 수신할 수 있다(1535).The receiving thread 653 of the communication middleware 650 may receive a request message while monitoring the selector 658 ( 1535 ).

수신 스레드(653)는 요청 메시지를 요청 이벤트로 변환할 수 있다. 수신 스레드(653)는 요청 이벤트를 수신 큐를 통해 프로세싱 스레드(654)로 전달할 수 있다(1540).The receiving thread 653 may convert the request message into a request event. The receive thread 653 may forward the request event to the processing thread 654 via the receive queue ( 1540 ).

프로세싱 스레드(654)는 요청 이벤트를 처리하여 응답 이벤트를 생성할 수 있다. 프로세싱 스레드(654)는 응답 이벤트를 송신 스레드(652)로 전달할 수 있다(1545).Processing thread 654 may process the request event to generate a response event. The processing thread 654 may forward the response event to the sending thread 652 ( 1545 ).

송신 스레드(652)는 응답 이벤트를 응답 메시지로 변환할 수 있다. 송신 스레드(652)는 응답 메시지를 비블록킹 소켓 채널(656)을 통해 제1 통신 장치(500)로 전송할 수 있다(1550 및 1555).The sending thread 652 may convert the response event into a response message. The sending thread 652 may transmit the response message to the first communication device 500 through the non-blocking socket channel 656 ( 1550 and 1555 ).

제1 통신 장치(500)의 수신 스레드(553)는 셀렉터(556)를 모니터링하다가 응답 메시지를 수신할 수 있다(1260).The receiving thread 553 of the first communication device 500 may receive a response message while monitoring the selector 556 ( 1260 ).

수신 스레드(553)는 응답 메시지를 응답 이벤트로 변환할 수 있다. 수신 스레드(553)는 응답 이벤트를 프로세싱 스레드(554)로 전달할 수 있다(1565).The receiving thread 553 may convert the response message into a response event. The receiving thread 553 may forward the response event to the processing thread 554 ( 1565 ).

프로세싱 스레드(554)는 응답 이벤트 및 이벤트 동기화 객체(555)에 등록된 응답 조건에 기초하여, 이벤트 동기화 객체(555)를 통해 현재 태스크의 다음 태스크를 수행하기 위한 메인 스레드(551)의 동작 상태를 전환할 수 있다(1570).The processing thread 554 determines the operational state of the main thread 551 for performing the next task of the current task through the event synchronization object 555 based on the response event and the response condition registered in the event synchronization object 555 . can be switched (1570).

예를 들어, 통신 미들웨어(550)가 일대일 직접 동기식 통신을 수행하는 경우, 프로세싱 스레드(554)는 응답 이벤트가 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일한지 여부를 판단할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일한 때, 응답 이벤트를 이벤트 동기화 객체(555)에 등록할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일한 때, 이벤트 동기화 객체(555)를 통해 메인 스레드(551)의 동작 상태를 실행 상태로 전환할 수 있다. 프로세싱 스레드(554)는 이벤트 동기화 객체(555)에 대한 락을 획득할 수 있다. 프로세싱 스레드(554)는 락을 획득한 후 notify() 함수를 호출함으로써 대기 상태에 있는 메인 스레드(551)의 동작 상태를 실행 상태로 전환할 수 있다. 프로세싱 스레드(554)는 메인 스레드(551)의 동작 상태를 실행 상태로 전환한 후 락을 놓을 수 있다.For example, when the communication middleware 550 performs one-to-one direct synchronous communication, the processing thread 554 may determine whether the response event is the same as the event type registered in the event synchronization object 555 . The processing thread 554 may register the response event with the event synchronization object 555 when the response event is the same as the event type registered with the event synchronization object 555 . The processing thread 554 may transition the operational state of the main thread 551 to the running state through the event synchronization object 555 when the response event is the same as the event type registered in the event synchronization object 555 . The processing thread 554 may acquire a lock on the event synchronization object 555 . The processing thread 554 may switch the operation state of the main thread 551 in the standby state to the execution state by calling the notify() function after acquiring the lock. The processing thread 554 may release the lock after transitioning the operational state of the main thread 551 to the running state.

메인 스레드(551)는 실행 대기 상태에서 전환되어 실행 상태가 된 후, 이벤트 동기화 객체(555)에 등록된 응답 이벤트를 추출할 수 있다(1575). 예를 들어, 메인 스레드(551)는 응답 이벤트에 포함된 서비스 요청 결과 값을 애플리케이션(540)으로 리턴할 수 있다. 이 때, 이벤트 동기화 객체(555)에 등록된 응답 이벤트는 삭제될 수 있다. 클라이언트 애플리케이션(540)은 서비스 요청 함수의 리턴값으로 결과 값을 받아 다음 태스크를 수행할 수 있다.The main thread 551 may extract a response event registered in the event synchronization object 555 after being switched from the execution standby state to the execution state ( 1575 ). For example, the main thread 551 may return a service request result value included in the response event to the application 540 . In this case, the response event registered in the event synchronization object 555 may be deleted. The client application 540 may receive the result value as a return value of the service request function and perform the following task.

통신 시스템(50)은 비동기식 통신 미들웨어를 통한 통신에서, 클라이언트의 메인 스레드(551)와 프로세싱 스레드(554)가 서로 이벤트 동기화 객체(555)를 통해 동기화함으로써, 메인 스레드(551)는 서비스 요청 결과를 받을 때까지 실행 대기 상태에 있을 수 있다(즉, 동기식 통신을 수행할 수 있다). 반면에, 통신 시스템(50)에서 서버(600)는 기존의 비동기식 통신 방식과 동일하게 클라이언트로부터의 요청을 처리하기 때문에 특정 스레드가 실행 대기 상태일 필요가 없을 수 있다.In communication through the asynchronous communication middleware, the communication system 50 synchronizes the client's main thread 551 and the processing thread 554 with each other through the event synchronization object 555, so that the main thread 551 transmits the service request result. It may be in a waiting-to-run state until it receives it (ie, it may perform synchronous communication). On the other hand, since the server 600 in the communication system 50 processes a request from a client in the same way as in the existing asynchronous communication method, there may be no need for a specific thread to be in an execution standby state.

도 16은 제1 통신 장치, 서버 및 제2 통신 장치 간의 비동기식 통신 미들웨어에서의 일대일 간접 동기식 통신 방법 및 일대다 간접 동기식 통신 방법의 일 예를 설명하기 위한 도면이다.16 is a diagram for describing an example of a one-to-one indirect synchronous communication method and a one-to-many indirect synchronous communication method in asynchronous communication middleware between a first communication device, a server, and a second communication device.

사용자는 제1 통신 장치(500)를 통해 CM 통신 서비스를 동기식으로 요청할 수 있다(1610).The user may synchronously request a CM communication service through the first communication device 500 (1610).

통신 미들웨어(550)의 메인 스레드(551)는 사용자의 서비스 요청에 해당하는 요청 이벤트를 생성할 수 있다. 메인 스레드(551)는 요청 이벤트를 메시지 송신 큐를 통해 송신 스레드(552)로 전달할 수 있다(1615).The main thread 551 of the communication middleware 550 may generate a request event corresponding to a user's service request. The main thread 551 may forward the request event to the send thread 552 through the message send queue ( 1615 ).

메인 스레드(551)는 사용자의 서비스 요청에 따라 수행되는 현재 태스크에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(555; event synchronizer)에 등록할 수 있다. 예를 들어, 통신 미들웨어(550)가 일대일 간접 동기식 통신을 수행하는 경우, 메인 스레드(551)는 응답 조건으로 요청 이벤트에 대한 응답 이벤트의 이벤트 타입 및 요청 이벤트가 전송되는 응답 대상 클라이언트 장치를 이벤트 동기화 객체(555)에 등록할 수 있다. 다른 예를 들어, 통신 미들웨어(550)가 일대다 간접 동기식 통신을 수행하는 경우, 메인 스레드(551)는 응답 조건으로 요청 이벤트에 대한 응답 이벤트의 이벤트 타입, 요청 이벤트가 전송되는 복수의 응답 대상 클라이언트 장치들 및 복수의 응답 대상 클라이언트 장치들로부터 전송되는 최소 응답 이벤트 수를 이벤트 동기화 객체(555)에 등록할 수 있다.The main thread 551 may register a response condition of a request event for a current task performed according to a user's service request in an event synchronization object 555 (event synchronizer). For example, when the communication middleware 550 performs one-to-one indirect synchronous communication, the main thread 551 synchronizes the event type of the response event to the request event and the client device to which the request event is transmitted as response conditions. It can be registered with the object 555 . As another example, when the communication middleware 550 performs one-to-many indirect synchronous communication, the main thread 551 provides an event type of a response event to a request event as a response condition, and a plurality of response target clients to which the request event is transmitted. The minimum number of response events transmitted from the devices and a plurality of response target client devices may be registered in the event synchronization object 555 .

메인 스레드(551)는 이벤트 동기화 객체(555)를 통해 메인 스레드의 동작 상태를 전환할 수 있다. 예를 들어, 메인 스레드(551)는 이벤트 동기화 객체(555)에 대한 소유 상태를 독점하는 락(lock)을 획득할 수 있다. 메인 스레드(551)는 락을 획득한 후 wait() 함수 호출을 통해 동작 상태를 실행 대기 상태로 전환할 수 있다. 메인 스레드(551)는 실행 대기 상태로 전환한 후 락을 놓을 수 있다(1620). 사용자는 메인 스레드(551)가 실행 대기 상태로 동작 상태가 전환된 이후, 다른 서비스 요청이 불가할 수 있다.The main thread 551 may switch the operation state of the main thread through the event synchronization object 555 . For example, the main thread 551 may acquire a lock that monopolizes the ownership state for the event synchronization object 555 . After acquiring the lock, the main thread 551 may change the operation state to the execution standby state by calling the wait() function. The main thread 551 may release the lock after switching to the execution standby state ( 1620 ). The user may not be able to request another service after the main thread 551 is switched to the execution standby state.

송신 스레드(552)는 요청 이벤트를 요청 메시지로 변환할 수 있다. 송신 스레드(552)는 요청 메시지를 비블록킹 소켓 채널(557)을 통해 서버(600)로 송신할 수 있다(1625 및 1630).The sending thread 552 may convert the request event into a request message. The sending thread 552 may send the request message to the server 600 over the non-blocking socket channel 557 (1625 and 1630).

서버(600)는 요청 메시지를 수신할 수 있다. 서버(600)는 요청 메시지를 제2 통신 장치(700)로 송신할 수 있다(1635). 예를 들어, 서버(600)는 요청 메시지를 응답 대상 클라이언트 장치(예를 들어, 응답 대상인 하나의 제2 통신 장치(700)로 송신할 수 있다. 다른 예를 들어, 서버(600)는 요청 메시지를 복수의 응답 대상 클라이언트 장치들(예를 들어, 응답 대상인 복수의 제2 통신 장치들(700))로 송신할 수 있다.The server 600 may receive the request message. The server 600 may transmit the request message to the second communication device 700 ( 1635 ). For example, the server 600 may transmit the request message to a response target client device (eg, one second communication device 700 that is a response target. For another example, the server 600 may transmit the request message may be transmitted to a plurality of response target client devices (eg, a plurality of response target second communication devices 700 ).

통신 미들웨어(750)의 수신 스레드(753)는 셀렉터(758)를 모니터링하다가 요청 메시지를 수신할 수 있다(1635 및 1640).The receiving thread 753 of the communication middleware 750 may receive a request message while monitoring the selector 758 ( 1635 and 1640 ).

수신 스레드(753)는 요청 메시지를 요청 이벤트로 변환할 수 있다. 수신 스레드(753)는 요청 이벤트를 수신 큐를 통해 프로세싱 스레드(754)로 전달할 수 있다(1645).The receiving thread 753 may convert the request message into a request event. The receive thread 753 may forward the request event via the receive queue to the processing thread 754 ( 1645 ).

프로세싱 스레드(754)는 요청 이벤트를 처리하여 응답 이벤트를 생성할 수 있다. 프로세싱 스레드(754)는 응답 이벤트를 송신 스레드(752)로 전달할 수 있다(1750).Processing thread 754 may process the request event to generate a response event. The processing thread 754 may forward the response event to the sending thread 752 ( 1750 ).

송신 스레드(752)는 응답 이벤트를 응답 메시지로 변환할 수 있다. 송신 스레드(752)는 응답 메시지를 비블록킹 소켓 채널(756)을 통해 서버(600)로 전송할 수 있다(1655 및 1660).The sending thread 752 may convert the response event into a response message. The sending thread 752 may send a response message to the server 600 over the non-blocking socket channel 756 ( 1655 and 1660 ).

서버(600)는 응답 메시지를 수신할 수 있다. 서버(600)는 응답 메시지를 제1 통신 장치(500)로 송신할 수 있다(1665).The server 600 may receive the response message. The server 600 may transmit the response message to the first communication device 500 ( 1665 ).

제1 통신 장치(500)의 수신 스레드(553)는 셀렉터(556)를 모니터링하다가 응답 메시지를 수신할 수 있다(1670).The receiving thread 553 of the first communication device 500 may receive a response message while monitoring the selector 556 ( 1670 ).

수신 스레드(553)는 응답 메시지를 응답 이벤트로 변환할 수 있다. 수신 스레드(553)는 응답 이벤트를 프로세싱 스레드(554)로 전달할 수 있다(1675).The receiving thread 553 may convert the response message into a response event. The receiving thread 553 may forward the response event to the processing thread 554 ( 1675 ).

프로세싱 스레드(554)는 응답 이벤트 및 이벤트 동기화 객체(555)에 등록된 응답 조건에 기초하여, 이벤트 동기화 객체(555)를 통해 현재 태스크의 다음 태스크를 수행하기 위한 메인 스레드(551)의 동작 상태를 전환할 수 있다(1680).The processing thread 554 determines the operational state of the main thread 551 for performing the next task of the current task through the event synchronization object 555 based on the response event and the response condition registered in the event synchronization object 555 . may switch (1680).

예를 들어, 통신 미들웨어(550)가 일대일 간접 동기식 통신을 수행하는 경우, 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 응답 대상 클라이언트 장치로부터 전송되었는지 여부를 판단할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 응답 대상 클라이언트 장치로부터 전송된 때, 응답 이벤트를 이벤트 동기화 객체(555)에 등록할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 응답 대상 클라이언트 장치로부터 전송된 때, 이벤트 동기화 객체(555)를 통해 메인 스레드(551)의 동작 상태를 실행 상태로 전환할 수 있다.For example, when the communication middleware 550 performs one-to-one indirect synchronous communication, the processing thread 554 determines that the response event is the same as the event type registered in the event synchronization object 555, and is transmitted from the response target client device. It can be determined whether or not The processing thread 554 may register the response event with the event synchronization object 555 when the response event is the same as the event type registered in the event synchronization object 555 and is transmitted from the responding target client device. The processing thread 554 determines the operational state of the main thread 551 through the event synchronization object 555 when the response event is the same as the event type registered in the event synchronization object 555 and is transmitted from the responding client device. can be switched to the running state.

다른 예를 들어, 통신 미들웨어(550)가 일대다 간접 동기식 통신을 수행하는 경우, 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 복수의 응답 대상 클라이언트 장치들 중에서 어느 하나로부터 전송되었는지 여부를 판단할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 복수의 응답 대상 클라이언트 장치들 중에서 어느 하나로부터 전송된 때, 응답 이벤트를 이벤트 동기화 객체(555)에 등록할 수 있다. 프로세싱 스레드(554)는 응답 이벤트가, 이벤트 동기화 객체(555)에 등록된 이벤트 타입과 동일하고, 복수의 응답 대상 클라이언트 장치들 중에서 어느 하나로부터 전송된 때, 응답 이벤트 수를 카운트할 수 있다. 프로세싱 스레드(554)는 카운트한 응답 이벤트 수가 최소 응답 이벤트 수를 만족하는 때, 이벤트 동기화 객체(555)를 통해 메인 스레드(551)의 동작 상태를 실행 상태로 전환할 수 있다.For another example, when the communication middleware 550 performs one-to-many indirect synchronous communication, the processing thread 554 determines that a response event is the same as an event type registered in the event synchronization object 555, and a plurality of response targets It can be determined whether the transmission is from any one of the client devices. The processing thread 554 sends the response event to the event synchronization object 555 when the response event is the same as the event type registered in the event synchronization object 555 and is transmitted from any one of a plurality of response target client devices. can register. The processing thread 554 may count the number of response events when the response event is the same as the event type registered in the event synchronization object 555 and is transmitted from any one of a plurality of response target client devices. The processing thread 554 may transition the operational state of the main thread 551 to the running state through the event synchronization object 555 when the counted number of response events satisfies the minimum number of response events.

프로세싱 스레드(554)는 이벤트 동기화 객체(555)에 대한 락을 획득할 수 있다. 프로세싱 스레드(554)는 락을 획득한 후 notify() 함수를 호출함으로써 대기 상태에 있는 메인 스레드(551)의 동작 상태를 실행 상태로 전환할 수 있다. 프로세싱 스레드(554)는 메인 스레드(551)의 동작 상태를 실행 상태로 전환한 후 락을 놓을 수 있다.The processing thread 554 may acquire a lock on the event synchronization object 555 . The processing thread 554 may switch the operation state of the main thread 551 in the standby state to the execution state by calling the notify() function after acquiring the lock. The processing thread 554 may release the lock after transitioning the operational state of the main thread 551 to the running state.

메인 스레드(551)는 실행 대기 상태에서 전환되어 실행 상태가 된 후, 이벤트 동기화 객체(555)에 등록된 응답 이벤트를 추출할 수 있다(1685). 예를 들어, 메인 스레드(551)는 응답 이벤트에 포함된 서비스 요청 결과 값을 애플리케이션(540)으로 리턴할 수 있다. 이 때, 이벤트 동기화 객체(555)에 등록된 응답 이벤트는 삭제될 수 있다. 클라이언트 애플리케이션(540)은 서비스 요청 함수의 리턴값으로 결과 값을 받아 다음 태스크를 수행할 수 있다.The main thread 551 may extract a response event registered in the event synchronization object 555 after being switched from the execution standby state to the execution state ( 1685 ). For example, the main thread 551 may return a service request result value included in the response event to the application 540 . In this case, the response event registered in the event synchronization object 555 may be deleted. The client application 540 may receive the result value as a return value of the service request function and perform the following task.

도 17은 도 15 및 도 16에 도시된 이벤트 동기화 객체의 클래스 및 관련 클래스 다이어그램을 나타낸 도면이고, 도 18은 제1 통신 장치의 통신 미들웨어의 내부 상태 정보 관리 클래스들을 나타낸 도면이다.17 is a diagram illustrating classes and related class diagrams of the event synchronization object shown in FIGS. 15 and 16 , and FIG. 18 is a diagram illustrating internal state information management classes of communication middleware of the first communication device.

통신 미들웨어(550)의 이벤트 동기화 객체(555)는 제1 통신 장치(500)와 서버(600) 및/또는 제1 통신 장치(500)와 제2 통신 장치(700) 사이의 동기식 통신을 지원하기 위한 모듈일 수 있다. 도 17은 이벤트 동기화 객체(555)의 클래스 및 다른 관련 통신 미들웨어 클래스의 관계를 나타내는 클래스 다이어그램일 수 있다. 이는, 클래스들의 관계를 간략히 표시하기 위해 클래스별로 멤버 변수만 나타내고 멤버 함수는 생략한 다이어그램일 수 있다.The event synchronization object 555 of the communication middleware 550 is configured to support synchronous communication between the first communication device 500 and the server 600 and/or the first communication device 500 and the second communication device 700 . It may be a module for 17 may be a class diagram illustrating the relationship between a class of event synchronization object 555 and other related communication middleware classes. This may be a diagram in which only member variables are shown for each class and member functions are omitted in order to briefly display the relationship between classes.

CMInfo 클래스는 통신 미들웨어(550)에서 관리하는 모든 내부 상태 정보를 포함하는 클래스를 의미할 수 있다. CMInfo 클래스는 다시 용도별로 다양한 종류의 클래스를 포함할 수 있다.The CMInfo class may mean a class including all internal state information managed by the communication middleware 550 . The CMInfo class may again include various types of classes for each purpose.

각 정보 클래스의 용도는 도 18과 같을 수 있다. 이 중에서 CMEventInfo 클래스는 통신 미들웨어의 이벤트 처리와 관련된 정보를 저장하는 클래스로써, CM 이벤트 수신을 담당하는 스레드(CMEventReceiver)와 이벤트 동기화 객체(CMEventSynchronizer) 정보를 포함할 수 있다.The use of each information class may be as shown in FIG. 18 . Among them, the CMEventInfo class is a class that stores information related to event processing of the communication middleware, and may include information on a thread (CMEventReceiver) in charge of receiving CM events and an event synchronization object (CMEventSynchronizer).

메인 스레드(551)와 프로세싱 스레드(554)는 이벤트 동기화 객체(555)를 통해 다음과 같이 동기화될 수 있다.The main thread 551 and the processing thread 554 may be synchronized through the event synchronization object 555 as follows.

먼저, 메인 스레드(551)는 이벤트 동기화 객체(555)에 대한 락(lock)을 얻은 상태에서 요청 이벤트를 전송한 후, wait() 메소드를 호출하여 이벤트 동기화 객체(555)의 대기 큐에 들어가 대기 상태로 전환될 수 있다.First, the main thread 551 receives a lock on the event synchronization object 555 and transmits a request event, then calls the wait() method to enter the wait queue of the event synchronization object 555 and wait state can be converted.

프로세싱 스레드(554)는 응답 이벤트를 수신하여 조건이 만족되면, 이벤트 동기화 객체(555)에 대한 락(lock)을 얻은 상태에서 notify() 메소드를 호출하여 대기 상태인 메인 스레드(551)를 대기 큐에서 깨워 실행 상태로 전환할 수 있다.When the condition is satisfied by receiving the response event, the processing thread 554 calls the notify() method in a state in which a lock on the event synchronization object 555 is obtained to put the main thread 551 in a waiting state into a waiting queue can be woken up and transitioned to the running state.

이벤트 동기화 클래스의 역할을 멤버 변수별로 기술하면 다음과 같다. 통신 미들 웨어(550)의 메인 스레드(551)는 서버(600)로 요청 이벤트를 전송한 후 동기식 통신을 위한 응답 조건으로 응답 이벤트의 이벤트 타입(m_nWatiedEventType) 및/또는 아이디(m_nWaitedEventID)를 이벤트 동기화 객체(5550)에 등록할 수 있다.The role of the event synchronization class for each member variable is described as follows. After transmitting the request event to the server 600, the main thread 551 of the communication middleware 550 sets the event type (m_nWatiedEventType) and/or ID (m_nWaitedEventID) of the response event as a response condition for synchronous communication as an event synchronization object (5550) can be registered.

서버(600)가 아닌 제2 통신 장치(700)와의 동기식 통신을 위해서는 대기할 응답 이벤트뿐 아니라, 어느 클라이언트 장치로부터의(m_strWaitedReceiver) 응답 이벤트를 기다릴 것인지도 응답 조건으로 이벤트 동기화 객체(555)에 등록할 수 있다. 프로세싱 스레드(554)는 수신한 응답 이벤트를 이벤트 동기화 객체(555)에 등록함으로써(m_replyEvent) 응답 이벤트를 메인 스레드(551)로 전달할 수 있다.For synchronous communication with the second communication device 700 other than the server 600, not only the response event to wait, but also which client device (m_strWaitedReceiver) to wait for the response event is registered in the event synchronization object 555 as a response condition. can do. The processing thread 554 may transfer the response event to the main thread 551 by registering the received response event in the event synchronization object 555 (m_replyEvent).

제1 통신 장치(500)가 일대다 간접 동기식 통신을 사용하는 경우에는, 메인 스레드(551)가 대기할 응답 이벤트의 최소 응답 이벤트 수(m_nMinNumWaitedEvents)를 응답 조건으로 이벤트 동기화 객체(555)에 등록할 수 있다. 프로세싱 스레드(554)는 수신한 응답 이벤트 리스트를 이벤트 동기화 객체(555)에 등록하여 메인 스레드(551)로 전달할 수 있다.When the first communication device 500 uses one-to-many indirect synchronous communication, the minimum number of response events (m_nMinNumWaitedEvents) of the response event to be waited by the main thread 551 is registered in the event synchronization object 555 as a response condition. can The processing thread 554 may transmit the received response event list to the main thread 551 by registering it in the event synchronization object 555 .

도 19는 제1 통신 장치의 통신 미들웨어의 동기식 애플리케이션 프로그래밍 인터페이스를 설명하기 위한 도면이다.19 is a view for explaining a synchronous application programming interface of the communication middleware of the first communication device.

서버(600)와의 직접 동기식 통신 방식을 사용하는 API는 CM이 제공하는 서비스 종류별로 특화된 함수를 제공할 수 있다. 메인 스레드(551)는 클라이언트 장치가 정해진 서비스를 서버(600)에게 요청하고, 서버(600)로부터의 응답 이벤트를 수신할 때까지 대기할 수 있다.The API using the direct synchronous communication method with the server 600 may provide a function specialized for each service type provided by the CM. The main thread 551 may wait until the client device requests a predetermined service from the server 600 and receives a response event from the server 600 .

제1 통신 장치(500)가 응답 이벤트를 수신하면, 서비스 요청 API의 리턴값 형태로 응답 이벤트가 제1 통신 장치(500)에게 반환되고, 메인 스레드(551)는 다음 태스크를 수행할 수 있다.When the first communication device 500 receives the response event, the response event is returned to the first communication device 500 in the form of a return value of the service request API, and the main thread 551 may perform the following task.

통신 미들웨어(550)에서 동기식 통신을 필요로 하는 경우 sendrecv() 함수를 통해 일반화된 버전의 직접 동기식 통신 및 간접 동기식 통신을 사용할 수 있다.When the communication middleware 550 requires synchronous communication, a generalized version of direct synchronous communication and indirect synchronous communication may be used through the sendrecv() function.

동기식 통신을 요청할 때 필요한 파라미터 정보는 요청 이벤트, 요청 이벤트의 응답 대상 클라이언트 장치에 대한 정보, 기다릴 응답 이벤트의 이벤트 타입과 아이디, 응답 이벤트를 기다릴 최대 시간일 수 있다.The parameter information required when requesting synchronous communication may be a request event, information about a client device to which the request event responds, an event type and ID of the response event to wait for, and the maximum time to wait for a response event.

제1 통신 장치(500)가 송신하는 요청 이벤트의 수신자가 서버(600)이면 직접 동기식 통신이 되고, 수신자가 다른 클라이언트인 제2 통신 장치(700)이면 간접 동기식 통신이 될 수 있다. 간접 동기식 통신의 경우, 제1 통신 장치(500)의 요청 이벤트는 서버(600)로 전송되고, 서버(600)의 통신 미들웨어(650)가 최종 타겟 클라이언트 장치인 제2 통신 장치(700)로 요청 이벤트를 송신할 수 있다.If the receiver of the request event transmitted by the first communication device 500 is the server 600 , direct synchronous communication may be performed, and if the receiver is the second communication device 700 , which is another client, indirect synchronous communication may be performed. In the case of indirect synchronous communication, the request event of the first communication device 500 is transmitted to the server 600 , and the communication middleware 650 of the server 600 makes a request to the second communication device 700 which is the final target client device. Events can be sent.

제2 통신 장치(700)의 응답 이벤트는 다시 서버(600)를 통해 요청 클라이언트 장치인 제1 통신 장치(500)로 수신될 수 있다. 응답 이벤트는 리턴값으로써 제1 통신 장치(500)에게 반환될 수 있다. 제1 통신 장치(500)는 응답 이벤트의 수신을 실패하고 대기 시간이 종료하면NULL을 반환할 수 있다.The response event of the second communication device 700 may be received again through the server 600 to the first communication device 500 which is the requesting client device. The response event may be returned to the first communication device 500 as a return value. The first communication device 500 may return NULL when the reception of the response event fails and the waiting time ends.

제1 통신 장치(500)나 서버(600)는 castrecv() 함수를 통해 일대다 간접 동기식 통신을 사용할 수 있다. 일대다 간접 동기식 통신에서 요청 이벤트의 수신 대상은 응답 대상 클라이언트 장치 그룹으로 지정될 수 있다. 응답 대상 클라이언트 장치 그룹은 통신 미들웨어(550)에서 정의한 세션 및 그룹 개념을 이용할 수 있다.The first communication device 500 or the server 600 may use one-to-many indirect synchronous communication through the castrecv() function. In one-to-many indirect synchronous communication, a reception target of a request event may be designated as a response target client device group. The response target client device group may use the session and group concept defined in the communication middleware 550 .

통신 미들웨어 네트워크에 참여하는 클라이언트 장치는 항상 적어도 하나의 세션 및 그룹에 속할 수 있다. 서버(600)는 여러 세션을 구성할 수 있고, 세션 내에 여러 그룹을 가질 수 있다.A client device participating in a communication middleware network may always belong to at least one session and group. The server 600 may configure several sessions, and may have several groups within a session.

제1 통신 장치(500)는 요청 이벤트의 수신자 그룹을 세션과 그룹 아이디로 지정할 수 있다. 제1 통신 장치(500)는 수신할 응답 이벤트의 타입과 아이디뿐 아니라, 기다릴 최소 응답이벤트 수도 지정할 수 있다. 즉, castrecv() 함수는 최소 수의 응답 이벤트를 수신하면 응답 이벤트 배열을 반환하고, 최소 수의 응답 이벤트를 수신하기 전에 대기 시간이 종료하면 실패의 의미로 NULL을 반환할 수 있다.The first communication device 500 may designate a recipient group of the request event as a session and group ID. The first communication device 500 may designate not only the type and ID of a response event to be received, but also the minimum number of response events to wait. That is, the castrecv() function can return a response event array when the minimum number of response events is received, and NULL can be returned in the sense of failure if the waiting time expires before receiving the minimum number of response events.

도 20은 sendrecv() 함수의 동작 알고리즘을 나타낸다.20 shows the operation algorithm of the sendrecv() function.

제1 통신 장치(500)가 통신 미들웨어(550)의 동기식 API를 호출할 때 메인 스레드(551)의 동작 알고리즘은 거의 동일할 수 있다. 이벤트 동기화 객체(555)에 등록하는 정보는 응답 대상 클라이언트의 정보와 응답 이벤트 정보일 수 있다. 직접 동기식 API에서는 수신자가 서버(600)이고 서비스별 응답 이벤트가 이미 정의되어 있기 때문에 응답 대상 클라이언트의 정보는 별도의 파라미터로 제공되지 않을 수 있다.When the first communication device 500 calls the synchronous API of the communication middleware 550 , the operation algorithm of the main thread 551 may be substantially the same. Information registered in the event synchronization object 555 may be information of a response target client and response event information. In the direct synchronous API, since the receiver is the server 600 and the response event for each service is already defined, the information of the response target client may not be provided as a separate parameter.

castrecv() 함수에서는 이벤트 동기화 객체(555)에 등록하는 응답 대상 클라이언트의 정보가 세션 및 그룹으로 변경될 수 있다. 메인 스레드(551)는 실행대기 상태에 들어가기 전(line 06)에 이벤트 동기화 객체(555)에 대한 락을 얻어서 임계영역(criticalsection)으로 들어가고(line 05) 락을 해제할 수 있다.In the castrecv() function, information of a response target client registered in the event synchronization object 555 may be changed to a session and a group. The main thread 551 may obtain a lock on the event synchronization object 555 before entering the execution standby state (line 06), enter the critical section (line 05), and release the lock.

프로세싱 스레드(554)가 메인 스레드(551)를 깨우면, 락을 재획득한 후 실행을 계속하고 락을 해제하면서 임계영역을 나올 수 있다(line 07). 메인 스레드(551)는 프로세싱 스레드(554)가 등록한 응답 이벤트를 이벤트 동기화 객체를 통해 획득할 수 있다(line 08).When the processing thread 554 wakes up the main thread 551 , after reacquiring the lock, execution may continue and exit the critical section while releasing the lock (line 07). The main thread 551 may obtain a response event registered by the processing thread 554 through an event synchronization object (line 08).

도 21은 제1 통신 장치의 프로세싱 스레드가 수행하는 동기식 통신 처리 알고리즘의 일 예를 나타낸다.21 shows an example of a synchronous communication processing algorithm performed by a processing thread of a first communication device.

통신 미들웨어(550)의 프로세싱 스레드(554)는 수신 큐를 통해 전달된 응답 이벤트를 내부적으로 처리하고, 필요한 경우에 이를 통신 미들웨어(550)에 등록된 이벤트 핸들러의 콜백 함수를 호출함으로써 애플리케이션(540)에게도 전달하는 역할을 수행할 수 있다.The processing thread 554 of the communication middleware 550 internally processes the response event delivered through the reception queue, and when necessary, by calling a callback function of an event handler registered in the communication middleware 550, the application 540 . It can also play a role in conveying

프로세싱 스레드(554)는 동기식 통신을 위해 수신 큐에서 전달받은 응답 이벤트의 처리를 완료한 후, 메인 스레드(551)가 응답 이벤트의 수신을 기다리고 있는지 여부를 판단할 수 있다. 즉, 프로세싱 스레드(554)는 수신한 응답 이벤트가 응답 조건을 만족하는지 여부를 판단할 수 있다. 예를 들어, 프로세싱 스레드(554)는 이벤트 동기화 객체(555)에서 메인 스레드(551)의 대기 상태를 나타내는 플래그 변수 값이 참(TRUE)인지, 수신한 응답 이벤트의 타입과 아이디가 등록된 이벤트의 타입 및 아이디와 동일한지, 응답 이벤트 송신자가 동기식 통신 대상과 동일한지를 판단할 수 있다.The processing thread 554 may determine whether the main thread 551 is waiting for reception of the response event after completing processing of the response event received from the reception queue for synchronous communication. That is, the processing thread 554 may determine whether the received response event satisfies the response condition. For example, the processing thread 554 determines whether the value of the flag variable indicating the standby state of the main thread 551 in the event synchronization object 555 is TRUE, and the type and ID of the received response event are registered events. It can be determined whether the type and ID are the same, and whether the response event sender is the same as the synchronous communication target.

프로세싱 스레드(554)는 수신한 응답 이벤트가 응답 조건을 만족하면, 응답 이벤트를 이벤트 동기화 객체(555)에 등록하고, 이벤트 동기화 객체(555)에 대해 대기 상태에 있던 메인 스레드(551)를 동작 상태로 전환할 수 있다.If the received response event satisfies the response condition, the processing thread 554 registers the response event in the event synchronization object 555 and puts the main thread 551 in the waiting state for the event synchronization object 555 into an operating state. can be converted to

메인 스레드(551)가 대기 상태로 들어갈 때와 마찬가지로, 동기화를 위해서는 프로세싱 스레드(554)는 먼저 이벤트 동기화 객체(555)에 대한 락을 얻어야 하고 임계영역에서 메인 스레드(551)를 깨울 수 있다. 마지막으로, 프로세싱 스레드(554)는 이벤트 동기화 객체(555)에 대한 락을 해제할 수 있다.Similar to when the main thread 551 enters the standby state, for synchronization, the processing thread 554 must first obtain a lock on the event synchronization object 555 and can wake the main thread 551 in a critical section. Finally, the processing thread 554 may release the lock on the event synchronization object 555 .

프로세싱 스레드(554)는 수신한 요청 이벤트가 일대일 동기식 통신 조건을 만족하지 않으면, 응답 이벤트가 일대다 동기식 통신 조건을 만족하는지도 판단할 수 있다.The processing thread 554 may determine whether the response event satisfies the one-to-many synchronous communication condition if the received request event does not satisfy the one-to-one synchronous communication condition.

이때의 응답 조건은 이벤트 동기화 객체(555)에서 메인 스레드(551)가 대기중인지, 수신한 응답 이벤트가 이벤트 동기화 객체(555)에 등록된 응답 이벤트의 이벤트 타입인지, 수신한 응답 이벤트가 응답 대상 클라이언트 장치 또는 복수의 응답 대상 클라이언트 장치들로부터 수신된 것인지, 이벤트 동기화 객체(555)에 최소 응답 이벤트 수가 등록되어 있는지 여부일 수 있다.The response condition at this time is whether the main thread 551 is waiting in the event synchronization object 555, whether the received response event is an event type of a response event registered in the event synchronization object 555, and whether the received response event is the response target client It may be whether it is received from a device or a plurality of response target client devices, or whether the minimum number of response events is registered in the event synchronization object 555 .

프로세싱 스레드(554)는 응답 조건을 만족하면, 수신한 응답 이벤트를 이벤트 동기화 객체(555)에 등록하고, 이벤트 동기화 객체(555)에 등록된 응답 이벤트의 수를 카운트하여 최소 응답 이벤트 수를 만족하는지 여부를 다시 판단할 수 있다.If the response condition is satisfied, the processing thread 554 registers the received response event in the event synchronization object 555 and counts the number of response events registered in the event synchronization object 555 to determine whether the minimum number of response events is satisfied. can be re-evaluated.

프로세싱 스레드(554)는 두 번째 조건도 만족하면 일대다 동기식 통신의 응답 조건을 모두 만족한 것으로 판단하여 이벤트 동기화 객체(555)에서 대기중인 메인 스레드(551)를 실행 상태로 전환시킬 수 있다.If the second condition is also satisfied, the processing thread 554 may determine that all of the response conditions of the one-to-many synchronous communication are satisfied, and may switch the main thread 551 waiting in the event synchronization object 555 to an execution state.

프로세싱 스레드(554)는 동기식 통신 조건을 만족하면 수신한 응답 이벤트는 메인 스레드(551)에서 처리되기 때문에, 응답 이벤트를 클라이언트의 이벤트 핸들러로 전달하지 않을 수 있다. 프로세싱 스레드(554)는 동기식 통신 조건을 만족하지 않으면, 수신한 응답 이벤트의 내부 처리결과에 따라 필요한 경우 응답 이벤트를 원래대로 이벤트 핸들러로 전달하여 클라이언트가 비동기식으로 이벤트를 처리할 수 있도록 처리할 수 있다.If the processing thread 554 satisfies the synchronous communication condition, since the received response event is processed in the main thread 551 , the response event may not be delivered to the event handler of the client. If the processing thread 554 does not satisfy the synchronous communication condition, if necessary according to the internal processing result of the received response event, the processing thread 554 passes the response event back to the event handler so that the client can process the event asynchronously. .

도 22는 비동기식 API 함수의 리턴 지연 시간의 일 예를 나타낸 도면이다.22 is a diagram illustrating an example of a return delay time of an asynchronous API function.

통신 미들웨어(550)가 제공하는 동기식 통신 서비스를 이용하면, 애플리케이션(540)이 서버(600)로 서비스를 요청하고 이에 대한 응답을 대기하는 절차를 해당 함수 호출과 리턴 값 수신을 통해 처리할 수 있다. 따라서, 통신 미들웨어(550)의 동기식 통신 서비스는 비동기식 통신 서비스에 비해 보다 직관적이고 효율적으로 애플리케이션을 개발할 수 있는 수단이 될 수 있다.If the synchronous communication service provided by the communication middleware 550 is used, the procedure of the application 540 requesting a service to the server 600 and waiting for a response thereto can be processed through a corresponding function call and return value reception. . Accordingly, the synchronous communication service of the communication middleware 550 may be a means for developing applications more intuitively and efficiently compared to the asynchronous communication service.

클라이언트는 동기식 통신 서비스를 위해 동기식 API를 호출한 후 리턴 값을 받을 때까지 대기해야 하는 지연 문제가 발생할 수 있다. 클라이언트의 통신 서비스 요청에 대한 응답 지연 시간은 두 가지 경우로 나누어질 수 있다.After calling the synchronous API for the synchronous communication service, the client may have a delay problem that has to wait until it receives a return value. The response delay time to the communication service request of the client can be divided into two cases.

첫번째는 통신 API의 리턴 지연 시간일 수 있다. 리턴 지연 시간은 클라이언트가 API 함수를 호출한 때부터 이에 대한 리턴 값이 반환될 때까지의 경과 시간으로 측정할 수 있다. 두번째는 클라이언트의 요청 메시지에 대한 타겟 서버 또는 클라이언트로부터의 응답 지연 시간일 수 있다. 응답 지연 시간은 클라이언트가 API 함수를 호출한 때부터 서버나 클라이언트로부터 응답을 받을 때까지의 경과시간으로 측정할 수 있다. 직접 동기식 통신의 경우에는 서버로부터의 응답 시간이고, 간접 동기식 통신일 때는 응답 대상 클라이언트로부터의 응답 시간을 의미할 수 있다.The first may be a return delay time of the communication API. The return delay time can be measured as the elapsed time from when the client calls an API function until the return value is returned. The second may be a response delay time from the target server or the client to the client's request message. The response delay time can be measured as the elapsed time from when a client calls an API function to when it receives a response from the server or client. In the case of direct synchronous communication, it may mean a response time from the server, and in the case of indirect synchronous communication, it may mean a response time from a response target client.

동기식 API의 경우에는 통신 미들웨어가 응답 이벤트를 수신한 후에 클라이언트가 호출했던 함수에서 리턴하기 때문에 리턴 지연 시간과 응답 지연 시간이 같을 수 있다. 비동기식 API에서는 리턴 지연 시간은 클라이언트 요청에 대해 클라이언트 통신 미들웨어가 서버로 요청 이벤트를 보낼 때까지의 로컬 처리 시간을 의미할 수 있다. 반면 응답 지연 시간은 클라이언트가 API를 호출한 후에 클라이언트의 이벤트 핸들러가 응답 이벤트를 수신할 때까지의 시간으로 차이가 있을 수 있다.In the case of a synchronous API, the return delay time and response delay time may be the same because the communication middleware returns from the function called by the client after receiving the response event. In the asynchronous API, the return delay time may mean the local processing time for a client request until the client communication middleware sends a request event to the server. On the other hand, the response delay time is the time from when the client calls the API until the event handler of the client receives the response event, and there may be a difference.

실험을 위해, 통신 미들웨어를 사용하는 샘플 클라이언트와 샘플 서버 애플리케이션을 Eclipse IDE와 자바(Java)로 개발했을 수 있다. 서버를 실행하는 컴퓨터(윈도우 10, i3 3.5GHz, 8GB 메모리)는 1Gbps 유선랜으로 연결되어 있일 수 있다. 클라이언트를 실행하는 컴퓨터(맥OS, i5 3.8 GHz, 16GB 메모리)는 무선랜(WiFi 5GHz 밴드)을 통해 서버와 연결했을 수 있다. 응답 지연 시간 측정을 위한 대상 통신 API는 직접 동기식 통신에서는 로그인, 세션 정보 요청, 세션 조인, 블록킹 소켓 채널 추가 및 채널 삭제 서비스이고, 간접 동기식 통신을 위해 sendrecv()와 castrecv() API를 사용했을 수 있다.For the experiment, a sample client and sample server application using communication middleware may have been developed with Eclipse IDE and Java. The computer running the server (Windows 10, i3 3.5GHz, 8GB memory) may be connected via a 1Gbps wired LAN. The computer running the client (Mac OS, i5 3.8 GHz, 16 GB memory) may have connected to the server via wireless LAN (WiFi 5 GHz band). The target communication APIs for measuring response latency are login, session information request, session join, blocking socket channel addition and channel deletion services for direct synchronous communication, and sendrecv() and castrecv() APIs may have been used for indirect synchronous communication. there is.

통신 미들웨어(550) API의 리턴 지연 시간은 비동기식 API에 대해서만 측정했으며 결과는 도 22와 같을 수 있다. 측정 결과에서 확인할 수 있듯이, 대부분의 함수 호출에서 리턴 지연 시간은 측정 불가할 정도로 무시할 만한 수준일 수 있다. 측정 함수들 중에서 로그인 함수와 소켓 채널 추가 함수는 로컬에서 통신 채널을 추가하는 과정이 있기 때문에 약간의 지연 시간이 측정되었으나 역시 미미한 값일 수 있다. 즉, 비동기식 API를 사용하는 경우 클라이언트는 API 함수 호출 즉시 리턴을 받아서 다음 실행을 계속할 수 있다.The return delay time of the communication middleware 550 API was measured only for the asynchronous API, and the result may be as shown in FIG. 22 . As can be seen from the measurement results, the return latency in most function calls can be negligible and unmeasurable. Among the measurement functions, the login function and the socket channel addition function have a process of adding a communication channel locally, so a little delay time is measured, but it may still be insignificant. That is, when using an asynchronous API, the client can receive a return immediately after calling the API function and continue with the next execution.

도 23 및 도 24는 클라이언트가 통신 미들웨어 서비스를 요청하는 경우 직접 동기식 통신과 비동기식 통신을 사용했을 때의 서버 응답 시간을 측정한 결과의 일 예를 나타낸다.23 and 24 show examples of results of measuring server response times when direct synchronous communication and asynchronous communication are used when a client requests a communication middleware service.

도 23 및 도 24는 CM 서비스 API의 응답 지연 시간을 동기식과 비동기식 모두 측정해서 비교한 결과일 수 있다. 또한, 도 23 및 도 24는 클라이언트가 CM 서비스를 요청할 때 직접 동기식 통신 방식과 비동기식 통신 방식을 사용했을 때의 서버 응답 시간을 측정한 결과일 수 있다.23 and 24 may be a result of measuring and comparing both synchronous and asynchronous response delay times of the CM service API. 23 and 24 may be results of measuring the server response time when the direct synchronous communication method and the asynchronous communication method are used when the client requests a CM service.

도 23은 다른 API 함수에 비해 소켓 채널 추가 함수가 높은 응답 지연 시간을 나타내고 있을 수 있다. 이것은 서버 측에서 새로운 채널을 생성하고 관련 정보를 등록하는 절차가 상대적으로 높은 비용이 필요하기 때문일 수 있다. 나머지 API 함수에 대해서는 전반적으로 비슷한 수준의 응답 지연 시간을 보일 수 있다.23 , the socket channel add function may show a high response delay time compared to other API functions. This may be because the procedure for creating a new channel and registering related information on the server side requires a relatively high cost. For the rest of the API functions, the overall response latency can be similar.

동기식 API와 비동기식 API의 서버 응답 시간을 서로 비교하면, 비동기식에 비해 동기식 API의 응답 시간이 상대적으로 짧다는 것을 알 수 있다. 동기식 방식의 경우, 서버의 응답 이벤트를 클라이언트 통신 미들웨어의 프로세싱 스레드가 수신하여 동기화된 메인 스레드로 전달하고, 메인 스레드가 응답 이벤트를 리턴함으로써 클라이언트 애플리케이션으로 전달할 수 있다.Comparing the server response times of the synchronous API and the asynchronous API, it can be seen that the response time of the synchronous API is relatively short compared to the asynchronous API. In the case of the synchronous method, the processing thread of the client communication middleware may receive the response event of the server and transmit it to the synchronized main thread, and may transmit the response event to the client application by the main thread returning the response event.

비동기식 방식에서는, 역시 클라이언트 CM의 프로세싱 스레드가 응답 이벤트를 수신한 다음, CM에 등록된 이벤트 핸들러의 콜백 함수를 호출함으로써 응답 이벤트를 클라이언트 이벤트 핸들러로 전달할 수 있다.In the asynchronous method, the processing thread of the client CM also receives the response event, and then can forward the response event to the client event handler by calling the callback function of the event handler registered in the CM.

즉, 이벤트 전송 시간이 같다는 가정하에, 애플리케이션으로 이벤트 전달을 위해 통신 미들웨어(550)에서 콜백 함수를 호출하는 비용보다 스레드 간의 동기화 처리 후 함수를 리턴하는 비용이 적게 들기 때문에, 동기식 호출방식이 상대적으로 짧은 서버 응답 지연 시간을 가질 수 있다.That is, under the assumption that the event transmission time is the same, since the cost of returning the function after synchronization processing between threads is less than the cost of calling the callback function in the communication middleware 550 for event delivery to the application, the synchronous call method is relatively Can have short server response latency.

도 25는 직접 동기식 및 간접 동기식 sendrecv() API와 비동기식 버전의 응답 지연 시간의 일 예를 나타낸다.25 shows an example of response latency of a direct synchronous and indirect synchronous sendrecv() API and an asynchronous version.

도 25는 일대일 직접/간접 동기식 통신 API인 sendrecv() 서비스와 이의 비동기식 구현 사이의 응답 시간을 비교한 것일 수 있다. 좌측 2개 항목(sendrecv with server 및 async sendrecv with server)의 결과는 요청 이벤트를 수신하는 타겟 노드가 서버인 직접 동기식 통신 방식과 이의 비동기식 버전의 응답 시간 측정 결과일 수 있다. 오른쪽 2개 항목(sendrecv with client 및 async sendrecv with client)은 타겟 노드가 클라이언트인 간접 동기식 통신 방식과 이의 비동기식 버전의 응답 시간 측정 결과일 수 있다.25 may be a comparison of response times between a one-to-one direct/indirect synchronous communication API, sendrecv() service, and an asynchronous implementation thereof. The result of the left two items (sendrecv with server and async sendrecv with server) may be a response time measurement result of a direct synchronous communication method in which a target node receiving a request event is a server and an asynchronous version thereof. The two items on the right (sendrecv with client and async sendrecv with client) may be response time measurement results of an indirect synchronous communication method in which the target node is a client and an asynchronous version thereof.

간접 통신(sendrecv with client 및 async sendrecv with client)의 경우, 클라이언트와 클라이언트가 서버를 중개로 통신하기 때문에 직접 통신(sendrecv with server 및 async sendrecv withserver)보다 응답 지연 시간이 길어졌을 수 있다. 두 경우 모두 일대일 통신이기 때문에 동기식과 비동기식 통신 방식에서의 응답 지연 시간은 거의 차이가 없는 것을 알 수 있다.In the case of indirect communication (sendrecv with client and async sendrecv with client), the response delay time may have been longer than that of direct communication (sendrecv with server and async sendrecv withserver) because the client and the client communicate through the server. Since both cases are one-to-one communication, it can be seen that there is almost no difference in response delay time between synchronous and asynchronous communication methods.

도 26은 일대다 간접 동기식 castrecv() API와 비동기식 버전의 응답 지연 시간의 일 예를 나타낸다.26 shows an example of response latency of a one-to-many indirect synchronous castrecv() API and an asynchronous version.

도 26은 일대다 간접 동기식 통신 API인 castrecv() 서비스와 이의 비동기식 구현 사이의 응답 시간을 비교한 것일 수 있다. 제1 통신 장치(500)의 요청 이벤트를 수신하는 제2 통신 장치(700)은 요청 클라이언트가 대기하는 최소 응답 이벤트 수와 같고, 그룹의 크기에 따른 동기식 방식과 비동기식 방식의 응답 지연 시간을 측정했을 수 있다.26 may be a comparison of response times between a one-to-many indirect synchronous communication API, a castrecv() service, and an asynchronous implementation thereof. The second communication device 700 that receives the request event of the first communication device 500 is equal to the minimum number of response events that the requesting client waits, and measures the response delay time of the synchronous method and the asynchronous method according to the group size. can

이러한 결과를 통해 동기식 방식의 응답 지연 시간이 비동기식 방식보다 짧은 것을 확인했을 수 있다. 대기하는 최소 응답 이벤트수가 증가함에 따라 응답 지연 시간도 증가하고, 동기식 방식보다 비동기식 방식이 상대적으로 큰 응답 시간 증가 폭을 나타낼 수 있다.Through these results, it can be confirmed that the response delay time of the synchronous method is shorter than that of the asynchronous method. As the minimum number of waiting response events increases, the response delay time also increases, and the asynchronous method may exhibit a relatively larger increase in response time than the synchronous method.

결과적으로, 도 22 내지 도 26을 통한 성능 분석 결과 제1 통신 장치(500)가 일련의 여러 통신 서비스를 순차적으로 이용해야 하는 경우에는, 비동기식 통신 방법으로 서비스 API를 호출하는 것보다 동기식 API를 호출하는 것이 프로그래밍 효율성과 직관성이 더 좋고, 서버(600)나 제2 통신 장치(700)로부터의 응답 지연 시간도 더 작다는 것을 확인할 수 있다.As a result, as a result of the performance analysis through FIGS. 22 to 26 , when the first communication device 500 needs to sequentially use a series of several communication services, the synchronous API is called rather than the service API in the asynchronous communication method. It can be confirmed that programming efficiency and intuitiveness are better, and the response delay time from the server 600 or the second communication device 700 is also smaller.

통신 시스템(50)은 이벤트 기반 비동기 통신 프레임워크인 통신 미들웨어에서 동기식 통신 서비스 메카니즘을 제공할 수 있다. 통신 시스템(50)은 클라이언트와 서버 그리고 클라이언트와 클라이언트 사이의 모든 통신 서비스를 동기식과 비동기식 방식으로 모두 제공함으로써, 애플리케이션의 요구사항에 따라 보다 유연한 통신 서비스를 지원할 수 있다.The communication system 50 may provide a synchronous communication service mechanism in communication middleware, which is an event-based asynchronous communication framework. The communication system 50 may support a more flexible communication service according to application requirements by providing all communication services between the client and the server and between the client and the client in both a synchronous and asynchronous manner.

통신 시스템(50)은 이벤트 기반 비동기 통신을 사용하는 통신 미들웨어가 일대일 직접 동기식 통신, 일대일 간접 동기식 통신 및 일대다 간접 동기식 통신 방식을 지원하기 위해, 내부 관리 스레드 간의 이벤트 동기화 객체(555)를 통한 동기화 메카니즘을 제공할 수 있다.Communication system 50 is synchronized through event synchronization object 555 between internal management threads, so that communication middleware using event-based asynchronous communication supports one-to-one direct synchronous communication, one-to-one indirect synchronous communication, and one-to-many indirect synchronous communication scheme. mechanism can be provided.

통신 시스템(50)에서 통신 미들웨어(550)의 동기식 및 비동기식 통신 서비스 지원을 통해, 클라이언트인 제1 통신 장치(500)는 통신 미들웨어의 통신 서비스 중 필요한 서비스를 선택하는 것에서 그치는 것이 아니라, 클라이언트의 현재 컨텍스트 또는 요구사항에 따라 서버(600)와의 통신 방식도 선택할 수 있다.Through the support of the synchronous and asynchronous communication services of the communication middleware 550 in the communication system 50, the first communication device 500, which is a client, does not stop at selecting a necessary service among communication services of the communication middleware, but also A communication method with the server 600 may also be selected according to context or requirements.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The method according to the embodiment may be implemented in the form of program instructions that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, etc. alone or in combination. The program instructions recorded on the medium may be specially designed and configured for the embodiment, or may be known and available to those skilled in the art of computer software. Examples of the computer-readable recording medium include magnetic media such as hard disks, floppy disks and magnetic tapes, optical media such as CD-ROMs and DVDs, and magnetic media such as floppy disks. - includes magneto-optical media, and hardware devices specially configured to store and execute program instructions, such as ROM, RAM, flash memory, and the like. Examples of program instructions include not only machine language codes such as those generated by a compiler, but also high-level language codes that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

소프트웨어는 컴퓨터 프로그램(computer program), 코드(code), 명령(instruction), 또는 이들 중 하나 이상의 조합을 포함할 수 있으며, 원하는 대로 동작하도록 처리 장치를 구성하거나 독립적으로 또는 결합적으로(collectively) 처리 장치를 명령할 수 있다. 소프트웨어 및/또는 데이터는, 처리 장치에 의하여 해석되거나 처리 장치에 명령 또는 데이터를 제공하기 위하여, 어떤 유형의 기계, 구성요소(component), 물리적 장치, 가상 장치(virtual equipment), 컴퓨터 저장 매체 또는 장치, 또는 전송되는 신호 파(signal wave)에 영구적으로, 또는 일시적으로 구체화(embody)될 수 있다. 소프트웨어는 네트워크로 연결된 컴퓨터 시스템 상에 분산되어서, 분산된 방법으로 저장되거나 실행될 수도 있다. 소프트웨어 및 데이터는 하나 이상의 컴퓨터 판독 가능 기록 매체에 저장될 수 있다.Software may comprise a computer program, code, instructions, or a combination of one or more thereof, which configures a processing device to operate as desired or is independently or collectively processed You can command the device. The software and/or data may be any kind of machine, component, physical device, virtual equipment, computer storage medium or apparatus, to be interpreted by or to provide instructions or data to the processing device. , or may be permanently or temporarily embody in a transmitted signal wave. The software may be distributed over networked computer systems and stored or executed in a distributed manner. Software and data may be stored in one or more computer-readable recording media.

이상과 같이 실시예들이 비록 한정된 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기를 기초로 다양한 기술적 수정 및 변형을 적용할 수 있다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다.As described above, although the embodiments have been described with reference to the limited drawings, those skilled in the art may apply various technical modifications and variations based on the above. For example, the described techniques are performed in an order different from the described method, and/or the described components of the system, structure, apparatus, circuit, etc. are combined or combined in a different form than the described method, or other components Or substituted or substituted by equivalents may achieve an appropriate result.

그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (20)

이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어-상기 통신 미들웨어는 프로세서에 의해 실행됨-에서의 통신 방법에 있어서,
상기 프로세서에 의해 메인 스레드(main thread)가 현재 태스크(task)에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록하는 단계;
상기 프로세서에 의해 상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계; 및
상기 프로세서에 의해 프로세싱 스레드(processing thread)가 상기 응답 조건 및 서버로부터 수신한 응답 이벤트에 기초하여 상기 이벤트 동기화 객체를 통해 상기 현재 태스크의 다음 태스크를 수행하기 위한 상기 메인 스레드의 상기 동작 상태를 전환하는 단계
를 포함하고,
상기 응답 조건은,
상기 통신 미들웨어가 일대일 직접 동기식 통신을 수행하는 경우에는 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입을 포함하고,
상기 통신 미들웨어가 일대일 간접 동기식 통신을 수행하는 경우에는 상기 이벤트 타입 및 상기 요청 이벤트가 전송되는 응답 대상 클라이언트 장치를 포함하며,
상기 통신 미들웨어가 일대다 간접 동기식 통신을 수행하는 경우에는 상기 이벤트 타입, 상기 응답 대상 클라이언트 장치 복수 개, 및 최소 응답 이벤트 수를 포함하는 통신 방법.
A communication method in communication middleware supporting event-based asynchronous communication, wherein the communication middleware is executed by a processor, the method comprising:
registering, by the processor, a response condition of a request event for a current task by a main thread in an event synchronizer;
switching, by the processor, the operating state of the main thread through the event synchronization object; and
By the processor, a processing thread transitions the operational state of the main thread to perform a next task of the current task through the event synchronization object based on the response condition and a response event received from a server. step
including,
The response condition is
When the communication middleware performs one-to-one direct synchronous communication, it includes an event type of a response event to the request event,
When the communication middleware performs one-to-one indirect synchronous communication, it includes a response target client device to which the event type and the request event are transmitted,
When the communication middleware performs one-to-many indirect synchronous communication, the communication method including the event type, the plurality of response target client devices, and a minimum number of response events.
삭제delete 제1항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 일대일 직접 동기식 통신을 수행하는 경우 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가 상기 이벤트 타입과 동일한지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계; 및
판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 방법.
According to claim 1,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs one-to-one direct synchronous communication;
determining whether the received response event is the same as the event type;
registering the received response event in the event synchronization object according to the determination result; and
switching the operation state of the main thread through the event synchronization object according to the determination result;
A communication method comprising a.
삭제delete 제1항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 상기 일대일 간접 동기식 통신을 수행하는 경우, 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치로부터 전송되었는지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계; 및
판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 방법.
According to claim 1,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs the one-to-one indirect synchronous communication;
determining whether the received response event is the same as the event type and is transmitted from the response target client device;
registering the received response event in the event synchronization object according to the determination result; and
switching the operation state of the main thread through the event synchronization object according to the determination result;
A communication method comprising a.
삭제delete 제1항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 상기 일대다 간접 동기식 통신을 수행하는 경우 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치 복수 개 중에서 어느 하나로부터 전송되었는지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계;
판단 결과에 따라 응답 이벤트 수를 카운트하는 단계; 및
카운트 결과가 상기 최소 응답 이벤트 수를 만족하는 때, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 방법.
According to claim 1,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs the one-to-many indirect synchronous communication;
determining whether the received response event is the same as the event type and is transmitted from any one of a plurality of response target client devices;
registering the received response event in the event synchronization object according to the determination result;
counting the number of response events according to the determination result; and
when the count result satisfies the minimum number of response events, switching the operation state of the main thread through the event synchronization object;
A communication method comprising a.
제3항, 제5항 및 제7항 중 어느 한 항에 있어서,
상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계;
상기 락을 획득한 상기 프로세싱 스레드가 상기 메인 스레드의 동작 상태를 실행 상태로 전환하는 단계; 및
상기 메인 스레드를 실행 상태로 전환시킨 상기 프로세싱 스레드가 상기 락을 놓는 단계
를 포함하는 통신 방법.
8. The method of any one of claims 3, 5 and 7,
The step of switching the operation state of the main thread through the event synchronization object comprises:
acquiring a lock exclusive of ownership state for the event synchronization object;
converting, by the processing thread acquiring the lock, an operation state of the main thread to an execution state; and
releasing the lock by the processing thread that brought the main thread to the running state;
A communication method comprising a.
제1항에 있어서,
상기 프로세싱 스레드에 의해 동작 상태가 전환된 상기 메인 스레드가 상기 이벤트 동기화 객체에 등록된 응답 이벤트를 추출하는 단계; 및
상기 메인 스레드가 추출한 응답 이벤트에 포함된 상기 요청 이벤트에 대한 요청 결과 값을 애플리케이션으로 리턴하는 단계
를 더 포함하는 통신 방법.
According to claim 1,
extracting, by the main thread whose operation state has been changed by the processing thread, a response event registered in the event synchronization object; and
returning a request result value for the request event included in the response event extracted by the main thread to the application
A communication method further comprising a.
제1항에 있어서,
상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 동작 상태를 전환하는 단계는,
상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계;
상기 락을 획득한 상기 메인 스레드가 상기 메인 스레드의 동작 상태를 실행 대기 상태로 전환하는 단계; 및
상기 실행 대기 상태로 전환된 상기 메인 스레드가 상기 락을 놓는 단계
를 포함하는 통신 방법.
According to claim 1,
The step of the main thread switching the operation state through the event synchronization object comprises:
acquiring a lock exclusive of ownership state for the event synchronization object;
converting, by the main thread acquiring the lock, an operation state of the main thread to an execution standby state; and
releasing the lock by the main thread switched to the execution standby state
A communication method comprising a.
이벤트 기반의 비동기식 통신을 지원하는 통신 미들웨어; 및
상기 통신 미들웨어를 실행하기 위한 프로세서
를 포함하고,
상기 통신 미들웨어가 상기 프로세서에 의해 실행될 때, 상기 통신 미들웨어는,
메인 스레드(main thread)가 현재 태스크(task)에 대한 요청 이벤트의 응답 조건을 이벤트 동기화 객체(event synchronizer)에 등록하는 단계;
상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계; 및
프로세싱 스레드(processing thread)가 상기 응답 조건 및 서버로부터 수신한 응답 이벤트에 기초하여 상기 이벤트 동기화 객체를 통해 상기 현재 태스크의 다음 태스크를 수행하기 위한 상기 메인 스레드의 상기 동작 상태를 전환하는 단계를 수행하고,
상기 응답 조건은,
상기 통신 미들웨어가 일대일 직접 동기식 통신을 수행하는 경우에는 상기 요청 이벤트에 대한 응답 이벤트의 이벤트 타입을 포함하고,
상기 통신 미들웨어가 일대일 간접 동기식 통신을 수행하는 경우에는 상기 이벤트 타입 및 상기 요청 이벤트가 전송되는 응답 대상 클라이언트 장치를 포함하며,
상기 통신 미들웨어가 일대다 간접 동기식 통신을 수행하는 경우에는 상기 이벤트 타입, 상기 응답 대상 클라이언트 장치 복수 개, 및 최소 응답 이벤트 수를 포함하는, 통신 장치.
Communication middleware supporting event-based asynchronous communication; and
a processor for executing the communication middleware
including,
When the communication middleware is executed by the processor, the communication middleware,
registering, by a main thread, a response condition of a request event for a current task in an event synchronizer;
converting, by the main thread, an operating state of the main thread through the event synchronization object; and
performing, by a processing thread, transitioning the operational state of the main thread to perform a next task of the current task through the event synchronization object based on the response condition and a response event received from a server; ,
The response condition is
When the communication middleware performs one-to-one direct synchronous communication, it includes an event type of a response event to the request event,
When the communication middleware performs one-to-one indirect synchronous communication, it includes a response target client device to which the event type and the request event are transmitted,
When the communication middleware performs one-to-many indirect synchronous communication, the communication device including the event type, the plurality of response target client devices, and a minimum number of response events.
삭제delete 제11항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 상기 일대일 직접 동기식 통신을 수행하는 경우 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가 상기 이벤트 타입과 동일한지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계; 및
판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 장치.
12. The method of claim 11,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs the one-to-one direct synchronous communication;
determining whether the received response event is the same as the event type;
registering the received response event in the event synchronization object according to the determination result; and
switching the operation state of the main thread through the event synchronization object according to the determination result;
A communication device comprising a.
삭제delete 제11항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 상기 일대일 간접 동기식 통신을 수행하는 경우 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치로부터 전송되었는지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계; 및
판단 결과에 따라, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 장치.
12. The method of claim 11,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs the one-to-one indirect synchronous communication;
determining whether the received response event is the same as the event type and is transmitted from the response target client device;
registering the received response event in the event synchronization object according to the determination result; and
switching the operation state of the main thread through the event synchronization object according to the determination result;
A communication device comprising a.
삭제delete 제11항에 있어서,
상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 통신 미들웨어가 상기 일대다 간접 동기식 통신을 수행하는 경우 상기 메인 스레드가 상기 서버로부터 응답 이벤트를 수신하는 단계;
상기 수신한 응답 이벤트가, 상기 이벤트 타입과 동일하고 상기 응답 대상 클라이언트 장치 복수 개 중에서 어느 하나로부터 전송되었는지 여부를 판단하는 단계;
판단 결과에 따라 상기 수신한 응답 이벤트를 상기 이벤트 동기화 객체에 등록하는 단계;
판단 결과에 따라 응답 이벤트 수를 카운트하는 단계; 및
카운트 결과가 상기 최소 응답 이벤트 수를 만족하는 때, 상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계
를 포함하는 통신 장치.
12. The method of claim 11,
The step of switching the operation state of the main thread comprises:
receiving, by the main thread, a response event from the server when the communication middleware performs the one-to-many indirect synchronous communication;
determining whether the received response event is the same as the event type and is transmitted from any one of a plurality of response target client devices;
registering the received response event in the event synchronization object according to the determination result;
counting the number of response events according to the determination result; and
when the count result satisfies the minimum number of response events, switching the operation state of the main thread through the event synchronization object;
A communication device comprising a.
제13항, 제15항 및 제17항 중 어느 한 항에 있어서,
상기 이벤트 동기화 객체를 통해 상기 메인 스레드의 동작 상태를 전환하는 단계는,
상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계;
상기 락을 획득한 상기 프로세싱 스레드가 상기 메인 스레드의 동작 상태를 실행 상태로 전환하는 단계; 및
상기 메인 스레드를 실행 상태로 전환시킨 상기 프로세싱 스레드가 상기 락을 놓는 단계
를 포함하는 통신 장치.
18. The method of any one of claims 13, 15 and 17, wherein
The step of switching the operation state of the main thread through the event synchronization object comprises:
acquiring a lock exclusive of ownership state for the event synchronization object;
converting, by the processing thread acquiring the lock, an operation state of the main thread to an execution state; and
releasing the lock by the processing thread that brought the main thread to the running state;
A communication device comprising a.
제11항에 있어서,
상기 통신 미들웨어는,
상기 프로세싱 스레드에 의해 동작 상태가 전환된 상기 메인 스레드가 상기 이벤트 동기화 객체에 등록된 응답 이벤트를 추출하는 단계; 및
상기 메인 스레드가 추출한 응답 이벤트에 포함된 상기 요청 이벤트에 대한 요청 결과 값을 애플리케이션으로 리턴하는 단계를 더 수행하는
통신 장치.
12. The method of claim 11,
The communication middleware,
extracting, by the main thread whose operation state has been changed by the processing thread, a response event registered in the event synchronization object; and
Further performing the step of returning a request result value for the request event included in the response event extracted by the main thread to the application
communication device.
제11항에 있어서,
상기 메인 스레드가 상기 이벤트 동기화 객체를 통해 동작 상태를 전환하는 단계는,
상기 이벤트 동기화 객체에 대한 소유 상태를 독점하는 락(lock)을 획득하는 단계;
상기 락을 획득한 상기 메인 스레드가 상기 메인 스레드의 동작 상태를 실행 대기 상태로 전환하는 단계; 및
상기 실행 대기 상태로 전환된 상기 메인 스레드가 상기 락을 놓는 단계
를 포함하는 통신 장치.
12. The method of claim 11,
The step of the main thread switching the operation state through the event synchronization object comprises:
acquiring a lock exclusive of ownership state for the event synchronization object;
converting, by the main thread acquiring the lock, an operation state of the main thread to an execution standby state; and
releasing the lock by the main thread switched to the execution standby state
A communication device comprising a.
KR1020200071630A 2020-06-12 2020-06-12 Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware KR102388083B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020200071630A KR102388083B1 (en) 2020-06-12 2020-06-12 Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020200071630A KR102388083B1 (en) 2020-06-12 2020-06-12 Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware

Publications (2)

Publication Number Publication Date
KR20210154525A KR20210154525A (en) 2021-12-21
KR102388083B1 true KR102388083B1 (en) 2022-04-18

Family

ID=79165555

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020200071630A KR102388083B1 (en) 2020-06-12 2020-06-12 Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware

Country Status (1)

Country Link
KR (1) KR102388083B1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030312A (en) 2002-06-26 2004-01-29 Mitsubishi Electric Corp Method for controlling multithread synchronization
EP1715422A1 (en) 2005-04-18 2006-10-25 Research In Motion Limited System and method for converting a schema based synchronous service to a schema based asynchronous service
KR100988395B1 (en) * 2003-02-18 2010-10-18 마이크로소프트 코포레이션 Multithreaded kernel for graphics processing unit
JP2015143998A (en) 2015-02-27 2015-08-06 テレフオンアクチーボラゲット エル エム エリクソン(パブル) Apparatus and method for processing events in telecommunications network
KR101745392B1 (en) 2011-08-12 2017-06-09 (주)테크노니아 Program analyzing device and computer readble recording medium recording analyzing program
KR101867866B1 (en) * 2017-03-23 2018-06-18 주식회사 노트스퀘어 Method and Apparatus for optimizing target program dynamically

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6217644B2 (en) * 2012-10-23 2017-10-25 日本電気株式会社 Rule distribution server, event processing system, method and program

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030312A (en) 2002-06-26 2004-01-29 Mitsubishi Electric Corp Method for controlling multithread synchronization
KR100988395B1 (en) * 2003-02-18 2010-10-18 마이크로소프트 코포레이션 Multithreaded kernel for graphics processing unit
EP1715422A1 (en) 2005-04-18 2006-10-25 Research In Motion Limited System and method for converting a schema based synchronous service to a schema based asynchronous service
KR101745392B1 (en) 2011-08-12 2017-06-09 (주)테크노니아 Program analyzing device and computer readble recording medium recording analyzing program
JP2015143998A (en) 2015-02-27 2015-08-06 テレフオンアクチーボラゲット エル エム エリクソン(パブル) Apparatus and method for processing events in telecommunications network
KR101867866B1 (en) * 2017-03-23 2018-06-18 주식회사 노트스퀘어 Method and Apparatus for optimizing target program dynamically

Also Published As

Publication number Publication date
KR20210154525A (en) 2021-12-21

Similar Documents

Publication Publication Date Title
US11556366B2 (en) Container login method, apparatus, and storage medium
KR102004160B1 (en) Apparatus and method for logical grouping method of iot connected client nodes using client identifier
US8321530B2 (en) Cloud computing system, server computer, device connection method, and storage medium
CN107172187B (en) A kind of SiteServer LBS and method
US7415522B2 (en) Extensible framework for transferring session state
RU2670794C9 (en) Method and system for forming flexible node on local or distributed computing systems
US20160205152A1 (en) Remote calling method and apparatus
EP3454215A1 (en) Method for calling remote procedure in network device, and network device
KR102127591B1 (en) Method and apparatus for event-based synchronous communication in asynchronous communication framework
KR102122913B1 (en) Distributed api proxy system and apapparatus and method for managing traffic in such system
CN111258723B (en) Transaction processing method, device, system, medium and equipment of distributed system
CN112583931A (en) Message processing method, message middleware, electronic device and storage medium
US20230422158A1 (en) Non-ip data delivery authorization update method and connection release method for non-ip data delivery, and device for performing the method
CN113747373B (en) Message processing system, device and method
KR102490698B1 (en) Communication method for selecting a network slice / service and a communication device performing the same
KR101604303B1 (en) Apparatus and Method for Executing Update and Recording Medium Using the Same, Server and Method for Providing Update
Kulkarni et al. The cost of stateless network functions in 5G
KR102388083B1 (en) Method and apparatus for directly and indirectly synchronous communication in event-based asynchronous communication middleware
WO2024125106A1 (en) Data transmission method and apparatus, device, and storage medium
WO2012174838A1 (en) Method and system of parallel transmitting network element messages
CN115334155B (en) Message queue proxy method and device
Lim Directly and indirectly synchronous communication mechanisms for client-server systems using event-based asynchronous communication framework
KR102277756B1 (en) Method for IMS based service exposure in 5G Networks and system using thereof
KR100914249B1 (en) Communication System and method for network based robot control
US20160182667A1 (en) Management Application for an Application Router

Legal Events

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