Methods, apparatus, storage media, and electronic devices for transmitting control commands

CN116846936BActive Publication Date: 2026-11-17QINGDAO HAIER TECH +2
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310792315.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2026-11-17
Estimated Expiration
2043-06-29

AI Technical Summary

Technical Problem

[0004]针对相关技术中,如何提高控制指令的发送效率的技术问题,尚未提出有效的解决方案

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116846936B_ABST
    Figure CN116846936B_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, storage medium, and electronic device for sending control commands, relating to the field of smart home technology. The method for sending control commands includes: determining a first service gateway from a plurality of service gateways that has a message channel with a controlled device, wherein the plurality of service gateways and the controlled device belong to the same local area network (LAN); obtaining a first ratio between the first gateway memory of the first service gateway and the LAN memory of the same LAN from a first service platform connected to the first service gateway, and sending the first ratio to the first service gateway; obtaining a first control command generated by the first service gateway based on the first ratio, and sending the first control command to the controlled device through the message channel, so that the controlled device executes the first control command. This technical solution solves the technical problem of how to improve the efficiency of sending control commands.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of smart home technology, and more specifically, to a method, apparatus, storage medium, and electronic device for transmitting control commands. Background Technology

[0002] Currently, with the continuous maturation of IoT technology, it is being increasingly widely applied in the field of home appliance control. In related fields, for scenarios such as returning home and leaving home, device linkage based on IoT technology can be achieved, allowing users to control all devices in the house simply by opening or closing the door. However, this device linkage typically operates in edge scenarios, where the business architecture is a single-host centralized gateway architecture. This architecture is highly dependent on the hardware performance of the single host. If the hardware performance of the single host degrades or is inherently low, it can lead to insufficient CPU load on the platform, preventing timely sending of control commands to home appliances and resulting in the appliances failing to respond to users promptly.

[0003] Therefore, in related technologies, there is a technical problem of how to improve the efficiency of sending control commands.

[0004] No effective solution has yet been proposed for the technical problem of improving the efficiency of control command transmission in related technologies. Summary of the Invention

[0005] This application provides a method, apparatus, storage medium, and electronic device for transmitting control commands, to at least solve the technical problem of how to improve the transmission efficiency of control commands in related technologies.

[0006] According to one embodiment of this application, a method for sending control commands is provided, comprising: determining a first service gateway from a plurality of service gateways that has a message channel with a controlled device, wherein the plurality of service gateways and the controlled device belong to the same local area network; obtaining a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from a first service platform connected to the first service gateway, and sending the first ratio to the first service gateway; obtaining a first control command generated by the first service gateway based on the first ratio, and sending the first control command to the controlled device through the message channel, so that the controlled device executes the first control command.

[0007] In an exemplary embodiment, obtaining a first control instruction generated by the first service gateway based on the first ratio includes: determining a first computing power value required to control the controlled device based on the device identifier of the controlled device; if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is less than or equal to a preset computing power value, then obtaining the first control instruction from a first domain model component included in the first service gateway; wherein the first control instruction is generated by the first domain model component based on the first ratio.

[0008] In an exemplary embodiment, obtaining a first control instruction generated by the first service gateway based on the first ratio includes: determining a first computing power value required to control the controlled device based on the device identifier of the controlled device; if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is greater than a preset computing power value, then obtaining the first control instruction from a first scenario software development kit component included in the first service gateway; wherein the first control instruction is generated by the first scenario software development kit component based on the first ratio.

[0009] In an exemplary embodiment, obtaining a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from a first service platform connected to the first service gateway includes: obtaining the first gateway memory and the local area network memory from a first memory load calculation component of the first service gateway; sending the first gateway memory and the local area network memory to the first service platform; and obtaining a first ratio generated by the first service platform based on the first gateway memory and the local area network memory.

[0010] In an exemplary embodiment, after determining a first service gateway that has a message channel with the controlled device from a plurality of service gateways, the method further includes: determining other devices belonging to the same local area network, and a second service gateway corresponding to the other devices; determining a second service platform connected to the second service gateway, wherein the computing power supported by the second service platform is higher than the computing power supported by the first service platform; obtaining a second control instruction from the second service platform, and sending the second control instruction to the other devices to cause the other devices to execute the second control instruction.

[0011] In one exemplary embodiment, obtaining a second control instruction from the second service platform includes: obtaining an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second service gateway; sending the encrypted third control instruction to the second service platform; and, if it is determined that the second service platform has completed decryption of the encrypted third control instruction, obtaining the decryption result of the encrypted third control instruction from the second service platform, and obtaining the second control instruction from the decryption result.

[0012] In one exemplary embodiment, obtaining an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second service gateway includes: obtaining a second ratio of the second gateway memory of the second service gateway to the local area network memory from a second memory load calculation component included in the second service gateway; sending the second ratio to the second domain model component or the second scenario software development kit component using an event bus interaction component included in the second service gateway; and obtaining the encrypted third control instruction from the second domain model component or the second scenario software development kit component, wherein the encrypted third control instruction is obtained by encrypting a control instruction generated based on the second ratio by the second domain model component or the second scenario software development kit component.

[0013] According to another aspect of the embodiments of this application, a control command sending apparatus is also provided, characterized in that it includes: a determining module, configured to determine a first service gateway that has a message channel with a controlled device from a plurality of service gateways, wherein the plurality of service gateways and the controlled device belong to the same local area network; an obtaining module, configured to obtain a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from a first service platform connected to the first service gateway, and send the first ratio to the first service gateway; and a sending module, configured to obtain a first control command generated by the first service gateway based on the first ratio, and send the first control command to the controlled device through the message channel, so that the controlled device executes the first control command.

[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described method for sending control instructions when it is run.

[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described method for sending control instructions through the computer program.

[0016] In this embodiment, a first service gateway that has a message channel with the controlled device is determined from among multiple service gateways belonging to the same local area network (LAN) as the controlled device. A first ratio of the first gateway memory of the first service gateway to the LAN memory of the same LAN is obtained from a first service platform connected to the first service gateway, and the first ratio is sent to the first service gateway. A first control instruction generated by the first service gateway based on the first ratio is obtained, and the first control instruction is sent to the controlled device through the message channel, so that the controlled device executes the first control instruction. By adopting the above technical solution, a control instruction can be generated based on the ratio of the gateway memory of the first service gateway to the LAN memory, and the control instruction can be sent to the controlled device through the message channel between the first service gateway and the controlled device. This solves the technical problem of how to improve the sending efficiency of the control instruction, thereby improving the sending efficiency of the control instruction. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a schematic diagram of the hardware environment for a method of sending control commands according to an embodiment of this application;

[0020] Figure 2 This is a schematic diagram of the structure of a gateway message sending system according to an embodiment of this application;

[0021] Figure 3 This is a flowchart of a method for sending control commands according to an embodiment of this application;

[0022] Figure 4 This is a structural block diagram (a) of a control command sending device according to an embodiment of this application;

[0023] Figure 5This is a structural block diagram (II) of a control command sending device according to an embodiment of this application. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] According to one aspect of the embodiments of this application, a method for sending control commands is provided. This method for sending control commands is widely applicable to edge scenarios of whole-house intelligent digital control applications, such as smart homes, smart home device ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for sending control commands can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.

[0027] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.

[0028] In one embodiment, combined Figure 2 To provide a better explanation of the aforementioned gateway message interaction system, Figure 2 This is a schematic diagram of the structure of a gateway message interaction system according to an embodiment of this application. For example... Figure 2 As shown, the gateway message interaction system includes Gateway A (equivalent to the first service gateway mentioned above) and Gateway B (equivalent to the second service gateway mentioned above). Gateway A and Gateway B have the same composition structure, and each of Gateway A and Gateway B has a corresponding user service channel.

[0029] Taking Gateway A as an example, the interaction process of gateway messages is explained. The CAE sends messages transmitted via the user service channel to the UCOM component, which then forwards the messages to the gateway message filter. The gateway message filter sends the filtered messages to the event bus broker (equivalent to the aforementioned event bus interaction component). The event bus broker interacts with each of the following modules: the scenario JSDK (equivalent to the aforementioned first scenario software development kit component), the domain model (equivalent to the aforementioned first domain model component), the CPU load statistics module (equivalent to the aforementioned first memory load calculation component), the SDL user side, the master-slave database backup module, and the message forwarding module. In response to a subscription request from any of the following subscribers—the gateway message filter, scenario JSDK, domain model, CPU load statistics module, SDL user side, master-slave database backup module, or message forwarding module—the event bus broker publishes the gateway message indicated by the subscription request to that subscriber.

[0030] Among them, Figure 2 In this context, SDL (Smart Device Linux SDK) refers to an IoT software development kit used by devices based on the Linux platform.

[0031] CAE (Computer-Aided Engineering) uses computer technology and software tools to simulate, analyze, and optimize physical phenomena, thereby helping designers improve product performance and reliability, reduce product development cycles and costs, and achieve intelligent and digital production. In gateway systems, CAE can also be used for network connectivity modeling and simulation analysis.

[0032] UCOM components refer to a general-purpose type library under COM (Component Object Model) technology, which includes some basic interface and structure definitions. These interfaces and structures allow developers to share code in different development environments, thereby achieving more efficient and reliable software development. UCOM components are commonly used on the Microsoft .NET platform, through which unmanaged code or COM components can be easily called, and objects written on the .NET platform can be interacted with.

[0033] An event bus broker is a component in a messaging framework used to pass messages between different parts of an application or system. It simplifies application development by decoupling publishers and subscribers and enabling asynchronous communication. In an event bus system, the event bus broker acts as a central node, serving as the interaction point for all publishing and receiving messages. The broker ensures messages are sent to the correct destinations, provides data control to connectors, and performs operations such as buffering events. This simplifies application integration, logging of processing tasks, and problem tracking.

[0034] The Scene JSDK (Java Software Development Kit) is a software development kit used to create and manage artificial intelligence scene models in a Java environment. It provides a rich set of APIs and tools, enabling developers to easily create, train, test, and deploy their own machine learning models. This SDK can be used with various third-party frameworks and libraries (such as TensorFlow, Keras, etc.) and supports local or cloud execution. By using the Scene JSDK, developers can quickly build high-quality AI applications for enterprise or individual users.

[0035] This embodiment provides a method for sending control commands, applied to the aforementioned terminal device. Figure 3 This is a flowchart of a method for sending control commands according to an embodiment of this application. The process includes the following steps:

[0036] Step S302: Determine the first service gateway that has a message channel with the controlled device from among multiple service gateways, wherein the multiple service gateways and the controlled device belong to the same local area network;

[0037] It should be noted that the aforementioned "same local area network" can be understood as a home LAN within a household. Multiple service gateways within a home LAN can correspond to service gateways for different home appliances. For example, there might be a first service gateway that has a message channel with the controlled device, and a second service gateway that corresponds to other devices within the home LAN besides the controlled device.

[0038] The aforementioned first service platform can be understood as an RTOS (also known as a FreeRTOS) platform. RTOS platforms are Real-Time Operating Systems (RTOS) used in embedded systems to implement functions such as task management, time management, semaphores, and message queues. They are suitable for embedded devices with both single and distributed processors. In this embodiment, the first service gateway can be used to implement command compensation functionality for the controlled device, and the second service gateway can be used to implement scene linkage functionality for other devices.

[0039] The aforementioned controlled equipment can be understood as household appliances such as door locks and lighting fixtures.

[0040] Step S304: Obtain the first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway.

[0041] Step S306: Obtain the first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction.

[0042] Through the above steps, a first service gateway that has a message channel with the controlled device is determined from among multiple service gateways belonging to the same local area network as the controlled device; a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network is obtained from a first service platform connected to the first service gateway, and the first ratio is sent to the first service gateway; a first control command generated by the first service gateway based on the first ratio is obtained, and the first control command is sent to the controlled device through the message channel so that the controlled device executes the first control command. This solves the technical problem of how to improve the sending efficiency of control commands in related technologies, thereby improving the sending efficiency of control commands.

[0043] In an exemplary embodiment, the implementation process of obtaining the first control instruction generated by the first service gateway based on the first ratio in step S306 above specifically includes the following implementation steps: Step S11, determining the first computing power value required to control the controlled device based on the device identifier of the controlled device; Step S12, if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is less than or equal to a preset computing power value, then obtaining the first control instruction from the first domain model component included in the first service gateway; wherein, the first control instruction is generated by the first domain model component based on the first ratio.

[0044] Optionally, the process of determining the first computing power value required to control the controlled device based on the device identifier of the controlled device may include: determining a preset correspondence between all device identifiers of the controlled device and the first computing power value required to control the controlled device, determining the device identifier of the controlled device from all device identifiers, and determining the first computing power value corresponding to the device identifier of the controlled device based on the preset correspondence.

[0045] In one exemplary embodiment, another technical solution for obtaining a first control instruction generated by the first service gateway based on the first ratio is further proposed. The specific steps include: step S21, determining a first computing power value required to control the controlled device based on the device identifier of the controlled device; step S22, if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is greater than a preset computing power value, then obtaining the first control instruction from the first scenario software development kit component included in the first service gateway; wherein, the first control instruction is generated by the first scenario software development kit component based on the first ratio.

[0046] In an exemplary embodiment, to better illustrate the technical solution of obtaining the first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway in step S304 above, the following steps are specifically provided: Step S31, obtaining the first gateway memory and the local area network memory from the first memory load calculation component of the first service gateway; Step S32, sending the first gateway memory and the local area network memory to the first service platform, and obtaining the first ratio generated by the first service platform based on the first gateway memory and the local area network memory.

[0047] Optionally, for step S31, the first memory load calculation component can determine the local area network memory based on the memory data of other service gateways (e.g., the second gateway memory of the second service gateway) forwarded by the message forwarding component (i.e., the message forwarding module) of the first service gateway, calculate the first gateway memory in real time using the first gateway memory of the first service gateway and the local area network memory, and calculate the gateway memory of other service gateways in real time based on the memory data and local area network memory of other service gateways.

[0048] In an exemplary embodiment, after determining a first service gateway that has a message channel with the controlled device from among multiple service gateways, it is further possible to determine other devices belonging to the same local area network, and a second service gateway corresponding to the other devices; determine a second service platform connected to the second service gateway, wherein the computing power supported by the second service platform is higher than that supported by the first service platform; obtain a second control instruction from the second service platform, and send the second control instruction to the other devices to cause the other devices to execute the second control instruction.

[0049] This embodiment allows for the setup of service platforms with varying computing power within the same local area network (LAN). For each device corresponding to a service gateway on a different service platform, corresponding control commands are generated to control that device. For instance, a first service gateway connected to a first service platform has a message channel with the controlled device, enabling the generation of a first control command for the controlled device. Similarly, for other devices corresponding to a second service gateway on a second service platform connected within the same LAN, second control commands can be generated for those other devices.

[0050] Specifically, the first service platform is, for example, an RTOS platform, and the corresponding first service gateway can be used to control the controlled device to achieve single-command compensation. The second service platform is, for example, a Linux system, and the corresponding second service gateway can be used to control other devices to achieve scene linkage. Single-command compensation means generating control commands for only a single device. For example, in a home-return scenario, a second control command generated by the second service gateway controls the activation of other devices such as the porch light, smart speaker, and air conditioner. If the user interacts with any of these devices, or with a controlled device such as a refrigerator, a first control command needs to be generated by the first service gateway to control the controlled device.

[0051] In an exemplary embodiment, the technical solution for obtaining the second control instruction from the second service platform can also be described through the following steps: obtaining an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second service gateway; sending the encrypted third control instruction to the second service platform; and, if it is determined that the second service platform has completed the decryption of the encrypted third control instruction, obtaining the decryption result of the encrypted third control instruction from the second service platform, and obtaining the second control instruction from the decryption result.

[0052] In an exemplary embodiment, the process of obtaining the encrypted third control instruction from the second domain model component or the second scenario software development kit component included in the second service gateway is further described through the following steps: Step S41, obtaining the second ratio of the second gateway memory of the second service gateway to the local area network memory from the second memory load calculation component included in the second service gateway; Step S42, sending the second ratio to the second domain model component or the second scenario software development kit component using the event bus interaction component included in the second service gateway; Step S43, obtaining the encrypted third control instruction from the second domain model component or the second scenario software development kit component, wherein the encrypted third control instruction is obtained by encrypting the control instruction generated based on the second ratio by the second domain model component or the second scenario software development kit component.

[0053] Optionally, in one embodiment, for an RTOS (FreeRTOS) platform (equivalent to the first business platform mentioned above), relevant information about tasks can be obtained by calling the function vTaskList(), and relevant information about CPU utilization can be obtained by calling the function vTaskGetRunTimeStats().

[0054] For Linux systems (equivalent to the second business platform mentioned above), process and CPU information is stored in real time. For example, CPU information is stored at ` / proc / stat`, and CPU information at different times can be queried in the ` / proc / stat` file. Process information is stored at ` / proc / pid / stat`, meaning that the ` / proc / stat` file contains all CPU activity information. It should be noted that from system startup until the current moment, the code used to store process information is constantly running and stored in the ` / proc / stat` file.

[0055] One approach is to push CPU information at regular intervals, or to push CPU information when the CPU load rate changes by more than 10%.

[0056] Optionally, the required calculation formula for both push methods is as follows:

[0057] CPU load rate = ((CPU load rate of user processes + CPU load rate of system processes) × 100) ÷ (Time difference between the last statistical time and the current statistical time).

[0058] Based on the above embodiments, service gateways for low-performance hardware platforms such as RTOS and high-performance hardware platforms such as Linux can be set up separately within the same local area network. On the basis of using the service gateway for high-performance hardware platforms such as Linux to control home appliances to achieve linkage, the service gateway for low-performance hardware platforms such as RTOS can also be used to control home appliances to achieve command compensation, thereby achieving comprehensive linkage. While ensuring normal linkage of home appliances, it also improves the control efficiency of individual home appliances in linkage scenarios.

[0059] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0060] Figure 4 This is a structural block diagram (a) of a control command transmitting device according to an embodiment of this application; as shown... Figure 4 As shown, it includes:

[0061] The determining module 42 is used to determine the first service gateway that has a message channel with the controlled device from multiple service gateways, wherein the multiple service gateways and the controlled device belong to the same local area network;

[0062] It should be noted that the aforementioned "same local area network" can be understood as a home LAN within a household. Multiple service gateways within a home LAN can correspond to service gateways for different home appliances. For example, there might be a first service gateway that has a message channel with the controlled device, and a second service gateway that corresponds to other devices within the home LAN besides the controlled device.

[0063] The aforementioned first service platform can be understood as an RTOS (also known as a FreeRTOS) platform. RTOS platforms are Real-Time Operating Systems (RTOS) used in embedded systems to implement functions such as task management, time management, semaphores, and message queues. They are suitable for embedded devices with both single and distributed processors. In this embodiment, the first service gateway can be used to implement command compensation functionality for the controlled device, and the second service gateway can be used to implement scene linkage functionality for other devices.

[0064] The aforementioned controlled equipment can be understood as household appliances such as door locks and lighting fixtures.

[0065] The acquisition module 44 is used to acquire a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway.

[0066] The sending module 46 is used to obtain the first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction.

[0067] The above-described apparatus identifies a first service gateway that has a message channel with the controlled device from among multiple service gateways belonging to the same local area network (LAN) as the controlled device; obtains a first ratio of the first gateway memory of the first service gateway to the LAN memory of the same LAN from a first service platform connected to the first service gateway, and sends the first ratio to the first service gateway; obtains a first control command generated by the first service gateway based on the first ratio, and sends the first control command to the controlled device through the message channel, so that the controlled device executes the first control command; thus solving the technical problem of how to improve the sending efficiency of control commands in related technologies, thereby improving the sending efficiency of control commands.

[0068] In an exemplary embodiment, the sending module 46 includes a first acquisition unit, configured to acquire a first control instruction generated by the first service gateway based on the first ratio based on the following steps: Step S11, determining a first computing power value required to control the controlled device based on the device identifier of the controlled device; Step S12, if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is less than or equal to a preset computing power value, then acquiring the first control instruction from the first domain model component included in the first service gateway; wherein the first control instruction is generated by the first domain model component based on the first ratio.

[0069] In an exemplary embodiment, the sending module 46 includes a second acquisition unit, configured to perform the following specific steps: Step S21, determining a first computing power value required to control the controlled device based on the device identifier of the controlled device; Step S22, if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is greater than a preset computing power value, then acquiring the first control instruction from the first scenario software development kit component included in the first service gateway; wherein the first control instruction is generated by the first scenario software development kit component based on the first ratio.

[0070] In an exemplary embodiment, the acquisition module 44 includes a third acquisition unit, which provides the following steps to illustrate a technical solution for obtaining a first ratio between the first gateway memory of the first service gateway and the local area network memory of the same local area network from a first service platform connected to the first service gateway: Step S31, obtaining the first gateway memory and the local area network memory from the first memory load calculation component of the first service gateway; Step S32, sending the first gateway memory and the local area network memory to the first service platform, and obtaining the first ratio generated by the first service platform based on the first gateway memory and the local area network memory.

[0071] Optionally, in the above embodiments, the first memory load calculation component can determine the local area network memory based on the memory data of other service gateways (such as the second gateway memory of the second service gateway) forwarded by the message forwarding component (i.e., the message forwarding module) of the first service gateway, calculate the first gateway memory in real time using the first gateway memory of the first service gateway and the local area network memory, and calculate the gateway memory of other service gateways in real time based on the memory data and local area network memory of other service gateways.

[0072] Furthermore, in one exemplary embodiment, in combination with Figure 5 Another means of sending control commands is provided. Figure 5 This is a structural block diagram (II) of a control command transmitting device according to an embodiment of this application; as shown Figure 5 As shown, in the case of Figure 4In addition to the determination module 42, acquisition module 44, and sending module 46 shown, the system also includes: an instruction execution module 52, which, after determining a first service gateway that has a message channel with the controlled device from among multiple service gateways, can further determine other devices belonging to the same local area network and a second service gateway corresponding to the other devices; determine a second service platform connected to the second service gateway, wherein the computing power supported by the second service platform is higher than that supported by the first service platform; acquire a second control instruction from the second service platform; and send the second control instruction to the other devices to cause the other devices to execute the second control instruction.

[0073] This embodiment allows for the setup of service platforms with varying computing power within the same local area network (LAN). For each device corresponding to a service gateway on a different service platform, corresponding control commands are generated to control that device. For instance, a first service gateway connected to a first service platform has a message channel with the controlled device, enabling the generation of a first control command for the controlled device. Similarly, for other devices corresponding to a second service gateway on a second service platform connected within the same LAN, second control commands can be generated for those other devices.

[0074] Specifically, the first service platform is, for example, an RTOS platform, and the corresponding first service gateway can be used to control the controlled device to achieve single-command compensation. The second service platform is, for example, a Linux system, and the corresponding second service gateway can be used to control other devices to achieve scene linkage. Single-command compensation means generating control commands for only a single device. For example, in a home-return scenario, a second control command generated by the second service gateway controls the activation of other devices such as the porch light, smart speaker, and air conditioner. If the user interacts with any of these devices, or with a controlled device such as a refrigerator, a first control command needs to be generated by the first service gateway to control the controlled device.

[0075] In an exemplary embodiment, the execution module further includes a first acquisition unit, configured to describe the technical solution of acquiring a second control instruction from the second business platform through the following steps: acquiring an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second business gateway; sending the encrypted third control instruction to the second business platform; and, if it is determined that the second business platform has completed the decryption of the encrypted third control instruction, acquiring the decryption result of the encrypted third control instruction from the second business platform, and obtaining the second control instruction from the decryption result.

[0076] In an exemplary embodiment, the execution module further includes a second acquisition unit, configured to specifically describe how to acquire the encrypted third control instruction from the second domain model component or the second scenario software development kit component included in the second service gateway through the following steps: Step S41, acquiring a second ratio of the second gateway memory of the second service gateway to the local area network memory from the second memory load calculation component included in the second service gateway; Step S42, sending the second ratio to the second domain model component or the second scenario software development kit component using the event bus interaction component included in the second service gateway; Step S43, acquiring the encrypted third control instruction from the second domain model component or the second scenario software development kit component, wherein the encrypted third control instruction is obtained by the second domain model component or the second scenario software development kit component by encrypting the control instruction generated based on the second ratio.

[0077] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0078] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0079] S1, determine the first service gateway that has a message channel with the controlled device from multiple service gateways, wherein the multiple service gateways and the controlled device belong to the same local area network;

[0080] S2, obtain the first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway;

[0081] S3, obtain the first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction.

[0082] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0083] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0084] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0085] S1, determine the first service gateway that has a message channel with the controlled device from multiple service gateways, wherein the multiple service gateways and the controlled device belong to the same local area network;

[0086] S2, obtain the first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway;

[0087] S3, obtain the first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction.

[0088] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0089] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0090] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0091] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for sending control commands, characterized in that, include: A first service gateway that has a message channel with the controlled device is determined from multiple service gateways, wherein the multiple service gateways and the controlled device belong to the same local area network; Obtain a first ratio between the first gateway memory of the first service gateway and the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway; Obtain the first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction; The method further includes, after identifying a first service gateway that has a message channel with the controlled device from multiple service gateways, the first service gateway being identified as having a message channel with the controlled device; the second service gateway being identified as belonging to the same local area network and corresponding to the other devices; the third service gateway being identified as having a second service platform connected to the second service gateway, wherein the second service platform supports a higher computing power than the first service platform; the fourth service gateway being identified as having a second control instruction, and the fifth service gateway being identified as having a second control instruction, and the sixth service gateway being identified as having a second control instruction, and the seventh service gateway being identified as having a second control instruction, and the eighth ... The process of obtaining the second control instruction from the second business platform includes: obtaining an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second business gateway; sending the encrypted third control instruction to the second business platform; and, if it is determined that the second business platform has decrypted the encrypted third control instruction, obtaining the decryption result of the encrypted third control instruction from the second business platform, and obtaining the second control instruction from the decryption result. Obtaining the first control instruction generated by the first service gateway based on the first ratio includes: The first computing power value required to control the controlled device is determined based on the device identifier of the controlled device; If it is determined that the first computing power value is less than the second computing power value supported by the first business platform, and if it is determined that the first computing power value is less than or equal to a preset computing power value, then the first control instruction is obtained from the first domain model component included in the first business gateway; wherein, the first control instruction is generated by the first domain model component based on the first ratio. If it is determined that the first computing power value is greater than the preset computing power value, the first control instruction is obtained from the first scenario software development kit component included in the first service gateway; wherein, the first control instruction is generated by the first scenario software development kit component based on the first ratio.

2. The method for sending control commands according to claim 1, characterized in that, Obtaining a first ratio of the first gateway memory of the first service gateway to the local area network memory of the same local area network from the first service platform connected to the first service gateway includes: Obtain the first gateway memory and the local area network memory from the first memory load calculation component of the first service gateway; The first gateway memory and the local area network memory are sent to the first service platform, and a first ratio generated by the first service platform based on the first gateway memory and the local area network memory is obtained.

3. The method for sending control commands according to claim 1, characterized in that, Obtain encrypted third control instructions from the second domain model component or the second scenario software development kit component included in the second business gateway, including: Obtain a second ratio between the second gateway memory and the local area network memory from the second memory load calculation component included in the second service gateway; The second ratio is sent to the second domain model component or the second scenario software development kit component using the event bus interaction component included in the second service gateway; The encrypted third control instruction is obtained from the second domain model component or the second scene software development kit component, wherein the encrypted third control instruction is obtained by the second domain model component or the second scene software development kit component by encrypting the control instruction generated based on the second ratio.

4. A control command transmitting device, characterized in that, include: The determining module is used to determine, from multiple service gateways, the first service gateway that has a message channel with the controlled device, wherein the multiple service gateways and the controlled device belong to the same local area network; The acquisition module is used to acquire a first ratio between the first gateway memory of the first service gateway and the local area network memory of the same local area network from the first service platform connected to the first service gateway, and send the first ratio to the first service gateway. The sending module is used to obtain a first control instruction generated by the first service gateway based on the first ratio, and send the first control instruction to the controlled device through the message channel so that the controlled device executes the first control instruction; The determining module is further configured to determine other devices belonging to the same local area network, and a second service gateway corresponding to the other devices; determine a second service platform connected to the second service gateway, wherein the computing power supported by the second service platform is higher than that supported by the first service platform; obtain a second control instruction from the second service platform, and send the second control instruction to the other devices to cause the other devices to execute the second control instruction; The determining module is further configured to: obtain an encrypted third control instruction from a second domain model component or a second scenario software development kit component included in the second business gateway; send the encrypted third control instruction to the second business platform; and, if it is determined that the second business platform has decrypted the encrypted third control instruction, obtain the decryption result of the encrypted third control instruction from the second business platform, and obtain the second control instruction from the decryption result, wherein... The sending module is further configured to determine a first computing power value required to control the controlled device based on the device identifier of the controlled device; if it is determined that the first computing power value is less than a second computing power value supported by the first service platform, and if it is determined that the first computing power value is less than or equal to a preset computing power value, then the first control instruction is obtained from the first domain model component included in the first service gateway; wherein the first control instruction is generated by the first domain model component based on the first ratio; if it is determined that the first computing power value is greater than the preset computing power value, then the first control instruction is obtained from the first scenario software development kit component included in the first service gateway; wherein the first control instruction is generated by the first scenario software development kit component based on the first ratio.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program is executed by a computer to perform the method described in any one of claims 1 to 3.

6. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 3 through the computer program.

Citation Information

Patent Citations

  • Load balancing method, load balancing device and server

    CN108737255A

  • Control method of smart home equipment, smart home system and gateway thereof

    CN111913450A

  • Gateway equipment control method and device, storage medium and electronic device

    CN115473753A