Method, device, electronic device and medium for controlling device based on compensation command
By generating compensation commands and creating command queues, the problems of cumbersome human-computer interaction process and low success rate in the prior art are solved, and more humanized smart home control is achieved.
Patent Information
- Application Number
- CN202110891861.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2041-08-04
AI Technical Summary
In the prior art, the human-computer interaction process is complicated, the success rate is low, and it is not humane enough. Especially when controlling household appliances through voice interaction, it is difficult for users to directly execute complex device control commands.
By receiving user control commands, obtaining compensation commands associated with the command, creating a command queue, and controlling the device according to the queue, thereby realizing the adjustment of device attributes.
The human-computer interaction process is simplified, the interaction success rate is improved, and the human-computer interaction is more humanized, and the household appliances can be effectively controlled without understanding the status of the equipment.
Smart Images

Figure CN115903524B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Internet of Things and household appliances, and in particular to a method, device, electronic device and medium for controlling a device based on a compensation command. Background Art
[0002] With the development and popularization of the Internet of Things and home appliances, more and more smart furniture appears in people's lives, human-computer interaction occurs more and more frequently, and the forms of human-computer interaction become more and more diverse. With the development of the Internet of Things, users can control home appliances not only with remote controls, but also through terminal devices such as mobile phones, and through human-computer interaction interfaces provided by smart speakers.
[0003] For the control on the terminal page, the user can clearly know the current status of the device and control it based on the current status of the device. However, if the user intends to lower the temperature of the air conditioner in another room through the speaker, it is known that lowering the temperature is only effective when the air conditioner is turned on and in cooling mode. However, the user does not know the status of the air conditioner and can only turn it on and then adjust it to cooling mode before adjusting the temperature. The current human-computer interaction process is cumbersome, with a low success rate and is not user-friendly. Summary of the invention
[0004] The purpose of the present invention is to provide a method, an apparatus, an electronic device and a medium for controlling a device based on a compensation command, so as to solve the problems existing in the prior art.
[0005] In a first aspect, the present invention provides a method for controlling a device based on a compensation command, comprising:
[0006] receiving a first command including a first attribute for controlling a device;
[0007] According to a first attribute of the first command, acquiring at least one second attribute associated with the first attribute; according to the at least one second attribute, generating a corresponding compensation command, wherein the compensation command is an associated command that must be executed by the device to execute the first command; and according to the first command and the compensation command, creating a command queue;
[0008] The device is controlled according to the command queue so that the first attribute of the device is adjusted accordingly.
[0009] Optionally, before the operation of acquiring at least one second attribute associated with the first attribute according to the first attribute of the first command, the method further includes:
[0010] An operation of determining whether the first command is directly executable includes:
[0011] Get the current status of the device;
[0012] determining, according to the current state and the first attribute, whether the device can directly execute the first command in the current state;
[0013] When the result of the determination is that the first command cannot be directly executed, the subsequent operation of acquiring at least one second attribute associated with the first attribute according to the first attribute of the first command is performed.
[0014] Optionally, the operation of creating a command queue according to the first command and the compensation command includes:
[0015] Determining, according to the first attribute and the at least one second attribute, an execution order corresponding to the first command and the compensation command;
[0016] The command queue is generated according to the execution order.
[0017] Optionally, judging, according to the current state and the first attribute, whether the device can directly execute an operation of the first command in the current state includes:
[0018] According to the current state, determine whether the first command is executable; if executable, then:
[0019] According to the first command, it is determined whether the first command is executable; if not, the result of the determination is that the first command cannot be directly executed; otherwise, the result of the determination is that the first command can be directly executed, and the first command is sent to the device.
[0020] Optionally, the current state includes a third attribute, and the operation of determining whether the first command is executable according to the current state includes:
[0021] According to the third attribute, the relationship between the third attribute and the first attribute is determined; when the relationship between the third attribute and the first attribute is a logical AND, it is determined that the first command can be directly executed; otherwise, it is determined that the first command cannot be directly executed.
[0022] Optionally, the operation of determining whether the first command is executable according to the first command includes:
[0023] Determining whether the at least one second attribute exists according to the first attribute;
[0024] If it exists, the judgment result is that the first command cannot be directly executed; otherwise, the judgment result is that the first command can be directly executed and the first command is sent to the device.
[0025] Optionally, the third attribute is a device function mode; and the first attribute is a sub-function of the device function mode.
[0026] In a second aspect, the present invention provides an apparatus for controlling a device based on a compensation command, comprising:
[0027] A command receiving module, configured to receive a first command, wherein the first command includes a first attribute for controlling a device;
[0028] a queue creation module, configured to obtain, according to a first attribute of the first command, at least one second attribute associated with the first attribute; generate, according to the at least one second attribute, a corresponding compensation command, wherein the compensation command is an associated command that must be executed by the device to execute the first command; and create a command queue according to the first command and the compensation command;
[0029] The device control module is used to control the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0030] In a third aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for controlling a device based on compensation commands according to the first aspect are implemented.
[0031] In a fourth aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for controlling a device based on compensation commands according to the first aspect.
[0032] It can be seen from the above technical solution that the method, device, electronic device and medium for controlling the device based on compensation commands provided by the present invention generate compensation commands and create a command queue, and then the device executes the command queue, thereby simplifying the human-computer interaction process, improving the success rate of human-computer interaction, and making the human-computer interaction process more humane. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0034] Figure 1 is a flow chart of a method for controlling a device based on a compensation command according to an embodiment of the present invention;
[0035] Figure 2 is a flow chart of the control request calculation rules;
[0036] Figure 3 is a schematic diagram of a compensation command according to an embodiment of the present invention;
[0037] Figure 4 is a schematic diagram of an apparatus for controlling a device based on a compensation command according to an embodiment of the present invention;
[0038] Figure 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0040] When users control household appliances through various human-computer interaction interfaces, they expect to make human-computer interaction more humane and more in line with human interaction habits. For example, when a spoken instruction "the room is too hot, turn down the temperature" is issued, it is expected that a series of operations such as turning on the relevant air-conditioning equipment, adjusting it to the cooling mode, and setting the temperature to 24 degrees can be realized. However, there is currently a lack of corresponding solutions, and the human-computer interaction process is relatively cumbersome, with a low success rate and is not humane enough. In order to solve the above problems, an embodiment of the present invention proposes a method for controlling a device based on a compensation command.
[0041] Figure 1 is a flowchart of a method for controlling a device based on a compensation command according to an embodiment of the present invention, with reference to Figure 1 The method for controlling a device based on a compensation command provided in an embodiment of the present invention includes:
[0042] Step 110, receiving a first command, wherein the first command includes a first attribute for controlling a device;
[0043] Step 120: acquiring at least one second attribute associated with the first attribute according to the first attribute of the first command; generating a corresponding compensation command according to the at least one second attribute, wherein the compensation command is an associated command that must be executed by the device to execute the first command; and creating a command queue according to the first command and the compensation command;
[0044] Step 130: Control the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0045] In the embodiment of the present invention, it should be noted that the present invention is applicable to smart speakers or devices with voice interaction functions, especially human-computer interaction interfaces of smart assistants through voice interaction. The human-computer interaction interface can call the method provided by the embodiment of the present invention after determining that the user issues a command to control the device. In particular, the device that generates the command queue and the device that executes the command queue can be integrated or separate. For example, there may be a smart speaker and an air conditioner connected to the smart speaker. The user controls the air conditioner by interacting with the smart speaker, especially the scene where the user is in one room and the air conditioner is in another room; there may also be an air conditioner with a voice smart assistant, and the user controls the air conditioner through the voice smart assistant that comes with the air conditioner, especially in the scene where the visual display interface is not viewed. Here, the smart assistant can use various methods to process the user's voice input to obtain commands for controlling the device. Such a command can be "set the air conditioner to 20 degrees" and other commands that clearly specify the device to be controlled and the attributes to be operated, but does not specify what mode it is, whether it is turned on, etc., lacking complete conditions, so when this command is directly used to control the device, an error will occur, or the user's true intention cannot be realized. The device described here takes an air conditioner as an example, but it can also be other devices, such as household appliances such as desk lamps and refrigerators.
[0046] In the embodiment of the present invention, it should be noted that the operation of creating a command queue based on the first command and the compensation command includes: determining the execution order corresponding to the first command and the compensation command based on the first attribute and the at least one second attribute respectively; and generating the command queue based on the execution order.
[0047] Among them, the first attribute and the second attribute have their own priorities, so the first command and the compensation command also have corresponding priorities. According to the priorities of each command, the execution order of each command can be determined, including the execution order of the first command and the compensation command. The queue is a data structure with limited operation. Each element in the command queue, that is, each command, has a first-in-first-out order, that is, a first-execution-later-execution order. According to the execution order of each command, a command queue is generated. The command queue is executed by the device in the order of the commands in the queue.
[0048] In the embodiment of the present invention, it should be noted that before the operation of obtaining at least one second attribute associated with the first attribute of the first command, it also includes: an operation of determining whether the first command can be directly executed, the operation including: obtaining the current state of the device; determining whether the device can directly execute the first command in the current state based on the current state and the first attribute; when the judgment result is that the first command cannot be directly executed, executing the subsequent operation of obtaining at least one second attribute associated with the first attribute based on the first attribute of the first command.
[0049] The first command is a command issued by the user and may be pre-processed. The first command may be complete and sufficient to control the device to realize the user's true intention, or it may be incomplete and insufficient to control the device to realize the user's true intention. When the first command is incomplete, the method provided by the embodiment of the present invention is executed to control the device to realize the user's true intention. The embodiment of the present invention determines whether the first command is complete and sufficient to control the device to realize the user's true intention according to the state and attributes of the device. Specifically, judging whether the device can directly execute the operation of the first command in the current state according to the state and attributes of the device includes: first, judging whether the first command is executable according to the current state; if it is executable, then judging whether the first command is executable according to the first command; if the first command is judged to be executable according to the current state and the first command, the first command is sent to the device, and the device executes the first command. If the first command is judged to be not executable according to the current state, the judgment result is that the first command cannot be directly executed; if the first command is judged to be executable according to the current state, but the first command is judged to be not executable according to the first command, the judgment result is also that the first command cannot be directly executed.
[0050] Specifically, the following describes a method for determining whether a first command is executable based on the current state of a device, the current state includes a third attribute, and the relationship between the third attribute and the first attribute is determined based on the third attribute; when the relationship between the third attribute and the first attribute is a logical AND, the first command is determined to be directly executable; otherwise, the first command is determined to be not directly executable. Specifically, the following describes a method for determining whether a first command is executable based on the first command, the first command includes a first attribute, and whether the at least one second attribute exists is determined based on the first attribute; if so, the result of the determination is that the first command cannot be directly executed; otherwise, the result of the determination is that the first command can be directly executed and the first command is sent to the device. Among them, the third attribute is the device function mode; the first attribute is a sub-function of the device function mode.
[0051] Figure 2 It is a flow chart of the control request calculation rules. In the field of Internet of Things, devices are controlled through the Internet, based on existing functions and user expectations. The calculation rules implemented are as follows Figure 2 As shown. In this control request calculation rule, after the cloud receives the control request, it determines whether the command is allowed to be issued in the current state. After the verification is passed, the command completion is completed and the command can be issued. However, this method requires a page interaction layer between the user and the device. The user can understand what commands the device can currently issue through the application layer page, thereby ensuring that the issued command can be executed by the device. This method is suitable for APP operation, but not for smart speaker voice operation devices. Unless you know the current state of the device and what operations the device can support through the speaker before the operation, the user experience is not good. The method of controlling the device based on compensation commands can control the device without understanding the status of the device.
[0052] Figure 3 is a schematic diagram of a compensation command according to an embodiment of the present invention, with reference to Figure 3, the compensation command provided in the embodiment of the present invention is a command that needs to be supplemented before issuing certain commands. The compensation command and the issued command form a command queue and are issued in sequence. For example, the issued command is "set the air conditioner to 20 degrees", and the issued command here is the first command, which is used to control the target temperature of the air conditioner, and the first attribute is the target temperature. According to the issued command, the corresponding trigger content is found, the range of the attribute value is 16 degrees to 30 degrees, and the relationship between the attributes is "and". According to the attribute of the target temperature, at least one second attribute associated with the target temperature is obtained. Here, the second attribute is the on / off state, and the current state is the off state. It is judged that there is a second attribute, so the command to control the target temperature of the air conditioner cannot be directly executed. The current state of the air conditioner is obtained, and the attribute of the current state of the air conditioner is the function mode, that is, the third attribute here is the function mode, the attribute value is cooling, the relationship between the attributes is "and", and the first attribute is a sub-function that needs to be set in the cooling mode. Here, it is determined that the command to control the target temperature of the air conditioner can be directly executed. In summary of the above two judgment conditions, only the command to control the target temperature of the air conditioner cannot be directly executed so that the attribute value of the target temperature of the device can be adjusted accordingly. Specifically, when receiving the command "set the air conditioner to 20 degrees" from the user, the cloud finds that the air conditioner is currently in cooling mode but is not turned on. At this time, it only sends a command to set the target temperature to 20 degrees to the air conditioner, and the air conditioner is still not turned on, that is, the command to set the target temperature to 20 degrees does not change the state of the air conditioner, and the user's intention is not realized. In the embodiment of the present invention, the cloud will prepend a power-on command according to the preset rules. The power-on command should be executed by the air conditioner before setting the target temperature to 20 degrees. Therefore, after the power-on command is successfully issued, the command to set the target temperature to 20 degrees continues to be issued. After completing all the commands in the command queue, the user's true intention is realized. The air conditioner changes from the state of being turned off in cooling mode to the state of being turned on in cooling mode with the target temperature set to 20 degrees, thus avoiding multiple interactions with the user.
[0053] According to the current state of the air conditioner and the commands issued, multiple command queues that can change the state of the air conditioner may be found. For example, a command to set the target temperature to 20 degrees is received in the power-on state. At this time, no functional mode is specified, and there are multiple modes such as heating, ventilation and automatic. At this time, according to the preset priority rules, such as setting the automatic mode to the highest priority, the automatic mode is selected when no functional mode is specified. Compensation commands can also be selected in the cloud based on external information. For example, when the room temperature reaches 30 degrees in summer, the priority of the cooling mode is increased and the cooling mode is selected. After one o'clock in the evening, the priority of the sleep mode is increased, so that the command queue also includes the command to set the air conditioner to the sleep mode. When the user is accustomed to turning on the air conditioner at 7 o'clock in the afternoon, setting it to the cooling mode, and the temperature is 22 degrees, the cloud can record the user's habits. When the command of "turning on the air conditioner" is received, a command queue including setting the functional mode to the cooling mode and the target temperature to 22 degrees is selected.
[0054] Figure 4 A schematic diagram of an apparatus for controlling a device based on a compensation command provided by an embodiment of the present invention, such as Figure 4 As shown, the device for controlling a device based on a compensation command provided by an embodiment of the present invention includes:
[0055] A command receiving module 410, configured to receive a first command, wherein the first command includes a first attribute for controlling a device;
[0056] The queue creation module 420 is configured to obtain, according to the first attribute of the first command, at least one second attribute associated with the first attribute; generate a corresponding compensation command according to the at least one second attribute, where the compensation command is an associated command that must be executed by the device to execute the first command; and create a command queue according to the first command and the compensation command;
[0057] The device control module 430 is used to control the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0058] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0059] Since the device based on compensation command control equipment provided in the embodiment of the present invention can be used to execute the method based on compensation command control equipment described in the above embodiment, its working principle and beneficial effects are similar, so they will not be described in detail here. For specific contents, please refer to the introduction of the above embodiment.
[0060] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call the logic instructions in the memory 530 to execute a method for controlling a device based on a compensation command, the method comprising: receiving a first command, the first command including a first attribute for controlling a device; obtaining at least one second attribute associated with the first attribute according to the first attribute of the first command; generating a corresponding compensation command according to the at least one second attribute, the compensation command being an associated command that the device must execute to execute the first command; creating a command queue according to the first command and the compensation command; and controlling the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0061] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0062] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the method of controlling a device based on a compensation command provided by the above-mentioned methods, and the method includes: receiving a first command, the first command including a first attribute for controlling a device; according to the first attribute of the first command, obtaining at least one second attribute associated with the first attribute; according to the at least one second attribute, generating a corresponding compensation command, the compensation command being an associated command that must be executed by the device to execute the first command; creating a command queue according to the first command and the compensation command; and controlling the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0063] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned methods for controlling a device based on compensation commands, the method comprising: receiving a first command, the first command comprising a first attribute for controlling a device; obtaining at least one second attribute associated with the first attribute according to the first attribute of the first command; generating a corresponding compensation command according to the at least one second attribute, the compensation command being an associated command that must be executed by the device to execute the first command; creating a command queue according to the first command and the compensation command; and controlling the device according to the command queue so that the first attribute of the device is adjusted accordingly.
[0064] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0065] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0066] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for controlling a device based on a compensation command, characterized in that: include: receiving a first command including a first attribute for controlling a device; Get the current status of the device; Determining whether the first command is executable according to the current state; If executable, then: According to the first command, determining whether the first command is executable; If it is executable, the judgment result is that the first command can be directly executed, and the first command is sent to the device; If it is not executable, the judgment result is that the first command cannot be directly executed, and the following operations are performed: According to a first attribute of the first command, acquiring at least one second attribute associated with the first attribute; generating a corresponding compensation command according to the at least one second attribute, where the compensation command is an associated command that must be executed by the device to execute the first command; Creating a command queue according to the first command and the compensation command; The device is controlled according to the command queue so that the first attribute of the device is adjusted accordingly.
2. The method for controlling a device based on a compensation command according to claim 1, characterized in that: The operation of creating a command queue according to the first command and the compensation command includes: Determining, according to the first attribute and the at least one second attribute, an execution order corresponding to the first command and the compensation command; The command queue is generated according to the execution order.
3. The method for controlling a device based on a compensation command according to claim 1, characterized in that: The current state includes a third attribute, and the operation of determining whether the first command is executable according to the current state includes: According to the third attribute, the relationship between the third attribute and the first attribute is determined; when the relationship between the third attribute and the first attribute is a logical AND, it is determined that the first command can be directly executed; otherwise, it is determined that the first command cannot be directly executed.
4. The method for controlling a device based on a compensation command according to claim 1, characterized in that: The operation of determining whether the first command is executable according to the first command includes: Determining whether the at least one second attribute exists according to the first attribute; If it exists, the judgment result is that the first command cannot be directly executed; otherwise, the judgment result is that the first command can be directly executed and the first command is sent to the device.
5. The method for controlling a device based on a compensation command according to claim 3, characterized in that: The third attribute is a device function mode; the first attribute is a sub-function of the device function mode.
6. A device for controlling a device based on a compensation command, characterized in that: include: A command receiving module, configured to receive a first command, wherein the first command includes a first attribute for controlling a device; The judgment module is used to: Get the current status of the device; Determining whether the first command is executable according to the current state; If executable, then: According to the first command, determining whether the first command is executable; If it is executable, the judgment result is that the first command can be directly executed, and the first command is sent to the device; If it is not executable, the judgment result is that the first command cannot be directly executed; a queue creation module, configured to obtain, according to a first attribute of the first command, at least one second attribute associated with the first attribute; and generate, according to the at least one second attribute, a corresponding compensation command, wherein the compensation command is an associated command that must be executed by the device to execute the first command; Creating a command queue according to the first command and the compensation command; The device control module is used to control the device according to the command queue so that the first attribute of the device is adjusted accordingly.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method for controlling a device based on a compensation command according to any one of claims 1 to 5 are implemented.
8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for controlling a device based on compensation commands according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Intelligent household electrical appliance control method and device
CN105045222A
Method, device and equipment for controlling operation states of household electrical appliances and readable storage medium
CN108549246A