Intelligent control method, device and equipment of internet of things device and storage medium
By running a first operating system and a second operating system with a shared kernel in the control terminal, and by utilizing inter-process communication mechanisms and smart gateway programs, the problem of adaptability to diverse applications of IoT devices is solved, enabling the normal operation of various applications and the flexibility of device control.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN OURUIBO ELECTRONICS
- Filing Date
- 2022-12-29
- Publication Date
- 2026-05-12
AI Technical Summary
物联网设备由于多样化的应用程序导致适配性问题,影响使用效果。
By running a first operating system and a second operating system with a shared kernel in the control terminal, and utilizing inter-process communication mechanisms and smart gateway programs, control of target IoT devices can be achieved.
It improves the adaptability of the control terminal to various applications, ensures the normal operation of the device control interface and smart gateway program, and enhances the flexibility and compatibility of device control.
Smart Images

Figure CN116319905B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of Internet of Things (IoT) technology, and in particular to an intelligent control method, apparatus, device, and storage medium for IoT devices. Background Technology
[0002] With the development of computer technology, the Internet of Things (IoT) technology has emerged, in which the operating system plays a crucial role. Traditionally, IoT devices typically use a single operating system to run programs. However, due to the diversity of IoT devices, various applications control them, and incompatibility between these applications often hinders the usability of the IoT devices. Summary of the Invention
[0003] Therefore, it is necessary to provide an intelligent control method, device, computer equipment, computer-readable storage medium, and computer program product for Internet of Things (IoT) devices to address the aforementioned technical problems.
[0004] In a first aspect, this application provides an intelligent control method for an Internet of Things (IoT) device, applied to a control terminal, wherein the control terminal is compatible with a first operating system and a second operating system running with a shared kernel; the method includes:
[0005] In response to a trigger operation on the device control interface in the first operating system, control information for the target IoT device is generated;
[0006] Based on the inter-process communication mechanism, control information is sent to the smart gateway program running on the second operating system;
[0007] The target IoT device is controlled by a smart gateway program based on control information.
[0008] In some embodiments, the step of generating control information for a target IoT device in response to a trigger operation on a device control interface in a first operating system includes at least one of the following:
[0009] In response to a trigger operation on the device control interface of a device control program running in the first operating system, control information for the target IoT device is generated.
[0010] In response to a trigger operation on the native device control interface in the first operating system, control information for the target IoT device is generated; wherein, the native device control interface is the device control interface presented by the control terminal based on the first operating system.
[0011] In some embodiments, the first operating system and the second operating system each have corresponding environment variables set; the runtime environment of the first operating system is generated by loading the first environment variables of the first operating system by the first loader; the runtime environment of the second operating system is generated by loading the second environment variables corresponding to the second operating system by the second loader.
[0012] In some embodiments, before generating control information for a target IoT device in response to a trigger operation on a device control interface in a first operating system, the method further includes:
[0013] The first environment variable is loaded by the first loader, and the first runtime environment corresponding to the first operating system is generated.
[0014] Before sending control information to the smart gateway program running on the second operating system based on inter-process communication mechanisms, the method also includes:
[0015] The target process is started, the first environment variable that has been loaded is removed through the target process, and the second environment variable is loaded through the second loader to generate the second runtime environment corresponding to the second operating system, and the smart gateway program is run in the second runtime environment.
[0016] In some embodiments, the shared kernel is the kernel of a first operating system; the steps of controlling the target IoT device through a smart gateway program based on control information specifically include:
[0017] The smart gateway program calls the kernel of the first operating system to output control commands using the target hardware resources in the control terminal.
[0018] The target hardware resources are hardware resources configured for the second operating system and matched with the control information; the control instructions are used to instruct the target IoT device to perform processing corresponding to the control information.
[0019] In some embodiments, the second operating system is obtained by adding a second environment variable of the second operating system to the kernel of the first operating system; the method further includes:
[0020] The hardware resources in the control terminal are allocated to the first operating system and the second operating system, and the access permissions of the first operating system to access the hardware resources allocated to the second operating system are disabled.
[0021] In some embodiments, the first environment variable corresponding to the first operating system is stored in the first storage area; the second environment variable corresponding to the second operating system is stored in the second storage area.
[0022] Secondly, this application also provides an intelligent control device for an Internet of Things (IoT) device, applied to a control terminal, wherein the control terminal is compatible with a first operating system and a second operating system sharing a common kernel, and the device includes:
[0023] The generation module is used to generate control information for the target IoT device in response to a trigger operation on the device control interface in the first operating system.
[0024] The sending module is used to send control information to the smart gateway program running on the second operating system based on the inter-process communication mechanism.
[0025] The control module is used to control the target IoT device based on control information through the smart gateway program.
[0026] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.
[0027] Fourthly, this application also provides a computer-readable storage medium. This computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.
[0028] Fifthly, this application also provides a computer program product. This computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described method.
[0029] The aforementioned intelligent control method, apparatus, computer device, computer-readable storage medium, and computer program product for IoT devices, in response to a trigger operation on the device control interface in a first operating system, generate control information for the target IoT device; based on an inter-process communication mechanism, send the control information to an intelligent gateway program running on a second operating system; and control the target IoT device through the intelligent gateway program based on the control information. By enabling the control terminal to run both a first operating system and a second operating system with a shared kernel, displaying the device control interface in the first operating system, running the intelligent gateway program in the second operating system, and controlling the target IoT device through the intelligent gateway program, the control terminal can run multiple applications, improving the control terminal's adaptability to applications. Attached Figure Description
[0030] Figure 1 This is an application environment diagram of an intelligent control method for an Internet of Things (IoT) device in one embodiment.
[0031] Figure 2 This is a flowchart illustrating an intelligent control method for an IoT device in one embodiment;
[0032] Figure 3 This is a flowchart illustrating an intelligent control method for an IoT device in another embodiment;
[0033] Figure 4 This is a flowchart illustrating an intelligent control method for an IoT device in one embodiment.
[0034] Figure 5 This is a structural block diagram of the intelligent control device for an Internet of Things (IoT) device in one embodiment.
[0035] Figure 6 Here is a structural block diagram of the generation module 501 in one embodiment;
[0036] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0037] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0038] The intelligent control method for IoT devices provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the control terminal 101 is compatible with a first operating system 1012 and a second operating system 1013 that share a common kernel 1011. The control terminal 101 refers to a terminal with control functions that controls the target IoT device 102 by generating control information.
[0039] The kernel is the core program inside the operating system. It provides external interfaces and services for requesting and managing computer system resources, and has full access to hardware resources. The memory space in which the kernel runs is called kernel space. Programs outside kernel space are called applications, and the memory space in which applications run is called user space. The kernel and applications together constitute the operating system. Applications running in user space can only see the system resources they are allowed to use, and cannot use certain specific system functions, nor can they directly access kernel space and hardware resources.
[0040] It is understandable that because the first operating system 1012 and the second operating system 1013 in the control terminal 101 share the same kernel 1011, applications adapted to the first operating system 1012 and applications adapted to the second operating system 1013 can be run in the operation terminal 101.
[0041] For example, in response to a trigger operation on the device control interface in the first operating system 1012, the control terminal 101 generates control information for the target IoT device 102. Based on an inter-process communication mechanism, the control terminal 101 sends the control information to a smart gateway program running on the second operating system 1013. The control terminal 101 then controls the target IoT device 102 through the smart gateway program based on the control information.
[0042] In one embodiment, such as Figure 2 As shown, an intelligent control method for an Internet of Things (IoT) device is provided, which can be applied to... Figure 1 Taking the control terminal 101 as an example, the following steps are included:
[0043] Step 201: In response to a trigger operation on the device control interface in the first operating system, generate control information for the target IoT device.
[0044] The first operating system is used to display the device control interface. Specifically, it displays the device control interface to the user, captures user actions on the interface, and generates operation data. The first operating system includes, but is not limited to, any one of the following: Linux, Android, or macOS.
[0045] Control information is used to instruct target IoT devices to change their operating state. For example, if the IoT device is a smart air conditioner, and the triggering operation is clicking on the device's control interface and setting the air conditioner to cool to 26 degrees Celsius, then the generated control information will instruct the smart air conditioner to change its operating state to cool to 26 degrees Celsius. Or, if the IoT device is a smart central control switch, triggering the smart central control switch's control interface will control devices linked to the smart central control switch, such as air conditioners or electric curtains, to adjust their states.
[0046] For example, when a user performs a trigger operation on the device control interface of the control terminal, the control terminal responds to the user's trigger operation on the device control interface in the first operating system and generates control information for the target IoT device.
[0047] Step 202: Based on the inter-process communication mechanism, send the control information to the smart gateway program running on the second operating system.
[0048] Inter-process communication (IPC) refers to the mechanism by which two processes exchange data. In essence, a first operating system and a second operating system sharing a kernel use IPC to enable communication between applications adapted to the first operating system and applications adapted to the second operating system.
[0049] A smart gateway program is a program with protocol conversion capabilities, which converts the protocols of different sensing networks to the access network, encapsulates the lower-layer standard format data in a unified manner, ensures that the protocols of different sensing networks can be transformed into unified data and signaling, and parses the data packets sent down from the upper layer into signaling that can be recognized by the sensing layer protocol.
[0050] For example, some IoT devices support protocols such as Bluetooth, LoRa, Wi-Fi, and ZigBee, but lack the ability to directly access the network and cannot directly connect to the IoT platform. Therefore, they need to first connect to the control terminal via Bluetooth, LoRa, Wi-Fi, or ZigBee, and then establish a connection with the IoT platform through the smart gateway program in the control terminal. Furthermore, when the control terminal needs to control the IoT device, it sends control information to the IoT device through the smart gateway program, enabling the IoT device to recognize the control information.
[0051] The second operating system is used to run the smart gateway program, enabling control of IoT devices that support different protocols. The second operating system includes, but is not limited to, any of the following: Linux, Android, and macOS. It can be understood that the first and second operating systems are different operating systems; therefore, running both operating systems on the control terminal allows the control terminal to run a variety of applications.
[0052] Step 203: Control the target IoT device based on control information through the smart gateway program.
[0053] For example, the smart gateway program in the control terminal converts control information into control commands that the target IoT device can recognize, and controls the target IoT device through the recognizable control commands to change the operating state of the target IoT device.
[0054] In the above-mentioned intelligent control method for IoT devices, by running a first operating system and a second operating system with a shared kernel on the control terminal, displaying the device control interface in the first operating system, running a smart gateway program in the second operating system, and controlling the target IoT device through the smart gateway program, the control terminal can run a variety of applications, thus improving the adaptability of the control terminal to applications.
[0055] In some embodiments, the step of generating control information for a target IoT device in response to a trigger operation on a device control interface in a first operating system includes at least one of the following: generating control information for a target IoT device in response to a trigger operation on a device control interface of a device control program running in the first operating system; or generating control information for a target IoT device in response to a trigger operation on a native device control interface in the first operating system.
[0056] The native device control interface is the device control interface presented by the control terminal based on the first operating system. That is, the control interface is formed by calling the built-in controls of the control terminal, which is different from the control interface of third-party APP in the control terminal. For example, the system settings interface built into the IoT device is a native device control interface.
[0057] The control interface of a device control program refers to the control interface of a third-party APP (Application) installed on the control terminal, that is, a control interface that does not call the control terminal's built-in controls. For example, the control interface of various shopping apps that can be installed on smartphones.
[0058] It should be noted that both the application that generates the control interface for a third-party app and the application that generates the native device control interface are compatible with the first operating system.
[0059] In some embodiments, the step of generating control information for a target IoT device in response to a trigger operation on the device control interface of a device control program running in the first operating system includes: a user clicking on the market display interface of the device control program to enter the device control interface of the device control program, and then triggering the device control interface of the device control program; the control terminal generating control information for the target IoT device in response to the user's trigger operation on the device control interface of the device control program running in the first operating system. Here, the market display interface refers to the display interface before the device control program is started, i.e., the interface presented to the user when the third-party APP is not opened. It can be understood that the device control program runs in the first operating system and requires a trigger operation on the native device control interface of the control terminal to enter the device control interface of the device control program.
[0060] In some embodiments, the step of generating control information for a target IoT device in response to a trigger operation on the native device control interface in the first operating system includes: the user triggers the native device control interface in the first operating system, and the control terminal directly generates control information for the target IoT device in response to the trigger operation on the native device control interface in the first operating system, that is, directly controls the target IoT device through the native device control interface.
[0061] In the above embodiments, control information is generated by triggering the native device control interface or the device control interface of the device control program in the first operating system, which facilitates the control of the target IoT device.
[0062] In some embodiments, the first operating system and the second operating system each have corresponding environment variables set; the runtime environment of the first operating system is generated by loading the first environment variables of the first operating system by the first loader; the runtime environment of the second operating system is generated by loading the second environment variables corresponding to the second operating system by the second loader.
[0063] The first environment variable is a set of parameters used to specify the runtime environment of the first operating system. It can be understood that by loading the first environment variable to generate the runtime environment of the first operating system, applications adapted to the first operating system can run on the control terminal.
[0064] The second environment variable is a set of parameters used to specify the runtime environment of a second operating system. It can be understood that by loading the second environment variable to generate the runtime environment of the second operating system, applications adapted to the second operating system can be run in the control terminal.
[0065] In the above embodiments, by defining environment variables corresponding to the first operating system and the second operating system respectively, the application can automatically load the corresponding system resources according to the application's own environment variables when it runs.
[0066] In some embodiments, before generating control information for a target IoT device in response to a trigger operation on a device control interface in a first operating system, the method further includes: loading a first environment variable through a first loader to generate a first runtime environment corresponding to the first operating system; before sending the control information to a smart gateway program running on a second operating system based on an inter-process communication mechanism, the method further includes: starting a target process, removing the loaded first environment variable through the target process, and loading a second environment variable through a second loader to generate a second runtime environment corresponding to the second operating system, and running the smart gateway program in the second runtime environment.
[0067] It is understandable that, since the application generating the device control interface runs on the first operating system, the first environment variables need to be loaded via the first loader to generate the first runtime environment corresponding to the first operating system, so that the device control interface can be displayed correctly. Furthermore, since the first and second operating systems share the same kernel, when the second operating system calls the shared kernel, the target process needs to be started to remove the loaded first environment variables, allowing the shared kernel to be called by the second operating system. Before sending control information to the smart gateway program, the second environment variables are loaded via the second loader to generate the second runtime environment corresponding to the second operating system, and the smart gateway program runs in the second runtime environment.
[0068] In the above embodiments, the corresponding environment variables are loaded by the loader corresponding to different operating systems, so that the control terminal can be compatible with two operating environments.
[0069] In some embodiments, the shared kernel is the kernel of the first operating system; the step of controlling the target IoT device based on control information through the smart gateway program specifically includes: calling the kernel of the first operating system through the smart gateway program to output control instructions using the target hardware resources in the control terminal; wherein, the target hardware resources are hardware resources configured for the second operating system and matched with the control information; the control instructions are used to instruct the target IoT device to perform processing corresponding to the control information.
[0070] It is understood that since the first and second operating systems run on the control terminal, they share the control terminal's hardware resources and the kernel of the first operating system. Therefore, the access permissions for the control terminal's hardware resources are managed by the shared kernel. When either the first or second operating system needs to use hardware resources, it must call the kernel of the first operating system to obtain the necessary access permissions before it can use the hardware resources.
[0071] The target hardware resource is at least one of the hardware resources that the second operating system has the right to access.
[0072] For example, the control terminal obtains access to the hardware resources of the second operating system by calling the kernel of the first operating system through the smart gateway program. It then uses the hardware resources configured by the second operating system that match the control information to output control commands. The target IoT device performs processing corresponding to the control information according to the control commands, such as changing its operating state according to the control commands.
[0073] In the above embodiments, control commands are output by calling the target hardware resources to ensure that control over the target IoT device is executed. In some embodiments, the second operating system is obtained by adding a second environment variable of the second operating system based on the kernel of the first operating system; the method further includes: allocating hardware resources in the control terminal to the first operating system and the second operating system, and disabling the first operating system's access rights to the hardware resources allocated to the second operating system.
[0074] It is understandable that, since both the first and second operating systems share the hardware resources of the control terminal, in order to prevent conflicts between the hardware resources accessed by the first and second operating system environments, it is necessary to allocate access permissions for the hardware resources of the control terminal.
[0075] In the above embodiments, by allocating access permissions to the hardware resources of the control terminal, conflicts between the first operating system and the second operating system when accessing hardware resources are avoided, thus ensuring the normal operation of the control terminal.
[0076] In some embodiments, the first environment variable corresponding to the first operating system is stored in the first storage area; the second environment variable corresponding to the second operating system is stored in the second storage area.
[0077] In some embodiments, such as Figure 3 The diagram illustrates a flowchart of an intelligent control method for an Internet of Things (IoT) device, applied to a control terminal. The control terminal is compatible with a first operating system and a second operating system sharing a common kernel. Taking Android as the first operating system and Linux as the second operating system as an example, the method includes the following steps:
[0078] Step 301: Store the first environment variable corresponding to the first operating system in the first storage area; store the second environment variable corresponding to the second operating system in the second storage area.
[0079] For example, a first storage area and a second storage area are created in the control terminal. The first storage area is defined as the / system partition, which is used to store the first environment variables of the Android system; the second storage area is defined as the / oem partition, which is used to store the second environment variables of the Linux system.
[0080] Step 302: Allocate the hardware resources in the control terminal to the first operating system and the second operating system, and for the hardware resources allocated to the second operating system, disable the first operating system's access permissions for the hardware resources allocated to the second operating system.
[0081] For example, the access permissions for screen display resources in the control terminal are assigned to the Android system, and the access permissions for the WiFi interface, BT (Bluetooth) interface, and Audio interface are assigned to the Linux system. At the same time, the access permissions for the WiFi interface, BT (Bluetooth) interface, and Audio interface of the Android system need to be turned off.
[0082] Step 303: Load the first environment variables of the first operating system through the first loader to generate the runtime environment of the first operating system.
[0083] For example, the first environment variable of the Android system is loaded from the first storage area / system partition through the first loader of the Android system / system / bin / linker64, that is, the library resource files under / system / lib in the / system partition are loaded.
[0084] Step 304: In response to the trigger operation of the native device control interface in the first operating system, generate control information for the target IoT device; wherein, the native device control interface is the device control interface presented by the control terminal based on the first operating system.
[0085] In some embodiments, control information for the target IoT device may be generated in response to a trigger operation on the device control interface of a device control program running in the first operating system.
[0086] Step 305: Start the target process, remove the loaded first environment variable through the target process, and load the second environment variable through the second loader to generate the second runtime environment corresponding to the second operating system, and run the smart gateway program in the second runtime environment.
[0087] For example, the target process is started, the first environment variable of the loaded Android system is removed by the target process, and the second environment variable is loaded from the second storage area / oem partition through the second loader of the Linux system / lib / ld-linux-aarch64.so, that is, the library resource files under / oem / lib in the / oem partition are loaded, a second runtime environment corresponding to the Linux operating system is generated, and the smart gateway program is run in the second runtime environment.
[0088] Step 306: Based on the inter-process communication mechanism, send control information to the smart gateway program running on the second operating system.
[0089] Step 307: Through the smart gateway program, call the kernel of the first operating system to output control commands using the target hardware resources in the control terminal; wherein, the target hardware resources are hardware resources configured for the second operating system and matched with the control information; the control commands are used to instruct the target IoT device to perform processing corresponding to the control information.
[0090] In some embodiments, such as Figure 4 The diagram illustrates a flowchart of an intelligent control method for IoT devices. The control terminal is compatible with both Android and Linux systems running on a shared kernel. An Android app also runs on the control terminal. Taking the trigger operation of turning on a light as an example, the method includes the following steps:
[0091] Step 401: The user turns on the lights using the device control interface of the Android APP running on the Android system in the control terminal.
[0092] Step 402: The control terminal responds to the light-on operation on the device control interface of the Android APP and generates control information for the target IoT device.
[0093] Step 403: The control terminal sends control information to the smart gateway program running on the Linux system based on the inter-process communication mechanism.
[0094] Step 404: The control terminal calls the kernel of the Android system through the smart gateway program to use the target hardware resources in the control terminal to turn on the light.
[0095] In the above-mentioned intelligent control method for IoT devices, by running Android and Linux operating systems with a shared kernel on the control terminal, displaying the device control interface in the Android operating system, running the smart gateway program in the Linux operating system, and controlling the target IoT device through the smart gateway program, the control terminal can run Linux and Android applications, thereby improving the compatibility of the control terminal with applications.
[0096] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0097] Based on the same inventive concept, this application also provides an intelligent control device for implementing the intelligent control method for IoT devices described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the intelligent control device for IoT devices provided below can be found in the limitations of the intelligent control method for IoT devices described above, and will not be repeated here.
[0098] In one embodiment, such as Figure 5 As shown, an intelligent control device for an Internet of Things (IoT) device is provided, applied to a control terminal. The control terminal is compatible with a first operating system and a second operating system that share a common kernel. The device includes: a generation module 501, a transmission module 502, and a control module 503, wherein:
[0099] The generation module 501 is used to generate control information for the target IoT device in response to a trigger operation on the device control interface in the first operating system.
[0100] The sending module 502 is used to send control information to the smart gateway program running on the second operating system based on the inter-process communication mechanism.
[0101] The control module 503 is used to control the target IoT device based on control information through the smart gateway program.
[0102] In some embodiments, such as Figure 6 As shown, the generation module 501 includes a first generation unit 501a and a second generation unit 501b, wherein:
[0103] The first generation unit 501a is used to generate control information for the target IoT device in response to a trigger operation on the device control interface of the device control program running in the first operating system.
[0104] The second generation unit 501b is used to generate control information for the target IoT device in response to a trigger operation on the native device control interface in the first operating system; wherein, the native device control interface is the device control interface presented by the control terminal based on the first operating system.
[0105] In some embodiments, the generation module 501 is further configured to load the first environment variable through the first loader to generate a first runtime environment corresponding to the first operating system; start the target process, remove the loaded first environment variable through the target process, and load the second environment variable through the second loader to generate a second runtime environment corresponding to the second operating system, and run the smart gateway program in the second runtime environment.
[0106] In some embodiments, the common kernel is the kernel of the first operating system; the control module 503 is used to call the kernel of the first operating system through the smart gateway program to output control instructions using the target hardware resources in the control terminal; wherein, the target hardware resources are hardware resources configured for the second operating system and matched with the control information; the control instructions are used to instruct the target IoT device to perform processing corresponding to the control information.
[0107] In some embodiments, the second operating system is obtained by adding a second environment variable of the second operating system to the kernel of the first operating system; the generation module 501 is also used to allocate hardware resources in the control terminal to the first operating system and the second operating system, and to disable the first operating system's access permission to call the hardware resources allocated to the second operating system for the hardware resources allocated to the second operating system.
[0108] The various modules in the intelligent control device of the aforementioned Internet of Things (IoT) device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0109] In one embodiment, a computer device is provided, which may be a control terminal, and its internal structure diagram may be as follows: Figure 7As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a smart control method for Internet of Things (IoT) devices. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0110] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0111] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0112] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0113] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0114] It should be noted that the control information (including but not limited to control device information, control personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data that have been authorized by the control or have been fully authorized by the parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0115] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0116] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0117] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A smart control method for an Internet of Things (IoT) device, characterized in that, The method is applied to a control terminal, wherein the control terminal is compatible with a first operating system and a second operating system that share a common kernel, wherein the second operating system is based on the kernel of the first operating system and a second environment variable of the second operating system is added; the method includes: In response to a trigger operation on the device control interface in the first operating system, control information for the target IoT device is generated; Based on the inter-process communication mechanism, the control information is sent to the smart gateway program running on the second operating system; The target IoT device is controlled by the smart gateway program based on the control information; The hardware resources in the control terminal are allocated to the first operating system and the second operating system, and the access rights of the first operating system to access the hardware resources allocated to the second operating system are closed for the hardware resources allocated to the second operating system. The shared kernel is the kernel of the first operating system; the step of controlling the target IoT device based on the control information through the smart gateway program specifically includes: calling the kernel of the first operating system through the smart gateway program to output control instructions using the target hardware resources in the control terminal; wherein, the target hardware resources are hardware resources configured for the second operating system and matched with the control information; the control instructions are used to instruct the target IoT device to perform processing corresponding to the control information.
2. The method according to claim 1, characterized in that, The step of generating control information for a target IoT device in response to a trigger operation on a device control interface in a first operating system includes at least one of the following: In response to a trigger operation on the device control interface of the device control program running in the first operating system, control information for the target IoT device is generated; In response to a trigger operation on the native device control interface in the first operating system, control information for the target IoT device is generated; wherein, the native device control interface is the device control interface presented by the control terminal based on the first operating system.
3. The method according to claim 1, characterized in that, The first operating system and the second operating system each have corresponding environment variables set; the runtime environment of the first operating system is generated by loading the first environment variables of the first operating system by the first loader; the runtime environment of the second operating system is generated by loading the second environment variables of the second operating system by the second loader.
4. The method according to claim 3, characterized in that, Before generating control information for the target IoT device in response to a trigger operation on the device control interface in the first operating system, the method further includes: The first environment variable is loaded by the first loader to generate the first runtime environment corresponding to the first operating system; Before sending the control information to the smart gateway program running on the second operating system based on the inter-process communication mechanism, the method further includes: The target process is started, the first environment variable that has been loaded is removed through the target process, and the second environment variable is loaded through the second loader to generate a second running environment corresponding to the second operating system, and the smart gateway program is run in the second running environment.
5. The method according to any one of claims 1 to 4, characterized in that, The first environment variable corresponding to the first operating system is stored in the first storage area; the second environment variable corresponding to the second operating system is stored in the second storage area.
6. An intelligent control device for an Internet of Things (IoT) device, characterized in that, The device is applied to a control terminal, wherein the control terminal is compatible with a first operating system and a second operating system that share a common kernel, and the device includes: The generation module is used to generate control information for the target IoT device in response to a trigger operation on the device control interface in the first operating system. The sending module is used to send the control information to the smart gateway program running on the second operating system based on the inter-process communication mechanism. The control module is used to control the target IoT device based on the control information through the smart gateway program; The allocation module is used to allocate hardware resources in the control terminal to the first operating system and the second operating system, and to disable the first operating system's access permissions to the hardware resources allocated to the second operating system. Through the smart gateway program, it calls the kernel of the first operating system to output control commands using the target hardware resources in the control terminal. The target hardware resources are hardware resources configured for the second operating system and matched with the control information. The control commands are used to instruct the target IoT device to perform processing corresponding to the control information.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.