CN104852971B - Plug-in protocol device and data communication method based on plug-in protocol - Google Patents
Plug-in protocol device and data communication method based on plug-in protocol Download PDFInfo
- Publication number
- CN104852971B CN104852971B CN201510203046.8A CN201510203046A CN104852971B CN 104852971 B CN104852971 B CN 104852971B CN 201510203046 A CN201510203046 A CN 201510203046A CN 104852971 B CN104852971 B CN 104852971B
- Authority
- CN
- China
- Prior art keywords
- protocol
- plug
- manager
- communication object
- configuration file
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
Abstract
本发明提供一种插件式协议装置及基于插件式协议的数据通信方法,用以解决目前的嵌入式应用开发对于应用的协议支持不够灵活,无法做到基于不同网络链路实现不同业务的问题。其中,基于插件式协议的数据通信方法包括:读取通信方的链路信息;创建与通信方进行通信的通信对象;根据链路信息加载通信对象的上下文信息,得到加载后的通信对象;将加载后的通信对象中的业务数据按照业务协议进行转换;在经过业务协议转换后的通信对象按照传输协议进行转换并封装后发送至通信方,该方案实现了基于不同网络链路实现不同业务的功能。
The present invention provides a plug-in protocol device and a data communication method based on the plug-in protocol, which are used to solve the problem that the current embedded application development is not flexible enough for application protocol support and cannot realize different services based on different network links. Wherein, the data communication method based on the plug-in protocol includes: reading the link information of the communicating party; creating a communication object that communicates with the communicating party; loading the context information of the communication object according to the link information to obtain the loaded communication object; The service data in the loaded communication object is converted according to the service protocol; the communication object after the service protocol conversion is converted according to the transmission protocol, encapsulated and sent to the communicating party. This solution realizes the realization of different services based on different network links. Function.
Description
技术领域technical field
本发明涉及通讯领域,特别是涉及一种插件式协议装置及基于插件式协议的数据通信方法。The invention relates to the field of communication, in particular to a plug-in protocol device and a data communication method based on the plug-in protocol.
背景技术Background technique
目前,在基于智能终端的应用开发工作中,一个重要的任务,就是与不同服务器进行交互,对私有协议进行解析,执行业务逻辑。在开发过程中,基础功能经常重复性开发,包括基础的网络(tcp/ip)、数据加密以及私有业务协议,这些功能的开发占据了大部分的开发时间。由于核心业务往往具有一致性,重复实现业务不便于维护和扩展,增加了开发维护成本。目前随着智能终端硬件水平的不断提高,智能终端设备的处理能力和存储能力不断提高,网络环境不断改善,能够实现一些较为复杂的功能,但是随着数据处理能力要求越来越高,需要参与计算的原始数据越来愈多,计算的复杂性越来越高。硬件配置相对较低的智能设备对复杂计算的处理缓慢而容易失败,面对较为复杂的计算,会导致存储能力和计算能力不足,此时,需要基于云的服务器参与存储和计算。At present, in the application development work based on the intelligent terminal, an important task is to interact with different servers, parse the private protocol, and execute the business logic. During the development process, basic functions are often developed repeatedly, including basic network (tcp/ip), data encryption, and private business protocols. The development of these functions occupies most of the development time. Because the core business is often consistent, it is inconvenient to maintain and expand the repeated implementation of the business, which increases the development and maintenance cost. At present, with the continuous improvement of the hardware level of intelligent terminals, the processing capabilities and storage capabilities of intelligent terminal devices, and the continuous improvement of the network environment, some more complex functions can be realized. More and more raw data are calculated, and the complexity of the calculation is getting higher and higher. Smart devices with relatively low hardware configuration are slow to process complex calculations and are prone to failure. In the face of more complex calculations, storage capacity and computing power will be insufficient. At this time, cloud-based servers are required to participate in storage and calculation.
Android、IOS以及windows系统的智能设备的属性不同,但共性也很明显,支持成熟的开发语言,较好的联网方式和网路速度,对网络基础协议支持很好。以上各种操作系统可以基于不同的计算机语言进行开发,为基于智能终端的应用协议栈插件化提供了可能。现有的嵌入式应用开发并非基于插件化,因此升级时需要全部更新;用户无法选择性定制应用,必须下载量大且较为完整的应用,对于应用的协议支持也不够灵活,无法做到不同网络链路,实现不同业务;现在的云技术侧重于存储,对协同计算则涉及较少,而当智能嵌入式设备的硬件无法满足计算存储需求时,需要一种模式来实现手机端计算的分布性。Android, IOS and Windows systems have different attributes, but the commonality is also obvious. They support mature development languages, better networking methods and network speeds, and support basic network protocols. The above various operating systems can be developed based on different computer languages, which provides the possibility for the plug-in of the application protocol stack based on the intelligent terminal. Existing embedded application development is not based on plug-ins, so it needs to be fully updated when upgrading; users cannot selectively customize applications, and must download large and relatively complete applications, and the protocol support for applications is not flexible enough to achieve different networks. link to realize different services; the current cloud technology focuses on storage, and involves less collaborative computing, and when the hardware of intelligent embedded devices cannot meet the computing and storage requirements, a mode is needed to realize the distributed computing on the mobile phone. .
发明内容SUMMARY OF THE INVENTION
本发明提供一种插件式协议装置及基于插件式协议的数据通信方法,用以解决目前的嵌入式应用开发对于应用的协议支持不够灵活,无法做到基于不同网络链路实现不同业务的问题。The invention provides a plug-in protocol device and a data communication method based on the plug-in protocol, which are used to solve the problem that the current embedded application development is not flexible enough to support the application protocol and cannot realize different services based on different network links.
根据本发明的一个方面,提供了一种插件式协议装置,包括:插件配置管理器、业务协议插件管理器以及基础协议插件管理器;插件配置管理器,用于根据通信方的链路信息对业务协议插件管理器以及基础协议插件管理器进行调度;业务协议插件管理器,用于对终端接收或发送的通信对象中的业务数据进行业务协议的转换;基础协议插件管理器,用于对终端接收或发送的通信对象进行传输协议封装。According to an aspect of the present invention, a plug-in protocol device is provided, including: a plug-in configuration manager, a service protocol plug-in manager, and a basic protocol plug-in manager; The service protocol plug-in manager and the basic protocol plug-in manager perform scheduling; the service protocol plug-in manager is used to convert the service protocol of the service data in the communication object received or sent by the terminal; the basic protocol plug-in manager is used for the terminal The communication object received or sent is encapsulated by the transport protocol.
其中,插件配置管理器包括:插件管理器以及配置管理器;配置管理器中存储有协议配置文件;插件管理器用于调用配置管理器中的协议配置文件,根据协议配置文件加载基础协议插件管理器中的基础协议插件配置信息以及加载业务协议插件管理器中的业务协议插件配置信息,根据基础协议插件配置信息以及业务协议插件配置信息配置基础协议插件以及业务协议插件。The plug-in configuration manager includes: a plug-in manager and a configuration manager; the configuration manager stores a protocol configuration file; the plug-in manager is used to call the protocol configuration file in the configuration manager, and load the basic protocol plug-in manager according to the protocol configuration file The basic protocol plug-in configuration information in and the business protocol plug-in configuration information in the business protocol plug-in manager are loaded, and the basic protocol plug-in and the business protocol plug-in are configured according to the basic protocol plug-in configuration information and the business protocol plug-in configuration information.
其中,装置还包括:更新模块,用于从配置管理器中读取协议配置文件的时间戳,携带时间戳访问协议配置文件的升级服务器,如果读取到的时间戳与升级服务器的中的协议配置文件的时间戳不一致,则从升级服务器中下载更新的协议配置文件;下载模块,用于使用下载到的更新的协议配置文件的时间戳与终端本地的协议配置文件的时间戳进行对比,如果二者不一致,则根据更新的协议配置文件在终端生成更新的插件信息以及版本信息,并从升级服务器下载更新的插件。Wherein, the device also includes: an update module for reading the timestamp of the protocol configuration file from the configuration manager, and the upgrade server carrying the timestamp to access the protocol configuration file, if the read timestamp matches the protocol in the upgrade server If the timestamps of the configuration files are inconsistent, download the updated protocol configuration file from the upgrade server; the download module is used to compare the timestamp of the downloaded updated protocol configuration file with the timestamp of the local protocol configuration file of the terminal, if If the two are inconsistent, the updated plug-in information and version information are generated at the terminal according to the updated protocol configuration file, and the updated plug-in is downloaded from the upgrade server.
其中,通信对象包括终端向计算请求代理服务器发送的计算参数,插件配置管理器具体用于:在将经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之后,接收来自计算请求代理服务器返回的计算结果,将计算结果发送至业务协议插件管理器。The communication object includes the calculation parameters sent by the terminal to the calculation request proxy server, and the plug-in configuration manager is specifically used for: after the communication object converted by the service protocol is converted according to the transmission protocol, packaged and sent to the communication party, received The calculation result returned from the calculation request proxy server is sent to the service protocol plug-in manager.
进一步的,装置还包括:传输控制协议TCP层,用于对终端待发送以及接收的数据进行TCP封装;安全套接层SSL,用于对在TCP层传输的数据进行加密。Further, the device further includes: a transmission control protocol TCP layer, used to perform TCP encapsulation on data to be sent and received by the terminal; and a secure socket layer SSL, used to encrypt data transmitted at the TCP layer.
根据本发明的另一个方面,提供了一种基于插件式协议的数据通信方法,包括:读取通信方的链路信息;创建与通信方进行通信的通信对象;根据链路信息加载通信对象的上下文信息,得到加载后的通信对象;将加载后的通信对象中的业务数据按照业务协议进行转换;在经过业务协议转换后的通信对象按照传输协议进行封装后发送至通信方。According to another aspect of the present invention, a data communication method based on a plug-in protocol is provided, comprising: reading link information of a communicating party; creating a communication object for communicating with the communicating party; loading a communication object according to the link information The context information is obtained, and the loaded communication object is obtained; the business data in the loaded communication object is converted according to the business protocol; the communication object converted by the business protocol is encapsulated according to the transmission protocol and sent to the communication party.
进一步的,上述方法还包括:调用协议配置文件,根据协议配置文件加载基础协议插件配置信息以及业务协议插件配置信息;根据基础协议插件配置信息以及业务协议插件配置信息配置基础协议插件以及业务协议插件。Further, the above method further includes: calling the protocol configuration file, loading the basic protocol plug-in configuration information and the business protocol plug-in configuration information according to the protocol configuration file; configuring the basic protocol plug-in and the business protocol plug-in according to the basic protocol plug-in configuration information and the business protocol plug-in configuration information. .
其中,上述方法还包括:从配置管理器中读取协议配置文件的时间戳,携带时间戳访问协议配置文件的升级服务器,如果读取到的时间戳与升级服务器的中的协议配置文件的时间戳不一致,则从升级服务器中下载更新的协议配置文件;使用下载到的更新的协议配置文件的时间戳与终端本地的协议配置文件的时间戳进行对比,如果二者不一致,则根据更新的协议配置文件在终端生成更新的插件信息以及版本信息,并从升级服务器下载更新的插件。Wherein, the above method also includes: reading the timestamp of the protocol configuration file from the configuration manager, and accessing the upgrade server of the protocol configuration file with the timestamp, if the read timestamp is the same as the time of the protocol configuration file in the upgrade server If the stamps are inconsistent, download the updated protocol configuration file from the upgrade server; use the timestamp of the downloaded updated protocol configuration file to compare with the timestamp of the local protocol configuration file of the terminal. The configuration file generates updated plug-in information and version information on the terminal, and downloads the updated plug-in from the upgrade server.
其中,通信对象包括终端向计算请求代理服务器发送的计算参数,方法还包括:在将经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之后,接收来自计算请求代理服务器返回的计算结果;将计算结果按照传输协议进行转换;将转换后的计算结果按照业务协议进行转换后提供给终端。Wherein, the communication object includes the calculation parameter sent by the terminal to the calculation request proxy server, and the method further includes: after the communication object converted by the service protocol is converted according to the transmission protocol, packaged and sent to the communication party, receiving the data from the calculation request proxy server. The calculation result returned by the server; the calculation result is converted according to the transmission protocol; the converted calculation result is converted according to the service protocol and provided to the terminal.
其中,上下文信息中包括:表明通信对象是否支持安全套接层SSL的指示信息、通信对象使用的业务协议以及通信对象使用的传输协议,当上下文信息中表明通信对象支持SSL时,方法还包括,在将经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之前,按照SSL对通信对象进行加密。Wherein, the context information includes: indication information indicating whether the communication object supports SSL, the business protocol used by the communication object, and the transmission protocol used by the communication object, and when the context information indicates that the communication object supports SSL, the method further includes, in The communication object after the business protocol conversion is converted according to the transmission protocol and packaged and sent to the communication party, and the communication object is encrypted according to SSL.
本发明实施例提供的方案,基于插件式的协议栈,将通信传输协议以及业务协议分别进行管理,基于终端需求统一进行调度,且,将终端接收到的以及发送的数据分别进行业务协议转换以及传输协议封装,实现了基于不同网络链路实现不同业务的功能。The solution provided by the embodiment of the present invention is based on a plug-in protocol stack, separately manages the communication transmission protocol and the service protocol, performs unified scheduling based on terminal requirements, and performs service protocol conversion on the data received and sent by the terminal. The transmission protocol encapsulation realizes the function of realizing different services based on different network links.
附图说明Description of drawings
图1是本发明实施例1中插件式协议装置的结构框图;1 is a structural block diagram of a plug-in protocol device in Embodiment 1 of the present invention;
图2是本发明实施例1中插件式协议装置借助服务集群实现复杂计算的示意图;2 is a schematic diagram of a plug-in protocol device implementing complex computing by means of a service cluster in Embodiment 1 of the present invention;
图3是本发明实施例3提供的应用协议栈的插件管理器加载插件的流程图;Fig. 3 is the flow chart that the plug-in manager of the application protocol stack provided by Embodiment 3 of the present invention loads plug-ins;
图4是本发明实施例2的协议栈的调用使用的流程图;Fig. 4 is the flow chart of the calling use of the protocol stack of Embodiment 2 of the present invention;
图5是本发明实施例2的协议栈插件更新的流程图;5 is a flowchart of the protocol stack plug-in update according to Embodiment 2 of the present invention;
图6是本发明实施例2的协议栈插件更新的流程图;6 is a flowchart of the protocol stack plug-in update in Embodiment 2 of the present invention;
图7是本发明实施例3的基于插件式协议的数据通信方法的流程图。FIG. 7 is a flowchart of a data communication method based on a plug-in protocol according to Embodiment 3 of the present invention.
具体实施方式Detailed ways
为了解决现有技术的嵌入式应用开发对于应用的协议支持不够灵活,无法做到基于不同网络链路实现不同业务的问题,本发明提供了一种插件式协议装置及基于插件式协议的数据通信方法,以下结合附图以及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不限定本发明。In order to solve the problem that the embedded application development in the prior art is not flexible enough for the application protocol support and cannot realize different services based on different network links, the present invention provides a plug-in protocol device and data communication based on the plug-in protocol. method, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to illustrate the present invention, but not to limit the present invention.
实施例1Example 1
本发明实施例提供一种插件式协议装置,具体的,该装置为应用于智能终端的插件式应用协议栈,如图1所示,该装置具体可以包括如下组成部分,需要说明的是,该图仅为示意图,图1中所示各组成部分的具体个数在本实施例中不做具体限定:An embodiment of the present invention provides a plug-in protocol device. Specifically, the device is a plug-in application protocol stack applied to an intelligent terminal. As shown in FIG. 1 , the device may specifically include the following components. It should be noted that the The figure is only a schematic diagram, and the specific number of each component shown in FIG. 1 is not specifically limited in this embodiment:
插件配置管理器、业务协议插件管理器以及基础协议插件管理器;Plug-in configuration manager, business protocol plug-in manager, and basic protocol plug-in manager;
插件配置管理器,用于根据通信方的链路信息对业务协议插件管理器以及基础协议插件管理器进行调度,以通过业务协议插件管理器以及基础协议插件管理器对接收或待发送的通信对象进行协议转换,如图1所示,该层位于最上层,该插件配置管理器通过诸如配置文件、云端存储等,进行个体智能终端的协议插件配置,具体的,该插件可以分为两个子层,即业务协议插件管理器以及基础协议插件管理器。The plug-in configuration manager is used to schedule the service protocol plug-in manager and the basic protocol plug-in manager according to the link information of the communicating party, so that the received or to-be-sent communication objects are processed by the service protocol plug-in manager and the basic protocol plug-in manager. Perform protocol conversion, as shown in Figure 1, this layer is located at the top layer, the plug-in configuration manager configures the protocol plug-in of the individual intelligent terminal through configuration files, cloud storage, etc. Specifically, the plug-in can be divided into two sub-layers , namely the business protocol plug-in manager and the base protocol plug-in manager.
业务协议插件管理器,用于对终端接收或发送的通信对象中的业务数据进行业务协议的转换,且用于管理用户的业务插件,其中,业务插件负责各个业务模块的数据转化和处理;The business protocol plug-in manager is used to convert the business data in the communication object received or sent by the terminal, and is used to manage the user's business plug-in, wherein the business plug-in is responsible for the data conversion and processing of each business module;
基础协议插件管理器,用于对终端接收或发送的通信对象进行传输协议封装和转换,该基础协议插件管理器,用于管理基础协议插件,其中,基础协议例如,mqtt协议、基于物联网家电的e++协议以及http协议等。The basic protocol plug-in manager is used to encapsulate and convert the communication object received or sent by the terminal. The basic protocol plug-in manager is used to manage the basic protocol plug-ins. e++ protocol and http protocol, etc.
如图1所示,该装置还包括TCP(Transmission Control Protocol,传输控制协议)层以及SSL(Secure Sockets Layer,安全套接层),其中,传输控制协议TCP层,用于对终端待发送以及接收的数据进行TCP封装;安全套接层SSL层,用于对在TCP层传输的数据进行加密。As shown in FIG. 1, the device further includes a TCP (Transmission Control Protocol, transmission control protocol) layer and an SSL (Secure Sockets Layer, secure sockets layer), wherein the transmission control protocol TCP layer is used for the terminal to be sent and received. The data is encapsulated by TCP; the SSL layer of the secure socket layer is used to encrypt the data transmitted at the TCP layer.
基于此:上述插件配置管理器包括:插件管理器以及配置管理器;配置管理器中存储有协议配置文件;插件管理器用于调用配置管理器中的协议配置文件,根据协议配置文件加载基础协议插件管理器中的基础协议插件配置信息以及加载业务协议插件管理器中的业务协议插件配置信息,根据基础协议插件配置信息以及业务协议插件配置信息配置基础协议插件以及业务协议插件。Based on this: the above plug-in configuration manager includes: a plug-in manager and a configuration manager; the configuration manager stores a protocol configuration file; the plug-in manager is used to call the protocol configuration file in the configuration manager, and load the basic protocol plug-in according to the protocol configuration file. The basic protocol plug-in configuration information in the manager and the business protocol plug-in configuration information in the business protocol plug-in manager are loaded, and the basic protocol plug-in and the business protocol plug-in are configured according to the basic protocol plug-in configuration information and the service protocol plug-in configuration information.
上述装置还具有插件更新功能,基于此,上述装置还包括:更新模块,用于从配置管理器中读取协议配置文件的时间戳,携带时间戳访问协议配置文件的升级服务器,如果读取到的时间戳与升级服务器的中的协议配置文件的时间戳不一致,则从升级服务器中下载更新的协议配置文件;使用下载到的更新的协议配置文件的时间戳与终端本地的协议配置文件的时间戳进行对比,如果二者不一致,则根据更新的协议配置文件在终端生成更新的插件信息以及版本信息,并从升级服务器下载更新的插件。The above-mentioned device also has a plug-in update function, and based on this, the above-mentioned device also includes: an update module for reading the timestamp of the protocol configuration file from the configuration manager, and the upgrade server carrying the timestamp to access the protocol configuration file. If the timestamp of the updated protocol configuration file is inconsistent with the timestamp of the protocol configuration file in the upgrade server, download the updated protocol configuration file from the upgrade server; use the timestamp of the downloaded updated protocol configuration file and the time of the local protocol configuration file of the terminal If the two are inconsistent, the updated plug-in information and version information are generated at the terminal according to the updated protocol configuration file, and the updated plug-in is downloaded from the upgrade server.
基于上述装置可以实现在终端硬件性能无法进行复杂计算的情况下,使用较为精简的协议和集群进行计算请求交互,进而通过集群向智能终端推送计算结果,图2是基于上述装置来借助服务集群来实现复杂计算的示意图,如图2所示,该计算过程涉及到几个参与计算的主体:智能终端,计算集群,上下文存储集群,其中,上述通信对象包括终端向计算请求代理服务器发送的计算参数,基于此,上述插件配置管理器具体用于:在将经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之后,接收来自计算请求代理服务器返回的计算结果,将计算结果发送至业务协议插件管理器。Based on the above device, when the terminal hardware performance cannot perform complex calculations, a relatively simplified protocol can be used to interact with the cluster for computing requests, and then the calculation results can be pushed to the intelligent terminal through the cluster. Figure 2 is based on the above device. A schematic diagram of implementing complex computing, as shown in Figure 2, the computing process involves several subjects involved in computing: intelligent terminals, computing clusters, and context storage clusters, wherein the above communication objects include computing parameters sent by the terminal to the computing request proxy server , based on this, the above-mentioned plug-in configuration manager is specifically used for: after the communication object converted by the business protocol is converted according to the transmission protocol and packaged and sent to the communication party, the calculation result returned from the calculation request proxy server is received, and the The calculation result is sent to the business protocol plug-in manager.
实施例2Example 2
本实施例协议栈的加载、使用、调用、更新以及进行复杂计算来进一步对本发明实施例1提供的插件式协议栈进行进一步说明。Loading, using, calling, updating, and performing complex calculations of the protocol stack in this embodiment further describe the plug-in protocol stack provided in Embodiment 1 of the present invention.
图3是本发明实施例3提供的应用协议栈的插件管理器加载插件的流程图。如图3所示,该流程包括如下步骤:FIG. 3 is a flowchart of loading a plug-in by a plug-in manager of an application protocol stack according to Embodiment 3 of the present invention. As shown in Figure 3, the process includes the following steps:
第一步,插件管理器调用配置管理器获取基础协议配置信息,例如,是否支持加密、业务协议插件信息等信息;In the first step, the plug-in manager calls the configuration manager to obtain basic protocol configuration information, such as whether to support encryption, service protocol plug-in information and other information;
第二步,插件管理器调用基础协议插件管理器,加载配置信息中读取的基础协议插件配置信息;In the second step, the plug-in manager calls the basic protocol plug-in manager to load the basic protocol plug-in configuration information read in the configuration information;
第三步,插件管理器调用业务插件协议管理器,加载业务协议插件管理器。第四步,完成协议栈插件的加载。In the third step, the plug-in manager calls the service plug-in protocol manager, and loads the service protocol plug-in manager. The fourth step is to complete the loading of the protocol stack plug-in.
图4是本发明实施例2的协议栈的调用使用的流程图,如图4所示,该流程包括如下步骤:Fig. 4 is the flow chart of calling and using the protocol stack according to the second embodiment of the present invention. As shown in Fig. 4 , the flow chart includes the following steps:
第一步,从配置管理器通信方的读取链路模板信息,也即上述实施例1中记载的链路信息,该链路模板信息描述一些固定链路的配置信息,例如,升级服务器的地址、端口、配置的业务协议以及基础协议等信息,待模块启动后,以此信息以模板形式创建通讯链路,配置通讯上下文对象。The first step is to read the link template information from the communication party of the configuration manager, that is, the link information recorded in the above Embodiment 1. The link template information describes the configuration information of some fixed links, for example, the upgrade server's Information such as address, port, configured service protocol, and basic protocol, etc., after the module is started, use this information to create a communication link in the form of a template, and configure a communication context object.
第二步,根据读取到的链路模板信息创建通讯对象;The second step is to create a communication object according to the read link template information;
第三步,根据模板信息加载通讯对象的上下文信息,包括是否支持SSL,使用哪个业务协议,基于什么基础协议信息;The third step is to load the context information of the communication object according to the template information, including whether to support SSL, which business protocol to use, and what basic protocol information is based on;
第四步,使用创建好的通讯对象进行应用协议的通讯以及处理。The fourth step is to use the created communication object to communicate and process the application protocol.
图5是本发明实施例2的协议栈插件更新的流程图,如图5所示,该流程包括如下步骤:FIG. 5 is a flowchart of the protocol stack plug-in update according to Embodiment 2 of the present invention. As shown in FIG. 5 , the flowchart includes the following steps:
第一步,从配置管理器读取配置文件的时间戳,携带该时间戳访问升级服务器,如果二者时间戳不一致,则下载配置文件;The first step is to read the timestamp of the configuration file from the configuration manager, and access the upgrade server with the timestamp. If the two timestamps are inconsistent, download the configuration file;
第二步,对比下载到的配置文件以及本地配置文件,生成要更新的插件信息及版本;The second step is to compare the downloaded configuration file and the local configuration file, and generate the information and version of the plug-in to be updated;
第三步,下载插件到临时目录;The third step, download the plug-in to the temporary directory;
第四步,对临时目录插件进行处理,卸载旧版本插件,更新新版本插件,完毕。The fourth step is to process the temporary directory plug-in, uninstall the old version of the plug-in, update the new version of the plug-in, and complete.
图6是本发明实施例2的协议栈插件更新的流程图,如图6所示,该流程包括如下步骤:FIG. 6 is a flowchart of a protocol stack plug-in update according to Embodiment 2 of the present invention. As shown in FIG. 6 , the flowchart includes the following steps:
第一步,智能终端应用向计算代理服务器申请计算,并携带本次参与计算的输入条件;In the first step, the intelligent terminal application applies to the calculation proxy server for calculation, and carries the input conditions for participating in the calculation;
第二步,对智能终端进行hash计算,获取该智能终端的GUID(全局统一标识符);The second step is to perform hash calculation on the smart terminal to obtain the GUID (Global Uniform Identifier) of the smart terminal;
第三步,计算服务器接到代理服务器申请后,根据GUID查询该GUID之前参与计算的上下文信息,以及规格化的存储信息,利用查询到的信息进行计算;In the third step, after receiving the application from the proxy server, the computing server queries the context information that the GUID participated in the calculation before and the normalized storage information according to the GUID, and uses the queried information for calculation;
第四步,将计算结果传递给代理计算服务器;The fourth step is to transmit the calculation result to the proxy calculation server;
第五步,代理计算服务器生成计算结果格式,推送给智能终端。In the fifth step, the proxy computing server generates the calculation result format and pushes it to the intelligent terminal.
实施例3Example 3
本实施例提供了一种基于插件式协议的数据通信方法,图7是本发明实施例3的基于插件式协议的数据通信方法的流程图,如图7所示,包括:This embodiment provides a data communication method based on a plug-in protocol. FIG. 7 is a flowchart of the data communication method based on a plug-in protocol according to Embodiment 3 of the present invention, as shown in FIG. 7 , including:
步骤701:读取通信方的链路信息;Step 701: Read the link information of the communicating party;
步骤702:创建与通信方进行通信的通信对象;Step 702: Create a communication object that communicates with the communication party;
步骤703:根据链路信息加载通信对象的上下文信息,得到加载后的通信对象;Step 703: Load the context information of the communication object according to the link information to obtain the loaded communication object;
步骤704:将加载后的通信对象中的业务数据按照业务协议进行转换;Step 704: Convert the service data in the loaded communication object according to the service protocol;
步骤705:在经过业务协议转换后的通信对象按照传输协议进行转换并封装后发送至通信方。Step 705 : The communication object converted by the service protocol is converted according to the transmission protocol and encapsulated, and then sent to the communicating party.
其中,上述方法还包括:调用协议配置文件,根据协议配置文件加载基础协议插件配置信息以及业务协议插件配置信息;根据基础协议插件配置信息以及业务协议插件配置信息配置基础协议插件以及业务协议插件。The above method further includes: calling the protocol configuration file, loading the basic protocol plug-in configuration information and the business protocol plug-in configuration information according to the protocol configuration file; configuring the basic protocol plug-in and the business protocol plug-in according to the basic protocol plug-in configuration information and the business protocol plug-in configuration information.
进一步的,上述方法还包括:从配置管理器中读取协议配置文件的时间戳,携带时间戳访问协议配置文件的升级服务器,如果读取到的时间戳与升级服务器的中的协议配置文件的时间戳不一致,则从升级服务器中下载更新的协议配置文件;使用下载到的更新的协议配置文件的时间戳与终端本地的协议配置文件的时间戳进行对比,如果二者不一致,则根据更新的协议配置文件在终端生成更新的插件信息以及版本信息,并从升级服务器下载更新的插件。Further, the above method also includes: reading the timestamp of the protocol configuration file from the configuration manager, and accessing the upgrade server of the protocol configuration file with the timestamp, if the read timestamp is the same as that of the protocol configuration file in the upgrade server. If the timestamps are inconsistent, download the updated protocol configuration file from the upgrade server; compare the timestamp of the downloaded updated protocol configuration file with the timestamp of the local protocol configuration file of the terminal. The protocol configuration file generates updated plug-in information and version information on the terminal, and downloads the updated plug-in from the upgrade server.
其中,通信对象包括终端向计算请求代理服务器发送的计算参数,方法还包括:在将经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之后,接收来自计算请求代理服务器返回的计算结果;将计算结果按照传输协议进行转换;将转换后的计算结果按照业务协议进行转换后提供给终端。Wherein, the communication object includes the calculation parameter sent by the terminal to the calculation request proxy server, and the method further includes: after the communication object converted by the service protocol is converted according to the transmission protocol, packaged and sent to the communication party, receiving the data from the calculation request proxy server. The calculation result returned by the server; the calculation result is converted according to the transmission protocol; the converted calculation result is converted according to the service protocol and provided to the terminal.
其中,上下文信息中包括表明通信对象是否支持SSL的指示信息、通信对象使用的业务协议以及通信对象使用的传输协议,当上下文信息中表明通信对象支持SSL时,方法还包括,在在经过业务协议转换后的通信对象按照传输协议进行转换并组包后发送至通信方之前,按照SSL对通信对象进行加密。Wherein, the context information includes indication information indicating whether the communication object supports SSL, the business protocol used by the communication object, and the transmission protocol used by the communication object. When the context information indicates that the communication object supports SSL, the method further includes, after passing the business protocol. The converted communication object is converted according to the transmission protocol and packaged, and before being sent to the communication party, the communication object is encrypted according to SSL.
本发明提供的方案基于自由组合的插件式应用协议栈框架,实现用户应用的定制化需求,且在应用需要升级时,可以仅进行应用的局部升级,而不需要全部升级;且基于流行的分布式构架进行重新架构后实现智能终端计算的分布话,降低对手机的性能要求。The solution provided by the present invention is based on a freely combined plug-in application protocol stack framework, which realizes the customization requirements of user applications, and when the application needs to be upgraded, only a partial upgrade of the application can be performed without all upgrades; and based on popular distribution After the re-architecture is carried out, the distributed computing of the intelligent terminal is realized, and the performance requirements for the mobile phone are reduced.
尽管为示例目的,已经公开了本发明的优选实施例,本领域的技术人员将意识到各种改进、增加和取代也是可能的,因此,本发明的范围应当不限于上述实施例。Although the preferred embodiments of the present invention have been disclosed for illustrative purposes, those skilled in the art will appreciate that various modifications, additions and substitutions are possible, and therefore, the scope of the present invention should not be limited to the above-described embodiments.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510203046.8A CN104852971B (en) | 2015-04-24 | 2015-04-24 | Plug-in protocol device and data communication method based on plug-in protocol |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510203046.8A CN104852971B (en) | 2015-04-24 | 2015-04-24 | Plug-in protocol device and data communication method based on plug-in protocol |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN104852971A CN104852971A (en) | 2015-08-19 |
| CN104852971B true CN104852971B (en) | 2020-11-10 |
Family
ID=53852322
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510203046.8A Active CN104852971B (en) | 2015-04-24 | 2015-04-24 | Plug-in protocol device and data communication method based on plug-in protocol |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN104852971B (en) |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106657371B (en) * | 2017-01-03 | 2020-01-21 | 北京奇虎科技有限公司 | Scheduling method and device for transmission node |
| CN107277018A (en) * | 2017-06-22 | 2017-10-20 | 重庆大学 | The method that a kind of utilization request/data aggregate improves WebServer https application performances |
| CN112866182B (en) * | 2019-11-28 | 2023-05-23 | 浙江宇视科技有限公司 | Data docking method, device and computer readable storage medium |
| CN113608773B (en) * | 2021-08-17 | 2024-06-18 | 联想(北京)有限公司 | Method and device for upgrading update component and electronic equipment |
| CN113473098B (en) * | 2021-08-20 | 2023-03-24 | Vidaa(荷兰)国际控股有限公司 | Display apparatus and display method |
| CN113726579A (en) * | 2021-09-02 | 2021-11-30 | 国网信息通信产业集团有限公司 | Method and device for realizing power Internet of things communication protocol plug-in |
| CN114531437B (en) * | 2022-02-14 | 2023-02-17 | 镁佳(北京)科技有限公司 | MQTT-based non-homologous uplink data processing method and device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101141359A (en) * | 2007-10-24 | 2008-03-12 | 中兴通讯股份有限公司 | United service access system and access method |
| CN101170734A (en) * | 2007-11-28 | 2008-04-30 | 华为技术有限公司 | Method and device for realizing service interworking between different networks |
| CN103685419A (en) * | 2012-09-21 | 2014-03-26 | 中兴通讯股份有限公司 | Business processing method and apparatus |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9077683B2 (en) * | 2010-12-08 | 2015-07-07 | At&T Intellectual Property I, L.P. | Architecture for network management in a multi-service network |
-
2015
- 2015-04-24 CN CN201510203046.8A patent/CN104852971B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101141359A (en) * | 2007-10-24 | 2008-03-12 | 中兴通讯股份有限公司 | United service access system and access method |
| CN101170734A (en) * | 2007-11-28 | 2008-04-30 | 华为技术有限公司 | Method and device for realizing service interworking between different networks |
| CN103685419A (en) * | 2012-09-21 | 2014-03-26 | 中兴通讯股份有限公司 | Business processing method and apparatus |
Non-Patent Citations (2)
| Title |
|---|
| "The Communication Bridge for Message Handling and ProtocolConversion Services between ISDN and PSDN";Kun Suk Kim, Tae Man Han, Pyung Dong Cho;《Proceedings of IEEE Asia Pacific Conference on Circuits and Systems ‘96》;19961121;全文 * |
| "软件换技术综述";苏宏;《通信技术》;20020630;全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN104852971A (en) | 2015-08-19 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104852971B (en) | Plug-in protocol device and data communication method based on plug-in protocol | |
| EP3047701B1 (en) | Updating firmware on mobile devices | |
| WO2018103521A1 (en) | Monitoring method for server, device, and storage medium | |
| US9535681B2 (en) | Validating availability of firmware updates for client devices | |
| CN108322496A (en) | Image file distribution method and system, computer readable storage medium, electronic equipment | |
| CN114616807B (en) | Method and system for managing and controlling a communication network | |
| CN108337327A (en) | Resource acquisition method and proxy server | |
| CN104854843A (en) | Loading a re-directed web page on a web browser of a client device in a communications system | |
| CN105100021A (en) | Method, device and system for triggering device management sessions | |
| CN113556359A (en) | A communication protocol conversion method, device, system and gateway device | |
| CN105786511A (en) | Implementation method for terminal device Web application management | |
| CN112416396B (en) | Application program updating method and system | |
| CN104598525B (en) | A kind of replication runs, equipment and system | |
| CN110225510A (en) | Method and apparatus for burning embedded SIM card | |
| CN114115969A (en) | Hot updating method and system based on real Native | |
| CN112073247A (en) | Block chain network deployment method, device, computer system and medium | |
| WO2017124736A1 (en) | Method, device and system for transmitting upgrade abnormality information | |
| CN102148839B (en) | Method, device and system for managing FTP (file transfer protocol) server | |
| CN115314376B (en) | Method and device for deploying network plug-ins in cluster, electronic equipment and storage medium | |
| WO2015117522A1 (en) | Parameter configuration data processing method and device, and parameter configuration method and device | |
| CN112527377B (en) | Application generation processing method, device, computer equipment and storage medium | |
| CN111984616B (en) | A method, device and system for updating shared files | |
| WO2025016039A1 (en) | Data transmission method and apparatus, and related device | |
| CN115442446B (en) | Industrial communication management system and method of micro-service architecture under industrial Internet | |
| CN106533716A (en) | Method and system for managing northbound interface |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| CB03 | Change of inventor or designer information |
Inventor after: Li Li Inventor after: Chen Jinlei Inventor after: Pan Yuelin Inventor after: Zhao Honglei Inventor after: Mou Tingting Inventor before: Chen Jinlei |
|
| CB03 | Change of inventor or designer information | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |