[go: up one dir, main page]

CN1326066C - Communication method and its device during process - Google Patents

Communication method and its device during process Download PDF

Info

Publication number
CN1326066C
CN1326066C CNB021545510A CN02154551A CN1326066C CN 1326066 C CN1326066 C CN 1326066C CN B021545510 A CNB021545510 A CN B021545510A CN 02154551 A CN02154551 A CN 02154551A CN 1326066 C CN1326066 C CN 1326066C
Authority
CN
China
Prior art keywords
communication
message
layer
unified
task
Prior art date
Legal status (The legal status 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 status listed.)
Expired - Fee Related
Application number
CNB021545510A
Other languages
Chinese (zh)
Other versions
CN1441366A (en
Inventor
尹宁铉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Samsung Electronics Co Ltd
Original Assignee
Samsung Electronics Co Ltd
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 Samsung Electronics Co Ltd filed Critical Samsung Electronics Co Ltd
Publication of CN1441366A publication Critical patent/CN1441366A/en
Application granted granted Critical
Publication of CN1326066C publication Critical patent/CN1326066C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Communication Control (AREA)

Abstract

从起始点到终点传递消息的过程间通信方法,该方法包括步骤:在操作系统独立访问(OIA)层提供一个操作系统统一的接口函数,该操作系统统一的接口函数对于通信装置的操作系统是可以独立访问的;在设备独立访问(DIA)层,提供一个设备统一的接口函数,该设备统一的接口函数对于通信装置的物理设备是可以独立访问的;以及在统一过程间通信(UIPC)层,通过操作系统独立访问层和设备独立访问层中的至少一个,使用由终点任务提供的关于终点的信息,以及使用基于该任务的基本公共控制流程(flow)的一个公共任务结构,从起始点到终点传递消息。

Figure 02154551

An inter-process communication method for delivering messages from a starting point to an end point, the method comprises the steps of: providing a unified interface function of an operating system at an operating system independent access (OIA) layer, and the unified interface function of the operating system is for the operating system of the communication device Can be independently accessed; at the device independent access (DIA) layer, a unified interface function of the device is provided, and the unified interface function of the device can be independently accessed for the physical device of the communication device; and at the unified inter-process communication (UIPC) layer , through at least one of the OS-independent access layer and the device-independent access layer, using information about the endpoint provided by the endpoint task, and using a common task structure based on the basic common control flow of the task, from the starting point Pass the message to the destination.

Figure 02154551

Description

过程间通信方法及其设备Inter-process communication method and device thereof

技术领域technical field

本发明涉及执行过程间通信(IPC)的通信系统。更具体地说,本发明涉及统一过程间通信(UIPC)的方法及其设备,它们独立于通信物理设备和操作系统。The present invention relates to a communication system implementing inter-process communication (IPC). More specifically, the present invention relates to a method of Unified Inter-Process Communication (UIPC) and devices thereof, which are independent of communicating physical devices and operating systems.

背景技术Background technique

过程间通信使用各种方法来实现过程间消息通信,例如,管道、旗语(semaphore)、消息队列,或共享的存储器。这些方法都是基于操作系统的。所以,提供具有基于操作系统的多种过程间通信方法是可能的。换而言之,过程间通信方法依操作系统而定。因此,每次要实现过程间通信和过程时,根据通信系统中用到的操作系统,应用软件要做相应的改变。同样,假设在硬件设备之间进行过程间通信,对于提供的不同的物理设备,要用到不同的物理设备驱动器。这样,对于一个使用设备驱动器的过程,过程间通信函数将要根据使用的设备驱动器的种类而改变。Inter-process communication uses various methods to implement inter-process message communication, such as pipes, semaphores, message queues, or shared memory. These methods are all OS-based. Therefore, it is possible to provide a variety of inter-process communication methods based on the operating system. In other words, the interprocess communication method depends on the operating system. Therefore, each time the inter-process communication and the process are to be realized, the application software needs to be changed accordingly according to the operating system used in the communication system. Likewise, assuming inter-process communication between hardware devices, different physical device drivers are used for different physical devices provided. Thus, for a process using a device driver, the inter-process communication function will be changed according to the kind of device driver used.

通信系统中的这种过程间通信方法依操作系统和物理设备。结果,当通信系统中的操作系统和物理设备变化时,系统开销(overhead)就重复地出现。这样不但恶化了软件的可重复使用性和可移植性,而且增加了相关行业开发新的通信系统时在时间和成本上的负担。Such inter-process communication methods in communication systems depend on operating systems and physical devices. As a result, overhead occurs repeatedly when operating systems and physical devices in the communication system change. This not only deteriorates the reusability and portability of the software, but also increases the burden of time and cost on the development of new communication systems for related industries.

发明内容Contents of the invention

因此,本发明的一个目的是提供灵活的统一过程间通信的方法及其设备,它们是独立于通信系统的操作系统和物理设备的。Therefore, an object of the present invention is to provide a flexible unified inter-procedural communication method and device thereof, which are independent of the operating system and physical devices of the communication system.

本发明的另外一个目的是提供一种统一过程间通信方法及其设备,不管通信系统中用到的操作系统怎样,都能够高可重复性和高可移植性地执行过程间通信。Another object of the present invention is to provide a unified inter-process communication method and apparatus thereof capable of performing inter-process communication with high repeatability and high portability regardless of the operating system used in the communication system.

本发明的又另一个目的就是提供一种独立于通信系统的物理设备的统一过程间通信的方法及其设备,Yet another object of the present invention is to provide a unified inter-process communication method and device thereof independent of physical devices of the communication system,

本发明的又另一个目是提供一种不管在通信装置中用到的通信方法(例如:异步传输模式(ATM)、因特网协议(IP)、同步数字序列(SDH),等等)的种类如何而从起始点向终点传递消息的通信装置。Still another object of the present invention is to provide a communication method regardless of the type of communication method (for example: Asynchronous Transfer Mode (ATM), Internet Protocol (IP), Synchronous Digital Hierarchy (SDH), etc.) used in the communication device. A communication device that transmits messages from a starting point to an end point.

为实现上述目的,提供了一种从起始点向终点传递消息的通信方法,该方法包括步骤:在操作系统独立访问(OIA)层提供一个统一操作系统接口函数,该统一操作系统接口函数对通信装置的操作系统是可独立访问的;在设备独立访问(DIA)层提供一个设备统一接口函数,该设备统一接口函数对通信装置的物理设备是可独立访问的;在统一过程间通信层,通过操作系统独立访问层和设备独立访问层中间的至少一个,从起始点向终点传递消息。For realizing above-mentioned object, provide a kind of communication method from starting point to terminal point, this method comprises the steps: provide a unified operating system interface function in operating system independent access (OIA) layer, this unified operating system interface function is to communication The operating system of the device is independently accessible; a device uniform interface function is provided at the device independent access (DIA) layer, and the device uniform interface function is independently accessible to the physical device of the communication device; at the unified inter-process communication layer, through At least one of the OS-independent access layer and the device-independent access layer transmits messages from the start point to the end point.

本发明的另一个方面是提供一种从起始点到终点传递消息的通信装置,该装置包括:用于提供操作系统统一接口功能的操作系统独立访问层,该操作系统统一接口功能对通信装置的操作系统是可独立访问的;提供设备统一接口功能的设备独立访问层,该设备统一接口功能对通信装置的物理设备是可独立访问的;统一过程间通信层,用于通过操作系统独立访问层和设备独立访问层中的至少一个,从起始点向终点传递消息。Another aspect of the present invention is to provide a communication device for transferring messages from a starting point to an end point, the device includes: an operating system independent access layer for providing a unified interface function of the operating system, and the unified interface function of the operating system has a significant impact on the communication device. The operating system is independently accessible; the device independent access layer that provides the unified interface function of the device, and the unified interface function of the device is independently accessible to the physical device of the communication device; the unified inter-process communication layer is used to access the layer independently through the operating system and at least one of the device-independent access layers to pass messages from the origin to the destination.

本发明的另一个方面是提供一种用于从起始点到终点传递消息的处理器间通信的方法,该方法包括的步骤:提供具有一个任务的基本公共控制流程的一个公共任务结构,作为统一过程间通信的一个接口;如果一个起始任务使用公共任务结构来提供一条消息和关于终点的信息,就基于关于终点的信息,确定该消息是一块卡内的处理器间通信消息,还是卡之间的处理器内部通信消息;如果该消息属于卡之间的处理器内部通信消息,那么把这条消息传递到统一过程间通信协议堆栈的一个队列进行路由;如果该消息属于一块卡内的处理器间通信消息,那么通过由操作系统独立访问层提供的应用程序接口库,把消息传递到卡内的相对应的任务的一个消息队列。Another aspect of the present invention is to provide a method of interprocessor communication for passing messages from a start point to an end point, the method comprising the steps of: providing a common task structure with a basic common control flow of a task, as a unified An interface for interprocess communication; if an originating task uses the common task structure to provide a message and information about the destination, based on the information about the destination, it is determined whether the message is an interprocessor communication message within a card or between cards Inter-processor communication message between cards; if the message belongs to the inter-processor communication message between cards, then pass this message to a queue of the unified inter-process communication protocol stack for routing; if the message belongs to a process within a card Inter-device communication messages, then pass the message to a message queue of the corresponding task in the card through the application program interface library provided by the independent access layer of the operating system.

在本发明的实施例中需要注意的一件事是:象“过程”、“应用”、或“任务”这些术语可以互换使用,他们都是指存在于统一过程间通信层的上部的任务。One thing to note in embodiments of the present invention is that terms like "process", "application", or "task" are used interchangeably to refer to tasks that exist on top of the unified interprocess communication layer .

附图说明Description of drawings

通过下面结合附图的详细描述,本发明的上述的以及其它目的、特点和优点将会会变得更显而易见。The above and other objects, features and advantages of the present invention will become more apparent through the following detailed description in conjunction with the accompanying drawings.

图1是根据本发明的一个优选实施例的在每一个架间交换消息的网络的原理图;Fig. 1 is a schematic diagram of a network exchanging messages between each rack according to a preferred embodiment of the present invention;

图2是根据本发明的优选实施例的应用了统一过程间通信的通信系统的详细配置的示范图;2 is an exemplary diagram of a detailed configuration of a communication system to which unified inter-process communication is applied according to a preferred embodiment of the present invention;

图3是根据本发明的优选实施例的包括作为一个组件的统一过程间通信的公共软件平台的结构图;3 is a block diagram of a common software platform including unified inter-process communication as a component according to a preferred embodiment of the present invention;

图4是根据本发明的优选实施例的表示每一个卡(每一个单元)的统一过程间通信配置的方框图;4 is a block diagram representing a unified inter-process communication configuration for each card (each unit) according to a preferred embodiment of the present invention;

图5是使用公共任务结构的过程的流程图,即,一个任务的基本控制流程图;Figure 5 is a flow diagram of a process using a common task structure, i.e., a basic control flow diagram of a task;

图6是解释根据本发明的优选实施例的统一过程间通信应用程序接口(API)配置和公共任务结构的方框图。FIG. 6 is a block diagram illustrating a unified inter-process communication application program interface (API) configuration and common task structure according to a preferred embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图,在此对本发明的一个优选实施例进行描述。在下面的描述里,众所周知的功能或结构就不再详细描述,由于它们可能在不必要的细节上让本发明变得不清楚。Hereinafter, a preferred embodiment of the present invention will be described with reference to the accompanying drawings. In the following description, well-known functions or constructions are not described in detail since they would obscure the invention in unnecessary detail.

下面的外文文献揭示了本发明的背景和附加的信息,对理解本发明的原理有帮助。The following foreign language documents disclose the background and additional information of the present invention, which are helpful for understanding the principle of the present invention.

Open Systems Interconnection,Basic Reference Model(开放系统互连,基本参考模型),ITU-T X.200;Open Systems Interconnection, Basic Reference Model (Open Systems Interconnection, Basic Reference Model), ITU-T X.200;

Open Systems Interconnection,Data Link Service Definition(开放系统互连,数据链路业务定义),ITU-T X.212;Open Systems Interconnection, Data Link Service Definition (Open Systems Interconnection, Data Link Service Definition), ITU-T X.212;

Open Systems Interconnection,Network Service Definition(开放系统互连,网络业务定义),ITU-T X.213;以及Open Systems Interconnection, Network Service Definition (Open Systems Interconnection, Network Service Definition), ITU-T X.213; and

Open Systems Interconnection,Transport Service Definition(开放系统互连,传输业务定义),ITU-T X.214。Open Systems Interconnection, Transport Service Definition (Open Systems Interconnection, Transport Service Definition), ITU-T X.214.

图1是在每一个架之间交换消息的网络的原理图,体现了本发明的原理。图中描述的网络拓扑包括元素管理系统(EMS)8、装备了包括卡12在内的多个卡的系统控制器架10、装备有智能设备6以及包括卡22a在内的多个卡的第一扩充架201、装备有包括卡22b在内的多个卡的第二扩充架20b、装备有包括卡22c在内的多个卡的第三扩充架30c。Figure 1 is a schematic diagram of a network exchanging messages between each shelf, embodying the principles of the present invention. The network topology depicted in the figure includes an element management system (EMS) 8, a system controller shelf 10 equipped with a plurality of cards including card 12, a second rack equipped with smart devices 6 and a plurality of cards including card 22a. An expansion shelf 201, a second expansion shelf 20b equipped with a plurality of cards including the card 22b, and a third expansion shelf 30c equipped with a plurality of cards including the card 22c.

参考图1,由于第三扩充架20c可以和系统控制器架10之间进行通信,虽然第三扩充架20c和系统控制器架10之间的通信可以物理地通过第二扩充架20b,但是根据本发明的原理,第三扩充架20c和系统控制器架10之间存在一个虚拟的直接信道。Referring to FIG. 1, since the third expansion shelf 20c can communicate with the system controller shelf 10, although the communication between the third expansion shelf 20c and the system controller shelf 10 can physically pass through the second expansion shelf 20b, according to According to the principle of the present invention, there is a virtual direct channel between the third expansion shelf 20c and the system controller shelf 10 .

图1主要是为了解释应用了本发明的统一过程间通信功能的网络配置。尽管稍后将参照图2做详尽的描述,粗略描述本发明的统一过程间通信就是:它支持每一个卡上任务间的消息交换,同一架上不同卡的任务之间的消息交换,以及某一特定架和附属的智能设备6(例如,数字用户线调制解调器和统一访问设备)的任务之间的消息交换。应当注意的是上面描述的功能是基于这样的假设,即,如果必要的话,系统控制器架10决定两个架间的将要传递的消息的路径。这样简化了全部协议,减少了与协议相关的象因特网协议处理一个更一般的网络拓扑结构那样的系统开销。同样,消息可以发送到元素管理系统8和一个架上的特定卡之间的路径上。至于涉及的统一过程间通信,元素管理系统8象另一个架一样工作。FIG. 1 is mainly for explaining a network configuration to which the unified inter-process communication function of the present invention is applied. Although it will be described in detail later with reference to FIG. 2, a rough description of the unified interprocess communication of the present invention is that it supports message exchange between tasks on each card, message exchange between tasks on different cards on the same shelf, and some Message exchange between tasks of a particular rack and attached intelligent devices 6 (eg DSL modems and unified access devices). It should be noted that the functions described above are based on the assumption that the system controller shelf 10 decides, if necessary, the routing of messages to be delivered between two shelves. This simplifies the overall protocol and reduces the overhead associated with the protocol as the Internet Protocol handles a more general network topology. Likewise, messages can be sent on the path between the element management system 8 and a particular card on a rack. As far as unified interprocess communication is concerned, the element management system 8 works like another rack.

图2说明了应用本发明的统一过程间通信功能的通信系统的详细的配置。FIG. 2 illustrates a detailed configuration of a communication system to which the unified inter-process communication function of the present invention is applied.

图2中的扩充架20i是图1中描述的多个扩充架中的一个,而系统控制器架10是用来控制多个扩充架20a、20b和20c的架。每一个架10、20i包括多个控制卡14、16、24和26,和用来控制多个控制卡14、16、24和26的主控制卡12、22。对每一个控制卡14、16、24、26和主控制卡12、22都提供了统一过程间通信30作为过程间消息通信的公共软件平台32的部分组件。统一过程间通信30是为过程间消息通信提供一条信道的装置,这些消息通信是在卡上的过程间、卡之间、架上、和架之间进行的。每一个统一过程间通信30都象图2中所示的P1、P2那样连接到过程(应用任务)上。The expansion shelf 20i in FIG. 2 is one of the plurality of expansion shelves described in FIG. 1, and the system controller shelf 10 is a shelf for controlling the plurality of expansion shelves 20a, 20b, and 20c. Each shelf 10 , 20i includes a plurality of control cards 14 , 16 , 24 and 26 , and a main control card 12 , 22 for controlling the plurality of control cards 14 , 16 , 24 and 26 . For each control card 14, 16, 24, 26 and master control card 12, 22 a unified interprocess communication 30 is provided as part of a common software platform 32 for interprocess message communication. Unified interprocess communication 30 is a means of providing a channel for interprocess message communication between processes on a card, between cards, on a shelf, and between shelves. Each unified interprocess communication 30 is connected to a process (application task) like P1, P2 shown in FIG. 2 .

如图2中所示,统一过程间通信30有三种格式:“卡内的过程通信(处理器内部通信)”、“一个架内的卡之间的过程通信(处理器间通信)”、“架之间的过程通信(处理器间通信)”。尤其是,“一个架内的卡之间的过程通信(处理器间通信)”和“架之间的过程通信(处理器间通信)”需要一个单独的物理设备驱动器。As shown in FIG. 2, the unified interprocess communication 30 has three formats: "process communication within a card (interprocessor communication)", "process communication between cards within a rack (interprocessor communication)", " Process communication between racks (interprocessor communication)". In particular, "process communication between cards within one rack (interprocessor communication)" and "process communication between racks (interprocessor communication)" require a separate physical device driver.

图3是部分包括作为一个组件体现本发明的原理的统一过程间通信30的公共软件平台32的方框图。FIG. 3 is a block diagram of a common software platform 32 that includes, in part, unified interprocess communication 30 as a component embodying the principles of the present invention.

图3中描述的公共软件平台32是用于提供可应用到很多不同的通信系统的一般的和公共功能。公共软件平台32存在于图2中所说明的单元10、20中的卡12、14、16、22、24和26中的每一个,并且,它的组件被划分为多个功能单元。The common software platform 32 depicted in Figure 3 is intended to provide generic and common functionality applicable to many different communication systems. A common software platform 32 exists in each of the cards 12, 14, 16, 22, 24 and 26 in the units 10, 20 illustrated in Figure 2, and its components are divided into functional units.

如图3中所示,公共软件平台32大致上可以分成水平排列的组件(其后,称为水平组件)和垂直排列的组件(其后,称为垂直组件)。更具体地,诸如公共代理40、公共操作管理和维护(OAM)42、统一过程间通信30、设备独立访问层46、物理设备驱动器48、实时操作系统(RTOS)50和硬件52之类的水平组件,都是各种通信系统所需要的公共功能块,它们特定的技术功能都由垂直组件提供的。另一方面,诸如异步传输模式(ATM)56、同步数字序列(SDH)+准同步数字序列(PDH)58、分组语音(VoP)160之类的垂直组件,都是根据通信系统的种类所需要的技术功能块。和前面类似,垂直组件的技术功能由水平组件提供,并且,它们根据通信系统的种类而不同。例如,在其它水平组件中的公共操作管理和维护42是为通信系统的管理和维护特别提供报警、收集操作(performance)数据、管理操作数据。所以,如果公共操作管理和维护42做一些与异步传输模式相关的处理,例如为一个异步传输模式相关的通信系统提供一个异步传输模式相关的警报或收集操作数据,那么一个垂直设备,精确地说是异步传输模式56提供这些数据。在使用或增加一个商业软件的情况下,就使用图2中带有斜线的功能块50、162、164、166、168和170。As shown in FIG. 3 , the common software platform 32 can be roughly divided into components arranged horizontally (hereinafter, referred to as horizontal components) and components arranged vertically (hereinafter, referred to as vertical components). More specifically, levels such as common agent 40, common operations management and maintenance (OAM) 42, unified interprocess communication 30, device independent access layer 46, physical device drivers 48, real-time operating system (RTOS) 50, and hardware 52 Components are common functional blocks required by various communication systems, and their specific technical functions are provided by vertical components. On the other hand, vertical components such as Asynchronous Transfer Mode (ATM) 56, Synchronous Digital Hierarchy (SDH) + Pseudo-Synchronous Digital Hierarchy (PDH) 58, Voice over Packet (VoP) 160 are required according to the type of communication system technical function blocks. Similar to before, the technical functions of the vertical components are provided by the horizontal components, and they differ according to the type of communication system. For example, common operation management and maintenance 42 among other horizontal components is providing alarms, collecting performance data, managing operation data especially for management and maintenance of the communication system. So, if Common Operations Management and Maintenance 42 does some ATM-related processing, such as providing an ATM-related alarm or collecting operational data for an ATM-related communication system, then a vertical device, precisely It is Asynchronous Transfer Mode 56 that provides these data. In the case of using or adding a commercial software, the function blocks 50, 162, 164, 166, 168 and 170 with oblique lines in Fig. 2 are used.

上部模块,即,从图3中所示的“公共代理40”到“公共操作管理和维护42”都依赖于软件的应用。The upper modules, ie, from "common agent 40" to "common operation management and maintenance 42" shown in Fig. 3 are all dependent on the application of software.

通常地,各种通信系统包括一个如图3中所示的公共软件平台32,并且,通信系统致力在将来实现的所有应用,都将以公共软件平台32提供的垂直组件与水平组件相结合的功能的形式来开发。Generally, various communication systems include a common software platform 32 as shown in FIG. Functional form to develop.

下面解释了图3中所示的公共软件平台32的水平组件的具体功能:The specific functions of the horizontal components of the common software platform 32 shown in FIG. 3 are explained below:

1.操作系统独立访问层541. Operating system independent access layer 54

它提供了操作系统统一接口功能,用于应用和统一过程间通信30的实现,使得可以独立访问操作系统(OS)而不依赖如实时操作系统50的任何操作系统。结果,增强了应用和统一过程间通信30的可移植性。换一句话说,软件应用和统一过程间通信30可以在不同的通信系统中被不同的操作系统重复使用。It provides an operating system unified interface function for implementation of application and unified inter-process communication 30 so that an operating system (OS) can be independently accessed without depending on any operating system such as a real-time operating system 50 . As a result, portability of applications and UPC 30 is enhanced. In other words, software applications and UPC 30 can be reused by different operating systems in different communication systems.

2.设备独立访问层462. Device Independent Access Layer 46

通过隐藏物理设备驱动器48的更具体的部分,为各种设备提供了一种公共模型,那就是,设备统一接口功能,这使得可以实现对不同设备的独立访问而不依赖该设备。这是设备独立访问层46的益处,现在,即使改变象图3中所示的硬件52这样的硬件芯片,也可以重复使用该应用和统一过程间通信30/操作系统独立访问层54。By hiding the more specific parts of the physical device driver 48, a common model is provided for various devices, that is, the device uniform interface function, which enables independent access to different devices without depending on the device. This is the benefit of the device independent access layer 46, now the application and UIPC 30/operating system independent access layer 54 can be reused even if the hardware chip like the hardware 52 shown in FIG. 3 is changed.

3.统一过程间通信303. Unified Interprocess Communication 30

依照用于过程间通信的操作系统、如实时操作系统50的底层软件、和底层硬件52,通过隐藏关于过程间通信机制的细节信息,当为了实现一个应用而改变操作系统时,不特别地需要单独的任务。Depending on the operating system used for inter-process communication, the underlying software such as the real-time operating system 50, and the underlying hardware 52, by hiding detailed information about the inter-process communication mechanism, when changing the operating system to implement an application, it is not particularly necessary separate tasks.

4.公共操作管理和维护424. Public operation management and maintenance 42

为各种类型的通信系统的操作、管理和维护提供了一种公共方法。Provides a common method for the operation, management and maintenance of various types of communication systems.

5、公共代理软件405. Public proxy software 40

为了通信系统中的更有效的网络操作,为外部网络操作系统提供了一个接口。For more efficient network operation in the communication system, an interface is provided to the external network operating system.

简言之,通过提供不需要从事特定功能的公共功能,公共软件平台32的存在主要是为了实现一种软件结构,该软件结构对不同种类的通信系统是可以重复使用的,并且是独立于操作系统和硬件设备的。并且,统一过程间通信30是用来实现过程间消息通信方法的公共软件平台32的一个组件。In short, the common software platform 32 exists primarily to enable a software structure that is reusable for different kinds of communication systems and is independent of the operating systems and hardware devices. Also, the unified inter-process communication 30 is a component of the common software platform 32 for implementing the inter-process message communication method.

到此为止,为了更好的理解本发明,对公共软件平台32已经进行了描述。从现在起,将对统一过程间通信30的配置和它的功能进行详细的解释。So far, the public software platform 32 has been described for better understanding of the present invention. From now on, the configuration of the unified inter-process communication 30 and its functions will be explained in detail.

与图2中相似,统一过程间通信30在每一个控制单元,即控制卡12、14、16、22、24和26内工作。主要是在一块卡内、一个架上、或不同的架中的过程间提供一个消息通信功能。Similar to FIG. 2 , UPC 30 operates within each of the control units, ie control cards 12 , 14 , 16 , 22 , 24 and 26 . It mainly provides a message communication function between processes in a card, on a rack, or in different racks.

通过本发明的统一过程间通信30的消息通信,需要应用识别符(ID)APP_ID和网络地址N_ADDR。应用识别符APP_ID是一个用来对通信区别有关过程的识别符,网络地址N_ADDR是表示有关过程的物理地址的一个地址值。网络地址N_ADDR尺寸为4字节,并包括柜-架-槽-端口(rack-shelf-slot-port)信息。所以,通过使用网络地址N_ADDR就可以容易地获得相对应的过程的物理地址。网络地址N_ADDR只给统一过程间通信30使用一个架和槽(卡就固定在这里)识别符,柜和端口识别符用于其它目的。再参考图2,举一个例子,一个消息从系统主控制器架10的主控制卡12的过程1(P1)传递到扩充架20i的主控制卡22的过程1(P1)。假设系统控制器架10的识别符是“1”,扩充架20的识别符是“2”,而主控制卡12、22的槽识别符是“22”。首先,起始点和终点应用识别符APP_ID分别是P1。然后,起始网络地址N_ADDR是16进制数“0x00010200”(柜-架-槽-端口),终点网络地址N_ADDR也是16进制数“0x00020200”(柜-架-槽-端口)。当把网络地址N_ADDR和应用识别符APP_ID与网络协议相比较时,就会发现网络地址N_ADDR近似对应于一个因特网协议地址,而应用识别符APP_ID对应于一个传输控制协议(TCP)的端口号。Message communication through the unified inter-process communication 30 of the present invention requires an application identifier (ID) APP_ID and a network address N_ADDR. The application identifier APP_ID is an identifier for distinguishing the relevant process for communication, and the network address N_ADDR is an address value indicating the physical address of the relevant process. The network address N_ADDR has a size of 4 bytes and includes rack-shelf-slot-port (rack-shelf-slot-port) information. Therefore, the physical address of the corresponding process can be easily obtained by using the network address N_ADDR. The network address N_ADDR only uses a rack and slot (where the card is fixed) identifier for the unified interprocess communication 30, the cabinet and port identifiers are used for other purposes. Referring to FIG. 2 again, as an example, a message is transferred from the process 1 (P1) of the main control card 12 of the system main control shelf 10 to the process 1 (P1) of the main control card 22 of the expansion shelf 20i. Assume that the identifier of the system controller shelf 10 is "1", the identifier of the expansion shelf 20 is "2", and the slot identifiers of the main control cards 12 and 22 are "22". First, the start point and end point application identifiers APP_ID are P1 respectively. Then, the start network address N_ADDR is the hexadecimal number "0x00010200" (cabinet-rack-slot-port), and the end network address N_ADDR is also the hexadecimal number "0x00020200" (cabinet-rack-slot-port). When comparing the network address N_ADDR and the application identifier APP_ID with the network protocol, it is found that the network address N_ADDR approximately corresponds to an Internet Protocol address, and the application identifier APP_ID corresponds to a Transmission Control Protocol (TCP) port number.

下面是体现本发明的原理的统一过程间通信30的功能。The following are the functions of the unified inter-process communication 30 embodying the principles of the present invention.

统一过程间通信30传递一个双向的消息到网络组件中任何地方的任务。UPC 30 delivers a bidirectional message to tasks anywhere in the network components.

统一过程间通信30允许应用异步传递消息。应用程序接口给出一个没有阻塞的立即响应。Unified Inter-Process Communication 30 allows applications to pass messages asynchronously. The API gives an immediate response without blocking.

统一过程间通信30允许任务在暂时停止工作时,传递消息和同步地响应。Unified Interprocess Communication 30 allows tasks to pass messages and respond synchronously when they are temporarily out of work.

统一过程间通信30提取出一个底层物理传输机制。UPC 30 abstracts an underlying physical transport mechanism.

统一过程间通信30提供用于广播消息的机制。Unified Inter-Process Communication 30 provides a mechanism for broadcasting messages.

统一过程间通信30使得低层的统一过程间通信协议可变而不改变高层协议,反之亦然。UPC 30 enables the lower-level UPC protocol to be changed without changing the higher-level protocol, and vice versa.

统一过程间通信30检测基于链接到链接的传输错误,并对错误的分组进行再选取。这意味着用于控制每一个链接的协议的数据链路层应该可以做可靠的链接。UPC 30 detects link-to-link based transmission errors and reselects erroneous packets. This means that the data link layer of the protocol used to control each connection should be able to make reliable connections.

公共统一过程间通信应用程序接口是用在处理器内部通信和外部过程通信。The Common Unified Interprocedural Communication API is used for inter-processor communication and external process communication.

公共统一过程间通信30分割并重新组装大容量的消息。Common Unified Interprocedural Communication 30 splits and reassembles large volumes of messages.

统一过程间通信30提供一个能输出纠错的机制。UPC 30 provides a mechanism for outputting error correction.

统一过程间通信协议参数在运行期间也可以配置。UIP parameters are also configurable during runtime.

统一过程间通信30提供用来给每一个链接指派最大的传输单元的机制。UC 30 provides a mechanism to assign a maximum transmission unit to each link.

统一过程间通信30支持具有可变最大传输单元的链接。UC 30 supports links with variable maximum transmission units.

统一过程间通信30支持关于实时敏感消息的消息优先级。Unified Inter-Process Communication 30 supports message prioritization for real-time sensitive messages.

统一过程间通信30是独立于操作系统的。UC 30 is operating system independent.

统一过程间通信30使得消息透明地从控制器通过,并最终到达固定在卡上的设备。UIPC 30 enables messages to pass transparently from the controller and ultimately to the device affixed to the card.

虽然统一过程间通信30从起始点向终点传递消息,只要涉及到消息的内容,它就充当一个应用。这样,对于特定的系统消息,不提供表示机制。系统消息的表示机制类似一个表示层,但是根据本发明的统一过程间通信30并不包括表示层,因为统一过程间通信30是针对实时协议。Although UPC 30 transfers messages from origin to destination, it acts as an application as far as the contents of the messages are concerned. Thus, no presentation mechanism is provided for specific system messages. The presentation mechanism of the system message is similar to a presentation layer, but the UPC 30 according to the present invention does not include a presentation layer because the UPC 30 is for a real-time protocol.

图4是表示每一个卡(每一个单元)的统一过程间通信30的配置的图,体现了本发明的原理。应该理解,在图中,“任务”和“过程”是可以互换使用的。FIG. 4 is a diagram showing the configuration of the unified inter-process communication 30 per card (each unit), embodying the principle of the present invention. It should be understood that in the figures, "task" and "process" are used interchangeably.

参照图4,包括在每一个卡(单元)内的统一过程间通信30可以大致分为统一过程间通信应用程序接口60和统一过程间通信协议堆栈70。这样就可以更加有效的区分需要统一过程间通信协议堆栈70的处理器间的通信和不需要统一过程间通信协议堆栈70的处理器内部的通信。具体地说,处理器间通信是一种情况,其中,其网络地址N_ADDR不是它自身,这样,消息应该从它的卡上传递到另外一块卡上,而处理器内部通信是另一种情况,其中,其网络地址N_ADDR就是其本身,这样,消息直接传递到卡内部一个对应的任务。同时,统一过程间通信应用程序接口60以一种库的形式提供,从一个任务调用。大体上,任务调用统一过程间通信应用程序接口60来收发消息,与统一过程间通信协议堆栈70通信,以控制处理器间通信的消息。Referring to FIG. 4 , the UPC 30 included in each card (unit) can be roughly divided into a UPC API 60 and a UPC protocol stack 70 . In this way, it is possible to more effectively distinguish between inter-processor communication requiring the UIP stack 70 and inter-processor communication not requiring the UIP stack 70 . Specifically, inter-processor communication is a case where its network address N_ADDR is not itself, so that a message should pass from its card to another card, and inter-processor communication is another case, Wherein, its network address N_ADDR is itself, so that the message is directly delivered to a corresponding task inside the card. Meanwhile, the UPC API 60 is provided in the form of a library to be called from a task. In general, tasks call the UPC API 60 to send and receive messages, and communicate with the UPC protocol stack 70 to control interprocessor communication messages.

首先,将参照图4进一步详细解释根据本发明的优选实施例的统一过程间通信应用程序接口60。First, the unified inter-process communication API 60 according to the preferred embodiment of the present invention will be explained in further detail with reference to FIG. 4 .

统一过程间通信应用程序接口60Unified Interprocess Communication API 60

统一过程间通信应用程序接口60是一个公共库,可以被任何种类的任务(过程)共享,并且提供与统一过程间通信30提供的每一个内部操作相关的一个接口。换句话说,统一过程间通信应用程序接口60提供一个接口,使得任意类型的应用任务都能够使用统一过程间通信功能。另外,统一过程间通信应用程序接口60决定了基于网络地址N_ADDR和应用软件识别符APP_ID的过程间和过程内部通信路径。在这期间,统一过程间通信应用程序接口60对处理器内部通信并不使用统一过程间通信协议堆栈70。而且,统一过程间通信应用程序接口60搜索出网络地址N_ADDR,试图找出相对应的应用任务(过程)的物理地址,并且,如果涉及处理器内部通信,那么将消息通过由图3的操作系统独立访问层54提供的操作系统独立访问应用程序接口直接传递到一个相对应的任务(过程)的消息队列。另一方面,如果涉及处理器间通信,统一过程间通信应用程序接口60把消息传递到统一过程间通信协议堆栈70的一个消息队列,来选定到达目的地的路径。The UPC API 60 is a common library that can be shared by any kind of tasks (processes), and provides an interface related to each internal operation provided by the UPC 30 . In other words, the UPC API 60 provides an interface that enables any type of application task to use the UPC function. In addition, the unified inter-process communication API 60 determines the inter-process and intra-process communication paths based on the network address N_ADDR and the application software identifier APP_ID. In the meantime, the UPC API 60 does not use the UPC protocol stack 70 for inter-processor communication. Furthermore, the UPC API 60 searches out the network address N_ADDR, tries to find the physical address of the corresponding application task (process), and, if inter-processor communication is involved, sends the message through the The operating system independent access application program interface provided by the independent access layer 54 is directly delivered to the message queue of a corresponding task (process). On the other hand, if interprocessor communication is involved, the UPC API 60 passes the message to a message queue of the UPC protocol stack 70 to route the message to the destination.

统一过程间通信应用程序接口60对任务(应用)提供的最有重要的功能中的一个就是公共软件平台32的一个公共任务结构,它使得任务可以使用统一过程间通信。根据本发明的公共任务结构的主要功能如下面所列:One of the most important functions that UPC API 60 provides to tasks (applications) is a common task structure of common software platform 32, which enables tasks to use UPC. The main functions of the public task structure according to the present invention are listed below:

1.开发者不需要再重新设计任务结构。1. The developer does not need to redesign the task structure.

2.在一个呼叫者的任务上执行异步回呼功能。2. Execute an asynchronous callback function on a caller's task.

3.开发者不必致力于公共组件(例如,公共操作管理和维护)和应用的集成。3. Developers do not have to work on the integration of common components (eg, common operation management and maintenance) and applications.

4.基于消息队列方法的任务间的通信现在变为可能,因为这是所有操作系统都提供的公共过程间通信机制。4. Inter-task communication based on the message queue method is now possible because this is a common inter-process communication mechanism provided by all operating systems.

在公共软件平台32的组件中(水平组件+垂直组件),特别是统一过程间通信层30的上层块的软件应用,例如,公共代理任务40、公共操作管理和维护任务42等等,通过使用体现本发明的原理的公共任务结构而成功实现。图5是使用具有上述的那四个功能的公共任务结构的一个任务(过程)的基本的公共控制流程。Among the components of the common software platform 32 (horizontal components + vertical components), especially the software applications of the upper block of the unified inter-process communication layer 30, for example, the common agent task 40, the common operation management and maintenance task 42, etc., by using This was achieved successfully through a common task structure embodying the principles of the present invention. FIG. 5 is a basic common control flow of a task (process) using the common task structure having the above-mentioned four functions.

参照图5,任务等待一个使用队列的消息。任务异步地接收消息(S100),对接收到的消息进行解码和分析(S102),执行消息处理(S104)。如果需要单独的处理,则任务就处理其它特定的应用(S106),然后等待返回到步骤100的消息。Referring to Figure 5, a task waits for a message using a queue. A task receives a message asynchronously (S100), decodes and analyzes the received message (S102), and performs message processing (S104). If separate processing is required, the task processes other specific applications (S106), and then waits for a message back to step 100.

表1和表2示出了传统的继承任务结构与具有根据本发明的如图5中所示的一个基本公共控制流程的任务的公共任务结构的比较结果。如表1中所说明的,由于传统的继承任务不是一个公共结构,它将会按照开发者和任务操作被单独设计成不同的格式。所以,即使在开发期间任务是值得考虑的系统开销,但它必须重新设计。相反,如下面的表2中所示的,根据本发明的公共任务结构实现了具有如图5中所示那样的任务的基本的公共控制流程,这里避免了系统开销。用这种方式,可以大大缩短开发时间。Table 1 and Table 2 show the results of comparison between the traditional inherited task structure and the common task structure of tasks with a basic common control flow as shown in FIG. 5 according to the present invention. As illustrated in Table 1, since the traditional inherited task is not a public structure, it will be individually designed into different formats according to developer and task operations. So, even though the task is worth considering overhead during development, it has to be redesigned. In contrast, as shown in Table 2 below, the common task structure according to the present invention implements a basic common control flow with tasks as shown in FIG. 5, where system overhead is avoided. In this way, the development time can be shortened considerably.

[表1][Table 1]

<继承任务结构><Inheritance Task Structure>

    performanceTaskMain(){/*任务初始化和组件库初始化*/performanceTaskInit();/*在主队列上永远循环接受消息*/ performanceTaskMain(){/*Task initialization and component library initialization*/performanceTaskInit();/*Receive messages on the main queue forever*/

    FOREVERrcvMsg(myQ,&pMsg)switch(msgType)case PERFORMANCE_TYPE_MSG调用执行组件库以处理消息case MY_MSGS处理消息end switch/*接收下一条消息之前的其它处理*/}/*taskMain结束*/ FOREVERrcvMsg(myQ,&pMsg) switch(msgType) case PERFORMANCE_TYPE_MSG calls the execution component library to process the message case MY_MSGS processes the message end switch/*Other processing before receiving the next message*/}/*taskMain ends*/

[表2][Table 2]

<公共任务结构><common task structure>

    taskMain(){/*任务初始化和组件库初始化*/Uipc_InitTaskContext();/*创建一个可以被一个任务用于UIPC的消息队列*/Uipc_CreateQueue(MY_APP_ID,&hMyQueue);/*一个任务的Uipc_RcvLoop()在这个队列上等待接收消息*/Uipc_SetmainQueue(hMyQueue);/*将要接收一个特定类的消息的寄存器*/Uipc_RegisterMsgHandler(MY_MSG_CLASS,&MyMessageHandler);/*Uipc_RcvLoop()将在处理完消息后,当队列里没有消息时,调用寄存的空闲处理器(handler)*/Uipc_RegisterIdleHandler(&MyIdleHandler)/*在主队列上永远循环接收消息*/Uipc_RcvLoop();} taskMain(){/*Task initialization and component library initialization*/Uipc_InitTaskContext();/*Create a message queue that can be used by a task for UIPC*/Uipc_CreateQueue(MY_APP_ID, &hMyQueue);/*Uipc_RcvLoop() of a task in Waiting to receive messages on this queue*/Uipc_SetmainQueue(hMyQueue);/*Registers that will receive messages of a specific class*/Uipc_RegisterMsgHandler(MY_MSG_CLASS,&MyMessageHandler);/*Uipc_RcvLoop() will process the message, when there is no message in the queue , call the registered idle handler (handler)*/Uipc_RegisterIdleHandler(&MyIdleHandler)/*receive messages on the main queue forever*/Uipc_RcvLoop();}

现在参照图6对表2中描述的公共任务结构进行详细的描述。The common task structure described in Table 2 will now be described in detail with reference to FIG. 6 .

图6是根据本发明的统一过程间通信应用程序接口的配置和公共任务结构的一个示范图。参照图6,每一个卡的主要任务在统一过程间通信的内部产生类似表3中所示的一个全局的信息表,并产生服务任务,任务1和任务2,这些任务执行它们自己特定的功能(例如:报警任务、操作任务等等)。FIG. 6 is an exemplary diagram of the configuration and common task structure of the UPC API according to the present invention. Referring to Figure 6, the main task of each card generates a global information table similar to that shown in Table 3 within the unified interprocess communication, and generates service tasks, task 1 and task 2, which perform their own specific functions (Example: alarm task, operation task, etc.).

[表3][table 3]

 任务识别符 task identifier  应用识别符 application identifier   用于任务的动态消息处理器表的指针 A pointer to the dynamic message handler table for the task  用于任务的静态消息处理器表的指针 A pointer to the static message handler table for the task  用于任务的动态消息类表的指针 A pointer to the dynamic message class table for the task  用于任务的空闲消息处理器指针 Free message handler pointer for the task  Uipc_RcvLoop()内使用的等待时间 The waiting time used in Uipc_RcvLoop()

为了更多地解释统一过程间通信内部的统一过程间通信全局信息表,该全局信息表包括关于在一个特定卡上的所有任务的信息。全局信息表的每一个入口是一个任务控制块(TSB)。假定每一个任务控制块都有统一指定的信息。To explain more about the UIPC global information table within UPC, the global information table contains information about all tasks on a particular card. Each entry in the global information table is a task control block (TSB). It is assumed that each task control block has uniformly specified information.

任务控制块的第一字段是‘任务识别符’。任务控制块的第二字段是‘应用识别符’,这就是任务的“主队列”的“应用识别符”。The first field of the task control block is the 'task identifier'. The second field of the task control block is the 'Application Identifier', which is the 'Application Identifier' of the task's 'Main Queue'.

每一个任务都有一个动态消息处理器表、一个静态消息处理器表、和一个动态消息类表。每当任务调用Uipc_RegisterOneTimeApi(),就在动态消息处理器表里创建一个入口。动态消息处理器表中的这种任务不是固定的。实际上,只要从应用程序接口接收到响应,该入口就被删除。通过使用平衡的二进制树,可以实现该动态消息处理器表。无论何时,当一个任务创建Uipc_RegisterMsgHandler()时,就在该静态消息处理器表内创建一个入口。这里,该静态消息处理器表专用于一个监控程序(supervisor)的应用程序接口。与动态消息处理器表中的入口不一样,静态消息处理器表中的入口是固定的。这样,该静态消息处理器表可以通过使用数组实现。Each task has a dynamic message handler table, a static message handler table, and a dynamic message class table. Whenever a task calls Uipc_RegisterOneTimeApi(), an entry is created in the dynamic message handler table. Such tasks in the list of dynamic message handlers are not fixed. In fact, the entry is deleted whenever a response is received from the API. This dynamic message handler table can be implemented by using a balanced binary tree. Whenever a task creates Uipc_RegisterMsgHandler(), an entry is created in the static message handler table. Here, the static message handler table is dedicated to an application program interface of a supervisor (supervisor). Unlike the entries in the dynamic message handler table, the entries in the static message handler table are fixed. Thus, the static message handler table can be implemented using an array.

无论何时,当一个任务调用Uipc_GenerateTempMsgClass()时,该消息类返回到上述的任务,任何必要的更新都在动态消息类表中进行,使得一个特定的消息类处于繁忙状态(busy)。同样,无论何时,当该任务调用Uipc_FreeTempMsgClass()时,统一过程间通信对动态消息类表中做必要的修正,使得一个特定的消息类对后面的一个使用是可获得的。动态消息类表被实现为另外的一个数组。Whenever a task calls Uipc_GenerateTempMsgClass(), the message class returns to the above task and any necessary updates are made in the dynamic message class table to make a particular message class busy. Also, whenever the task calls Uipc_FreeTempMsgClass(), UPC makes the necessary updates to the dynamic message class table to make a particular message class available for a subsequent use. The dynamic message class table is implemented as another array.

全局信息表包括用于每一个上述的表的指针。而且,全局信息表包括用于任务的‘空闲消息处理器’功能的指针。全局信息表也包括潜伏(latency)时间,该潜伏时间被假定为用于仅仅每一个任务的Uipc_RcvLoop()中。在Uipc_RcvLoop API内,将对全局信息表审查潜伏时间。既然每一个任务对全局信息表都是可访问的,一个指定的旗语信号就保护该全局信息表。这种旗语信号在Uipc_InitCardContext()期间产生。The global information table includes a pointer for each of the above tables. Furthermore, the global information table includes pointers to the 'idle message handler' functions of the tasks. The global information table also includes the latency, which is assumed to be used only in Uipc_RcvLoop() of each task. Within the Uipc_RcvLoop API, latency is checked against the global info table. Since every task has access to the global information table, a designated semaphore signal protects the global information table. This semaphore is generated during Uipc_InitCardContext().

再参考图6,在统一过程间通信应用程序接口中,Uipc_InitCardContext()被假定是根据本发明对统一过程间通信30进行初始化的。由主任务运行的Uipc_InitCardContext()指定一块存储器以使用统一过程间通信30,并产生一个数据内部结构。这里,Uipc_InitCardContext()应该为每一个卡(单元)只调用一次。Referring again to FIG. 6, in the UIP, Uipc_InitCardContext() is assumed to initialize UIP 30 according to the present invention. Uipc_InitCardContext( ) run by the main task specifies a block of memory to use UIP 30 and creates a data internal structure. Here, Uipc_InitCardContext() should be called only once for each card (unit).

关于从属任务task1和task2的公共任务结构将进行进一步的解释,task1和task2由主任务产生。A further explanation will be given regarding the common task structure of the slave tasks task1 and task2, which are spawned by the master task.

在公共任务结构内,无论何时,当产生一个任务来帮助许多的任务,以使之能够使用统一过程间通信30相互通信时,Uipc_InitTaskContext()就指定一个全局信息表,并寄存指定到全局表入口的全局信息表。同样,Uipc_InitTaskContext()为每一个任务应该只能被调用一次。Within the common task structure, Uipc_InitTaskContext() specifies a global information table and registers the assignment to the global table The entry's global information table. Also, Uipc_InitTaskContext() should only be called once for each task.

Uipc_CreateQueue(TASK1_APP_ID,&Task1Queue)创建一个队列来帮助每一个任务,以使之可以使用统一过程间通信来接收消息。Uipc_CreateQueue(TASK1_APP_ID,&Task1Queue)将一个创建的队列识别符寄存到用于任务的应用识别符的队列表中。Uipc_CreateQueue(TASK1_APP_ID, &Task1Queue) creates a queue to help each task to receive messages using unified interprocess communication. Uipc_CreateQueue(TASK1_APP_ID, &Task1Queue) registers a created queue ID into the queue table for the task's application ID.

Uipc_SetmainQueue(hTask1Queue)将一个相对应的队列设置为用于接收消息的一个主队列。一旦作为主队列被寄存起来,它将在Uipc_RcvLoop()内部被用作消息等待队列。Uipc_SetmainQueue(hTask1Queue) sets a corresponding queue as a main queue for receiving messages. Once registered as the main queue, it will be used as a message waiting queue inside Uipc_RcvLoop().

Uipc_RegisterMsgHandler(TASK1_MSG_CLASS,&Task1MessageHandler)将用来处理从一个任务接收到的消息的消息(消息类)和用于消息处理的处理器函数(handler function)寄存到一个全局信息表中。它们用于处理在Uipc_RcvLoop()内部接收到的消息。Uipc_RegisterMsgHandler(TASK1_MSG_CLASS, &Task1MessageHandler) registers the message (message class) used to process the message received from a task and the handler function (handler function) used for message processing into a global information table. They are used to process messages received inside Uipc_RcvLoop().

当一个任务要执行除消息处理外其它功能时,Uipc_RegisterIdleHandler(&Task1IdleHander)将处理器函数寄存到一个全局信息表中,当没有从Uipc_RcvLoop()接收到任何消息时,执行给定的一个另外的工作。When a task wants to perform functions other than message processing, Uipc_RegisterIdleHandler(&Task1IdleHander) registers the handler function into a global information table, and when no message is received from Uipc_RcvLoop(), it executes a given other work.

一个任务从主队列接收消息并处理这些接收到的消息的过程是在Uipc_RcvLoop()中进行的。它从不回应,但内部执行一个无限的循环。而且,它执行象消息接收/消息解码/消息处理/附加工作这样的事情。The process of a task receiving messages from the main queue and processing these received messages is carried out in Uipc_RcvLoop(). It never responds, but internally executes an infinite loop. Also, it does things like message reception/message decoding/message processing/additional work.

现在参照图4对统一过程间通信30的统一过程间通信协议堆栈70进行详细描述。The UIPC protocol stack 70 of the UIPC 30 will now be described in detail with reference to FIG. 4 .

统一过程间通信协议堆栈70Unified Interprocess Communication Protocol Stack 70

统一过程间通信协议堆栈70是用于处理器间的通信。当统一过程间通信应用程序接口60使用出自统一过程间通信协议堆栈70的一个队列传递消息时,就进行处理器间的通信。统一过程间通信协议堆栈70需要一个路由库,用于基于应用识别符APP_ID和网络地址N_ADDR来决定消息的路由。为进行路由,统一过程间通信应用程序接口60使用应用识别符APP_ID和网络地址N_ADDR调用由路由库提供的应用程序接口,并决定接收到的消息属于哪一种,即,处理器间的消息或处理器内部的消息。如果是一个处理器间的消息,统一过程间通信应用程序接口60将该消息发送到统一过程间通信协议堆栈70的一个队列中。典型地,这个协议堆栈符合开放系统互连(OSI)模型,但是在本发明中,它并非支持所有的7个层,而是只支持其中的3层。更具体地讲,体现本发明原理的统一过程间通信协议堆栈70支持数据链路层72、网络层74、和传输层76。数据链路层72有一个数据链接队列,而网络层74有一个网络队列,以及传输层76有一个传输队列。The UPCP stack 70 is used for inter-processor communication. Interprocessor communication occurs when the UPC API 60 passes messages using a queue from the UPC protocol stack 70 . The UIP stack 70 requires a routing library for determining the routing of messages based on the application identifier APP_ID and the network address N_ADDR. For routing, the UPC API 60 uses the application identifier APP_ID and the network address N_ADDR to call the API provided by the routing library and decide which type the received message belongs to, i.e., an interprocessor message or Processor internal messages. If it is an interprocessor message, the UPC API 60 sends the message to a queue in the UPC protocol stack 70 . Typically, this protocol stack conforms to the Open Systems Interconnection (OSI) model, but in the present invention, it does not support all 7 layers, but only 3 of them. More specifically, the unified interprocess communication protocol stack 70 embodying the principles of the present invention supports a data link layer 72 , a network layer 74 , and a transport layer 76 . The data link layer 72 has a data link queue, while the network layer 74 has a network queue, and the transport layer 76 has a transmit queue.

那三个层的操作将会在稍后做详细的解释。然而,在对每层做进一步的细节描述之前,有必要引入应用到每层的一些一般要求。这样做的目的是为了实现上述的层。The operation of those three layers will be explained in detail later. However, before describing each layer in further detail, it is necessary to introduce some general requirements that apply to each layer. The purpose of doing this is to realize the above-mentioned layers.

首先,每一层的头部(header)应该包括一个协议鉴别器。该鉴别器表明是否有一个特定的协议或一个协议的组合伴随着这条消息。通常,该协议鉴别器在头部包括2比特或3比特。这种实现不需要改变其它协议就可以进行。例如,被网络层74处理的接收到的消息在它的网络层的头部具有一个协议鉴别器,该协议鉴别器指示下一步那个协议模块将要处理该消息。如果统一过程间通信想要支持类似传输控制协议或用户数据报协议(UDP)那样的传输层协议,则协议鉴别器就通知网络层74这个消息是否要传递到传输控制协议或用户数据报协议模块。这时,用户数据报协议就参考提供数据报服务的因特网标准网络层、传输层和会话层协议。与传输控制协议类似,用户数据报协议也是因特网协议的顶层的一个无连接的协议。First, the header of each layer should include a protocol discriminator. The discriminator indicates whether a particular protocol or a combination of protocols is accompanying the message. Typically, the protocol discriminator includes 2 or 3 bits in the header. This implementation can be done without changing other protocols. For example, a received message processed by the network layer 74 has a protocol discriminator in its network layer header that indicates which protocol module is to process the message next. If UPC intends to support a transport layer protocol like Transmission Control Protocol or User Datagram Protocol (UDP), the Protocol Discriminator informs Network Layer 74 whether the message is to be delivered to the Transmission Control Protocol or User Datagram Protocol module . In this case, the User Datagram Protocol refers to the Internet standard network layer, transport layer, and session layer protocols that provide datagram services. Similar to Transmission Control Protocol, User Datagram Protocol is also a connectionless protocol on top of the Internet Protocol.

有些协议层依赖于其它层,或者说它们也不能够独立的使用。例如,D信道链路访问过程(LAPD),一种数据链路层协议,依赖于物理高级数据链路控制(HDLC)层。这里,“D信道链路访问过程”意思是D信道上的一个链接访问过程。Some protocol layers depend on other layers, or they cannot be used independently. For example, D-channel Link Access Procedure (LAPD), a data link layer protocol, relies on the physical high-level data link control (HDLC) layer. Here, "D channel link access procedure" means a link access procedure on D channel.

每层都具有一个消息优先权。所以,具有高优先权的消息或段(段:如果一个消息足够长,就要对它进行分段)就在其它消息和段之前传递。最好是,两个优先权,即,本发明中引入了“普通”和“高级”优先权,因为进一步的划分只会把事情弄得更混乱。但是,如果有必要的话,在任何时候都可以对优先权进行另外划分。Each layer has a message priority. Therefore, messages or segments (segments: if a message is long enough, it is segmented) with high priority are delivered before other messages and segments. Preferably, two priorities, ie, "normal" and "superior" priorities are introduced in the present invention, because further divisions would only confuse things more. However, another allocation of priorities can be made at any time if necessary.

此外,每一层可以定义具体的控制消息,这些控制消息在一个端点的相同层之间交换。这些控制消息与一个层协商协议参数或允许一个层来执行一个流程控制。In addition, each layer can define specific control messages, which are exchanged between the same layer at an endpoint. These control messages negotiate protocol parameters with a layer or allow a layer to enforce a flow control.

下面将描述每一个协议层的特征和职责。每一部分都有一个由每一层提供的原语(primitive)列表。这些原语是假定用来显示对另外的软件提供的外部接口(即,下一个协议层)。它们不必解释在两个端点之间通信的实际消息。同样,对于这些消息以及它们的状态机构的定义,也不需要解释,因为当一个更具体的设计建立起来时,它们将会被定义。The characteristics and responsibilities of each protocol layer are described below. Each part has a list of primitives provided by each layer. These primitives are assumed to expose an external interface to additional software (ie, the next protocol layer). They do not have to interpret the actual messages communicated between the two endpoints. Also, the definition of these messages and their state machinery needs no explanation, as they will be defined when a more concrete design is built.

这些原语将依照国际电联(ITU)的术语系统来命名,并将按如下所示划分为“请求”、“响应”、“指示”和“确认”。These primitives will be named according to the terminology of the International Telecommunication Union (ITU) and will be divided into "request", "response", "indication" and "confirmation" as shown below.

请求:它的意思是一个层应该支持的一项功能,通常是该层的下一层调用它来请求某一个操作。Request: It means a function that a layer should support, usually the next layer of the layer calls it to request a certain operation.

响应:当收到一个请求回应的命令时,它被一个远处或远程的终端调用。从而,上面‘请求’的请求者将接收该确认。Response: It is invoked by a remote or remote terminal when a command requesting a response is received. Thus, the requester of the above 'request' will receive the acknowledgment.

指示:它是一个通知,用来告知一件事情发生了。通常,它指示向上数的下一层,或表示由稍后产生的代码接收这种命令。大部分的‘指示’都是远处(远程)终端通过一个‘请求’初始化一个操作的结果。Indication: It is a notification that something has happened. Usually, it indicates the next level up, or indicates that such commands are received by code generated later. Most 'indications' are the result of a remote (remote) terminal initiating an operation via a 'request'.

确认:它是响应‘请求’的一个证实。Acknowledgment: It is a confirmation of the response to the 'request'.

每一个原语都有这样的数据,这些数据有一个指定的与之相关的原语。对于通过层之间的原语的机制,由于它是层的详细设计的一部分,在这里将不做详细的说明。Every primitive has data that has a specific primitive associated with it. The mechanism for passing primitives between layers will not be described in detail here since it is part of the detailed design of the layers.

另一方面,意识到定义一个最大传输单元(MTU)的必要性是非常重要的。最大传输单元定义了一个最大消息尺寸。任何比最大尺寸小的的消息都可以作为单个的消息进行传递。On the other hand, it is very important to be aware of the need to define a Maximum Transmission Unit (MTU). The maximum transmission unit defines a maximum message size. Any message smaller than the maximum size can be delivered as a single message.

实际上,确定最大传输单元就是一个应用设计的一部分。所以,它不是作为统一过程间通信的一部分来定义的。然而,要指定最大传输单元,统一过程间通信定义了一个只对统一过程间通信组件可见的内部应用程序接口。最大传输单元的确定是基于用于执行一个应用的请求、消息被假定采用的跳(hop)的数目(跳:一个路由器与另一个路由器之间的段)、以及当前使用的通信链接速率。In fact, determining the maximum transmission unit is part of an application design. So, it's not defined as part of Unified Interprocedural Communication. However, to specify the maximum transfer unit, UPC defines an internal API that is only visible to UPC components. The determination of the maximum transmission unit is based on the request to execute an application, the number of hops the message is supposed to take (hop: the segment between one router and another router), and the communication link speed currently in use.

在用于从一个节点到下一个节点指引消息路径的网络可能存在很多复杂的问题。例如,如果每跳的最大传输单元不一样,就必须要采取一些措施来解决这种不平衡。问题是,当一个节点传递具有大的最大传输单元的消息,并且这条消息是通过超出一跳之后的另一个节点用一个小的最大传输单元进行广播时,经常会出现问题。当然,对于一个特定的节点来说,要知道消息经过的每一个链接的最大传输单元是非常困难的。事实上,一个起始的节点甚至可能不知道这条消息将被传递到哪一条链接。所有的起始节点所知道的是如何把消息发送到下一个节点。所以,每一个节点的协议堆栈应该可以克服在连接到一个相对应的节点上的链接的最大传输单元大小上的差异。网络层74有分段功能,在稍后的“网络层74”部分中将会描述。它将被用来把一个大的最大传输单元分段成小的最大传输单元。如果网络层不执行分段,一个端到端的连接可以作为一个选择而尝试,其中,所有的节点都参与确定最大传输单元的讨论。然而不幸的是,这种方法会产生系统开销,并且对于无连接的消息没有什么效果。There can be many complexities in the network used to direct the path of messages from one node to the next. For example, if the maximum transmission unit of each hop is not the same, some measures must be taken to resolve this imbalance. The problem is that problems often arise when a node delivers a message with a large MTU, and the message is broadcast by another node one hop later with a small MTU. Of course, for a specific node, it is very difficult to know the maximum transmission unit of each link that the message passes through. In fact, an originating node might not even know which link the message will be delivered to. All the starting node knows is how to send the message to the next node. Therefore, each node's protocol stack should be able to overcome the difference in the maximum transmission unit size of the link connected to a corresponding node. The network layer 74 has a segmentation function, which will be described later in the "Network layer 74" section. It will be used to fragment a large MTU into smaller MTUs. If the network layer does not perform segmentation, an end-to-end connection can be attempted as an option, where all nodes participate in the discussion of determining the maximum transmission unit. Unfortunately, this approach incurs overhead and is ineffective for connectionless messages.

数据链路层72Data Link Layer 72

在统一过程间通信协议堆栈70支持的三层中,首先对数据链路层72进行解释。数据链路层72连接端点间的一个数据链接,并且负责链接之间的无差错数据传输,以及提供下面的这些操作。Among the three layers supported by the UIP stack 70, the data link layer 72 is explained first. The data link layer 72 connects a data link between endpoints, and is responsible for error-free data transmission between links, and provides the following operations.

1、通过提供数据优先权而进行排队。1. Queuing by providing data priority.

2、通过提供一个流程控制而支持数据的平稳收发。2. Support the smooth sending and receiving of data by providing a process control.

3、支持无差错数据传输。3. Support error-free data transmission.

4、提供无连接的模式和面向连接模式,并且在面向连接的模式下,进行数据链接的连接/释放。4. Provide a connectionless mode and a connection-oriented mode, and perform data link connection/release in the connection-oriented mode.

5、当存在错误时,可以重发相对应的数据。5. When there is an error, the corresponding data can be resent.

表4是在数据链路层72上的面向连接的模式的原语的一个内容和它们的描述,该数据链路层至少需要面向连接的数据链接。表5所示的是在数据链路层72上的无连接模式的原语的一个内容和它们的描述,该数据链路层至少需要无连接的数据链接。Table 4 is a content and their description of the primitives of the connection-oriented mode on the data link layer 72, which requires at least connection-oriented data links. Shown in Table 5 is a content and their description of the primitives of the connectionless mode on the data link layer 72, which requires at least a connectionless data link.

[表4][Table 4]

<数据链路层72上的面向连接的模式的原语以及它们的描述><Primitives of Connection-Oriented Mode on Data Link Layer 72 and Their Descriptions>

  服务 Serve   原语 Primitives 描述 describe   链接建立 link building   DL-CONNECT请求 DL-CONNECT request 它初始化到一个远程端点或到一个物理信道的连接。 It initiates a connection to a remote endpoint or to a physical channel.   DL-CONNECT指示 DL-CONNECT instruction 当一个远程端点初始化一个到这里的连接时,它就被接收到 It is received when a remote endpoint initiates a connection to this   DL-CONNECT应答 DL-CONNECT response 它被DL-CONNECT指示接收器调用,以接受该连接 It is called by the DL-CONNECT indication receiver to accept the connection   DL-CONNECT确认 DL-CONNECT confirmation 通知连接的发起点,一个远程的端点接受了该连接。 Notifies the originator of the connection that a remote endpoint has accepted the connection.   正常数据传输 normal data transmission   DL-DATA请求 DL-DATA request 由发送器用于传输数据。 Used by the transmitter to transmit data.   DL-DATA指示 DL-DATA instruction 被发送到接收器用于数据接收 is sent to the receiver for data reception   链接释放 link release   DL-DISCONNECT请求 DL-DISCONNECT request 发送器或接收器都可以初始化连接释放。不需响应。 Either sender or receiver can initiate connection release. No response required.   DL-DISCONNECT指示 DL-DISCONNECT instruction 在远程端点释放连接时,就接收它。 When the remote endpoint releases the connection, it is accepted.

[表5][table 5]

<数据链路层72上的无连接模式的原语以及它们的描述><Primitives of connectionless mode on data link layer 72 and their description>

  服务 Serve   原语 Primitives 描述 describe   链接建立 link building   DL-DATA请求 DL-DATA request 发送器用它进行数据传递。 The sender uses it for data transfer.   DL-DATA指示 DL-DATA instruction 接收器用它进行数据接收。 The receiver uses it for data reception.

下面解释的是由统一过程间通信协议堆栈70支持的三个层中的网络层74。网络层74在处理器间通信的处理器间负责消息的路由。下面描述网络层72的功能。The network layer 74 of the three layers supported by the unified interprocess communication protocol stack 70 is explained below. Network layer 74 is responsible for the routing of messages between processors for inter-processor communication. The function of the network layer 72 is described below.

1、它提供一个消息路由功能。1. It provides a message routing function.

它基于网络地址N_ADDR确定消息路由。更具体地讲,网络层决定一个消息是应该作为一个过程的消息被发送到一个传输层,还是应该经过另一个接口传递以到达最终的目的地。It determines message routing based on network address N_ADDR. More specifically, the network layer decides whether a message should be sent to a transport layer as a process message, or should be passed through another interface to reach its final destination.

2、它支持消息分段和重组。2. It supports message segmentation and reassembly.

消息进行路由时,在消息被送到具有跟该数据链路层不同的最大传输单元的接口的情况下,就要对消息进行分段和重组。When a message is routed, it is fragmented and reassembled if the message is sent to an interface with a different maximum transmission unit than the data link layer.

3、它执行一个无状态操作。3. It performs a stateless operation.

由于网络层74不支持消息重传功能,它执行一个没有状态机制的无状态操作。当一个消息被发送时,无论接收器是否接收到了这个消息,这个发送的消息并不被保存,最后将消失。如果需要在端点间更可靠地发送/接收消息,需要将它置于传输层76。Since the network layer 74 does not support message retransmission functionality, it performs a stateless operation with no state mechanism. When a message is sent, no matter whether the receiver receives the message or not, the sent message is not saved and will eventually disappear. It needs to be placed in the transport layer 76 if it is required to send/receive messages more reliably between endpoints.

统一过程间通信30定义了附加的地址相关原语,以便具有可以执行上述的网络层74的操作的接口。下面的表6是网络层74的原语的内容及其描述。UPC 30 defines additional address-related primitives to have an interface that can perform the operations of network layer 74 described above. Table 6 below is the content of the primitives of the network layer 74 and their descriptions.

[表6][Table 6]

<在网络层74上的原语及其描述><primitives and their descriptions on the network layer 74>

  服务 Serve   原语 Primitives 描述 describe   普通数据传输 Ordinary data transfer   N-DATA请求 N-DATA request 发送器用它进行数据发送 The transmitter uses it for data transmission   N-DATA指示 N-DATA indication 接收器用它进行数据接收 The receiver uses it for data reception

最后,对统一过程间通信协议堆栈70支持的三个层中的传输层76进行解释。大体上,传输层76负责任务间的端到端的通信。下面关于传输层76的功能做更多的解释。Finally, the transport layer 76 of the three layers supported by the UIP stack 70 is explained. In general, the transport layer 76 is responsible for end-to-end communication between tasks. The function of the transport layer 76 will be explained more below.

1、它提供消息路由功能。1. It provides message routing function.

它将接收到的消息发送到目的应用。最后,传输层76负责基于应用识别符APP_ID建立一个路由表。该路由表可以通过一个统一过程间通信应用程序接口60使用的内部应用程序接口形成。It sends received messages to the destination application. Finally, the transport layer 76 is responsible for building a routing table based on the application identifier APP_ID. The routing table may be formed through an internal API used by the UPC API 60 .

2、它提供无连接模式和面向连接模式。在下层(例如,数据链路层)保障端到端的可靠性来减少通信过程中的系统开销的条件下,就用到无连接模式。所以,在无连接的模式下,如在数据链路层72中,根本不检查目标应用是否接收到了消息。另一方面,在面向连接模式下,端到端的应用的连接应该被建立起来,以便可以发送/接收消息,在功能方面,它与传输控制协议的一个插口(socket)类似。另外,由于面向连接的模式有额外的系统开销,并且在建立/释放连接的时候非常的复杂,最好不要过于经常地使用这种模式,尤其是当一个低层具有比较低的可靠性以及当对实时通信请求的要求并不很多的时候。2. It provides connectionless mode and connection-oriented mode. The connectionless mode is used under the condition that the lower layer (for example, the data link layer) guarantees end-to-end reliability to reduce the system overhead in the communication process. Therefore, in connectionless mode, as in the data link layer 72, there is no check at all whether the target application has received the message. On the other hand, in the connection-oriented mode, the end-to-end application connection should be established so that messages can be sent/received. In terms of function, it is similar to a socket of Transmission Control Protocol. In addition, because the connection-oriented mode has additional system overhead and is very complicated when establishing/releasing connections, it is best not to use this mode too often, especially when a lower layer has relatively low reliability and when the When there are not many requests for real-time communication requests.

3、它提供消息多路复用功能。3. It provides message multiplexing function.

当从许多的应用那里接收到大量消息时,传输层76基于起始点的网络地址N_ADDR组合这些消息,并把这些组合的消息传递到一个相对应的应用。When receiving a large number of messages from many applications, the transport layer 76 combines the messages based on the network address N_ADDR of the origin and delivers the combined messages to a corresponding application.

表7是在传输层76的面向连接的模式的原语的内容和它的描述,它是一个外部接口功能所要求的。表8是在传输层76中的无连接的模式的原语的内容及其描述,它是一个外部接口功能所要求的。Table 7 is the content and description of the primitives of the connection-oriented mode at the transport layer 76, which are required by an external interface function. Table 8 is the content and description of the primitives of the connectionless mode in the transport layer 76, which are required by an external interface function.

[表7][Table 7]

<在传输层76中的面向连接的模式的原语和它们的描述><Primitives of connection-oriented mode in transport layer 76 and their description>

  服务 Serve   原语 Primitives 描述 describe   链接建立 link building   T-CONNECT请求 T-CONNECT request 它初始化到一个应用的连接。它的响应与队列处理器相联系。 It initiates a connection to an application. Its responses are associated with queue handlers.   T-CONNECT指示 T-CONNECT instruction 当一个远程端点初始化到一个应用连接时,它就被接收。 It is received when a remote endpoint initiates a connection to an application.   T-CONNECT响应 T-CONNECT response 它被T-CONNECT指示接收器调用,以接受该连接。 It is called by the T-CONNECT indication receiver to accept the connection.   T-CONNECT确认 T-CONNECT confirmation 它通知连接的发起点,一个远程端点接受了该连接。 It notifies the originator of the connection that a remote endpoint has accepted the connection.   正常数据传递 Normal data transfer   T-DATA请求 T-DATA request 它被发送器用来进行数据发送。 It is used by the transmitter for data transmission.   T-DATA指示 T-DATA indication 它被接收器用来进行数据接收。 It is used by the receiver for data reception.   链接释放 link release   T-DISCONNECT请求 T-DISCONNECT request 发送器或接收器都可以初始化连接释放。不需响应 Either sender or receiver can initiate connection release. no response required   T-DISCONNECT指示 T-DISCONNECT instruction 当远程端点释放该连接时,它就被接收。 It is accepted when the remote endpoint releases the connection.

[表8][Table 8]

<在传输层76中的无连接的模式的原语及其描述><primitives and descriptions of connectionless mode in transport layer 76>

  服务 Serve   原语 Primitives 描述 describe   正常数据传输 normal data transmission   T-DATA请求 T-DATA request 发送器用它进行数据发送。 The transmitter uses it for data transmission.   T-DATA指示 T-DATA indication 接收器用它进行数据接收。 The receiver uses it for data reception.

下面将参照图1到图6说明体现本发明原理的用于从起始任务向终止任务传递消息数据的一般过程。A general procedure for transferring message data from an initiating task to a terminating task embodying the principles of the present invention will now be described with reference to FIGS. 1 to 6 .

为传递一条消息到一个目的任务,起始任务就调用函数Uipc_SendMsg(数据,目的地址),该函数可以从统一过程间通信应用程序接口提供目的任务的网络地址N_ADDR、应用识别符APP_ID和消息数据。其后,该任务将目的任务的网络地址N_ADDR、应用软件识别符APP_ID、和消息数据载入到函数Uipc_SendMsg(数据,目的地址),统一过程间通信应用程序接口60决定该目的地址,即,网络地址N_ADDR是否和它自己卡上的网络地址一样。如果是一样的,也就是说,如果目的地址,或网络地址,就是它自己卡上的网络地址,那么,处理器内部通信统一过程间通信把消息传递到目的地。但是,如果目的地址与它自己卡上的网络地址不一样,那么,处理器间的通信统一过程间通信把消息传递到目的地。如果载入到函数Uipc_SendMsg(数据,目的地址)的网络地址N_ADDR是它自己卡上的网络地址,即,为处理器内部通信统一过程间通信,那么,统一过程间通信应用程序接口60通过操作系统独立访问应用程序接口库直接把消息传递到卡内的目的任务的一个消息队列,该操作系统独立访问应用程序接口库由图3中的操作系统独立访问层54提供。在涉及到处理器内部通信统一过程间通信的情况下,协议堆栈70根本就用不着。同时,由于已经接收到了消息,通过使用Uipc_RcvLoop()函数,基于图5和图6中所示的公共任务结构的基本公共控制流程,目的任务就控制诸如消息接收、消息解码、消息处理和按照请求由任务单独执行的其它处理之类的相关的操作。To deliver a message to a destination task, the initial task calls the function Uipc_SendMsg(data, destination address), which can provide the network address N_ADDR, application identifier APP_ID and message data of the destination task from the UPC API. Thereafter, the task loads the network address N_ADDR, the application software identifier APP_ID, and the message data of the target task into the function Uipc_SendMsg (data, destination address), and the UIP 60 determines the destination address, that is, the network Whether the address N_ADDR is the same as the network address on its own card. If it is the same, that is, if the destination address, or network address, is the network address on its own card, then inter-processor communication unifies inter-process communication to deliver the message to the destination. However, if the destination address is not the same as the network address on its own card, then the inter-processor communication unifies the inter-process communication to deliver the message to the destination. If the network address N_ADDR loaded into the function Uipc_SendMsg(data,destination address) is the network address on its own card, i.e., the unified interprocess communication for processor internal communication, then the unified interprocess communication API 60 is passed through the operating system The independent access application programming interface library directly transfers messages to a message queue of the purpose task in the card, and the operating system independent access application programming interface library is provided by the operating system independent access layer 54 in FIG. 3 . In cases involving inter-processor communication and inter-process communication, the protocol stack 70 is not used at all. Meanwhile, since the message has been received, by using the Uipc_RcvLoop() function, based on the basic common control flow of the common task structure shown in Fig. 5 and Fig. 6, the destination task controls such as message reception, message decoding, message processing and following Related operations such as other processing performed by tasks alone.

另一方面,如果目的地址,或网络地址N_ADDR,与它自己卡上的网络地址不一样,也就是说,如果是处理器间的通信统一过程间通信,那么,统一过程间通信应用程序接口60把消息传递到统一过程间通信协议堆栈70的一个消息队列,用于进行到一个外部目的地的路由搜索。更具体地说,统一过程间通信应用程序接口60把消息传递到统一过程间通信协议堆栈70的一个传递队列。然后,传输层76就引导针对发送到传递队列的消息的传输层的具体操作,并处理这些消息,以及把处理过的消息发送到网络层74的一个网络队列。网络层74引导针对发送到网络队列中的网络层的具体操作,并把这些消息传递到数据链路层72的一个数据链接队列。类似的,数据链路层72引导针对发送到数据链接队列中的消息的数据链路层的具体操作,并把这些消息传递到设备独立访问层(请参照图3中的46)、通过设备独立访问层(请参照图3中的46)发送到目的卡上的设备驱动器48、发送到设备驱动器48。On the other hand, if the destination address, or network address N_ADDR, is not the same as the network address on its own card, that is, if the communication between processors is uniform interprocess communication, then the UIP 60 The message is passed to a message queue of the UPCP stack 70 for routing search to an external destination. More specifically, the UPC API 60 passes the message to a delivery queue of the UPC protocol stack 70 . The transport layer 76 then directs the transport layer specific operations for the messages sent to the delivery queues, processes these messages, and sends the processed messages to a network queue of the network layer 74. Network layer 74 directs network layer specific operations for sending to network queues and passes these messages to a data link queue of data link layer 72 . Similarly, the data link layer 72 guides the specific operation of the data link layer for messages sent to the data link queue, and passes these messages to the device independent access layer (please refer to 46 in FIG. 3 ), through the device independent The access layer (please refer to 46 in FIG. 3 ) is sent to the device driver 48 on the destination card, and sent to the device driver 48 .

以后,发送到目的卡的设备独立访问层(请参照图3的46)、设备驱动器48的消息通过协议层70的数据链路层72、网络层74和传输层76被发送到目的任务。同样,网络地址N_ADDR和应用识别符APP_ID可以被用来识别目的卡和目的任务。相应的,通过使用由统一过程间通信应用程序接口库提供的Uipc_RcvLoop()函数,基于图5和图6中所示的公共任务结构的基本控制流程,目的任务控制诸如消息接收、消息解码、消息处理和按照请求由任务单独执行的其它处理之类的相关的操作。Afterwards, the message sent to the device independent access layer (please refer to 46 of FIG. 3 ), device driver 48 of the destination card is sent to the destination task through the data link layer 72 of the protocol layer 70, the network layer 74 and the transport layer 76. Likewise, the network address N_ADDR and the application identifier APP_ID can be used to identify the destination card and the destination task. Correspondingly, by using the Uipc_RcvLoop() function provided by the unified interprocess communication API library, based on the basic control flow of the common task structure shown in Figure 5 and Figure 6, the purpose task controls such as message reception, message decoding, message Related operations such as processing and other processing performed individually by tasks as requested.

下面的表9说明了关于Uipc_SendMsg(数据,目的地址)函数的一段程序,这段程序在一个任务里执行,该函数已经被统一过程间通信应用程序接口60调用。Table 9 below illustrates a program for the Uipc_SendMsg(data, destination address) function, which is executed in a task, and which has been called by the UPC API 60.

[表9][Table 9]

    Uipc_S endMsg(data,destinationAddress){if(destinationAddress==myAddress)/*卡(单元)内的任务的统一过程间通信{1.得到目的队列识别符->DestQueue2.通过操作系统独立访问用DestQueue把数据发送到另外一个任务->Oia_WriteQByld(DestQueue,AppDAta);}else/*任务的统一过程间通信在卡(单元)之间{ Uipc_S endMsg(data, destinationAddress){if(destinationAddress==myAddress)/*communication between the unified process of the task in the card (unit) {1. Get the destination queue identifier->DestQueue2. Use the DestQueue to transfer the data through the independent access of the operating system Send to another task->Oia_WriteQByld(DestQueue, AppDAta); }else /*UPC for tasks between cards (units){

    把数据送到“统一过程间通信堆栈传递任务队列”->us_AL_Transmit_TL(AppData){Oia_WriteQByld(TransportQueue,AppData); Send the data to the "unified inter-process communication stack transfer task queue" ->us_AL_Transmit_TL(AppData){Oia_WriteQByld(TransportQueue, AppData);

类似的,下面的表10说明了关于Uipc_RcvLoop()函数的一段程序,这段程序在一个任务里执行,已经被统一过程间通信应用程序接口60调用。Similarly, Table 10 below illustrates a section of the Uipc_RcvLoop() function, which is executed in a task and has been called by the UPC API 60 .

表10Table 10

    Uipc_RcvLoop(){Uipc_Rcv(){Oia_ReadQByld(AppQueue,AppData)->接收一条消息}Uipc_ProcessMsg(AppData){对消息解码和处理}} Uipc_RcvLoop(){Uipc_Rcv(){Oia_ReadQByld(AppQueue,AppData)->Receive a message}Uipc_ProcessMsg(AppData){Decode and process the message}}

最后,本发明的统一过程间通信使得所有的应用(过程)都可以通过称为公共任务结构的一个结构而具有一个公共结构,并且终于减轻了开发新通信系统的负担和缩短其开发时间。此外,公共软件平台的益处、水平组件和垂直组件结合的益处是不会因将来操作系统和设备的改变而做另外的工作。Finally, the unified inter-process communication of the present invention enables all applications (processes) to have a common structure through a structure called a common task structure, and finally reduces the burden and shortens the development time of a new communication system. In addition, the benefit of a common software platform, the combination of horizontal components and vertical components, is that additional work will not be done due to changes in operating systems and devices in the future.

虽然已经参考本发明的优选实施例对本发明进行了展示和描述,那些本领域的技术人员应该理解,在不脱离由所附权利要求书中定义的本发明的精神和范围的前提下,可以进行各种形式上的和细节上的改变。While the invention has been shown and described with reference to preferred embodiments thereof, it will be understood by those skilled in the art that modifications may be made without departing from the spirit and scope of the invention as defined in the appended claims. Various changes in form and detail.

Claims (12)

1.一种用于从起始点到终点传递消息的过程间通信方法,该方法包括步骤:1. A method of interprocess communication for transferring messages from a starting point to an end point, the method comprising the steps of: 在操作系统独立访问层,提供一个操作系统统一的接口函数,该操作系统统一的接口函数对于通信装置的操作系统是可以独立访问的;In the operating system independent access layer, a unified interface function of the operating system is provided, and the unified interface function of the operating system can be independently accessed for the operating system of the communication device; 在设备独立访问层,提供一个设备统一的接口函数,该设备统一的接口函数对于通信装置的物理设备是可以独立访问的;In the device independent access layer, a unified interface function of the device is provided, and the unified interface function of the device can be independently accessed for the physical device of the communication device; 在统一过程间通信层,统一过程间通信应用程序接口提供一个接口使得任务可以使用统一过程间通信函数并且基于关于终点的信息来确定处理器内部通信和处理器间通信的路径,并且统一过程间通信协议堆栈通过用于连接端点之间的一个数据链接以及在链接之间传输无差错数据的数据链路层、用于在处理器内部的通信期间在任务之间进行消息路由的网络层和用于任务间的端到端通信的传输层来使用由统一过程间通信应用程序接口确定其通行路径的消息为处理器内部的通信进行单元间的路由,从而通过操作系统独立访问层和设备独立访问层中的至少一个,从起始点到终点传递消息。At the UPC layer, the UPC API provides an interface that enables tasks to use the UPC functions and determine the paths for intra-processor and inter-processor communications based on information about endpoints, and UPC The communication protocol stack passes through the data link layer for connecting a data link between the endpoints and transferring error-free data between the links, the network layer for routing messages between tasks during communication within the processor, and the user interface. A transport layer for end-to-end communication between tasks to route unit-to-unit communications within a processor using messages whose routing is determined by the UPC API, thereby accessing through OS-independent access layers and device-independently At least one of the layers, passing messages from a starting point to an ending point. 2.如权利要求1的方法,其中,关于终点的信息包括一个应用鉴别器和一个网络地址,该应用鉴别器用于鉴别与之通信的相对应的任务,该网络地址用于定位相对应的任务的一个物理地址。2. The method of claim 1, wherein the information about the endpoint includes an application identifier for identifying a corresponding task to communicate with and a network address for locating the corresponding task A physical address of . 3.如权利要求2的方法,其中,网络地址包括柜-架-槽-端口信息。3. The method of claim 2, wherein the network address includes cabinet-rack-slot-port information. 4.如权利要求2的方法,其中,统一过程间通信应用程序接口是对全部任务都可以应用的公共库。4. The method of claim 2, wherein the UPC API is a common library applicable to all tasks. 5.如权利要求1的方法,其中,公共任务结构的基本公共控制流程包括消息接收、消息解码、消息处理、和一个任务将要根据请求而执行相关的功能。5. The method of claim 1, wherein the basic common control flow of the common task structure includes message reception, message decoding, message processing, and a task to perform related functions upon request. 6.一种用于从起始点到终点传递消息的处理器间通信的装置,该装置包括:6. An apparatus for interprocessor communication passing messages from an origin to an end, the apparatus comprising: 操作系统独立访问层,用于提供一个操作系统统一接口功能,该操作系统统一接口功能对于通信装置的操作系统是可以独立访问的;The operating system independent access layer is used to provide a unified interface function of the operating system, and the unified interface function of the operating system can be independently accessed by the operating system of the communication device; 设备独立访问层,用于提供一个设备统一接口功能,该设备统一接口功能对于通信装置的物理设备是可以独立访问的;以及The device independent access layer is used to provide a device unified interface function, and the device unified interface function can be independently accessed by the physical device of the communication device; and 统一过程间通信层,用于通过操作系统独立访问层和设备独立访问层中的至少一个,从起始点到终点传递消息;a unified inter-process communication layer for passing messages from an origin to an end point through at least one of an OS-independent access layer and a device-independent access layer; 其中统一过程间通信层包括:The unified interprocess communication layer includes: 用于提供一个接口使得任务可以使用统一过程间通信功能并且还用Used to provide an interface so that tasks can use the unified process communication function and also use 于基于关于终点的信息来确定处理器内部通信和处理器间通信的路径的统一过程间通信应用程序接口;和A unified inter-process communication application program interface based on determining the path of intra-processor communication and inter-processor communication based on information about the endpoints; and 用于使用由统一过程间通信应用程序接口确定其通行路径的消息,为处理器内部通信进行单元间的路由的统一过程间通信协议堆栈,该统一过程间通信协议堆栈包括:用于在端点之间连接一个数据链接并且用于在链接之间传输无差错数据的数据链路层、用于在处理器内部通信期间在任务之间进行消息的路由的网络层和用于任务间的端到端的通信的传输层。A unified interprocedural communication protocol stack for routing between units for inter-processor communication using messages whose path is determined by a unified interprocess communication API, the unified interprocess communication protocol stack comprising: The data link layer connects a data link between the links and is used to transmit error-free data between the links, the network layer is used for the routing of messages between tasks during the internal communication of the processor, and the end-to-end communication between tasks. The transport layer for communication. 7.如权利要求6的装置,其中,关于终点的信息包括一个应用鉴别器和一个网络地址,该应用鉴别器用于鉴别与之通信的相对应的任务,该网络地址用于定位相对应的任务的一个物理地址。7. The apparatus of claim 6, wherein the information about the endpoint includes an application identifier for identifying a corresponding task communicating with it and a network address for locating the corresponding task A physical address of . 8.如权利要求7的装置,其中,网络地址包括柜-架-槽-端口信息。8. The apparatus of claim 7, wherein the network address includes cabinet-rack-slot-port information. 9.如权利要求6的装置,其中,统一过程间通信应用程序接口是对全部任务都可以应用的公共库。9. The apparatus of claim 6, wherein the UPC API is a common library applicable to all tasks. 10.如权利要求6的装置,其中,公共任务结构的基本公共控制流程包括消息接收、消息解码、消息处理、和一个任务将要根据请求而执行的相关的功能。10. The apparatus of claim 6, wherein the basic common control flow of the common task structure includes message reception, message decoding, message processing, and related functions that a task is to perform upon request. 11.一种用于从起始点到终点传递消息的处理器间通信的方法,该方法包括的步骤:11. A method of interprocessor communication for passing messages from a starting point to a destination, the method comprising the steps of: 提供具有一个任务的基本公共控制流程的一个公共任务结构,作为统一过程间通信的一个接口;Provide a common task structure with a basic common control flow of a task, as an interface for unified inter-process communication; 如果一个起始任务使用公共任务结构来提供一条消息和关于终点的信息,就基于关于终点的信息,确定该消息是一块卡内的处理器间通信消息,还是卡之间的处理器内部通信消息;If an initiating task uses the common task structure to provide a message and information about the destination, based on the information about the destination, determine whether the message is an interprocessor communication message within a card or an interprocessor communication message between cards ; 如果该消息属于卡之间的处理器内部通信消息,那么通过统一过程间通信协议堆栈所包括的用于在端点之间连接一个数据链接和用于在链接之间传输无差错数据的数据链路层、用于在处理器内部通信期间在任务之间进行消息的路由的网络层和用于任务间的端到端的通信的传输层把这条消息传递到统一过程间通信协议堆栈的一个队列进行路由;If the message is an inter-processor communication message between cards, then through the Unified Interprocedural Communication Protocol stack included for connecting a data link between the endpoints and for transferring error-free data between the links layer, a network layer for routing messages between tasks during inter-processor communication, and a transport layer for end-to-end communication between tasks to pass the message to a queue in the UPC stack for processing. routing; 如果该消息属于一块卡内的处理器间通信消息,那么通过由操作系统独立访问层提供的应用程序接口库,把消息传递到卡内的相对应的任务的一个消息队列。If the message belongs to an inter-processor communication message in a card, then the message is delivered to a message queue of a corresponding task in the card through the API library provided by the independent access layer of the operating system. 12.一种用于从起始点到终点传递消息的处理器间通信的装置,该装置包括:12. An apparatus for interprocessor communication passing messages from an origin to an end, the apparatus comprising: 操作系统块,用于在装置中独立地处理内部通信;以及an operating system block for independently handling internal communications within the device; and 硬件块,用于独立地处理从外部向该装置的或从该装置向外部的外部通信。A hardware block for independently handling external communications from the outside to the device or from the device to the outside.
CNB021545510A 2001-09-04 2002-09-04 Communication method and its device during process Expired - Fee Related CN1326066C (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US31630101P 2001-09-04 2001-09-04
US60/316,301 2001-09-04

Publications (2)

Publication Number Publication Date
CN1441366A CN1441366A (en) 2003-09-10
CN1326066C true CN1326066C (en) 2007-07-11

Family

ID=27788885

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB021545510A Expired - Fee Related CN1326066C (en) 2001-09-04 2002-09-04 Communication method and its device during process

Country Status (1)

Country Link
CN (1) CN1326066C (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100432944C (en) * 2005-09-30 2008-11-12 中国科学院研究生院 Computer system
US10075402B2 (en) * 2015-06-24 2018-09-11 Cisco Technology, Inc. Flexible command and control in content centric networks
CN107204908A (en) 2016-03-17 2017-09-26 阿里巴巴集团控股有限公司 A kind of message sending, receiving method and device based on interface communication protocol frame
CN107766077A (en) * 2017-10-18 2018-03-06 张洋 A kind of multiple external device control methods and device
CN113032166B (en) * 2021-03-26 2024-05-24 黑芝麻智能科技(上海)有限公司 Inter-core communication method, processor, inter-core communication system, and computer-readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1199473A (en) * 1995-10-09 1998-11-18 株式会社日立制作所 Terminal device
WO2000036794A1 (en) * 1998-12-17 2000-06-22 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus in a communication network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1199473A (en) * 1995-10-09 1998-11-18 株式会社日立制作所 Terminal device
WO2000036794A1 (en) * 1998-12-17 2000-06-22 Telefonaktiebolaget Lm Ericsson (Publ) Method and apparatus in a communication network

Also Published As

Publication number Publication date
CN1441366A (en) 2003-09-10

Similar Documents

Publication Publication Date Title
JP2003177930A (en) Inter-process communication method and apparatus
US5636371A (en) Virtual network mechanism to access well known port application programs running on a single host system
EP0749597B1 (en) Distributed protocol framework
US20050010925A1 (en) Interprocessor communication protocol with smart streaming port
US7263701B2 (en) Interprocess communication method and apparatus
US8326918B2 (en) Interprocessor communication protocol
EP0886987A4 (en) VIRTUAL LOCAL NETWORK FOR MULTI-EMULATORS IN AN OPEN SYSTEM ENVIRONMENT
WO2007090352A1 (en) A method, an apparatus and a system for message transmission
US7139805B2 (en) Scalable java servers for network server applications
CN1326066C (en) Communication method and its device during process
JP2007526544A5 (en)
KR100812680B1 (en) Interprocessor communication protocol providing guaranteed quality of service and selective broadcasting
CN113176957B (en) Remote application automation system based on RPC
KR100442688B1 (en) Interprocess communication method and apparatus
KR100412237B1 (en) A user-level sockets layer and method for interfacing communication using the sockets layer
KR100787850B1 (en) Interprocessor communication protocol with high level service composition
EP1296239A2 (en) Interprocess communication method and apparatus
JPH0666813B2 (en) Data communication system and communication path establishing method
KR20020097338A (en) Resource adapter in sdr system
CA2401462A1 (en) Interprocess communication method and apparatus
JP2000151739A (en) Information processor, distributed processor and network system
KR19980086587A (en) System Resource Reduction Tool Using TCP / IP Socket Application

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20070711

Termination date: 20091009