KR100803450B1 - Apparatus and method for scheduling in shared bus system - Google Patents

Apparatus and method for scheduling in shared bus system Download PDF

Info

Publication number
KR100803450B1
KR100803450B1 KR1020020072105A KR20020072105A KR100803450B1 KR 100803450 B1 KR100803450 B1 KR 100803450B1 KR 1020020072105 A KR1020020072105 A KR 1020020072105A KR 20020072105 A KR20020072105 A KR 20020072105A KR 100803450 B1 KR100803450 B1 KR 100803450B1
Authority
KR
South Korea
Prior art keywords
message
queue
semaphore
shared bus
terminals
Prior art date
Application number
KR1020020072105A
Other languages
Korean (ko)
Other versions
KR20040043683A (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 KR1020020072105A priority Critical patent/KR100803450B1/en
Publication of KR20040043683A publication Critical patent/KR20040043683A/en
Application granted granted Critical
Publication of KR100803450B1 publication Critical patent/KR100803450B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/36Handling requests for interconnection or transfer for access to common bus or bus system
    • G06F13/368Handling requests for interconnection or transfer for access to common bus or bus system with decentralised access control
    • G06F13/37Handling requests for interconnection or transfer for access to common bus or bus system with decentralised access control using a physical-position-dependent priority, e.g. daisy chain, round robin or token passing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • G06F13/4286Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a handshaking protocol, e.g. RS232C link

Abstract

본 발명은 공유 버스 시스템의 스케줄링 장치 및 그 방법을 제공하기 위한 것으로, 복수개의 터미널의 수만큼 이루어져 저장된 데이터들에 대해 세마포어를 한번만 점유해서 한꺼번에 상기 복수개의 터미널로 데이터들을 보낼 수 있도록 하는 복수개의 큐를 구비하고, 공유 버스 시스템에서 주제어 기능을 수행하는 마스터와; 상기 마스터와 공유 버스로 연결되어 제어를 받는 복수개의 터미널을 포함하여 구성함으로써, 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 세마포어를 획득하고 반납하는 과정을 줄이고 시스템의 효율성을 향상시킬 수 있게 되는 것이다.SUMMARY OF THE INVENTION The present invention provides a scheduling apparatus and a method of a shared bus system, and includes a plurality of queues which allow data to be sent to the plurality of terminals at a time by occupying a semaphore once for data stored as many as a plurality of terminals. A master having a main control function in the shared bus system; By including a plurality of terminals connected to the master and controlled by the shared bus, the process of acquiring and returning semaphores when performing data communication in serial communication using an RS-422 device supporting a multipoint connection is reduced. The efficiency of the system can be improved.

Description

공유 버스 시스템의 스케줄링 장치 및 그 방법{Apparatus and method for scheduling in shared bus system}Apparatus and method for scheduling in shared bus system

도 1은 종래 공유 버스 시스템의 스케줄링 장치의 블록구성도이고,1 is a block diagram of a scheduling apparatus of a conventional shared bus system,

도 2는 종래 공유 버스 시스템의 스케줄링 방법을 보인 절차도이며,2 is a flowchart illustrating a scheduling method of a conventional shared bus system.

도 3은 종래 공유 버스 시스템의 스케줄링 방법을 보인 순서도이고,3 is a flowchart illustrating a scheduling method of a conventional shared bus system.

도 4는 종래 공유 버스 시스템의 스케줄링 장치 및 그 방법에 의한 큐의 구성예를 보인 개념도이며,4 is a conceptual diagram illustrating a configuration example of a queue by a scheduling apparatus and a method of a conventional shared bus system,

도 5는 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 장치의 블록구성도이고,5 is a block diagram illustrating a scheduling apparatus of a shared bus system according to an exemplary embodiment of the present invention.

도 6은 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 방법을 보인 절차도이며,6 is a flowchart illustrating a scheduling method of a shared bus system according to an embodiment of the present invention.

도 7은 본 발명의 다른 실시예에 의한 공유 버스 시스템의 스케줄링 방법을 보인 순서도이고,7 is a flowchart illustrating a scheduling method of a shared bus system according to another exemplary embodiment of the present invention.

도 8은 본 발명에 의한 공유 버스 시스템의 스케줄링 장치 및 그 방법에 의한 큐의 구성예를 보인 개념도이다.8 is a conceptual diagram illustrating an exemplary configuration of a queue by a scheduling apparatus and a method of a shared bus system according to the present invention.

* 도면의 주요 부분에 대한 부호의 설명 *Explanation of symbols on the main parts of the drawings

10 : 마스터 10: master                 

20, 21, 22, ..., 2N : 큐Cue: 20, 21, 22, ..., 2N

31, 32, ..., 3N : 터미널31, 32, ..., 3N: terminal

40 : 공유 버스40: shared bus

본 발명은 공유 버스 시스템(Shared Bus System)의 스케줄링(Scheduling) 방법에 관한 것으로, 특히 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 세마포어(Semaphore)를 획득하고 반납하는 과정을 줄이고 시스템의 효율성을 향상시키기에 적당하도록 한 공유 버스 시스템의 스케줄링 장치 및 그 방법에 관한 것이다.The present invention relates to a scheduling method of a shared bus system. In particular, a semaphore is obtained when performing data communication in serial communication using an RS-422 device supporting a multipoint connection. The present invention relates to a scheduling apparatus and a method of a shared bus system suitable for reducing the process of returning and improving the efficiency of the system.

일반적으로 직렬 데이터 통신을 수행할 때는 직렬 장치 접속용 표준 인터페이스 장치인 RS-322 장치를 이용할 수 있다.In general, RS-322 devices, which are standard interface devices for serial device connection, can be used for serial data communication.

도 1은 종래 공유 버스 시스템의 스케줄링 장치의 블록구성도이다.1 is a block diagram of a scheduling apparatus of a conventional shared bus system.

여기서 참조번호 10은 공유 버스 시스템에서 주제어 기능을 수행하는 마스터이고, 20은 상기 마스터(10) 내의 큐이며, 31 내지 3N은 상기 마스터(10)와 공유 버스로 연결되어 제어를 받는 터미널들이다.Here, reference numeral 10 is a master performing a main control function in a shared bus system, 20 is a queue in the master 10, and 31 to 3N are terminals connected to the master 10 by a shared bus and controlled.

그래서 이러한 종래의 기술에서는 1개의 큐(20)가 마스터(10)에 구비되고 있고, RS-422 장치와 멀티포인트로 연결되어 있는 터미널들(31 ~ 3N)과 이러한 터미널들(31 ~ 3N)을 제어하는 마스터(10)로 이루어져 있다. Therefore, in this conventional technology, one queue 20 is provided in the master 10, and terminals 31 to 3N and the terminals 31 to 3N, which are connected to the RS-422 device by multipoint, are connected to each other. It consists of a master 10 for controlling.                         

도 2는 종래 공유 버스 시스템의 스케줄링 방법을 보인 절차도이다.2 is a flowchart illustrating a scheduling method of a conventional shared bus system.

이에 도시된 바와 같이, 마스터와 터미널 간에 세마포어를 점유하는 단계(ST11)와; 상기 세마포어 점유 후 상기 마스터에서 브로드캐스팅(Broadcasting)으로 메시지를 상기 터미널로 전송하는 단계(ST12)와; 상기 터미널은 전송받은 메시지에 대한 응답을 상기 마스터로 전송하는 단계(ST13)와; 상기 응답 전송 후 상기 마스터와 상기 터미널 간의 세마포어를 해제하는 단계(ST14)를 수행한다.As shown therein, occupying the semaphore between the master and the terminal (ST11); Transmitting a message to the terminal by broadcasting from the master after the semaphore is occupied (ST12); The terminal transmitting a response to the received message to the master (ST13); After the response is transmitted, the step S14 of releasing the semaphore between the master and the terminal is performed.

도 3은 종래 공유 버스 시스템의 스케줄링 방법을 보인 순서도이다.3 is a flowchart illustrating a scheduling method of a conventional shared bus system.

이에 도시된 바와 같이, 마스터로 메시지를 입력하고 큐에 저장한 다음 세마포어를 점유하는 단계(ST21 ~ ST23)와; 상기 세마포어 점유 후 메시지를 전송하여 응답 메시지가 터미널로부터 있는지 판별하는 단계(ST24)(ST25)와; 상기 터미널로부터 응답 메시지가 있으면 세마포어를 해제하는 단계(ST25)를 수행한다.As shown in the figure, inputting a message to a master, storing it in a queue, and then occupying semaphores (ST21 to ST23); Determining whether a response message is from a terminal by transmitting a message after the semaphore occupancy (ST24) (ST25); If there is a response message from the terminal, the step of releasing the semaphore is performed (ST25).

도 4는 종래 공유 버스 시스템의 스케줄링 장치 및 그 방법에 의한 큐의 구성예를 보인 개념도이다.4 is a conceptual diagram illustrating an exemplary configuration of a queue by a scheduling apparatus and a method of a conventional shared bus system.

이와 같이 구성된 종래 기술의 동작을 첨부한 도면에 의거 상세히 설명하면 다음과 같다.When described in detail with reference to the accompanying drawings of the operation of the prior art configured as follows.

먼저 종래의 기술은 도 4에서 처럼 1개의 큐에 마스터 장치로 들어온 메시지들을 저장하고, T1 시간에 한 개의 메시지를 큐에서 꺼내어 특정 터미널의 한 곳에 보내도록 하는 방법을 사용하고 있다.First, the prior art uses a method of storing messages coming into a master device in one queue as shown in FIG. 4, and taking one message out of a queue at a time T1 and sending it to a specific terminal.

이때 RS-422를 이용한 공유 버스를 사용하기 때문에 T1 시간에 A 메시지가 타겟 터미널과 통신하는 동안에는 다른 터미널들은 마스터 장치와 통신할 수가 없다.Since a shared bus using RS-422 is used, other terminals cannot communicate with the master device while the A message communicates with the target terminal at T1 time.

통신이 끝나면, 타겟 터미널에서 마스터 장치로 응답(Ack)을 보내고, 마스터에서 세마포어를 해제한다.When the communication is over, an acknowledgment is sent from the target terminal to the master device, and the semaphore is released from the master.

메시지의 타겟 터미널이 존재하지 않을 때 마스터는 타겟 터미널로부터 응답 메시지를 받지 못하게 된다.When the target terminal of the message does not exist, the master does not receive a response message from the target terminal.

이러한 동작을 큐에 메시지가 있는 동안 계속 반복하게 된다.This operation is repeated for as long as there are messages on the queue.

이는 FIFO(First In First Out, 선입선출)를 이용한 큐이며, 각 메시지에는 우선순위가 없기 때문에 큐의 처음에 위치한 메시지가 다음에 보내질 메시지가 된다.This is a queue using FIFO (First In First Out), and since each message has no priority, the first message on the queue becomes the next message to be sent.

그러나 이러한 종래의 기술은 다음과 같은 문제점이 있었다.However, this conventional technology has the following problems.

즉, 마스터에서 한 개의 메시지를 공유 버스를 통해서 뿌릴 때 그 메시지가 어느 터미널로 갈지를 고려하지 않고 터미널이 메시지의 목적지(Destination)를 보아서 자신과 동일하면 그 메시지를 취한다.That is, when a master sends a message through the shared bus, it takes the message if the terminal is identical to itself by looking at the destination of the message, without considering which terminal the message will go to.

이런 동작을 수행하기 위해서 마스터는 세마포어를 점유하고 있다가 터미널 장치에서 메시지를 받았다는 응답을 보내면 세마포어를 해제한다.To do this, the master occupies the semaphore and releases the semaphore when it sends a response from the terminal device.

단 한 개의 메시지를 타겟 터미널로 보내기 위해서 마스터는 세마포어를 점유하고 해제하는 과정을 거치게 된다.To send only one message to the target terminal, the master goes through the process of seizing and releasing the semaphore.

N 개의 메시지를 보내기 위해서는 위의 과정을 N 번 수행해야 한다.In order to send N messages, the above process must be performed N times.

도 4에서 9번째에 위치한 메시지를 타겟 터미널로 보내기 위해서는 8번의 세 마포어를 잡고 놓는 과정을 반복한 다음이어야만 가능하며, 13번째에 위치한 메시지를 타겟 터미널로 보내기 위해서는 12번의 세마포어를 잡고 놓는 과정을 반복한 다음에야 가능하게 된다.In order to send the message located at the ninth point in FIG. 4 to the target terminal, it is possible to repeat the process of holding the eight semaphores, and to send the message located at the 13th point to the target terminal, the process of holding the semaphore at the 12th point is carried out. Only after repeating is it possible.

공유 버스를 통해서 전달되는 메시지의 개수가 많을수록 세마포어 연산 횟수는 증가하게 되며, 운영체제의 부하도 더 걸리게 된다.The greater the number of messages sent over the shared bus, the greater the number of semaphore operations and the greater the operating system load.

또한 보낼 메시지의 타겟 터미널이 존재하지 않음에도 불구하고 메시지는 공유 버스를 타고 브로드캐스팅될 수 있는 비효율적인 면도 존재하는 등의 문제점들이 있었다.In addition, although there is no target terminal for a message to be sent, there are problems such as the inefficiency of a message that can be broadcasted on a shared bus.

이에 본 발명은 상기와 같은 종래의 제반 문제점을 해소하기 위해 제안된 것으로, 본 발명의 목적은 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 세마포어를 획득하고 반납하는 과정을 줄이고 시스템의 효율성을 향상시킬 수 있는 공유 버스 시스템의 스케줄링 장치 및 그 방법을 제공하는 데 있다.Accordingly, the present invention has been proposed to solve the above conventional problems, and an object of the present invention is to acquire and return semaphores when performing data communication in serial communication using an RS-422 device supporting a multipoint connection. The present invention provides a scheduling apparatus and a method of a shared bus system that can reduce the number of steps and improve the efficiency of the system.

또한 본 발명의 다른 목적은 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 1개의 큐에 전송해야할 데이터들을 저장한 후 일정 시간 동안에 큐의 첫 번째에 저장되어 있는 1개의 데이터만을 가져와서 세마포어를 점유한 후 다시 돌려주는 종래의 방식의 문제점을 극복하여 RS-422와 연결되어 있는 N개의 터미널의 개수만큼 큐를 사용해서 일정 시간 동안에 터미널 N으로 보내야 하는 경우 큐 N에 저장되어 있는 데이터들에 대해 세마포어를 한번만 점유해서 한꺼번에 보내도록 하여 세마포어를 획득하고 반납하는 과정을 줄임과 동시에 시스템의 효율성을 향상시킬 수 있는 공유 버스 시스템의 스케줄링 장치 및 그 방법을 제공하는 데 있다.In addition, another object of the present invention is to store the data to be transmitted to one queue when performing data communication in the serial communication using the RS-422 device supporting a multi-point connection is stored in the first of the queue for a certain time Overcoming the problem of the conventional method of taking only one data and occupying and returning the semaphore, if the number of N terminals connected to RS-422 needs to be sent to terminal N for a predetermined time, queue N The present invention provides a scheduling system and a method for a shared bus system that can improve the efficiency of the system while simultaneously acquiring and returning semaphores to the semaphores and sending them all at once. .

상기와 같은 목적을 달성하기 위하여 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 장치는,In order to achieve the above object, the scheduling apparatus of a shared bus system according to an embodiment of the present invention,

복수개의 터미널의 수만큼 이루어져 저장된 데이터들에 대해 세마포어를 한번만 점유해서 한꺼번에 상기 복수개의 터미널로 데이터들을 보낼 수 있도록 하는 복수개의 큐를 구비하고, 공유 버스 시스템에서 주제어 기능을 수행하는 마스터와; 상기 마스터와 공유 버스로 연결되어 제어를 받는 복수개의 터미널을 포함하여 이루어짐을 그 기술적 구성상의 특징으로 한다.A master having a plurality of queues which allow data to be sent to the plurality of terminals at a time by occupying semaphores only once for the stored data made up of a plurality of terminals, and performing a main control function in a shared bus system; The technical configuration is characterized in that it comprises a plurality of terminals connected to the master and the control bus is controlled.

상기와 같은 목적을 달성하기 위하여 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 방법은,Scheduling method of a shared bus system according to an embodiment of the present invention to achieve the above object,

마스터와 복수개의 터미널 간에 세마포어를 점유하는 제 1 단계와; 상기 제 1 단계에서 세마포어 점유 후 상기 복수개의 터미널의 개수만큼의 큐를 사용해서 일정 시간 동안에 상기 복수개의 터미널로 메시지를 전송하고, 그 각각에 대해 응답을 받는 제 2 단계와; 상기 제 2 단계가 완료되면 세마포어를 해제하는 제 3 단계를 포함하여 수행함을 그 기술적 구성상의 특징으로 한다.A first step of occupying semaphores between the master and the plurality of terminals; A second step of transmitting a message to the plurality of terminals for a predetermined time by using the number of queues of the plurality of terminals after semaphore occupancy in the first step, and receiving a response to each of the plurality of terminals; When the second step is completed, including the third step of releasing the semaphore is characterized in the technical configuration.

상기와 같은 목적을 달성하기 위하여 본 발명의 다른 실시예에 의한 공유 버스 시스템의 스케줄링 방법은,Scheduling method of a shared bus system according to another embodiment of the present invention in order to achieve the above object,

마스터로 메시지를 입력하고 메시지에서 추출한 목적지가 유효한지 판별하는 제 1 단계와; 상기 추출한 목적지가 유효하지 않으면 메시지를 재입력받고, 상기 추출한 목적지가 유효하면 목적지의 큐에 저장한 다음 세마포어를 점유하는 제 2 단계와; 상기 제 2 단계 후 타임 오버가 되거나 큐에 보낼 메시지가 없을 때까지 메시지를 터미널로 전송하는 제 3 단계와; 상기 제 3 단계가 완료되면 세마포어를 해제하는 제 4 단계를 포함하여 수행함을 그 기술적 구성상의 특징으로 한다.A first step of inputting a message to the master and determining whether the destination extracted from the message is valid; Receiving a message again if the extracted destination is not valid, and storing the semaphore after storing the message in a queue of the destination if the extracted destination is valid; Transmitting a message to the terminal until the time-out after the second step or there is no message to be queued; When the third step is completed is characterized by including the fourth step of releasing the semaphore.

이하, 상기와 같이 구성된 본 발명, 공유 버스 시스템의 스케줄링 장치 및 그 방법의 기술적 사상에 따른 일실시예를 도면을 참조하여 상세히 설명하면 다음과 같다.Hereinafter, an embodiment according to the present invention configured as described above, a scheduling apparatus of a shared bus system and a method thereof will be described in detail with reference to the accompanying drawings.

도 5는 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 장치의 블록구성도이다.5 is a block diagram of a scheduling apparatus of a shared bus system according to an exemplary embodiment of the present invention.

이에 도시된 바와 같이, 복수개의 터미널(31 ~ 3N)의 수만큼 이루어져 저장된 데이터들에 대해 세마포어를 한번만 점유해서 한꺼번에 상기 복수개의 터미널(31 ~ 3N)로 데이터들을 보낼 수 있도록 하는 복수개의 큐(21 ~ 2N)를 구비하고, 공유 버스 시스템에서 주제어 기능을 수행하는 마스터(10)와; 상기 마스터(10)와 공유 버스(40)로 연결되어 제어를 받는 복수개의 터미널(31 ~3N)을 포함하여 구성된다.As shown in the drawing, a plurality of queues 21 may be used to transmit data to the plurality of terminals 31 to 3N at a time by occupying semaphores only once for the stored data, which is composed of the number of terminals 31 to 3N. 2N), the master 10 performing a main control function in the shared bus system; It is configured to include a plurality of terminals (31 ~ 3N) connected to the master 10 and the shared bus 40 and controlled.

도 6은 본 발명의 일 실시예에 의한 공유 버스 시스템의 스케줄링 방법을 보인 절차도이다.6 is a flowchart illustrating a scheduling method of a shared bus system according to an exemplary embodiment of the present invention.

이에 도시된 바와 같이, 마스터(10)와 복수개의 터미널(31 ~ 3N) 간에 세마 포어를 점유하는 제 1 단계(ST31)와; 상기 제 1 단계에서 세마포어 점유 후 상기 복수개의 터미널(31 ~ 3N)의 개수만큼의 큐(21 ~ 2N)를 사용해서 일정 시간 동안에 상기 복수개의 터미널(31 ~ 3N)로 메시지를 전송하고, 그 각각에 대해 응답을 받는 제 2 단계(ST32 ~ ST35)와; 상기 제 2 단계가 완료되면 세마포어를 해제하는 제 3 단계(ST37)를 포함하여 수행한다.As shown therein, the first step ST31 occupies the semaphore between the master 10 and the plurality of terminals 31 to 3N; After the semaphore occupies in the first step, a message is transmitted to the plurality of terminals 31 to 3N for a predetermined time by using the queues 21 to 2N as many as the numbers of the terminals 31 to 3N, respectively. Receiving a response to the second step (ST32 to ST35); When the second step is completed, a third step (ST37) for releasing the semaphore is performed.

상기에서 제 2 단계는, 세마포어를 잡을 큐를 선택할 때 RR(Round Robin) 방식으로 큐를 선택한다.In the second step, when selecting a queue to semaphore semaphore, the queue is selected in a round robin (RR) manner.

상기에서 제 2 단계는, 세마포어를 잡을 큐를 선택할 때 각 큐에서 기다리는 메시지 중에서 맨 처음에 위치한 메시지들 중 대기 시간(Waiting Time)이 가장 긴 메시지를 포함하고 있는 큐가 먼저 서비스되도록 큐를 선택한다.In the second step, when selecting a queue to semaphore, the queue is selected so that the queue containing the message with the longest waiting time among the first messages among the waiting messages in each queue is serviced first. .

상기에서 제 2 단계는, 세마포어를 잡을 큐를 선택할 때 메시지에 우선순위를 설정하여 메시지의 우선순위에 따라 큐를 선택한다.In the second step, when selecting a queue to semaphore, the priority is set to the message to select the queue according to the priority of the message.

도 7은 본 발명의 다른 실시예에 의한 공유 버스 시스템의 스케줄링 방법을 보인 순서도이다.7 is a flowchart illustrating a scheduling method of a shared bus system according to another exemplary embodiment of the present invention.

이에 도시된 바와 같이, 마스터(10)로 메시지를 입력하고 메시지에서 추출한 목적지가 유효한지 판별하는 제 1 단계(ST41)(ST42)와; 상기 추출한 목적지가 유효하지 않으면 메시지를 재입력받고, 상기 추출한 목적지가 유효하면 목적지의 큐에 저장한 다음 세마포어를 점유하는 제 2 단계(ST43)(ST44)와; 상기 제 2 단계 후 타임 오버가 되거나 큐에 보낼 메시지가 없을 때까지 메시지를 터미널로 전송하는 제 3 단계(ST45)(ST46)와; 상기 제 3 단계가 완료되면 세마포어를 해제하는 제 4 단계(ST47)를 포함하여 수행한다.As shown therein, a first step (ST41) (ST42) of inputting a message to the master 10 and determining whether the destination extracted from the message is valid; A second step (ST43) (ST44) of receiving a message again if the extracted destination is not valid and storing the semaphore after storing the message in a queue of the destination if the extracted destination is valid; A third step (ST45) (ST46) of transmitting a message to the terminal until a time-out after the second step or there is no message to be queued; After the third step is completed, a fourth step ST47 for releasing the semaphore is performed.

이와 같이 구성된 본 발명에 의한 공유 버스 시스템의 스케줄링 장치 및 그 방법의 동작을 첨부한 도면에 의거 상세히 설명하면 다음과 같다.Operation of the scheduling apparatus and the method of the shared bus system according to the present invention configured as described above will be described in detail with reference to the accompanying drawings.

먼저 본 발명은 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 세마포어를 획득하고 반납하는 과정을 줄이고자 한 것이다.First, the present invention aims to reduce the process of acquiring and returning semaphores when performing data communication in serial communication using an RS-422 device supporting a multipoint connection.

도 8은 본 발명에 의한 공유 버스 시스템의 스케줄링 장치 및 그 방법에 의한 큐의 구성예를 보인 개념도이다.8 is a conceptual diagram illustrating an exemplary configuration of a queue by a scheduling apparatus and a method of a shared bus system according to the present invention.

그래서 본 발명은 터미널 개수 만큼의 큐(21 ~ 2N)와 터미널들(31 ~ 3N)을 제어하는 마스터(10)로 이루어져 있으며, 마스터(10)와 터미널들(31 ~ 3N)은 공유 버스를 사용하는 구조로 구성되어 있다.Thus, the present invention consists of a master 10 controlling the queues 21 to 2N and terminals 31 to 3N as many as the number of terminals, and the master 10 and the terminals 31 to 3N use a shared bus. It is composed of a structure.

따라서 본 발명에서는 터미널 개수 만큼의 큐(21 ~ 2N)를 사용하고, 마스터(10)에서는 들어오는 메시지들의 각각의 타겟 터미널을 보고 타겟 터미널의 번호(#)에 따라서 각각의 큐에 저장한다.Therefore, in the present invention, as many queues 21 to 2N as the number of terminals are used, and the master 10 looks at each target terminal of incoming messages and stores them in each queue according to the number (#) of the target terminal.

터미널 N(3N)에 메시지를 보낼 때, 큐 N(2N)을 살펴보고 큐 N(2N)에 저장되어 있는 메시지들을 세마포어를 이용해서 터미널 N(3N) 장치에 보낸다.When sending a message to terminal N (3N), it looks at queue N (2N) and sends messages stored in queue N (2N) to terminal N (3N) devices using semaphores.

이때 메시지가 1개 이상이더라도 세마포어는 한번만 점유해서 메시지를 보내고, 메시지의 전송이 다 끝나면 그때 세마포어를 해제시킨다.At this time, even if there is more than one message, the semaphore occupies only one time and sends the message. When the message is finished, the semaphore is released.

이때 몇 가지 스케줄링 방법을 추가시킨다.Add some scheduling methods.

1. 가령, 메시지별로 우선순위가 없이 큐 1(21) 내지 큐 N(2N)까지 차례대로 보면서 메시지가 있는 큐를 선택해서 큐 번호(#)에 해당하는 터미널에 큐 번호(#)에 쌓여 있는 메시지를 세마포어를 획득한 후에 보낸다고 생각해보자.1. For example, if a message has no priority and selects queues 1 (21) to queues N (2N) in sequence, select the queue with messages and accumulate the queue number (#) at the terminal corresponding to the queue number (#). Suppose you send a message after you have acquired a semaphore.

큐 #에 쌓여 있는 메시지의 개수에 따라서 다른 터미널로 가야하는 메시지들이 가지 못하고 굶주림(Starvation) 상태에 빠질 수가 있다.Depending on the number of messages accumulated in queue #, messages that have to go to other terminals may not go to starvation.

즉, 도 8에서 큐 1의 메시지가 20 정도 쌓여 있고 계속해서 큐 1로 메시지가 들어온다고 가정할 때, 다른 큐에 저장되어 있는 메시지는 해당 터미널로 보내어 질 수가 없게 된다.That is, assuming that messages of queue 1 are stacked about 20 in FIG. 8 and messages continue to enter queue 1, messages stored in other queues cannot be sent to the corresponding terminal.

이와 같은 경우를 대비해서 한 큐에서 한번에 획득해서 사용할 수 있는 세마포어의 제한 시간을 지정해둔다.In case of such a case, specify the time limit of semaphores that can be acquired and used in one queue at a time.

현재 세마포어를 획득한 큐에 많은 메시지가 쌓여 있을 지라도 제한 시간이 지나면 세마포어를 반납하고 다음의 큐로 가도록 한다.Even if there are many messages accumulated in the queue that acquired the semaphore, the semaphore is returned after the timeout and the next queue is moved.

2. 세마포어를 잡을 큐를 선택할 때에도 단순히 RR(Round Robin) 방식으로 할 수도 있고, 각 큐에서 기다리는 메시지 중에서 맨 처음에 위치한 메시지들 중에서 대기 시간(Waiting Time)이 가장 긴 메시지를 포함하고 있는 큐가 먼저 서비스되도록 하는 방식으로 큐를 선택할 수도 있다. 또한 메시지에 우선순위가 있어서 우선순위에 따라서 서비스하는 방식으로 큐를 선택할 수도 있다.2. When selecting a queue to semaphore, it can be simply RR (Round Robin) method, or the queue containing the longest waiting time among the first messages among the waiting messages in each queue. You can also select a queue by first servicing it. You can also select a queue in a way that the message has a priority, so that you can service it according to its priority.

이것은 시스템의 성격에 따라 선택적으로 사용할 수 있다.This can be used selectively depending on the nature of the system.

이러한 본 발명의 동작을 전체적으로 설명하면 다음과 같다.The overall operation of the present invention will be described below.

먼저 메시지들의 타겟 터미널 #(Number)을 확인한다.First check the target terminal # (Number) of messages.

그리고 메시지별로 타겟 터미널에 해당하는 큐에 저장한다. Each message is stored in a queue corresponding to the target terminal.                     

그런 다음 현재 서비스 해야 할 큐 #(Number)를 확인한다.Then check the queue # (Number) that needs to be serviced.

그리고 나서 세마포어를 점유한다.Then seize the semaphore.

큐 #에 있는 메시지들을 하나씩 목적지(Destination)로 보낸다.Send messages on queue # one by one to destination.

한 번 점유해서 사용할 수 있는 세마포어의 타임 틱(Time Tick)을 체크한다.Check the time tick of the semaphore that can be occupied once.

타임 틱이 끝났거나 큐에 보낼 메시지가 없으면 세마포어를 해제한다.Release the semaphore when the time tick ends or there are no messages to be queued.

다음에 서비스 해줄 큐 #를 선택한다. 이때 큐 #의 선택은 시스템 특성에 맞게 적절한 스케줄링 방법을 사용한다. 예를 들면, 라운드 로빈 방식 또는 큐의 대기 시간이 가장 긴 또는 메시지의 우선순위가 높은 것 등등을 이용한다.Next select the queue # to serve. At this time, selection of queue # uses appropriate scheduling method according to system characteristics. For example, use round robin or the longest queue wait time, or the high priority of the message.

이처럼 본 발명은 멀티포인트 접속을 지원하는 RS-422 장치를 이용한 직렬 통신에서 데이터 통신을 수행할 때 세마포어를 획득하고 반납하는 과정을 줄이고 시스템의 효율성을 향상시키게 되는 것이다.As described above, the present invention reduces the process of acquiring and returning semaphores and improves the efficiency of the system when performing data communication in the serial communication using the RS-422 device supporting the multipoint connection.

이상에서 본 발명의 바람직한 실시예를 설명하였으나, 본 발명은 다양한 변화와 변경 및 균등물을 사용할 수 있다. 본 발명은 상기 실시예를 적절히 변형하여 동일하게 응용할 수 있음이 명확하다. 따라서 상기 기재 내용은 하기 특허청구범위의 한계에 의해 정해지는 본 발명의 범위를 한정하는 것이 아니다.Although the preferred embodiment of the present invention has been described above, the present invention may use various changes, modifications, and equivalents. It is clear that the present invention can be applied in the same manner by appropriately modifying the above embodiments. Accordingly, the above description does not limit the scope of the invention as defined by the limitations of the following claims.

이상에서 살펴본 바와 같이, 본 발명에 의한 공유 버스 시스템의 스케줄링 장치 및 그 방법은, 종래의 기술이 한 개의 큐를 사용하여 메시지 개수 만큼의 세마포어를 점유하고 해제하는 동작을 하는 것임에 반해, 큐의 개수를 늘려서 세마포어를 점유하고 해제하는 동작을 줄임으로써 운영체제에서 스케줄링하는 오버헤드를 감소시킬 수 있는 효과가 있게 된다.As described above, the scheduling apparatus and the method of the shared bus system according to the present invention, while the prior art is to occupy and release as many semaphores as the number of messages using a single queue, Increasing the number reduces the semaphore seizure and release operations, reducing the overhead of scheduling in the operating system.

그래서 종래 기술에 의한 도 4의 경우에는 13번의 세마포어를 점유하고 해제하는 과정을 반복해야 함에 비해, 본 발명에 의한 도 8의 경우에는 5번의 세마포어를 점유하고 해제하는 과정을 반복하게 됨으로써, 100% 이상의 효율을 볼 수 있음을 확인할 수 있게 된다. 물론 들어오는 메시지의 순서와 스케줄링 방법에 따라서 그 효율성은 가변적일 수 있다.So, in the case of FIG. 4 according to the prior art, the process of occupying and releasing 13 semaphores should be repeated, whereas in the case of FIG. 8 according to the present invention, the process of occupying and releasing five semaphores is repeated, and thus 100%. It can be confirmed that the above efficiency can be seen. Of course, the efficiency may vary depending on the order of incoming messages and the scheduling method.

또한 본 발명은 미리 타겟 터미널에 해당하는 큐에 메시지를 저장하기 때문에 타겟이 불분명할 때에는 큐에 저장되지 않으므로 불필요한 메시지를 공유 버스로 브로드캐스팅하는 경우는 일어나지 않게 되어 시스템의 효율성을 향상시킬 수 있는 효과가 있게 된다.In addition, the present invention stores the message in the queue corresponding to the target terminal in advance, so when the target is unclear, the message is not stored in the queue, so that unnecessary messages are not broadcasted to the shared bus, thereby improving the efficiency of the system. Will be.

Claims (6)

복수개의 터미널의 수만큼 이루어져 저장된 데이터들에 대해 세마포어를 한번만 점유해서 한꺼번에 상기 복수개의 터미널로 데이터들을 보낼 수 있도록 하는 복수개의 큐를 구비하고, 공유 버스 시스템에서 주제어 기능을 수행하는 마스터와;A master having a plurality of queues which allow data to be sent to the plurality of terminals at a time by occupying semaphores only once for the stored data made up of a plurality of terminals, and performing a main control function in a shared bus system; 상기 마스터와 공유 버스로 연결되어 제어를 받는 복수개의 터미널을 포함하여 구성된 것을 특징으로 하는 공유 버스 시스템의 스케줄링 장치.And a plurality of terminals connected to the master via a shared bus and controlled. 마스터와 복수개의 터미널 간에 세마포어를 점유하는 제 1 단계와;A first step of occupying semaphores between the master and the plurality of terminals; 상기 제 1 단계에서 세마포어 점유 후 상기 복수개의 터미널의 개수 만큼의 큐를 사용해서 일정 시간 동안에 상기 복수개의 터미널로 메시지를 전송하고, 그 각각에 대해 응답을 받는 제 2 단계와;A second step of transmitting a message to the plurality of terminals for a predetermined time by using the number of queues of the plurality of terminals after semaphore occupation in the first step, and receiving a response to each of the plurality of terminals; 상기 제 2 단계가 완료되면 세마포어를 해제하는 제 3 단계를 포함하여 수행하는 것을 특징으로 하는 공유 버스 시스템의 스케줄링 방법.And a third step of releasing a semaphore when the second step is completed. 제 2 항에 있어서, 상기 제 2 단계는,The method of claim 2, wherein the second step, 세마포어를 잡을 큐를 선택할 때 라운드 로빈 방식으로 큐를 선택하는 것을 특징으로 하는 공유 버스 시스템의 스케줄링 방법.A method of scheduling a shared bus system, wherein the queue is selected in a round robin manner when selecting a queue to semaphore. 제 2 항에 있어서, 상기 제 2 단계는,The method of claim 2, wherein the second step, 세마포어를 잡을 큐를 선택할 때 각 큐에서 기다리는 메시지 중에서 맨 처음에 위치한 메시지들 중 대기 시간이 가장 긴 메시지를 포함하고 있는 큐가 먼저 서비스되도록 큐를 선택하는 것을 특징으로 하는 공유 버스 시스템의 스케줄링 방법.When selecting a queue to semaphore, the scheduling method of a shared bus system, characterized in that the queue is selected so that the queue containing the message with the longest waiting time among the first messages among the queued messages is serviced first. 제 2 항에 있어서, 상기 제 2 단계는,The method of claim 2, wherein the second step, 세마포어를 잡을 큐를 선택할 때 메시지에 우선순위를 설정하여 메시지의 우선순위에 따라 큐를 선택하는 것을 특징으로 하는 공유 버스 시스템의 스케줄링 방법.A method of scheduling a shared bus system, characterized in that when selecting a queue to semaphore, the queue is selected according to the priority of the message. 마스터로 메시지를 입력하고 메시지에서 추출한 목적지가 유효한지 판별하는 제 1 단계와;A first step of inputting a message to the master and determining whether the destination extracted from the message is valid; 상기 추출한 목적지가 유효하지 않으면 메시지를 재입력받고, 상기 추출한 목적지가 유효하면 목적지의 큐에 저장한 다음 세마포어를 점유하는 제 2 단계와;Receiving a message again if the extracted destination is not valid, and storing the semaphore after storing the message in a queue of the destination if the extracted destination is valid; 상기 제 2 단계 후 타임 오버가 되거나 큐에 보낼 메시지가 없을 때까지 메시지를 터미널로 전송하는 제 3 단계와;Transmitting a message to the terminal until the time-out after the second step or there is no message to be queued; 상기 제 13 단계가 완료되면 세마포어를 해제하는 제 4 단계를 포함하여 수행하는 것을 특징으로 하는 공유 버스 시스템의 스케줄링 방법.And a fourth step of releasing the semaphore when the thirteenth step is completed.
KR1020020072105A 2002-11-19 2002-11-19 Apparatus and method for scheduling in shared bus system KR100803450B1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
KR1020020072105A KR100803450B1 (en) 2002-11-19 2002-11-19 Apparatus and method for scheduling in shared bus system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020020072105A KR100803450B1 (en) 2002-11-19 2002-11-19 Apparatus and method for scheduling in shared bus system

Publications (2)

Publication Number Publication Date
KR20040043683A KR20040043683A (en) 2004-05-24
KR100803450B1 true KR100803450B1 (en) 2008-02-14

Family

ID=37340112

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020020072105A KR100803450B1 (en) 2002-11-19 2002-11-19 Apparatus and method for scheduling in shared bus system

Country Status (1)

Country Link
KR (1) KR100803450B1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7610463B2 (en) * 2004-10-22 2009-10-27 Qualcomm Incorporated Method and apparatus for performing an atomic semaphore operation
CN113064733A (en) * 2020-07-23 2021-07-02 浙江华云信息科技有限公司 LINUX message queue-based multi-application shared serial port communication method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06250910A (en) * 1993-02-24 1994-09-09 Nec Corp Management system for message queue incoming call
KR19980070448A (en) * 1997-01-10 1998-10-26 김영환 Multiple queue handling method and apparatus using joint processing algorithm
KR19990071122A (en) * 1998-02-27 1999-09-15 이종수 Multiprocessor circuit
KR19990077481A (en) * 1998-03-18 1999-10-25 포만 제프리 엘 Method and apparatus for performing a semaphore operation
US5996036A (en) * 1997-01-07 1999-11-30 Apple Computers, Inc. Bus transaction reordering in a computer system having unordered slaves
KR20000040598A (en) * 1998-12-18 2000-07-05 서평원 Method for periodically executing task by use of flag variable and semaphore
KR20010058316A (en) * 1999-12-27 2001-07-05 박종섭 Multi-tasking method of semiconductor apparatus with semaphore

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06250910A (en) * 1993-02-24 1994-09-09 Nec Corp Management system for message queue incoming call
US5996036A (en) * 1997-01-07 1999-11-30 Apple Computers, Inc. Bus transaction reordering in a computer system having unordered slaves
KR19980070448A (en) * 1997-01-10 1998-10-26 김영환 Multiple queue handling method and apparatus using joint processing algorithm
KR19990071122A (en) * 1998-02-27 1999-09-15 이종수 Multiprocessor circuit
KR19990077481A (en) * 1998-03-18 1999-10-25 포만 제프리 엘 Method and apparatus for performing a semaphore operation
KR20000040598A (en) * 1998-12-18 2000-07-05 서평원 Method for periodically executing task by use of flag variable and semaphore
KR20010058316A (en) * 1999-12-27 2001-07-05 박종섭 Multi-tasking method of semiconductor apparatus with semaphore

Also Published As

Publication number Publication date
KR20040043683A (en) 2004-05-24

Similar Documents

Publication Publication Date Title
US4679190A (en) Distributed voice-data switching on multi-stage interconnection networks
CN101341698B (en) Method and system to reduce interconnect latency
US4993018A (en) Self-routing switching system with multiple link connections between incoming and outgoing lines
US7173931B2 (en) Scheduling the dispatch of cells in multistage switches
US6977935B2 (en) Two-dimensional pipelined scheduling technique
CN1046076C (en) Multichannel ranodom access communications system
US4785446A (en) Distributed bit switching of a multistage interconnection network
US8750323B2 (en) Method for switching data and structure for switching data
CA2163342A1 (en) A cell switch and a method for routing cells therethrough
JPH09121217A (en) Method for burst transfer
JPH08293877A (en) Communication system
JP2001285291A (en) Arbitration system and arbiter circuit using it
AU2003218229B2 (en) Packet scheduling mechanism
US5285445A (en) Switching network and switching network control for a switching node in a wideband transmission system
US6055437A (en) Dynamic allocation of communication resources
US7103056B2 (en) Scheduling the dispatch of cells in multistage switches using a hierarchical arbitration scheme for matching non-empty virtual output queues of a module with outgoing links of the module
KR100803450B1 (en) Apparatus and method for scheduling in shared bus system
CN101253741A (en) Efficient message switching in a switching apparatus
KR100655290B1 (en) Methods and Apparatus for Transmission Queue in Communication Systems
JP2001285341A (en) Method for decentralized pipe line scheduling and system for the same
CN101626347B (en) Cell-switching method, and switching equipment and switching system
JP2752116B2 (en) Switching node
CN1444820A (en) Method for putting through at least one call having predeterminable priority
JP2583679B2 (en) Cell switching equipment
CN102761484B (en) Data channel method for sorting in a kind of light burst-switched

Legal Events

Date Code Title Description
N231 Notification of change of applicant
A201 Request for examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20130117

Year of fee payment: 6

FPAY Annual fee payment

Payment date: 20140115

Year of fee payment: 7

FPAY Annual fee payment

Payment date: 20150116

Year of fee payment: 8

LAPS Lapse due to unpaid annual fee