CN116233283B - Dynamic expansion and hot plug method of equipment communication protocol - Google Patents

Dynamic expansion and hot plug method of equipment communication protocol Download PDF

Info

Publication number
CN116233283B
CN116233283B CN202310494938.2A CN202310494938A CN116233283B CN 116233283 B CN116233283 B CN 116233283B CN 202310494938 A CN202310494938 A CN 202310494938A CN 116233283 B CN116233283 B CN 116233283B
Authority
CN
China
Prior art keywords
service
equipment
communication protocol
theme
message
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
Application number
CN202310494938.2A
Other languages
Chinese (zh)
Other versions
CN116233283A (en
Inventor
王怀採
王先红
李修庆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Shengding Technology Development Co ltd
Original Assignee
Hunan Shengding Technology Development Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Shengding Technology Development Co ltd filed Critical Hunan Shengding Technology Development Co ltd
Priority to CN202310494938.2A priority Critical patent/CN116233283B/en
Publication of CN116233283A publication Critical patent/CN116233283A/en
Application granted granted Critical
Publication of CN116233283B publication Critical patent/CN116233283B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0806Configuration setting for initial configuration or provisioning, e.g. plug-and-play
    • H04L41/0809Plug-and-play configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Small-Scale Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a dynamic expansion and hot plug method of a device communication protocol, relates to the technical field of the Internet of things, and can realize flexible access and safety control of edge devices. The method comprises the following steps: environmental deployment: deploying a real-time database, a message server, a Config microservice and a Handler microservice; and (3) equipment registration: judging whether a communication protocol of a new device exists in the Config micro service; protocol extension: selecting a standard communication protocol framework predefined by Config micro-service, and expanding a communication protocol of new equipment; device activation: the Config micro-service starts to send a device activation message to the system theme consumption of the message server; monitoring by equipment: dynamically creating a monitor corresponding to the new equipment service theme; and (3) data communication: the edge terminal equipment sends data to a service theme of the message server; and (3) data processing: searching a communication protocol corresponding to the new equipment, and analyzing the message.

Description

Dynamic expansion and hot plug method of equipment communication protocol
Technical Field
The application relates to the technical field of the internet of things, in particular to a dynamic expansion and hot plug method of a device communication protocol.
Background
With the rapid development of the internet of things technology, various devices are connected in a geometric-level speed-increasing mode. Every time a new device is accessed in the service system, a set of communication protocols related to the device must be redefined, and then the service system needs to be redeployed and started before the service system can be put into use. Conversely, to uninstall the device, the service associated with the device communication protocol is stopped, and the service system is restarted.
Moreover, from a security perspective, if control based on a single device is to be implemented, it is also necessary to separately write a communication protocol specific to that standby instance, which is extremely cumbersome to implement and difficult to expand.
In the implementation manner, the access burden of the internet of things equipment is greatly increased, so that an effective solution is needed to be provided, and the flexible access and the safety control of the edge terminal equipment are realized.
Disclosure of Invention
In order to solve at least one technical problem in the background technology, the embodiment of the application provides a dynamic expansion and hot plug method of a device communication protocol, which can realize flexible access and safety control of edge devices.
The method for dynamically expanding and hot-plugging the equipment communication protocol provided by the embodiment of the application comprises the following steps:
environmental deployment: deploying a real-time database, a message server, a Config microservice and a Handler microservice;
and (3) equipment registration: judging whether the Config micro service has a communication protocol of the edge terminal equipment or not;
if the communication protocol of the edge equipment does not exist, executing a protocol expansion step;
if the communication protocol of the edge equipment exists, selecting an item and the communication protocol to be registered by the edge equipment, finishing the registration of the equipment after the information of the equipment is input, and executing an equipment activation step;
protocol extension: selecting a standard communication protocol framework predefined by Config micro-service, and expanding a communication protocol of edge terminal equipment;
device activation: the Config micro-service starts to send equipment activation information to the system theme consumption of the message server, and simultaneously dynamically creates tenants, namespaces and business themes in the message server and performs certificate authorization;
monitoring by equipment: after receiving the equipment activation message, the consumption starting monitor of the Handler micro-service dynamically creates a monitor corresponding to the service theme of the edge equipment;
and (3) data communication: the edge terminal equipment sends data to a service theme of the message server;
and (3) data processing: after receiving the message, the corresponding service monitor of the Handler micro-service searches the communication protocol corresponding to the edge device, analyzes the message, and stores the remote data into the real-time database.
In one possible implementation manner, the method for dynamically expanding and hot-plugging the device communication protocol provided by the embodiment of the application includes the following steps:
protocol development: defining the attribute, action, event and heartbeat of the edge terminal equipment to be added based on a standard communication protocol frame predefined by Config micro-service;
and (3) model packaging: compiling and unit testing four types of codes of attribute, action, event and heartbeat of the edge terminal equipment to be added, and respectively packaging the four types of codes into independent model packages;
model verification: uploading the model package to an object storage library or a file server through a Config micro service, then downloading the model package to a local place to read the model, and carrying out normalization check and verification on the model package;
if the verification fails, prompting an error and displaying an improvement suggestion;
if the verification is passed, performing model preloading;
model preloading: loading the model package passing the verification into a Config micro service, and carrying out object instantiation preheating;
if the preheating fails, prompting and displaying a conflict processing method;
if the preheating is successful, executing model deployment;
model deployment: the Config micro service loads and sends the message to the system theme model of the message server, and after the Handler micro service receives the message, asynchronous operation is carried out, a model package is loaded, and the dynamic deployment of the communication protocol of the edge terminal equipment is completed.
In one possible implementation manner, the method for dynamically expanding and hot-plugging the device communication protocol provided by the embodiment of the present application includes the following steps:
creating tenants: the Config micro service dynamically adds tenants in a message server by taking a project as a unit;
creating a namespace: dynamically adding a naming space in a message server by taking a model library as a unit;
creating a theme: establishing a corresponding theme according to the security control level when the equipment is registered;
generating a key: generating an authorization key according to the master station machine number, the account key and the project key information;
certificate authorization: generating a security certificate according to the secret key;
activating message: the Config microservice initiates sending an activation message to the consumption system topic of the message server.
In one possible implementation manner, the method for dynamically expanding and hot-plugging the device communication protocol provided in the embodiment of the present application, the device monitoring step includes:
after receiving the activation message, the Handler micro-service inquires the cache information and judges whether the current node starts the monitoring of the service theme of the edge equipment;
if so, the program prompts and returns;
if not, inquiring a protocol framework to which the edge equipment belongs, initializing a service processing interface, creating monitoring on the service theme of the edge equipment, storing the activated information in a cache, and sharing the load in a polling mode aiming at monitoring on the same service theme by each node.
In one possible implementation manner, the method for dynamically expanding and hot-plugging the device communication protocol provided in the embodiment of the present application includes the following data processing steps:
device subscription: the edge terminal equipment sends production data in real time according to a theme name pre-agreed in an expansion protocol;
theme consumption: the theme monitor of the Handler micro service receives the message and calls the business processing interface agreed by the protocol to process the message;
and (3) data preservation: the service processing interface analyzes the data, generates a data instantiation object, creates a data table structure and dynamically inserts the data record;
and (3) online analysis: and the data statistics analysis related service system inquires the real-time data of the equipment and performs stream calculation.
In one possible implementation manner, the security control level in the created theme is divided into item level control, equipment object model level control and equipment instance level control according to the dynamic extension and hot plug method of the equipment communication protocol provided by the embodiment of the application;
project-level control is that all devices under a project belong to the same tenant and namespace, and share related topics;
the equipment object model level control is that the same equipment belongs to the same name space and shares related subjects;
the device instance level control has a separate theme for each device.
The beneficial effects of this application: the embodiment of the application provides a dynamic expansion and hot plug method of a device communication protocol, which relies on a set of self-expansion standard communication protocol frames, greatly reduces the workload of definition and analysis of various device communication protocols, greatly facilitates the connection and disconnection of edge devices and old devices, reduces the dependence on the starting and deployment of a service system, and realizes the random insertion and extraction of devices under the standard communication protocol frames.
Meanwhile, by means of a message server, through a dynamic creation, subscription and cancellation mechanism of a theme, hot plug deployment of equipment under three-level control is realized, real-time communication of data of the equipment can be rapidly realized, rapid blocking under abnormal conditions is realized, the spreading of safety problems is avoided, the cost of manual intervention is reduced, and fine management and control is realized.
1. The self-expanding standard communication protocol framework reduces the definition and analysis workload of the edge equipment protocol.
2. The flexible inserting and extracting mechanism for the equipment reduces the dependence on a service system and improves the working efficiency.
3. By means of refined three-level control, safety control of equipment is achieved, operation is simplified, and labor cost is saved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief description will be given below of the drawings that are needed in the embodiments or the prior art descriptions, it being obvious that the drawings in the following description are some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort to a person skilled in the art.
FIG. 1 is a schematic view of an environment deployment in a method for dynamic extension and hot plug of a device communication protocol according to an embodiment of the present application;
FIG. 2 is a flowchart of a technical implementation of Config micro-services in a method for dynamic extension and hot plug of a device communication protocol according to an embodiment of the present application;
fig. 3 is a flowchart of a technical implementation of the Han dler micro service in the method for dynamically expanding and hot-plugging the device communication protocol according to the embodiment of the present application.
Detailed Description
With the rapid development of the internet of things technology, various devices are connected in a geometric-level speed-increasing mode. Every time an edge device is accessed in a service system, a set of communication protocols related to the device must be redefined, and then the service system needs to be redeployed and started to be put into use. Conversely, to uninstall the device, the service associated with the device communication protocol is stopped, and the service system is restarted.
At present, the communication protocol of the equipment is complicated and difficult to uniformly define: for communication protocols commonly used in the internet of things, such as MQTT, XMPP, COAP, HTTP, TCP, etc., the standard set of communication protocol frames are defined to correspond to the standard set of communication protocol frames. For the edge terminal equipment, the edge terminal equipment can be configured according to the standard frame according to the communication protocol, so that flexible customization and dynamic expansion are realized.
The equipment is difficult to dynamically access, and the safety control is as follows: aiming at the added edge terminal equipment, a service theme and a corresponding service monitor are synchronously established through a message publishing and subscribing mechanism, so that the dynamic access and unloading of the equipment can be realized, and the fine management and control of the equipment can be realized.
From the security point of view, if control based on a single device is to be implemented, it is also necessary to separately write a communication protocol specific to the standby instance, the implementation is extremely cumbersome and difficult to expand.
In the implementation manner, the access burden of the internet of things equipment is greatly increased, so that an effective solution is needed to be provided, and the flexible access and the safety control of the edge equipment are realized.
Based on the above, the embodiment of the application provides a method for dynamically expanding and hot-plugging a device communication protocol, by which flexible access and safety control of edge devices can be realized.
The implementation of the examples of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1-3, an embodiment of the present application provides a method for dynamically expanding and hot-plugging a device communication protocol, including the following steps:
environmental deployment: deploying a real-time database, a message server, a Config microservice, a Handler microservice, wherein:
real-time database: the method is characterized by providing a time driving and blending resource allocation algorithm, adopting a real-time data model, combining a real-time system and a database technology, and being applied to data acquisition of the Internet of things. The data and the transaction have definite time limit, and the running condition of the field device, the execution time of the transaction, the deadline and the like can be faithfully reflected; the contradiction between time and storage space can be properly processed, and mass data can be efficiently processed. The database may be selected TDengine, influxDB, openTSDB, etc.
Message server: based on queue and messaging techniques, middleware is provided for synchronous or asynchronous, reliable message transmission for applications in a network. There are a number of currently available products such as RabbitM Q, emqX, rocketMQ, kafka, pulsar, etc. The selecting of the support degree of the Internet of things includes: 1) Support common MQTT, XMPP, COAP, HTTP, and TCP protocols; 2) Supporting creation of multiple tenants according to dimensions such as projects, users, groups and the like, supporting degree of protocol division, and grading security authentication; 3) The version above MQTT3.1 is supported, and repeated consumption is avoided; 4) Dynamic listening is supported.
Config and Handler micro services: is the environment in which the business system operates, the development language may select Java, python, C, etc., suggesting the use of an environment that supports JVM. The software architecture suggests a micro-service architecture that facilitates automatic registration and configuration of services.
And (3) equipment registration: and judging whether the Config micro service has a communication protocol of the edge terminal equipment or not.
If there is no communication protocol of the edge device, a protocol expansion step is performed.
If the communication protocol of the edge equipment exists, selecting an item and the communication protocol to be registered by the edge equipment, finishing the registration of the equipment after inputting the information of the equipment, and executing the equipment activating step.
Protocol extension: selecting a standard communication protocol framework predefined by Config micro-service, and expanding a communication protocol of edge terminal equipment, wherein:
the protocol expansion step specifically includes:
protocol development: and defining the attribute, action, event and heartbeat of the edge terminal equipment to be added based on a standard communication protocol framework predefined by the Config micro-service.
And (3) model packaging: compiling and unit testing four types of codes of the attribute, action, event and heartbeat of the edge terminal equipment to be added, and respectively packaging the four types of codes into independent model packages.
Model verification: and uploading the model package to an object repository or a file server through a Config micro service, then downloading the model package to a local place to read the model, and performing normalization check and verification on the model package.
If the verification fails, an error is prompted and an improvement suggestion is displayed.
If the verification is passed, model preloading is performed.
Model preloading: and loading the model package which passes the verification into a Config micro service, and carrying out object instantiation preheating.
If the preheating fails, prompting and displaying a conflict processing method.
If the warmup is successful, the model deployment is performed.
Model deployment: the Config micro service loads and sends the message to the system theme model of the message server, and after the Handler micro service receives the message, asynchronous operation is carried out, a model package is loaded, and the dynamic deployment of the communication protocol of the edge terminal equipment is completed.
Device activation: config micro-service starts to send device activation message to system theme consumption of message server, and simultaneously dynamically creates tenant, name space, service theme and certificate authority in message server, wherein:
referring to fig. 2, the device activation step specifically includes:
creating tenants: config micro-services add tenants dynamically in message servers in terms of items.
Creating a namespace: namespaces are dynamically added in the message server in units of model libraries.
Creating a theme: establishing a corresponding theme according to the security control level when the equipment is registered, wherein:
the security control level in the creation theme is classified into item-level control, equipment object model-level control, and equipment instance-level control. Project-level control is that all devices under a project belong to the same tenant and namespace, and share related topics; the equipment object model level control is that the same equipment belongs to the same name space and shares related subjects; the device instance level control has a separate theme for each device.
Generating a key: and generating an authorization key according to the master station machine number, the account key and the project key information.
Certificate authorization: a security certificate is generated from the key.
Activating message: the Config microservice initiates sending an activation message to the consumption system topic of the message server.
Monitoring by equipment: after the consumption start monitor of the Handler micro-service receives the device activation message, dynamically creating a monitor corresponding to the service theme of the edge device, wherein:
referring to fig. 3, the device monitoring step specifically includes:
after the Handler micro-service receives the activation message, the buffer information is queried, and whether the current node starts the service theme monitoring of the edge terminal equipment is judged.
If so, the program prompts and returns.
If not, inquiring a protocol framework to which the edge equipment belongs, initializing a service processing interface, creating monitoring on the service theme of the edge equipment, storing the activated information in a cache, and sharing the load in a polling mode aiming at monitoring on the same service theme by each node.
And (3) data communication: the edge device sends data to the service theme of the message server.
And (3) data processing: after receiving the message, the corresponding service monitor of the Handler micro-service searches the communication protocol corresponding to the edge device, analyzes the message, and stores the remote data into a real-time database, wherein:
the data processing steps specifically comprise:
device subscription: and the edge terminal equipment sends the production data in real time according to the theme name pre-agreed in the extension protocol.
Theme consumption: the theme listener of the Handler micro service receives the message and calls the service processing interface agreed by the protocol to process the message.
And (3) data preservation: the service processing interface analyzes the data, generates a data instantiation object, creates a data table structure and dynamically inserts the data record.
And (3) online analysis: and the data statistics analysis related service system inquires the real-time data of the equipment and performs stream calculation.
According to the dynamic expansion and hot plug method of the device communication protocol, a set of self-expansion standard communication protocol frames are used, the workload of definition and analysis of various device communication protocols is greatly reduced, the access of edge devices and the removal of old devices are greatly facilitated, the dependence on the starting and deployment of a service system is reduced, and the random insertion and extraction of devices under the standard communication protocol frames are realized.
Meanwhile, by means of a message server, through a dynamic creation, subscription and cancellation mechanism of a theme, hot plug deployment of equipment under three-level control is realized, real-time communication of data of the equipment can be rapidly realized, rapid blocking under abnormal conditions is realized, the spreading of safety problems is avoided, the cost of manual intervention is reduced, and fine management and control is realized. The flexible inserting and extracting mechanism for the equipment reduces the dependence on a service system and improves the working efficiency. By means of refined three-level control, safety control of equipment is achieved, operation is simplified, and labor cost is saved.
Taking dynamic access to an edge device as an example, describing the implementation principles of dynamic expansion of a communication protocol, dynamic activation of the device and instant messaging of data:
referring to fig. 1, the system participant main body mainly comprises four parts: message server, real-time database, config microservice, and Handler microservice, wherein:
dynamic expansion of the communication protocol is realized through Config micro-service, and a set of standard communication protocol frames corresponding to the common Internet of things protocols, such as HTTP, TCP, MQTT, XMPP, COAP, are predefined in the system for the edge terminal equipment to access. The data format of the communication is not limited by the quasi-communication protocol framework, and Json, message, XML, binary string and the like are supported. The protocol framework describes the object model and the business algorithm of the equipment by using objectification, and comprehensively defines the attribute, action, event and heartbeat of the object model.
And realizing hot plug and instant communication of the equipment through the Handler micro-service. When the micro service is started, initializing work is carried out, a system tenant, a system name space and a six-system theme are established by default in a message server, and six-system monitors corresponding to the six-system theme are started and are respectively used for performing function inverse correction on model deployment, service theme consumption activation, service theme production activation, service theme consumption stop, service theme production stop and service theme transmission.
The following is a brief description of the implementation process.
1. Protocol extension: when a request for adding the edge terminal equipment exists, a standard communication protocol framework predefined by Config micro-service is selected, and the communication protocol of the equipment is expanded, wherein the standard communication protocol comprises a data format, an analysis method, a processing result, reverse control and the like;
2. and (3) protocol encapsulation: encapsulating each part of protocol into a complete functional package;
3. protocol checking: uploading the functional package to a Config micro-service, checking the protocol, and sending a protocol loading message to a system theme 'model loading' of a message server after the checking is passed;
4. protocol loading: the Handler micro service model loading monitor receives the protocol loading message, starts to download the function package, and dynamically loads the new equipment protocol into the protocol library;
5. device activation: the Config micro-service sends a device activation message to the system theme "consumption start" of the message server, and simultaneously dynamically creates a tenant, a name space, a service theme (such as a topic_a theme, a six-system theme which is not predefined in the Handler micro-service) and performs certificate authorization in the message server.
6. Monitoring by equipment: after the "consumption start listener" of the Handler micro service receives the device activation message, dynamically creating a listener corresponding to the service theme of the device (here, a service listener dynamically creating a topic_a theme, such as a Listener_a, is not a six-system listener predefined in the Handler micro service).
7. And (3) data communication: the edge device sends data to the traffic topic "topic_a" to the message server.
8. And (3) data processing: after receiving the message, the corresponding service monitor "listener_a" of the Handler micro service searches the protocol corresponding to the device, analyzes the message, and stores the remote data into the real-time database.
System platform architecture:
a first layer: the real-time database stores the acquired real-time data of the equipment;
a second layer: the message server supports dynamic creation, consumption and production of the theme and realizes asynchronous communication;
third layer: the micro service clusters comprise Config micro service clusters, and the dynamic expansion of the communication protocol is realized; and a Handler micro service cluster is used for realizing hot plug and instant messaging of equipment.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
Taking the MQTT protocol as an example, the specific implementation process of the protocol expansion and the data acquisition of the edge equipment is described.
The first step: the environment deployment comprises a real-time database, a message server, a Config micro-service and a Handler micro-service, and optional business components comprise a cache server and an object storage server;
and a second step of: protocol expansion, when a new device type is accessed, expanding the protocol first;
step 2.1: protocol development, in this example, an MQTT communication protocol framework is selected to describe the attributes, actions, events and heartbeats of the device. If the attribute of a video recorder device is defined, the class name is "Tv Prop", where "Tv" represents $ { custom class name }, and "Prop" represents $ { object model classification }. The class must implement an IMqttR interface, representing the topic subscription, for receiving messages. The @ Dev note, which indicates that the type of theme is "Prop", is exemplified as follows:
two methods of IMqttR interface:
the fields of the Recorder subclass, i.e. the properties of the device, are defined by the developer himself, each field having to be annotated with @ Prop. The properties of the recorder device defined in this example are:
SDevice is used to define the common attributes of devices, defaulting to 4 attribute fields, timestamp, device number, message number, device name, respectively.
The @ Dev annotation identifies the type of topic, the name of the hyper-table, the name of the topic.
The @ Prop annotation is used to define device attribute fields including name, data type, tags, sub-table tags, description. The source codes are as follows:
step 2.2: after the model is packaged and developed, four kinds of codes of equipment attribute, action, event and heartbeat are compiled, unit test is carried out, and finally the four kinds of codes are packaged into independent jar packages,
step 2.3: model verification, uploading the model package to an object repository or a file server through a Config microservice. And then downloading the model to a local place for reading, checking the normalization of the model of each part, verifying, if the model is wrong, prompting that the model is failed to verify, and displaying specific improvement suggestions.
Step 2.4: and (3) preloading the model, loading the model into a Config micro service after verification is passed, carrying out object instantiation preheating, and prompting a conflict processing method if the model fails, wherein the example is as follows:
step 2.5: after the model deployment and the preheating are successful, the Config micro service sends a message to the 'model loading' system theme of the message server. After the Handler micro-service receives the message, asynchronous operation is carried out, a model is loaded, and the dynamic deployment of the edge equipment protocol is completed.
And a third step of: and (3) registering the equipment, if the edge equipment is to be added, adding the equipment in a Config micro service, selecting an item to which the equipment is to be registered, selecting the level three of security control of the equipment, and then selecting the model deployed in the last step to finish the registration of the equipment.
Step 3.1: and adding edge terminal equipment in the Config micro-service, and judging whether the communication protocol of the equipment exists or not.
Step 3.2: if the protocol exists, selecting an item to be registered by the equipment, selecting the level three of security control by the equipment, selecting a protocol model deployed in the last step, and finishing the registration of the equipment after key information such as the number, the name and the like of the equipment is input;
step 3.3: no protocol exists, and the second step is entered;
fourth step: and (3) activating the equipment, wherein the equipment to be activated is selected from the Config microservices, and the message server performs initialization related operation and notifies the instant messaging module of monitoring the asynchronous activation theme.
Step 4.1: creating tenants, wherein Config micro-services dynamically add the tenants in a message server by taking items as units.
Step 4.2: and creating a namespace, dynamically adding the namespace in a message server by taking a model library as a unit, and defaults the namespace by default.
Step 4.3: and creating a theme, and creating a corresponding theme according to the security control level when the equipment is registered. The project-level control is that all devices under a project belong to the same tenant and default name space, and share related topics; the equipment object model level control is that the same equipment belongs to the same name space and shares related subjects; the device instance level is that each device has an independent theme.
Step 4.4: and generating a key, and generating an authorization key according to the master station machine number, the account key, the project key information and the like.
Step 4.5: certificate authorization, generating security certificates from keys, including certificate type (manager/client), topic, algorithm (NONE, HS256, HS384, HS512, RS256, RS384, RS512, ES256, ES384, ES512, PS256, PS384, PS512, default to RS 256), expiration date (1 y a year, 1h a 1 hour, 3 days 3 d), authorization scope (co nsume, produce, functions, sources, sinks, packages).
Step 4.5: activating a message, and sending the message to a message server by the Config micro-service, wherein the message comprises information such as a tenant, a theme, a certificate, a protocol framework to which the device belongs and the like.
Step 4.6: dynamically monitoring, after the Handler micro-service receives the message, inquiring the cache information, judging whether the current node starts the topic monitoring, if so, prompting by a program and returning; otherwise, inquiring the protocol frame to which the equipment belongs, initializing a service processing interface, creating monitoring on the service theme, and storing the activated information into a cache. For monitoring the same service theme by each node, the load is shared in a polling mode, and examples are as follows:
final String topic=topicDto.getFullTopic();
StringsubscriptName=topicDto.getSubscriptionPrefix()+tenantI d+namespaceId+topicId;
new OnMsgConsumerBusinessListener(topicDto.getModelDto(),data Handler);
fifth step: and (3) data processing, wherein the service theme receives real-time data sent by the edge terminal and stores the real-time data in a real-time database.
Step 5.1: subscribing equipment, and transmitting production data in real time by the edge terminal equipment according to the theme name pre-agreed in the extension protocol.
Step 5.2: the theme consumption, the theme monitor of the Handler micro service receives the message, and calls the business processing interface agreed by the protocol to process the message.
Step 5.3: the data is stored, the service processing interface analyzes the data, a data instantiation object is generated, a data table structure is created, the data record is dynamically inserted, and the examples are as follows:
Tuple2<String,List<Object>>t2=ReflectUtils.getInsSql(mq ttObj.getClass(),device);
jdbcTemplate.update(t2);
step 5.4: and (3) on-line analysis, wherein a data statistics analysis related service system inquires real-time data of the equipment and performs stream calculation.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (6)

1. The dynamic expansion and hot plug method of the device communication protocol is characterized by comprising the following steps:
environmental deployment: deploying a real-time database, a message server, a Config microservice and a Handler microservice;
and (3) equipment registration: judging whether the Config micro service has a communication protocol of the edge terminal equipment or not;
if the communication protocol of the edge equipment does not exist, executing a protocol expansion step;
if the communication protocol of the edge equipment exists, selecting an item and the communication protocol to be registered by the edge equipment, finishing the registration of the equipment after the information of the equipment is input, and executing an equipment activation step;
protocol extension: selecting a standard communication protocol framework predefined by Config micro-service, and expanding a communication protocol of edge terminal equipment;
device activation: the Config micro-service starts to send equipment activation information to the system theme consumption of the message server, and simultaneously dynamically creates tenants, namespaces and business themes in the message server and performs certificate authorization;
monitoring by equipment: after receiving the equipment activation message, the consumption starting monitor of the Handler micro-service dynamically creates a monitor corresponding to the service theme of the edge equipment;
and (3) data communication: the edge terminal equipment sends data to a service theme of the message server;
and (3) data processing: after receiving the message, the corresponding service monitor of the Handler micro-service searches the communication protocol corresponding to the edge device, analyzes the message, and stores the remote data into the real-time database.
2. The method for dynamic extension and hot plug of a device communication protocol according to claim 1, wherein the protocol extension step comprises:
protocol development: defining the attribute, action, event and heartbeat of the edge terminal equipment to be added based on a standard communication protocol frame predefined by Config micro-service;
and (3) model packaging: compiling and unit testing four types of codes of attribute, action, event and heartbeat of the edge terminal equipment to be added, and respectively packaging the four types of codes into independent model packages;
model verification: uploading the model package to an object storage library or a file server through a Config micro service, then downloading the model package to a local place to read the model, and carrying out normalization check and verification on the model package;
if the verification fails, prompting an error and displaying an improvement suggestion;
if the verification is passed, performing model preloading;
model preloading: loading the model package passing the verification into a Config micro service, and carrying out object instantiation preheating;
if the preheating fails, prompting and displaying a conflict processing method;
if the preheating is successful, executing model deployment;
model deployment: the Config micro service loads and sends the message to the system theme model of the message server, and after the Handler micro service receives the message, asynchronous operation is carried out, a model package is loaded, and the dynamic deployment of the communication protocol of the edge terminal equipment is completed.
3. The method of dynamic extension and hot plug of a device communication protocol according to claim 2, wherein the device activation step comprises:
creating tenants: the Config micro service dynamically adds tenants in a message server by taking a project as a unit;
creating a namespace: dynamically adding a naming space in a message server by taking a model library as a unit;
creating a theme: establishing a corresponding theme according to the security control level when the equipment is registered;
generating a key: generating an authorization key according to the master station machine number, the account key and the project key information;
certificate authorization: generating a security certificate according to the secret key;
activating message: the Config microservice initiates sending an activation message to the consumption system topic of the message server.
4. The method for dynamic extension and hot plug of a device communication protocol according to claim 3, wherein the device listening step comprises:
after receiving the activation message, the Handler micro-service inquires the cache information and judges whether the current node starts the monitoring of the service theme of the edge equipment;
if so, the program prompts and returns;
if not, inquiring a protocol framework to which the edge equipment belongs, initializing a service processing interface, creating monitoring on the service theme of the edge equipment, storing the activated information in a cache, and sharing the load in a polling mode aiming at monitoring on the same service theme by each node.
5. The method for dynamic extension and hot plug of a device communication protocol according to claim 4, wherein the data processing step comprises:
device subscription: the edge terminal equipment sends production data in real time according to a theme name pre-agreed in an expansion protocol;
theme consumption: the theme monitor of the Handler micro service receives the message and calls the business processing interface agreed by the protocol to process the message;
and (3) data preservation: the service processing interface analyzes the data, generates a data instantiation object, creates a data table structure and dynamically inserts the data record;
and (3) online analysis: and the data statistics analysis related service system inquires the real-time data of the equipment and performs stream calculation.
6. The method for dynamically expanding and hot-plugging a device communication protocol according to claim 3, wherein the security control level in the creation theme is divided into item level control, device object model level control and device instance level control;
project-level control is that all devices under a project belong to the same tenant and namespace, and share related topics;
the equipment object model level control is that the same equipment belongs to the same name space and shares related subjects;
the device instance level control has a separate theme for each device.
CN202310494938.2A 2023-05-05 2023-05-05 Dynamic expansion and hot plug method of equipment communication protocol Active CN116233283B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310494938.2A CN116233283B (en) 2023-05-05 2023-05-05 Dynamic expansion and hot plug method of equipment communication protocol

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310494938.2A CN116233283B (en) 2023-05-05 2023-05-05 Dynamic expansion and hot plug method of equipment communication protocol

Publications (2)

Publication Number Publication Date
CN116233283A CN116233283A (en) 2023-06-06
CN116233283B true CN116233283B (en) 2023-07-25

Family

ID=86584573

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310494938.2A Active CN116233283B (en) 2023-05-05 2023-05-05 Dynamic expansion and hot plug method of equipment communication protocol

Country Status (1)

Country Link
CN (1) CN116233283B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116582582B (en) * 2023-07-14 2023-10-13 中冶武勘智诚(武汉)工程技术有限公司 Data acquisition method, system, equipment and medium for component type Internet of things

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010146174A2 (en) * 2009-06-18 2010-12-23 Archimede Solutions Sarl System for accessing, controlling and managing heterogeneous communicating objects
CN103945012A (en) * 2014-05-16 2014-07-23 范伟飞 Modularized intelligent terminal implementation method

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080082690A1 (en) * 2006-09-29 2008-04-03 Dell Products L.P. System and method for the dynamic loading of protocol adapters
CA2719099C (en) * 2008-03-14 2013-10-01 Aastra Technologies Limited Method & system for configuring a network communications device
US8838865B2 (en) * 2008-10-10 2014-09-16 Nuon, Inc. Hot plug ad hoc computer resource allocation
CN108337324A (en) * 2018-03-21 2018-07-27 合肥工业大学 A kind of card insertion intelligent cloud computing central processing unit system and its data processing method
US10545773B2 (en) * 2018-05-23 2020-01-28 Intel Corporation System, method, and apparatus for DVSEC for efficient peripheral management
CN110430180A (en) * 2019-07-29 2019-11-08 贵州航天智慧农业有限公司 A kind of platform of internet of things and implementation method based on hot plug
CN110750306B (en) * 2019-10-18 2022-09-30 厦门亿联网络技术股份有限公司 Method and system for uniformly identifying hot plug of multi-type equipment
CN111309659B (en) * 2020-01-21 2021-08-13 北京工业大学 Pluggable module-based LoRa multichannel communication extension method
CN113489634A (en) * 2021-06-16 2021-10-08 中企链信(北京)科技有限公司 Inter-enterprise collaborative instant messaging extension method
CN116028200A (en) * 2021-10-26 2023-04-28 上海宝信软件股份有限公司 Extensible drive acquisition frame system and development method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010146174A2 (en) * 2009-06-18 2010-12-23 Archimede Solutions Sarl System for accessing, controlling and managing heterogeneous communicating objects
CN103945012A (en) * 2014-05-16 2014-07-23 范伟飞 Modularized intelligent terminal implementation method

Also Published As

Publication number Publication date
CN116233283A (en) 2023-06-06

Similar Documents

Publication Publication Date Title
US20220083379A1 (en) Managing a virtualized application workspace on a managed computing device
US10198162B2 (en) Method for installing or upgrading an application
US7287190B2 (en) Simultaneous execution of test suites on different platforms
CN107590072B (en) Application development and test method and device
US8910138B2 (en) Hot pluggable extensions for access management system
US9058571B2 (en) Tool for automated transformation of a business process definition into a web application package
CN112612629B (en) Method and system for realizing component type data interface
CN112486547B (en) Application program updating method and device under multi-tenant scene and electronic equipment
CN112394947B (en) Information system based on micro-service architecture
US20160179494A1 (en) Integration of an arbitrary server installed as an extension of a computing platform
WO2002044835A2 (en) A method and system for software and hardware multiplicity
CN116233283B (en) Dynamic expansion and hot plug method of equipment communication protocol
CN112199105A (en) Method, system, medium and electronic device for function combination type software development
CN108132807B (en) Parameter loading method and device
CN116257438A (en) Updating method of interface test case and related equipment
CN114006815B (en) Automatic deployment method and device for cloud platform nodes, nodes and storage medium
CN113360377A (en) Test method and device
US8161520B1 (en) Methods and systems for securing a system in an adaptive computer environment
US20040107244A1 (en) Scalable and intelligent network platform for distributed system
Reile et al. Bunk8s: Enabling Easy Integration Testing of Microservices in Kubernetes
CN111026413A (en) Requirement-oriented complex system &#39;pull&#39; mode deployment system and method thereof
CN115525253A (en) Method, device, computer equipment and storage medium for realizing customized demand
CN116302384A (en) Task scheduling method and device, electronic equipment and storage medium
Juneau et al. Jakarta Servlets
CN116980287A (en) Resource scheduling and isolation method, device, equipment and medium based on mixed distribution mode

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant