Control method and system for realizing actions of intelligent equipment based on cloud
By performing control request protocol conversion and transparent gateway transmission of smart devices in the cloud, the problem of high host hardware requirements in the existing technology is solved, enabling cloud computing to control smart devices, reducing hardware costs and enhancing security.
Patent Information
- Application Number
- CN202310172535.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-27
- Publication Date
- 2024-08-27
AI Technical Summary
Existing smart home control solutions require the host to have better hardware performance, resulting in higher hardware costs and higher equipment requirements.
By converting control requests and instructions into protocols in the cloud, and using a transparent transmission gateway to transmit the converted protocol instructions to smart devices, cloud computing is implemented to control the actions of smart devices, avoiding the need for edge computing on the host.
It reduces the demand for host hardware, reduces hardware costs, and ensures the security of the control process through authority judgment.
Smart Images

Figure CN118550217A
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of smart home technology, and specifically relates to a cloud-based control method and system for realizing the actions of smart devices. Background Art
[0002] With the continuous development of smart homes, the types of smart homes are becoming increasingly diverse. For the control of smart homes, the existing technology is usually that the user sends the control request information to the host through the APP, and the host converts the protocol of the control request information, and then sends the control information after the host converts the protocol through the corresponding network to the corresponding smart device to achieve control of the smart device. After the smart device receives the instruction information, it also returns a set of information to the host. After the host converts the protocol of the information again, it feeds back the converted information to the APP end to display it on the APP for users to view. That is, the existing control scheme for smart devices is edge computing performed by the host, which is an architecture design that emphasizes the host and lightly relies on the cloud. One family has one host, and one host handles the control requests of one family. Therefore, the existing control scheme for smart devices has relatively high requirements on the host performance, and the host needs to have better hardware to support it. Summary of the invention
[0003] The purpose of the present invention is to provide a control method and system for realizing the action of smart devices based on the cloud, so as to solve the problem that the existing smart device control scheme requires the host to have better hardware to realize the control of the smart device.
[0004] In order to solve the above technical problems, the present invention provides a control method for realizing the action of a smart device based on the cloud, comprising the following steps:
[0005] 1) When the action of the smart device needs to be controlled, a control request for the corresponding smart device is sent to the cloud;
[0006] 2) The cloud performs protocol conversion on the control instructions in the control request according to the control request, so as to convert the control instructions into protocol instructions that can be recognized by the corresponding smart device;
[0007] 3) After the protocol conversion, the cloud transmits the protocol instructions to the corresponding smart device through the transparent transmission gateway to realize the action control of the corresponding smart device.
[0008] The beneficial effects are as follows: the control process of the intelligent device action of the present invention is a process based on cloud computing, that is, the computing function implemented on the host in the original control method is migrated to the cloud as a whole. After the data is processed in the cloud, the cloud and the intelligent device end cannot directly send the converted protocol instructions to the device. Therefore, the protocol instructions are transmitted through the transparent transmission gateway in the present invention, thereby realizing the process of controlling the action of the intelligent device by cloud computing. The cloud computing method based on the present invention avoids the process of the host performing edge computing to realize the device action control in the prior art. The process of intelligent device action control can be realized by only transmitting instructions through the transparent transmission gateway. Therefore, the method of the present invention does not have too many requirements on the hardware equipment of the host compared with the prior art, thereby correspondingly reducing the hardware cost of the host.
[0009] Furthermore, in step 3), when the smart device receives the instruction and performs corresponding actions, it transmits control return data to the instruction sending end; the control return data includes the latest status information of the current device after the action of this smart device is executed. The process of transmitting the control return data is: the control return data is first transmitted to the cloud through the transparent transmission gateway, the cloud decodes the received control return data, and converts the format of the decoded data to convert the control return data into a data form that can be recognized by the instruction sending end, and then the cloud judges the result of the control return data after the format conversion, and transmits the result to the instruction sending end.
[0010] After the smart device receives the control instruction and performs the action, the control process of the present invention also receives the control return data returned by the smart device. Through this process of the present invention, it is possible to obtain whether the action of the smart device is successful, and then the corresponding control process can be continued for this smart device or other smart devices based on the data of whether it is successful. And after the control return data is transmitted to the cloud through the transparent transmission gateway in the present invention, because the cloud also needs to transmit this data to the instruction sending end, the cloud needs to perform data decoding and data format conversion. For example, when the format of the decoded data is a hexadecimal instruction code and the data format that the sending end can recognize is data in json format, the format of the decoded data is converted to convert the hexadecimal instruction code into data in json format in the present invention.
[0011] Furthermore, in step 2), when receiving a control request, the cloud first calls the permission service to determine whether the instruction issuer has control authority over the smart device to be controlled. If so, the cloud performs protocol conversion.
[0012] The control process of the present invention also adds an authority judgment, that is, when an instruction is received, an authority judgment is first performed, for example, it is judged whether the instruction issuing end issues the instruction through legal channels, and it is judged whether the instruction issuing end has the authority to control the smart device that needs to be controlled in the instruction. The instruction is processed only when the instruction issuing end has the authority to control the smart device. This process ensures the security of the control process and avoids security issues caused by unauthorized users controlling the device.
[0013] Furthermore, in step 2), the protocol conversion includes: firstly creating a control message including a command sending end, a corresponding smart device and its specific control according to a control request, and then performing protocol conversion on the control message.
[0014] Furthermore, in step 2), by controlling the corresponding smart device in the message, a protocol conversion rule corresponding to the smart device is selected to perform protocol conversion; the protocol conversion rule is stored in the cloud and different types of smart devices correspond to different protocol conversion rules.
[0015] In order to solve the above technical problems, the present invention also provides a control system for realizing the action of intelligent devices based on the cloud, including a cloud and a transparent transmission gateway; the cloud includes two ports for connecting to the transparent transmission gateway and the user control terminal respectively, and the port connected to the user control terminal is used to receive the control request of the corresponding intelligent device transmitted by the user control terminal;
[0016] The cloud performs protocol conversion on the control instructions in the control request according to the control request, so as to convert the control instructions into protocol instructions that can be recognized by the corresponding smart device;
[0017] The port connected to the transparent transmission gateway is used to perform protocol conversion in the cloud and transmit the converted protocol instructions to the transparent transmission gateway; the transparent transmission gateway also includes a port for connecting to the smart device end, which is used to transmit the protocol instructions to the corresponding smart device to realize the action control of the corresponding smart device.
[0018] The beneficial effects are as follows: the control process of the intelligent device action of the present invention is a process based on cloud computing, that is, the computing function implemented on the host in the original control method is migrated to the cloud as a whole. After the data is processed in the cloud, the cloud and the intelligent device end cannot directly send the converted protocol instructions to the device. Therefore, the protocol instructions are transmitted through the transparent transmission gateway in the present invention, thereby realizing the process of controlling the action of the intelligent device by cloud computing. The cloud computing method based on the present invention avoids the process of the host performing edge computing to realize the device action control in the prior art. The process of intelligent device action control can be realized by only transmitting instructions through the transparent transmission gateway. Therefore, the method of the present invention does not have too many requirements on the hardware equipment of the host compared with the prior art, thereby correspondingly reducing the hardware cost of the host.
[0019] Furthermore, the port connecting the transparent transmission gateway and the smart device end is also used to receive control return data transmitted by the smart device after the smart device receives the instruction and performs corresponding actions. The control return data includes the latest status information of the current device after the action of this smart device is executed; after the transparent transmission gateway receives the control return data, the control return data is first transmitted to the cloud through the port connected to the transparent transmission gateway in the cloud. The cloud decodes the received control return data and converts the format of the decoded data to convert the control return data into a data form that can be recognized by the instruction sending end. Then, the cloud judges the result of the control return data after the format conversion, and transmits the result to the instruction sending end through the interface connected to the cloud and the user control end.
[0020] After the smart device receives the control instruction and takes action, the control process of the present invention also receives control return data returned by the smart device. Through this process of the present invention, it is possible to obtain whether the action of the smart device is successful, and then the corresponding control process can be continued for this smart device or other smart devices based on the success data.
[0021] Furthermore, the cloud also includes a permission service module; the permission service module is used to determine whether the instruction issuer has control authority over the smart device to be controlled when receiving a control request. If so, the cloud performs protocol conversion.
[0022] The control process of the present invention also adds an authority judgment, that is, when an instruction is received, an authority judgment is first performed, for example, it is judged whether the instruction issuing end issues the instruction through legal channels, and it is judged whether the instruction issuing end has the authority to control the smart device that needs to be controlled in the instruction. The instruction is processed only when the instruction issuing end has the authority to control the smart device. This process ensures the security of the control process and avoids security issues caused by unauthorized users controlling the device.
[0023] Furthermore, the protocol conversion includes: firstly creating a control message including a command sending end, a corresponding smart device and its specific control according to a control request, and then performing protocol conversion on the control message.
[0024] Furthermore, by controlling the corresponding smart device in the message, a protocol conversion rule corresponding to the smart device is selected to perform protocol conversion; the protocol conversion rule is stored in the cloud and different types of smart devices correspond to different protocol conversion rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of the control system structure of the present invention;
[0026] Figure 2 It is a schematic diagram of the device control flow on the APP of the present invention. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0028] An embodiment of a control method for realizing the action of an intelligent device based on the cloud:
[0029] In order to avoid the problem of high hardware requirements for the host in the process of realizing the action of the smart device due to the edge computing based on the host, the method of this embodiment now migrates the original way of realizing the function on the host to the cloud as a whole, that is, terminal computing (edge computing of the host) is no longer used, and cloud computing is used entirely to trigger all requests to the cloud service. In this embodiment, the function of the lua script is added to the cloud. When the server receives the instruction, it will call the lua script of the corresponding device. Through this script, the json instruction is converted into a ZigBee instruction and sent to the smart device. The process of successfully transmitting the instruction to the smart device requires a transparent transmission gateway (because the cloud service cannot be directly sent to the ZigBee network, a connection must be established between a terminal device and the cloud network), and the control transmission between the cloud and the smart device is established through the transparent transmission gateway; after the smart device receives the control instruction and performs the corresponding action, the control return data returned by the smart device is also sent to the transparent transmission gateway through the ZigBee network, and the transparent transmission gateway is then sent to the cloud through mqtt (in the form of a wired network), and the cloud calls the corresponding lua script to convert the ZigBee data into json data, and then returns the json data to the APP.
[0030] Specific as Figure 1 As shown, Figure 1The host part is the transparent transmission gateway, the device and the transparent transmission gateway are also on the user side, and the calculation is in the cloud. The user-side device no longer performs business operations such as command conversion. EMQX, IoT central control, device service, status service and control service are all modules included in the cloud, and the cloud part has the following functions:
[0031] Connect MQTT to interact with the host and app protocol. The specific connection between the cloud and the APP is that the device service establishes a connection with the APP through MQTT; the connection with the host is connected to the host through the IoT central control service.
[0032] The IoT central control in the cloud has the ability to parse and encode the Zigbee instructions of the device: it parses the object model sent internally and converts it into the Zigbee instructions of the device and sends it to the host. The host transmits it transparently to the device, and parses the Zigbee instructions transmitted by the host into object model data that can be directly used internally.
[0033] The cloud-based IoT central control can also obtain basic device information from Redis in the format of host sn + device id (basic information includes device name and which device it is (such as lights, door locks, curtains, etc.). Because different devices correspond to different object models, it is necessary to obtain the basic information of the device. After determining the device information, it is necessary to query the detailed model information of the device (model information can be understood as an abstract data formed by a real device in the cloud. The model data contains all the functions of the device, and also corresponds to the ZigBee instructions that need to be parsed for the device, which needs to correspond to each Lua script)), and determine which Lua script to call based on the model.
[0034] The cloud also has business processing capabilities: device control, device status reporting (on and off the network), setting device information, and querying device information, etc. Device status reporting is reporting device information at regular intervals for device status synchronization and monitoring whether the device is offline; while the device information query function queries the device through the APP, for example, querying whether the light is on or off, and the brightness if the light is on.
[0035] Figure 1The EMQX in the embodiment has the rule engine capability: according to the routing rules, different topics are parsed and then sent to mqtt for internal other service business monitoring and processing. The EMQX in this embodiment has made certain rule definitions based on the topic of mqtt. A normal topic is usually a string of English words (one or two combinations), and this topic is not easy to manage. In order to facilitate management, a rule is defined based on this topic in this embodiment, that is, the first three digits represent the unique identifiers of the sender, the receiver and the host, respectively, and the fourth and fifth digits are the unique identifiers of the business, which are used to distinguish which business this topic applies to.
[0036] The device service in the cloud has the ability to provide control protocols for the app and internal control protocols, and call the permission service to determine the user's control instruction authority, send it to the control service, monitor the control return result and return it to the APP, where the control return result is the result of whether the control is successful. In this embodiment, the latest status information of the current device is returned after the execution of the smart device action is completed, so as to obtain the result of whether the control is successful through the return data. The source of the control instruction on the cloud can be the manual control of the user's APP end or the automatic control of the system. For example, the automatic control is to turn on the light automatically when the door is opened, that is, the user only opens the door but the system turns on the light at the same time. The action of turning on the light is equivalent to directly calling the control protocol internally. The permission service is a judgment on the control security. If the user does not have the authority to control the device on the APP end, the device cannot be seen or there is no control button for the unauthorized device. When the control is received in the cloud, the permission service is called to compare whether the sending instruction end has the authority to control the smart device end to be controlled. Then, the double permission verification process of this embodiment realizes the safe control of the smart device.
[0037] The device status service in the cloud includes: 1) maintaining the real-time status of the host and the device; 2) monitoring the device status report after the MQTT-IoT central control is analyzed, and storing it in redis, forwarding the MQTT-common protocol for the app to monitor and process, and notifying other services through kafka messages internally; 3) monitoring the device control results forwarded by the control service, storing them in redis, forwarding the MQTT-common protocol for the app to monitor and process, and notifying other services through kafka messages internally; 4) other services directly query the device status through redis; 5) providing the app with the ability to query the device status.
[0038] The control service in the cloud includes: 1) providing the device single control (i.e. device control) http interface capability internally; 2) device control capability: processing the device single control protocol, creating sessionid (creating a unique identifier), recording context cache information (i.e. who issued the control request, when it was issued, and how the control was performed), sending it to the central control service, receiving the central control single control result and returning it to the caller, and then asynchronously notifying the device status change. The specific process of receiving the central control single control result and returning it to the caller is: the cloud decodes the received control return data and converts the format of the decoded data. Because the data format after decoding in this embodiment is a hexadecimal instruction code, and the data format that the caller (instruction sending end) can recognize is json format data, therefore, in this embodiment, the decoded hexadecimal instruction code is converted into json format data to convert the control return data into a data format that the instruction sending end can recognize, and then after judging the result of this json format data, the result is transmitted to the instruction sending end.
[0039] Based on the corresponding functions of each module in the cloud, the following can be achieved: Figure 2 The control flow shown is:
[0040] 1) The APP sends a device control request to EMQX;
[0041] 2) The device service listens to the request from EMQX and performs permission verification. After the verification passes, the control request is transmitted to the execution control engine service;
[0042] 3) After the execution control engine service creates a session, it transmits the assembled control message to EMQX;
[0043] 4) After the IoT central control obtains the assembled control message, it performs protocol encoding and then transmits the encoded control protocol to EMQX;
[0044] 5) The transparent transmission gateway then monitors EMQX to obtain the control protocol transmitted from the IoT central control to EMQX, and then the transparent transmission gateway transmits this control protocol to the corresponding smart device end to realize the control of the smart device action.
[0045] The control process of the intelligent device action of the present invention is a process based on cloud computing, that is, the computing function implemented on the host in the original control method is migrated to the cloud as a whole. After the data is processed in the cloud, the cloud and the intelligent device end cannot directly send the converted protocol instructions to the device. Therefore, the protocol instructions are transmitted through the transparent transmission gateway in the present invention, thereby realizing the process of controlling the action of the intelligent device by cloud computing. The cloud computing method based on the present invention avoids the process of the host performing edge computing to realize the device action control in the prior art. The process of intelligent device action control can be realized by only transmitting instructions through the transparent transmission gateway. Therefore, the method of the present invention does not have too many requirements on the hardware equipment of the host compared with the prior art, thereby correspondingly reducing the hardware cost of the host.
[0046] Example of a control system for realizing intelligent device actions based on the cloud:
[0047] The control system in this embodiment includes a cloud and a transparent transmission gateway. The cloud includes a port connected to the user control end and the transparent transmission gateway. The transparent transmission gateway includes a port connected to the cloud and the smart device end to realize the transmission of control instructions, thereby realizing the control method process of the smart device action. The control method of the smart device action has been introduced in detail in the control method of realizing the smart device action based on the cloud, and will not be repeated here.
[0048] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. The patent protection scope of the present invention shall be based on the claims. All equivalent structural changes made using the contents of the description and drawings of the present invention should also be included in the protection scope of the present invention.
Claims
1. A cloud-based control method for realizing the action of an intelligent device, characterized in that: The steps include: 1) When the action of the smart device needs to be controlled, a control request for the corresponding smart device is sent to the cloud; 2) The cloud performs protocol conversion on the control instructions in the control request according to the control request, so as to convert the control instructions into protocol instructions that can be recognized by the corresponding smart device; 3) After the protocol conversion, the cloud transmits the protocol instructions to the corresponding smart device through the transparent transmission gateway to realize the action control of the corresponding smart device.
2. The cloud-based control method for realizing the action of smart devices according to claim 1, characterized in that: In step 3), when the smart device receives the instruction and performs corresponding actions, it transmits control return data to the instruction sending end; the control return data includes the latest status information of the current device after the action of this smart device is executed. The process of transmitting the control return data is: the control return data is first transmitted to the cloud through the transparent transmission gateway, the cloud decodes the received control return data, and converts the format of the decoded data to convert the control return data into a data form that can be recognized by the instruction sending end, and then the cloud judges the result of the control return data after the format conversion, and transmits the result to the instruction sending end.
3. The cloud-based control method for realizing the action of intelligent devices according to claim 2, characterized in that: In step 2), when receiving a control request, the cloud first calls the permission service to determine whether the instruction issuer has control authority over the smart device to be controlled. If so, the cloud performs protocol conversion.
4. The cloud-based control method for realizing the action of intelligent devices according to claim 3, characterized in that: In step 2), the protocol conversion includes: firstly creating a control message including a command sending end, a corresponding smart device and its specific control according to a control request, and then performing protocol conversion on the control message.
5. The cloud-based control method for realizing the action of intelligent devices according to claim 4, characterized in that: In step 2), by controlling the corresponding smart device in the message, a protocol conversion rule corresponding to the smart device is selected to perform protocol conversion; the protocol conversion rule is stored in the cloud and different types of smart devices correspond to different protocol conversion rules.
6. A cloud-based control system for realizing the actions of intelligent devices, characterized in that: It includes a cloud and a transparent transmission gateway; the cloud includes two ports for connecting to the transparent transmission gateway and the user control terminal respectively, and the port connected to the user control terminal is used to receive a control request of a corresponding smart device transmitted by the user control terminal; The cloud performs protocol conversion on the control instructions in the control request according to the control request, so as to convert the control instructions into protocol instructions that can be recognized by the corresponding smart device; The port connected to the transparent transmission gateway is used to perform protocol conversion in the cloud and transmit the converted protocol instructions to the transparent transmission gateway; the transparent transmission gateway also includes a port for connecting to the smart device end, which is used to transmit the protocol instructions to the corresponding smart device to realize the action control of the corresponding smart device.
7. The cloud-based control system for realizing intelligent device actions according to claim 6 is characterized in that: The port connected to the transparent transmission gateway and the smart device end is also used to receive control return data transmitted by the smart device after the smart device receives the instruction and performs corresponding actions. The control return data includes the latest status information of the current device after the action of this smart device is executed; after the transparent transmission gateway receives the control return data, the control return data is first transmitted to the cloud through the port connected to the transparent transmission gateway in the cloud. The cloud decodes the received control return data and converts the format of the decoded data to convert the control return data into a data form that can be recognized by the instruction sending end. Then, the cloud judges the result of the control return data after the format conversion, and transmits the result to the instruction sending end through the interface connected to the cloud and the user control end.
8. The cloud-based control system for realizing intelligent device actions according to claim 7 is characterized in that: The cloud also includes a permission service module; the permission service module is used to determine whether the instruction issuer has control authority over the smart device to be controlled when receiving a control request. If so, the cloud performs protocol conversion.
9. The cloud-based control system for realizing intelligent device actions according to claim 8, characterized in that: The protocol conversion includes: firstly creating a control message including a command sending end, a corresponding intelligent device and its specific control according to a control request, and then performing protocol conversion on the control message.
10. The cloud-based control system for realizing intelligent device actions according to claim 9, characterized in that: By controlling the corresponding smart device in the message, the protocol conversion rule corresponding to the smart device is selected to perform protocol conversion; the protocol conversion rule is stored in the cloud and different types of smart devices correspond to different protocol conversion rules.
Citation Information
Cited By
Multi-user equipment access and control method based on smart cloud platform
CN121644204A
