A vert.x-based internet of things device management method, system and medium
By using the Vert.x framework to configure communication protocol conversion scripts and port driver files in the IoT management system, combined with message bus technology and modular management, the problem of excessively long system startup time was solved, achieving fast startup and unified management.
Patent Information
- Application Number
- CN202310453783.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-20
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2043-04-20
AI Technical Summary
The IoT management system needs to load multiple drivers and perform repeated configurations during startup, resulting in excessively long system startup time.
The Vert.x framework is used, and communication protocol conversion scripts and port driver files are configured. The message bus technology of the Vert.x framework enables zero-configuration loading of driver files and modular management of devices.
It reduces system startup time, lowers configuration difficulty, and enables rapid startup and unified management of the IoT management system.
Smart Images

Figure CN116405382B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to a Vert.x-based Internet of Things device management method and system and medium. BACKGROUND
[0002] With the application of Internet of Things technology in production and life more and more widely, an Internet of Things management system for managing multiple Internet of Things devices appears. In the Internet of Things management system, complex and diverse Internet of Things devices are connected, and when the Internet of Things management system is started, the driver of each Internet device that needs to be supported needs to be loaded, which consumes a lot of time. Especially in multi-region tenant management, a large number of configuration operations need to be repeated for the Internet of Things devices, increasing the workload of starting the Internet of Things management system and prolonging the system startup time. SUMMARY
[0003] The present application provides a Vert.x-based Internet of Things device management method, system and medium, which is used to solve the technical problem that too many drivers need to be loaded when the Internet of Things management system is started, and repeated configuration operations are required, consuming system startup time.
[0004] The present application adopts the following technical solutions:
[0005] On the one hand, the present application provides a Vert.x-based Internet of Things device management method, which comprises: configuring a communication protocol conversion script supporting different communication protocols; configuring a port corresponding to each communication protocol according to specific requirements, and configuring a driver file corresponding to each port; connecting an Internet of Things device through the port; and based on a Vert.x framework, dividing all connected Internet of Things devices into modules for modular management of all connected devices.
[0006] In a feasible implementation, the communication protocol conversion script supporting different communication protocols is configured, specifically including:
[0007] Determining the type of communication protocol that the Internet of Things management system needs to support; wherein the communication protocol type at least includes: MQTT protocol, HTTP protocol, TCP protocol and MODUS protocol;
[0008] Based on each type of communication protocol, a corresponding communication protocol conversion script is configured; the communication protocol conversion script is used to convert different encoding format data packets transmitted under different communication protocols into a data format that can be recognized by the system.
[0009] In a feasible implementation, the port corresponding to each communication protocol is configured according to specific requirements, and the driver file corresponding to each port is configured, specifically including:
[0010] The number of ports required for each communication protocol is determined according to specific requirements;
[0011] A corresponding driver file is developed for each port of each communication protocol, and the driver file is bound to the corresponding port, so that the communication entering from the corresponding port is parsed and connected through the driver file.
[0012] In a feasible implementation, the Internet of Things device is accessed through the port, specifically including:
[0013] The communication data of the Internet of Things device is received through the port;
[0014] According to the port number of the port, the corresponding communication protocol and the communication protocol conversion script are determined;
[0015] The communication data is converted in data format through the communication protocol conversion script;
[0016] The communication data converted in data format is parsed through the driver file corresponding to the port number.
[0017] In a feasible implementation, the communication data converted in data format is parsed through the driver file corresponding to the port number, specifically including:
[0018] According to the port number, the corresponding driver file is determined;
[0019] Based on the message bus technology of the Vert.x framework, the driver file is loaded with zero configuration;
[0020] After loading, the communication data converted in data format is parsed through the driver file to realize communication between the system and the Internet of Things device.
[0021] In a feasible implementation, based on the message bus technology of the Vert.x framework, the driver file is loaded with zero configuration, specifically including:
[0022] Based on the message bus technology of the Vert.x framework, the driver configuration in the driver file is directly read through the class loader; wherein the driver configuration is used to provide communication basic support parameters of the corresponding communication protocol.
[0023] In a feasible implementation, based on the Vert.x framework, all Internet of Things devices accessed are divided into modules for modular management of all accessed devices, specifically including:
[0024] Based on operation and maintenance requirements, a plurality of Internet of Things devices are combined into a group, and the group is divided into a module;
[0025] Based on the Vert.x framework, a configuration script of each module is developed, and all Internet of Things devices in the same module are jointly controlled through the configuration script.
[0026] In an available implementation, the method further comprises:
[0027] In the case that the operation and maintenance requirements of the new module are the same as those of the original module, the configuration script parameters of the original module are copied to the configuration script of the new module as a whole, and the configuration script does not need to be rewritten.
[0028] On the other hand, the embodiment of the present application also provides an Internet of Things device management system based on Vert.x, which comprises:
[0029] The configuration unit is configured to configure a communication protocol conversion script supporting different communication protocols, configure a port corresponding to each communication protocol according to specific requirements, and configure a drive file corresponding to each port.
[0030] The access unit is configured to access the Internet of Things devices through the ports.
[0031] The modular management unit is configured to divide all the accessed Internet of Things devices into modules based on the Vert.x framework, so as to modularly manage all the accessed devices.
[0032] On the other hand, the embodiment of the present application also provides a storage medium, which is a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores at least one program, each of which comprises instructions, which, when executed by a terminal, causes the terminal to execute the Internet of Things device management method based on Vert.x according to any one of the above embodiments.
[0033] Compared with the prior art, the Internet of Things device management method, system and medium based on Vert.x provided by the embodiment of the present application have the following beneficial effects:
[0034] The present application configures a corresponding protocol conversion script for different communication protocols, and develops a platform drive jar file that can be started softly, so that the Internet of Things management system can support the access of Internet of Things devices under multiple protocols, and realize unified message conversion through the platform drive jar file, so that the operation and implementation configuration personnel do not need to perform single conversion and decoding processing on the messages of each accessed device, thereby reducing the difficulty of system startup. Moreover, the present application also provides an editing method of component modules, increases the system reusability, can uniformly manage the Internet of Things devices in a module, and reduces the configuration difficulty during system startup. Based on the characteristics of the Vert.x framework, the Internet of Things management system is realized through the drive jar file. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to make the technical solutions in the embodiments of the present application or the prior art clearer, the accompanying drawings needed in the embodiments or prior art description will be briefly introduced. Obviously, the accompanying drawings in the following description only represent some embodiments described in the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings. In the drawings:
[0036] Figure 1 A flow chart of a Vert.x-based Internet of Things device management method provided by an embodiment of the present application;
[0037] Figure 2 A structural schematic diagram of a Vert.x-based Internet of Things device management system provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely with reference to the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments only represent some embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without any creative effort should belong to the protection scope of the present application.
[0039] An embodiment of the present application provides a Vert.x-based Internet of Things device management method, as shown in the figure, the Vert.x-based Internet of Things device management method specifically comprises steps S101-S104: Figure 1
[0040] S101, configure a communication protocol conversion script supporting different communication protocols.
[0041] Specifically, the type of communication protocol that the Internet of Things management system needs to support is determined. The type of communication protocol that needs to be supported includes MQTT protocol, HTTP protocol, TCP protocol, MODUS protocol, etc.
[0042] Further, based on each type of communication protocol, a corresponding communication protocol conversion script is configured respectively. The communication protocol conversion script is used to convert different encoding format data packets transmitted under different communication protocols into a data format that can be recognized by the system.
[0043] As a feasible implementation, different Internet of Things devices have different protocols and encoding formats used when sending and receiving data packets due to different types and manufacturers. Therefore, before accessing the Internet of Things device, a conversion script needs to be preset in advance to perform data packet decoding and transcoding operations based on different protocols, so as to convert data packets in different encoding formats transmitted under different protocols into a data format that can be recognized by the Internet of Things device management system. Therefore, before accessing the Internet of Things device, the application first confirms the communication protocol used by the Internet of Things device management system: MQTT or HTTP or TCP or MODUS, etc., and configures a protocol conversion script for each communication protocol.
[0044] S102, according to specific requirements, configure ports corresponding to different communication protocols, and configure a drive file corresponding to each port.
[0045] Specifically, according to specific requirements, the number of ports required for each communication protocol is determined. A corresponding drive file is developed for each port of each communication protocol, and the drive file is bound to the corresponding port to parse and connect the communication entering from the corresponding port through the drive file.
[0046] As a feasible implementation, the drive file is a Jar package developed by the application independently, and the Jar package is equivalent to a system drive. The Jar package provides basic communication support for the corresponding protocol, and the specific configuration is obtained according to common protocol parameters. Generally, a communication protocol has a default port, for example, the port number of the http protocol is 8080. However, the connection communication between multiple devices and the Internet of Things management system cannot be satisfied with only one port for each communication protocol, so multiple related ports need to be configured to ensure the normal connection of devices using this protocol. When configuring the drive jar package, bind a port to each drive jar package. The communication message entering from the port is parsed and connected according to the currently configured drive jar package.
[0047] In one embodiment, two devices of different types but with the same communication protocol need to be connected to the Internet of Things management system. The system opens two ports 1884 and 1885. Device 1 uses port 1884 to request access to the system and parses the communication according to drive jar 1; device 2 uses port 1885 to request access to the system and parses the communication according to drive jar 2.
[0048] S103, access the Internet of Things device through the port.
[0049] Specifically, the communication data of the Internet of Things device is received through the port. According to the port number of the port, the corresponding communication protocol and the communication protocol conversion script are determined. The communication data is converted in data format through the communication protocol conversion script.
[0050] Further, the communication data after data format conversion is parsed through the drive file corresponding to the port number, specifically including: determining the corresponding drive file according to the port number; and loading the drive file based on the message bus technology of the Vert.x framework. After loading is completed, the communication data after data format conversion is parsed through the drive file to realize communication between the system and the Internet of Things device.
[0051] As a feasible implementation manner, the drive file is loaded based on the message bus technology of the Vert.x framework, specifically including: directly reading the drive configuration in the drive file through a class loader based on the message bus technology of the Vert.x framework; wherein the drive configuration is used to provide communication basic support parameters of the corresponding communication protocol.
[0052] As a feasible implementation manner, Vert.x is a JVM-based, lightweight and high-performance application platform, which is very suitable for the latest mobile end background, Internet and enterprise application architecture. The application adopts the Vert.x message bus, directly reads the drive configuration in the jar package using the class loader, reduces the difficulty of starting, and can realize zero-configuration one-key starting. Specifically, the OSGi idea is borrowed, and when the drive jar package is connected, there is a class loader and a code library called module on each execution vertex. The code blocks in the code library are loaded into the class loader of each vertex using them. The class loading and resource searching between the delegated package class loaders are connected together, and the loading efficiency is improved.
[0053] All Verticle components in the framework Vert.x are completely decoupled, and any components cannot directly call each other, but can only be completed by sending events on the event bus of Vert.x, completely solving the complexity of managing mutual dependence between components in traditional application systems, and finally making the vert.x application programming extremely simple and efficient. The verticle is the smallest code block that can be deployed and run in vert.x, and can be understood as a verticle is a minimized business processing engine. An application program can be a single verticle or composed of multiple verticles. After the verticle is published and deployed, the start method in the verticle is called to start business logic processing, and after completion, the stop method is called to perform a destruction action on the code block. Vert.x has a distributed event bus, allowing JSON messages to be propagated between vert.x application programs. The code library can be understood as a collection of code segments or a collection of executable class files for each independent verticle. In use, the class loader obtains the corresponding required verticles from the code library for execution.
[0054] S104, based on the Vert.x framework, all accessed Internet of Things devices are divided into modules for modular management of all accessed devices.
[0055] Specifically, based on operation and maintenance requirements, a plurality of Internet of Things devices are combined into a group, and the group is divided into a module. Based on the Vert.x framework, a configuration script of each module is developed, and all Internet of Things devices in the same module are jointly controlled through the configuration script.
[0056] Further, in the case that the operation and maintenance requirements of the new module and the original module are the same, the configuration script parameters of the original module are copied to the configuration script of the new module as a whole, without the need to rewrite the configuration script.
[0057] As a feasible implementation, system operation and maintenance personnel can combine multiple devices into a group according to their own requirements, and the devices in the group can be jointly controlled after combination, such as: combining a socket and a sensor into a group, and the socket switch can be controlled according to the data of the sensor after combination. The purpose of combination is to quickly combine, and similar requirements can directly copy the script configuration without the need to rewrite the script process. After the devices are combined into a group, the parameter script configuration can be copied between the devices as a whole, especially for complex multi-element configuration, without the need to rewrite the script, and direct copy can be used. In addition, the switches can be managed as a group, and the modularization is managed as a small unit.
[0058] Vert.x uses a single-threaded event-driven asynchronous working mode, and when writing a Vert.x component, complex multi-threaded programming problems do not need to be considered, and the calling, synchronization, locking and other tedious processing programming between threads do not need to be concerned, which simplifies the programming code and improves the programming efficiency.
[0059] In addition, the embodiment of the application also provides an Internet of Things device management system based on Vert.x, as shown in Figure 2 The Internet of Things device management system based on Vert.x 200 specifically includes:
[0060] The configuration unit 210 is configured to configure a communication protocol conversion script supporting different communication protocols; according to specific requirements, the ports corresponding to different communication protocols are configured, and the drive files corresponding to each port are configured;
[0061] The access unit 220 is configured to access the Internet of Things device through the port;
[0062] The modular management unit 230 is configured to divide all accessed Internet of Things devices into modules based on the Vert.x framework, for modular management of all accessed devices.
[0063] The embodiment of the present application also provides a storage medium, which is a nonvolatile computer readable storage medium, and the nonvolatile computer readable storage medium stores at least one program, each of the programs comprises instructions, and the instructions make the terminal execute the following steps when the terminal executes the instructions:
[0064] The communication protocol conversion script is configured to support different communication protocols.
[0065] According to specific requirements, the ports corresponding to different communication protocols are configured, and the drive files corresponding to each port are configured.
[0066] The Internet of Things device is accessed through the port.
[0067] Based on the Vert.x framework, all the accessed Internet of Things devices are divided into modules to modularly manage all the accessed devices.
[0068] The present application configures the corresponding protocol conversion script for different communication protocols, and develops the platform drive jar file which can be started softly, so that the Internet of Things management system can support the access of the Internet of Things devices under multiple protocols, and realizes the unified message conversion through the platform drive jar file, and the operation and implementation configuration personnel do not need to individually convert and decode the messages of each accessed device, thereby reducing the difficulty of starting the system. Moreover, the present application also provides the editing method of the component modularization, increases the system reusability, can uniformly manage the Internet of Things devices in a module, and reduces the configuration difficulty when starting the system. Based on the characteristics of the Vert.x framework, the zero-configuration one-key starting of the Internet of Things management system is realized through the drive jar file.
[0069] The system, device, module or unit described in the above embodiment can be specifically implemented by a computer chip or entity, or by a product with certain functions. A typical implementation device is a computer. Specifically, the computer may, for example, be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0070] For the convenience of description, the above device is described as various units respectively described in functions. Of course, the functions of each unit can be implemented in the same or multiple software and / or hardware when implementing the present specification.
[0071] Those skilled in the art will appreciate that embodiments of the present description can be readily used as a method, an apparatus (system) or a computer program product. Accordingly, embodiments of the present description can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable program code.
[0072] The present description is described in reference to flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the present description. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing device or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0073] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0074] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0075] In one typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0076] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory. The memory can also include non-volatile memory, such as read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable read-only memory (EEPROM), flash memory, or a combination of non-volatile memories in different forms. The memory is an example of computer-readable media.
[0077] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0078] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusion, so that processes, methods, articles or devices that include a series of elements not only include those elements, but also include other elements not explicitly listed or inherent to such processes, methods, articles or devices. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or device that includes the element.
[0079] The specification can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The specification can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0080] Each embodiment in the specification is described in a progressive manner, and the same or similar parts between each embodiment can be referred to each other, and each embodiment focuses on the difference from other embodiments. In particular, for device, equipment, non-volatile computer storage medium embodiments, because they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the part of the method embodiment.
[0081] The above-described embodiments of the application have several aspects, no single one of which is solely responsible for the application's desirable attributes. Without limiting the scope of this application, several non-limiting examples of aspects of the application are described in the following paragraphs.
[0082] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, which modifications and changes are to be understood as intended to be embraced by the claims. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The scope of the application should be determined, not with reference to the above description, but rather with reference to the appended claims, along with their full scope of equivalents.
Claims
1. A method for managing Internet of Things devices based on Vert.x, characterized in that, The method comprises: configuring a communication protocol conversion script supporting different communication protocols; configuring ports corresponding to different communication protocols according to specific requirements, and configuring a drive file corresponding to each port; accessing an Internet of Things device through the port, specifically comprising: receiving communication data of the Internet of Things device through the port; determining the corresponding communication protocol and the communication protocol conversion script according to the port number of the port; performing data format conversion on the communication data through the communication protocol conversion script; parsing the communication data after data format conversion through the drive file corresponding to the port number, specifically comprising: determining the corresponding drive file according to the port number; loading the drive file based on the message bus technology of the Vert.x framework, specifically comprising: directly reading the drive configuration in the drive file through the class loader based on the message bus technology of the Vert.x framework; wherein the drive configuration is used to provide communication basic support parameters of the corresponding communication protocol; after loading, parsing the communication data after data format conversion through the drive file to realize communication between the system and the Internet of Things device; based on the Vert.x framework, dividing all accessed Internet of Things devices into modules to modularly manage all accessed devices.
2. The Vert.x based Internet of Things device management method of claim 1, wherein, configuring a communication protocol conversion script supporting different communication protocols, specifically comprising: determining the communication protocol types that the Internet of Things management system needs to support; wherein the communication protocol types at least include: MQTT protocol, HTTP protocol, TCP protocol and MODUS protocol; configuring the corresponding communication protocol conversion script based on each communication protocol type; the communication protocol conversion script is used to convert different encoding format data packets transmitted under different communication protocols into a data format recognizable by the system.
3. The Vert.x based Internet of Things device management method of claim 2, wherein, configuring ports corresponding to different communication protocols according to specific requirements, and configuring a drive file corresponding to each port, specifically comprising: determining the number of ports required for each communication protocol according to specific requirements; developing a corresponding drive file for each port of each communication protocol, and binding the drive file with the corresponding port, so as to parse and connect the communication entering from the corresponding port through the drive file.
4. The Vert.x based Internet of Things device management method of claim 1, wherein, based on the Vert.x framework, dividing all accessed Internet of Things devices into modules to modularly manage all accessed devices, specifically comprising: based on operation and maintenance requirements, merging a plurality of Internet of Things devices into a group, and dividing the group into a module; based on the Vert.x framework, developing a configuration script for each module, and jointly controlling all Internet of Things devices in the same module through the configuration script.
5. The Vert.x based Internet of Things device management method of claim 4, wherein, The method further comprises: in the case that the operation and maintenance requirements of the new module and the original module are the same, copying the configuration script parameters of the original module to the configuration script of the new module as a whole, without the need to rewrite the configuration script.
6. A Vert.x based IoT device management system, applying a Vert.x based IoT device management method according to any one of claims 1-5, characterized in that, The system comprises: a configuration unit configured to configure a communication protocol conversion script supporting different communication protocols; configure ports corresponding to different communication protocols according to specific requirements, and configure a drive file corresponding to each port; An access unit is configured to access the Internet of Things device through the port; A modular management unit is configured to divide all the accessed Internet of Things devices into modules based on a Vert.x framework, so as to modularly manage all the accessed devices.
7. A storage medium, characterized by The storage medium is a non-volatile computer readable storage medium, and the non-volatile computer readable storage medium stores at least one program, and each program includes instructions, which, when executed by a terminal, causes the terminal to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
Multi-protocol gateway equipment
CN105516185A
Internet of Things control method and device in power line carrier environment, and intelligent terminal
CN115914312A