WO2014187166A1 - Communication method and apparatus among multiple processes in star structure - Google Patents

Communication method and apparatus among multiple processes in star structure Download PDF

Info

Publication number
WO2014187166A1
WO2014187166A1 PCT/CN2014/071196 CN2014071196W WO2014187166A1 WO 2014187166 A1 WO2014187166 A1 WO 2014187166A1 CN 2014071196 W CN2014071196 W CN 2014071196W WO 2014187166 A1 WO2014187166 A1 WO 2014187166A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
link
controller
communication
thread
Prior art date
Application number
PCT/CN2014/071196
Other languages
French (fr)
Chinese (zh)
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 福建联迪商用设备有限公司
Publication of WO2014187166A1 publication Critical patent/WO2014187166A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution

Definitions

  • the present invention relates to the field of communications, and in particular to a multi-process communication method and apparatus for a star structure.
  • Bluetooth-related multi-threaded programming there is a need for a process that requires data interaction with other multiple processes or threads, and the amount of data exchanged is small, but the time of data interaction is random, that is, The blocking listener waits for the communication link; it needs to be able to terminate the thread asynchronously.
  • each communication link needs to establish a process or thread to block the waiting event, so the program is more complicated.
  • Asynchronous termination of threads generally uses pthread_cancel to notify the thread to terminate, or to terminate the thread in a thread by means of global variables, etc., but there are problems such as resource cleanup or inefficient execution when the thread terminates. In severe cases, even A situation where the program terminated unexpectedly.
  • multi-process communication usually uses pipes, message queues, shared memory, semaphores, sockets, etc., and simultaneously communicates with multiple processes or threads.
  • Each communication link establishes a process or thread to block. Wait for an event to occur.
  • Thread termination generally uses pthread_cancel to notify the thread to terminate, or to terminate the thread by looping through the query mode through global variables.
  • FIG. 1 is a schematic diagram showing the structure of a general real-time multi-process communication model.
  • the present invention provides a multi-process communication invention suitable for a star structure similar to a network topology, in which a poll function is used in a thread to skillfully combine a control link and a communication link for centralized monitoring.
  • a thread can communicate with multiple threads or processes at the same time.
  • the communication link is used for the interactive use of specific function information
  • the control link is used for the interactive use of specific control information.
  • the present invention includes three parts of a controller, a processor, and a functional module as a whole.
  • the controller starts the processor and establishes a control link with the processor, and then the processor blocks the controller link between the controller and the processor and the functional link between the processor and other functional modules with the poll; Through the control link, the processor can be controlled to add and delete communication links and monitoring functions between the processor and the function module, and the processor can be shut down through the control link; other functional modules are connected through a new communication link. Specific functional operational interactions.
  • the invention uses a combination of a poll function and a socket to simultaneously monitor the handles of multiple communication links in a thread or process, and can dynamically increase and delete the monitored communication link handles, avoiding the general method.
  • a communication link consumes a process or thread problem in a blocking mode, which reduces the complexity of the program and does not require the use of a query method to generate additional system overhead.
  • the notification thread actively terminates the thread from within the thread, and provides a method for asynchronously terminating the thread, which simplifies the process of cleaning the resource when the thread is asynchronously terminated, and avoids the extra system overhead caused by the query mode.
  • Figure 1 Schematic diagram of the general real-time multi-process communication model structure
  • FIG. 2 is a schematic structural diagram of a multi-process communication model of a star structure according to an embodiment of the present invention
  • Figure 3 is a diagram showing a multi-process communication model framework of a star structure of the present invention.
  • Figure 4 is a flow chart showing the process of variation of the present invention during the running of the program.
  • FIG. 2 it is a schematic diagram of a multi-process communication model structure of a star structure according to the present invention. It can be seen from the model comparison diagram that a general real-time multi-process communication invention is required, and if it is required to simultaneously perform with four functional modules. In the interaction, the main process needs to establish four sub-threads to interact, and the present invention organically combines the control link and the functional link through the poll function, and simultaneously monitors multiple communication links in one thread.
  • the handle the work that needs to be established by multiple threads or processes is simplified in one thread, and the monitored communication link handle can be dynamically added and deleted, avoiding the cost of a communication link in the blocking mode.
  • a process or thread problem does not require the use of query methods to generate additional system overhead, which reduces the complexity of the program and increases the flexibility of the program.
  • a control link is established between the main process (controller) and the child thread (processor). The main process can notify the sub-thread to actively terminate the thread from the inside of the thread through the control link, simplifying the process of cleaning the resource when the thread is asynchronously terminated, and avoiding the query mode. Additional overhead.
  • FIG. 3 it is a multi-process communication model framework diagram of a star structure of the present invention.
  • the invention can be divided into three parts as a whole: a controller part, a processor part and a function module.
  • the controller part the process, is responsible for starting the processor thread and terminating the processor thread, controlling the establishment and deletion of the communication link between the processor and other modules through the control link, and terminating the related operations;
  • Thread controlled by the controller, is responsible for monitoring the communication link handle and control link handle of each function module, interacting with the controller and each functional module, and performing related processing;
  • Functional module part A thread or process, a specific functional module, interacts with the processor through a communication link.
  • Procedure 1 The main process creates a new sub-thread and establishes a control link with the sub-process; the sub-thread adds the control link handle to the poll function listener set for monitoring, and processes the control information from the main process at any time.
  • Process 2 The main process controls the sub-thread to establish a communication link with the function module through the control link, and the sub-thread adds the communication link handle to the poll function listener set for monitoring, and then the sub-thread can process the communication chain from the listener at any time. The interaction information of the road is gone.
  • Process 3 The main process controls the sub-thread to disconnect the communication link with the function module through the control link, and the sub-thread deletes the communication link handle from the poll function monitoring set, and no longer listens.
  • Process 4 The main process notifies the child thread to end by controlling the link, that is, shutting down the processor.
  • the external termination thread in general is converted into a notification thread to actively end from inside the thread.
  • the present invention is applicable to a multi-process communication model similar to a star structure in a network topology.
  • the communication time of each communication link is random.
  • the invention has been adopted in the Bluetooth module on the POS machine and tested:
  • the activation and termination of the pairing request thread can be controlled by the opening and closing operations of the Bluetooth device, that is, the controller in the invention model enables the processor and turns off the processor, and the process of shutting down the processor is to notify the thread to terminate through the control link.
  • the communication link monitored by the thread can be dynamically added and deleted, that is, the communication link function between the processor and the function module is established and deleted in the invention model.
  • the method of asynchronously terminating the thread by means of a method of notifying the thread termination by pthread_cancel or a method of looping through the query in a thread by means of a global variable or the like has a great robustness and stability. Improvement.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Small-Scale Networks (AREA)
  • Communication Control (AREA)

Abstract

The present invention proposes a communication method and apparatus among multiple processes in a star structure. In a thread, a poll function is used to ingeniously combine a control link and a communications link and perform centralized monitoring; in this way, as seen in a macroscopic scale, one thread can communicate with multiple threads or processes synchronously. The communications link is used for specific interaction and use of function information, and the control link is used for specific interaction and use of control information. By means of the present invention, a problem in a one-to-multiple model in multiple-process communication that a common communication method cannot perform synchronous communication between one process or thread and other multiple threads or processes is solved; meanwhile, a method in which a control link is used to instruct a thread to actively end a thread operation from inside the thread provides an asynchronous thread termination method.

Description

一种星型结构的多进程间的通信方法和装置  Multi-process communication method and device with star structure
技术领域Technical field
本发明涉及通信领域,特别是提出了一种星型结构的多进程间的通信方法和装置。The present invention relates to the field of communications, and in particular to a multi-process communication method and apparatus for a star structure.
背景技术Background technique
在进行蓝牙相关的多线程编程时,遇到这样的需求:一个进程需要与其他多个进程或线程进行数据交互,且交互的数据量不大,但数据交互的时间具有随机性,即要能阻塞监听等待通信链路;需要能异步终止线程。一般情况下要同时与多个进程或线程进行数据通信,则每条通信链路需要建立一个进程或线程去阻塞等待事件的发生,这样程序会比较复杂。异步终止线程则一般使用pthread_cancel通知线程终止,或通过全局变量等方式在线程中循环询查方式来终止线程等方法,但会存在线程终止时的资源清理问题或执行效率低下的问题,严重时甚至出现程序意外终止的情况。In Bluetooth-related multi-threaded programming, there is a need for a process that requires data interaction with other multiple processes or threads, and the amount of data exchanged is small, but the time of data interaction is random, that is, The blocking listener waits for the communication link; it needs to be able to terminate the thread asynchronously. In general, to communicate with multiple processes or threads at the same time, each communication link needs to establish a process or thread to block the waiting event, so the program is more complicated. Asynchronous termination of threads generally uses pthread_cancel to notify the thread to terminate, or to terminate the thread in a thread by means of global variables, etc., but there are problems such as resource cleanup or inefficient execution when the thread terminates. In severe cases, even A situation where the program terminated unexpectedly.
1.目前多进程间通信通常使用管道、消息队列、共享内存、信号量、套接口等方式,同时与多个进程或线程进行数据通信,则每条通信链路都建立一个进程或线程去阻塞等待事件的发生。1. At present, multi-process communication usually uses pipes, message queues, shared memory, semaphores, sockets, etc., and simultaneously communicates with multiple processes or threads. Each communication link establishes a process or thread to block. Wait for an event to occur.
2.线程终止一般使用pthread_cancel通知线程终止,或通过全局变量等方式在线程中循环询查方式来终止线程。2. Thread termination generally uses pthread_cancel to notify the thread to terminate, or to terminate the thread by looping through the query mode through global variables.
通常使用的多进程间通信方法(管道、消息队列、共享内存、信号量、套接口等),一般如果使用阻塞方式则需要花费一个进程或线程去阻塞等待事件的发生,而如果是非阻塞则又需要使用查询的方式去反复查询事件的发生。前者会使程序进程或线程数目增多,增加程序的复杂性,而后者又会浪费额外的系统资源在查询事件的发生上。另外,在多线程编程中,异步终止线程一般使用pthread_cancel或全局变量方式异步终止线程,或存在资源清理问题或浪费额外的系统资源。图1是一般的实时多进程间通信模型结构示意图。Commonly used multi-process communication methods (pipe, message queue, shared memory, semaphore, socket, etc.), generally use a blocking method to spend a process or thread to block the occurrence of waiting events, and if it is non-blocking then You need to use the way of query to repeatedly query the occurrence of the event. The former will increase the number of program processes or threads, increasing the complexity of the program, while the latter will waste additional system resources on the occurrence of query events. In addition, in multi-threaded programming, asynchronous termination threads typically terminate threads asynchronously using pthread_cancel or global variables, or have resource cleanup issues or wasted additional system resources. FIG. 1 is a schematic diagram showing the structure of a general real-time multi-process communication model.
发明内容Summary of the invention
本发明提供一种适用于类似于网络拓扑结构中的星型结构的多进程间的通信发明,在线程中使用poll函数巧妙地将控制链路和通信链路结合在一起,进行集中监测,这样从宏观上看就是一个线程就可以同时与多个线程或进程进行通信。通信链路用于具体的功能信息的交互使用,控制链路用于具体的控制信息的交互使用。通过本发明,解决了多进程通信中的一对多的模型中一般通信方法无法在一个进程或线程中同时与其他多个线程或进程进行通信的问题,同时通过控制链路来通知线程从线程内部主动结束线程操作的方法,提供了一种异步终止线程的方法。The present invention provides a multi-process communication invention suitable for a star structure similar to a network topology, in which a poll function is used in a thread to skillfully combine a control link and a communication link for centralized monitoring. From a macro perspective, a thread can communicate with multiple threads or processes at the same time. The communication link is used for the interactive use of specific function information, and the control link is used for the interactive use of specific control information. Through the invention, the problem that the general communication method in the one-to-many model in the multi-process communication cannot simultaneously communicate with other multiple threads or processes in one process or thread is solved, and the thread is notified from the thread through the control link. A method of actively terminating thread operations internally provides a way to terminate threads asynchronously.
本发明从整体上来看包括控制器,处理器,功能模块三个部分。首先由控制器启动处理器,并和处理器建立控制链路,随后处理器用poll阻塞监测控制器与处理器之间的控制器链路和处理器与其他功能模块之间的功能链路;控制器通过控制链路可以控制处理器新增和删减处理器与功能模块间的通信链路及监测功能,还可以通过控制链路关闭处理器;其他功能模块则通过新增的通信链路进行具体的功能性操作交互。The present invention includes three parts of a controller, a processor, and a functional module as a whole. First, the controller starts the processor and establishes a control link with the processor, and then the processor blocks the controller link between the controller and the processor and the functional link between the processor and other functional modules with the poll; Through the control link, the processor can be controlled to add and delete communication links and monitoring functions between the processor and the function module, and the processor can be shut down through the control link; other functional modules are connected through a new communication link. Specific functional operational interactions.
本发明通过poll函数与套接字组合使用,在一个线程或进程中集中式同时监测多个通信链路的句柄,并可以动态增加和删减所监测的通信链路句柄,避开一般方法中通信链路在阻塞方式下一条通路花费一个进程或线程的问题,降低了程序的复杂性,也不需要使用查询方式产生额外的系统开销。同时通过建立的控制链路,通知线程从线程内部主动结束线程,提供了一种异步终止线程的方法,简化线程异步终止时资源清理过程,规避查询方式带来的额外系统开销。The invention uses a combination of a poll function and a socket to simultaneously monitor the handles of multiple communication links in a thread or process, and can dynamically increase and delete the monitored communication link handles, avoiding the general method. A communication link consumes a process or thread problem in a blocking mode, which reduces the complexity of the program and does not require the use of a query method to generate additional system overhead. At the same time, through the established control link, the notification thread actively terminates the thread from within the thread, and provides a method for asynchronously terminating the thread, which simplifies the process of cleaning the resource when the thread is asynchronously terminated, and avoids the extra system overhead caused by the query mode.
附图说明DRAWINGS
通过参照附图更详细地描述本发明的示例性实施例,本发明的以上和其它方面及优点将变得更加易于清楚,在附图中:The above and other aspects and advantages of the present invention will become more apparent from the following detailed description of exemplary embodiments of the invention.
图1:一般实时多进程间通信模型结构示意图;Figure 1: Schematic diagram of the general real-time multi-process communication model structure;
图2:本发明实施例的一种星型结构的多进程间的通信模型结构示意图;2 is a schematic structural diagram of a multi-process communication model of a star structure according to an embodiment of the present invention;
图3:本发明的一种星型结构的多进程间的通信模型框架图;Figure 3 is a diagram showing a multi-process communication model framework of a star structure of the present invention;
图4:本发明在程序运行的过程中存在的变化过程流程图。Figure 4 is a flow chart showing the process of variation of the present invention during the running of the program.
具体实施方式detailed description
在下文中,现在将参照附图更充分地描述本发明,在附图中示出了各种实施例。然而,本发明可以以许多不同的形式来实施,且不应该解释为局限于在此阐述的实施例。相反,提供这些实施例使得本公开将是彻底和完全的,并将本发明的范围充分地传达给本领域技术人员。In the following, the invention will now be described more fully hereinafter with reference to the accompanying drawings in which FIG. However, the invention may be embodied in many different forms and should not be construed as being limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and
在下文中,将参照附图更详细地描述本发明的示例性实施例。Hereinafter, exemplary embodiments of the present invention will be described in more detail with reference to the accompanying drawings.
如图2所示,为本发明的一种星型结构的多进程间的通信模型结构示意图,通过模型对比图可以看出,一般实时多进程间通信发明,如果需要同时与四个功能模块进行交互,则主进程需要建立四个子线程去进行交互,而本发明通过poll函数,将控制链路和功能链路有机地结合在一起进行监测,在一个线程中集中式同时监测多个通信链路的句柄,将原本需要建立多个线程或进程来完成的工作简化在一个线程中完成,并可以动态增加和删减所监测的通信链路句柄,避开通信链路在阻塞方式下一条通路花费一个进程或线程的问题,也不需要使用查询方式产生额外的系统开销,在降低了程序的复杂性的同时也增加了程序的灵活性。主进程(控制器)与子线程(处理器)间建立控制链路,主进程可以通过控制链路通知子线程从线程内部主动结束线程,简化线程异步终止时资源清理过程,规避查询方式带来的额外系统开销。As shown in FIG. 2, it is a schematic diagram of a multi-process communication model structure of a star structure according to the present invention. It can be seen from the model comparison diagram that a general real-time multi-process communication invention is required, and if it is required to simultaneously perform with four functional modules. In the interaction, the main process needs to establish four sub-threads to interact, and the present invention organically combines the control link and the functional link through the poll function, and simultaneously monitors multiple communication links in one thread. The handle, the work that needs to be established by multiple threads or processes is simplified in one thread, and the monitored communication link handle can be dynamically added and deleted, avoiding the cost of a communication link in the blocking mode. A process or thread problem does not require the use of query methods to generate additional system overhead, which reduces the complexity of the program and increases the flexibility of the program. A control link is established between the main process (controller) and the child thread (processor). The main process can notify the sub-thread to actively terminate the thread from the inside of the thread through the control link, simplifying the process of cleaning the resource when the thread is asynchronously terminated, and avoiding the query mode. Additional overhead.
如图3所示,为本发明的一种星型结构的多进程间的通信模型框架图。As shown in FIG. 3, it is a multi-process communication model framework diagram of a star structure of the present invention.
本发明从整体上看可以分为三部分:控制器部分,处理器部分和功能模块。The invention can be divided into three parts as a whole: a controller part, a processor part and a function module.
控制器部分:进程,负责启动处理器线程和终止处理器线程,通过控制链路控制处理器与其他模块通信链路的建立与删减及相关操作的终止等动作;The controller part: the process, is responsible for starting the processor thread and terminating the processor thread, controlling the establishment and deletion of the communication link between the processor and other modules through the control link, and terminating the related operations;
处理器部分:线程,由控制器控制其生命进程,负责监听各功能模块与其建立的通信链路句柄及控制链路句柄,与控制器和各功能模块进行交互,并进行相关的处理;Processor part: thread, controlled by the controller, is responsible for monitoring the communication link handle and control link handle of each function module, interacting with the controller and each functional module, and performing related processing;
功能模块部分:线程或进程,某一具体功能模块,与处理器通过通信链路进行交互。Functional module part: A thread or process, a specific functional module, interacts with the processor through a communication link.
如图4所示,为本发明实现后,在程序运行的过程中,会存在的几个变化过程流程图。注意,图4中主进程(控制器)下面简称主进程,子线程(处理器)下面简称子线程。As shown in FIG. 4, after the implementation of the present invention, in the process of running the program, there are several flow chart of the change process. Note that in Figure 4, the main process (controller) is referred to as the main process, and the sub-thread (processor) is referred to as the sub-thread.
过程1:主进程新建子线程,并与子进程间建立控制链路;子线程将控制链路句柄添加到poll函数监听集合中进行监听,随时处理来自主进程的控制信息。Procedure 1: The main process creates a new sub-thread and establishes a control link with the sub-process; the sub-thread adds the control link handle to the poll function listener set for monitoring, and processes the control information from the main process at any time.
过程2:主进程通过控制链路控制子线程与功能模块建立通信链路,子线程将通信链路句柄添加到poll函数监听集合中进行监听,此后子线程便可以随时处理来自所监听的通信链路的交互信息了。Process 2: The main process controls the sub-thread to establish a communication link with the function module through the control link, and the sub-thread adds the communication link handle to the poll function listener set for monitoring, and then the sub-thread can process the communication chain from the listener at any time. The interaction information of the road is gone.
过程3:主进程通过控制链路控制子线程断开与功能模块之间的通信链路,子线程将通信链路句柄从poll函数监听集合中删除,不再监听。Process 3: The main process controls the sub-thread to disconnect the communication link with the function module through the control link, and the sub-thread deletes the communication link handle from the poll function monitoring set, and no longer listens.
过程4:主进程通过控制链路通知子线程结束,即关闭处理器。Process 4: The main process notifies the child thread to end by controlling the link, that is, shutting down the processor.
本发明的特点如下:The features of the invention are as follows:
1、套接字和poll函数的组合使用,使机制灵活多变。1, the combination of socket and poll function, making the mechanism flexible.
2、有异步终止线程的需求。通过建立的通信链路,将一般情况下的外部终止线程转换为通知线程从线程内部主动结束。2. There is a need to terminate the thread asynchronously. Through the established communication link, the external termination thread in general is converted into a notification thread to actively end from inside the thread.
3、本发明适用于类似于网络拓扑结构中的星型结构的多进程间的通信模型中。3. The present invention is applicable to a multi-process communication model similar to a star structure in a network topology.
4、各通信链路的通信时间具有随机性。4. The communication time of each communication link is random.
本发明已经在POS机上蓝牙模块中被采用,并进行了测试:The invention has been adopted in the Bluetooth module on the POS machine and tested:
1) 通过蓝牙设备的打开和关闭操作可以控制监测配对请求线程的启用与终止,即发明模型中的控制器启用处理器和关闭处理器,关闭处理器过程就是通过控制链路通知线程终止。1) The activation and termination of the pairing request thread can be controlled by the opening and closing operations of the Bluetooth device, that is, the controller in the invention model enables the processor and turns off the processor, and the process of shutting down the processor is to notify the thread to terminate through the control link.
2) 通过发起配对请求操作,可以动态增加和删减线程所监测的通信链路,即发明模型中的建立和删除处理器与功能模块间的通信链路功能。2) By initiating the pairing request operation, the communication link monitored by the thread can be dynamically added and deleted, that is, the communication link function between the processor and the function module is established and deleted in the invention model.
3) 通过采用此发明,相比之前所采用的通过pthread_cancel通知线程终止的方法,或通过全局变量等方式在线程中循环询查方式来异步终止线程的方法,在健壮性和稳定性上有了很大的提高。3) By adopting the invention, the method of asynchronously terminating the thread by means of a method of notifying the thread termination by pthread_cancel or a method of looping through the query in a thread by means of a global variable or the like has a great robustness and stability. Improvement.
4) 将此发明应用到POS机上的蓝牙模块配对功能中,在长达4000次的强度测试中功能稳定正常。4) Apply this invention to the Bluetooth module pairing function on the POS machine, and the function is stable and normal in the strength test up to 4000 times.
以上所述仅为本发明的实施例而已,并不用于限制本发明。本发明可以有各种合适的更改和变化。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above description is only an embodiment of the present invention and is not intended to limit the present invention. The invention is susceptible to various modifications and changes. Any modifications, equivalents, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims (1)

  1. 1.一种星型结构的多进程间的通信方法,其特征在于:A multi-process communication method of a star structure, characterized in that:
    首先由控制器启动处理器,并和处理器建立控制链路,随后处理器用poll阻塞监测控制器与处理器之间的控制器链路和处理器与其他功能模块之间的功能链路;控制器通过控制链路可以控制处理器新增和删减处理器与功能模块间的通信链路及监测功能,还可以通过控制链路关闭处理器;其他功能模块则通过新增的通信链路进行具体的功能性操作交互。First, the controller starts the processor and establishes a control link with the processor, and then the processor blocks the controller link between the controller and the processor and the functional link between the processor and other functional modules with the poll; Through the control link, the processor can be controlled to add and delete communication links and monitoring functions between the processor and the function module, and the processor can be shut down through the control link; other functional modules are connected through a new communication link. Specific functional operational interactions.
    2.如权利要求1所述的一种星型结构的多进程间的通信方法,其特征在于:2. A multi-process communication method for a star structure according to claim 1, wherein:
    所述方法运行的过程中,具有如下变化过程:During the operation of the method, the following changes are made:
    过程1:控制器新建处理器,并与子进程间建立控制链路;处理器将控制链路句柄添加到poll函数监听集合中进行监听,随时处理来自控制器的控制信息;Process 1: The controller creates a new processor and establishes a control link with the child process; the processor adds a control link handle to the poll function listener set for monitoring, and processes control information from the controller at any time;
    过程2:控制器通过控制链路控制处理器与功能模块建立通信链路,处理器将通信链路句柄添加到poll函数监听集合中进行监听,此后处理器便可以随时处理来自所监听的通信链路的交互信息了;Process 2: The controller establishes a communication link with the function module through the control link control processor, and the processor adds the communication link handle to the poll function monitoring set for monitoring, and the processor can then process the communication chain from the listener at any time. Road interaction information;
    过程3:控制器通过控制链路控制处理器断开与功能模块之间的通信链路,处理器将通信链路句柄从poll函数监听集合中删除,不再监听;Process 3: The controller controls the processor to disconnect the communication link with the function module by controlling the link, and the processor deletes the communication link handle from the poll function monitoring set, and no longer listens;
    过程4:控制器通过控制链路通知处理器结束,即关闭处理器。Process 4: The controller notifies the processor to end by controlling the link, ie, shutting down the processor.
    3.一种星型结构的多进程间的通信装置,其特征在于:3. A multi-process communication device of a star structure, characterized in that:
    所述装置分为三部分:控制器部分,处理器部分和功能模块;The device is divided into three parts: a controller part, a processor part and a function module;
    控制器部分:负责进程,负责启动处理器线程和终止处理器线程,通过控制链路控制处理器与其他模块通信链路的建立与删减及相关操作的终止等动作;Controller part: responsible for the process, responsible for starting the processor thread and terminating the processor thread, controlling the establishment and deletion of the communication link between the processor and other modules through the control link, and terminating the related operations;
    处理器部分:负责线程,由控制器控制其生命进程,负责监听各功能模块与其建立的通信链路句柄及控制链路句柄,与控制器和各功能模块进行交互,并进行相关的处理;Processor part: responsible for the thread, the controller controls its life process, is responsible for monitoring the communication link handles and control link handles established by each function module, interacting with the controller and each functional module, and performing related processing;
    功能模块:负责线程或进程,某一具体功能模块,与处理器通过通信链路进行交互。Function module: responsible for threads or processes, a specific function module, and the processor interacts through the communication link.
    4.如权利要求3所述的一种星型结构的多进程间的通信装置,其特征在于:4. A multi-process communication device with a star structure according to claim 3, wherein:
    所述通信装置的通信方法为: The communication method of the communication device is:
    首先由控制器启动处理器,并和处理器建立控制链路,随后处理器用poll阻塞监测控制器与处理器之间的控制器链路和处理器与其他功能模块之间的功能链路;控制器通过控制链路可以控制处理器新增和删减处理器与功能模块间的通信链路及监测功能,还可以通过控制链路关闭处理器;其他功能模块则通过新增的通信链路进行具体的功能性操作交互。First, the controller starts the processor and establishes a control link with the processor, and then the processor blocks the controller link between the controller and the processor and the functional link between the processor and other functional modules with the poll; Through the control link, the processor can be controlled to add and delete communication links and monitoring functions between the processor and the function module, and the processor can be shut down through the control link; other functional modules are connected through a new communication link. Specific functional operational interactions.
    5.如权利要求4所述的一种星型结构的多进程间的通信方法,其特征在于:5. A multi-process communication method for a star structure according to claim 4, wherein:
    所述方法运行的过程中,具有如下变化过程:During the operation of the method, the following changes are made:
    过程1:控制器新建处理器,并与子进程间建立控制链路;处理器将控制链路句柄添加到poll函数监听集合中进行监听,随时处理来自控制器的控制信息;Process 1: The controller creates a new processor and establishes a control link with the child process; the processor adds a control link handle to the poll function listener set for monitoring, and processes control information from the controller at any time;
    过程2:控制器通过控制链路控制处理器与功能模块建立通信链路,处理器将通信链路句柄添加到poll函数监听集合中进行监听,此后处理器便可以随时处理来自所监听的通信链路的交互信息了;Process 2: The controller establishes a communication link with the function module through the control link control processor, and the processor adds the communication link handle to the poll function monitoring set for monitoring, and the processor can then process the communication chain from the listener at any time. Road interaction information;
    过程3:控制器通过控制链路控制处理器断开与功能模块之间的通信链路,处理器将通信链路句柄从poll函数监听集合中删除,不再监听;Process 3: The controller controls the processor to disconnect the communication link with the function module by controlling the link, and the processor deletes the communication link handle from the poll function monitoring set, and no longer listens;
    过程4:控制器通过控制链路通知处理器结束,即关闭处理器。Process 4: The controller notifies the processor to end by controlling the link, ie, shutting down the processor.
PCT/CN2014/071196 2013-05-24 2014-01-23 Communication method and apparatus among multiple processes in star structure WO2014187166A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310198340.5 2013-05-24
CN201310198340.5A CN103294541B (en) 2013-05-24 2013-05-24 Star-structured multi-process communication method and device

Publications (1)

Publication Number Publication Date
WO2014187166A1 true WO2014187166A1 (en) 2014-11-27

Family

ID=49095473

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/071196 WO2014187166A1 (en) 2013-05-24 2014-01-23 Communication method and apparatus among multiple processes in star structure

Country Status (2)

Country Link
CN (1) CN103294541B (en)
WO (1) WO2014187166A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294541B (en) * 2013-05-24 2017-04-26 福建联迪商用设备有限公司 Star-structured multi-process communication method and device
CN112003785B (en) 2018-08-23 2022-08-16 Oppo广东移动通信有限公司 Link aggregation method and related product
CN111309529B (en) * 2018-12-11 2022-04-19 英业达科技有限公司 System and method for complete testing of communication links within a processor based on processor information

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193779A (en) * 2011-05-16 2011-09-21 武汉科技大学 MPSoC (multi-processor system-on-chip)-oriented multithread scheduling method
CN102223655A (en) * 2011-07-05 2011-10-19 上海市安全生产科学研究所 Underlying multi-thread data transmission method of mobile communication
CN102768637A (en) * 2011-05-05 2012-11-07 阿里巴巴集团控股有限公司 Method and device for controlling test execution
CN103294541A (en) * 2013-05-24 2013-09-11 福建联迪商用设备有限公司 Star-structured multi-process communication method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8335853B2 (en) * 2009-12-17 2012-12-18 Sonus Networks, Inc. Transparent recovery of transport connections using packet translation techniques
US8862769B2 (en) * 2010-11-23 2014-10-14 Qualcomm Incorporated Object-based transport protocol
US8595345B2 (en) * 2011-05-26 2013-11-26 Mfluent Llc Enhanced push notification services

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102768637A (en) * 2011-05-05 2012-11-07 阿里巴巴集团控股有限公司 Method and device for controlling test execution
CN102193779A (en) * 2011-05-16 2011-09-21 武汉科技大学 MPSoC (multi-processor system-on-chip)-oriented multithread scheduling method
CN102223655A (en) * 2011-07-05 2011-10-19 上海市安全生产科学研究所 Underlying multi-thread data transmission method of mobile communication
CN103294541A (en) * 2013-05-24 2013-09-11 福建联迪商用设备有限公司 Star-structured multi-process communication method and device

Also Published As

Publication number Publication date
CN103294541B (en) 2017-04-26
CN103294541A (en) 2013-09-11

Similar Documents

Publication Publication Date Title
TWI407373B (en) Resource management in a multicore architecture
WO2014187166A1 (en) Communication method and apparatus among multiple processes in star structure
WO2012025014A1 (en) Cloud robotics system and implementation method thereof
JPS6387435A (en) Information transmission control method for elevator system
JP2006236356A (en) Windows (r) remote debugger service
Li et al. Green and reliable software-defined industrial networks
WO2014015572A1 (en) Cross application automatic test apparatus and method for android
CN108881408A (en) A kind of multi-service operating system based on platform of internet of things
Dubey et al. Device access abstractions for resilient information architecture platform for smart grid
US20180217954A1 (en) Asynchronous Start for Timed Functions
CN103677760A (en) Event parallel controller based on Openflow and event parallel processing method thereof
WO2024019474A1 (en) Bi-directional inverter with solar inverter function
CN103529789A (en) Maglev train levitation monitoring method and maglev train levitation monitoring system based on industrial Ethernet communication
CN104796688B (en) By the method for CEC communication detection equipment active states
Cho et al. The RTDEVS/CORBA environment for simulation-based design of distributed real-time systems
JP6564839B2 (en) MPI implementation system and method based on embedded operating system
CN207209640U (en) A kind of elevator remote monitoring system
WO2012065452A1 (en) Home automation system, control method thereof, and information processing center device
CN205596147U (en) WirelessHART adapter, network node and network
CN104636206A (en) Optimization method and device for system performance
JP3913608B2 (en) Intelligent type device that allows all intelligent type modules to share the same user input / output interface
WO2021048818A1 (en) Iiot agent device
WO2015089839A1 (en) Method and device for processing messages in shared queue and receiving core
JPH11306038A (en) Units and method for parallel operation processing
JPH0266640A (en) Debugger task scheduling system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14800357

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14800357

Country of ref document: EP

Kind code of ref document: A1