Method and device for coding and decoding IoT device protocols adapted to microservice architecture
An Internet of Things device, codec technology, applied in transmission systems, electrical components, etc., can solve problems such as difficulty, the codec module cannot database, cache interaction, cannot meet the needs of information update and information cache interaction, etc. Normal operation, achieve unified effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0051] Combine the following figure 1 , figure 2 and image 3 A specific embodiment of the method for encoding and decoding the protocol of the Internet of Things device adapted to the micro-service architecture according to the present invention is described, and the method includes:
[0052] Step 1: Define the codec interface of the codec microservice module to receive parameters in a uniform format, and return the command encoding structure and data decoding structure in a predefined format according to the type of the issued command and the type of the reported data.
[0053] The encoding interface of the codec interface is defined as follows:
[0054] JSONObject encode(String cmdType, JSONObject params);
[0055] Among them, JSONObject represents the return type is a JSON object, encode represents the encoded interface name, the parameter cmdType is a string, representing the type of the issued command, and the parameter params type is a JSON object, including the par...
Embodiment 2
[0073] Combine the following Figure 4 and Figure 5 A specific embodiment of an apparatus for encoding and decoding an IoT device protocol adapted to a micro-service architecture according to the present invention is described, including:
[0074] The codec interface definition module 201 is used to define the codec interface of the codec microservice module to receive parameters in a unified format, and to return the instruction encoding structure and data decoding structure of the predefined format according to the type of the issued instruction and the type of the reported data; The decoding microservice module can be decoupled from specific business processing, specific databases and caching technologies, avoiding the impact of business changes and technology upgrades on the encoding and decoding microservice module, and realizing the external exposure capability and internal encapsulation of the device protocol encoding and decoding microservice module. Unity of details...
Embodiment 3
[0084] The following describes a specific embodiment of an IoT device access system under a micro-service architecture for IoT device access according to the present invention, where the IoT device is a smart lock device.
[0085]The normal operation of the IoT device access system has been connected to the single lamp device and the environmental monitor device. If the smart lock device is further connected to the device access system, it is necessary to write a codec microservice module for the smart lock device. If the device protocol version used is 1.0, set the unique identifier of the codec microservice module of the smart lock device to smart_lock_1.0. Register the codec microservice module of the smart lock device to the microservice registration center, and add the unique identifier smart_lock_1.0 to the device access system to keep the device access system running normally and avoid affecting the codec service of the connected device.
[0086] Taking reading the hear...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


