Internet of Things remote calling method based on resource identifier and related equipment thereof

By using URI data and hash digest in the IoT system, the remote call process is simplified, the problems of complex development and bandwidth waste in the existing technology are solved, efficient and secure remote call of the IoT are achieved, and the system is improved performance and user experience.

CN119071344APending Publication Date: 2024-12-03深圳异彩科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411030466.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

Existing IoT remote call solutions are complex to develop, bandwidth is wasted, and are not suitable for resource-constrained devices, especially when cloud services send messages to devices.

Method used

Using the IoT remote call method based on resource identification, hash calculation and data relay in the proxy server through URI data (URI string or URI hash digest). The second device determines the processing function based on the hash digest to achieve fast positioning. and process resources, reduce communication complexity between devices, and improve system scalability and security.

Benefits of technology

Simplifies the remote call development process, improves the system's performance and user experience, ensures the fast response and accurate processing of the IoT system when processing remote call requests, and enhances the flexibility and security of the system, especially in cross-network domains. Secure access during communication.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119071344A_ABST
    Figure CN119071344A_ABST
Patent Text Reader

Abstract

The invention discloses an Internet of Things remote calling method based on a resource identifier and related equipment thereof, and belongs to the technical field of network communication. By introducing URI data including URI character strings or URI hash abstracts, rapid positioning and resource processing can be realized; the proxy server carries out Hash calculation and data transfer, the complexity of communication between direct devices is reduced, the expandability and maintainability of the system are improved, meanwhile, the efficiency and safety of data transmission are improved through the Hash digest, sensitive URI information is prevented from being exposed in the transmission process, the second device executes a processing function based on the Hash digest, and the data transmission efficiency is improved. And efficient processing and response of the request are realized. The quick response and accurate processing of the Internet of Things system when the remote call request is processed are ensured, and the overall performance of the system and the user experience are enhanced. Through sharing and coordination of the proxy server, the problem of cross-network domain communication between devices is effectively solved, for example, the Internet of Things devices are safely accessed on a public network, and the flexibility and security of the system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of network communication technology, and specifically relates to a remote calling method of the Internet of Things based on resource identification and related equipment. Background Art

[0002] The Internet of Things is a network that connects various objects to the Internet through information sensing devices, such as radio frequency identification, infrared sensors, and global positioning systems, to exchange information and communicate, so as to achieve intelligent identification, positioning, tracking, monitoring, and management. IoT devices are usually called remotely in the network (such as "remote device control") and also initiate remote calls (such as requesting the server to query the latest firmware version).

[0003] Currently, the most widely used remote call solution is that IoT devices connect to a proxy service (usually deployed in the cloud) through the MQTT protocol. The MQTT protocol is a topic-based publish-subscribe model, which requires mutual subscription to each other's topics before publishing messages to each other. In particular, in the request-response model, there will be a pair of topic coupling between the two parties, which makes remote call development complicated.

[0004] Some remote call solutions are implemented using the MQTT protocol, and each published message needs to carry a long string of UTF-8 encoded topics. Remote control devices need to send messages to each device, and usually the topic contains the identifier of each device (for example, a UUID will take up 36 characters), resulting in a waste of communication bandwidth.

[0005] Some IoT devices can connect to cloud services via HTTP, HTTP2, or Websocket protocols, but these protocols are not designed for constrained devices, are not compact enough, and are not suitable for resource-constrained devices.

[0006] Some IoT devices implement remote calls based on CoAP, a communication protocol designed for resource-constrained devices, but this protocol is more suitable for device-to-device (M2M) communication within a local network. It is not applicable to scenarios where cloud services send messages to IoT devices in remote control device scenarios. Although the subsequent protocol adds an "observe resource" model, according to the protocol standard (RFC7641), this is a "best effort" to notify the CoAP client of each resource update, and it cannot guarantee that each resource change can be notified to the device, but the latest status is notified to the IoT device. Therefore, it is unreliable to send control instructions to IoT devices through CoAP resource updates. Summary of the invention

[0007] The purpose of the embodiments of the present application is to propose a resource identification-based remote calling method, device, computer equipment and storage medium for the Internet of Things to solve the problems of complex calling development process and bandwidth waste in existing remote calling solutions.

[0008] In order to solve the above technical problems, the embodiment of the present application provides an IoT remote calling method based on resource identification, which adopts the following technical solution:

[0009] A remote calling method for an Internet of Things based on resource identification, the remote calling method for an Internet of Things is applied to an Internet of Things system composed of a first device, a proxy server and a second device, and the remote calling method for an Internet of Things includes:

[0010] The first device sends a remote call request to the proxy server based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest;

[0011] When the URI data is a URI character string, the proxy server performs hash calculation on the URI character string to obtain a URI hash digest, and forwards the URI hash digest calculated by the proxy server and the request data to the second device;

[0012] When the URI data is a URI hash digest, the proxy server directly forwards the remote call request to the second device;

[0013] The second device determines a matching processing function according to the URI hash digest, wherein each URI hash digest is bound to a processing function;

[0014] The second device executes the processing function to process the request data, obtains response data, and sends the response data to the proxy server;

[0015] The proxy server sends response data to the first device based on the communication request response.

[0016] Furthermore, the second device is an Internet of Things device or a device server, the URI string is a uniform resource identifier pre-declared for a function of the second device, and the URI hash digest is a hash calculation result of the URI string.

[0017] Furthermore, when the second device is an Internet of Things device, the first device is a mobile device or a server that controls the Internet of Things device.

[0018] Furthermore, before the first device sends the remote call request to the proxy server based on the preset communication request, it also includes:

[0019] The IoT device registers the pre-declared URI and performs hash digest calculation on the pre-declared URI string to obtain the URI hash digest of the IoT device;

[0020] Get the processing function of the IoT device and bind the URI hash digest of the IoT device to the processing function of the IoT device.

[0021] Furthermore, when the second device is a device server, the first device is an IoT device, and after the proxy server receives the URI hash digest, the IoT remote calling method specifically includes:

[0022] The proxy server searches for the device service address and processing function of the target device server based on the URI hash digest, wherein the target device server is the device server that the IoT device needs to call;

[0023] The proxy server sends the processing function and request data to the target device server based on the device service address.

[0024] Furthermore, before the first device sends the remote call request to the proxy server based on the preset communication request, it also includes:

[0025] The device server registers the pre-declared URI and performs hash digest calculation on the pre-declared URI string to obtain the URI hash digest of the device server;

[0026] The processing function and the device service address of the device server are obtained, and the URI hash digest of the device server, the device service address of the device server and the processing function of the device server are bound.

[0027] Furthermore, it also includes:

[0028] The IoT device initiates a link establishment request to the proxy server, wherein the link establishment request includes at least a device identification and a device key of the IoT device;

[0029] The proxy server authenticates the IoT device based on the device identification and device key of the IoT device;

[0030] When the authentication of the IoT device is passed, a link is established between the IoT device and the proxy server.

[0031] In order to solve the above technical problems, the embodiment of the present application also provides an IoT remote calling device based on resource identification, which adopts the following technical solution:

[0032] A remote calling system of the Internet of Things based on resource identification, the remote calling system of the Internet of Things includes a first device, a proxy server and a second device, wherein:

[0033] A first device, configured to send a remote call request to a proxy server based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest;

[0034] The proxy server is configured to, when the URI data is a URI character string, perform hash calculation on the URI character string to obtain a URI hash digest, and forward the calculated URI hash digest and the request data to the second device; when the URI data is a URI hash digest, directly forward the remote call request to the second device, and send the response data returned by the second device to the first device based on the communication request response;

[0035] The second device is used to determine a matching processing function according to the URI hash digest, execute the processing function to process the request data, obtain response data, and send the response data to the proxy server, wherein each URI hash digest is bound to a processing function.

[0036] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0037] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the resource identification-based Internet of Things remote calling method as described in any one of the above are implemented.

[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0039] A computer-readable storage medium having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by a processor, implement the steps of the resource identification-based Internet of Things remote calling method as described in any one of the above.

[0040] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0041] The present application discloses a remote calling method of the Internet of Things based on resource identification and related devices, and belongs to the field of network communication technology. By introducing URI data, including URI string or URI hash digest, the system can quickly locate and process resources; the proxy server performs hash calculation, data transfer and data caching, which reduces the complexity of direct communication between devices and improves the scalability and maintainability of the system. At the same time, the hash digest is used to improve the efficiency and security of data transmission, and sensitive URI information is prevented from being exposed during the transmission process. The second device executes the processing function based on the hash digest to achieve efficient processing and response of the request. The solution of the present application ensures the rapid response and accurate processing of the Internet of Things system when processing remote call requests, and enhances the overall performance and user experience of the system. Through the sharing and coordination of the proxy server, the problem of cross-network domain communication between devices is effectively solved, such as secure access to Internet of Things devices on the public network, which improves the flexibility and security of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 A flowchart of an embodiment of a resource identification-based IoT remote calling method according to the present application is shown;

[0044] Figure 2 A flowchart of an embodiment of registering a URI for an IoT device according to the present application is shown;

[0045] Figure 3 An interaction diagram showing an embodiment in which a mobile device initiates a remote call to an IoT device;

[0046] Figure 4 A flowchart of an embodiment of registering a URI with a device server according to the present application is shown;

[0047] Figure 5 An interaction diagram showing an embodiment in which an IoT device initiates a remote call to a device server;

[0048] Figure 6 A flowchart of an embodiment of an Internet of Things device initiating a link to a proxy server according to the present application is shown;

[0049] Figure 7 A structural schematic diagram of an embodiment of a resource identification-based IoT remote calling device according to the present application is shown;

[0050] Figure 8 A schematic structural diagram of an embodiment of a computer device according to the present application is shown. DETAILED DESCRIPTION

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0054] See also Figure 1 , Figure 1 A flowchart of an embodiment of a resource identification-based IoT remote calling method according to the present application is shown. A resource identification-based IoT remote calling method is applied to an IoT system composed of a first device, a proxy server, and a second device. The IoT remote calling method includes:

[0055] S101, the first device sends a remote call request to a proxy server based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest.

[0056] Specifically, when the IoT system receives a preset communication request, it sends the communication request to the first device. The first device sends a remote call request to the proxy server based on the preset communication request. This remote call request contains at least two key elements: URI data and request data. The URI data can be a URI string or its hash digest. The URI string is a uniform resource identifier pre-declared by the developer for the function of the second device. The URI hash digest is the hash calculation result of the URI string. URI (Uniform Resource Identifier) ​​is a string used to identify resources. URI can help locate and access resources in the IoT system, and the request data is the specific data or instructions that need to be processed. The key to this step is that the first device must know the URI of the target resource in advance and construct a correct remote call request so that the proxy server can correctly process and forward the request.

[0057] The proxy server can be deployed on a cloud server or on an edge device. The preset communication request includes but is not limited to the HTTP protocol, GRPC protocol or TCP protocol. This step ensures the flexibility and scalability of the system because the first device only needs to know the URI of the resource without having to care about the specific resource location or processing method.

[0058] S102: When the URI data is a URI character string, the proxy server performs a hash calculation on the URI character string to obtain a URI hash digest, and forwards the URI hash digest calculated by the proxy server and the request data to the second device.

[0059] Specifically, when the proxy server receives a remote call request containing a URI string, it performs a hash calculation on the URI string to generate a URI hash digest. Hash calculation is to convert the input (here is the URI string) into a fixed-length output (hash value) through a hash algorithm. The hash algorithm in this application includes but is not limited to the CRC32 algorithm or the MD5 algorithm. This conversion helps to simplify and speed up subsequent resource matching operations because the hash value has a fixed length and a low probability of conflict.

[0060] After generating the URI hash digest, the proxy server forwards the URI hash digest and the request data to the second device. This step is designed with performance and security in mind, because the hash digest is shorter than the original URI string, and is more efficient to transmit and store. It also avoids directly transmitting sensitive URI information.

[0061] S103: When the URI data is a URI hash digest, the proxy server directly forwards the remote call request to the second device.

[0062] Specifically, when the remote call request received by the proxy server already contains the URI hash digest, the proxy server no longer performs hash calculations, but directly forwards the request to the second device. In this case, the first device has already calculated and attached the URI hash digest in advance, simplifying the processing steps of the proxy server. This step improves the flexibility and efficiency of the system, allowing different devices to decide whether to pre-calculate the URI hash digest based on their own capabilities and needs, thereby reducing the burden and delay of the proxy server. In addition, this also enhances the security of the system because the original URI string will not be exposed in the communication.

[0063] S104: The second device determines a matching processing function according to the URI hash digest, wherein each URI hash digest is bound to a processing function.

[0064] Specifically, after receiving the remote call request, the second device will determine the corresponding processing function based on the URI hash digest. Each URI hash digest is bound to a specific processing function in advance, which ensures that the request data is processed by the correct logic. The processing functions are usually pre-defined and can perform various operations, such as data storage, calculations, or other control tasks. The core of this step lies in the uniqueness and accuracy of the hash digest, which enables the system to efficiently map requests to the corresponding processing logic. This design contributes to the modularity and maintainability of the system, because new functions or resources can be expanded by adding new URIs and processing functions.

[0065] S105, the second device executes the processing function to process the request data, obtains response data, and sends the response data to the proxy server.

[0066] Specifically, the second device performs processing operations according to the processing function determined in the previous step, and processes the request data, including reading sensor data, controlling device actions, performing computing tasks, etc. After the processing is completed, the second device generates response data, which reflects the processing results, which can be status information, calculation results, or other related data. This step is the core of the entire remote call, which directly determines the processing effect of the request and the functional realization of the system. The efficiency and accuracy of executing the processing function are crucial to the overall performance of the system and the user experience.

[0067] S106: The proxy server sends response data to the first device based on the communication request response.

[0068] Specifically, the second device sends the generated response data to the proxy server, and the proxy server forwards the response data to the first device based on the response to the above communication request. This step completes the closed loop of the entire remote call, allowing the first device to receive the processing results. This method of transiting through the proxy server improves the flexibility and security of the system, because the proxy server can perform necessary intermediate processing, such as data caching, protocol conversion, etc. At the same time, this also simplifies direct communication between devices and reduces the complexity of the system. This mechanism ensures the scalability and efficient operation of the Internet of Things system.

[0069] Furthermore, the second device is an Internet of Things device or a device server, the URI string is a uniform resource identifier pre-declared for a function of the second device, and the URI hash digest is a hash calculation result of the URI string.

[0070] Specifically, the second device can be an IoT device or a device server, and the URI string is a uniform resource identifier pre-declared by the developer for the function of the second device to declare a remote call target provided by the device. Usually, the device pre-declares multiple different URI strings for different functions. The URI hash digest is calculated by hashing the URI string. This process ensures that each device function has a unique identifier in the device, which facilitates subsequent remote calls.

[0071] Embodiment 1

[0072] A remote calling scheme is initiated by a mobile device or a server controlling an IoT device to an IoT device, wherein the second device is an IoT device and the first device is a mobile device or a server controlling an IoT device.

[0073] For further information, see Figure 2 , Figure 2 A flowchart of an embodiment of registering a URI for an IoT device according to the present application is shown, and before the first device sends a remote call request to a proxy server based on a preset communication request, the flowchart also includes:

[0074] S201, the IoT device registers the pre-declared URI, and performs hash digest calculation on the pre-declared URI string to obtain the URI hash digest of the IoT device;

[0075] S202, obtaining a processing function of the IoT device, and binding the URI hash digest of the IoT device to the processing function of the IoT device.

[0076] Specifically, the second device is an Internet of Things device, and the first device includes but is not limited to a mobile device or a server that controls these Internet of Things devices.

[0077] Before making a remote call, the IoT device will register the pre-declared URI. The URI is in the form of a string and is a uniform resource identifier pre-declared by the developer for the functions of the IoT device. The URI string is usually defined based on the characteristics and functions of the device to ensure its uniqueness and identifiability in the system. It is the remote call target provided by the IoT device to the outside world.

[0078] When registering a URI, IoT devices will perform hash calculations on the URI string to generate the corresponding URI hash digest. The hash digest has the characteristics of uniqueness and low probability of conflict, which not only simplifies the system's processing of URIs, but also improves the efficiency and security of data transmission.

[0079] IoT devices predefine processing functions based on device characteristics and functions. The processing function is the specific logic of the system processing device requests to implement the functional operation of the device. The processing function is bound to the generated URI hash digest to generate a URI hash digest-processing function mapping table. The storage location of the URI hash digest-processing function mapping table includes but is not limited to the device memory or the device's file system or the storage medium that the device can access. Through this binding method, the system can quickly locate and call the corresponding processing function to ensure the efficiency and accuracy of remote calls.

[0080] Take the example of a mobile device initiating a remote call to an IoT device. Figure 3 , Figure 3 The interactive diagram of an embodiment of a mobile device initiating a remote call to an IoT device is shown. The IoT system first calls the IoT device to register a URI string, which is a uniform resource identifier pre-declared by the developer for the function of the IoT device, and declares a remote call target provided by the IoT device. The specific process is as follows:

[0081] The device side calculates the hash digest of the URI digest = Hash (URI), where: URI is a string, digest is the URI hash digest, and the URI hash digest is bound to its processing function. In the embodiment, CRC32 is used for hash calculation, and its URI hash digest is bound to the processing function to obtain the URI hash digest-processing function mapping table of the IoT device:

[0082] Table 1 URI hash summary-processing function mapping table of IoT devices

[0083] 0x345789AB "Processing function 1 0x6678334C "Processing function 2 0x20240625 "Processing function 3

[0084] After obtaining the URI hash digest-processing function mapping table of the IoT device, the specific interaction process of the mobile device initiating a remote call to the IoT device is as follows:

[0085] S11. The IoT device initiates a link establishment request to the proxy server. The request includes the device ID and device secret of the IoT device. The proxy service authenticates the IoT device. If the authentication is successful, the link becomes a legitimate link. If the authentication fails, the link will be closed.

[0086] S21. Sending a remote call request to a proxy server using an HTTP request via a mobile device, wherein the remote call request includes at least URI data and request data, and the URI data is a URI string or a URI hash digest;

[0087] After receiving the remote call request, the proxy server judges the URI data. When the URI data is a URI character string, the proxy server performs a hash calculation on the URI character string to obtain a URI hash digest. When the URI data is a URI hash digest, the proxy server no longer performs a hash calculation, but directly forwards the request to the second device.

[0088] S22. The proxy server sends the URI hash digest and the request data to the IoT device;

[0089] The IoT device determines a matching processing function according to the URI hash digest, and executes the processing function to process the request data to obtain response data, wherein each URI hash digest is bound to a processing function;

[0090] S23. The IoT device sends the response data to the proxy server;

[0091] S24. The proxy server sends response data to the mobile device based on the HTTP request response.

[0092] Please continue to refer to Figure 3 As shown in Table 1, the following takes a mobile device remotely controlling a printer as an example, where the printer is an IoT device:

[0093] The printer program registers a URI, such as " / printer / action", and executes the following function RegistURI(" / printer / action", startPrinting). The RegistURI function calls the hash calculation function digest = Hash(URI) to calculate the hash digest. Finally, the RegistURI function binds the hash digest and the processing function and stores them in the URI hash digest-processing function mapping table.

[0094] Then execute S11. The printer initiates a link establishment request to the proxy service. The request includes the printer's device ID and device secret key. The proxy service authenticates the printer. If the authentication is successful, the link becomes a legitimate link. If the authentication fails, the link will be closed.

[0095] The user initiates a remote call to the printer via the mobile phone.

[0096] Execute S21. The mobile device requests the proxy service via the HTTP protocol, wherein the request includes the device identification of the printer, the URI string of the remote call (" / printer / action"), and the request data of the remote call ("cmd=print", indicating starting printing).

[0097] After receiving the request, the proxy service performs hash calculation on the remote call URI string (" / printer / action") to obtain the hash digest (0x44d87c69).

[0098] Execute S22. The proxy service forwards the URI hash digest (0x44d87c69) of the remote call and the request data ("cmd=print") of the remote call to the printer according to the device identification of the printer.

[0099] After receiving the request forwarded by the proxy service, the printer finds the bound processing function startPrinting() according to the URI hash digest of the remote call (0x44d87c69), executes startPrinting(), and starts the printing task by judging the request data (RequestData is "cmd = print") and using the execution status as the response data ("status = printing"). The processing function is as follows:

[0100] ResponseData=startPrinting(RequestData)

[0101] Among them, RequestData is "cmd=print" and ResponseData is "status=printing".

[0102] Execute S23. The printer sends the response data ("status = printing") of the remote call to the proxy service.

[0103] Execute S24. The proxy service returns the response data to the mobile phone using the HTTP response as a carrier. At this point, the mobile phone initiates a remote call to the printer and issues a command to the printer to start printing.

[0104] In this embodiment, through the steps of pre-declaring URI and calculating hash digest of the above-mentioned IoT device function, URI is convenient for classification and management of device functions, and the digest length is short (only 4 bytes). At the same time, the uniqueness of the URI string and digest mapping can be guaranteed within a certain range, so that the system can accurately locate and process device requests. At the same time, the use of hash digests improves the efficiency and security of data processing and transmission. The binding processing function simplifies the system's call logic and improves the overall performance and user experience. This design enhances the scalability, maintainability and security of the IoT system, ensuring that the system can still operate efficiently when facing a large number of devices and complex operations.

[0105] Embodiment 2

[0106] The IoT device initiates a remote call scheme to the device server, wherein the second device is the device server and the first device is the IoT device. In this embodiment, the IoT remote call method specifically includes:

[0107] After receiving the URI hash digest, the proxy server searches for the device service address and processing function of the target device server based on the URI hash digest, where the target device server is the device server that the IoT device needs to call;

[0108] The proxy server sends the processing function and request data to the target device server based on the device service address. It should be noted that the above-mentioned "processing function" is a function defined and implemented by the target device server, and the "processing function" sent by the proxy server here refers to the pointer of the function (i.e. the address of the function in the device server service process space). This embodiment expands the IoT remote calling method based on resource identification, especially for the scenario where the second device is a device server, and describes in detail how to search and call the device service address and processing function through the proxy server in this case, thereby achieving efficient communication and collaborative work between devices.

[0109] When the second device is a device server, the first device is an IoT device. When the proxy server receives a remote call request containing a URI hash digest, it searches for the device service address and processing function of the target device server based on the hash digest. The target device server is a specific server that the IoT device needs to call and is responsible for processing the request of the IoT device.

[0110] After finding the device service address of the target device server, the proxy server will send the processing function and request data to the target device server, ensuring that the request data and processing logic can be accurately delivered to the device server responsible for processing, thereby achieving efficient communication and collaborative work between the IoT device and the device server.

[0111] For further information, see Figure 4 , Figure 4 A flowchart of an embodiment of registering a URI with a device server according to the present application is shown. Before the first device sends a remote call request to a proxy server based on a preset communication request, the flowchart also includes:

[0112] S301, the device server registers the pre-declared URI, and performs hash digest calculation on the pre-declared URI string to obtain the URI hash digest of the device server;

[0113] S302: Obtain a processing function and a device service address of the device server, and bind the URL hash digest of the device server, the device service address of the device server, and the processing function of the device server.

[0114] Before performing a remote call operation, the device server will register the pre-declared URI. The URI is in the form of a string, which is a uniform resource identifier pre-declared by the developer for the function of the IoT device. It is unique and identifiable in the system and is the remote call target provided by the device server to the outside world.

[0115] During the registration process of the device server URI, the URI string is hashed to generate the corresponding URI hash digest. The hash digest has the characteristics of uniqueness and low probability of conflict, which not only simplifies the system's processing of URIs, but also improves the efficiency and security of data transmission.

[0116] The device server predefines processing functions according to its characteristics and functions. The processing function is the specific logic of the system for processing device requests to implement the functional operation of the device server. The processing function, the device service address, and the generated URI hash digest are bound to generate a URI hash digest-device service address-processing function mapping table of the device server. The storage location of the URI hash digest-device service address-processing function mapping table of the device server includes but is not limited to an in-memory database (such as Redis) or a file system accessible to the proxy server. Through this binding method, the system can quickly locate and call the corresponding processing function to ensure the efficiency and accuracy of remote calls.

[0117] Take the example of an IoT device initiating a remote call to a device server. Figure 5 , Figure 5 The interactive diagram of an embodiment of an IoT device initiating a remote call to a device server is shown. The device server (device server A and device server B) needs to be registered with the system first, and its pre-declared URI is registered, that is, the remote call target provided by the device server is declared. The specific process is as follows:

[0118] The device side calculates the hash digest of the URI digest = Hash (URI), where: URI is a string, digest is the URI hash digest, and the URI hash digest of the device server, the device service address and its processing function are bound. In the embodiment, CRC32 is used for hash calculation, and the URI hash digest, the device service address and the processing function are bound to obtain the URI hash digest-device service address-processing function mapping table of the IoT device:

[0119] Table 2 URI hash summary of device server - device service address - processing function mapping table

[0120] 0x9e5c1339 Equipment service address A Processing function 1 0x07554283 Equipment service address A Processing function 2 0x70527215 Equipment service address B Processing function 3

[0121] After obtaining the URI hash digest-device service address-processing function mapping table of the device server, the specific interaction process of the IoT device initiating a remote call to the device server is as follows:

[0122] S11. The IoT device initiates a link establishment request to the proxy server. The request contains the device ID and device secret of the IoT device. The proxy service authenticates the IoT device. If the authentication is successful, the link becomes a legitimate link, such as a TCP link. If the authentication fails, the link will be closed.

[0123] S31. Sending a remote call request to a proxy server based on a TCP request through a TCP link established by the IoT device, wherein the remote call request includes at least URI data and request data, and the URI data is a URI string or a URI hash digest;

[0124] After receiving the remote call request, the proxy server judges the URI data. When the URI data is a URI character string, the proxy server performs a hash calculation on the URI character string to obtain a URI hash digest. When the URI data is a URI hash digest, the proxy server no longer performs a hash calculation, but directly forwards the request to the second device.

[0125] S32. The proxy server sends the URI hash digest and request data to the device server;

[0126] The device server determines a matching processing function according to the URI hash digest, and executes the processing function to process the request data to obtain response data, wherein each URI hash digest is bound to a processing function;

[0127] S33. The device server sends the response data to the proxy server;

[0128] S34. The proxy server sends the response data to the IoT device based on the TCP request response.

[0129] Please continue to refer to Figure 5 As shown in Table 2, taking the printer querying the device service for the latest firmware version as an example, the address of the device server is serviceA.deviceservice (ie, the DNS address of the device server), and the getVersion function is implemented.

[0130] The printer performs hash calculation on " / printer / version" to obtain a hash summary (0x9570eca7), and then executes S31. The IoT device initiates a remote call to the proxy service and carries the hash summary.

[0131] After receiving the printer request, the proxy service queries the "Server URI Summary and Device Service Processing Function Mapping Table" according to the hash summary (0x9570eca7) it carries to obtain the device service address (serviceA.deviceservice) and processing function (pointer to "getVersion") corresponding to the hash summary (0x9570eca7).

[0132] Execute S32. The proxy service forwards the processing function (pointer to "getVersion") and the remote call request data to the device service (serviceA.deviceservice). The device service calls the internal processing function getVersion() according to the processing function (pointer to "getVersion"), processes the remote call request data (ResponseData is "type=small") and obtains the remote call response data (ResponseData is "version=0.0.1").

[0133] The processing function is as follows: ResponseData = startPrinting (RequestData).

[0134] Among them, RequestData is "type=small" and ResponseData is "version=0.0.1".

[0135] Execute S33. The device service sends the remote call response data ("version=0.0.1") to the proxy service.

[0136] Execute S34. The proxy service forwards the response data ("version=0.0.1") of the remote call to the printer. At this point, the printer initiates a call to the device service (serviceA.deviceservice) to obtain the latest version.

[0137] In this embodiment, URI is used as the remote call target (object), which is easy to classify and search, and facilitates subsequent function iteration and maintenance. URI is used as the remote call target, and the following takes a printer as an IoT device as an example:

[0138] / printer / status – Get the printer status.

[0139] / printer / action – enables the printer to perform an action. For example, the parameter can specify “cmd=print” to start printing.

[0140] / printer / v2 / status – Get the printer status function after iteration to declare the V2 version of the URI.

[0141] / printer / v2 / action – The URI for the printer to perform an action function after iterating over the declared V2 version.

[0142] In the embodiment, the communication between the IoT device and the proxy service uses the CRC32 digest of the URI string as the remote call target, which only uses 4 bytes, which is about one tenth of the bytes occupied by the Topic of MQTT (the device identifier usually uses the UUID identifier. In the remote device control scenario, each device corresponds to at least one Topic. The standard UUID format is: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" with a total of 36 characters. Usually, in addition to the device identifier, the Topic will also have other information attached, such as "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / printer / status / request"). Especially in the scenario of a large number of IoT devices and frequent communications, the communication bandwidth is greatly saved.

[0143] In the embodiment, CRC32 is used as a hash function, which is suitable for running on resource-constrained devices. The CRC32 calculation process on the IoT device side is inside the registration function, and the user does not need to care about the digest calculation process, which is completely consistent with the remote call URI identifier on the mobile side, facilitating joint debugging and verification by developers on different ends.

[0144] In the embodiment, the IoT device is equivalent to a small HTTP server through the proxy service, providing services corresponding to the URI. The mobile device does not need to integrate communication-related SDKs (such as MQTT clients) and directly uses the HTTP protocol to call the services on the IoT device, which greatly simplifies the development work on the mobile device side.

[0145] In the embodiment, the addition of new device services will not affect old device services and already running IoT devices. There is no topic coupling similar to the request-response model implemented by MQTT, and IoT devices and device services can be independently upgraded and updated, which facilitates the iteration and maintenance of IoT application development.

[0146] In this embodiment, through the registration and binding steps of the device server, it is ensured that each device server address is unique, the URI string and the URI hash digest are unique, so that the system can accurately locate and process device requests. The proxy server plays a central role in the remote call process. By searching and forwarding requests, efficient communication and collaborative work between IoT devices and device servers are achieved. The use of hash digests improves the efficiency and security of data processing and transmission. The way of binding processing functions and device service addresses simplifies the system's call logic and improves overall performance and user experience. This design enhances the scalability, maintainability and security of the IoT system, ensuring that the system can still operate efficiently when facing a large number of devices and complex operations.

[0147] For further information, see Figure 6 , Figure 6 A flowchart of an embodiment of an Internet of Things device initiating a link to a proxy server according to the present application is shown, and further includes:

[0148] S401, the IoT device initiates a link establishment request to the proxy server, wherein the link establishment request at least includes a device identification and a device key of the IoT device;

[0149] S402, the proxy server authenticates the IoT device based on the device identification and device key of the IoT device;

[0150] S403, when the identity authentication of the IoT device is passed, a link is established between the IoT device and the proxy server.

[0151] Specifically, the IoT device initiates a link establishment request to the proxy server. This request contains at least the device ID and device key of the IoT device. The device ID is used to uniquely identify the device, while the device key is a security credential used for identity authentication. After receiving the link establishment request, the proxy server will authenticate the IoT device based on its device ID and device key. The identity authentication process usually involves verifying the device ID and key to confirm the authenticity and legitimacy of the device. When the IoT device passes the identity authentication, a link is established between the proxy server and the IoT device. This link ensures that the communication between the device and the server is secure and reliable. After the link is established, the IoT device can make remote calls and transmit data through the proxy server.

[0152] In this embodiment, the resource identification-based Internet of Things remote calling method is run on the electronic device (for example Figure 1 The server shown in the figure) can receive instructions or obtain data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future.

[0153] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0154] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0155] Further references Figure 7 As the above Figure 1 The present application provides an embodiment of a remote calling system of the Internet of Things based on resource identification, and the system embodiment is similar to Figure 1 Corresponding to the method embodiment shown, the system can be specifically applied to various electronic devices.

[0156] like Figure 7 As shown, the IoT remote calling system 700 based on resource identification described in this embodiment, the IoT remote system includes a first device 701, a proxy server 702 and a second device 703, wherein:

[0157] The first device 701 is used to send a remote call request to the proxy server 702 based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest;

[0158] The proxy server 702 is configured to, when the URI data is a URI character string, perform hash calculation on the URI character string to obtain a URI hash digest, and forward the calculated URI hash digest and the request data to the second device; when the URI data is a URI hash digest, directly forward the remote call request to the second device 703, and send the response data returned by the second device 703 to the first device 702 based on the communication request response;

[0159] The second device 703 is used to determine a matching processing function according to the URI hash digest, execute the processing function to process the request data, obtain response data, and send the response data to the proxy server, wherein each URI hash digest is bound to a processing function.

[0160] In the above embodiments, the present application discloses an IoT remote call system based on resource identification, which belongs to the field of network communication technology. The present application introduces URI data, including URI string or URI hash digest, so that the system can quickly locate and process resources; the proxy server performs hash calculation, data transfer and data caching, which reduces the complexity of direct device-to-device communication and improves the scalability and maintainability of the system. At the same time, the hash digest is used to improve the efficiency and security of data transmission, and prevent sensitive URI information from being exposed during the transmission process. The second device executes the processing function based on the hash digest to achieve efficient processing and response of the request. The solution of the present application ensures the rapid response and accurate processing of the IoT system when processing remote call requests, and enhances the overall performance and user experience of the system. Through the sharing and coordination of the proxy server, the problem of cross-network domain communication between devices is effectively solved, such as secure access to IoT devices on the public network, which improves the flexibility and security of the system.

[0161] To solve the above technical problems, the present application also provides a computer device. Figure 8 , Figure 8 This is a basic structural block diagram of the computer device in this embodiment.

[0162] The computer device 8 includes a memory 81, a processor 82, and a network interface 83 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 8 with components 81-83, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0163] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0164] The memory 81 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 81 can be an internal storage unit of the computer device 8, such as a hard disk or memory of the computer device 8. In other embodiments, the memory 81 can also be an external storage device of the computer device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 8. Of course, the memory 81 can also include both the internal storage unit of the computer device 8 and its external storage device. In this embodiment, the memory 81 is generally used to store the operating system and various application software installed on the computer device 8, such as computer-readable instructions of the remote call method of the Internet of Things based on resource identification, etc. In addition, the memory 81 can also be used to temporarily store various types of data that have been output or are to be output.

[0165] The processor 82 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 82 is generally used to control the overall operation of the computer device 8. In this embodiment, the processor 82 is used to run the computer-readable instructions stored in the memory 81 or process data, such as computer-readable instructions for running the resource identification-based Internet of Things remote call method.

[0166] The network interface 83 may include a wireless network interface or a wired network interface. The network interface 83 is generally used to establish a communication connection between the computer device 8 and other electronic devices.

[0167] In the above embodiment, the present application discloses a computer device, which belongs to the field of network communication technology. By introducing URI data, including URI string or URI hash digest, the system can quickly locate and process resources; the proxy server performs hash calculation, data transfer and data caching, which reduces the complexity of direct communication between devices and improves the scalability and maintainability of the system. At the same time, the hash digest is used to improve the efficiency and security of data transmission, and sensitive URI information is prevented from being exposed during the transmission process. The second device executes the processing function based on the hash digest to achieve efficient processing and response of the request. The solution of the present application ensures the rapid response and accurate processing of the Internet of Things system when processing remote call requests, and enhances the overall performance and user experience of the system. Through the sharing and coordination of the proxy server, the problem of cross-network domain communication between devices is effectively solved, such as secure access to Internet of Things devices on the public network, which improves the flexibility and security of the system.

[0168] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned resource identification-based Internet of Things remote call method.

[0169] In the above embodiments, the present application discloses a computer-readable storage medium, which belongs to the field of network communication technology. By introducing URI data, including URI strings or URI hash digests, the system can quickly locate and process resources; the proxy server performs hash calculations, data transfer and data caching, which reduces the complexity of direct communication between devices and improves the scalability and maintainability of the system. At the same time, the hash digest is used to improve the efficiency and security of data transmission, and sensitive URI information is prevented from being exposed during the transmission process. The second device executes the processing function based on the hash digest to achieve efficient processing and response of the request. The solution of the present application ensures the rapid response and accurate processing of the Internet of Things system when processing remote call requests, and enhances the overall performance and user experience of the system. Through the sharing and coordination of the proxy server, the problem of cross-network domain communication between devices is effectively solved, such as secure access to Internet of Things devices on the public network, which improves the flexibility and security of the system.

[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0171] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application 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, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, 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.

[0172] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A remote calling method of the Internet of Things based on resource identification, characterized in that: The Internet of Things remote calling method is applied to an Internet of Things system composed of a first device, a proxy server and a second device, and the Internet of Things remote calling method includes: The first device sends a remote call request to the proxy server based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest; When the URI data is a URI character string, the proxy server performs hash calculation on the URI character string to obtain a URI hash digest, and forwards the URI hash digest calculated by the proxy server and the request data to the second device; When the URI data is a URI hash digest, the proxy server directly forwards the remote call request to the second device; The second device determines a matching processing function according to the URI hash digest, wherein each of the URI hash digests is bound to a processing function; The second device executes the processing function to process the request data, obtains response data, and sends the response data to the proxy server; The proxy server sends the response data to the first device based on the communication request response.

2. The method for remotely calling the Internet of Things based on resource identification according to claim 1, characterized in that: The second device is an Internet of Things device or a device server, the URI string is a uniform resource identifier pre-declared for a function of the second device, and the URI hash digest is a hash calculation result of the URI string.

3. The method for remotely calling the Internet of Things based on resource identification according to claim 2, characterized in that: When the second device is an Internet of Things device, the first device is a mobile device or a server that controls the Internet of Things device.

4. The method for remotely calling the Internet of Things based on resource identification according to claim 3, characterized in that: Before the first device sends the remote call request to the proxy server based on the preset communication request, the method further includes: The IoT device registers the pre-declared URI and performs hash digest calculation on the pre-declared URI string to obtain the URI hash digest of the IoT device; The processing function of the IoT device is obtained, and the URI hash digest of the IoT device is bound to the processing function of the IoT device.

5. The method for remotely calling the Internet of Things based on resource identification according to claim 2, characterized in that: When the second device is a device server, the first device is an IoT device, and after the proxy server receives the URI hash digest, the IoT remote calling method specifically includes: The proxy server searches for a device service address and a processing function of a target device server based on the URI hash digest, wherein the target device server is a device server that the IoT device needs to call; The proxy server sends the processing function and the request data to the target device server based on the device service address.

6. The method for remotely calling the Internet of Things based on resource identification according to claim 5, characterized in that: Before the first device sends the remote call request to the proxy server based on the preset communication request, the method further includes: The device server registers the pre-declared URI and performs hash digest calculation on the pre-declared URI character string to obtain the URI hash digest of the device server; The processing function and the device service address of the device server are obtained, and the URI hash digest of the device server, the device service address of the device server and the processing function of the device server are bound.

7. The Internet of Things remote calling method based on resource identification as claimed in claim 3 or 5, characterized in that: Also includes: The IoT device initiates a link establishment request to the proxy server, wherein the link establishment request at least includes a device identification and a device key of the IoT device; The proxy server authenticates the IoT device based on the device identification and device key of the IoT device; When the identity authentication of the IoT device is passed, a link is established between the IoT device and the proxy server.

8. A remote calling system of Internet of Things based on resource identification, characterized in that: The Internet of Things remote system includes a first device, a proxy server and a second device, wherein: The first device is used to send a remote call request to the proxy server based on a preset communication request, wherein the remote call request at least includes URI data and request data, and the URI data is a URI string or a URI hash digest; The proxy server is configured to, when the URI data is a URI character string, perform hash calculation on the URI character string to obtain a URI hash digest, and forward the calculated URI hash digest and the request data to the second device; when the URI data is a URI hash digest, directly forward the remote call request to the second device, and send response data returned by the second device to the first device based on the communication request response; The second device is used to determine a matching processing function according to the URI hash digest, execute the processing function to process the request data, obtain response data, and send the response data to the proxy server, wherein each URI hash digest is bound to a processing function.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the resource identification-based Internet of Things remote calling method as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the resource identification-based Internet of Things remote calling method as described in any one of claims 1 to 7 are implemented.