Device control method, device, storage medium, and electronic device
By sending request messages to the target cloud platform for connection authentication and data acquisition, the complexity of the IoT device control process in existing technologies is solved, enabling flexible and efficient device control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI MXCHIP INFORMATION TECHN
- Filing Date
- 2022-11-15
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, when using a third-party cloud platform to control IoT devices, all data from the original platform needs to be migrated to the third-party cloud platform, resulting in a complex and time-consuming control process.
By sending a request message to the target cloud platform for connection authentication and obtaining access permissions, cloud product and device data are obtained, and remote control is performed based on this data, using advanced message queue protocol to synchronize operation results.
It enables flexible control of third-party cloud platform devices, simplifies the control process, and improves efficiency.
Smart Images

Figure CN115766812B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of the Internet of Things (IoT), and more specifically, to a device control method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the development of IoT technology, multiple IoT devices can be connected to a cloud platform, enabling the cloud platform to perform operations such as status monitoring, action control, and data synchronization on the connected IoT devices. Each cloud platform has its own independent communication mechanism and data interaction method, and there is data isolation and ecosystem isolation between cloud platforms. Therefore, IoT devices can only be controlled by the cloud platform they are connected to.
[0003] In related technologies, when a user needs to control IoT devices connected to cloud platform B using cloud platform A, all data in cloud platform B, including product and device information, must be migrated to cloud platform A. Additionally, if a user has already connected to server B and needs to utilize functions such as the rule engine in cloud platform A, the existing device information must be migrated to cloud platform A.
[0004] Therefore, in related technologies, when using a third-party cloud platform to control IoT devices, it is necessary to migrate all the data from the original platform to the third-party cloud platform, which makes the control process of IoT devices complex and time-consuming.
[0005] There is currently no effective solution to the above problems. Summary of the Invention
[0006] This invention provides a device control method, apparatus, storage medium, and electronic device to at least solve the technical problem of cumbersome control process for third-party cloud platform devices in related technologies.
[0007] According to one embodiment of the present invention, a device control method is provided, comprising: sending a first request message to a target cloud platform, wherein the target cloud platform is a third-party cloud platform to be connected, and the first request message is used to initiate connection authentication to obtain access permissions for multiple cloud products under the target cloud platform; in response to the first request message successfully passing the connection authentication of the target cloud platform, obtaining product information of the target cloud product and first device data of the target device corresponding to the target cloud product from the target cloud platform, wherein the target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product; and remotely controlling the target device based on the first device data.
[0008] Optionally, sending a first request message to the target cloud platform includes: selecting a target cloud platform from multiple candidate cloud platforms; obtaining configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication; and sending the first request message based on the configuration information.
[0009] Optionally, obtaining product information of the target cloud product from the target cloud platform includes: obtaining introductory information of multiple cloud products corresponding to the first request message from the target cloud platform; selecting the target cloud product from the multiple cloud products based on the introductory information; sending a second request message to the target cloud platform, wherein the second request message is used to obtain product information of the target cloud product; and obtaining product information corresponding to the second request message from the target cloud platform.
[0010] Optionally, obtaining the first device data of the target device from the target cloud platform includes: selecting the target device based on product information; sending a third request message to the target cloud platform, wherein the third request message is used to obtain the first device data of the target device; and obtaining the first device data corresponding to the third request message returned by the target cloud platform.
[0011] Optionally, remotely controlling the target device based on the first device data includes: receiving a first control command from a first terminal; and sending the first control command to the target device based on the first device data, so that the target device executes a first control operation corresponding to the first control command.
[0012] Optionally, the device control method further includes: receiving first synchronization data from the target cloud platform via an Advanced Message Queuing Protocol (AMQP) message, wherein the AMQP message is a message subscribed after the first request message successfully passes the connection authentication of the target cloud platform, and the first synchronization data is used to synchronize the operation result of the first control operation; and updating the first device data to the second device data based on the first synchronization data.
[0013] Optionally, the device control method further includes: receiving second synchronization data from the target cloud platform via an Advanced Message Queuing Protocol message, wherein the second synchronization data is used to synchronize the operation result of the second control operation, the second control operation is the control operation corresponding to the second control instruction executed by the target device, and the second control instruction is the control instruction sent by the second terminal to the target device via the target cloud platform; and updating the first device data to the second device data based on the second synchronization data.
[0014] According to one embodiment of the present invention, a device control apparatus is provided, comprising: a sending module, configured to send a first request message to a target cloud platform, wherein the target cloud platform is a third-party cloud platform to be connected, and the first request message is used to initiate connection authentication to obtain access permissions for multiple cloud products under the target cloud platform; an acquisition module, configured to, in response to the successful connection authentication of the target cloud platform via the first request message, acquire product information of the target cloud product and first device data of the target device corresponding to the target cloud product from the target cloud platform, wherein the target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product; and a control module, configured to remotely control the target device based on the first device data.
[0015] Optionally, the sending module is also used to: select a target cloud platform from multiple candidate cloud platforms; obtain the configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication; and send a first request message based on the configuration information.
[0016] Optionally, the acquisition module is further configured to: acquire introductory information of multiple cloud products corresponding to the first request message from the target cloud platform; select a target cloud product from the multiple cloud products based on the introductory information; send a second request message to the target cloud platform, wherein the second request message is used to acquire product information of the target cloud product; and acquire product information corresponding to the second request message from the target cloud platform.
[0017] Optionally, the acquisition module is further configured to: select a target device based on product information; send a third request message to the target cloud platform, wherein the third request message is used to acquire first device data of the target device; and acquire the first device data corresponding to the third request message returned by the target cloud platform.
[0018] Optionally, the control module is further configured to: receive a first control command from a first terminal; and send a first control command to a target device based on the first device data, so that the target device executes a first control operation corresponding to the first control command.
[0019] Optionally, the device control apparatus further includes: a receiving module, configured to receive first synchronization data from the target cloud platform via an Advanced Message Queuing Protocol (AMQP) message, wherein the AMQP message is a message subscribed after the first request message successfully passes the connection authentication of the target cloud platform, and the first synchronization data is used to synchronize the operation result of the first control operation; and an updating module, configured to update the first device data to the second device data based on the first synchronization data.
[0020] Optionally, the receiving module is further configured to: receive second synchronization data from the target cloud platform via an Advanced Message Queuing Protocol message, wherein the second synchronization data is used to synchronize the operation result of the second control operation, the second control operation is the control operation corresponding to the second control instruction executed by the target device, and the second control instruction is the control instruction sent by the second terminal to the target device via the target cloud platform; the updating module is further configured to: update the first device data to the second device data based on the second synchronization data.
[0021] According to one embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the device control method described in any of the above-mentioned embodiments when run by a processor.
[0022] According to one embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the device control method described in any of the preceding claims.
[0023] In this embodiment of the invention, by sending a first request message to the target cloud platform, access permissions for multiple cloud products under the target cloud platform are obtained. Then, in response to the successful connection authentication of the first request message through the target cloud platform, product information of the target cloud products and first device data of the target device corresponding to the target cloud products are obtained from the target cloud platform. Finally, the target device is remotely controlled based on the first device data, thereby achieving the purpose of flexibly controlling third-party cloud platform devices. This simplifies the control process of third-party cloud platform devices and solves the technical problem of cumbersome control process of third-party cloud platform devices in related technologies. Attached Figure Description
[0024] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0025] Figure 1 This is a flowchart of a device control method according to one embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of an operation process for connecting to a target cloud platform according to one embodiment of the present invention;
[0027] Figure 3 This is a schematic diagram of an operation process for selecting cloud products according to one embodiment of the present invention;
[0028] Figure 4This is a schematic diagram of an operation process for acquiring target device data according to one embodiment of the present invention;
[0029] Figure 5 This is a schematic diagram of a device control method according to one embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of another device control method according to one embodiment of the present invention;
[0031] Figure 7 This is a structural block diagram of a device control apparatus according to one embodiment of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] According to an embodiment of the present invention, a method embodiment for device control is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0035] This method embodiment can be executed in a device control system. The device control system includes: multiple cloud platforms, cloud devices, a first terminal, and a second terminal.
[0036] Specifically, the aforementioned cloud devices can be smart home devices, such as smart humidifiers, smart washing machines, and smart robot vacuum cleaners; they can also be smart industrial devices, such as smart robots and smart scanners. The aforementioned first and second terminals can be smartphones (e.g., Android phones, iOS phones), tablets, PCs, and mobile internet devices (MIDs).
[0037] The internal structures of the aforementioned cloud platform, cloud devices, first terminal, and second terminal are basically similar. The following explanation will use the internal structure of the cloud platform as an example; the internal structures of the cloud devices, first terminal, and second terminal will not be repeated.
[0038] A cloud platform may include one or more processors (processors may include, but are not limited to, central processing units (CPUs), graphics processing units (GPUs), digital signal processing (DSP) chips, microcontroller units (MCUs), field-programmable gate arrays (FPGAs), neural network processors (NPUs), tensor processors (TPUs), artificial intelligence (AI) type processors, etc.) and memory for storing data. Optionally, the cloud platform may also include transmission devices, input / output devices, and display devices for communication functions. Those skilled in the art will understand that the above structural description is merely illustrative and does not limit the structure of the cloud platform. For example, a cloud platform may include more or fewer components than those described above, or have a different configuration than those described above.
[0039] The memory can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the device control method in this embodiment of the invention. The processor executes various functional applications and data processing by running the computer program stored in the memory, thereby realizing the aforementioned device control method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to a cloud platform via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0040] The transmission device is used to receive or send data over a network. Specific examples of the network mentioned above may include a wireless network provided by a cloud platform's communication provider. In one example, the transmission device includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device may be a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0041] The display device can be, for example, a touchscreen liquid crystal display (LCD) or a touch display (also referred to as a "touchscreen" or "touch display"). This LCD allows the user to interact with the cloud platform's user interface. In some embodiments, the cloud platform has a graphical user interface (GUI), which allows the user to interact with the GUI via finger contact and / or gestures on a touch-sensitive surface. Optional human-computer interaction functions include: creating web pages, drawing, word processing, creating electronic documents, playing games, video conferencing, instant messaging, sending and receiving emails, a call interface, playing digital video, playing digital music, and / or web browsing, etc. Executable instructions for performing the above device control methods are configured / stored in one or more processor-executable computer program products or readable storage media.
[0042] This embodiment provides a device control method running on one of the aforementioned cloud platforms. Figure 1 This is a flowchart of a device control method according to one embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0043] Step S12: Send a first request message to the target cloud platform, where the target cloud platform is the third-party cloud platform to be connected. The first request message is used to initiate connection authentication in order to obtain access permissions to multiple cloud products under the target cloud platform.
[0044] Step S14: In response to the successful authentication of the first request message through the target cloud platform, obtain the product information of the target cloud product and the first device data of the target device corresponding to the target cloud product from the target cloud platform. The target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product.
[0045] Step S16: Remotely control the target device based on the data from the first device.
[0046] The aforementioned cloud products can be smart home products, such as smart lights, Bluetooth access control systems, sockets, humidifiers, and single-wire double-button switches. Product information for the target cloud products may include the product name and product identifier; for example, the product name for a smart light is "Smart Light," and the product identifier is "a1NLPrUIxtD."
[0047] The first device data may include the device name, device identifier, device online status, device activation status, and last online time. The device online status may include online, offline, activated, or inactive, and the device activation status may include activated or inactive. For example, the first device data for humidifier 1 includes the device name "humidifier 1", the device identifier "9wS6zt1HFv06IZekj3TK", the device online status "offline", the device activation status "activated", and the last online time "August 23, 2022, 18:03".
[0048] Specifically, an integration authentication request is sent to the third-party cloud platform to be integrated, in order to obtain access permissions for multiple cloud products under the third-party cloud platform. For example, an integration authentication request is sent to cloud platform A to obtain access permissions for smart lights, Bluetooth access control, and sockets under cloud platform A.
[0049] When access permissions are obtained for multiple cloud products under a third-party cloud platform, the product name and product identifier of the cloud product to be connected, as well as the device name, device identifier, device online status, device activation status, and last online time of the corresponding device to be synchronized with the cloud product to be connected, are obtained from the third-party cloud platform.
[0050] For example, when access permissions are obtained for smart lights, Bluetooth access control systems, and sockets under cloud platform A, the product name and product identifier of the smart light to be connected, as well as the device name, device identifier, device online status, device activation status, and last online time of the smart light 1 to be synchronized with the smart light to be connected, are obtained from cloud platform A.
[0051] When remotely controlling a target device based on the data of the first device, the device name, device identifier, device online status, device activation status, and last online time of the device to be synchronized can be used to remotely control the device to be synchronized. The remote control can include operations such as starting and stopping.
[0052] Based on the above steps S12 to S16, by sending a first request message to the target cloud platform, access permissions for multiple cloud products under the target cloud platform are obtained. Then, in response to the first request message, the connection authentication of the target cloud platform is successfully passed. The product information of the target cloud product and the first device data of the target device corresponding to the target cloud product are obtained from the target cloud platform. Finally, the target device is remotely controlled based on the first device data, thereby achieving the purpose of flexibly controlling the third-party cloud platform device. This simplifies the control process of the third-party cloud platform device and solves the technical problem of the cumbersome control process of the third-party cloud platform device in related technologies.
[0053] Optionally, in step S12, sending a first request message to the target cloud platform includes:
[0054] Step S121: Select the target cloud platform from multiple candidate cloud platforms;
[0055] Step S122: Obtain the configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication;
[0056] Step S123: Send a first request message based on the configuration information.
[0057] Figure 2 This is a schematic diagram illustrating an operation process for connecting to a cloud platform according to one embodiment of the present invention, as shown below. Figure 2 As shown, the interface for connecting to the cloud platform mainly consists of two parts: the third-party cloud platform and the configuration information.
[0058] exist Figure 2 The interface shown allows users to select the third-party cloud platform to connect to from multiple third-party cloud platforms and obtain the configuration information of the third-party cloud platform entered by the user. The configuration information may include AccessKey ID, AccessKey Secret, RegionID, GroupID, InstantID, and EndPoint.
[0059] The configuration information of the third-party cloud platform is used to determine the authentication content required to initiate the connection authentication. Then, based on the configuration information, a first request message can be sent to the third-party platform to obtain access permissions for multiple cloud products under the third-party cloud platform.
[0060] For example, among multiple third-party cloud platforms in the cloud platform interface, select the cloud platform A to be connected to, and obtain the access key identifier, access key key, region identifier, organization identifier, instant identifier, and terminal address of cloud platform A entered by the user. In order to determine the authentication content required to initiate the connection authentication, a first request message can be sent to cloud platform A based on the access key identifier, access key key, region identifier, organization identifier, instant identifier, and terminal address of cloud platform A to obtain access permissions to multiple cloud products under cloud platform A.
[0061] Based on the above steps S121 to S123, a target cloud platform is selected from multiple candidate cloud platforms, and the configuration information corresponding to the target cloud platform is obtained. Finally, a first request message is sent based on the configuration information in order to obtain access permissions for cloud products under platform A.
[0062] Optionally, in step S14, obtaining product information of the target cloud product from the target cloud platform includes:
[0063] Step S141: Obtain the introduction information of multiple cloud products corresponding to the first request message from the target cloud platform;
[0064] Step S142: Based on the introductory information, select the target cloud product from multiple cloud products;
[0065] Step S143: Send a second request message to the target cloud platform, wherein the second request message is used to obtain product information of the target cloud product;
[0066] Step S144: Obtain the product information corresponding to the second request message from the target cloud platform.
[0067] Figure 3 This is a schematic diagram illustrating an operation process for selecting a cloud product according to one embodiment of the present invention, such as... Figure 3 As shown, the cloud product selection interface mainly includes introductory information for multiple cloud products provided by the target cloud platform. The introductory information for these multiple cloud products is displayed in a list format, allowing users to select the cloud product to be integrated based on this information.
[0068] like Figure 3As shown, the cloud product interface displays introductions to five cloud products fed back by cloud platform A: a smart light and a1NLPrUIxtD, a single-fire double-button switch and a1XOpI1ajbQ, a Bluetooth access control and a1ybOPKZ72G, a socket and a1gOSFITG9d, and a humidifier and a1DPQCdMCiZ. Users can then select the smart light with the product name "smart light" and product identifier "a1NLPrUIxtD" from these five cloud products as the cloud product to be integrated.
[0069] Send a second request message to the cloud platform to be connected in order to obtain product information of the cloud product to be connected. The product information may include the product name, product identifier and cloud platform to which the cloud product belongs. Then obtain the product information of the cloud product to be connected from the cloud platform.
[0070] For example, a second request message is sent to cloud platform A to obtain the product name and product identifier of the smart light, as well as the cloud platform to which the smart light belongs, from cloud platform A.
[0071] Based on the above steps S141 to S144, by obtaining the introduction information of multiple cloud products corresponding to the first request message from the target cloud platform, and then selecting the target cloud product from the multiple cloud products based on the introduction information, a second request message is sent to the target cloud platform, and finally the product information corresponding to the second request message is obtained from the target cloud platform, the product information of the cloud product to be connected can be obtained from the cloud platform to be connected, so as to obtain the device data of the device to be synchronized based on the product information of the cloud product to be connected.
[0072] Optionally, in step S14, obtaining the first device data of the target device from the target cloud platform includes:
[0073] Step S145: Select the target device based on the product information;
[0074] Step S146: Send a third request message to the target cloud platform, wherein the third request message is used to obtain the first device data of the target device;
[0075] Step S147: Obtain the first device data corresponding to the third request message returned by the target cloud platform.
[0076] Figure 4 This is a schematic diagram of an operation process for acquiring device data according to one embodiment of the present invention, such as... Figure 4 As shown, the device data acquisition interface mainly consists of two parts: a third-party cloud platform and cloud products.
[0077] According to product information, you can... Figure 4The interface for obtaining device data shows the selection of a third-party cloud platform and the cloud product to be connected. Then, the device to be synchronized can be selected from multiple cloud devices under the cloud product to be connected, and a third request message is sent to the third-party cloud platform to obtain the first device data of the device to be synchronized.
[0078] Based on the product name and identifier of the smart light, and the cloud platform A to which the smart light belongs, it is possible to... Figure 4 The interface for obtaining device data shows that the third-party cloud platform is selected as cloud platform A, and the cloud product to be connected is selected as smart light. Then, smart light 1 can be selected from multiple smart lights under smart light, and a third request message is sent to cloud platform A to obtain the device name, device identifier, device online status, device activation status and last online time of smart light 1.
[0079] Based on the above steps S145 to S147, by selecting a target device based on product information, sending a third request message to the target cloud platform, and finally obtaining the first device data corresponding to the third request message returned by the target cloud platform, it is possible to flexibly obtain device data of devices in a third-party cloud platform.
[0080] Optionally, in step S16, remotely controlling the target device based on the first device data includes:
[0081] Step S161: Receive a first control command from the first terminal;
[0082] Step S162: Send a first control command to the target device based on the first device data, so that the target device executes the first control operation corresponding to the first control command.
[0083] Specifically, the first terminal is a terminal device associated with our cloud platform. It receives control commands from the terminal device associated with our cloud platform and sends control commands to the device to be synchronized based on data such as the third-party cloud platform to which the device belongs, the device name, and the device identifier, so that the device to be synchronized executes the control operation corresponding to the control command. The control operation can include starting or stopping.
[0084] For example, it receives a control command to "turn on smart light 1" sent from mobile phone 1 associated with our cloud platform, and sends an "turn on" command to smart light 1 based on data such as the third-party cloud platform to which smart light 1 belongs, the device name of smart light 1, and the device identifier, so that smart light 1 performs a startup operation.
[0085] Based on the above steps S161 to S162, by receiving the first control command from the first terminal, and then sending the first control command to the target device based on the first device data, the target device can execute the first control operation corresponding to the first control command, thereby flexibly controlling the device in the third-party cloud platform.
[0086] Optionally, the device control method further includes the following steps:
[0087] Step S71: Receive first synchronization data from the target cloud platform via Advanced Message Queuing Protocol (ALP) messages. The ALP messages are messages subscribed to after the first request message successfully passes the connection authentication of the target cloud platform. The first synchronization data is used to synchronize the operation results of the first control operation.
[0088] Step S172: Update the first device data to the second device data based on the first synchronization data.
[0089] Specifically, after the first request message successfully passes the integration authentication with the third-party cloud platform, we subscribe to Advanced Message Queuing Protocol (ALP) messages. We can then receive initial synchronization data from the third-party cloud platform via ALP messages to synchronize device data within our cloud platform.
[0090] For example, when smart light 1 in cloud platform A performs an on operation, our cloud platform can update the device status of smart light 1 in our cloud platform to "on" through the synchronized data of cloud platform A.
[0091] Based on the above steps S171 to S172, the first synchronization data from the target cloud platform is received through the Advanced Message Queuing Protocol (AMQP) message, and then the first device data is updated to the second device data based on the first synchronization data. This enables the device data in the third-party cloud platform to be synchronously updated to our cloud platform through AMQP messages, thereby ensuring that the device data in our cloud platform is consistent with the device data in the third-party cloud platform.
[0092] Optionally, the device control method further includes the following steps:
[0093] Step S173: Receive second synchronization data from the target cloud platform via Advanced Message Queuing Protocol message. The second synchronization data is used to synchronize the operation result of the second control operation. The second control operation is the control operation corresponding to the second control instruction executed by the target device. The second control instruction is the control instruction sent by the second terminal to the target device via the target cloud platform.
[0094] Step S174: Update the first device data to the second device data based on the second synchronization data.
[0095] Specifically, the second terminal is a terminal device associated with a third-party cloud platform. The terminal device associated with the third-party cloud platform sends a second control command to the device to be synchronized. The device to be synchronized executes the control operation corresponding to the second control command. Our cloud platform then receives the device data from the device to be synchronized from the third-party cloud platform through Advanced Message Queuing Protocol (ALP) messages. Finally, based on the device data of the device to be synchronized, we synchronize the device data in our cloud platform.
[0096] For example, mobile phone 2, which is associated with cloud platform A, sends an "on" command to smart light 1. Smart light 1 performs the "on" operation. Our cloud platform then receives device data of smart light 1 from cloud platform A through advanced message queue protocol messages. Finally, based on the device data of smart light 1, the device status of smart light 1 in our cloud platform is updated to "on".
[0097] Based on the above steps S173 to S174, the second synchronization data from the target cloud platform is received through the Advanced Message Queuing Protocol (AMQP) message, and then the first device data is updated to the second device data based on the second synchronization data. This enables the device data in the target cloud platform to be synchronized to our cloud platform through AMQP messages, thereby ensuring that the device data in our cloud platform is consistent with the device data in the target cloud platform.
[0098] Figure 5 This is a schematic diagram of a device control method according to one embodiment of the present invention, such as... Figure 5 As shown, the workflow of the equipment control method is as follows:
[0099] Step S501: Select the target cloud platform from multiple candidate cloud platforms;
[0100] Step S502: Obtain the configuration information corresponding to the target cloud platform;
[0101] Step S503: Send a first request message based on the configuration information, wherein the first request message is used to initiate the docking authentication in order to obtain access permissions for multiple cloud products under the target cloud platform;
[0102] Step S504: Determine whether the first request message has successfully passed the connection authentication of the target cloud platform;
[0103] Step S505: In response to the successful authentication of the first request message through the target cloud platform, subscribe to the advanced message queue protocol message.
[0104] Step S506: Provide introductory information for multiple cloud products corresponding to the first request message;
[0105] Step S507: Based on the introductory information, select the target cloud product from multiple cloud products;
[0106] Step S508: Send a second request message to the target cloud platform, wherein the second request message is used to obtain product information of the target cloud product;
[0107] Step S509: Feedback the product information corresponding to the second request message;
[0108] Step S510: Select the target device based on product information;
[0109] Step S511: Send a third request message to the target cloud platform, wherein the third request message is used to obtain the first device data of the target device;
[0110] Step S512: Feedback the first device data corresponding to the third request message;
[0111] Step S513: Send the first control command;
[0112] Step S514: Send a first control command based on the first device data;
[0113] Step S515: Execute the control operation corresponding to the first control command;
[0114] Step S516: Send the second device data of the target device;
[0115] Step S517: Update the first device data of the target device to the second device data;
[0116] Step S518: Send the first synchronization data via Advanced Message Queuing Protocol message;
[0117] Step S519: Update the first device data to the second device data based on the first synchronization data.
[0118] In the workflow of the above-mentioned device control method, a first request message is sent to the target cloud platform to obtain access permissions for multiple cloud products under the target cloud platform. Then, in response to the first request message, the connection authentication of the target cloud platform is successfully passed. The product information of the target cloud product and the first device data of the target device corresponding to the target cloud product are obtained from the target cloud platform. Finally, the target device is remotely controlled based on the first device data, thereby achieving the purpose of flexibly controlling the third-party cloud platform device. This simplifies the control process of the third-party cloud platform device and solves the technical problem of the cumbersome control process of the third-party cloud platform device in related technologies.
[0119] The following section will use a smart home scenario as an example to provide a detailed explanation of the workflow of the above device control methods:
[0120] First, cloud platform A is selected from three candidate cloud platforms A, B, and C, and the configuration information of cloud platform A is obtained, including the access key identifier, access key key, regional identifier, organization identifier, instantaneous identifier, and terminal address of cloud platform A. Based on the configuration information of cloud platform A, a first request message is sent to cloud platform A to obtain access permissions for smart lights, door locks, and power strips under cloud platform A.
[0121] Secondly, cloud platform A determines whether the first request message has successfully passed the docking authentication. When the docking authentication is successful, cloud platform A subscribes to advanced message queue protocol messages and sends the introduction information of smart lights, door locks and power strips corresponding to the first request message to our cloud platform. After receiving the introduction information, our cloud platform selects the cloud product to be docked as smart light from smart lights, door locks and power strips, and sends a second request message to cloud platform A to obtain the product information of smart light, including the product identifier and product name of smart light.
[0122] Subsequently, cloud platform A sends the product information of the smart lamp corresponding to the second request message to our cloud platform. After receiving the product information of the smart lamp, our cloud platform selects the device to be synchronized as smart lamp 1 based on the product information of the smart lamp.
[0123] Then, our cloud platform sends a third request message to cloud platform A to obtain the device data of smart lamp 1. After receiving the third request message, cloud platform A sends the device data of smart lamp 1 corresponding to the third request message back to our cloud platform.
[0124] Finally, mobile phone 1, associated with our cloud platform, sends a control command to our cloud platform to "turn on smart light 1". After receiving the control command, our cloud platform sends a control command to smart light 1 based on the device data of smart light 1. After receiving the control command, smart light 1 performs the turn-on operation. After smart light 1 is turned on, it sends the current device data of smart light 1 to cloud platform A, thereby causing cloud platform A to update the device status of smart light 1 to "on" and send synchronization data to our cloud platform through advanced message queue protocol messages. After receiving the synchronization data through advanced message queue protocol messages, our cloud platform updates the device status of smart light 1 to "on" based on the synchronization data.
[0125] Figure 6 This is a schematic diagram of another device control method according to one embodiment of the present invention, such as... Figure 6 As shown, the workflow of the equipment control method is as follows:
[0126] Step S601: Select the target cloud platform from multiple candidate cloud platforms;
[0127] Step S602: Obtain the configuration information corresponding to the target cloud platform;
[0128] Step S603: Send a first request message based on the configuration information, wherein the first request message is used to initiate the docking authentication in order to obtain access permissions for multiple cloud products under the target cloud platform;
[0129] Step S604: Determine whether the first request message has successfully passed the connection authentication of the target cloud platform;
[0130] Step S605: In response to the successful authentication of the first request message through the target cloud platform, subscribe to the Advanced Message Queuing Protocol message.
[0131] Step S606: Provide introductory information for multiple cloud products corresponding to the first request message;
[0132] Step S607: Based on the introductory information, select the target cloud product from multiple cloud products;
[0133] Step S608: Send a second request message to the target cloud platform, wherein the second request message is used to obtain product information of the target cloud product;
[0134] Step S609: Feedback the product information corresponding to the second request message;
[0135] Step S610: Select the target device based on product information;
[0136] Step S611: Send a third request message to the target cloud platform, wherein the third request message is used to obtain the first device data of the target device;
[0137] Step S612: Feedback the first device data corresponding to the third request message;
[0138] Step S613: Send the second control command;
[0139] Step S614: Send a second control command based on the first device data;
[0140] Step S615: Execute the control operation corresponding to the second control command;
[0141] Step S616: Send the second device data of the target device;
[0142] Step S617: Update the first device data of the target device to the second device data;
[0143] Step S618: Send the second synchronization data via Advanced Message Queuing Protocol message;
[0144] Step S619: Update the first device data to the second device data based on the second synchronization data;
[0145] In the workflow of the above-mentioned device control method, a first request message is sent to the target cloud platform to obtain access permissions for multiple cloud products under the target cloud platform. Then, in response to the first request message, the connection authentication of the target cloud platform is successfully passed. The product information of the target cloud product and the first device data of the target device corresponding to the target cloud product are obtained from the target cloud platform. Finally, the target device is remotely controlled based on the first device data, thereby achieving the purpose of flexibly controlling the third-party cloud platform device. This simplifies the control process of the third-party cloud platform device and solves the technical problem of the cumbersome control process of the third-party cloud platform device in related technologies.
[0146] The following section will use a smart home scenario as an example to provide a detailed explanation of the workflow of the above device control methods:
[0147] First, cloud platform A is selected from three candidate cloud platforms A, B, and C, and the configuration information corresponding to cloud platform A is obtained, including the access key identifier, access key key, region identifier, organization identifier, instantaneous identifier, and terminal address of cloud platform A. Based on the configuration information of cloud platform A, a first request message is sent to cloud platform A to obtain access permissions for smart lights, door locks, and power strips under cloud platform A.
[0148] Secondly, it is determined whether the first request message has successfully passed the connection authentication of cloud platform A. When the first request message has successfully passed the connection authentication of cloud platform A, cloud platform A subscribes to advanced message queue protocol messages and sends the introduction information of smart lights, door locks and power strips corresponding to the first request message to our cloud platform. After receiving the introduction information, our cloud platform selects the cloud product to be connected as smart light from smart lights, door locks and power strips, and sends a second request message to cloud platform A to obtain the product information of smart light, including the product identifier and product name of smart light.
[0149] Subsequently, cloud platform A sends the product information of the smart lamp corresponding to the second request message to our cloud platform. After receiving the product information of the smart lamp, our cloud platform selects the device to be synchronized as smart lamp 1 based on the product information of the smart lamp.
[0150] Then, our cloud platform sends a third request message to cloud platform A to obtain the device data of smart lamp 1. After receiving the third request message, cloud platform A sends the device data of smart lamp 1 corresponding to the third request message back to our cloud platform.
[0151] Finally, mobile phone 2, associated with cloud platform A, sends a control command to cloud platform A to "turn on smart light 1". After receiving the control command, cloud platform A sends a control command to smart light 1 based on the device data of smart light 1. After receiving the control command, smart light 1 turns on. After smart light 1 turns on, it sends its current device data to cloud platform A, thereby updating the device status of smart light 1 to "on" and sending synchronization data to our cloud platform via Advanced Message Queuing Protocol (AQC). After receiving the synchronization data, our cloud platform updates the device status of smart light 1 to "on" based on the synchronization data.
[0152] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0153] This embodiment also provides a device control apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0154] Figure 7 This is a structural block diagram of a device control apparatus according to one embodiment of the present invention, such as... Figure 7 As shown, the device includes: a sending module 701, used to send a first request message to a target cloud platform, wherein the target cloud platform is a third-party cloud platform to be connected, and the first request message is used to initiate connection authentication to obtain access permissions for multiple cloud products under the target cloud platform; an acquisition module 702, used to obtain product information of the target cloud product and first device data of the target device corresponding to the target cloud product from the target cloud platform in response to the successful connection authentication of the first request message; wherein the target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product; and a control module 703, used to remotely control the target device based on the first device data.
[0155] Optionally, the sending module 701 is further configured to: select a target cloud platform from multiple candidate cloud platforms; obtain configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication; and send a first request message based on the configuration information.
[0156] Optionally, the acquisition module 702 is further configured to: acquire introductory information of multiple cloud products corresponding to the first request message from the target cloud platform; select a target cloud product from the multiple cloud products based on the introductory information; send a second request message to the target cloud platform, wherein the second request message is used to acquire product information of the target cloud product; and acquire product information corresponding to the second request message from the target cloud platform.
[0157] Optionally, the acquisition module 702 is further configured to: select a target device based on product information; send a third request message to the target cloud platform, wherein the third request message is used to acquire first device data of the target device; and acquire the first device data corresponding to the third request message returned by the target cloud platform.
[0158] Optionally, the control module 703 is further configured to: receive a first control command from the first terminal; and send the first control command to the target device based on the first device data, so that the target device executes the first control operation corresponding to the first control command.
[0159] Optionally, the device control apparatus further includes: a receiving module 704, used to receive first synchronization data from the target cloud platform via an Advanced Message Queuing Protocol (AMQP) message, wherein the AMQP message is a message subscribed after the first request message successfully passes the connection authentication of the target cloud platform, and the first synchronization data is used to synchronize the operation result of the first control operation; and an updating module 705, used to update the first device data to the second device data based on the first synchronization data.
[0160] Optionally, the receiving module 704 is further configured to: receive second synchronization data from the target cloud platform via an Advanced Message Queuing Protocol message, wherein the second synchronization data is used to synchronize the operation result of the second control operation, the second control operation is the control operation corresponding to the second control instruction executed by the target device, and the second control instruction is the control instruction sent by the second terminal to the target device via the target cloud platform; the updating module 705 is further configured to: update the first device data to the second device data based on the second synchronization data.
[0161] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.
[0162] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps of any of the above method embodiments when run by a processor.
[0163] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:
[0164] Step S1: Send a first request message to the target cloud platform, where the target cloud platform is the third-party cloud platform to be connected. The first request message is used to initiate connection authentication in order to obtain access permissions to multiple cloud products under the target cloud platform.
[0165] Step S2: In response to the successful authentication of the first request message through the target cloud platform, obtain the product information of the target cloud product and the first device data of the target device corresponding to the target cloud product from the target cloud platform. The target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product.
[0166] Step S3: Remotely control the target device based on the data from the first device.
[0167] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0168] Embodiments of the present invention also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0169] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0170] Step S1: Send a first request message to the target cloud platform, where the target cloud platform is the third-party cloud platform to be connected. The first request message is used to initiate connection authentication in order to obtain access permissions to multiple cloud products under the target cloud platform.
[0171] Step S2: In response to the successful authentication of the first request message through the target cloud platform, obtain the product information of the target cloud product and the first device data of the target device corresponding to the target cloud product from the target cloud platform. The target cloud product is the cloud product to be connected, and the target device is the device to be synchronized corresponding to the target cloud product.
[0172] Step S3: Remotely control the target device based on the data from the first device.
[0173] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0174] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0175] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0176] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0177] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0178] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0179] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A device control method, characterized in that, include: Send a first request message to the target cloud platform, wherein the target cloud platform is a third-party cloud platform to be connected, and the first request message is used to initiate connection authentication in order to obtain access permissions to multiple cloud products under the target cloud platform; In response to the first request message successfully passing the connection authentication of the target cloud platform, the product information of the target cloud product and the first device data of the target device corresponding to the target cloud product are obtained from the target cloud platform, wherein the target cloud product is the cloud product to be connected and the target device is the device to be synchronized corresponding to the target cloud product; The target device is remotely controlled based on the data from the first device. The device control method further includes: receiving first synchronization data from the target cloud platform via an Advanced Message Queuing Protocol (AMQP) message, wherein the AMQP message is a message subscribed after the first request message successfully passes the connection authentication of the target cloud platform, the first synchronization data is used to synchronize the operation result of the first control operation, the first control operation is executed by the target device, the first control operation is the operation corresponding to the first control instruction, the first control instruction is an instruction sent to the target device based on the first device data, and the first device data includes: device name, device identifier, device online status, device activation status, and the last online time of the device; The device control method further includes: receiving second synchronization data from the target cloud platform via an Advanced Message Queuing Protocol message, wherein the second synchronization data is used to synchronize the operation result of a second control operation, the second control operation being a control operation corresponding to a second control instruction executed by the target device, and the second control instruction being a control instruction sent by a second terminal to the target device via the target cloud platform, wherein the second terminal is a terminal device associated with a third-party cloud platform; and updating the first device data to the second device data based on the second synchronization data. Sending the first request message to the target cloud platform includes: selecting the target cloud platform from multiple candidate cloud platforms; obtaining configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication, and the configuration information includes: the access key identifier of the target cloud platform, the access key key of the target cloud platform, the regional identifier of the target cloud platform, the organization identifier of the target cloud platform, the instantaneous identifier of the target cloud platform, and the terminal address of the target cloud platform; and sending the first request message based on the configuration information. Obtaining the product information of the target cloud product from the target cloud platform includes: obtaining the introduction information of the plurality of cloud products corresponding to the first request message fed back by the target cloud platform; selecting the target cloud product from the plurality of cloud products based on the introduction information; sending a second request message to the target cloud platform, wherein the second request message is used to obtain the product information of the target cloud product, the product information including: the product name of the target cloud product, the product identifier of the target cloud product, and the target cloud platform to which the target cloud product belongs; and obtaining the product information corresponding to the second request message fed back by the target cloud platform.
2. The equipment control method according to claim 1, characterized in that, The first device data obtained from the target cloud platform for the target device includes: Based on the product information, the target device is selected; Send a third request message to the target cloud platform, wherein the third request message is used to obtain the first device data of the target device; Obtain the first device data corresponding to the third request message returned by the target cloud platform.
3. The equipment control method according to claim 1, characterized in that, Remote control of the target device based on the first device data includes: Receive the first control command from the first terminal; Based on the data from the first device, the first control command is sent to the target device so that the target device executes the first control operation corresponding to the first control command.
4. A device control apparatus, characterized in that, include: The sending module is used to send a first request message to the target cloud platform, wherein the target cloud platform is a third-party cloud platform to be connected, and the first request message is used to initiate connection authentication in order to obtain access permissions to multiple cloud products under the target cloud platform; The acquisition module is used to respond to the first request message by successfully passing the docking authentication of the target cloud platform, and to acquire product information of the target cloud product and first device data of the target device corresponding to the target cloud product from the target cloud platform, wherein the target cloud product is the cloud product to be docked, and the target device is the device to be synchronized corresponding to the target cloud product; The control module is used to remotely control the target device based on the data from the first device. The control module is also used to receive first synchronization data from the target cloud platform via Advanced Message Queuing Protocol (AMQP) messages. The AMQP messages are messages subscribed to after the first request message successfully passes the connection authentication of the target cloud platform. The first synchronization data is used to synchronize the operation result of the first control operation. The first control operation is executed by the target device. The first control operation is the operation corresponding to the first control instruction. The first control instruction is an instruction sent to the target device based on the first device data. The first device data includes: device name, device identifier, device online status, device activation status, and the last online time of the device. The control module is further configured to receive second synchronization data from the target cloud platform via an Advanced Message Queuing Protocol message. The second synchronization data is used to synchronize the operation result of a second control operation, which is a control operation corresponding to a second control instruction executed by the target device. The second control instruction is a control instruction sent by a second terminal to the target device via the target cloud platform, wherein the second terminal is a terminal device associated with a third-party cloud platform. The control module also updates the first device data to the second device data based on the second synchronization data. The sending module is further configured to select the target cloud platform from multiple candidate cloud platforms; obtain configuration information corresponding to the target cloud platform, wherein the configuration information is used to determine the authentication content required to initiate the connection authentication, and the configuration information includes: the access key identifier of the target cloud platform, the access key key of the target cloud platform, the regional identifier of the target cloud platform, the organization identifier of the target cloud platform, the instantaneous identifier of the target cloud platform, and the terminal address of the target cloud platform; and send the first request message based on the configuration information. The acquisition module is further configured to acquire the introduction information of the plurality of cloud products corresponding to the first request message fed back by the target cloud platform; select the target cloud product from the plurality of cloud products based on the introduction information; send a second request message to the target cloud platform, wherein the second request message is used to acquire product information of the target cloud product, the product information including: the product name of the target cloud product, the product identifier of the target cloud product, and the target cloud platform to which the target cloud product belongs; and acquire the product information corresponding to the second request message fed back by the target cloud platform.
5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the device control method according to any one of claims 1 to 3 when run by a processor.
6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the device control method according to any one of claims 1 to 3.