Method, device and system for constructing proxy service for device access to Internet of Things platform

By building proxy services and using container technology, the poor flexibility and high deployment cost of non-TCP/IP devices when accessing IoT platforms are solved, fast access and flexible operation and maintenance of devices are realized, and the IoT platform is expanded Application scope.

CN114979212BActive Publication Date: 2025-02-11BOE TECHNOLOGY GROUP CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210565627.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-23
Publication Date
2025-02-11
Estimated Expiration
2042-05-23

AI Technical Summary

Technical Problem

When accessing the Internet of Things platform in the prior art, non-TCP/IP devices have problems such as poor flexibility, complex operation and maintenance and updates, and large deployment costs, especially the inability to directly access the Internet of Things platform.

Method used

By building agent services, establish communication channels between access devices and the Internet of Things platform, and deploying agent services using container technology to realize communication between access devices and the Internet of Things platform. For non-TCP/IP devices, use a preset data conversion interface to enable them to access the IoT platform.

Benefits of technology

It realizes fast and convenient access to the IoT platform for non-TCP/IP devices, expands the application scope of the Internet of Things platform access devices, reduces the access cost of non-TCP/IP devices, and improves service flexibility , reduces the difficulty of operation and maintenance and updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114979212B_ABST
    Figure CN114979212B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for constructing a proxy service for device access to an Internet of Things platform, a device access proxy service device, an Internet of Things system, a computer device, and a storage medium. One embodiment provides a method for constructing a proxy service for device access to an Internet of Things platform, including: establishing a communication path between the access device and the Internet of Things platform in response to device data sent by the access device, and using the communication path to achieve communication between the access device and the Internet of Things platform to form a proxy service; using container technology to construct and deploy the proxy service. The present invention provides a method for constructing a communication path between the access device and the Internet of Things platform through a proxy service and achieving communication between the two, and connecting non-TCP / IP devices to the Internet of Things platform through a preset data conversion interface; using container technology to integrate data conversion, establishing a communication path, and achieving data communication into a service, and constructing a service image for deployment, thereby improving flexibility and reducing operation and maintenance deployment costs, which has practical significance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Internet of Things, and in particular to a method for constructing a proxy service for device access to an Internet of Things platform, a device access proxy service device, an Internet of Things system, a computer device and a storage medium. Background Art

[0002] With the rapid development and widespread application of IoT technology, the devices connected to the IoT platform vary greatly, which makes these devices have problems such as poor flexibility, complex operation and maintenance, and high deployment costs when connected to the IoT platform. In particular, the problem that a large number of non-TCP / IP devices cannot directly connect to the IoT platform due to the wide variety of protocols used and limited computing performance needs to be solved urgently.

[0003] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention

[0004] In order to solve at least one of the above problems, the first embodiment of the present invention provides a method for constructing a proxy service for a device to access an Internet of Things platform, comprising:

[0005] In response to device data sent by the access device, a communication path is established between the access device and the Internet of Things platform, and the communication path is used to realize communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface;

[0006] The container technology is used to build a service image for the proxy service, and the service image is deployed.

[0007] Furthermore, establishing a communication path between the access device and the Internet of Things platform in response to the device data sent by the access device, and using the communication path to achieve communication between the access device and the Internet of Things platform to form a proxy service further includes:

[0008] Generate a device authentication request according to the received device data sent by the access device, and send it to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform, wherein the device data includes device information and device monitoring data of the access device, and the device authentication request includes the device information of the access device;

[0009] In response to the device data sent by the access device, a matching interface protocol is selected from the preset interface protocols and the device data is parsed, and a device data request is generated and sent to the Internet of Things platform, wherein the device data request includes the parsed device data;

[0010] In response to the device instruction sent by the Internet of Things platform, an interface protocol matching the device instruction is selected from the preset interface protocols, and the device instruction is used to generate device instruction data and sent to the access device.

[0011] Furthermore, generating a device authentication request according to the received device data sent by the access device, and sending the request to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform further includes:

[0012] Generate a device authentication request according to the received device data and send it to the Internet of Things platform;

[0013] The device information of the device data is saved in response to the device authentication confirmation instruction sent by the Internet of Things platform.

[0014] Further, in response to the device data sent by the access device, a matching interface protocol is selected from the preset interface protocols and the device data is parsed, a device data request is generated and sent to the Internet of Things platform, and the device data request includes the parsed device data and further includes: identifying the device interface protocol type of the device data, and selecting a matching first interface protocol from the preset interface protocols; parsing the device monitoring data using the first interface protocol and generating a device data request, and sending the device data request to the Internet of Things platform;

[0015] The step of responding to a device instruction sent by the Internet of Things platform, selecting an interface protocol matching the device instruction from preset interface protocols, generating device instruction data from the device instruction and sending the data to the access device further includes: the device instruction includes device information and instruction information, selecting a matching second interface protocol from preset interface protocols according to the device information; generating device instruction data from the instruction information through the second interface protocol and sending the data to the access device corresponding to the device information, and when the access device is a non-TCP / IP device, converting the setting instruction data into data recognizable by the access device through a preset data conversion interface.

[0016] Furthermore, the access device includes at least one first access device and at least one second access device communicating with the first access device, and the proxy service construction method also includes: in response to first device data sent by the first access device, selecting a third interface protocol matching the first access device from a preset interface protocol and parsing the first device data to generate parsed data, selecting a fourth interface protocol matching the second access device from a preset interface protocol and generating second device data from the parsed data and sending it to the second access device.

[0017] Furthermore, after generating a device authentication request based on the device data received from the access device and sending it to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform, the proxy service construction method also includes: performing heartbeat communication with the access device and the Internet of Things platform respectively at preset time intervals.

[0018] Furthermore, the use of container technology to build a service image for the proxy service and deploying according to the service image further includes: using container technology to pull, compile, package and build a service image for the code of the proxy service, and uploading the service image to an image repository; deploying in response to a deployment request of a preset deployment object, so that the deployment object pulls the service image from the image repository and starts to complete the deployment.

[0019] A second embodiment of the present invention provides a device access proxy service device, which runs a service image constructed by the proxy service construction method, establishes a communication path between the access device and the Internet of Things platform in response to device data sent by the access device, and uses the communication path to realize communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface.

[0020] A third embodiment of the present invention provides an Internet of Things system, including an Internet of Things platform, multiple access devices, a data conversion interface, and the device access proxy service device as described in the second embodiment of the present invention.

[0021] Furthermore, the Internet of Things system includes an intelligent gateway, and the intelligent gateway includes the data conversion interface and the device access proxy service device.

[0022] Furthermore, the Internet of Things system includes a cloud server, and the cloud server includes the device access proxy service device.

[0023] A fourth embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for constructing a proxy service for device access to an Internet of Things platform as described in the first embodiment.

[0024] A fifth embodiment of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method for constructing a proxy service for device access to an Internet of Things platform as described in the first embodiment is implemented.

[0025] The beneficial effects of the present invention are as follows:

[0026] In view of the existing problems, the present invention develops a proxy service construction method for device access to the Internet of Things platform, a device access proxy service device, an Internet of Things system, a computer device and a storage medium. One embodiment constructs a communication path between the access device and the Internet of Things platform through a proxy service and realizes communication between the two, which is convenient and fast; at the same time, the data output by non-TCP / IP devices is converted through a pre-set data conversion interface, so that non-TCP / IP devices can be connected to the Internet of Things platform, effectively expanding the application scope of devices that can be accessed by the Internet of Things platform, and reducing the access cost of non-TCP / IP devices; further, container technology is used to integrate data conversion, establishment of communication paths and realization of data communication into a service and build a service image for deployment, thereby improving service flexibility, reducing the difficulty of operation and maintenance and updating, and reducing deployment costs, and has broad application prospects. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 A flow chart of the proxy service method according to an embodiment of the present invention is shown;

[0029] Figure 2 A component diagram showing a proxy service system according to an embodiment of the present invention;

[0030] Figure 3 A detailed flow chart of the proxy service method according to an embodiment of the present invention is shown;

[0031] Figure 4 A structural diagram showing a mirror service of a proxy service method according to an embodiment of the present invention;

[0032] Figure 5a-5b A structural diagram of an Internet of Things system according to another embodiment of the present invention is shown.

[0033] Figure 6 A schematic structural diagram of a computer device according to another embodiment of the present invention is shown. DETAILED DESCRIPTION

[0034] In order to more clearly illustrate the present invention, the present invention is further described below in conjunction with preferred embodiments and accompanying drawings. Similar components in the accompanying drawings are represented by the same reference numerals. It should be understood by those skilled in the art that the content specifically described below is illustrative rather than restrictive, and should not be used to limit the scope of protection of the present invention.

[0035] When the existing technology connects a device to the IoT platform, it is necessary to carry out customized development for the protocol used by the device, call the program library that matches the device, and write the communication code. In particular, when there are many types of devices that need to be connected, it is necessary to write corresponding codes for each device. Furthermore, if new devices need to be connected, the existing system needs to be updated as a whole. If interaction between different devices is required, the code must be written separately and implemented through the IoT platform. Furthermore, for a large number of non-TCP / IP devices, there are many types of protocols used, and their own computing performance is limited, so they cannot be directly connected to the IoT platform. Therefore, there are problems that need to be solved urgently, such as poor flexibility, complex operation and maintenance and updates, and high deployment costs.

[0036] According to the above questions, if Figure 1 As shown, an embodiment of the present invention provides a method for constructing a proxy service for a device to access an Internet of Things platform, including:

[0037] In response to device data sent by the access device, a communication path is established between the access device and the Internet of Things platform, and the communication path is used to realize communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface;

[0038] The container technology is used to build a service image for the proxy service, and the service image is deployed.

[0039] This embodiment uses a proxy service to build a communication path between the access device and the Internet of Things platform and realize communication between the two, which is convenient and fast. At the same time, the data output by non-TCP / IP devices is converted through a pre-set data conversion interface, so that non-TCP / IP devices can be connected to the Internet of Things platform, effectively expanding the application scope of devices that can be accessed by the Internet of Things platform and reducing the access cost of non-TCP / IP devices. Furthermore, container technology is used to integrate data conversion, establishment of communication paths and realization of data communication into a service and build a service image for deployment, thereby improving service flexibility, reducing the difficulty of operation and maintenance and updating, and reducing deployment costs.

[0040] In a specific embodiment, Figure 2 As shown, the present invention also provides an Internet of Things system, including multiple access devices, a data conversion interface, a device access proxy service device and an Internet of Things platform, wherein:

[0041] Access equipment: including equipment that complies with the TCP / IP protocol and non-TCP / IP equipment;

[0042] Data conversion interface: realizes interface conversion for non-TCP / IP devices so that the output data can communicate with the device access proxy service device through TCP / IP protocol;

[0043] IoT platform: an IoT software platform that enables centralized management of access devices;

[0044] Device access proxy service device: a service image of the proxy service construction method for device access to the Internet of Things platform of the present application, used to connect the access device and the Internet of Things platform.

[0045] Based on the IoT system, Figure 3 As shown, the device accessing the proxy service apparatus 100, the access device 300 and the Internet of Things platform for running the proxy service are specifically described by taking an actual process of a device accessing the Internet of Things platform as an example:

[0046] In response to device data sent by the access device, a communication path is established between the access device and the Internet of Things platform, and the communication path is used to realize communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface.

[0047] In this embodiment, a communication path between the access device and the Internet of Things platform is first established through a proxy service, and then the communication between the access device and the Internet of Things platform is achieved through the established communication path.

[0048] It should be noted that this embodiment takes into account that when the access device is a non-TCP / IP device, it cannot directly access the Internet of Things platform. Therefore, a data conversion interface is used for data conversion for such devices. For example, if the access device is a sensor, the output interface of the sensor is an RS485 interface, and the output data is RS485 data, which cannot be directly transmitted to the Internet of Things platform. The RS485 to USB conversion of the data conversion interface is used to facilitate the access of the data output by the sensor to the Internet of Things platform. This application does not make specific limitations on the access device or the output interface of the access device, including but not limited to UART, Zigbee, Lora, Bluetooth, and infrared interfaces. The data conversion interface can be converted according to the interface type of the access device and converted into a unified data format to meet the access requirements of the Internet of Things platform. Those skilled in the art should understand that it is set according to actual application requirements and will not be repeated here.

[0049] Specifically include:

[0050] First, a device authentication request is generated based on the device data received from the access device, and sent to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform. The device data includes the device information and device monitoring data of the access device, and the device authentication request includes the device information of the access device.

[0051] In this embodiment, the proxy service receives the device data sent by the access device, and obtains the device information of the access device from the device data. The device information includes a device identifier that can uniquely characterize the access device. The present invention does not specifically limit the device identifier. For example, in this embodiment, it is the IP address of the access device. The specific process includes:

[0052] S11: The access device 300 sends device data to the device access proxy service apparatus 100;

[0053] S12: The device access proxy service device 100 generates a device authentication request;

[0054] S13: The device access proxy service apparatus 100 sends a device authentication request to the Internet of Things platform 200.

[0055] In this embodiment, the proxy service run by the device access proxy service device parses the device identification of the device based on the received device data, and determines whether the device needs to be authenticated based on the device identification. If authentication is required, a device authentication request is sent to the Internet of Things platform to confirm the legitimacy of the access device. This application does not specifically limit the method for determining whether the access device needs to be authenticated. In this embodiment, the judgment is made based on whether the device identification of the device exists in the list of trusted devices and the trust record has not expired. In other words, the proxy service generates a device authentication request based on the received device data and sends it to the Internet of Things platform.

[0056] S14: The Internet of Things platform 200 sends an authentication confirmation instruction to the device access proxy service device 100;

[0057] S15: The device access proxy service apparatus 100 saves the device information of the confirmed access device.

[0058] In this embodiment, the proxy service run by the device access proxy service device responds to the device authentication confirmation instruction sent by the Internet of Things platform. If the received instruction is a successful device authentication, the device identification of the device is stored in the trusted device list, and the validity period of the trust record is set at the same time. In other words, the proxy service saves the device information of the device data in response to the device authentication confirmation instruction sent by the Internet of Things platform. It is worth noting that the specific storage method and validity period rules are not specifically limited in the present invention. Those skilled in the art should make specific implementations according to actual needs, such as encrypting and storing the trust record, and calculating the hash value of the trust record to ensure that the trust record has not been tampered with; for example, the validity period can be set to indefinite or one month, etc., which will not be repeated here.

[0059] Through the above operations, the proxy service verifies the legitimacy of the access device by receiving device data, sending device authentication requests, receiving device authentication confirmation instructions, and locally storing device authentication results to ensure the security of the system; on the other hand, devices that have not passed the legitimacy authentication are denied access to the Internet of Things platform, thereby avoiding illegal data intrusion and system information leakage.

[0060] It is worth noting that the present invention does not specifically limit the specific authentication and request implementation methods, and those skilled in the art should select a suitable implementation method according to application requirements. For example, the communication protocol for authentication operations, for access devices that support the HTTP protocol, the HTTP protocol is directly used to communicate with the IoT platform, because the HTTP protocol has many supporting devices, and the related implementation technology is mature, stable, concise, and rapid; for sensor devices that do not support the HTTP protocol, for example, the MQTT protocol that is more suitable for the IoT system can be selected. For a large number of sensor devices that cannot support the HTTP protocol due to hardware device limitations, the selection of the MQTT protocol is conducive to reducing costs, improving stability, and facilitating interaction with other IoT systems.

[0061] Secondly, in response to the device data sent by the access device, a matching interface protocol is selected from the pre-set interface protocols and the device data is parsed, a device data request is generated and sent to the Internet of Things platform, and the device data request includes the parsed device data.

[0062] In this embodiment, after receiving the device data, the proxy service identifies the device information, and uses the device identification of the device to determine that the device has passed the authentication of the Internet of Things platform, further confirms the device type of the receiving device, parses the device data according to the corresponding protocol, generates a corresponding device data request according to the protocol of the Internet of Things platform, and sends it to the Internet of Things platform. The specific process is as follows:

[0063] S21: the access device 300 sends device detection data to the device access proxy service device 100;

[0064] S22: The device access proxy service apparatus 100 selects an interface protocol that matches the access device 300 .

[0065] In this embodiment, the specific steps of the proxy service identifying the device interface protocol type of the device data are:

[0066] a) According to the pre-set protocol type, open the corresponding receiving port to receive data;

[0067] b) using the port's preset protocol to attempt to parse the received transparent data;

[0068] c) if the analysis is successful, identifying the protocol type of the received device data and selecting a matching first interface protocol;

[0069] d) If the parsing fails, the device data is discarded.

[0070] In other words, the proxy service identifies the device interface protocol type of the device data and selects a matching first interface protocol from pre-set interface protocols.

[0071] It should be noted that the present invention does not specifically limit the device interface protocol type, including but not limited to UART, Zigbee, Lora, Bluetooth, infrared, etc., and those skilled in the art should implement the processing of the corresponding type of protocol according to specific needs. For example, access device 1 is a sensor, the output interface of the sensor is an RS485 interface, and the output data is RS485 data, which cannot be directly transmitted to the proxy service. The data output by the sensor is converted to USB through the data conversion interface to facilitate the transmission of the data to the USB port corresponding to the proxy service; device 2 uses the same sensor, the output interface of the sensor is an RS485 interface, and the output data is RS485 data, but the data conversion interface used is a data transparent transmission device for conversion, so device 2 can directly use the TCP / IP protocol to directly transmit the device data to the TCP / IP port of the proxy service. The proxy service opens the USB port and the TCP / IP port to receive data at the same time according to the pre-set requirements, and can process two interface protocols at the same time to achieve compatible use of devices with different protocols.

[0072] It can be seen that the proxy service described in the present application selects a matching interface protocol from the pre-set interface protocols, has the ability to process multiple interface protocols, and can support data transmission on different data interfaces of multiple access devices.

[0073] S23: the device access proxy service device 100 uses the first interface protocol to parse the device monitoring data and generate device data;

[0074] S24: The device access proxy service device 100 sends device data to the Internet of Things platform 200. In this embodiment, the proxy service encapsulates the received data according to the first interface protocol confirmed in the previous step, and sends it to the Internet of Things platform; that is, the proxy service uses the first interface protocol to parse the device monitoring data and generate a device data request, and sends the device data request to the Internet of Things platform.

[0075] In an optional embodiment, the proxy service can optimize the device data, including but not limited to encryption, signing, compression and supplementing extended information, etc. In this embodiment, after the proxy service encapsulates the received data according to the first interface protocol, the IP address and serial number of the device are supplemented at the end of the information to facilitate the subsequent process of the Internet of Things platform. It can be seen that the proxy service of the present invention can provide compatibility with devices of different protocols while ensuring the security and reliability of data transmission, and has practical value.

[0076] Secondly, in response to the device instruction sent by the Internet of Things platform, an interface protocol matching the device instruction is selected from the pre-set interface protocols, and the device instruction generates device instruction data and sends it to the access device.

[0077] In this embodiment, when the proxy service performs data communication, the access device reports device data to the IoT platform, and the IoT platform issues instructions to the access device. That is, the proxy service can process the instructions of the IoT platform as necessary and send them to the access device. The specific steps include:

[0078] S31: The Internet of Things platform 200 sends a device instruction to the device access proxy service device 100;

[0079] S32: The device access proxy service apparatus 100 selects a matching interface protocol according to the device information in the device instruction.

[0080] In this embodiment, when the proxy service run by the device access proxy service device receives the device instruction issued by the Internet of Things platform, the device instruction is parsed to obtain the device information, and a matching second interface protocol is selected from the pre-set interface protocols according to the device information. In other words, the device instruction includes device information and instruction information, and a matching second interface protocol is selected from the pre-set interface protocols according to the device information.

[0081] In an optional embodiment, the proxy service can optimize the device data, including but not limited to decryption, signature verification, decompression and reading of extended information, etc. For example, in this embodiment, the proxy service reads the IP address of the access device in the extended information to provide a target address for the next step of sending data, or reads the serial number in the extended information to perform transaction processing in an asynchronous message environment, etc.

[0082] It can be seen that the proxy service described in the present invention can forward the instructions issued by the Internet of Things platform to devices of various protocols, and has good compatibility. At the same time, it can provide extended functions for the data itself, such as confidentiality, anti-tampering, multi-threading support, etc., and has certain practical value.

[0083] S33: the device access proxy service device 100 generates device instruction data according to the second interface protocol;

[0084] S34: the device access proxy service device 100 sends device instruction data to the access device 300;

[0085] S35: The access device 300 executes the device instruction.

[0086] In this embodiment, the proxy service run by the device access proxy service device encapsulates the instruction information according to the second interface protocol to generate device instruction data, and sends it to the access device corresponding to the device information; that is, the instruction information is generated into device instruction data through the second interface protocol and sent to the access device corresponding to the device information.

[0087] Specifically, the present invention does not specifically limit the method for obtaining the target address of the access device, and those skilled in the art should make corresponding processing according to specific needs. In an optional embodiment, the proxy service can query the IP address corresponding to the device in the device list stored in the proxy service according to the device information. In another optional embodiment, the proxy platform can parse the extended information from the instruction information according to the second interface protocol, and read the original IP address of the sending device from the extended information, thereby achieving a situation where the compatible IP address can be changed dynamically. In another optional embodiment, the access device does not support the TCP / IP protocol, and the proxy service can perform interface conversion again to achieve compatibility with multiple devices; that is, when the access device is a non-TCP / IP device, the setting instruction data is converted into data recognizable by the access device through a pre-set data conversion interface.

[0088] It can be seen that the proxy service described in the present invention is compatible with devices of multiple protocols, including but not limited to TCP / IP, MQTT, UART, Zigbee, Lora, Bluetooth, infrared, etc. The proxy service has strong compatibility and has certain practical value.

[0089] Considering that there is communication between access devices, in an optional embodiment, the access device includes at least one first access device and at least one second access device communicating with the first access device, and the proxy service construction method further includes:

[0090] In response to the first device data sent by the first access device, a third interface protocol matching the first access device is selected from the pre-set interface protocols and the first device data is parsed to generate parsed data; a fourth interface protocol matching the second access device is selected from the pre-set interface protocols and the parsed data is generated into second device data and sent to the second access device.

[0091] In this embodiment, the proxy service responds to the data input of the first device, confirms the device type of the receiving device, parses the device data according to the corresponding protocol, and confirms that the data needs to be directly forwarded to another access device instead of being reported to the Internet of Things platform. Therefore, the device data is parsed using the third interface protocol that matches the first device, and the second access device is confirmed to be the destination of the device data. The fourth interface protocol that matches the second access device is selected from the pre-set interface protocols and the parsed data is generated into second device data that can be recognized by the second access device and sent to the second access device.

[0092] It can be seen that the proxy service described in the present invention can handle the communication relationship between at least two pre-set access devices, that is, data communication is performed directly through the proxy service without passing through the Internet of Things platform, which is faster and more convenient, can improve the response speed of data processing, and reduce the data processing pressure of the Internet of Things platform, thereby improving the load capacity of the Internet of Things platform.

[0093] Considering the stable operation of the Internet of Things system, in an optional embodiment, after generating a device authentication request according to the received device data sent by the access device and sending it to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform, the proxy service construction method further includes:

[0094] Heartbeat communication is performed with the access device and the Internet of Things platform respectively at preset time intervals.

[0095] In this embodiment, after the proxy service establishes a communication path between the access device and the Internet of Things platform, in order to ensure a stable connection with the Internet of Things platform and the access device, the proxy service maintains a stable connection with the Internet of Things platform by performing a first heartbeat communication with the Internet of Things platform. Similarly, the proxy service maintains a stable connection with the access device by performing a second heartbeat communication with the access device.

[0096] This application does not limit the specific implementation of the heartbeat communication of the proxy service, but only provides basic functional modules. Those skilled in the art should design and implement specific heartbeat modes according to actual needs and specific access devices. In this embodiment, for non-TCP / IP devices, since their own hardware is limited and they do not support the TCP / IP communication protocol, they cannot actively send heartbeats. The proxy service will provide them with a service for sending heartbeat requests on their behalf.

[0097] At this point, the proxy service enables the access device to access the Internet of Things platform and realizes communication between the access device and the Internet of Things platform.

[0098] Considering how to use the above proxy service more conveniently and widely, this embodiment uses container technology to build a service image for the proxy service and deploys it according to the service image.

[0099] In this embodiment, if Figure 4 As shown, the proxy service uses container technology to complete its code management, program packaging and program deployment, specifically including:

[0100] First, the code of the proxy service is pulled, compiled, packaged and a service image is built using container technology, and the service image is uploaded to the image warehouse.

[0101] In this embodiment, after the developer of the proxy service completes the code development according to the actual needs, he generates a tag and uploads the code to the version control server. In the project management service, relevant configuration is performed, and the product release personnel run the relevant script to package the software code and the relevant software base library into an image and upload it to the image warehouse.

[0102] Then, deployment is performed in response to a deployment request of a preset deployment object, so that the deployment object pulls the service image from the image repository and starts to complete the deployment.

[0103] In this embodiment, according to the preset deployment object, relevant information is read and the image repository command is operated to complete the deployment, which specifically includes the following steps:

[0104] First, pull the service image from the server where the proxy service image is deployed. The server running the proxy service image includes but is not limited to a cloud server, a local server, an intelligent gateway, etc. Any environment that supports the operation of the image service can be used to run the service image of the proxy service.

[0105] Secondly, on the server running the proxy service image, if it is determined that there is a container with an old version of the proxy service image installed, a related script will be called and the operation of the old version container will be stopped.

[0106] Again, on the server running the proxy service image, start the container of the new version of the proxy service image.

[0107] Finally, the corresponding startup script is called to start the related services in the container;

[0108] It is worth noting that the present invention uses container technology to encapsulate the proxy service that adapts to complex and changeable IoT access devices in a service image, and uses image technology and version control technology to manage and automatically deploy the service image. It can have good reliability in actual engineering practice, thereby adapting to complex and changeable project requirements.

[0109] Corresponding to the proxy service construction method provided in the above-mentioned embodiments, an embodiment of the present application also provides a proxy service device for a device to access an Internet of Things platform. Since the proxy service device provided in the embodiment of the present application corresponds to the proxy service construction method provided in the above-mentioned embodiments, the previous implementation method is also applicable to the proxy service device provided in this embodiment and will not be described in detail in this embodiment.

[0110] Specifically, an embodiment of the present application also provides a device access proxy service device, which runs the service image constructed by the above-mentioned proxy service construction method, establishes a communication path between the access device and the Internet of Things platform in response to the device data sent by the access device, and uses the communication path to realize the communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface.

[0111] The device access proxy service device described in this embodiment develops a method of building a communication path between the access device and the Internet of Things platform through a proxy service and realizing communication between the two, which is convenient and fast; at the same time, the data output by non-TCP / IP devices is converted through a pre-set data conversion interface, so that non-TCP / IP devices can be connected to the Internet of Things platform, effectively expanding the application scope of devices that can be accessed by the Internet of Things platform and reducing the access cost of non-TCP / IP devices; further, the container technology is used to integrate data conversion, establish communication paths and realize data communication into a service and build a service image for deployment, which improves service flexibility, reduces the difficulty of operation and maintenance and updating, reduces deployment costs, and has broad application prospects. The specific implementation method of this embodiment refers to the aforementioned embodiment and will not be repeated here.

[0112] Based on the above equipment access proxy service device, such as Figure 2 As shown, an embodiment of the present application provides an Internet of Things system, including an Internet of Things platform, multiple access devices, a data conversion interface, and the above-mentioned device access proxy service device.

[0113] In this embodiment, the Internet of Things system realizes the communication path between the access device and the Internet of Things platform and realizes communication between the two through the proxy service device, which has good convenience, compatibility and stability, and has wide flexibility and practicality.

[0114] In an optional embodiment, if Figure 5a As shown, the Internet of Things system includes an intelligent gateway, and the intelligent gateway includes the data conversion interface and the device access proxy service device.

[0115] In this embodiment, some of the access devices are limited by hardware level and cost control. The access devices themselves do not support TCP / IP protocol and cannot directly upload relevant data to the Internet of Things platform. To solve this problem, data access of the access devices is achieved through an intelligent gateway including the data conversion interface and the device access proxy service device. For example, the access device is a sensor, the output interface of the sensor is an RS485 interface, and the output data is RS485 data, which cannot be directly transmitted to the Internet of Things platform. The RS485 to USB conversion of the data conversion interface in the intelligent gateway is used to convert the data output by the sensor to the device access proxy service device in the intelligent gateway, thereby achieving data of different protocols, especially non-TCP / IP devices, being uploaded to the Internet of Things platform, with good compatibility and stability.

[0116] In an optional embodiment, if Figure 5b As shown, the Internet of Things system includes a cloud server, and the cloud server includes the device access proxy service device.

[0117] In this embodiment, if the access device supports TCP / IP protocol itself, or is limited by hardware level and cost control, the access device does not support TCP / IP protocol itself, and a transparent transmission device is added to enable it to support TCP / IP protocol, it is necessary to establish a secure and stable data path to upload relevant data to the IoT platform. To solve this problem, a cloud server is added, and a device access proxy service device is deployed on the cloud server. For example, the access device is a sensor, the output interface of the sensor is an NB-iot interface, and the output data is NB-iot data. The data can be directly uploaded to the proxy service device of the cloud server through the TCP / IP protocol.

[0118] In this embodiment, because the cloud server itself is secure, stable, and can be updated and expanded at any time, the proxy service device running on the cloud server also has corresponding advantages. For example, in combination with container technology, new image services can be redeployed at any time to support new access devices; for another example, when there is an emergency that requires a significant increase in the processing performance of the proxy service device in a short period of time, the advantages of cloud services can be used to deploy hardware to support related needs at any time, or to reduce costs and reduce the hardware configuration of the cloud server after the emergency is over; so that the proxy service has better compatibility, stability and adaptability.

[0119] Another embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the following steps provided by the embodiment of the invention: establishing a communication path between the access device and an Internet of Things platform in response to device data sent by an access device, and utilizing the communication path to implement communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a pre-set data conversion interface; using container technology to build a service image for the proxy service, and deploying it according to the service image.

[0120] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0121] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0122] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0123] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0124] like Figure 6 As shown, a structural schematic diagram of a computer device provided by another embodiment of the present invention. Figure 6 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0125] like Figure 6 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0126] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0127] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0128] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0129] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0130] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 20. Figure 6 As shown, the network adapter 20 communicates with other modules of the computer device 12 via the bus 18. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with computer device 12, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0131] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing a proxy service construction method for a device to access an Internet of Things platform provided in an embodiment of the present invention.

[0132] In view of the existing problems, the present invention develops a method for building a communication path between an access device and an Internet of Things platform through a proxy service and realizing communication between the two, which is convenient and fast; at the same time, through a pre-set data conversion interface, the data output by a non-TCP / IP device is converted into an interface, so that the non-TCP / IP device can be connected to the Internet of Things platform, effectively expanding the application scope of the devices that can be accessed by the Internet of Things platform, and reducing the access cost of non-TCP / IP devices; further, the container technology is used to integrate data conversion, establishment of a communication path and realization of data communication into a service and build a service image for deployment, which improves service flexibility, reduces the difficulty of operation and maintenance and updating, and reduces deployment costs, and has broad application prospects.

[0133] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not limitations on the implementation methods of the present invention. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is impossible to list all the implementation methods here. All obvious changes or modifications derived from the technical solution of the present invention are still within the protection scope of the present invention.

Claims

1. A method for constructing a proxy service for a device to access an Internet of Things platform, characterized in that: include: In response to device data sent by the access device, a communication path is established between the access device and the Internet of Things platform, and the communication path is used to realize the communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface; further comprising: Generate a device authentication request according to the received device data sent by the access device, and send it to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform, wherein the device data includes device information and device monitoring data of the access device, and the device authentication request includes the device information of the access device; In response to the device data sent by the access device, a matching interface protocol is selected from the preset interface protocols and the device data is parsed, a device data request is generated and sent to the Internet of Things platform, the device data request includes the parsed device data; further comprising: Identify the device interface protocol type of the device data, and select a matching first interface protocol from preset interface protocols; Parsing the device monitoring data using the first interface protocol and generating a device data request, and sending the device data request to the Internet of Things platform; In response to the device instruction sent by the Internet of Things platform, an interface protocol matching the device instruction is selected from the preset interface protocols, and the device instruction is used to generate device instruction data and send it to the access device; further comprising: The device instruction includes device information and instruction information, and a matching second interface protocol is selected from preset interface protocols according to the device information; Generate device instruction data from the instruction information through the second interface protocol and send it to the access device corresponding to the device information, and when the access device is a non-TCP / IP device, convert the setting instruction data into data recognizable by the access device through a preset data conversion interface; The access device includes at least one first access device and at least one second access device communicating with the first access device, and the proxy service construction method further includes: in response to first device data sent by the first access device, selecting a third interface protocol matching the first access device from preset interface protocols and parsing the first device data to generate parsed data, selecting a fourth interface protocol matching the second access device from preset interface protocols and generating second device data from the parsed data and sending the second access device; Using container technology to build a service image for the proxy service, and deploying according to the service image; further comprising: Use container technology to pull, compile, package and build a service image of the proxy service code, and upload the service image to the image warehouse; Deployment is performed in response to a deployment request of a preset deployment object, so that the deployment object pulls the service image from the image repository and starts to complete the deployment.

2. The method for constructing a proxy service according to claim 1, characterized in that: The generating of a device authentication request according to the received device data sent by the access device and sending the request to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform further includes: Generate a device authentication request according to the received device data and send it to the Internet of Things platform; The device information of the device data is saved in response to the device authentication confirmation instruction sent by the Internet of Things platform.

3. The proxy service construction method according to claim 1, characterized in that: After generating a device authentication request according to the received device data sent by the access device and sending it to the Internet of Things platform to establish a communication path between the access device and the Internet of Things platform, the proxy service construction method further includes: Heartbeat communication is performed with the access device and the Internet of Things platform respectively at preset time intervals.

4. A device access proxy service device, characterized in that: Run the service image constructed by the proxy service construction method described in any one of claims 1 to 3, establish a communication path between the access device and the Internet of Things platform in response to the device data sent by the access device, and use the communication path to realize the communication between the access device and the Internet of Things platform to form a proxy service, wherein the device data is communication data that complies with the TCP / IP protocol, and when the access device is a non-TCP / IP device, the output data is converted into the device data through a preset data conversion interface, including: the proxy service identifies the data output by each access device and selects a matching interface protocol from the preset interface protocols through the data conversion interface and converts it into the device data.

5. An Internet of Things system, characterized in that: It comprises an Internet of Things platform, multiple access devices, a data conversion interface, and the device access proxy service device as claimed in claim 4.

6. The Internet of Things system according to claim 5, characterized in that: It comprises an intelligent gateway, and the intelligent gateway comprises the data conversion interface and the device access proxy service device.

7. The Internet of Things system according to claim 5, characterized in that: It includes a cloud server, and the cloud server includes the device access proxy service device.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Method for internet of things platform access equipment

    CN108270855A

  • Internet of Things platform equipment access method, equipment and system

    CN113015165A

  • Data processing method and device, electronic equipment and storage medium

    CN113645131A