IoT device control method, device, system, and computer-readable storage medium
By connecting with multiple host apps through universal plug-ins, the problem of high development costs is solved, the compatibility and interface uniformity of IoT devices are achieved, and development and maintenance costs are reduced.
Patent Information
- Application Number
- CN202210094828.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-26
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2042-01-26
AI Technical Summary
In the prior art, it is costly to develop two different control APP plug-ins to adapt to different host APPs to control the same IoT device.
A universal plug-in is used to connect to at least two host apps. Control instructions are received through the universal plug-in and converted into target instructions to achieve compatibility with different host apps and reduce development costs.
It achieves compatibility with different host apps, reduces development and maintenance costs, and improves user experience and interface uniformity.
Smart Images

Figure CN116546042B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to an Internet of Things (IoT) device control method, device, system, and computer-readable storage medium. Background Art
[0002] With the rapid development of IoT technology, IoT devices are becoming increasingly common in people's lives. Typically, IoT devices are controlled through control applications (APPs) installed on control terminals (e.g., mobile phones, tablets, etc.). Control APPs consist of both APP plug-ins and host APPs. By loading APP plug-ins into the host APP, IoT devices can be controlled.
[0003] In some scenarios, users need to control the same IoT device through two different control apps. For example, consider an IoT device that a user wishes to control using both control app a installed on phone A and control app b installed on phone B. Because the host apps in these different control apps have different interfaces, controlling the same IoT device requires developing two separate app plug-ins to accommodate both host apps.
[0004] However, developing two sets of APP plug-ins separately has the problem of high development costs. Summary of the Invention
[0005] The present application provides an IoT device control method, device, system, and computer-readable storage medium, which can achieve compatibility between APP plug-ins and different host APPs, saving development costs.
[0006] In a first aspect, the present application provides a method for controlling an Internet of Things (IoT) device. The method is performed by an electronic device, wherein a control application for controlling the IoT device is installed in the electronic device, the control application includes a universal plug-in, and the universal plug-in includes at least two first data interfaces. The at least two first data interfaces are used to connect to at least two host applications and send data to the at least two host applications. The method includes:
[0007] The general plug-in receives control instructions, which are used to control IoT devices; the general plug-in converts the control instructions into target instructions that match the first target interface based on the target host application currently loaded by the general plug-in, where the first target interface refers to the interface that is connected to the target host application among at least two first data interfaces; the general plug-in sends the target instructions to the target host application through the first target interface; and sends the target instructions to the IoT device through the target host application.
[0008] In this implementation, the control application is also the control APP, the general plug-in is also the general APP plug-in, and the host application is also the host APP.
[0009] Optionally, the IoT device may be, for example, a smart screen. The control application may be a first control APP (such as a smart space APP) or a second control APP (such as a smart life APP) in a specific implementation. The universal plug-in can be loaded on at least two host applications, such as a smart life host APP and a smart space host APP. Specifically, the universal plug-in may include at least two first data interfaces, and the two first data interfaces may be connected to the smart life host APP and the smart space host APP, respectively. In addition, it can be understood that the smart life APP can be connected to the first IoT platform, the smart space APP can be connected to the second IoT platform, and the smart screen is connected to the first IoT platform and the second IoT platform, respectively.
[0010] When the universal plug-in is loaded into the Smart Space host app (i.e., the target host application is the Smart Space host app), the interface of the two first data interfaces that interfaces with the Smart Space host app is the first target interface. After receiving the control instruction, the universal plug-in converts the control instruction into a target instruction that matches the first target interface and sends the target instruction to the Smart Space host app through the first target interface. The Smart Space host app then sends the target instruction to the smart screen via the IoT platform.
[0011] Similarly, when the universal plug-in is loaded into the Smart Life host app (i.e., the target host application is the Smart Life host app), the interface of the two first data interfaces that interfaces with the Smart Life host app is the first target interface. After receiving the control instruction, the universal plug-in converts the control instruction into a target instruction that matches the first target interface and sends the target instruction to the Smart Life host app through the first target interface. The Smart Life host app then sends the target instruction to the smart screen via the IoT platform.
[0012] In the IoT device control method provided by the first aspect above, the universal plug-in includes at least two first data interfaces, which can be connected to different host applications. When the universal plug-in is loaded into the target host application and the first target interface of the at least two first data interfaces is connected to the target host application, the universal plug-in can convert the control instruction into a target instruction that matches the first target interface, so that the target instruction can be sent to the target host application through the first target interface, and then the target host application can send the target instruction to the IoT device to achieve control of the IoT device. In this method, the universal plug-in can be connected to at least two host applications, and can convert the control instruction into an instruction that matches the corresponding interface of the host application. That is to say, the universal plug-in and the IoT device control method are compatible with at least two host applications, and there is no need to develop application plug-ins for multiple host applications separately, thereby reducing development and maintenance costs.
[0013] In combination with the first aspect, in some implementations of the first aspect, the general plug-in converts the control instruction into a target instruction that matches the first target interface based on the target host application currently loaded by the general plug-in, including: the general plug-in converts the control instruction according to the target format to obtain the target instruction, and the target format refers to the format that matches the first target interface.
[0014] In a possible implementation, the target instruction is a universal instruction, and the target format is a universal format matching the first target interface.
[0015] Optionally, in this implementation, when the target host application is a smart life host APP, the target instruction may be the first general instruction in the specific implementation; when the target host application is a smart space host APP, the target instruction may be the second general instruction in the specific implementation.
[0016] In this implementation, the universal plug-in converts control instructions into instructions in a universal format that matches the first target interface. The universal plug-in only needs to use the same interface to connect to the target host application to send instructions. Correspondingly, the host application only needs one universal interface to receive instructions, eliminating the need to design multiple interfaces for both the universal plug-in and the host application. At the same time, the IoT platform corresponding to the target host application only needs to develop one universal user profile, eliminating the need to design multiple user profiles. This further reduces development and maintenance costs, especially for IoT devices with a high number of control instructions, such as smart screens and smart speakers.
[0017] In one possible implementation, the first target interface includes a target application tool class, the target host application includes a general instruction interface, the target application tool class is connected to the general instruction interface, and the general plug-in sends the target instruction to the target host application through the first target interface, including: the general plug-in sends the target instruction to the general instruction interface through the target application tool class.
[0018] Optionally, the target application tool class may be, for example, the first APP tool class or the second APP tool class in a specific implementation, and the general instruction interface may be the first general instruction interface or the second general instruction interface in a specific implementation. When the general plug-in is loaded into the first host APP, the general plug-in may send the target instruction to the first general instruction interface via the first APP tool class; when the general plug-in is loaded into the second host APP, the general plug-in may send the target instruction to the second general instruction interface via the second APP tool class.
[0019] In a possible implementation, the general plug-in converts the control instruction according to the target format to obtain the target instruction, including: converting the control instruction into an instruction in the target format by the general plug-in to obtain a converted instruction; marking the converted instruction by the general plug-in to obtain the target instruction.
[0020] Optionally, the conversion instruction may be the first general instruction or the second general instruction in a specific implementation manner, and the target instruction may be the first general tag instruction or the second general tag instruction.
[0021] Optionally, a general plug-in can be used to add an instruction tag to the conversion instruction to obtain the target instruction, wherein the instruction tag is used to uniquely identify the instruction.
[0022] In this implementation, the target instruction is obtained by marking the instruction, which facilitates subsequent identification of the instruction based on the instruction tag in the target instruction. For example, it is convenient for the IoT device to determine the source of the target instruction based on the instruction tag, and thus return feedback information based on the source of the target instruction.
[0023] In a possible implementation, receiving the control instruction through the universal plug-in includes: the universal plug-in receiving the control instruction input by the user through the device control interface, where the device control interface refers to a display interface for controlling the IoT device.
[0024] In one possible implementation, before the universal plug-in receives the control instructions input by the user through the device control interface, the method also includes: obtaining interface information through the target host application, where the interface information refers to the information required to display the device control interface; sending the interface information to the universal plug-in through the target host application; converting the interface information through the universal plug-in to obtain standard interface information; and the universal plug-in displays the device control interface based on the standard interface information.
[0025] Optionally, the interface information may include device information and feedback information of the IoT device, etc. The general plug-in converts the device information to obtain standard device information, and the general plug-in converts the feedback information to obtain standard feedback information.
[0026] In this implementation, the interface information is converted through a universal plug-in to obtain standard interface information, and the device control interface is displayed based on the standard interface information. In this way, the device information in different host applications can be unified and standardized, so that the device control interfaces presented to users by different control applications are unified, thereby improving the user experience.
[0027] In one possible implementation, the universal plug-in also includes at least two second data interfaces, which are used to connect with at least two host applications, obtain data from at least two host applications, and send interface information to the universal plug-in through the target host application, including: sending interface information to the second target interface through the target host application, where the second target interface refers to the interface in the second data interface that connects with the target host application.
[0028] In this implementation, the universal plug-in includes at least two second data interfaces, which connect to the at least two host applications mentioned above, thereby enabling the universal plug-in to receive data from the host applications. This enables two-way communication between the application plug-in and the host application, facilitating the universal plug-in to further receive interface information sent by the host application, thereby facilitating the display and update of the interface.
[0029] In one possible implementation, the interface information includes device information of the IoT device and / or feedback information from the IoT device, the second target interface includes a target device information interface and a target feedback information interface, and sending the interface information to the second target interface through the target host application includes: sending device information to the target device information interface through the target host application; and / or, sending feedback information to the target feedback information interface through the target host application.
[0030] Optionally, when the target host application is a first host APP (e.g., a smart life host APP), the target device information interface may be a first device information receiving module, and the target feedback information interface may be a first feedback information acquisition module. When the target host application is a second host APP (e.g., a smart control host APP), the target device information interface may be a second device information receiving module, and the target feedback information interface may be a second feedback information acquisition module.
[0031] In the second aspect, the present application provides an IoT device control method, which is executed by an IoT device, and the method includes: receiving a target instruction from a target control application, the target control application includes a universal plug-in, the universal plug-in includes at least two first data interfaces, the first data interface is used to connect with at least two host applications, and send data to at least two host applications; the target instruction is an instruction that matches the first target interface, the first target interface refers to the interface among the at least two first data interfaces that connects with the target host application, and the target host application refers to the host application currently loaded by the universal plug-in; executing the target instruction.
[0032] The beneficial effects of the IoT device control method provided in the second aspect can be found in the first aspect and will not be repeated here.
[0033] In combination with the second aspect, in some implementations of the second aspect, the method further includes: generating feedback data according to the target instruction; and sending the feedback data to the target control application.
[0034] In one possible implementation, the feedback information includes a first instruction tag of the target instruction, and the first instruction tag is used to characterize the unique identity of the target instruction. Sending feedback data to the target control application includes: obtaining the correspondence between the instruction tag and the control application; and sending feedback data to the target control application based on the first instruction tag and the correspondence.
[0035] In one possible implementation, the target instruction includes a first instruction tag, the IoT device includes at least two access modules, and the at least two access modules are used to communicate one-to-one with at least two control applications; receiving the target instruction from the target control application includes: receiving the target instruction from the target control application through the target access module, the target access module refers to a module among the at least two access modules used to communicate with the target control application; sending feedback data to the target control application based on the first instruction tag and the corresponding relationship, including: determining the target access module corresponding to the first instruction tag based on the corresponding relationship; and sending feedback information to the target control application through the target access module.
[0036] Optionally, at least two access modules of the IoT device are used to connect to at least two IoT platforms one by one, and at least two IoT platforms are used to connect to the at least two control applications mentioned above one by one. Specifically, the IoT device may include a first access module and a second access module. The first access module is used to connect to the first IoT platform, and the first control APP is connected to the first IoT platform. Therefore, the first access module of the IoT device can communicate with the first control APP through the first IoT platform. The second access module is used to connect to the second IoT platform, and the second control APP is connected to the second IoT platform. Therefore, the second access module of the IoT device can communicate with the second control APP through the second IoT platform.
[0037] Optionally, the correspondence between the instruction tag and the control application, that is, the correspondence between the instruction tag and the access module that inputs the instruction. In this implementation, the IoT device determines that the source of the control instruction corresponding to the instruction tag is the target access module based on the first instruction tag and the correspondence, and returns the feedback information to the target control application through the target access module. This ensures the accuracy of feedback information transmission in scenarios where two control apps control IoT devices, improving the user experience.
[0038] In a third aspect, the present application provides a device, which is included in an electronic device and has the function of implementing the electronic device behavior described in the first aspect and possible implementations of the first aspect. The function can be implemented through hardware or through hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the above functions. For example, a receiving module or unit, a processing module or unit, etc.
[0039] In a fourth aspect, the present application provides an apparatus, included in an IoT device, that implements the electronic device behaviors described in the second aspect and possible implementations of the second aspect. The functionality can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the functionality described above. For example, a receiving module or unit, a processing module or unit, etc.
[0040] In a fifth aspect, the present application provides an electronic device, which includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the first aspect.
[0041] In a sixth aspect, the present application provides an IoT device, which includes: a processor, a memory, and an interface; the processor, the memory, and the interface cooperate with each other so that the electronic device executes any one of the methods in the technical solution of the second aspect.
[0042] In a seventh aspect, the present application provides an IoT system, comprising the electronic device of the fifth aspect and the IoT device of the sixth aspect.
[0043] In an eighth aspect, the present application provides a chip including a processor, wherein the processor is configured to read and execute a computer program stored in a memory to perform the method of the first aspect and any possible implementation thereof, or to perform the method of the second aspect and any possible implementation thereof.
[0044] Optionally, the chip also includes a memory, and the memory is connected to the processor via circuits or wires.
[0045] Further optionally, the chip also includes a communication interface.
[0046] In the ninth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes any one of the methods in the technical solution of the first aspect, or executes the method in the second aspect and any possible implementation thereof.
[0047] In the tenth aspect, the present application provides a computer program product, which includes: computer program code, which, when the computer program code runs on an electronic device, enables the electronic device to execute any one of the methods in the technical solution of the first aspect, or execute the method in the second aspect and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a schematic diagram of an application scenario of an IoT device control method provided in an embodiment of the present application;
[0049] Figure 2 This is a schematic diagram of the principle of different control apps controlling the same IoT device provided in an embodiment of the present application;
[0050] Figure 3 1 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application;
[0051] Figure 4 This is a software structure diagram of an electronic device provided in an embodiment of the present application;
[0052] Figure 5 This is a schematic diagram of the architecture of a system including a first control APP, a first IoT platform, and an IoT device provided in an embodiment of the present application;
[0053] Figure 6 This is a schematic diagram of the architecture of a system including a second control APP, a second IoT platform, and an IoT device provided in an embodiment of the present application;
[0054] Figure 7 This is a flow chart of the device registration phase in an IoT device control method provided in an embodiment of the present application;
[0055] Figure 8 This is a schematic diagram of the interface changes of a mobile phone when a user operates a first control APP provided in an embodiment of the present application;
[0056] Figure 9 A schematic diagram of the process of displaying device information in an IoT device control method according to an embodiment of the present application;
[0057] Figure 10A flowchart of the instruction issuing stage in an IoT device control method provided in an embodiment of the present application;
[0058] Figure 11 This is a flow chart of the data return phase in an IoT device control method provided in an embodiment of the present application;
[0059] Figure 12 This is a flow chart of the device registration phase in another IoT device control method provided in an embodiment of the present application;
[0060] Figure 13 This is a schematic diagram of the interface changes of a mobile phone when a user operates a second control APP provided in an embodiment of the present application;
[0061] Figure 14 This is a flowchart of an IoT device control method provided in an embodiment of the present application;
[0062] Figure 15 This is a flowchart of another IoT device control method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0063] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships can exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0064] In the following, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the quantity of the technical features indicated. Therefore, a feature specified as "first," "second," or "third" may explicitly or implicitly include one or more of the features.
[0065] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of the present application include a particular feature, structure, or characteristic described in conjunction with that embodiment. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0066] To better understand the embodiments of the present application, the terms or concepts that may be involved in the embodiments are explained below.
[0067] IoT device: A physical object in an IoT network. In the embodiments of this application, an IoT device may be a smart home device, such as a smart speaker, smart screen, smart desk lamp, smart air conditioner, smart refrigerator, smart door lock, or smart curtains. Additionally, an IoT device may also be an in-vehicle device, wearable device, augmented reality (AR) or virtual reality (VR) device, or other smart device. The embodiments of this application do not limit the specific type of IoT device.
[0068] Control App: An app used to control IoT devices, such as the Smart Space App or the Smart Life App. A control app can include a host app and app plug-ins loaded into the host app. In this embodiment, the host app of the Smart Space App is referred to as the Smart Space Host App, and the host app of the Smart Life App is referred to as the Smart Life Host App.
[0069] Control terminal: a terminal device with a control app installed, including but not limited to mobile phones, tablet computers, wearable devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc.
[0070] Cloud server: Also known as IoT cloud, smart home cloud, cloud platform, cloud, or device cloud. Cloud servers are used to store data related to IoT devices or control terminals, and to forward and transmit data (for example, control commands) between control terminals and IoT devices.
[0071] IoT platform: An integrated platform that integrates IoT device management, secure data communication, and message subscription capabilities. The IoT platform supports connecting to IoT devices and collecting their data. It also provides an application programming interface (API) that allows control terminals to issue commands to IoT devices, enabling remote control of these devices. IoT platforms can be hosted on cloud servers and are therefore also called IoT cloud platforms.
[0072] The IoT platform consists of an access layer and a functional layer. The access layer is used to connect with IoT devices and control apps. The functional layer implements functions related to IoT device applications, including but not limited to identity verification, data encryption, IoT device upgrades, data storage, account management, device binding, and data forwarding (also known as data flow or data transmission).
[0073] Control app account information: This information is used to identify the user when the user registers with the control app. An app account is also called app user information or an app user identity document (user ID).
[0074] Feedback information: Data and information sent by an IoT device to the control app. Feedback information may include the results of the IoT device's execution of control commands, relevant data generated by the IoT device after executing the control commands, and status information of the IoT device obtained by the IoT device. Status information may include, for example, information indicating the IoT device's online status and battery level. This application does not impose any restrictions on the specific content of status information and feedback information.
[0075] Device control interface (view): refers to the interface used to control IoT devices displayed in the control app in the control terminal.
[0076] IoT device registration information: This information is required for IoT device registration. This information may include the registrant's identity and the device's activation code.
[0077] The register identity document (regID) of an IoT device is used to represent the unique identity of the IoT device during the device registration phase.
[0078] Activation code of IoT device: used for registration and activation of IoT device during the device registration phase.
[0079] Device account of an IoT device: also known as the device identity document (devID) of an IoT device, used to represent the unique identity of an IoT device.
[0080] IoT device login password: This information is used to verify the identity of an IoT device when logging into a device account. Each IoT device account corresponds to one login password.
[0081] The following describes the IoT device control method provided in the embodiments of the present application.
[0082] For the application of IoT devices, there is an application scenario where different control apps can be used to control the same IoT device. For example, Figure 1 This is a schematic diagram of an application scenario of an IoT device control method provided in an embodiment of the present application. Figure 1 As shown, this scenario includes a first cloud server 101, a first control terminal 102, a second cloud server 104, a second control terminal 105 and an IoT device 107. Figure 1 In the example, the IoT device is a smart screen, and the first control terminal 102 and the second control terminal 105 are both mobile phones. Among them, the first control terminal 102 is installed with a first control APP 103, and the second control terminal 105 is installed with a second control APP 106.
[0083] For example, Figure 2 This is a schematic diagram of the principle of different control APPs controlling the same IoT device provided in the embodiment of this application. Please refer to Figure 1 and Figure 2 A first IoT platform 1011 is established in the first cloud server 101, and a second IoT platform 1041 is established in the second cloud server 104. The IoT device 107 is connected to both the first IoT platform 1011 and the second IoT platform 1041. Specifically, the IoT device 107 includes a first access module 1071 and a second access module 1072. The first access module 1071 is an access module built based on the software development kit (SDK) provided by the first IoT platform 1011. The IoT device 107 can access the first IoT platform 1011 through the first access module 1071. The second access module 1072 is an access module built based on the SDK provided by the second IoT platform 1041. The IoT device 107 can access the second IoT platform 1041 through the second access module 1072.
[0084] In addition, the first control APP 103 is connected to the first IoT platform 1011 and can call the application programming interface (hereinafter referred to as the interface) in the first IoT platform 1011. The second control APP 106 is connected to the second IoT platform 1041 and can call the interface in the second IoT platform 1041. The first control APP 103 and the second control APP 106 both have developed control functions for the IoT device 107. Therefore, the IoT device 107 can be controlled by the first control APP 103 and the second control APP 106. Specifically, the first IoT platform 1011 defines user profiles corresponding to various control instructions for controlling the IoT device 107. The user profile is used to implement the processing and transmission of instructions and data between the control APP and the IoT device. The second IoT platform 1041 also defines user profiles corresponding to various control instructions for controlling the IoT device 107.
[0085] The first control app 103 includes a first host app 1031 and a first app plug-in 1032 that can be loaded into the first host app 1031. The first host app 1031 can interface with the first IoT platform 1011 and call corresponding interfaces within the first IoT platform 1011. The first app plug-in 1032 is used to display the device control interface of the IoT device 107, generate and issue control commands, and receive feedback information. The first app plug-in 1032 is loaded into the first host app 1031, and the first host app 1031 interfaces with the first IoT platform 1011, thereby accessing the first IoT platform 1011. The first host app 1031 receives user control commands through the first app plug-in 1032, calls the interface corresponding to the corresponding user profile within the first IoT platform 1011, and issues the control commands to the IoT device 107, thereby controlling the IoT device 107 through the first control app 103.
[0086] Similarly, the second control app 106 includes a second host app 1061 and a second app plug-in 1062 that can be loaded into the second host app 1061. The second host app 1061 can interface with the second IoT platform 1041 and call corresponding interfaces within the second IoT platform 1041. The second app plug-in 1062 is used to display the device control interface of the IoT device 107, generate and issue control commands, and receive feedback information. The second app plug-in 1062 is loaded into the second host app 1061, and the second host app 1061 interfaces with the second IoT platform 1041, thereby accessing the second IoT platform 1041. The second host app 1061 receives user control commands through the second app plug-in 1062, calls the interface corresponding to the corresponding user profile within the second IoT platform 1041, and issues the control commands to the IoT device 107, thereby controlling the IoT device 107 through the second control app 106.
[0087] As can be seen above, since the first IoT platform 1011 and the second IoT platform 1041 are different, the access interfaces and call interfaces provided by the two platforms are different. Therefore, the structures and interfaces of the first host APP 1031 and the second host APP 1061 are also different. In turn, the structures of the first APP plug-in 1032 and the second APP plug-in 1062 are also different. The two APP plug-ins need to be developed and designed separately, which is very costly. To address this issue, the embodiments of the present application provide an APP plug-in and IoT device control method that are compatible with multiple host APPs, thereby reducing development costs.
[0088] The IoT device control method provided in the embodiments of the present application can be applied to electronic devices that can install APPs, such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality / virtual reality devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, and personal digital assistants (PDAs). The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0089] For example, Figure 31 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0090] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0091] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0092] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0093] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0094] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0095] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0096] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0097] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Figure 3 The structures of antenna 1 and antenna 2 are merely examples. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with tuning switches.
[0098] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0099] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0100] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0101] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0102] The internal memory 121 can be used to store computer executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0103] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0104] Figure 4 This is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.
[0105] like Figure 4 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.
[0106] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0107] like Figure 4As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.
[0108] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0109] Content providers are used to store and retrieve data and make it accessible to applications. Data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0110] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0111] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0112] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0113] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0114] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.
[0115] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0116] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0117] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0118] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0119] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0120] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0121] A 2D graphics engine is a drawing engine for 2D drawings.
[0122] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0123] The following combination Figure 1 Application scenarios and Figure 3 and Figure 4 An electronic device of the structure shown is used to illustrate the method provided in the embodiment of the present application and the architecture of the system involved in the method. In this embodiment, an IoT device control method and a universal APP plug-in are provided, which are compatible with multiple host APPs, and there is no need to develop APP plug-ins for multiple host APPs separately, thereby reducing development and maintenance costs. The following embodiments are illustrated by taking the universal APP plug-in that is compatible with the first host APP and the second host APP as an example. It should be noted that in actual applications, as needed, a universal APP plug-in and IoT control method that can be compatible with any two or more host APPs can be designed according to the architecture and method provided in this embodiment.
[0124] The following embodiments are described by taking the IoT device as a smart screen, the first host APP as a smart life host APP, and the second host APP as a smart space host APP as an example.
[0125] For example, Figure 5 This is a schematic diagram of the architecture of a system including a first control app, a first IoT platform, and an IoT device, provided for one embodiment of the present application. The first IoT platform is established on a first cloud server. This embodiment relates to the structure and data flow associated with controlling an IoT device through the first control app.
[0126] like Figure 5 As shown, the first control APP may include a general APP plug-in and a first host APP. The general APP plug-in and the first host APP may be set in Figure 4 The application layer in the software architecture shown. The first host app may include a first device information acquisition module, a first device information acquisition interface, a first feedback information acquisition interface, and a first general command interface. The first device information acquisition interface, the first feedback information acquisition interface, and the first general command interface can all be connected to corresponding interfaces in the first IoT platform.
[0127] The general APP plug-in includes a first device information receiving module, a second device information receiving module, an information conversion module, an interface display module, an instruction generation module, a host proxy service (host service proxy), a first APP tool class (service util tool) and a second APP tool class (service util tool). Among them, the first device information receiving module can be connected to the first host APP to receive data sent by the first host APP. The second device information receiving module can be connected to the second host APP to receive data sent by the second host APP. The first APP tool class can be connected to the first host APP to send data to the first host APP. The second APP tool class can be connected to the second host APP to send data to the second host APP. Specifically, the first device information receiving module can be connected to the first device information acquisition module in the first host APP. The first APP tool class can be connected to the first general instruction interface in the first host APP.
[0128] The first device information acquisition module is used to obtain relevant information of the IoT device from the first IoT platform through the first device information acquisition interface, such as the device name, ID information, functional data and information to be displayed, etc. of the IoT device, and send the obtained relevant information of the IoT device to the first device information receiving module in the general APP plug-in. The first device information receiving module sends the relevant information of the IoT device to the information conversion module. In this embodiment, the first host APP is a smart life host APP, and the information obtained by the first device information may include hi link device entity. It can be understood that the format and / or information definition standards of the device information obtained by different host APPs are different. The information conversion module is used to convert the relevant data information of the IoT device into data information of preset standards. The interface display module is used to display the interface based on the acquired data and information, including but not limited to displaying the device control interface based on the data information converted by the information conversion module. In the embodiment of the present application, the IoT device is a smart screen, and the device control interface may include remote control controls, input source setting controls, sound setting controls, image setting controls, etc., which are not exhaustive here.
[0129] The command generation module is used to generate commands for controlling IoT devices in response to user operations on relevant controls in the device control interface. In this embodiment, the command generation module may include a remote control command generation unit, an input source setting command generation unit, a sound setting command generation unit, and an image setting command generation unit, corresponding to the controls in the device control interface.
[0130] The host proxy service may include an instruction conversion module, an instruction marking module, a first feedback information acquisition module, and a second feedback information acquisition module. The instruction conversion module is configured to convert control instructions into general instructions that match the first or second APP tool class, based on the host application loaded by the universal APP plug-in. For example, in this embodiment, if the universal APP plug-in is loaded into the first host APP and the first APP tool class is capable of interfacing with the first host APP, the instruction conversion module will convert the control instructions into first general instructions that match the first APP tool class. The instruction marking module is configured to mark the general instructions and send the marked general instructions to the tool class corresponding to the host APP loaded by the universal APP plug-in. In this embodiment, if the universal APP plug-in is loaded into the first host APP, the instruction marking module marks the first general instruction to obtain a first general marked instruction and sends the first general marked instruction to the first APP tool class. The first APP tool class is capable of interfacing with the first host APP, and the first general instruction interface is capable of interfacing with an interface in the first IoT platform. Therefore, the first APP tool class can send the first general marked instruction to the first IoT platform via the first general instruction interface. The first feedback information acquisition module is configured to interface with the first feedback information acquisition interface of the first host APP to receive feedback information sent by the first host APP. The second feedback information acquisition module is used to connect to the second feedback information acquisition interface of the second host APP and receive feedback information sent by the second host APP.
[0131] In this embodiment, the first IoT platform may include a first general user configuration file, and the first general user configuration file is used to send the first general marking instruction sent by the first control APP to the IoT device.
[0132] The IoT device may include a first APP account login module, a second APP account login module, a registration instruction generation module, a first access module, a second access module, an instruction distribution module, and an instruction processing service (cmd server) module. It will be understood that in this embodiment, the IoT device is a smart screen, which may have a display screen, and the display screen may display the IoT interface. Optionally, the IoT interface may include a first APP account login window, a second APP account login window, and a registration window, etc. The first APP account login module is used to obtain and manage the account information of the first control APP entered by the user in the first APP account login window (which may include an account, login password, etc.). The second APP account login module is used to obtain and manage the account information of the second control APP entered by the user in the second APP account login window. The registration instruction generation module is used to generate a registration instruction based on the information of the IoT device entered by the user in the registration window and the account information of the second control APP. The registration instruction is used to instruct the registration of the IoT device on the second IoT platform.
[0133] In this embodiment, the first access module is an access module built based on the Hi Link SDK provided by the first IoT platform, and the IoT device accesses the first IoT platform through the first access module. The second access module is an access module built based on the Magic Link SDK provided by the second IoT platform, and the IoT device accesses the second IoT platform through the second access module.
[0134] In this embodiment, the first IoT platform sends the first general tag instruction to the first access module. The first access module sends the marked general tag instruction to the instruction distribution module. The instruction distribution module is used to distribute the control instruction to the corresponding unit in the instruction processing service module according to the content of the control instruction. The instruction distribution module is also used to receive feedback information, and send the feedback information to the corresponding module according to the source of the control instruction corresponding to the feedback information (that is, which module the control instruction is input from). For example, in this embodiment, after the instruction distribution module receives the feedback information, if it is determined that the source of the control instruction corresponding to the feedback information is the first access module, the instruction distribution module sends the feedback information to the first access module. The instruction processing service module is used to process and execute the control instruction. Optionally, the control instruction processed and executed by the instruction distribution module and the instruction processing service module can be a control instruction issued by the control APP, or a control instruction issued by the server, or a control instruction input by the user directly operating the IoT device, for example, a registration control instruction input by the user through the interactive interface of the smart screen.
[0135] Optionally, in this embodiment, the instruction processing service module may include a device status reporting unit, a remote control unit, an input source setting unit, a sound setting unit, an image setting unit, and a device registration unit, etc. Among them, the device registration unit is used to register the IoT device with the second IoT platform.
[0136] It should be noted that the above IoT device architecture is merely an example. Depending on the type and functional design, IoT devices may include more or fewer units and modules than those in the above embodiments. For example, an IoT device without a display screen or interactive interface may not include a first APP account login module, a second APP account login module, or a registration instruction generation module. Furthermore, the specific instruction processing units included in the instruction processing service module may vary from IoT device to IoT device.
[0137] For example, Figure 6 This is a schematic diagram of the architecture of a system including a second control app, a second IoT platform, and an IoT device, provided for one embodiment of the present application. The second IoT platform is established on a second cloud server. This embodiment relates to the structure and data flow associated with controlling an IoT device via the second control app.
[0138] like Figure 6 As shown, the second control APP may include a general APP plug-in and a second host APP. The general APP plug-in and the second host APP may be set in Figure 4 The application layer in the software architecture shown. The second host APP includes a second device information acquisition module, a second device information acquisition interface, a second feedback information acquisition interface and a second general instruction interface. The second device information acquisition interface, the second feedback information acquisition interface and the second general instruction interface can all be connected to the corresponding interfaces in the second IoT platform. The second device information acquisition module is used to obtain relevant information of the IoT device from the second IoT platform through the second device information acquisition interface. The information obtained by the second device information is different from the format and / or information definition standard of the information obtained by the first device information acquisition module in the first control APP. In this embodiment, the second host APP is a smart space host APP, and the information obtained by the second device information may include a host device entity.
[0139] The structure and function of general APP plug-in Figure 5 The general APP plug-in structure in the embodiment shown is the same, and the structure of the general APP plug-in will not be repeated. Figure 5 What is different from the illustrated embodiment is that, in this embodiment, the universal APP plug-in is loaded into the second host APP, and the instruction conversion module converts the control instruction into a second universal instruction that matches the second APP tool class, and sends the second universal instruction to the instruction marking module. The instruction marking module marks the second universal instruction to obtain a second universal marking instruction, and sends the marked second universal marking instruction to the second APP tool class. The second APP tool class sends the second universal marking instruction to the second IoT platform through the second universal instruction interface. And in this embodiment, the universal APP plug-in is connected to the second feedback information acquisition interface through the second feedback information acquisition module to receive feedback information sent by the second host APP. The universal APP plug-in is connected to the second device information acquisition module through the second device information receiving module to receive device information sent by the second host APP. In other words, Figure 5 The universal APP plug-in structure in the illustrated embodiment is the same as that in this embodiment, but the host APPs to which the universal APP is connected are different, the transmission paths of instructions and information are different, and the formats of instructions are different.
[0140] In this embodiment, the second IoT platform may include a second universal user configuration file, and the second universal user configuration file is used to send the second universal marking instruction sent by the second control APP to the IoT device.
[0141] The structure of IoT devices is as follows Figure 5The embodiment shown is described in detail and will not be repeated here. The second access module of the IoT device can be connected to the second IoT platform. The second IoT platform sends the second general tag instruction to the second access module of the IoT device. In this embodiment, after the instruction distribution module of the IoT device receives the feedback information, it determines that the source of the feedback information is the second access module, and then sends the feedback information to the second access module, which sends the feedback information to the second IoT platform. In other words, the IoT platform to which the IoT device in this embodiment is connected is connected to Figure 5 The transmission paths of instructions and information are different in the different embodiments shown.
[0142] For ease of understanding, the following examples of this application will be Figure 5 and Figure 6 Taking the structure shown as an example, the IoT device control method provided in the embodiment of the present application is specifically described in combination with the accompanying drawings and application scenarios.
[0143] The process of controlling an IoT device primarily involves the device registration phase, the device information display phase, the command issuance phase, and the data return phase. In the following examples, using a smart screen as an example, we will describe the specific processes involved in each stage of IoT device control, in two scenarios: controlling the IoT device through a first control app and controlling the IoT device through a second control app.
[0144] A. Control IoT devices through the First Control APP
[0145] 1) Device registration phase
[0146] For example, Figure 7 This is a flow chart of the device registration phase in an IoT device control method provided in an embodiment of the present application. Figure 5 and Figure 7 In this embodiment, the IoT device control method includes:
[0147] S701: A user performs a first login operation in the first app account login window of the IoT device interface of the smart screen. In response to the user's first login operation, the first app account login module obtains the first app account information entered by the user. The first login operation includes entering the first app account information and clicking the login control. The first app account information refers to the account information registered by the user in the first control app.
[0148] S702. The first APP account login module sends the acquired first APP account information to the first access module.
[0149] S703: The first access module sends the first APP account information to the first IoT platform, and applies to the first IoT platform for registration information of the IoT device.
[0150] S704. The first IoT platform generates registration information of the IoT device in response to the application of the first access module, and associates the registration information of the IoT device with the first APP account information to facilitate verification during subsequent device registration.
[0151] The registration information of an IoT device may include the identity information of the registrant of the IoT device and the activation code of the IoT device.
[0152] S705. The first IoT platform returns the generated registration information of the IoT device to the first access module of the IoT device.
[0153] S706. The first access module of the IoT device sends the registration information of the IoT device and the first APP account to the second IoT platform, requesting the first IoT platform to register the device.
[0154] S707: The first IoT platform registers the IoT device in response to the device registration request of the first access module.
[0155] Specifically, the first IoT platform can compare and verify the IoT device registration information sent by the IoT device with the IoT device registration information associated with the first APP account stored on the first IoT platform. If the two are consistent, the first IoT platform generates device information for the IoT device. The device information includes the device account and login password. The first IoT platform binds the IoT device's device information to the first APP account, that is, associates the IoT device's device information with the first APP account information.
[0156] S708. The first IoT platform returns a registration result to the first access module of the IoT device.
[0157] Optionally, the registration result may include the device account and login password of the IoT device, etc. The IoT device can log in to the first IoT platform according to the device account and login password.
[0158] It should be noted that the process of the above-mentioned device registration stage is only an example. Depending on the type, function, etc. of the IoT device, the specific process of the device registration stage may be different. For example, if the IoT device does not have a display screen and an interactive interface, the device registration can be performed through the first control APP in the control terminal. The embodiments of this application do not impose any restrictions on this.
[0159] 2) Equipment information display stage
[0160] For example, Figure 8 This is a schematic diagram of the interface changes of a mobile phone when a user operates the first control APP provided in an embodiment of the present application. When the smart screen is bound to the first APP account and the first control APP in the mobile phone is logged in with the first APP account, when the user clicks Figure 8 In the interface shown in (a), the mobile phone opens the first control APP in response to the user's click operation and displays the main interface of the first control APP, such as Figure 8 As shown in (b) in the figure. This interface includes a smart screen card 801. The user clicks the smart screen card 801 to enter the device control interface of the smart screen, as shown in Figure 8 As shown in (c) in .
[0161] In the above process, when the user clicks on the smart screen card 801, the first control APP enters the device information display stage, and the specific execution process is as follows.
[0162] For example, Figure 9 This is a flow chart of the device information display phase in the IoT device control method provided in one embodiment of this application. Please also refer to Figure 5 and Figure 9 In this embodiment, the IoT device control method includes:
[0163] S901. The first device information acquisition module in the first host APP obtains the first device information of the IoT device (smart screen) from the first IoT platform through the first device information acquisition interface in response to the user clicking the smart screen card.
[0164] For the sake of convenience in distinguishing, in the embodiment of the present application, the device information of the smart screen obtained by the first device information acquisition module of the first host APP is referred to as the first device information, and the device information of the smart screen obtained by the second device information acquisition module of the second host APP is referred to as the second device information.
[0165] S902. The first device information acquiring module in the first host APP sends the first device information to the first device information receiving module in the general APP plug-in.
[0166] S903: The first device information receiving module in the general APP plug-in sends the first device information to the information conversion module.
[0167] S904: The information conversion module in the general APP plug-in converts the first device information to obtain standard device information.
[0168] Optionally, the information conversion module can perform JSON deserialization conversion on the first device information according to a preset standard to obtain standard device information. Subsequent APP displays the device control interface or performs other steps that require device information support based on the standard device information.
[0169] S905. The information conversion module in the general APP plug-in sends the standard device information to the interface display module.
[0170] S906. The interface display module in the general APP plug-in displays the device control interface of the smart screen according to the standard device information, such as Figure 8 As shown in (c) in .
[0171] In this embodiment, the first device information receiving module in the universal app plug-in interfaces with the first device information acquisition module in the first host app to obtain device information for the IoT device from the first host app. Furthermore, the information conversion module in the universal app plug-in converts the device information obtained by the host app into standard device information, and displays a device control interface based on this standard device information. In this way, the universal app plug-in is adaptable and compatible with multiple host apps, achieving the unification and standardization of device information across different host apps. This allows for a unified device control interface presented to users by different control apps, improving the user experience.
[0172] 3) Instruction issuance stage
[0173] In one embodiment, when the user clicks Figure 8 When a control in (c) is activated, the first control APP enters the instruction issuing stage. Figure 8 The example of the input source setting control 802 shown in (c) of FIG. 8 is used to issue an input source setting instruction. Specifically, the example of the user changing the input source of the smart screen from DTV to HDMI1 by operating the input source setting control 802 is used for explanation. The process of issuing other control instructions is similar and will not be repeated here.
[0174] For example, Figure 10 This is a flowchart of the instruction issuing stage in the IoT device control method provided in one embodiment of this application. Please refer to Figure 5 and Figure 10 In this embodiment, the IoT device control method includes:
[0175] S1001. An input source setting instruction generation unit in an instruction generation module generates an input source setting instruction in response to a user clicking an input source setting control.
[0176] In this embodiment, the input source setting instruction is used to instruct to set the input source of the smart screen to HDMI1.
[0177] S1002: The input source setting instruction generation unit sends the input source setting instruction to the instruction conversion module in the host proxy service.
[0178] S1003: The instruction conversion module in the host proxy service converts the input source setting instruction into a first general instruction.
[0179] Universal commands are control commands formatted in a pre-defined, universal format. After converting different control commands into universal commands in a common format, these commands can be input through a universal interface. Modules connected to this interface can also receive these commands through the universal interface. Furthermore, the IoT platform can process or transmit these universal commands through a universal user profile.
[0180] In this embodiment, the instruction conversion module can convert the received control instructions into general instructions of different formats according to the different host APPs loaded by the general APP plug-in. Specifically, if the general APP plug-in is loaded on the first host APP, the instruction conversion module converts all the received control instructions into general instructions of the first format to obtain the first general instruction. The first format refers to the format that matches the first APP tool class. If the general APP plug-in is loaded on the second host APP, the instruction conversion module converts all the received control instructions into general instructions of the second format to obtain the second general instruction. The second format refers to the format that matches the second APP tool class.
[0181] S1004: The instruction conversion module in the host proxy service sends the first general instruction to the instruction marking module in the host proxy service.
[0182] S1005. The instruction marking module in the host proxy service marks the first general instruction to obtain a first general marked instruction.
[0183] Optionally, the instruction marking module can add an instruction mark to each first general instruction to distinguish each first general instruction, and the instruction mark is used to characterize the unique identity of the instruction. As a possible implementation method, the instruction marking module can add an instruction sequence number at a preset position of each first general instruction, and the instruction sequence number added to each first general instruction is different. For example, the instruction marking module adds the instruction sequence number SN1 to the end of the first first general instruction issued, adds the instruction sequence number SN2 to the end of the second first general instruction issued, and so on. The first general instruction after adding the mark is called the first general marked instruction.
[0184] S1006: The instruction marking module in the host proxy service sends the first general marking instruction to the corresponding tool class. In this embodiment, the instruction marking module sends the first general marking instruction to the first APP tool class.
[0185] Optionally, the instruction marking module can send the first general marking instruction to the corresponding tool class according to the format of the first general marking instruction. Optionally, the instruction marking module can also first determine the host APP currently loaded by the general APP plug-in, and then send the first general marking instruction to the tool class of the host APP currently loaded by the general APP plug-in. Optionally, the instruction marking module can determine the host APP currently loaded by the general APP plug-in according to the type of device information received by the first device information receiving module or the source of the device information (first device information receiving module). For example, if the device information received by the information conversion module is hilink device entity, it is determined that the host APP currently loaded by the general APP plug-in is the smart life host APP, and the instruction marking module sends the first general marking instruction to the first APP tool class. If the device information received by the information conversion module is host device entity, it is determined that the host APP currently loaded by the general APP plug-in is the smart space host APP, and the instruction marking module sends the first general marking instruction to the second APP tool class.
[0186] S1007. The first APP tool class sends the first general marking instruction to the first IoT platform through the first general instruction interface in the first host APP.
[0187] S1008. The first IoT platform sends the first general marking instruction to the first access module of the IoT device.
[0188] Specifically, the first IoT platform may send the first general marking instruction to the first access module through the first general configuration file.
[0189] S1009. The first access module of the IoT device sends the first general marking instruction to the instruction distribution module.
[0190] S1010. The instruction distribution module of the IoT device determines and records information of the module that inputs the first general marking instruction, that is, determines and records the source of the first general instruction.
[0191] Specifically, the instruction distribution module can obtain the instruction tag in each received control instruction and establish a correspondence between each instruction tag and the information of the module that inputs the control instruction, so that the information of the module that inputs the control instruction can be obtained according to the instruction tag.
[0192] S1011: The instruction distribution module of the IoT device parses the first universal tag instruction and, based on the content of the first universal tag instruction, sends the first universal tag instruction to the corresponding unit in the instruction processing service module. In this embodiment, the instruction distribution module sends the first universal tag instruction to the input source setting unit in the instruction processing service module.
[0193] S1012. The instruction input source setting unit in the instruction processing service module executes the first general marking instruction, sets the input source of the current display screen of the smart screen, and sets the input source to HDMI1.
[0194] In this embodiment, the instruction marking module in the host proxy service can send the first general marking instruction to the first APP tool class corresponding to the first host APP loaded by the general APP plug-in. The first APP tool class can be connected to the first host APP, and the first general marking instruction is sent to the first IoT platform through the first general instruction interface in the first host APP, and the first IoT platform forwards the control instruction to the IoT device. In this way, the general APP plug-in is applicable to the first host APP. On the other hand, the instruction conversion module in the host proxy service converts the instruction into a general instruction, so that the first APP tool class and the first host APP only need to connect to one type of instruction, without the need to design multiple interfaces, and the first IoT platform only needs to develop a general user configuration file, without the need to design multiple user configuration files, thereby saving development and maintenance costs. Especially for IoT devices with more control instructions such as smart screens and smart speakers, development costs can be greatly saved.
[0195] 4) Data return phase
[0196] In actual applications, the IoT device will report or return feedback information to the control APP. Specifically, in some embodiments, after executing the control instruction, the relevant unit in the instruction processing service module of the IoT device can return the execution result of the control instruction or the relevant data generated by the execution of the control instruction to the control APP. In other embodiments, the IoT device can obtain the status information of the IoT device and report the status information to the control APP, so that the control APP displays the status information of the IoT device on the device control interface of the IoT device or the card of the IoT device in the main interface of the control APP. When the IoT device reports or returns feedback information, it enters the data return stage. The specific process of the data return stage is as follows.
[0197] For example, Figure 11 This is a flow chart of the data return phase in the IoT device control method provided by an embodiment of the present application. In this embodiment, the execution result of the input source setting instruction fed back by the IoT device to the first control APP is used as an example for explanation. Please refer to Figure 5and Figure 11 In this embodiment, the IoT device control method includes:
[0198] S1101: An input source setting unit generates first feedback information according to an execution result of an input source setting instruction. The first feedback information includes an instruction tag in the input source setting instruction.
[0199] S1102: The input source setting unit sends the first feedback information to the instruction distribution module.
[0200] S1103: The instruction distribution module determines the source of the control instruction corresponding to the instruction tag based on the instruction tag in the first feedback information. In this embodiment, the instruction distribution module of the IoT device determines that the source of the control instruction corresponding to the instruction tag is the first access module based on the instruction tag in the first feedback information.
[0201] S1104: The instruction distribution module returns the first feedback information to the corresponding module according to the source of the control instruction corresponding to the instruction tag. In this embodiment, the instruction distribution module returns the first feedback information to the first access module.
[0202] S1105. The first access module sends the first feedback information to the first IoT platform.
[0203] S1106. The first IoT platform sends the first feedback information to the first feedback information acquisition module of the host proxy service through the first feedback information acquisition interface of the first host APP.
[0204] S1107: The first feedback information acquisition module sends the first feedback information to the information conversion module.
[0205] S1108: The information conversion module converts the first feedback information to obtain first standard feedback information.
[0206] S1109: The information conversion module sends the first standard feedback information to the interface display module.
[0207] S1110 : The interface display module updates the device control interface according to the first standard feedback information, and displays that the input source is HDMI1.
[0208] In this embodiment, the instruction distribution module of the IoT device determines the source of the control instruction corresponding to the instruction tag based on the instruction tag in the first feedback information, and sends the first feedback information to the corresponding module based on the source of the control instruction, thereby feeding back the first feedback information to the control APP that issues the corresponding control instruction. The instruction distribution module determines the source of the control instruction corresponding to the instruction tag based on the instruction tag in the first feedback information, thereby ensuring the accuracy of feedback information transmission in scenarios where two control APPs control IoT devices, thereby improving the user experience. On the other hand, after the first feedback information is sent to the control APP, the first feedback information is converted by the information conversion module to obtain the first standard feedback information, and the interface is displayed based on the first standard feedback information, thereby ensuring the consistency of the feedback information display and further improving the user experience.
[0209] B. Control IoT devices through the second control APP
[0210] The specific process of controlling IoT devices through the second control APP is similar to that of controlling IoT through the first control APP. The following mainly describes the differences between the process of controlling IoT through the first control APP. For the same or similarities, please refer to Figures 7 to 11 The embodiments shown will not be described in detail.
[0211] 1) Device registration phase
[0212] For example, Figure 12 This is a flow chart of the device registration phase in another example of the IoT device control method provided in the embodiment of this application. Figure 6 and Figure 12 In this embodiment, the IoT device control method includes:
[0213] S1201: A user performs a second login operation in the second APP account login window of the IoT device interface of the smart screen. In response to the user's second login operation, the second APP account login module obtains the second APP account information entered by the user. The second login operation may include entering the second APP account information, clicking the login control, etc. The second APP account information refers to the account information registered by the user in the second control APP.
[0214] S1202. The second APP account login module sends the acquired second APP account information to the registration instruction generation module.
[0215] S1203: The user performs a registration operation in the registration window of the IoT device interface of the smart screen. In response to the user's registration operation, the registration instruction generation module generates a device registration instruction based on the second APP account information. The device registration instruction includes the second APP account information. The registration operation may include entering the device account information of the IoT device and clicking the registration control. The device account information may include the device account and login password of the IoT device.
[0216] S1204: The registration instruction generation module sends the device registration instruction to the instruction distribution module.
[0217] S1205: The instruction distribution module parses the registration instruction generation module and distributes the device registration instruction to the device registration unit in the instruction processing service module according to the content of the registration instruction.
[0218] S1206. The device registration unit in the instruction processing service module reports the second APP account information to the second IoT platform according to the device registration instruction, and applies for the target family account information from the second IoT platform.
[0219] Family account information refers to the family or collective account information to which the app account belongs or is associated. App accounts within the same family account can share IoT devices. In other words, app accounts within the same family account can share IoT devices. Target family account information refers to the family account information associated with the second app account information.
[0220] S1207. The second IoT platform obtains the target family account information associated with the second APP account information based on the second APP account information.
[0221] Specifically, if the second APP account does not belong to any family account, the second IoT platform can create a target family account and link the second APP account to the target family account, that is, associate the second APP account information with the target family account information. If the second APP account belongs to a family account, the second IoT platform determines the family account information as the target family account information.
[0222] S1208. The second IoT platform returns the target family account information to the device registration unit in the instruction processing service module of the IoT device.
[0223] S1209. The device registration unit in the instruction processing service module of the IoT device sends the target family account information and registration information to the second access module.
[0224] S1210. The second access module sends the target family account information and the IoT device account information to the second IoT platform, and applies to the second IoT platform for registration information of the IoT device.
[0225] S1211. The second IoT platform generates registration information of the IoT device in response to the application of the second access module, and associates the registration information of the IoT device with the target family account information to facilitate verification during subsequent device registration.
[0226] The registration information of an IoT device may include the identity information of the registrant of the IoT device and the activation code of the IoT device.
[0227] S1212. The second IoT platform returns the generated registration information of the IoT device to the second access module of the IoT device.
[0228] S1213. The second access module of the IoT device sends the registration information of the IoT device and the second APP account information to the second IoT platform, requesting the second IoT platform to register the device.
[0229] S1214: The second IoT platform registers the device in response to the device registration application of the second access module.
[0230] Specifically, the second IoT platform can search for the family account information corresponding to the second APP account information, as well as the registration information associated with the family account information. The second IoT platform compares and verifies the registration information sent by the IoT device with the searched registration information. If the two are consistent, the second IoT platform binds the IoT device to the second APP account, that is, associates the device information of the IoT device with the second APP account information.
[0231] It should be noted that the process of the above-mentioned device registration stage is only an example. Depending on the type, function, etc. of the IoT device, the specific process of the device registration stage may be different. For example, if the IoT device does not have a display screen and an interactive interface, the device registration can be performed through the second control APP in the control terminal. The embodiments of this application do not impose any restrictions on this.
[0232] 2) Equipment information display stage
[0233] For example, Figure 13 This is a schematic diagram of the interface changes of a mobile phone when a user operates the second control APP provided in an embodiment of the present application. Continuing to use the second control APP as an example to illustrate. When the smart screen is bound to the second APP account and the second control APP in the mobile phone is logged in with the second APP account, when the user clicks Figure 13In the interface shown in (a), the mobile phone opens the second control APP in response to the user's click operation and displays the main interface of the second control APP, such as Figure 13 As shown in (b) in the figure. This interface includes a smart screen card 1301. The user clicks the smart screen card 1301 to enter the device control interface of the smart screen, as shown in Figure 13 As shown in (c) in .
[0234] In the above process, when the user clicks on the smart screen card 1301, the second control APP enters the device information display stage. In this embodiment, the specific process of the device information display stage is the same as Figure 9 The embodiment shown is similar, except that, in this embodiment, after the user clicks on the smart screen card in the second control APP, the second device information acquisition module in the second host APP responds to the user's operation of clicking the smart screen card, and obtains the second device information from the second IoT platform through the second device information acquisition interface. The second device information acquisition module sends the second device information to the second device information receiving module in the universal APP plug-in. The second device information receiving module sends the second device information to the information conversion module, and the information conversion module converts the second device information to obtain standard device information. Subsequent steps are the same as Figure 9 The steps in the illustrated embodiments are the same and will not be described again.
[0235] In this embodiment, the second device information receiving module in the universal app plug-in interfaces with the second device information acquisition module in the second host app, enabling IoT device information to be obtained from the second host app. Furthermore, the information conversion module in the universal app plug-in converts the device information obtained by the host app into standard device information, and displays the device control interface based on this standard device information. In this way, the universal app plug-in is adaptable and compatible with multiple host apps, achieving the unification and standardization of device information across different host apps. This allows for a unified device control interface presented to users by different control apps, improving the user experience.
[0236] 3) Instruction issuance stage
[0237] In one embodiment, when the user clicks Figure 13 When a control in (c) is activated, the second control APP enters the instruction issuing stage. Figure 13 Specifically, the user changes the input source of the smart screen from DTV to HDMI1 by operating the input source setting control 1302.
[0238] In this embodiment, the specific process of the instruction issuing stage is the same as Figure 10The embodiment shown is similar, except that, in this embodiment, after the user clicks the input source setting control on the device control interface, the instruction conversion module in the host proxy service converts the input source setting instruction into a second general instruction. The format of the second general instruction is different from that of the first general instruction. The instruction conversion module sends the second general instruction to the instruction marking module, and the instruction marking module marks the second general instruction to obtain a second general marking instruction. The instruction marking module sends the second general marking instruction to the second APP tool class. The second APP tool class sends the second general marking instruction to the second IoT platform through the second general instruction interface in the second host APP. The second IoT platform sends the second general marking instruction to the second access module of the IoT device through the second general user profile. The second access module of the IoT device sends the second general marking instruction to the instruction distribution module. The subsequent processing flow for the second general marking instruction is the same as Figure 10 The steps in the illustrated embodiments are the same and will not be described again.
[0239] In this embodiment, the instruction tagging module in the host proxy service can send the second general tag instruction to the second APP tool class corresponding to the second host APP loaded by the general APP plug-in. The second APP tool class can be connected to the second host APP and send the second general tag instruction to the second IoT platform through the second general instruction interface in the second host APP. The second IoT platform forwards the control instruction to the IoT device. In this way, the general APP plug-in is applicable to the second host APP. It can be seen that the general APP plug-in is compatible with both the first host APP and the second host APP, so that when controlling the same IoT device through two control APPs, only one set of APP plug-ins needs to be developed, reducing development and maintenance costs. On the other hand, the instruction conversion module in the host proxy service converts the instruction into a general instruction, so that the second APP tool class and the second host APP only need to connect to one type of instruction, without the need to design multiple interfaces. The second IoT platform also only needs to develop a general user profile, without the need to design multiple user profiles, thereby saving development and maintenance costs. This can greatly save development costs, especially for IoT devices with a large number of control instructions, such as smart screens and smart speakers.
[0240] 4) Data return phase
[0241] In this embodiment, the specific process of the instruction issuing stage is the same as Figure 11The embodiment shown is similar, except that, in this embodiment, the input source setting unit generates second feedback information and sends the second feedback information to the instruction distribution module. The instruction distribution module determines that the source of the control instruction corresponding to the instruction tag is the second access module based on the instruction tag in the second feedback information. The instruction distribution module returns the second feedback information to the second access module. The second access module sends the second feedback information to the second IoT platform. The second IoT platform sends the second feedback information to the second feedback information acquisition module of the host agent service through the second feedback information acquisition interface of the second host APP. The rest of the processing flow and the beneficial effects of this embodiment are the same as Figure 11 The embodiments shown are the same and will not be described again.
[0242] The following is an overall description of the IoT device control method provided in the embodiments of the present application in conjunction with the accompanying drawings.
[0243] For example, Figure 14 This is an example of an IoT device control method provided in the embodiment of the present application. In this embodiment, the execution subject of the method can be as follows Figure 3 and Figure 4 The electronic device shown. A control APP is installed in the electronic device, and the control APP includes a universal APP plug-in. The universal APP plug-in includes at least two first data interfaces, and the at least two first data interfaces are used to connect with at least two host APPs and send data to at least two host APPs. Among them, the control APP can be the first control APP or the second control APP in the above embodiment. The at least two host APPs may include the first host APP and the second host APP in the above embodiment. Optionally, in one embodiment, the first data interface may include the first APP tool class and the second APP tool class in the above embodiment. Of course, the first data interface may also be other modules or interfaces, which is not limited in this application.
[0244] like Figure 14 As shown, the method includes:
[0245] S1401. Receive control instructions through a general APP plug-in, where the control instructions are used to control IoT devices.
[0246] The control instruction may be, for example, one of the remote control instructions, input source setting instructions, sound setting instructions, image setting instructions, and the like in the above embodiments.
[0247] Optionally, the universal app plug-in can receive control commands input by the user through the device control interface, or the universal app plug-in can generate control commands within a relevant module. For example, the universal app plug-in can include a network monitoring module to monitor the network communication status of IoT devices. This network monitoring module can generate network check commands at a preset period, instructing the IoT device to check its network status and return the results.
[0248] S1402. The general APP plug-in converts the control instruction into a target instruction matching the first target interface according to the target host APP currently loaded by the general APP plug-in. The first target interface refers to the interface connected to the target host APP among the at least two first data interfaces.
[0249] In other words, the target host app refers to the host app currently loaded by the universal app plug-in. When the universal app plug-in is loaded into a first control app, the first control app becomes the target host app, and the first target interface becomes the interface of the at least two data interfaces that interfaces with the first control app. When the universal app plug-in is loaded into a second control app, the second control app becomes the target host app, and the first target interface becomes the interface of the at least two data interfaces that interfaces with the second control app.
[0250] Different host apps have different interfaces, and different interfaces match different data types, formats, standards, etc. The universal app plug-in converts the control instruction into a target instruction that matches the first target interface, so that the instruction can be sent to the target host app through the first target interface.
[0251] S1403: The general APP plug-in sends a target instruction to the target host APP through the first target interface.
[0252] Optionally, the target host APP may include a universal command interface, and the universal APP plug-in may send the target command to the universal command interface via the first target interface. Optionally, when the target host APP is the first host APP, the universal command interface may be the first universal command interface; when the target host APP is the second host APP, the universal command interface may be the second universal command interface.
[0253] S1404: Send target instructions to the IoT device through the target host APP.
[0254] Alternatively, the target host app can send the target command to the IoT device via its connected IoT platform. For example, if the target host app is the first host app in the above embodiment, the first host app sends the target command to the first IoT platform, which then forwards the target command to the IoT device.
[0255] In the IoT device control method provided in this embodiment, the universal APP plug-in includes at least two first data interfaces, can be connected to at least two host APPs, and can convert control instructions into instructions that match the corresponding interfaces of the host APPs. In other words, the universal APP plug-in and the method are compatible with at least two host APPs, and there is no need to develop application plug-ins for multiple host APPs separately, thereby reducing development and maintenance costs.
[0256] In one embodiment, in step S1402, converting the control instruction into a target instruction that matches the first target interface may include: the universal APP plug-in converting the control instruction according to a target format to obtain the target instruction, wherein the target format refers to a format that matches the first target interface.
[0257] As a possible implementation, the target format can be a universal format that matches the first target interface, and the target instruction can be a universal instruction. Optionally, when the target host app is the first host app, the universal instruction can be the first universal instruction; when the target host app is the second host app, the universal instruction can be the second universal instruction.
[0258] In one embodiment, the above-mentioned step of converting the control instruction into an instruction in the target format by the universal APP plug-in to obtain the target instruction may include: converting the control instruction into an instruction in the target format by the universal APP plug-in to obtain a converted instruction; marking the converted instruction by the universal APP plug-in to obtain the target instruction.
[0259] Optionally, when the target host APP is the above-mentioned first host APP, the conversion instruction may be the above-mentioned first general marking instruction; when the target host APP is the above-mentioned second host APP, the general instruction may be the above-mentioned second general marking instruction.
[0260] In one embodiment, the universal APP plug-in can generate a device control interface by the following method: obtaining interface information through the target host APP, where the interface information refers to the information required to display the device control interface; sending the interface information to the universal APP plug-in through the target host APP; converting the interface information through the universal APP plug-in to obtain standard interface information; and the universal APP plug-in displays the device control interface based on the standard interface information.
[0261] Optionally, the universal APP plug-in may include at least two second data interfaces, which are used to connect to at least two host APPs and obtain data from at least two host APPs. In this case, the target host APP can send interface information to the second target interface, and the second target interface refers to the interface in the second data interface that connects to the target host APP.
[0262] Optionally, the second data interface may include at least two device information interfaces and at least two feedback information interfaces. The at least two device information interfaces are used to connect with the at least two host APPs mentioned above and receive device information sent by the at least two host APPs mentioned above. The at least two feedback information interfaces are used to connect with the at least two host APPs mentioned above and receive feedback information sent by the at least two host APPs mentioned above. In the case where the at least two host APPs include the first host APP and the second host APP in the above embodiment, the device information interface may include the first device information receiving module and the second device information receiving module in the above embodiment, and the feedback information interface may include the first feedback information acquisition module and the second feedback information acquisition module in the above embodiment.
[0263] The interface information includes device information of the IoT device and / or feedback information from the IoT device. The second target interface may include a target device information interface and a target feedback information interface. The target device information interface refers to the interface of the at least two device information interfaces that interfaces with the target host app. The target feedback information interface refers to the interface of the at least two feedback information interfaces that interfaces with the target host app.
[0264] For example, Figure 15 This is another example of an IoT device control method provided in the embodiment of the present application. In this embodiment, the execution subject of the method can be an IoT device. Figure 15 As shown, the method includes:
[0265] S1501. Receive a target instruction from a target control APP, where the target control APP includes a universal APP plug-in, and the universal APP plug-in includes at least two first data interfaces, where the first data interface is used to connect with at least two host APPs and send data to at least two host APPs; the target instruction is an instruction that matches the first target interface, where the first target interface refers to an interface among the at least two first data interfaces that connects with the target host APP, and the target host APP refers to the host APP currently loaded by the universal APP plug-in.
[0266] The target control APP refers to the control APP that can control at least two control APPs of IoT devices and send the above target instructions to the IoT device. The target control APP includes the above general APP plug-in, which can achieve Figure 14 The method in the embodiment shown.
[0267] S1502: Execute the target instruction.
[0268] S1503: Generate feedback data according to the target instruction.
[0269] The feedback data is data generated by the IoT device based on the target instruction. It can be the result of executing the target instruction, or related information and data obtained based on the target instruction. The feedback instruction uniquely corresponds to the target instruction. Optionally, when the target host app is the first host app and the target instruction is the first general-purpose tag instruction, the feedback data can be the first feedback data; when the target host app is the second host app and the target instruction is the second general-purpose tag instruction, the feedback data can be the second feedback data.
[0270] The process of IoT executing target instructions and generating feedback data can be seen in the above Figures 5 to 12 The relevant embodiments will not be described in detail here.
[0271] S1504: Send feedback data to the target control APP.
[0272] It can be understood that when multiple control apps are able to control IoT devices, the IoT device returns feedback data corresponding to the target instruction to the control app that sends the target instruction, thereby achieving accurate communication with the control app, avoiding communication confusion, and improving communication accuracy.
[0273] Optionally, the control instruction sent by the control APP to the IoT device may include an instruction tag. Among them, the target instruction may have a first instruction tag, which is used to characterize the unique identity of the target instruction, and the feedback instruction may also include the first instruction tag. When the IoT receives the control instruction, it can record the correspondence between the instruction tag in the control instruction and the control APP that sent the control instruction. When returning the feedback data, the IoT can determine the control APP that sent the control instruction corresponding to the feedback data based on the instruction tag in the feedback data. In this embodiment, the IoT device can send the feedback data to the control APP that sent the target instruction, that is, the target control APP, based on the above-mentioned correspondence and the first instruction tag.
[0274] In one embodiment, an IoT device includes at least two access modules, each configured to communicate with at least two control apps in a one-to-one correspondence. Optionally, the at least two access modules can be connected to at least two IoT platforms in a one-to-one relationship, and the at least two IoT platforms can be connected to at least two control apps, thereby enabling communication between the IoT device and the at least two control apps. Optionally, the at least two access modules can include the first access module and the second access module described in the above embodiment.
[0275] The correspondence between the above-mentioned instruction tag and the control APP can also be the correspondence between the control instruction and the access module. The above-mentioned step S1501, receiving the target instruction from the target control APP, can include: receiving the target instruction from the target control APP through the target access module, where the target access module refers to the module used to communicate with the target control APP among at least two access modules; then the IoT device can determine that the access module corresponding to the first instruction tag is the target access module based on the correspondence between the instruction tag and the control APP, that is, based on the correspondence between the control instruction and the access module, and send feedback information to the target control APP through the target access module.
[0276] The specific process and beneficial effects of the IoT device control method provided in this embodiment can be referred to above. Figures 5 to 12 The embodiments shown will not be described in detail here.
[0277] The above describes in detail an example of the IoT device control method provided in the embodiment of the present application. It is understandable that in order to realize the above functions, the electronic device or IoT device or IoT system includes hardware and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of the present application.
[0278] The embodiment of the present application can divide the functional modules of the electronic device according to the above method example. For example, each function can be divided into various functional modules, such as a detection unit, a processing unit, a display unit, etc., or two or more functions can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0279] It should be noted that all relevant contents of each step involved in the above method embodiment can be referred to the functional description of the corresponding functional module and will not be repeated here.
[0280] The electronic device provided in this embodiment is used to execute the process steps related to controlling the terminal in the above-mentioned IoT device control method, and thus can achieve the same effect as the above-mentioned implementation method.
[0281] When integrated, the electronic device may also include a processing module, a storage module, and a communication module. The processing module may be used to control and manage the operation of the electronic device. The storage module may be used to support the execution of program code and data stored in the electronic device. The communication module may be used to support communication between the electronic device and other devices.
[0282] The processing module may be a processor or a controller. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, and so on. The storage module may be a memory. The communication module may specifically be a device that interacts with other electronic devices, such as a radio frequency circuit, a Bluetooth chip, or a Wi-Fi chip.
[0283] In one embodiment, when the processing module is a processor and the storage module is a memory, the electronic device involved in this embodiment may be a Figure 3 Device with the structure shown.
[0284] The present application also provides an IoT device comprising a processing module, a storage module, and a communication module. The IoT device is configured to execute the relevant process steps of the IoT device in the above embodiment, thereby achieving the same effect as the above implementation method.
[0285] The present application also provides an IoT device, which includes an electronic device and an IoT device. The electronic device is used to execute the process steps related to the control terminal in the above-mentioned IoT device control method, and the IoT device is used to execute the process steps related to the IoT device in the above-mentioned embodiment.
[0286] Optionally, the IoT system may further include a server, which is used to execute relevant process steps of the first IoT platform in the first cloud server or the second IoT platform in the second cloud server in the above embodiment.
[0287] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the IoT device control method of any of the above embodiments.
[0288] An embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the IoT device control method in the above-mentioned embodiment.
[0289] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the IoT device control method in the above-mentioned method embodiments.
[0290] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0291] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0292] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0293] Units described as separate components may or may not be physically separate, and components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0294] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0295] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, which is stored in a storage medium and includes several instructions for enabling a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0296] The above content is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for controlling an IoT device, the method being executed by an electronic device, characterized in that: The electronic device is installed with a control application for controlling an IoT device, the control application includes a universal plug-in, the universal plug-in includes at least two first data interfaces, the at least two first data interfaces are used to connect to at least two host applications and send data to the at least two host applications, and the method includes: Receive a control instruction through the universal plug-in, where the control instruction is used to control the IoT device; The universal plug-in converts the control instruction according to a target format to obtain a target instruction, wherein the target format is a format that matches a first target interface, the first target interface is an interface of the at least two first data interfaces that interfaces with a target host application, and the target host application is a host application currently loaded by the universal plug-in; The universal plug-in sends the target instruction to the target host application through the first target interface; The target host application sends the target instruction to the IoT device through a first IoT platform, where the first IoT platform is an IoT platform that is connected to the target host application.
2. The method according to claim 1, characterized in that The target instruction is a general instruction, and the target format is a general format matching the first target interface.
3. The method according to claim 2, characterized in that The first target interface includes a target application tool class, the target host application includes a general instruction interface, the target application tool class is connected to the general instruction interface, and the general plug-in sends the target instruction to the target host application through the first target interface, including: The general plug-in sends the target instruction to the general instruction interface through the target application tool class.
4. The method according to any one of claims 1 to 3, characterized in that The universal plug-in converts the control instruction according to the target format to obtain the target instruction, including: Converting the control instruction into an instruction in the target format by the universal plug-in to obtain a conversion instruction; The conversion instruction is marked by the general plug-in to obtain the target instruction.
5. The method according to any one of claims 1 to 4, characterized in that The receiving of the control instruction through the universal plug-in includes: The universal plug-in receives the control instruction input by the user through the device control interface, where the device control interface refers to a display interface for controlling the IoT device.
6. The method according to claim 5, characterized in that Before the universal plug-in receives the control instruction input by the user through the device control interface, the method further includes: Acquire interface information through the target host application, where the interface information refers to information required to display the device control interface; Sending the interface information to the universal plug-in through the target host application; Convert the interface information through the universal plug-in to obtain standard interface information; The universal plug-in displays the device control interface based on the standard interface information.
7. The method according to claim 6, characterized in that The universal plug-in further includes at least two second data interfaces, where the second data interfaces are used to interface with the at least two host applications and obtain data from the at least two host applications. The sending of the interface information to the universal plug-in through the target host application includes: The interface information is sent to a second target interface through the target host application, where the second target interface refers to an interface in the second data interface that is connected to the target host application.
8. The method according to claim 7, characterized in that The interface information includes device information of the IoT device and / or feedback information from the IoT device, the second target interface includes a target device information interface and a target feedback information interface, and sending the interface information to the second target interface through the target host application includes: Sending the device information to the target device information interface through the target host application; and / or, The feedback information is sent to the target feedback information interface through the target host application.
9. A method for controlling an IoT device, the method being executed by an IoT device, characterized in that: The method comprises: Receive, through a first IoT platform, a target instruction from a target control application, the target control application including a universal plug-in, the universal plug-in including at least two first data interfaces, the first data interfaces being used to interface with at least two host applications and send data to the at least two host applications; the target instruction is obtained by converting a control instruction according to a target format, the target format being an instruction matching a first target interface, the first target interface being an interface of the at least two first data interfaces that interfaces with a target host application, the target host application being a host application currently loaded by the universal plug-in, the control instruction being used to control the IoT device, and the first IoT platform being an IoT platform interfaced with the target host application; Execute the target instruction.
10. The method according to claim 9, characterized in that The method further comprises: generating feedback data according to the target instruction; The feedback data is sent to the target control application.
11. The method according to claim 10, characterized in that The feedback information includes a first instruction tag of the target instruction, where the first instruction tag is used to represent a unique identity of the target instruction. The sending the feedback data to the target control application includes: Obtain the correspondence between the instruction tag and the control application; The feedback data is sent to the target control application according to the first instruction tag and the corresponding relationship.
12. The method according to claim 11, characterized in that The target instruction includes the first instruction tag, and the IoT device includes at least two access modules, and the at least two access modules are used to communicate with at least two control applications in a one-to-one correspondence; Receiving a target instruction from a target control application through the first IoT platform includes: Receiving the target instruction from the first IoT platform through a target access module, where the target instruction of the first IoT platform comes from the target control application, and the target access module refers to a module among the at least two access modules for communicating with the target control application; The sending the feedback data to the target control application according to the first instruction tag and the corresponding relationship includes: Determining the target access module corresponding to the first instruction mark according to the corresponding relationship; The feedback information is sent to the target control application through the target access module.
13. An IoT system, characterized in that: The device comprises an electronic device and an IoT device, wherein the electronic device is used to execute the method according to any one of claims 1 to 8, and the IoT device is used to execute the method according to any one of claims 9 to 12.
14. An electronic device, characterized in that: include: processors, memory, and interfaces; The processor, memory, and interface cooperate with each other so that the electronic device executes the method according to any one of claims 1 to 8.
15. An IoT device, characterized in that: processors, memory, and interfaces; The processor, memory, and interface cooperate with each other so that the IoT device executes the method according to any one of claims 9 to 12.
16. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor is caused to execute the method according to any one of claims 1 to 8, or execute the method according to any one of claims 9 to 12.
17. A computer program product, characterized in that The computer program product comprises: a computer program code, and when the computer program code is run on an electronic device, the electronic device executes the method according to any one of claims 1 to 8, or executes the method according to any one of claims 9 to 12.
Citation Information
Patent Citations
Intelligent device control method and mobile terminal
CN108958074A
Application program and the service plug-in use method thereof
CN108958842A
Plug-in transformation method and device of application, electronic equipment and storage medium
CN113032039A