Remote control method, system, terminal and storage medium for multiple devices

By defining the device as an object in a distributed database and analyzing client requests, a simplified remote control operation process is realized, solving the problem of high user network skills requirements in the existing technology, and ensuring the security of the system.

CN119052306BActive Publication Date: 2025-02-18浪潮智能终端有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411525021.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-18
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The existing remote control technology has high requirements for users' network skills, and the configuration and identity verification process are complex, which has become the threshold for users to use.

Method used

Establish communication connections with devices through the Internet, obtain management permissions, define the device as an object and save it to a distributed database, parse client requests, extract matching control command information, and issue it to the target device.

Benefits of technology

The operation process of remote control is simplified. Users do not need to perform complex network configurations, but directly implement remote control through MongoDB, ensuring the security of the system and avoiding access and control of unauthorized users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052306B_ABST
    Figure CN119052306B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of Internet technology, and specifically provides a remote control method, system, terminal and storage medium for multiple devices, including: establishing a communication connection with a device through the Internet, and obtaining management authority for the device; obtaining device information from the device based on the management authority, the device information including status information and control instruction information; defining the device as an object, and saving the device information of the object to a distributed database; receiving a client request, parsing the target device and control parameters of the request, querying the device information of the target device from the distributed database, extracting control instruction information matching the control parameters from the device information; generating control instructions based on the control parameters and matching control instruction information, and sending the control instructions to the target device. The present invention does not require complex network configuration, simplifies the operation process of remote control while ensuring data security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of Internet technology, and in particular relates to a remote control method, system, terminal and storage medium for multiple devices. Background Art

[0002] In recent years, with the rapid advancement of Internet technology, remote control technology has quietly emerged as a core component of many fields such as smart home and industrial automation. Currently, the widely used remote control solution based on VPN (virtual private network) technology gives users the convenient ability to remotely control local devices by building a safe and reliable virtual connection bridge. Once the user successfully establishes a VPN connection on the client, he can seamlessly access the local network and directly control and manage various devices.

[0003] However, with this type of remote control solution, users need to configure the VPN server and client first, and go through the identity verification process before they can gain access. Although this solution provides solid security, it requires relatively high user network skills, which has become a threshold that cannot be ignored. Summary of the invention

[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a remote control method, system, terminal and storage medium for multiple devices to solve the above-mentioned technical problems.

[0005] In a first aspect, the present invention provides a remote control method for multiple devices, comprising:

[0006] Establish a communication connection with the device through the Internet and obtain management rights to the device;

[0007] Acquire device information from the device based on the management authority, the device information including status information and control instruction information;

[0008] defining the device as an object, and saving device information of the object to a distributed database;

[0009] Receive a client request, parse the target device and control parameters of the request, query the device information of the target device from a distributed database, and extract control instruction information matching the control parameters from the device information;

[0010] Based on the control parameters and the matching control instruction information, the control instruction is sent to the target device.

[0011] In an optional implementation, establishing a communication connection with the device through the Internet and obtaining management rights for the device includes:

[0012] Receive an authentication request sent by a client, the authentication request including the client's identity and basic device information;

[0013] The client's identity is verified, and after the verification is passed, a permission acquisition request is sent to the target device, the permission acquisition request includes the identity and basic device information, the target device verifies the basic device information in the permission acquisition request and saves the identity after the verification is passed.

[0014] In an optional embodiment, the method further comprises:

[0015] The target device compares the basic device information in the permission acquisition request with the basic information of the local device for consistency. If the two are consistent, a key pair consisting of a public key and a private key is generated, the private key is saved to a specified path, and the public key is returned to the source address of the permission acquisition request.

[0016] In an optional implementation, obtaining device information from the device based on the management authority, the device information including status information and control instruction information, includes:

[0017] Associating the public key with the corresponding identity, and generating a key pair associated with the identity including a management public key and a management private key;

[0018] Using the public key, encrypt the management public key and the device information item to be obtained to obtain an encrypted device information acquisition request;

[0019] Sending the device information acquisition request to the target device to obtain the encrypted device information returned by the target device, wherein the encrypted device information is data encrypted based on the management public key;

[0020] The encrypted device information is decrypted using the management private key to obtain the device information of the target device.

[0021] In an optional implementation, defining the device as an object and saving the device information of the object to a distributed database includes:

[0022] Convert the device information of the object into structured data in JSON format, wherein the structured data includes: device ID, device type, current status, access path of control commands, and permission information;

[0023] An association relationship between the object and the identity identifier is established.

[0024] In an optional embodiment, the method further comprises:

[0025] Generate a hash value for the object's structured data;

[0026] Save the hash value of the identity and the associated object to an internal list;

[0027] Hash values ​​of structured data of objects in the distributed database are collected periodically, and the collected hash values ​​are matched with hash values ​​in the internal list to verify the security of the structured data in the distributed database.

[0028] In an optional implementation, receiving a client request, parsing a target device and a control parameter of the request, querying device information of the target device from a distributed database, and extracting control instruction information matching the control parameter from the device information includes:

[0029] Extracting an identity from the client request and parsing control parameters of the target device, the control parameters including a control instruction type and a target value;

[0030] Verifying the identity, and after verification, screening a target object that matches the target device from objects associated with the identity;

[0031] The structured data of the target object is retrieved from the distributed database, and the control instruction access path corresponding to the control instruction type is extracted from the structured data.

[0032] In a second aspect, the present invention provides a remote control system for multiple devices, comprising:

[0033] The permission acquisition module is used to establish a communication connection with the device through the Internet and obtain management permissions for the device;

[0034] An information acquisition module, used to acquire device information from the device based on the management authority, the device information including status information and control instruction information;

[0035] An object definition module, used to define the device as an object and save the device information of the object to a distributed database;

[0036] An information matching module is used to receive a client request, parse the target device and control parameters of the request, query the device information of the target device from the distributed database, and extract the control instruction information matching the control parameters from the device information;

[0037] The instruction sending module is used to generate control instruction information based on control parameters and matching, and send the control instruction to the target device.

[0038] In a third aspect, a terminal is provided, including:

[0039] A memory for storing remote control programs for multiple devices;

[0040] The processor is used to implement the steps of the multi-device remote control method provided in the first aspect when executing the multi-device remote control program.

[0041] In a fourth aspect, a computer-readable storage medium is provided, on which a remote control program for multiple devices is stored. When the remote control program for multiple devices is executed by a processor, the steps of the remote control method for multiple devices provided in the first aspect are implemented.

[0042] The beneficial effect of the present invention is that the remote control method, system, terminal and storage medium of multiple devices provided by the present invention define the device as an object, convert the device information into structured data of the object and save it in a distributed database, thereby realizing remote management of the device based on a distributed database. In the remote control method provided by the present invention, the user does not need to perform complex network configuration and can directly realize remote control through MongoDB, which greatly simplifies the operation process. In addition, the mechanism based on permission management ensures the security of the system and avoids access and control by unauthorized users.

[0043] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0045] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.

[0046] Figure 2 is a schematic block diagram of a system according to an embodiment of the present invention.

[0047] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

[0050] The remote control method for multiple devices provided by the embodiment of the present invention is executed by a computer device, and accordingly, the remote control system for multiple devices runs in the computer device.

[0051] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention. Figure 1 The execution subject may be a remote control system for multiple devices. According to different requirements, the order of the steps in the flow chart may be changed, and some may be omitted.

[0052] like Figure 1 As shown, the method includes:

[0053] Step 110, establishing a communication connection with the device through the Internet and obtaining management authority for the device;

[0054] Step 120, obtaining device information from the device based on the management authority, the device information including status information and control instruction information;

[0055] Step 130, defining the device as an object, and saving the device information of the object to a distributed database;

[0056] Step 140, receiving a client request, parsing the target device and control parameters of the request, querying device information of the target device from a distributed database, and extracting control instruction information matching the control parameters from the device information;

[0057] Step 150: Generate control instructions based on control parameters and matching control instruction information, and send the control instructions to the target device.

[0058] To facilitate understanding of the present invention, the remote control method for multiple devices provided by the present invention is further described below based on the principle of the remote control method for multiple devices of the present invention and in combination with the process of remotely controlling multiple devices in the embodiment.

[0059] Specifically, the remote control method for multiple devices includes:

[0060] S1. Establish a communication connection with the device through the Internet and obtain management rights to the device.

[0061] Receive an authentication request sent by a client, the authentication request including the client's identity and basic device information; verify the client's identity, and send a permission acquisition request to a target device after the verification is successful, the permission acquisition request including the identity and basic device information, the target device verifies the basic device information in the permission acquisition request and saves the identity after the verification is successful.

[0062] In an example, the process of obtaining permissions is as follows:

[0063] S101, receiving authentication request:

[0064] The server sets a listening port and waits to receive authentication requests from the client. When receiving the authentication request, the server parses the request to extract the client's identity (such as user name, device ID, etc.) and basic device information (such as device model, operating system version, etc.).

[0065] S102, verify the client identity:

[0066] The server uses a pre-stored legal identity database or authentication mechanism (such as a password, digital certificate, etc.) to verify the identity submitted by the client. If the identity verification fails, the server rejects the request and may return an error message. If the identity verification succeeds, the server proceeds to the next step.

[0067] S103. Build and send permission acquisition request:

[0068] The server constructs a permission acquisition request based on the verified client identity and basic device information. The permission acquisition request should contain the client identity and necessary basic device information so that the target device can perform further verification. The server sends the permission acquisition request to the target device (which may be another server, gateway, or specific smart device).

[0069] S104. Target device verifies basic device information:

[0070] After receiving the permission request, the target device parses the request to extract the basic information of the device. The target device verifies the basic information of the device using its own verification logic. If the basic information verification of the device fails, the target device rejects the permission request and may notify the server. If the basic information verification of the device succeeds, the target device proceeds to the next step.

[0071] S105, save identity:

[0072] After the target device passes the authentication, it saves the client's identity to its access control list. The saved identity is used for subsequent access control and permission management.

[0073] S106. Return the permission grant result:

[0074] The target device returns the permission grant result (success or failure) to the server. The server sends a corresponding response message to the client based on the returned result, notifying the client of the status of its access rights.

[0075] In order to improve data security protection capabilities, an encryption mechanism is established between the server and the target device, including:

[0076] The target device compares the basic device information in the permission acquisition request with the basic information of the local device for consistency. If the two are consistent, a key pair consisting of a public key and a private key is generated, the private key is saved to a specified path, and the public key is returned to the source address of the permission acquisition request.

[0077] S2. Acquire device information from the device based on the management authority, where the device information includes status information and control instruction information.

[0078] The public key is associated with the corresponding identity, and a key pair including a management public key and a management private key associated with the identity is generated; the management public key and the device information item to be obtained are encrypted using the public key to obtain an encrypted device information acquisition request; the device information acquisition request is sent to the target device to obtain the encrypted device information returned by the target device, wherein the encrypted device information is data encrypted based on the management public key; the encrypted device information is decrypted using the management private key to obtain the device information of the target device.

[0079] In one example, a method for obtaining device information in an encrypted manner includes:

[0080] The public key is securely and irreversibly associated with the corresponding identity, and then a key pair closely related to the identity, including the management public key and the management private key, is generated. In this process, it is ensured that the generation of the key pair follows high-standard encryption algorithms and security protocols to ensure its unbreakability and uniqueness. Then, the previously associated public key is used to perform encryption operations on the management public key and the specific device information items that need to be obtained. This encryption process strictly follows advanced encryption technology to ensure the security and integrity of data during transmission, thereby obtaining an encrypted device information acquisition request.

[0081] Subsequently, this encrypted device information acquisition request is sent to the designated target device through the Internet channel. After receiving the request, the target device will encrypt the device information of the target device according to the management public key carried in the request to generate encrypted device information. Here, the encrypted device information is completely based on the data encrypted by the management public key, ensuring that only the entity holding the corresponding management private key can decrypt and access this data.

[0082] After successfully receiving the encrypted device information returned by the target device, the encrypted device information is decrypted using the previously generated and securely stored management private key. The decryption process also follows strict decryption algorithms and processes to ensure the integrity and authenticity of the data after decryption. Ultimately, through this series of encryption, transmission, and decryption steps, the device information of the target device is successfully obtained, and the confidentiality and security of the information are fully guaranteed throughout the process.

[0083] Device information content, for example:

[0084] The device ID (device_id) is "abc123".

[0085] The device type (device_type) is smart_light.

[0086] The current status is on.

[0087] Control commands (control_commands) include:

[0088] The turn_on instruction is to access the path " / devices / abc123 / on".

[0089] The turn_off instruction is to access the path " / devices / abc123 / off".

[0090] The permissions information is as follows:

[0091] The user ID (user_id) is "user001".

[0092] The user has control (can_control), which is true.

[0093] In short, this is a smart light device with ID "abc123" which is currently turned on. User "user001" can control the switch of this device through the specified path.

[0094] In other embodiments of the present invention, device information may also be obtained through device self-reporting or manual configuration.

[0095] S3. Define the device as an object, and save the device information of the object to a distributed database.

[0096] In a specific example, the object definition and device information storage method includes:

[0097] The device is defined as an object and assigned properties and methods to it so that it can be efficiently managed and operated in the program. In this process, various types of information about the device, including but not limited to its model, serial number, current status, location data, and historical interaction records, will be considered as attributes of the object and properly preserved.

[0098] Subsequently, in order to ensure that this valuable device information can be persistently stored with high availability and scalability, a distributed database is used as the storage medium. With its excellent data sharding, replication and load balancing capabilities, the distributed database can achieve efficient read and write operations and fault recovery while ensuring data security and consistency. This means that even in the face of single point failures or large-scale data growth, it can still maintain stable operation and provide users with uninterrupted services.

[0099] Taking the device information in step S2 as an example, an object is defined and structured data is generated. The structured data content includes:

[0100] { "device_id": "abc123",

[0101] "device_type": "smart_light",

[0102] "status": "on",

[0103] "control_commands": {

[0104] "turn_on": " / devices / abc123 / on",

[0105] "turn_off": " / devices / abc123 / off"},

[0106] "permissions": {

[0107] "user_id": "user001",

[0108] "can_control": true}}.

[0109] An association relationship between the object and the identity identifier is established by creating a mapping.

[0110] In this implementation, the distributed database uses the MongoDB database.

[0111] In order to ensure that the data in the distributed database is not tampered with, a verification mechanism is designed:

[0112] (1) Generate a hash value for the object's structured data:

[0113] After defining a device as an object and assigning it unique properties and methods, a hash algorithm is used to generate a unique hash value for the structured data of the object. This hash value is a fixed-length string that represents the data fingerprint of the current state of the object. The choice of hash algorithm should be based on factors such as its anti-collision performance, hash distribution uniformity, and computational efficiency. By generating a hash value, the integrity of the object data can be quickly verified, that is, whether the data has been tampered with during transmission or storage.

[0114] (2) Save the hash value of the identity and the associated object to an internal list:

[0115] After generating the hash value of the object, associate it with the object (object ID or name) and save this association in an internal list. This internal list can be a dictionary, hash table, or any other efficient data structure, which allows us to quickly find the corresponding hash value based on the identity. By saving this association, we can quickly verify the authenticity of the object data in the subsequent data verification process.

[0116] (3) Regularly collect hash values ​​of structured data of objects in the distributed database:

[0117] In order to ensure that the object data in the distributed database remains intact and secure, the hash value of its structured data is collected regularly. This can be achieved by writing a scheduled task or trigger that regularly traverses the objects in the distributed database and generates new hash values ​​for them. This collection process should be synchronized with the daily operation and data update of the object to ensure that the collected hash value can truly reflect the current status of the object data.

[0118] (4) Match the collected hash value with the hash value in the internal list:

[0119] After the hash value of the object is collected in the distributed database, it is matched with the hash value saved in the internal list. This matching process can be achieved by comparing the strings of the hash values. If the two hash values ​​are the same, it means that the object data remains intact and has not been tampered with during the collection; if the two hash values ​​are different, it means that the object data may have been tampered with or damaged, and the corresponding alarm or recovery mechanism needs to be triggered.

[0120] (5) Verify the security of structured data in distributed databases:

[0121] Through the matching results of hash values, the security of structured data in distributed databases can be verified. If the match is successful, subsequent operations or processing can be continued; if the match fails, further investigation of the cause is required, and appropriate measures should be taken to restore the integrity or security of the data. In addition, the change of hash values ​​can be used to detect abnormal behavior of data or potential security threats, so that measures can be taken in advance to prevent potential risks.

[0122] In summary, by generating hash values ​​for structured data of objects, saving the hash values ​​of the identity and associated objects to an internal list, regularly collecting hash values ​​of structured data of objects in the distributed database, and matching the collected hash values ​​with the hash values ​​in the internal list, we can effectively verify the security of structured data in the distributed database. This mechanism not only improves the integrity and security of the data, but also provides a strong guarantee for the stable operation of the system.

[0123] S4. Receive a client request, parse the target device and control parameters of the request, query the device information of the target device from a distributed database, and extract control instruction information matching the control parameters from the device information.

[0124] An identity is extracted from the client request, and control parameters of the target device are parsed, wherein the control parameters include a control instruction type and a target value; the identity is verified, and after the verification is passed, a target object matching the target device is filtered out from objects associated with the identity; structured data of the target object is retrieved from the distributed database, and a control instruction access path corresponding to the control instruction type is extracted from the structured data.

[0125] In a specific example, the process includes the following:

[0126] When a client (such as a smartphone, tablet, or smart home control center) sends a request to a server to control a device, the request contains a series of key information. First, you need to extract the identity from the request, which is usually a string that can uniquely identify the user, such as the user ID (user_id), for example, the user ID is "user001". At the same time, extract the target device, that is, the device ID (device_id), for example, the device ID (device_id) is "abc123".

[0127] Next, the control parameters in the request need to be parsed. The control parameters include the control instruction type (such as turn on, turn off) and the target value (which may be applicable in some cases, such as setting brightness, temperature, etc.). In the specific example, the control instruction types include "turn on" (turn_on) and "turn off" (turn_off), as well as brightness adjustment, etc. The target value can be the target brightness.

[0128] After extracting and parsing the control parameters, the identity is verified. This usually involves checking whether the user has the right to control the target device. In this embodiment, it is necessary to verify whether the user ID "user001" is in the user database, that is, whether the identity is legal.

[0129] Once the identity is verified, the target objects that match the target device can be filtered from the objects associated with the identity. Find the smart light object associated with the device ID "abc123". This can be achieved by looking up the object with a matching device ID in the distributed database.

[0130] After the target object is found, the structured data of the object is retrieved from the distributed database. The structured data generally includes all the properties and methods of the object, as well as any metadata associated with it. In this embodiment, the structured data includes information such as the model, serial number, current state, location data, historical interaction records, and control instruction access path of the smart light.

[0131] From the structured data, the control instruction access path corresponding to the control instruction type is extracted. For example, if the control instruction type is "turn on", the access path " / devices / abc123 / on" is extracted; if the control instruction type is "turn off", the access path " / devices / abc123 / off" is extracted.

[0132] S5. Generate control instruction information based on the control parameters and the matching control instruction, and send the control instruction to the target device.

[0133] Construct a request containing the control instruction access path and any necessary parameters (such as the target value), encrypt the request and the corresponding identity using the public key and send it to the device itself.

[0134] If the control instruction is to "turn on" the smart light, a request is constructed with the access path " / devices / abc123 / on" and sent to the smart light.

[0135] After receiving the encrypted file, the device uses its own private key to decrypt it, obtains the identity and request, and first verifies the identity. If the identity is stored locally, it passes the verification, otherwise it fails. If it passes the verification, the request is executed, otherwise it is not executed.

[0136] In summary, by extracting identity and control parameters from client requests, verifying identity, filtering target objects, retrieving structured data, extracting control instruction access paths, and generating and issuing control instructions, we can achieve remote control and management of smart devices. This process not only improves the operability and flexibility of the device, but also provides a solid foundation for the construction of smart home systems.

[0137] In some embodiments, the remote control system for multiple devices may include multiple functional modules composed of computer program segments. The computer programs of each program segment in the remote control system for multiple devices may be stored in a memory of a computer device and executed by at least one processor to perform (see Figure 1 Description) Multiple devices remote control function.

[0138] In this embodiment, the remote control system of multiple devices can be divided into multiple functional modules according to the functions performed by them, such as Figure 2 As shown. The functional modules of the system 200 may include: a permission acquisition module 210, an information acquisition module 220, an object definition module 230, an information matching module 240 and an instruction issuing module 250. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.

[0139] The permission acquisition module is used to establish a communication connection with the device through the Internet and obtain management permissions for the device;

[0140] An information acquisition module, used to acquire device information from the device based on the management authority, the device information including status information and control instruction information;

[0141] An object definition module, used to define the device as an object and save the device information of the object to a distributed database;

[0142] An information matching module is used to receive a client request, parse the target device and control parameters of the request, query the device information of the target device from the distributed database, and extract the control instruction information matching the control parameters from the device information;

[0143] The instruction sending module is used to generate control instruction information based on control parameters and matching, and send the control instruction to the target device.

[0144] Optionally, as an embodiment of the present invention, establishing a communication connection with a device through the Internet and obtaining management authority over the device includes:

[0145] Receive an authentication request sent by a client, the authentication request including the client's identity and basic device information;

[0146] The client's identity is verified, and after the verification is passed, a permission acquisition request is sent to the target device, the permission acquisition request includes the identity and basic device information, the target device verifies the basic device information in the permission acquisition request and saves the identity after the verification is passed.

[0147] Optionally, as an embodiment of the present invention, it further includes:

[0148] The target device compares the basic device information in the permission acquisition request with the basic information of the local device for consistency. If the two are consistent, a key pair consisting of a public key and a private key is generated, the private key is saved to a specified path, and the public key is returned to the source address of the permission acquisition request.

[0149] Optionally, as an embodiment of the present invention, device information is obtained from the device based on the management authority, and the device information includes status information and control instruction information, including:

[0150] Associating the public key with the corresponding identity, and generating a key pair associated with the identity including a management public key and a management private key;

[0151] Using the public key, encrypt the management public key and the device information item to be obtained to obtain an encrypted device information acquisition request;

[0152] Sending the device information acquisition request to the target device to obtain the encrypted device information returned by the target device, wherein the encrypted device information is data encrypted based on the management public key;

[0153] The encrypted device information is decrypted using the management private key to obtain the device information of the target device.

[0154] Optionally, as an embodiment of the present invention, defining the device as an object and saving the device information of the object to a distributed database includes:

[0155] Convert the device information of the object into structured data in JSON format, wherein the structured data includes: device ID, device type, current status, access path of control commands, and permission information;

[0156] An association relationship between the object and the identity identifier is established.

[0157] Optionally, as an embodiment of the present invention, it further includes:

[0158] Generate a hash value for the object's structured data;

[0159] Save the hash value of the identity and the associated object to an internal list;

[0160] Hash values ​​of structured data of objects in the distributed database are collected periodically, and the collected hash values ​​are matched with hash values ​​in the internal list to verify the security of the structured data in the distributed database.

[0161] Optionally, as an embodiment of the present invention, receiving a client request, parsing a target device and a control parameter of the request, querying device information of the target device from a distributed database, and extracting control instruction information matching the control parameter from the device information includes:

[0162] Extracting an identity from the client request and parsing control parameters of the target device, the control parameters including a control instruction type and a target value;

[0163] Verifying the identity, and after verification, screening a target object that matches the target device from objects associated with the identity;

[0164] The structured data of the target object is retrieved from the distributed database, and the control instruction access path corresponding to the control instruction type is extracted from the structured data.

[0165] Figure 3 The present invention is a schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the remote control method of multiple devices provided in an embodiment of the present invention.

[0166] The terminal 300 may include: a processor 310, a memory 320 and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0167] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.

[0168] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.

[0169] The communication unit 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.

[0170] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).

[0171] Therefore, the present invention realizes remote management of devices based on a distributed database by defining devices as objects and converting device information into structured data of objects and saving them in a distributed database. The remote control method provided by the present invention allows users to directly realize remote control through MongoDB without having to perform complex network configuration, which greatly simplifies the operation process. In addition, the mechanism based on permission management ensures the security of the system and avoids access and control by unauthorized users. The technical effects that can be achieved by this embodiment can be found in the description above and will not be repeated here.

[0172] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, 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 a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.

[0173] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.

[0174] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.

[0175] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0176] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0177] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.

Claims

1. A remote control method for multiple devices, characterized in that: include: Establish a communication connection with the device through the Internet and obtain management rights to the device; Acquire device information from the device based on the management authority, the device information including status information and control instruction information; defining the device as an object, and saving device information of the object to a distributed database; Receive a client request, parse the target device and control parameters of the request, query the device information of the target device from a distributed database, and extract control instruction information matching the control parameters from the device information; Generate a control instruction based on the control parameter and the matched control instruction information, and send the control instruction to the target device; Establish a communication connection with the device through the Internet and obtain management permissions for the device, including: Receive an authentication request sent by a client, the authentication request including the client's identity and basic device information; Verify the identity of the client, and send a permission acquisition request to the target device after the verification is passed, the permission acquisition request includes the identity and basic device information, the target device verifies the basic device information in the permission acquisition request and saves the identity after the verification is passed; Defining the device as an object and saving the device information of the object to a distributed database includes: Convert the device information of the object into structured data in JSON format, wherein the structured data includes: device ID, device type, current status, access path of control commands, and permission information; An association relationship between the object and the identity identifier is established.

2. The method according to claim 1, characterized in that The method further comprises: The target device compares the basic device information in the permission acquisition request with the basic information of the local device for consistency. If the two are consistent, a key pair consisting of a public key and a private key is generated, the private key is saved to a specified path, and the public key is returned to the source address of the permission acquisition request.

3. The method according to claim 2, characterized in that Acquiring device information from the device based on the management authority, the device information including status information and control instruction information, including: Associating the public key with the corresponding identity, and generating a key pair associated with the identity including a management public key and a management private key; Using the public key, encrypt the management public key and the device information item to be obtained to obtain an encrypted device information acquisition request; Sending the device information acquisition request to the target device to obtain the encrypted device information returned by the target device, wherein the encrypted device information is data encrypted based on the management public key; The encrypted device information is decrypted using the management private key to obtain the device information of the target device.

4. The method according to claim 1, characterized in that: The method further comprises: Generate a hash value for the object's structured data; Save the hash value of the identity and the associated object to an internal list; Hash values ​​of structured data of objects in the distributed database are collected periodically, and the collected hash values ​​are matched with hash values ​​in the internal list to verify the security of the structured data in the distributed database.

5. The method according to claim 1, characterized in that: Receiving a client request, parsing the target device and control parameters of the request, querying device information of the target device from a distributed database, and extracting control instruction information matching the control parameters from the device information, including: Extracting an identity from the client request and parsing control parameters of the target device, the control parameters including a control instruction type and a target value; Verifying the identity, and after verification, screening a target object that matches the target device from objects associated with the identity; The structured data of the target object is retrieved from the distributed database, and the control instruction access path corresponding to the control instruction type is extracted from the structured data.

6. A remote control system for multiple devices, characterized in that: include: The permission acquisition module is used to establish a communication connection with the device through the Internet and obtain management permissions for the device; An information acquisition module, used to acquire device information from the device based on the management authority, the device information including status information and control instruction information; An object definition module, used to define the device as an object and save the device information of the object to a distributed database; An information matching module is used to receive a client request, parse the target device and control parameters of the request, query the device information of the target device from the distributed database, and extract the control instruction information matching the control parameters from the device information; An instruction issuing module, used for generating a control instruction based on the control parameter and the matched control instruction information, and issuing the control instruction to the target device; Establish a communication connection with the device through the Internet and obtain management permissions for the device, including: Receive an authentication request sent by a client, the authentication request including the client's identity and basic device information; Verify the identity of the client, and send a permission acquisition request to the target device after the verification is passed, the permission acquisition request includes the identity and basic device information, the target device verifies the basic device information in the permission acquisition request and saves the identity after the verification is passed; Defining the device as an object and saving the device information of the object to a distributed database includes: Convert the device information of the object into structured data in JSON format, wherein the structured data includes: device ID, device type, current status, access path of control commands, and permission information; An association relationship between the object and the identity identifier is established.

7. A terminal, characterized in that: include: A memory for storing remote control programs for multiple devices; A processor is used to implement the steps of the remote control method for multiple devices as described in any one of claims 1 to 5 when executing the remote control program for multiple devices.

8. A computer-readable storage medium storing a computer program, characterized in that: The readable storage medium stores a remote control program for multiple devices, and when the remote control program for multiple devices is executed by a processor, the steps of the remote control method for multiple devices as described in any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Control method of home networking system, server and electronic equipment

    CN113055411A

  • Detection and configuration method and device of Internet of Things equipment, equipment and medium

    CN117768321A