Voice control method and device for smart home and storage medium
By extracting device information fields and control logic fields from the voice control platform, the problem of voice control platform recognition failure or misrecognition in the prior art is solved, and the flexibility and accuracy are improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU HEMI TECHNOLOGY CO LTD
- Filing Date
- 2026-03-09
- Publication Date
- 2026-06-09
Smart Images

Figure CN122179259A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and in particular to a voice control method, device and storage medium for smart homes. Background Technology
[0002] With the rapid development of IoT and natural language processing technologies, smart homes have evolved from single-device systems to whole-house collaboration, and voice control has become the mainstream home control method due to its convenience. Currently, major technology companies have launched voice control platforms to enable voice control of the entire smart home system; the core technology involves controlling various home devices through natural voice commands.
[0003] In existing technologies, the device control logic of voice control platforms is based on fixed sentence patterns. This involves pre-enumerating multiple spoken expressions of the same intent and matching these pre-set sentences with the control voice to identify the intended command. However, this approach requires users to simultaneously issue control voice commands according to pre-set spoken expressions. The fixed input of the control voice lacks dynamic adaptability, making it prone to recognition failures or misrecognitions, severely impacting the flexibility and accuracy of voice control. Summary of the Invention
[0004] This application provides a voice control method, device, and storage medium for smart homes, which extracts device information fields and control logic fields from the user-input control voice information, accurately identifies the command intent of the control voice based on the device information fields and control logic fields, and generates corresponding device control commands. This solves the problem that the input form of control voice in the prior art is fixed and easy to misidentify, and ensures the flexibility and accuracy of voice control.
[0005] Firstly, this application provides a voice control method for smart homes, including:
[0006] Upon receiving control voice information, extract the device information field and the control logic field from the control voice information; The device identifier of the target device is determined based on the device information field, and the execution action information of the target device is determined based on the control logic field. Based on the device identifier and execution action information of the target device, a device control command for the target device is generated, and the device control command is sent to the target device to enable the target device to execute the device control command.
[0007] Secondly, a voice control device includes: One or more processors; A memory that stores one or more programs that, when executed by one or more processors, enable the one or more processors to implement the voice control method for smart homes as described in the first aspect.
[0008] Thirdly, a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the voice control method for a smart home as described in the first aspect.
[0009] In this application, upon receiving control voice information, device information fields and control logic fields are extracted from the control voice information; the device identifier of the target device is determined based on the device information fields, and the execution action information of the target device is determined based on the control logic fields; a device control command for the target device is generated based on the device identifier and execution action information, and the device control command is sent to the target device to execute the device control command. Through the above technical means, the core elements constituting the command intent, the device information fields and control logic fields, can be extracted from any control voice information, regardless of the user's sentence structure, achieving dynamic adaptation to voice input formats and accommodating diverse user voice expression habits. By clearly identifying the target device through the device information fields and the execution action of the target device through the control logic fields, and generating the device control command for the target device based on the target device identifier and execution action information, recognition errors of the device or action caused by mismatched or non-standard sentence structures are avoided, ensuring that the device control command matches the user's true intent. Figure 1 It achieves a balance between the flexibility and accuracy of voice control. Attached Figure Description
[0010] Figure 1 This is a flowchart of a voice control method for smart homes provided in an embodiment of this application; Figure 2 This is a flowchart illustrating the process of determining the device identifier of a target device, as provided in an embodiment of this application. Figure 3 This is a flowchart illustrating the process of determining the device identifier of a target device based on a region field, as provided in an embodiment of this application. Figure 4 This is a flowchart illustrating the process of determining the execution action information of the target device according to an embodiment of this application; Figure 5 This is a flowchart of controlling a target device through an IoT platform, provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a voice control device for smart homes provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a voice control device for smart homes provided in an embodiment of this application. Detailed Implementation
[0011] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. A process can be terminated when its operation is completed, but it may also have additional steps not included in the drawings. A process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0012] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0013] In common existing implementations, the device control logic of voice control platforms generally relies on fixed sentence patterns. This involves pre-enumerating multiple spoken expressions of the same intent and matching them with the control voice to identify the command intent. However, this approach requires users to simultaneously issue control voice commands according to preset spoken expressions. The fixed input of the control voice lacks dynamic adaptability, making it prone to recognition failures or misrecognitions, severely impacting the flexibility and accuracy of voice control.
[0014] To address the technical problems existing in the above-mentioned implementation methods, this embodiment proposes a voice control method for smart homes. The method aims to extract device information fields and control logic fields from the control voice information input by the user, accurately identify the command intent of the control voice based on the device information fields and control logic fields, and generate corresponding device control commands, thus balancing the flexibility and accuracy of voice control.
[0015] The voice control method provided in this embodiment can be executed by a voice control device, which can be implemented through software and / or hardware. The voice control device can consist of two or more physical entities, or it can consist of a single physical entity. For example, the voice control device can be a voice control platform, or it can be a smart home system composed of a voice control platform and various smart home devices.
[0016] The voice control device is equipped with at least one type of operating system, including but not limited to Android, Linux, and Windows. The voice control device can install at least one application based on the operating system; this application can be a built-in application of the operating system or an application downloaded from a third-party device or server. In this embodiment, the voice control device has at least one application capable of executing voice control methods.
[0017] For ease of understanding, this embodiment uses a voice control platform as the main body for executing the voice control method as an example for description.
[0018] Figure 1 A flowchart of a voice control method for smart homes, as provided in an embodiment of this application, is given. (Reference) Figure 1 The steps of this smart home voice control method include S110-S130: S110. Upon receiving control voice information, extract the device information field and control logic field from the control voice information.
[0019] The control voice information consists of the voice input by the user to the voice control platform for controlling smart home devices. Upon receiving the control voice information, the platform performs speech-to-text processing to obtain the corresponding control voice text. Device information fields and control logic fields are then extracted from the control voice text.
[0020] The device information field indicates the smart home device the user intends to control. The control logic field indicates the action the user intends to perform by controlling the smart home device. When extracting the device information and control logic fields from the control voice text, corresponding fields can be matched from the control voice text based on a pre-set device keyword library as device information fields, and corresponding fields can be matched from the control voice text based on a pre-set action keyword library as control logic fields. Alternatively, the control voice text can be semantically annotated using a pre-trained natural language model. When the semantic label of a word is "object," the word is determined as a device information field; when the semantic label of a word is "action," the word is determined as a control logic field.
[0021] Optionally, device information fields and control logic fields can be extracted from the control voice information using a preset regular expression rule base. The regular expression rule base includes multiple control voice templates, each marking the corresponding device information fields and control logic fields. The control logic fields can include function fields, action fields, and value fields. Function fields indicate the attributes to be adjusted, action fields indicate the actions to be performed, and value fields indicate the attribute values to be adjusted. For example, control voice templates in the regular expression rule base might include: "Open the curtains one-third," "Turn on the living room light," "Adjust the clothes dryer height to maximum," "Increase the brightness of the ambient light by 20%," "Adjust the dryer temperature to 50," etc. In these templates, "curtains," "light," "clothes dryer," and "dryer" are marked as device information fields; "open," "adjust to," "increase," and "adjust to" are marked as action fields in the control logic fields; "height," "brightness," and "temperature" are marked as function fields in the control logic fields; and "one-third," "maximum," "20%," and "20" are marked as value fields in the control logic fields. It can generate regular expression rules for various sentence structures based on control voice templates in the regular expression rule library. For example, the regular expression rule for "curtains open one-third" is "device information field" + "action field" + "value field", and the regular expression rule for "turn on the living room light" is "action field" + "device information field". The text corresponding to the converted control voice information is matched with each regular expression rule. Based on the positions of the marked device information field and control logic field in the control voice template corresponding to the successfully matched regular expression rule, the device information field and control logic field are extracted from the corresponding positions in the text. For example, if the converted text corresponding to the control voice information is "the brightness of the clothes dryer increases by 20%", it matches the regular expression rule "device information field" + "function field" + "action field" + "value field". Therefore, based on this regular expression rule, the device information field "clothes dryer", the function field "brightness", the action field "increase", and the value field "20%" are captured from "the brightness of the clothes dryer increases by 20%".
[0022] This embodiment uses the positioning rules of the pre-tagged device information field and control logic field in the control voice template in the regular expression rule base to quickly match the device information field and control logic field in the control voice information, without relying on complex model reasoning and semantic parsing, thus improving the field extraction efficiency.
[0023] In one embodiment, the voice control platform can employ some mainstream voice platforms currently on the market. These platforms have built-in voice recognition applications. The voice recognition application builds a regular expression rule library based on the user-input control voice template, and then uses this library to extract device information and control logic fields from the control voice information. Correspondingly, when the voice control platform extracts device information and control logic fields from the control voice information, the voice recognition application does so. That is, the voice recognition application runs regular expression parsing code to parse the user-provided control voice template, obtaining multiple regular expression rules. A regular expression rule library is built using these rules. The voice control platform then calls the application interface provided by the voice recognition application to transmit the text converted from the control voice information to the voice recognition application. The voice recognition application then extracts the device information and control logic fields from the text based on the regular expression rule library and returns the results. This embodiment utilizes the existing voice recognition application of the voice control platform to parse the user-provided control voice template to construct a corresponding regular expression rule library, thereby extracting device information and control logic fields from the control voice information without the need to develop additional field extraction code, thus reducing development costs.
[0024] S120. Determine the device identifier of the target device based on the device information field, and determine the execution action information of the target device based on the control logic field.
[0025] The target device is the smart home device that the user wants to control by voice. The device information field can be the device name field. The device name field can be matched with the device names of various preset smart home devices, and the smart home device whose name matches the target device can be used to obtain the corresponding device identifier.
[0026] Optionally, when a user controls smart home devices via voice, they may use aliases or general categories for the devices. In this case, the device name field extracted from the voice control information may point to these aliases or general categories. To more accurately match the target device pointed to by the device name field, the matching smart home device can be determined by matching the device name field with the aliases and general categories of various smart home devices, thus identifying the device identifier of the target device. Specifically, Figure 2 This is a flowchart illustrating the process of determining the device identifier of a target device, as provided in an embodiment of this application. Figure 2 As shown, the step of determining the device identifier of the target device specifically includes S1201-S1203: S1201. Match the device name field in the device information field with the device name of each device.
[0027] In this system, the device names of smart home devices are user-defined aliases such as "Little Lamp" or "Little Dryer." For example, multiple information tables for smart home devices are pre-created. These tables record the device identifier, device name, and type name for each smart home device, and these identifiers are stored together in the same row of the information tables. The device name field is then matched against the device names of each smart home device in the information tables to determine if a particular smart home device's device name matches.
[0028] S1202. If a match is successful, the device identifier associated with the matched device name and saved is determined as the device identifier of the target device.
[0029] For example, when the device name field is the same as the device name of a smart home device, it is confirmed that the device name field matches the device name of the smart home device. The smart home device with the same device name as the device name field is identified as the target device, and then the device identifier associated with the device name of the target device is obtained in the information table.
[0030] S1203. If the matching fails, match the device name field with the type name of each device, and determine the device identifier of the target device from the device identifiers associated with the matched type names.
[0031] The type names of smart home devices are common general terms for device types, such as lights, televisions, and clothes dryers. For example, if the device name field differs from the device name of any smart home device, it indicates a match failure. In this case, the device name field is not an alias used by the user but a general term for the type. The device name field can then be matched against the type names of all smart home devices in the information table to identify the smart home device whose type name matches the device name field.
[0032] Generally, users will use device aliases to quickly point to a specific smart home device, while using a generic type name may indicate an intention to control all smart home devices of that type. For example, if a user says "turn on the lights" upon arriving home, they may want to turn on all the lights in the house. Therefore, after identifying the smart home devices that match the type name and device name fields, these devices can be designated as target devices, allowing the device identifier of the target device to be retrieved from the information table.
[0033] This embodiment utilizes the device name field to prioritize matching the device alias of smart home devices and the device name field to fall back on matching the type name of smart home devices, thereby improving the error tolerance of target device identification and reducing the probability of matching failure.
[0034] Furthermore, the device information field also includes a region field, which allows the target device to be identified from the smart home devices corresponding to the type name matched in the device name field based on the region field. Specifically, Figure 3 This is a flowchart illustrating the process of determining the device identifier of a target device based on a region field, as provided in an embodiment of this application. Figure 3 As shown, the step of determining the device identifier of the target device based on the region field specifically includes S12031-S12033: S12031. If a type name is matched in the device name field, the device identifier associated with the matched type name and saved is determined as the device identifier of the target device.
[0035] For example, if the type general term corresponding to the device name field matches only one type name in the information table, it indicates that only one smart home device of that type is installed in the house. For instance, if there is only one television in the house, then when the user says the type general term "television", only that television will be matched. This uniquely matched smart home device is then identified as the target device, and the device identifier of the target device is retrieved from the information table.
[0036] S12032. If multiple type names are matched in the device name field, determine whether the device information field contains the region field.
[0037] For example, when the type general term corresponding to the device name field matches multiple type names in the information table, it indicates that multiple smart home devices of that type are installed in the house. For instance, if a house has multiple lights, the user saying the type general term "lights" will match all the lights in the house. In this case, the area field in the device information field can be further combined to determine which area the user intends to turn on. However, users often omit the area when entering control device information. Therefore, the device information field cannot guarantee that it will always contain the area field. Thus, before determining which area of smart home devices the user intends to turn on, it's necessary to first determine whether the device information field contains the area field.
[0038] S12033. If the device information field contains a region field, the device identifier that is associated with the type name in the region corresponding to the region field and saved is determined as the device identifier of the target device.
[0039] The region and device name fields in the device information field can be extracted previously using a regular expression rule base. The information table records the region to which each smart home device belongs, such as living room, balcony, toilet, and master bedroom. When the device information field contains a region field, it indicates that the user intends to turn on the smart home device in the region corresponding to that region field. This identifies smart home devices in the information table whose region matches the region field and whose type name matches the device name field as target devices. The device identifier of the target device is then retrieved from the same row of the information table. For example, when the device name field is "lamp" and the region field is "living room," the target device is determined to be the lamp in the living room.
[0040] In this embodiment, when the type name pointed to by the device name field matches the type names of multiple smart home devices, the region field in the device information field is combined to accurately match the region device that the user intends to control as the target device among the multiple smart home devices. This refines the dimensions of device information and provides support for the accurate identification of the target device, thereby ensuring the accuracy of voice control.
[0041] Furthermore, if the device information field does not include a region field, and the user intends to control all smart home devices pointed to by the device name field throughout the house, then multiple smart home devices corresponding to the type name matched by the device name field can be identified as target devices, thereby obtaining the device identifier of the target device in the information table.
[0042] Optionally, the system can prompt the user to input the region information of the target device, thereby identifying the target device based on the input region information. Specifically, if the device information field does not include a region field, a region inquiry voice is output to instruct the user to input the region information of the target device. Upon receiving the user's input region information, the system associates the device identifier with the matching type name in the corresponding region with the device identifier of the target device. If the voice control platform confirms that the currently received control voice information does not include a region field, it retrieves a preset region inquiry voice, such as "Which region's device do you want to control?", and plays the voice inquiry voice through a speaker. After hearing the region inquiry voice, the user can reply with the corresponding region information, such as "living room" or "master bedroom." After receiving the user's reply with region information, the voice control platform matches the region information in the information table, identifies smart home devices whose region matches the region information and whose type name matches the device name field, and identifies these smart home devices as the target devices, thereby retrieving the device identifier of the target device in the same row.
[0043] In this embodiment, when the device information field does not involve the region field, the user is asked to input the region information through voice inquiry. This allows for accurate identification of the target device that the user intends to control by combining the region information and the device name field, thereby improving the matching success rate of the target device. It also eliminates the need for the user to re-enter a complete sentence for voice control, thus improving the convenience of voice control.
[0044] The voice control platform can determine the device identifier and execution action information of the target device in parallel.
[0045] However, the determination of the execution action information may require the use of control parameters related to the target device. In this regard, the voice control platform can first determine the device identifier of the target device and then determine the execution action information of the target device to ensure the accuracy of the execution action information of the target device.
[0046] Control logic fields can be action fields. Action fields can be defined as the execution action information of the target device. For example, if the action field is "open", then the execution action information of the target device is "open".
[0047] Optionally, in addition to action fields, control logic fields may also include function fields and numerical fields. Function fields indicate the function of the target device, such as disinfection, lighting, and drying. Numerical fields specify the attribute value corresponding to a function in the target device, such as the brightness value for the lighting function and the temperature value for the drying function. It can be understood that when the control logic field only contains action fields or only contains function and action fields, the target device only needs to perform simple actions such as switching the device on or off. However, once the control logic field involves numerical fields, the target device needs to perform complex actions such as adjusting function attribute values. Therefore, the control type can be determined based on the field types contained in the control logic field, and the control type combined with the field content can determine the execution action information of the target device. Specifically… Figure 4 This is a flowchart illustrating the action information for determining the target device provided in an embodiment of this application. For example... Figure 4 As shown, the steps for determining the execution action information of the target device specifically include S1204-S1206: S1204. Determine the associated target attribute identifier in the preset functional attribute table based on the type name of the target device or the functional field in the control logic field. The functional attribute table records the attribute identifiers associated with various devices and their various functional fields.
[0048] The target attribute identifier refers to the attribute of the target device that the user intends to control, such as height, brightness, and temperature. For example, Table 1 is a table of functional attributes related to clothes drying racks provided in an embodiment of this application.
[0049] Table 1
[0050] As shown in Table 1, the clothes dryer includes multiple functions. The function attribute table records the functions, actions, attribute identifiers, and attribute values of the clothes dryer through multiple rows. The attribute identifier associated with the function and the same row is the attribute type of the corresponding controlled device when the function is started or stopped. For example, the device attribute controlled by the lighting function is brightness, and the device attribute controlled by the drying function is temperature. The function column in the function attribute table can be used to match the function field in the control logic field, and the action column in the function attribute table can be used to match the action field in the logic field. It can be understood that after determining that the target device is a clothes dryer, the corresponding table row for the clothes dryer can be determined in the function attribute table. Then, it is determined whether the control logic field contains a function field. If it does not contain a function field, the cells in the table row corresponding to the clothes dryer whose function column is empty are determined. For example, if the cells in the first and second rows of the function column in Table 1 are empty, the attribute identifier in the attribute column of the same row of the cell is determined as the target attribute identifier. If the control logic field contains a function field, the function field is matched with the contents of the cells in each function column of the table row corresponding to the clothes dryer. If a match is successful, the attribute identifier in the attribute column of the same row of the matching cell is determined as the target attribute identifier. For example, if the function field matches the disinfection of the clothes drying rack, then the attribute identifier "frequency" associated with disinfection will be determined as the target attribute identifier.
[0051] S1205. Determine the control type based on the action field and / or numeric field in the control logic field, and determine the target attribute value corresponding to the target attribute identifier based on the control type.
[0052] The target attribute value is the attribute value that the user intends to achieve by controlling the target device. For example, after determining the target attribute identifier, the control type can be determined as simple on / off control or complex parameter adjustment control based on the action field and / or numerical field in the control logic field. When the control type is simple on / off control, the target attribute value corresponding to the target attribute identifier is retrieved from the function attribute table. When the control type is complex parameter adjustment control, the attribute value corresponding to the target attribute identifier is determined through the numerical field.
[0053] In this embodiment, when the action field in the control logic field is a switch-type action field, if the control logic field does not include a numerical field, the control type is determined to be switch control; if the control logic field includes a numerical field, the control type is determined to be parameter adjustment control. When the action field in the control logic field is an adjustment-type action field or an increase / decrease-type action field, the control type is determined to be parameter adjustment control. Switch-type action fields are fields such as "open" or "close" where a single action can be clearly expressed without a numerical value. Adjustment-type action fields are fields such as "adjust to" or "adjust to" where a single action requires a numerical value to clearly express its meaning. Increase / decrease-type action fields are incremental actions such as "increase," "decrease," "raise," or "lower." For example, when the action field is a switch-type action field and the control logic field does not include a numerical field, it indicates that the user intends to control the target device to perform a simple switch action, thus determining the control type as switch control. When the action field is a switch-type action field and the control logic field includes a numerical field, or when the action field is an adjustment-type action field or an increase / decrease-type action field, it indicates that the user intends to control the target device to perform a complex attribute adjustment action, thus determining the control type as parameter adjustment control. This embodiment utilizes the classification of action fields combined with whether the control logic fields contain numerical fields to quickly determine whether the control type of the target device's execution action is a simple switch control or a complex parameter adjustment control, balancing the efficiency and accuracy of control type determination.
[0054] After determining the control type of the action to be executed, the target attribute value corresponding to the target attribute identifier can be determined based on the functional attribute table or the numerical field. Specifically, when the control type is switch control, the attribute value associated with the switch action field and the target attribute identifier in the functional attribute table is determined as the target attribute value; when the control type is parameter adjustment control, the target attribute value is determined based on the action field and the numerical field in the control logic field. Referring to Table 1, assuming the clothes dryer is the target device and its target attribute identifier is height. When the control type of the action to be executed is switch control, if the switch action field in the control logic field is "on", then the attribute value "1" stored in the same row as the "on" action and the "height" attribute identifier in the functional attribute table is obtained as the target attribute value. If the control type of the action to be executed is parameter adjustment control, then the specific height of the clothes dryer is determined as the attribute value based on the action field and the numerical field. When the action field is not an increase or decrease action field, the specific number pointed to by the numerical field can be directly determined as the target attribute value of the target attribute identifier. For example, if the action field is "rise to" and the numerical field is "100", then "100" is determined as the target attribute value of the height target attribute identifier. When the action field is an increase or decrease action field, the specific number pointed to by the numerical field can be added to or subtracted from the current attribute value of the target attribute identifier, and the result of the addition or subtraction is used as the target attribute value of the target attribute identifier. For example, if the action field is "rise" and the numerical field is "10", and the current height of the clothes dryer is 50, then the numerical field "10" is added to the current height "50" to get 60, and 60 is the target attribute value. In a simple switch control scenario, this embodiment directly queries the functional attribute table to quickly obtain the target attribute value associated with the target attribute identifier without complex calculations. This improves the efficiency of attribute value determination and avoids calculation deviations caused by the lack of numerical values, thus improving the stability of switch control. In complex parameter adjustment and control scenarios, the target attribute value is accurately calculated by combining action fields and numerical fields, ensuring that the target attribute value is highly matched with the user's control intention, thus guaranteeing the accuracy of parameter adjustment and control.
[0055] It should be noted that different smart home devices have different adjustable attribute ranges. It is necessary to ensure that the target attribute value in the parameter adjustment control scenario is within the attribute range of the smart home device, thereby ensuring the safety and compliance of the actions performed by the target device. Accordingly, when determining the target attribute value, it can be determined based on the preset attribute range of the target device and the action field and value field in the control logic field. For example, if the action field is not an increase / decrease action field, the target attribute value is determined based on the value field and the preset attribute range of the target device; if the action field is an increase / decrease action field, the attribute change value is determined based on the value field, the increase / decrease action field, and the preset attribute range of the target device, and the sum of the attribute change value and the original attribute value is determined as the target attribute value. The preset attribute range can be recorded in a device attribute range table, that is, the device attribute range table associates and stores the device identifier, attribute identifier, and preset attribute range of each smart home device. Table 2 is the device attribute range table provided in the embodiments of this application.
[0056] Table 2
[0057] As shown in Table 2, the device attribute range table stores the device description, attribute identifier, and corresponding upper and lower limit values of the attribute in the same row for each target device. The upper and lower limit values of the target device's attribute related to the target attribute identifier can be obtained by querying the device attribute range table using the target device's device identifier. It should be noted that even devices of the same type may have different attribute ranges. Therefore, the device attribute range table stores the attribute range of the corresponding device by associating it with the device identifier that uniquely represents the device, ensuring the accurate acquisition of the target device's preset attribute range.
[0058] When the target device's execution action is not an increase or decrease type action field, the attribute value calculation strategy can be determined based on the type of the numerical field. The target attribute value is then determined based on the attribute value calculation strategy, the content of the numerical field, and the attribute's upper and lower limits. Specifically, when the numerical field is a ratio field, the product of the preset attribute range and the ratio field is determined, and the sum of this product and the lower limit of the preset attribute range is determined as the target attribute value. When the numerical field is a number field, if the number field is within the preset attribute range, the number field is determined as the target attribute value; otherwise, the upper or lower limit of the preset attribute range is determined as the target attribute value. When the numerical field is an extreme value field, the upper or lower limit of the preset attribute range corresponding to the extreme value field is determined as the target attribute value. Ratio fields include fields involving percentages such as "10%" and "one-third". When the numerical field is a ratio field, the attribute range can be obtained by subtracting the attribute lower limit from the attribute upper limit value. The product of the attribute range and the ratio field is then determined, and the sum of this product and the attribute lower limit is determined as the target attribute value. For example, if the upper and lower limits of the target attribute identifier "Brightness" are 200 and 100 respectively, obtained from Table 1, the attribute range can be determined to be 100. If the numeric field is "10%", then the product of the attribute range and the numeric field is 10. Adding the product to the lower limit yields 110, which is the target attribute value. Numeric fields are fields with explicit numbers such as 100 and 50. When a numeric field is a number, it can be determined whether the number is greater than the upper limit or less than the lower limit. If it is greater than the upper limit, the upper limit is determined as the target attribute value; if it is less than the lower limit, the lower limit is determined as the target attribute value. Extreme value fields are fields with the meaning of maximum, minimum, etc., such as maximum value and minimum value. When the numeric field is a maximum extreme value field, the upper limit can be determined as the target attribute value; when the numeric field is a minimum extreme value field, the lower limit can be determined as the target attribute value. This embodiment provides different attribute value calculation strategies for different numerical types to adapt to different types of numerical fields, accommodate users' diverse numerical expression habits, and ensure the accuracy and rationality of parameter adjustment and control.
[0059] When the target device's action is an increment / decrement action field, the calculation strategy for the attribute change value can be determined based on the type of the numeric field. The attribute change value is calculated according to the calculation strategy and the content of the numeric field, and the sum of the attribute change value and the original attribute value is determined as the target attribute value. The original attribute value is the current attribute value of the target attribute identifier on the target device. Specifically, when the numeric field is a ratio field, the product of the preset attribute range and the ratio field is determined. If the increment / decrement action field is an increment action field, the product is determined as the attribute change value; if it is a decrement action field, the negative of the product is determined as the attribute change value. When the numeric field is a number field, if the increment / decrement action field is an increment action field, the number field is determined as the attribute change value; if it is a decrement action field, the negative of the number field is determined as the attribute change value. If the sum of the attribute change value and the original attribute value is less than the attribute's upper limit but greater than its lower limit, the sum is determined as the target attribute value. If the sum of the attribute change value and the original attribute value is greater than the attribute's upper limit value, then the attribute's upper limit value is determined as the target attribute value. If the sum of the attribute change value and the original attribute value is less than the attribute's lower limit value, then the attribute's lower limit value is determined as the target attribute value.
[0060] This embodiment further refines the rules for determining target attribute values in parameter adjustment control scenarios based on non-increase / decrease action fields and increase / decrease action fields. While adapting to diverse parameter adjustment needs, it ensures the accuracy and compliance of parameter adjustment control and avoids control deviations and abnormal control.
[0061] S1206. Generate the execution action information of the target device based on the target attribute identifier and the target attribute value.
[0062] For example, after determining the target attribute identifier and target attribute value of the target device, the target attribute identifier and target attribute value are organized into structured information, and the structured information is used as the execution action information of the target device.
[0063] This embodiment utilizes the function field, action field, and attribute field of the control logic field to determine the target attribute identifier and target attribute value of the target device, so as to accurately obtain the core requirements in the execution action information and ensure the reliability of the generation of control commands.
[0064] S130. Generate device control instructions for the target device based on the device identifier and execution action information of the target device, and send the device control instructions to the target device to enable the target device to execute the device control instructions.
[0065] For example, after determining the device identifier and execution action information of the target device, the voice control platform converts the device identifier and execution action information of the target device into a device control command for controlling the corresponding target device to perform the corresponding action. The voice control platform sends the device control command to the target device, and the target device responds to the device control command to perform the corresponding action.
[0066] In one embodiment, when the voice control platform is one of the mainstream voice platforms currently on the market, it calls a voice recognition application to extract the device information field and control logic field from the control voice information. Then, it calls the device control interface provided by the device control application to transmit the device information field and control logic field to the device control application; the device control application then generates device control commands based on the device information field and control logic field. Here, the device control application is the application used in this embodiment on the voice control platform to convert the device information field and control logic field into voice control commands, and the device control interface is the application interface used by the device control application to obtain the device information field and control logic field. After the voice recognition application extracts the device information field and control logic field, it calls the device control interface to transmit the device information field and control logic field to the device control application. After receiving the device information field and control logic field, the device control application can execute step S120 to determine the device identifier and execution action information of the target device, generate device control commands based on the device identifier and execution action information, and return the device control commands to the voice control platform. The voice control platform then sends the device control commands to the target device so that the target device executes the corresponding device control commands. This embodiment installs a device control application on a mainstream voice platform. By combining the device control application with the voice recognition application built into the voice platform, control voice information is accurately converted into device control commands, effectively reducing development costs and difficulty.
[0067] It's important to note that most smart home devices are controlled through an IoT platform. However, the commands of these IoT platforms are incompatible with those of voice control platforms. Directly sending control commands generated by the voice control platform to the IoT platform will result in the commands being unprocessed and ineffective. Therefore, control commands can be generated based on the target device's IoT platform and conform to its command requirements. These commands can then be sent to the IoT platform, enabling voice control of the target device. Specifically... Figure 5 This is a flowchart illustrating the control of a target device via an IoT platform, as provided in an embodiment of this application. Figure 5 As shown, the steps for controlling the target device through the IoT platform specifically include S1301-S1302: S1301. Determine the target IoT platform to which the target device belongs based on the device identifier of the target device, and generate native device control commands for the target IoT platform based on the device identifier and execution action information of the target device.
[0068] The target IoT platform refers to the IoT platform to which the target device belongs. For example, a device platform table can be used to record the device identifier of each target device and the platform identifier of its respective IoT platform. The device identifier of the target device and the platform identifier of its respective IoT platform are stored in the same row. The IoT platform corresponding to the platform identifier stored in the same row of the device platform table can be used to determine the target IoT platform. Then, native device control commands for the target IoT platform are generated based on the native command template of the target IoT platform, the device identifier of the target device, and the execution action information.
[0069] S1302. Call the device control interface of the target IoT platform to pass the native device control command to the target IoT platform, so that the target IoT platform forwards the native device control command to the target device for execution.
[0070] The device control interface is an API interface used by the target IoT platform to obtain control commands for the smart home devices it connects to. After generating native device control commands for the target IoT platform, the target IoT platform's device control interface can be called to transmit the native device control commands to the target IoT platform. The target IoT platform parses the device identifier in the native device control commands and forwards the native device control commands to the corresponding target device for execution based on the device identifier, thereby completing the voice control of the target device.
[0071] In this embodiment, under control scenarios where different smart home devices originate from different IoT platforms, the target IoT platform to which the target device is connected is accurately located through device identification. This generates native device control commands adapted to the target IoT platform, enabling the target IoT platform to achieve voice control of the target device through the native device control commands. This achieves unified voice control of smart home devices from different IoT platforms and improves the voice control platform's collaborative adaptation capability for all home appliances.
[0072] In summary, the smart home voice control method provided in this application extracts device information fields and control logic fields from the received control voice information; determines the device identifier of the target device based on the device information fields, and determines the execution action information of the target device based on the control logic fields; generates a device control command for the target device based on the device identifier and execution action information, and sends the device control command to the target device to execute the device control command. Through the above technical means, the core elements constituting the command intent, device information fields and control logic fields, can be extracted from any control voice information, regardless of the user's sentence structure, achieving dynamic adaptation to voice input formats and accommodating diverse user voice expression habits. By clearly identifying the target device through the device information fields and the execution action of the target device through the control logic fields, and generating the device control command for the target device based on the target device identifier and execution action information, the method avoids recognition errors of devices or actions caused by mismatched or non-standard sentence structures, ensuring that the device control command matches the user's true intent. Figure 1 It achieves a balance between the flexibility and accuracy of voice control.
[0073] Based on the above embodiments, Figure 6 This is a schematic diagram of the structure of a voice control device for smart homes, provided as an embodiment of this application. (Reference) Figure 6 The smart home voice control device provided in this embodiment specifically includes: a field extraction module 21, a field processing module 22, and an instruction generation module 23.
[0074] The field extraction module 21 is configured to extract device information field and control logic field from control voice information when receiving control voice information. The field processing module 22 is configured to determine the device identifier of the target device based on the device information field and to determine the execution action information of the target device based on the control logic field. The instruction generation module 23 is configured to generate device control instructions for the target device based on the device identifier and execution action information of the target device, and send the device control instructions to the target device to enable the target device to execute the device control instructions.
[0075] Based on the above embodiments, the field extraction module 21 includes: a field extraction submodule, configured to extract device information fields and control logic fields from control voice information through a preset regular expression rule library, wherein the regular expression rule library includes multiple control voice templates, and the control voice templates mark the corresponding device information fields and control logic fields.
[0076] Based on the above embodiments, the device information field includes a device name field; correspondingly, the field processing module 22 includes: a name matching submodule, configured to match the device name field in the device information field with the device names of each device; a first identifier determination submodule, configured to determine the device identifier of the target device from the device identifier associated with the matched device name if the match is successful; and a second identifier determination submodule, configured to match the device name field with the type name of each device if the match fails, and determine the device identifier of the target device from the device identifier associated with the matched type name.
[0077] Based on the above embodiments, the device information field includes a region field; correspondingly, the second identifier determination submodule includes: a first identifier determination unit, configured to determine the device identifier associated with the matching type name and stored as the device identifier of the target device when the device name field matches a type name; a region field judgment unit, configured to determine whether the device information field contains a region field when the device name field matches multiple type names; a third identifier determination unit, configured to determine the device identifier associated with the matching type name in the region corresponding to the region field and stored as the device identifier of the target device when the device information field contains a region field; correspondingly, the second identifier determination submodule also includes: a region query output unit, configured to output a region query voice when the device information field does not contain a region field after determining whether the device information field contains a region field, the region query voice being used to instruct the user to input the region information to which the target device belongs; and a fourth identifier determination unit, configured to determine the device identifier associated with the matching type name in the region corresponding to the region information and stored as the device identifier of the target device when the region information is received from the user.
[0078] Based on the above embodiments, the control logic field includes a function field, an action field, and a value field; correspondingly, the field processing module 22 includes: an attribute identifier determination submodule, configured to determine the associated target attribute identifier in a preset function attribute table based on the type name of the target device or the function field in the control logic field, the function attribute table recording the attribute identifiers associated with various devices and their various function fields; an attribute value determination submodule, configured to determine the control type based on the action field and / or value field in the control logic field, and determine the target attribute value corresponding to the target attribute identifier based on the control type; and an action information generation submodule, configured to generate the execution action information of the target device based on the target attribute identifier and the target attribute value.
[0079] Based on the above embodiments, the control types include switch control and parameter adjustment control; correspondingly, the attribute value determination submodule includes: a first control type determination unit, configured to determine the control type as switch control if the control logic field does not include a numerical field, and determine the control type as parameter adjustment control if the control logic field includes a numerical field, when the action field in the control logic field is a switch-type action field; a second control type determination unit, configured to determine the control type as parameter adjustment control when the action field in the control logic field is an adjustment-type action field or an increase / decrease-type action field; correspondingly, the attribute value determination submodule includes: a first attribute value determination unit, configured to determine the attribute value associated with the switch-type action field and the target attribute identifier in the function attribute table as the target attribute value when the control type is switch control; and a second attribute value determination unit, configured to determine the target attribute value based on the action field and the numerical field in the control logic field when the control type is parameter adjustment control.
[0080] Based on the above embodiments, the first attribute value determination unit includes: a first attribute value determination subunit, configured to determine a target attribute value based on a numerical field and a preset attribute range of the target device when the action field is not an increase / decrease type action field; and a second attribute value determination subunit, configured to determine an attribute change value based on a numerical field, an increase / decrease type action field, and a preset attribute range of the target device when the action field is an increase / decrease type action field, and to determine the sum of the attribute change value and the original attribute value as the target attribute value; correspondingly, the first attribute value determination subunit is specifically configured to: determine the product of the magnitude of the preset attribute range and the ratio field when the numerical field is a ratio field, and determine the sum of the product and the lower limit of the preset attribute range as the target attribute value; determine the target attribute value when the numerical field is a number field, if the number field is within the preset attribute range, determine the number field as the target attribute value, otherwise determine the upper or lower limit of the preset attribute range as the target attribute value; and determine the target attribute value when the numerical field is an extreme value field, the upper or lower limit of the preset attribute range corresponding to the extreme value field as the target attribute value.
[0081] Based on the above embodiments, the instruction generation module 23 includes: an instruction generation submodule, configured to determine the target IoT platform to which the target device belongs based on the device identifier of the target device, and generate native device control instructions for the target IoT platform based on the device identifier and execution action information of the target device; and an instruction sending submodule, configured to call the device control interface of the target IoT platform to transmit the native device control instructions to the target IoT platform, so that the target IoT platform forwards the native device control instructions to the target device for execution.
[0082] The smart home voice control device provided in this application, upon receiving control voice information, extracts device information fields and control logic fields from the control voice information; determines the device identifier of the target device based on the device information fields, and determines the execution action information of the target device based on the control logic fields; generates a device control command for the target device based on the device identifier and execution action information, and sends the device control command to the target device to enable the target device to execute the device control command. Through the above technical means, the core elements constituting the command intent, device information fields and control logic fields, can be extracted from any control voice information, regardless of the user's sentence structure, achieving dynamic adaptation to voice input formats and adapting to diverse user voice expression habits. By clearly defining the target device through the device information fields and the execution action of the target device through the control logic fields, and generating device control commands for the target device based on the target device identifier and execution action information, errors in device or action recognition caused by mismatched or non-standard sentence structures are avoided, ensuring that the device control commands match the user's true intent. Figure 1 It achieves a balance between the flexibility and accuracy of voice control.
[0083] The smart home voice control device provided in this application embodiment can be used to execute the smart home voice control method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0084] Figure 7 This is a schematic diagram of the structure of a voice control device for smart homes provided in an embodiment of this application, with reference to... Figure 7 The voice control device includes a processor 31, a memory 32, a communication device 33, an input device 34, and an output device 35. The number of processors 31 and the number of memories 32 in the voice control device can be one or more. The processor 31, memory 32, communication device 33, input device 34, and output device 35 of the voice control device can be connected via a bus or other means.
[0085] The memory 32, as a computer-readable storage medium, can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the voice control method of a smart home in any embodiment of this application (e.g., field extraction module 21, field processing module 22, and instruction generation module 23 in a smart home voice control device). The memory 32 may primarily include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on device usage, etc. Furthermore, the memory 32 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0086] The communication device 33 is used for data transmission.
[0087] The processor 31 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 32, thereby realizing the above-mentioned smart home voice control method.
[0088] Input device 34 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the device. Output device 35 may include display devices such as a display screen.
[0089] The voice control device provided above can be used to execute the voice control method for smart homes provided in the above embodiments, and has corresponding functions and beneficial effects.
[0090] This application embodiment also provides a storage medium containing computer-executable instructions. When executed by a computer processor, the computer-executable instructions are used to perform a voice control method for a smart home. The voice control method for a smart home includes: upon receiving control voice information, extracting a device information field and a control logic field from the control voice information; determining a device identifier of a target device based on the device information field, and determining execution action information of the target device based on the control logic field; generating a device control instruction for the target device based on the device identifier and execution action information of the target device, and sending the device control instruction to the target device to cause the target device to execute the device control instruction.
[0091] Storage medium – any type of memory device or storage device. The term “storage medium” is intended to include: mounting media, such as CD-ROM, floppy disk, or magnetic tape devices; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. Storage medium may also include other types of memory or combinations thereof. Furthermore, storage medium may reside in a first computer system in which the program is executed, or it may reside in a different second computer system connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term “storage medium” can include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). Storage medium may store program instructions (e.g., specifically implemented as a computer program) executable by one or more processors.
[0092] Of course, the computer-executable instructions provided in the embodiments of this application are not limited to the smart home voice control method described above, but can also execute related operations in the smart home voice control method provided in any embodiment of this application.
[0093] The smart home voice control device, storage medium, and voice control equipment provided in the above embodiments can execute the smart home voice control method provided in any embodiment of this application. For technical details not described in detail in the above embodiments, please refer to the smart home voice control method provided in any embodiment of this application.
[0094] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
[0095] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of this application. The scope of this application is determined by the scope of the claims.
Claims
1. A voice control method for smart homes, characterized in that, include: Upon receiving control voice information, extract the device information field and the control logic field from the control voice information; The device identifier of the target device is determined based on the device information field, and the execution action information of the target device is determined based on the control logic field. Based on the device identifier and execution action information of the target device, a device control command for the target device is generated, and the device control command is sent to the target device to enable the target device to execute the device control command.
2. The voice control method for smart homes according to claim 1, characterized in that, The step of extracting device information fields and control logic fields from the control voice information includes: The device information field and control logic field are extracted from the control voice information using a preset regular expression rule base. The regular expression rule base includes multiple control voice templates, and the control voice templates mark the corresponding device information field and control logic field.
3. The voice control method for smart homes according to claim 1, characterized in that, The device information field includes a device name field; correspondingly, determining the device identifier of the target device based on the device information field includes: Match the device name field in the device information field with the device name of each device; If a match is successful, the device identifier associated with the matched device name and saved will be used as the device identifier of the target device. If a match fails, the device name field is matched with the type name of each device, and the device identifier of the target device is determined from the device identifiers associated with the matched type names.
4. The voice control method for smart homes according to claim 3, characterized in that, The device information field includes a region field; correspondingly, determining the device identifier of the target device from the device identifiers associated with the matching type name includes: If a type name is matched in the device name field, the device identifier associated with the matched type name and stored therein will be determined as the device identifier of the target device. If the device name field matches multiple type names, determine whether the device information field contains a region field; If the device information field contains a region field, the device identifier associated with the type name in the region corresponding to the region field is determined as the device identifier of the target device. Accordingly, after determining whether the device information field contains a region field, the method further includes: If the device information field does not include a region field, a region query voice is output, which is used to instruct the user to input the region information to which the target device belongs. Upon receiving the region information input by the user, the device identifier associated with the matching type name in the region is determined as the device identifier of the target device.
5. The voice control method for smart homes according to claim 1, characterized in that, The control logic fields include function fields, action fields, and value fields; correspondingly, determining the execution action information of the target device based on the control logic fields includes: Based on the type name of the target device or the function field in the control logic field, the associated target attribute identifier is determined in a preset function attribute table. The function attribute table records the attribute identifiers associated with various devices and their various function fields. The control type is determined based on the action field and / or numerical field in the control logic field, and the target attribute value corresponding to the target attribute identifier is determined based on the control type. The execution action information of the target device is generated based on the target attribute identifier and the target attribute value.
6. The voice control method for smart homes according to claim 5, characterized in that, The control types include switch control and parameter adjustment control; Accordingly, determining the control type based on the action field and / or numerical field in the control logic field includes one or more of the following: If the action field in the control logic field is a switch action field, and the control logic field does not include a numerical field, then the control type is determined to be switch control; if the control logic field includes a numerical field, then the control type is determined to be parameter adjustment control. If the action field in the control logic field is an adjustment action field or an increase / decrease action field, the control type is determined to be parameter adjustment control; Accordingly, determining the target attribute value corresponding to the target attribute identifier based on the control type includes: When the control type is switch control, the attribute value associated with the switch action field and the target attribute identifier in the function attribute table is determined as the target attribute value; When the control type is parameter adjustment control, the target attribute value is determined based on the action field and the numerical field in the control logic field.
7. The voice control method for smart homes according to claim 6, characterized in that, Determining the target attribute value based on the action field and numerical field in the control logic field includes: If the action field is not an increase or decrease action field, the target attribute value is determined based on the numerical field and the preset attribute range of the target device; When the action field is an addition or subtraction action field, the attribute change value is determined based on the numerical field, the addition or subtraction action field, and the preset attribute range of the target device, and the sum of the attribute change value and the original attribute value is determined as the target attribute value. Accordingly, determining the target attribute value based on the numerical field and the preset attribute range of the target device includes: When the numerical field is a ratio field, the product of the preset attribute range and the ratio field is determined, and the sum of the product and the lower limit of the preset attribute range is determined as the target attribute value. If the numerical field is a numeric field, and the numeric field is within a preset attribute range, then the numeric field is determined as the target attribute value; otherwise, the upper or lower limit of the preset attribute range is determined as the target attribute value. When the numerical field is an extreme value field, the upper or lower limit of the preset attribute range corresponding to the extreme value field is determined as the target attribute value.
8. The voice control method for smart homes according to claim 1, characterized in that, The step of generating a device control command for the target device based on the device identifier and execution action information of the target device, and sending the control command to the target device to cause the target device to execute the device control command, includes: The target IoT platform to which the target device belongs is determined based on the device identifier of the target device, and native device control instructions of the target IoT platform are generated based on the device identifier of the target device and the execution action information. The device control interface of the target IoT platform is invoked to transmit the native device control command to the target IoT platform, so that the target IoT platform forwards the native device control command to the target device for execution.
9. A voice control device, characterized in that, include: One or more processors; A memory that stores one or more programs, which, when executed by one or more processors, enable the one or more processors to implement the voice control method for smart homes as described in any one of claims 1-8.
10. A storage medium containing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the voice control method for smart homes as described in any one of claims 1-8.