WO2021135496A1 - 一种支持多种通信协议的可扩展通信框架及通信方法 - Google Patents

一种支持多种通信协议的可扩展通信框架及通信方法 Download PDF

Info

Publication number
WO2021135496A1
WO2021135496A1 PCT/CN2020/120635 CN2020120635W WO2021135496A1 WO 2021135496 A1 WO2021135496 A1 WO 2021135496A1 CN 2020120635 W CN2020120635 W CN 2020120635W WO 2021135496 A1 WO2021135496 A1 WO 2021135496A1
Authority
WO
WIPO (PCT)
Prior art keywords
interface
communication
protocol
channel
data
Prior art date
Application number
PCT/CN2020/120635
Other languages
English (en)
French (fr)
Inventor
徐波银
Original Assignee
上海御渡半导体科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海御渡半导体科技有限公司 filed Critical 上海御渡半导体科技有限公司
Priority to US17/425,970 priority Critical patent/US11709722B2/en
Publication of WO2021135496A1 publication Critical patent/WO2021135496A1/zh

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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • G06F9/548Object oriented; Remote method invocation [RMI]

Definitions

  • the invention designs the field of semiconductor testing, and specifically relates to an extensible communication framework and communication method supporting multiple communication protocols.
  • the interface definitions of the related communication libraries are also diverse, each with different (mainly reflected in the function name and parameters), for example, the same means the connection, some are called Open, and some are called Connect; the same means Disconnect, some are called Close, and some are called Disconnect.
  • the difference in the communication library interface will cause the code of the business logic layer to face interface function calls with the same function but different names when integrating different protocol development, which undoubtedly destroys the readability and maintainability of the program.
  • the technical solution focuses on scalable support for different communication protocols, but lacks abstract design for different business models.
  • the purpose of the present invention is to provide an extensible communication framework and communication method that supports multiple communication protocols.
  • the logic code will not be affected in any way, which makes software code maintenance and function addition extremely convenient, and ultimately guarantees the quality of the product software.
  • a new class is created in the device interface, and the class is inherited from the device interface;
  • a channel protocol is created in the channel interface, and the channel protocol is inherited from the channel interface Create a new sub-protocol interface in the protocol interface, and the sub-protocol interface inherits from the protocol interface;
  • the software platform and the device communicate through the communication model, and call classes and channels in the communication process Protocol and sub-protocol interface.
  • the communication model includes a data issuing transaction command model and a data receiving service command model.
  • the protocol interface includes the IChannelSender interface, which is used to send data; the ISendAgreement interface, which is used to define the protocol when data is sent; the IChannelReceiver interface, which is used to realize data reception; and the IReceiveAgreement interface, which is used to define the data when receiving data.
  • a Sender interface when the software platform is connected to a device, a Sender interface, a SendAgreement interface, a Receiver interface, and a ReceiveAgreement interface are newly created in the protocol interface.
  • the device includes at least one channel, and each channel corresponds to a channel protocol and a sub-protocol interface in the communication framework.
  • An extensible communication framework supporting multiple communication protocols for device communication includes the following steps:
  • S01 Create a new class in the device interface, the class inherits from the device interface; the device connects to the software platform through the class; wherein the communication framework is used to connect the software platform and the device;
  • S02 Create a new channel protocol in the channel interface, the channel protocol is inherited from the channel interface, and the device connects to the software platform through the channel protocol;
  • S03 Create a new sub-protocol interface in the protocol interface, where the sub-protocol interface is inherited from the protocol interface, and the device implements data sending and receiving through the sub-protocol interface and the software platform;
  • S04 The device and the software platform use a communication model to communicate, and in the communication process, call the class, channel protocol, and sub-protocol interface.
  • the communication model includes a data issuing transaction command model and a data receiving service command model.
  • the protocol interface includes the IChannelSender interface, which is used to send data; the ISendAgreement interface, which is used to define the protocol when data is sent; the IChannelReceiver interface, which is used to realize data reception; and the IReceiveAgreement interface, which is used to define the data when receiving data.
  • Protocol In the step S03, a Sender interface, a SendAgreement interface, a Receiver interface and a ReceiveAgreement interface are newly created in the protocol interface.
  • the data receiving service command model completes the communication through synchronous call sending and monitoring, and the specific process is as follows:
  • S013 Synchronously call Listen, poll the monitoring data and return until it is called to stop monitoring; among them, for TCP-based monitoring, the link is first monitored, and then the data is monitored based on the link; for UDP-based monitoring, it directly monitors the specified IP And the data on the port;
  • the present invention uniformly defines the device interface, channel interface, and protocol interface.
  • it When importing different devices with different communication protocols, it only needs to implement the new communication protocol according to the established unified communication interface, and the upper-level business logic code It will not be affected in any way, which makes software code maintenance and function addition extremely convenient, and ultimately ensures the quality of product software.
  • Fig. 1 is a schematic diagram of an extensible communication framework supporting multiple communication protocols according to the present invention.
  • the present invention provides an extensible communication framework that supports multiple communication protocols, which is used to connect software platforms and devices, including a uniformly defined communication interface and a uniformly defined communication model, where the communication interface includes Device interface, channel interface and protocol interface.
  • the communication model calls the device interface, channel interface and protocol interface during communication.
  • the core of the present invention lies in the unified definition of communication interfaces, where the communication interfaces specifically include device interfaces, channel interfaces and protocol interfaces; by defining standard communication interfaces, different devices and protocols are encapsulated.
  • the problem solved by the present invention is to avoid the different communication protocols of different devices, and the various languages (C/C++/C#/JAVA, etc.) of each communication protocol (including TCP/UDP/GPIB/COM, etc.) have interfaces in the realization Defining the problem of inconsistency will in turn facilitate the standardized control of product software development.
  • the device class When the device is connected to the software platform through the communication framework, the device class uniformly inherits from the device interface, that is, the ICommunicationDevice interface in Figure 1, and the communication channel class of the device is uniformly inherited from the channel interface, that is, the ICommunicatingChannel interface in Figure 1.
  • a device can contain For multiple channels, the device class creates a communicable channel by calling the Connect interface.
  • the device interface that is, the ICommunicationDevice interface, defines the attributes and behaviors of the device. Attributes include ID, Name, communication mode (TCP/UDP/GPIB/COM, etc.), communication status (Interrupt, Error, Communicating), type (virtual device, physical device), device specification information (manufacturer, model, barcode, etc.); Behaviors include Connect, Send, Recive and Executive (Send+Receive).
  • the channel interface defines the attributes and behavior of the communication channel. Attributes include channel name, communication mode (TCP/UDP/GPIB/COM, etc.), communication target (such as IP: Port), send buffer size, receive buffer size, slot, group (used for different channel types Grouping) and their equipment; behaviors include SetOption and Connect.
  • Protocol interface including IChannelSender (channel sender) interface, used to send data; ISendAgreement (send protocol) interface, used to define the protocol when sending data, such as sending data command (command), sending data block mechanism , Sending timeout mechanism; IChannelReceiver (channel receiver) interface, used to achieve data reception; IReceiveAgreement (acceptance protocol) interface, used to define the protocol when data is received, mainly for data analysis.
  • the software platform When the software platform is connected to the device, create a new class in the device interface, and the class inherits from the device interface; create a new channel protocol in the channel interface, and the channel protocol inherits from the channel interface; create a new sub-protocol interface in the protocol interface, and the sub-protocol interface Inherited from the protocol interface, among them, when the software platform is connected to the device, the Sender interface (inherited from the IChannelSender interface), SendAgreement interface (inherited from the ISendAgreement interface), Receiver interface (inherited from the IChannelReceiver interface) and ReceiveAgreement interface (inherited) are created in the protocol interface From the IReceiveAgreement interface); the software platform and the device communicate through the communication model, and the class, channel protocol and sub-protocol interface are called during the communication process.
  • the Sender interface inherited from the IChannelSender interface
  • SendAgreement interface inherited from the ISendAgreement interface
  • Receiver interface inherited from the IChannel
  • the core of the present invention also lies in the unified definition of the communication model, distinguishing between Routine and Service.
  • the former is designed to be suitable for one-time transaction communication requirements, and the key is to emphasize the synchronization of sending and receiving; the latter is designed to be suitable for service communication
  • the key to the demand is to emphasize the asynchronous sending and receiving.
  • the communication model is based on the communication interface and inherits the communication scheme according to the actual business requirements. That is, the following two Command classes are inherited from as the base class, then the user's child There is no need to care about the data sending and receiving process in the class.
  • the communication model in the present invention includes a data issuing transaction command model DistributeRoutineCommand and a data receiving service command model AcceptServiceCommand.
  • the data distribution transaction command model DistributeRoutineCommand completes the communication by sending and receiving synchronously.
  • the specific process is as follows:
  • the data receiving service command model AcceptServiceCommand completes the communication through synchronous call sending and monitoring.
  • the specific process is as follows:
  • S013 Synchronously call Listen, poll and monitor the data return until it is called to stop monitoring; among them, for TCP (Transmission Control Protocol)-based monitoring, the link is monitored first, and then the data is monitored based on the link; UDP (User Datagram Protocol, User Datagram Protocol) monitoring directly monitors the data on the specified IP and port; among them, Listen is the service interface.
  • TCP Transmission Control Protocol
  • UDP User Datagram Protocol, User Datagram Protocol
  • the communication model is uniformly defined.
  • the business requirements of the product software are developed around the two communication models in the above scheme.
  • the processing logic of the communication layer is one of the models, which makes the upper business logic
  • the method for device communication with an extensible communication framework supporting multiple communication protocols provided by the present invention includes the following steps:
  • S01 When a new type of communication device is introduced, create a new class (such as DeviceA) in the device interface, which inherits from the device interface; the device connects to the software platform through the class; implements the ICommunicationDevice interface and implements the Connect interface because of the connection methods of different devices Is different from the process;
  • a new class such as DeviceA
  • S02 Create a channel protocol (such as ChannelA) for communication with the device, create a new channel protocol in the channel interface, the channel protocol inherits from the channel interface; realize Connect, because the connection methods and processes of different protocols are different;
  • ChannelA channel protocol
  • S03 Create a new sub-protocol interface in the protocol interface, the sub-protocol interface inherits from the protocol interface, and the device implements data sending and receiving through the sub-protocol interface and the software platform;
  • create the Sender interface and the SendAgreement interface which are inherited from the IChannelSender interface and the ISendAgreement interface, respectively; create the Receiver interface and the ReceiveAgreement interface, which are inherited from the IChannelReceiver interface and the IReceiveAgreement interface, respectively.
  • S04 The device and the software platform use the communication model to communicate, and in the communication process, call the class, channel protocol and sub-protocol interface.
  • the communication model in the present invention includes a data issuing transaction command model DistributeRoutineCommand and a data receiving service command model AcceptServiceCommand.
  • the data distribution transaction command model DistributeRoutineCommand completes the communication by sending and receiving synchronously.
  • the specific process is as follows:
  • the data receiving service command model AcceptServiceCommand completes the communication through synchronous call sending and monitoring.
  • the specific process is as follows:
  • S013 Synchronously invoke the Listen corresponding to the device, and poll the monitoring data to return until it is called to stop monitoring; among them, for TCP-based monitoring, the link is monitored first, and then the data is monitored based on the link; for UDP-based monitoring, then Directly monitor the data on the specified IP and port;
  • the communication model is uniformly defined.
  • the business requirements of the product software are developed around the two communication models in the above scheme.
  • the processing logic of the communication layer is one of the models, which makes the upper business logic

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Communication Control (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

本发明提供的一种支持多种通信协议的可扩展通信框架,用于连接软件平台和设备,包括通信接口和通信模型,其中,所述通信接口包括设备接口、通道接口和协议接口,所述通信模型在通信时调用设备接口、通道接口和协议接口;当所述软件平台连接设备时,在所述设备接口中新建类,且所述类继承自所述设备接口;在所述通道接口中新建通道协议,且所述通道协议继承自所述通道接口;在所述协议接口中新建子协议接口,且所述子协议接口继承自所述协议接口;所述软件平台和设备之间通过所述通信模型进行通信,且在通信过程中调用类、通道协议和子协议接口。本发明使得软件代码维护和功能新增变得极为方便,最终使得产品软件质量有了保障。

Description

一种支持多种通信协议的可扩展通信框架及通信方法
交叉引用
本申请要求2019年12月30日提交的申请号为CN201911388449.9的中国专利申请的优先权。上述申请的内容以引用方式被包含于此。
技术领域
本发明设计半导体测试领域,具体涉及一种支持多种通信协议的可扩展通信框架及通信方法。
技术背景
现有技术中对于不同的通信协议使用相应的通信库来开发,从而建立与设备的通信。比如socket(TCP/UDP)、GPIB、COM等,每一类协议在不同的开发语言(C/C++/JAVA/C#等)都有各自的接口函数定义(包括名称和参数)。
由于协议本身的不同和开发语言的不同,相关通信库的接口定义也是五花八门,各有不同(主要体现在函数名称和参数),比如同样表示连接,有的叫Open,有的叫Connect;同样表示断开连接,有的叫Close,有的叫Disconnect。
通信库接口的不同,会导致在集成不同协议开发时,业务逻辑层的代码需要面对同功能却不同名称的接口函数调用,这无疑是破坏了程序的可读性和可维护性。业界存在对于不同通信协议的封装,也囊括了诸多协议(包括各个领域的应用),比如visa。该技术方案重点是在于对不同通信协议的可扩展支持,但缺少对不同业务模型的抽象设计。
现有技术中软件平台在与设备通信时,面临的主要问题是因设备的不同 带来的通信协议不同,导致通信流程的实现无法统一和标准化,包括通信接口不统一和通信模型不统一。因此,设计一种通信协议和通信模型同时可扩展的通信框架是非常有必要的。
发明概要
本发明的目的是提供一种支持多种通信协议的可扩展通信框架及通信方法,当导入不同通信协议的不同设备时,只需根据既定的统一通信接口来实现新增的通信协议,上层业务逻辑代码不会受到任何影响,这使得软件代码维护和功能新增变得极为方便,最终使得产品软件质量有了保障。
为了实现上述目的,本发明采用如下技术方案:一种支持多种通信协议的可扩展通信框架,用于连接软件平台和设备,包括通信接口和通信模型,其中,所述通信接口包括设备接口、通道接口和协议接口,所述通信模型在通信时调用设备接口、通道接口和协议接口;
当所述软件平台连接设备时,在所述设备接口中新建类,且所述类继承自所述设备接口;在所述通道接口中新建通道协议,且所述通道协议继承自所述通道接口;在所述协议接口中新建子协议接口,且所述子协议接口继承自所述协议接口;所述软件平台和设备之间通过所述通信模型进行通信,且在通信过程中调用类、通道协议和子协议接口。
进一步地,所述通信模型包括数据下发事务命令模型和数据接收服务命令模型。
进一步地,所述协议接口包括IChannelSender接口,用于实现数据的发送;ISendAgreement接口,用于定义数据发送时的规约;IChannelReceiver接口,用于实现数据的接收;IReceiveAgreement接口,用于定义数据接收时 的规约。
进一步地,当所述软件平台连接设备时,在所述协议接口中新建Sender接口,SendAgreement接口,Receiver接口和ReceiveAgreement接口。
进一步地,所述设备包括至少一个通道,每个通道在所述通信框架中对应一个通道协议和一个子协议接口。
一种支持多种通信协议的可扩展通信框架进行设备通信的方法,包括如下步骤:
S01:在设备接口中新建类,所述类继承自所述设备接口;设备通过类连接软件平台;其中,所述通信框架用于连接软件平台和设备;
S02:在通道接口中新建通道协议,所述通道协议继承自所述通道接口,设备通过通道协议连接软件平台;
S03:在协议接口中新建子协议接口,所述子协议接口继承自所述协议接口,设备通过子协议接口与软件平台实现进行数据发送和接收;
S04:所述设备和软件平台采用通信模型进行通信,且在通信过程中,调用类、通道协议和子协议接口。
进一步地,所述通信模型包括数据下发事务命令模型和数据接收服务命令模型。
进一步地,所述协议接口包括IChannelSender接口,用于实现数据的发送;ISendAgreement接口,用于定义数据发送时的规约;IChannelReceiver接口,用于实现数据的接收;IReceiveAgreement接口,用于定义数据接收时的规约;所述步骤S03中在协议接口中新建Sender接口,SendAgreement接口,Receiver接口和ReceiveAgreement接口。
进一步地,所述数据下发事务命令模型通过同步调用发送和接收完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用Sender接口,发送指令消息;
S013:同步调用Receiver接口,接收数据;
S014:解析接收到的数据。
进一步地,所述数据接收服务命令模型通过同步调用发送和监听完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用Sender接口,发送指令消息;
S013:同步调用Listen,进行轮询监听数据返回,直至被调用停止监听;其中,对于基于TCP的监听,则先监听链接,再基于链接来监听数据;对于基于UDP的监听,则直接监听指定IP和端口上的数据;
S014:解析接收到的数据。
本发明的有益效果为:本发明统一定义设备接口、通道接口和协议接口,当导入不同通信协议的不同设备时,只需根据既定的统一通信接口来实现新增的通信协议,上层业务逻辑代码不会受到任何影响,这使得软件代码维护和功能新增变得极为方便,最终使得产品软件质量有了保障。
附图说明
附图1为本发明一种支持多种通信协议的可扩展通信框架的示意图。
发明内容
为使本发明的目的、技术方案和优点更加清楚,下面结合附图对本发明 的具体实施方式做进一步的详细说明。
如附图1所示,本发明提供的一种支持多种通信协议的可扩展通信框架,用于连接软件平台和设备,包括统一定义的通信接口和统一定义的通信模型,其中,通信接口包括设备接口、通道接口和协议接口,通信模型在通信时调用设备接口、通道接口和协议接口。
本发明的核心之处在于统一定义通信接口,其中通信接口具体包括设备接口、通道接口和协议接口;通过定义标准的通信接口,对不同设备和协议进行封装。本发明解决的问题是避免不同设备的通信协议各有不同,各个通信协议(包括TCP/UDP/GPIB/COM等)的各种语言(C/C++/C#/JAVA等)在实现上存在的接口定义不一致的问题,进而有利于产品软件开发的标准化控制。
当设备通过通信框架与软件平台连接时,设备类统一继承自设备接口,即附图1中ICommunicationDevice接口,设备的通信通道类统一继承自通道接口,即附图1中ICommunicatingChannel接口,一个设备可以包含多个通道,设备类通过调用Connect接口来创建一个可通信的通道。
具体地,设备接口,即ICommunicationDevice接口,定义设备具有的属性和行为。属性包括ID、Name、通信模式(TCP/UDP/GPIB/COM等)、通信状态(Interrupt、Error、Communicating)、类型(虚拟设备、物理设备)、设备规格信息(厂家、型号、条码等);行为包括Connect、Send、Recive和Excute(Send+Receive)。
通道接口,即ICommunicatingChannel接口,定义通信通道的属性和行为。属性包括通道名称、通信模式(TCP/UDP/GPIB/COM等)、通信目标(如 IP:Port)、发送缓冲区大小、接收缓冲区大小、槽位、组别(用于对不同通道类别的分组)和所属设备;行为包括SetOption、Connect。
协议接口,包括IChannelSender(通道发送者)接口,用于实现数据的发送;ISendAgreement(发送规约)接口,用于定义数据发送时的规约,比如发送数据的指令(command)、发送数据的分块机制、发送超时机制;IChannelReceiver(通道接受者)接口,用于实现数据的接收;IReceiveAgreement(接受规约)接口,用于定义数据接收时的规约,主要是对数据进行解析。
当软件平台连接设备时,在设备接口中新建类,且类继承自设备接口;在通道接口中新建通道协议,且通道协议继承自通道接口;在协议接口中新建子协议接口,且子协议接口继承自协议接口,其中,当软件平台连接设备时,在协议接口中新建Sender接口(继承自IChannelSender接口),SendAgreement接口(继承自ISendAgreement接口),Receiver接口(继承自IChannelReceiver接口)和ReceiveAgreement接口(继承自IReceiveAgreement接口);软件平台和设备之间通过通信模型进行通信,且在通信过程中调用类、通道协议和子协议接口。
本发明的核心之处还在于统一定义通信模型,区分Routine和Service两种类型,前者设计适用于一次性事务的通讯需求,其关键是强调发送和接收的同步;后者设计适用于服务的通讯需求,其关键是强调发送和接收的异步,通信模型是基于通信接口之上,根据实际的业务需求来继承自的通信方案,即把以下两个Command类作为基类继承自,那么用户的子类中就无须关心数据的发送和接收流程。本发明中通信模型包括数据下发事务命令模型 DistributeRoutineCommand和数据接收服务命令模型AcceptServiceCommand。
数据下发事务命令模型DistributeRoutineCommand通过同步调用发送和接收完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用Sender接口,发送指令消息;
S013:同步调用Receiver接口,接收数据;
S014:解析接收到的数据。
数据接收服务命令模型AcceptServiceCommand通过同步调用发送和监听完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用Sender接口,发送指令消息;
S013:同步调用Listen,进行轮询监听数据返回,直至被调用停止监听;其中,对于基于TCP(Transmission Control Protocol,传输控制协议)的监听,则先监听链接,再基于链接来监听数据;对于基于UDP(User Datagram Protocol,用户数据报协议)的监听,则直接监听指定IP和端口上的数据;其中,Listen为service接口。
S014:解析接收到的数据。
统一定义通信模型,产品软件的业务需求围绕着以上方案中的2种通信模型展开,虽然通信指令、通信数据会改变,但是通信层的处理逻辑都是其中的一种模型,这使得上层业务逻辑功能开发时无需关心通信层的处理逻辑,使得代码层次清晰,在提高了开发效率的同时,同样使得产品软件指令 有了保障。
本发明提供的一种支持多种通信协议的可扩展通信框架进行设备通信的方法,,包括如下步骤:
S01:当引入一类新的通信设备时,在设备接口中新建类(比如DeviceA),类继承自设备接口;设备通过类连接软件平台;实现ICommunicationDevice接口,实现Connect接口,因为不同设备的连接方式和过程是不同的;
S02:创建用于和该设备通信的通道协议(比如ChannelA),在通道接口中新建通道协议,通道协议继承自通道接口;实现Connect,因为不同协议的连接方式和过程是不同的;
S03:在协议接口中新建子协议接口,子协议接口继承自协议接口,设备通过子协议接口与软件平台实现进行数据发送和接收;
具体地,创建Sender接口和SendAgreement接口,分别继承自IChannelSender接口和ISendAgreement接口;创建Receiver接口和ReceiveAgreement接口,分别继承自IChannelReceiver接口和IReceiveAgreement接口。
S04:设备和软件平台采用通信模型进行通信,且在通信过程中,调用类、通道协议和子协议接口。
本发明中通信模型包括数据下发事务命令模型DistributeRoutineCommand和数据接收服务命令模型AcceptServiceCommand。
数据下发事务命令模型DistributeRoutineCommand通过同步调用发送和接收完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用该设备对应的Sender接口,发送指令消息;
S013:同步调用该设备对应的Receiver接口,接收数据;
S014:解析接收到的数据。
数据接收服务命令模型AcceptServiceCommand通过同步调用发送和监听完成通信,具体流程如下:
S011:与指定设备的通道协议建立连接;
S012:调用该设备对应的Sender接口,发送指令消息;
S013:同步调用该设备对应的Listen,进行轮询监听数据返回,直至被调用停止监听;其中,对于基于TCP的监听,则先监听链接,再基于链接来监听数据;对于基于UDP的监听,则直接监听指定IP和端口上的数据;
S014:解析接收到的数据。
统一定义通信模型,产品软件的业务需求围绕着以上方案中的2种通信模型展开,虽然通信指令、通信数据会改变,但是通信层的处理逻辑都是其中的一种模型,这使得上层业务逻辑功能开发时无需关心通信层的处理逻辑,使得代码层次清晰,在提高了开发效率的同时,同样使得产品软件指令有了保障。
以上所述仅为本发明的优选实施例,所述实施例并非用于限制本发明的专利保护范围,因此凡是运用本发明的说明书及附图内容所作的等同结构变化,同理均应包含在本发明所附权利要求的保护范围内。

Claims (10)

  1. 一种支持多种通信协议的可扩展通信框架,用于连接软件平台和设备,其特征在于,包括通信接口和通信模型,其中,所述通信接口包括设备接口、通道接口和协议接口,所述通信模型在通信时调用设备接口、通道接口和协议接口;
    当所述软件平台连接设备时,在所述设备接口中新建类,且所述类继承自所述设备接口;在所述通道接口中新建通道协议,且所述通道协议继承自所述通道接口;在所述协议接口中新建子协议接口,且所述子协议接口继承自所述协议接口;所述软件平台和设备之间通过所述通信模型进行通信,且在通信过程中调用类、通道协议和子协议接口。
  2. 根据权利要求1所述的一种支持多种通信协议的可扩展通信框架,其特征在于,所述通信模型包括数据下发事务命令模型和数据接收服务命令模型。
  3. 根据权利要求1所述的一种支持多种通信协议的可扩展通信框架,其特征在于,所述协议接口包括IChannelSender接口,用于实现数据的发送;ISendAgreement接口,用于定义数据发送时的规约;IChannelReceiver接口,用于实现数据的接收;IReceiveAgreement接口,用于定义数据接收时的规约。
  4. 根据权利要求3所述的一种支持多种通信协议的可扩展通信框架,其特征在于,当所述软件平台连接设备时,在所述协议接口中新建Sender接口,SendAgreement接口,Receiver接口和ReceiveAgreement接口。
  5. 根据权利要求1所述的一种支持多种通信协议的可扩展通信框架,其特征在于,所述设备包括至少一个通道,每个通道在所述通信框架中对应一 个通道协议和一个子协议接口。
  6. 一种支持多种通信协议的可扩展通信框架进行设备通信的方法,其特征在于,包括如下步骤:
    S01:在设备接口中新建类,所述类继承自所述设备接口;设备通过类连接软件平台;其中,所述通信框架用于连接软件平台和设备;
    S02:在通道接口中新建通道协议,所述通道协议继承自所述通道接口,设备通过通道协议连接软件平台;
    S03:在协议接口中新建子协议接口,所述子协议接口继承自所述协议接口,设备通过子协议接口与软件平台实现进行数据发送和接收;
    S04:所述设备和软件平台采用通信模型进行通信,且在通信过程中,调用类、通道协议和子协议接口。
  7. 根据权利要求6所述的一种支持多种通信协议的可扩展通信框架进行设备通信的方法,其特征在于,所述通信模型包括数据下发事务命令模型和数据接收服务命令模型。
  8. 根据权利要求7所述的一种支持多种通信协议的可扩展通信框架进行设备通信的方法,其特征在于,所述协议接口包括IChannelSender接口,用于实现数据的发送;ISendAgreement接口,用于定义数据发送时的规约;IChannelReceiver接口,用于实现数据的接收;IReceiveAgreement接口,用于定义数据接收时的规约;
    所述步骤S03中在协议接口中新建Sender接口,SendAgreement接口,Receiver接口和ReceiveAgreement接口。
  9. 根据权利要求8所述的一种支持多种通信协议的可扩展通信框架进行 设备通信的方法,其特征在于,所述数据下发事务命令模型通过同步调用发送和接收完成通信,具体流程如下:
    S011:与指定设备的通道协议建立连接;
    S012:调用Sender接口,发送指令消息;
    S013:同步调用Receiver接口,接收数据;
    S014:解析接收到的数据。
  10. 根据权利要求8所述的一种支持多种通信协议的可扩展通信框架进行设备通信的方法,其特征在于,所述数据接收服务命令模型通过同步调用发送和监听完成通信,具体流程如下:
    S011:与指定设备的通道协议建立连接;
    S012:调用Sender接口,发送指令消息;
    S013:同步调用Listen,进行轮询监听数据返回,直至被调用停止监听;其中,对于基于TCP的监听,则先监听链接,再基于链接来监听数据;对于基于UDP的监听,则直接监听指定IP和端口上的数据;
    S014:解析接收到的数据。
PCT/CN2020/120635 2019-12-30 2020-10-13 一种支持多种通信协议的可扩展通信框架及通信方法 WO2021135496A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/425,970 US11709722B2 (en) 2019-12-30 2020-10-13 Extensible communication framework and communication method supporting multiple communication protocols

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911388449.9A CN110928608B (zh) 2019-12-30 2019-12-30 一种支持多种通信协议的可扩展通信框架及通信方法
CN201911388449.9 2019-12-30

Publications (1)

Publication Number Publication Date
WO2021135496A1 true WO2021135496A1 (zh) 2021-07-08

Family

ID=69861310

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/120635 WO2021135496A1 (zh) 2019-12-30 2020-10-13 一种支持多种通信协议的可扩展通信框架及通信方法

Country Status (3)

Country Link
US (1) US11709722B2 (zh)
CN (1) CN110928608B (zh)
WO (1) WO2021135496A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110928608B (zh) * 2019-12-30 2024-03-22 上海御渡半导体科技有限公司 一种支持多种通信协议的可扩展通信框架及通信方法
CN111711940B (zh) * 2020-04-29 2023-10-31 杭州涂鸦信息技术有限公司 一种智能设备数据交互方法、智能设备和存储装置
CN112714170B (zh) * 2020-12-23 2022-08-16 卡斯柯信号有限公司 一种可配置通信协议的通用地面软件框架系统及应用

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857566A (zh) * 2012-09-06 2013-01-02 上海计算机软件技术开发中心 一种可软件定制的物联网智能网关
CN103853602A (zh) * 2012-12-04 2014-06-11 天津中兴软件有限责任公司 一种阅读器驱动装置、方法及阅读器控制系统
WO2014197879A1 (en) * 2013-06-06 2014-12-11 Activevideo Networks, Inc. Overlay rendering of user interface onto source video
CN106850758A (zh) * 2016-12-30 2017-06-13 广州慧扬信息系统科技有限公司 应用于医院信息系统的数据交换方法
US20170277648A1 (en) * 2014-06-06 2017-09-28 Apple Inc. Interface Emulator using FIFOs
CN110928608A (zh) * 2019-12-30 2020-03-27 上海御渡半导体科技有限公司 一种支持多种通信协议的可扩展通信框架及通信方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6691299B1 (en) * 1995-07-19 2004-02-10 Ricoh Company, Ltd. Object-oriented communications framework system with support for multiple remote machine types
FR2801704A1 (fr) * 1999-11-26 2001-06-01 Bull Sa Procede de communication sous plusieurs protocoles entre une application et une ressource de systeme
US20030147383A1 (en) * 2001-09-26 2003-08-07 Karen Capers Object communication services software development system and methods
WO2004092857A2 (en) * 2003-04-11 2004-10-28 Nnt, Inc. System, method and computer program product for remote vehicle diagnostics, telematics, monitoring, configuring, and reprogramming
US7483991B2 (en) * 2004-03-25 2009-01-27 Microsoft Corporation Instant messaging communications channel for transporting data between objects executing within a managed code environment
US7543023B2 (en) * 2005-03-15 2009-06-02 Microsoft Corporation Service support framework for peer to peer applications
CN101256612B (zh) * 2008-04-01 2010-11-03 北京飞天诚信科技有限公司 基于.Net卡的程序保护方法和系统
US9467483B2 (en) * 2012-12-20 2016-10-11 Sap Se ABAP channels for event signaling
US9462089B1 (en) * 2013-03-15 2016-10-04 Kaazing Corporation Communication channels
CN103795720A (zh) * 2014-01-24 2014-05-14 北京仿真中心 一种支持多接口协议处理的软件框架实现方法
CN108400992B (zh) * 2018-03-06 2020-05-26 电信科学技术第五研究所有限公司 一种流式通信数据协议解析软件框架实现系统及方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857566A (zh) * 2012-09-06 2013-01-02 上海计算机软件技术开发中心 一种可软件定制的物联网智能网关
CN103853602A (zh) * 2012-12-04 2014-06-11 天津中兴软件有限责任公司 一种阅读器驱动装置、方法及阅读器控制系统
WO2014197879A1 (en) * 2013-06-06 2014-12-11 Activevideo Networks, Inc. Overlay rendering of user interface onto source video
US20170277648A1 (en) * 2014-06-06 2017-09-28 Apple Inc. Interface Emulator using FIFOs
CN106850758A (zh) * 2016-12-30 2017-06-13 广州慧扬信息系统科技有限公司 应用于医院信息系统的数据交换方法
CN110928608A (zh) * 2019-12-30 2020-03-27 上海御渡半导体科技有限公司 一种支持多种通信协议的可扩展通信框架及通信方法

Also Published As

Publication number Publication date
CN110928608A (zh) 2020-03-27
CN110928608B (zh) 2024-03-22
US11709722B2 (en) 2023-07-25
US20220327010A1 (en) 2022-10-13

Similar Documents

Publication Publication Date Title
WO2021135496A1 (zh) 一种支持多种通信协议的可扩展通信框架及通信方法
CN104283967B (zh) 一种基于物联网数据采集的第三方数据服务系统
CN112261080B (zh) 一种应用于电力物联网的边缘物联代理方法
WO2011150715A1 (zh) 分布式控制系统中采集第三方设备数据的方法及装置
CN106936932B (zh) 一种通过云服务协议访问机器人软件包的方法
CN106506519A (zh) WCF框架net.tcp协议跨平台通信的系统及方法
CN113709166A (zh) 分布式业务网关实现方法、装置、计算机设备及存储介质
CN108063694A (zh) 通过核心程序在通讯端口上进行压力测试的系统及其方法
CN110224972A (zh) 一种面向多协议多类型设备接入系统、方法及装置
WO2018176244A1 (zh) 数据采集方法、装置和动环网管系统
CN116319953B (zh) 一种半导体设备数据采集方法
US20030120782A1 (en) Method and computer system for client server inter process communication
CN110058900A (zh) 基于可插拔组件框架的数据传输服务系统
CN114095584A (zh) 工业设备数据的模型转换与构建方法及可读存储介质
CN112235316A (zh) 一种仪器集成的数据通信方法
US20040243693A1 (en) Inbound connector
CN116668988A (zh) 基于多源传感设备的c-v2x统一接入网关及接入方法
CN116743886A (zh) 基于物联网的工业控制设备数据采集系统
US10289462B1 (en) Systems and methods for integration of websphere optimized local adapters with the spring framework
JP3805197B2 (ja) ネットワークエレメントを電気通信システムに接続する方法
CN109257264B (zh) 开通以太网虚拟专用网络服务的系统及方法
CN112506485A (zh) 业务处理系统
CN110502418B (zh) 一种实现远程调试的方法
CN111711660B (zh) 电子设备间通信的方法、装置、设备及存储介质
CN112073536A (zh) 一种实现不能直接互访网络之间安全传递处理数据的方法

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: 20909563

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: 20909563

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20909563

Country of ref document: EP

Kind code of ref document: A1