Smart home equipment control method and device, electronic equipment and storage medium
By creating object models and dynamic link libraries to unified control of smart home devices, the problem of inconsistency between devices of different brands is solved, and flexible unified control of devices and simplified user interaction is achieved.
Patent Information
- Application Number
- CN202411625273.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-11-14
AI Technical Summary
Due to the lack of common standard protocols between different smart home devices, users face the problems of operational complexity and the inability to achieve unified control when using multi-brand devices.
By responding to the access operation of smart home devices, the attribute information of the device, including the device type, and creating object models and dynamic link libraries based on this information, thereby achieving unified control of smart home devices.
It realizes unified control of the same type of smart home devices through the same object model, and realizes the output of specific control commands between different devices through dynamic link library configuration, breaks the communication barriers between different brands and reduces the complexity of user operations. , improves system response efficiency and user satisfaction.
Smart Images

Figure CN119414725A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart home device control technology, and in particular to a smart home device control method and device, electronic equipment, and storage medium. Background Art
[0002] With the rapid development of information technology, smart home devices have entered more and more households. Smart home devices in related technologies mainly connect devices to the corresponding network through technologies such as the Internet of Things, and control different smart home devices under the network through communication technology and control technology.
[0003] For example, a smart home system usually includes a variety of smart home devices, such as smart lamps, thermostats, security cameras, etc., which can improve living comfort, safety and energy efficiency. Users can interact with these smart home devices by inputting commands in a variety of ways.
[0004] However, due to the widespread nature of the Internet of Things, devices of different models, categories, and even brands are often connected to the network. Since different devices are not developed using universal standard protocols, these devices often use different communication protocols and operating standards, which makes users face the problem of high operational complexity when using multi-brand devices, and it is impossible to uniformly control multi-brand smart home devices, limiting the flexibility of user interaction. Summary of the invention
[0005] In view of the above problems, a method and device for controlling a smart home device, an electronic device, and a storage medium are proposed to overcome the above problems or at least partially solve the above problems, including:
[0006] A method for controlling a smart home device, the method comprising:
[0007] In response to an access operation of a smart home device, determining attribute information of the smart home device; wherein the attribute information at least includes a device type of the smart home device;
[0008] Creating an object model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type;
[0009] The smart home device is controlled according to the object model and the dynamic link library.
[0010] Optionally, the method further includes:
[0011] The device status monitoring process is performed on the smart home device according to the object model and the dynamic link library.
[0012] Optionally, the performing device status monitoring processing on the smart home device according to the object model and the dynamic link library includes:
[0013] In response to a state change of the smart home device, acquiring first data corresponding to the state change;
[0014] Performing a first conversion process on the first data through the dynamic link library to generate a first conversion result;
[0015] Adjusting a corresponding field in the object model according to the first conversion result, and determining a first adjustment result of the corresponding field;
[0016] Perform information reporting processing on the first adjustment result.
[0017] Optionally, controlling the smart home device according to the object model and the dynamic link library includes:
[0018] receiving a control command through the physical model, and parsing the control command through the physical model to generate a parsing result;
[0019] Adjusting a corresponding field in the object model according to the parsing result, and determining a second adjustment result of the corresponding field;
[0020] Performing a second conversion process on the second adjustment result by using the dynamic link library to generate device control data;
[0021] The smart home device is controlled according to the device control data.
[0022] Optionally, the performing information reporting processing on the first adjustment result includes:
[0023] According to the first adjustment result, determining whether the smart home device has a device abnormality;
[0024] If the smart home device has the device abnormality, device abnormality information is generated, and the first adjustment result and the device abnormality information are reported.
[0025] Optionally, the method further includes:
[0026] In response to an access operation of a newly added smart home device, determining whether the smart home device and the newly added smart home device are of the same device type;
[0027] If the smart home device and the newly added smart home device are of the same device type, the dynamic link library is updated according to the newly added smart home device.
[0028] Optionally, the attribute information also includes any one or more of basic attributes, state attributes, function attributes and event attributes.
[0029] Optionally, the creating an object model according to the attribute information includes:
[0030] The object model is created according to the device type and any one or more of the basic attributes, state attributes, functional attributes and event attributes.
[0031] A smart home device control device, the device comprising:
[0032] An attribute information determination module, configured to determine attribute information of a smart home device in response to an access operation of the smart home device; wherein the attribute information at least includes a device type of the smart home device;
[0033] A physical model and dynamic link library creation module, used to create a physical model according to the attribute information, and edit a dynamic link library corresponding to the device type according to the device type;
[0034] A smart home device control module is used to control the smart home device according to the object model and the dynamic link library.
[0035] Optionally, the device further comprises:
[0036] The device status monitoring processing module is used to perform device status monitoring processing on the smart home device according to the object model and the dynamic link library.
[0037] Optionally, the device status monitoring processing module includes:
[0038] A first data acquisition submodule, configured to acquire first data corresponding to a state change in response to a state change of the smart home device;
[0039] A first conversion result generating submodule, configured to perform a first conversion process on the first data through the dynamic link library to generate a first conversion result;
[0040] a first adjustment result determination submodule, configured to adjust a corresponding field in the object model according to the first conversion result, and determine a first adjustment result of the corresponding field;
[0041] The information reporting processing submodule is used to perform information reporting processing on the first adjustment result.
[0042] Optionally, the smart home device control module includes:
[0043] A control command parsing submodule, used for receiving a control command through the physical model, parsing the control command through the physical model, and generating a parsing result;
[0044] a second adjustment result determination submodule, configured to adjust a corresponding field in the object model according to the parsing result, and determine a second adjustment result of the corresponding field;
[0045] a device control data generating submodule, configured to perform a second conversion process on the second adjustment result through the dynamic link library to generate device control data;
[0046] The smart home device control submodule is used to control the smart home device according to the device control data.
[0047] Optionally, the information reporting processing submodule includes:
[0048] a device abnormality determination unit, configured to determine whether the smart home device has a device abnormality according to the first adjustment result;
[0049] An information reporting processing unit is used to generate device abnormality information if the smart home device has the device abnormality, and perform the information reporting processing on the first adjustment result and the device abnormality information.
[0050] Optionally, the device further comprises:
[0051] A smart home device adding module, configured to respond to an access operation of a newly added smart home device and determine whether the smart home device and the newly added smart home device are of the same device type;
[0052] The dynamic link library update module is used to update the dynamic link library according to the newly added smart home device if the smart home device and the newly added smart home device are of the same device type.
[0053] Optionally, the physical model and dynamic link library creation module includes:
[0054] The object model creation submodule is used to create the object model according to the device type and any one or more of the basic attributes, state attributes, function attributes and event attributes.
[0055] An electronic device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the smart home device control method as described above when executed by the processor.
[0056] A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the smart home device control method as described above is implemented.
[0057] A computer program product includes a computer program, and when the computer program is executed by a processor, the computer program implements the smart home device control method as described above.
[0058] The embodiments of the present invention have the following advantages:
[0059] The present invention provides a method for controlling smart home devices, which determines the attribute information of smart home devices by responding to the access operation of smart home devices; wherein the attribute information at least includes the device type of the smart home devices; thereby creating a physical model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type; and then controlling the smart home devices according to the physical model and the dynamic link library. The method realizes the control of smart home devices by combining the physical model with the dynamic link library, which can not only uniformly control the same type of smart home devices through the same physical model, but also realize the output of specific control commands between different smart home devices through the configuration of the dynamic link library, thereby realizing flexible and unified control of different smart home devices, breaking the communication barriers of different protocols between different brands, reducing the operational complexity of users when controlling smart home devices, improving the response efficiency and user satisfaction of the smart home system, and enhancing the flexibility of users when interacting with smart home devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0061] Figure 1 is a flowchart of a method for controlling a smart home device provided by some embodiments of the present invention;
[0062] Figure 2 is a flowchart of another smart home device control method provided by some embodiments of the present invention;
[0063] Figure 3 is a flowchart of another smart home device control method provided by some embodiments of the present invention;
[0064] Figure 4 is a schematic diagram of the overall execution flow of the smart home device control method provided by some embodiments of the present invention;
[0065] Figure 5 It is a structural schematic diagram of a smart home device control device provided by some embodiments of the present invention. DETAILED DESCRIPTION
[0066] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all 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.
[0067] In the embodiments of the present application, words such as "first" and "second" are used to distinguish between identical or similar items with basically the same functions and effects. This is only for the purpose of clearly describing the technical solutions of the embodiments of the present application, and shall not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features.
[0068] In the embodiments of the present application, the terms "upper", "lower", etc. indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present application.
[0069] With the rapid development of information technology, smart home devices have entered more and more households. Smart home devices in related technologies mainly connect devices to the corresponding network through technologies such as the Internet of Things, and control different smart home devices under the network through communication technology and control technology.
[0070] For example, a smart home system usually includes a variety of smart home devices, such as smart lamps, thermostats, security cameras, etc., which can improve living comfort, safety and energy efficiency. Users can interact with these smart home devices by inputting commands in a variety of ways.
[0071] However, due to the widespread nature of the Internet of Things, devices of different models, categories, and even brands are often connected to the network. Since different devices are not developed using universal standard protocols, these devices often use different communication protocols and operating standards, which makes users face the problem of high operational complexity when using multi-brand devices, and it is impossible to uniformly control multi-brand smart home devices, limiting the flexibility of user interaction.
[0072] In order to solve the above problems, the present invention is based on the core technical concept of controlling smart home devices by combining the object model with the dynamic link library, and improves the smart home device control method in the related art. The present invention will be described in detail below with reference to the accompanying drawings:
[0073] Reference Figure 1 , shows a flowchart of a method for controlling a smart home device provided by some embodiments of the present invention, which may specifically include the following steps:
[0074] Step 101, in response to an access operation of a smart home device, determining attribute information of the smart home device; wherein the attribute information at least includes a device type of the smart home device;
[0075] In a specific implementation, the attribute information of the smart home device can be determined when the smart home device is connected to the control system, and the attribute information includes at least the device type of the smart home device; thereby, a corresponding physical model file can be created in a subsequent step according to the smart home device connected to the system. Specifically, the physical model file can be created mainly based on the device type information in the attribute information. The attribute information can also include basic device attributes (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.) to be applied to different usage scenarios according to actual needs and to improve the control efficiency of smart home devices.
[0076] In some embodiments of the present invention, the attribute information further includes any one or more of basic attributes, state attributes, function attributes and event attributes.
[0077] In actual applications, attribute information can also include basic device attributes (such as the unique identification of the device, device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.), so as to improve the control efficiency of smart home devices in subsequent processes.
[0078] Step 102, creating an object model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type;
[0079] In a specific implementation, a corresponding physical model file can be created according to the smart home device connected to the system. Specifically, the physical model file can be created mainly according to the device type information in the attribute information. The physical model file corresponding to the smart home device can also include the basic device attributes in the attribute information (such as the unique identifier of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault state, state change, etc.). The physical model file can be expressed in the form of a JSON (JavaScript Object Notation) structure.
[0080] Furthermore, you can also write a so (shared object, dynamic link) library corresponding to the device type for different types of smart home devices. Each so library file can contain the driver and control logic of the smart home device to achieve the underlying control of the smart home device. The so library can adopt a standard interface specification to facilitate system calls and expansions. And the so library files can be numbered according to the device type. Taking the switch as an example, the switch type can be numbered as 10001, so that you can know that this library is a so library file with a switch class number through the so library number, and you can further deploy the so library configuration table to the predefined path of the host for easy calling.
[0081] In some embodiments of the present invention, the step of creating an object model according to the attribute information includes:
[0082] The object model is created according to the device type and any one or more of the basic attributes, state attributes, functional attributes and event attributes.
[0083] In a specific implementation, when creating a physical model file, the physical model file can be created mainly based on the device type information in the attribute information, and can be created based on actual needs combined with any one or more of the basic device attributes (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off, and various modes, etc.) and event attributes (fault status, state change, etc.), so as to meet various different actual application scenarios.
[0084] Step 103, controlling the smart home device according to the object model and the dynamic link library;
[0085] In actual applications, after the object model and the dynamic link library are created, the object model and the dynamic link library can be used to control the smart home devices. Specifically, after the user issues a control command through an app or a voice assistant, the object model can be used to parse the specific content of the control command, and the corresponding fields in the object model can be adjusted according to the parsing results, and then the corresponding so library interface function can be called to convert the adjusted fields into corresponding device control data to achieve control of the smart home devices;
[0086] In one example, taking the air conditioner object model as an example, it includes the cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the control command is issued, the object model will parse the control command and adjust the cmd field in the object model according to the parsing result, and then use the so library to convert the adjusted field into control data that can be recognized by the air conditioner, thereby achieving the control effect of the air conditioning equipment.
[0087] In some embodiments of the present invention, controlling the smart home device according to the object model and the dynamic link library includes:
[0088] receiving a control command through the physical model, and parsing the control command through the physical model to generate a parsing result;
[0089] Adjusting a corresponding field in the object model according to the parsing result, and determining a second adjustment result of the corresponding field;
[0090] Performing a second conversion process on the second adjustment result by using the dynamic link library to generate device control data;
[0091] The smart home device is controlled according to the device control data.
[0092] In actual applications, after the user issues a control command through an app or voice assistant, the specific content of the control command can be parsed through the object model, and the corresponding fields in the object model can be adjusted according to the parsing results. Then, the corresponding so library interface function is called to convert the adjusted fields into corresponding device control data to realize the control of smart home devices.
[0093] In one example, taking the air conditioner object model as an example, it includes cmd control field, mode mode, speed wind speed, tem temperature and other status fields; when the control command is issued, the object model will parse the control command and adjust the cmd field in the object model according to the parsing result, and then use the so library to convert the adjusted field into control data that can be recognized by the air conditioner, thereby achieving the control effect of the air conditioning equipment.
[0094] In some embodiments of the present invention, the method further comprises:
[0095] The device status monitoring process is performed on the smart home device according to the object model and the dynamic link library.
[0096] In the specific implementation, the changes of smart home devices can be monitored in real time through polling or event-driven methods, and the collected data can be converted into a json structure through the corresponding so library to realize the reporting of smart home device status change data;
[0097] In one example, taking the air conditioner object model as an example, it includes the cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the state of the smart home device changes (such as wind speed), the data corresponding to the state change can be collected, and the collected data can be further used as input data for the SO library conversion processing. After the SO library conversion, the value corresponding to the wind speed field in the object model can be adjusted according to the SO library conversion result. When the value of one or more status fields is adjusted, the result information of the above adjustment can be reported to the cloud and kept synchronized with the cloud.
[0098] In some embodiments of the present invention, the device status monitoring process for the smart home device according to the object model and the dynamic link library includes:
[0099] In response to a state change of the smart home device, acquiring first data corresponding to the state change;
[0100] Performing a first conversion process on the first data through the dynamic link library to generate a first conversion result;
[0101] Adjusting a corresponding field in the object model according to the first conversion result, and determining a first adjustment result of the corresponding field;
[0102] Perform information reporting processing on the first adjustment result.
[0103] In the specific implementation, the changes of smart home devices can be monitored in real time through polling or event-driven methods, and the collected data can be converted into a json structure through the corresponding so library to realize the reporting of smart home device status change data; specifically, taking the air-conditioning object model as an example, it includes cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the state of the smart home device changes (such as wind speed), the data corresponding to the state change can be collected, and the collected data can be further used as input data for so library conversion processing. After so library conversion, the value corresponding to the wind speed field in the object model can be adjusted according to the so library conversion result. When the value of one or more status fields is adjusted, the above adjustment result information can be reported to the cloud and kept synchronized with the cloud.
[0104] In some embodiments of the present invention, the step of performing information reporting processing on the first adjustment result includes:
[0105] According to the first adjustment result, determining whether the smart home device has a device abnormality;
[0106] If the smart home device has the device abnormality, device abnormality information is generated, and the first adjustment result and the device abnormality information are reported.
[0107] In actual applications, when an abnormality occurs in a device or its status changes, it can be captured and processed through event attributes. Corresponding processing operations can be performed for different types of events. For example, device abnormality information can be generated when it is confirmed that a smart home device has a device abnormality. The field adjustment results of the object model and the device abnormality information at this time can be sent to the cloud or the linkage control of other devices can be triggered accordingly.
[0108] In one example, taking the air conditioner as an example, when the state of the air conditioner changes (for example, from on to off), if there is a linkage setting in the cloud that when the air conditioner is turned off, the fan is turned off synchronously, then the cloud can compare the status information of the air conditioner at this time. If it meets the air conditioner off state, the cloud can issue a control command to turn off the fan, thereby realizing linkage control between devices.
[0109] In some embodiments of the present invention, the method further comprises:
[0110] In response to an access operation of a newly added smart home device, determining whether the smart home device and the newly added smart home device are of the same device type;
[0111] If the smart home device and the newly added smart home device are of the same device type, the dynamic link library is updated according to the newly added smart home device.
[0112] In the specific implementation, when a new home device is added, corresponding update operations can be performed according to the device type of the newly added smart home device. For example, when the newly added smart home device is the device type corresponding to the existing physical model, it is only necessary to update the so configuration table and the corresponding so file; if the newly added smart home device is not the device type corresponding to the existing physical model, in addition to updating the above-mentioned so configuration table and the corresponding so file, it is also necessary to create and update the corresponding physical model file to achieve system expansion, which greatly increases the scalability and flexibility of the system.
[0113] Reference Figure 2 , shows a flowchart of another smart home device control method provided by some embodiments of the present invention, which may specifically include the following steps:
[0114] Step 201, in response to an access operation of a smart home device, determining attribute information of the smart home device; wherein the attribute information includes a device type of the smart home device, and any one or more of basic attributes, state attributes, function attributes, and event attributes;
[0115] In a specific implementation, the attribute information of the smart home device can be determined when the smart home device is connected to the control system, and the attribute information includes at least the device type of the smart home device; thereby, a corresponding physical model file can be created in a subsequent step according to the smart home device connected to the system. Specifically, the physical model file can be created mainly based on the device type information in the attribute information. The attribute information can also include basic device attributes (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.) to be applied to different usage scenarios according to actual needs and to improve the control efficiency of smart home devices.
[0116] Step 202, creating the object model according to the device type and any one or more of the basic attributes, state attributes, function attributes and event attributes, and editing the dynamic link library corresponding to the device type according to the device type;
[0117] In a specific implementation, a corresponding physical model file can be created according to the smart home devices connected to the system. Specifically, the physical model file can be created mainly based on the device type information in the attribute information. The physical model file corresponding to the smart home device can also include one or more of the basic device attributes in the attribute information (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.), so as to meet various different actual application scenarios.
[0118] Furthermore, you can also write a so (shared object, dynamic link) library corresponding to the device type for different types of smart home devices. Each so library file can contain the driver and control logic of the smart home device to achieve the underlying control of the smart home device. The so library can adopt a standard interface specification to facilitate system calls and expansions. And the so library files can be numbered according to the device type. Taking the switch as an example, the switch type can be numbered as 10001, so that you can know that this library is a so library file with a switch class number through the so library number, and you can further deploy the so library configuration table to the predefined path of the host for easy calling.
[0119] Step 203: Control the smart home device according to the object model and the dynamic link library.
[0120] In actual applications, after the object model and the dynamic link library are created, the object model and the dynamic link library can be used to control the smart home devices. Specifically, after the user issues a control command through an app or a voice assistant, the object model can be used to parse the specific content of the control command, and the corresponding fields in the object model can be adjusted according to the parsing results, and then the corresponding so library interface function can be called to convert the adjusted fields into corresponding device control data to achieve control of the smart home devices;
[0121] In one example, taking the air conditioner object model as an example, it includes the cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the control command is issued, the object model will parse the control command and adjust the cmd field in the object model according to the parsing result, and then use the so library to convert the adjusted field into control data that can be recognized by the air conditioner, thereby achieving the control effect of the air conditioning equipment.
[0122] Reference Figure 3 , shows a flowchart of another smart home device control method provided by some embodiments of the present invention, which may specifically include the following steps:
[0123] Step 301, in response to an access operation of a smart home device, determining attribute information of the smart home device; wherein the attribute information at least includes a device type of the smart home device;
[0124] In a specific implementation, the attribute information of the smart home device can be determined when the smart home device is connected to the control system, and the attribute information includes at least the device type of the smart home device; thereby, a corresponding physical model file can be created in a subsequent step according to the smart home device connected to the system. Specifically, the physical model file can be created mainly based on the device type information in the attribute information. The attribute information can also include basic device attributes (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.) to be applied to different usage scenarios according to actual needs and to improve the control efficiency of smart home devices.
[0125] Step 302, creating a thing model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type;
[0126] In a specific implementation, a corresponding physical model file can be created based on the smart home devices connected to the system. Specifically, the physical model file can be created mainly based on the device type information in the attribute information. The physical model file corresponding to the smart home device can also include the basic device attributes in the attribute information (such as the unique identification of the device, the device communication method, etc.), state attributes (device switch, temperature, color temperature, etc.), functional attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault status, state change, etc.).
[0127] Step 303, controlling the smart home device according to the object model and the dynamic link library;
[0128] In actual applications, after the object model and the dynamic link library are created, the object model and the dynamic link library can be used to control the smart home devices. Specifically, after the user issues a control command through an app or a voice assistant, the object model can be used to parse the specific content of the control command, and the corresponding fields in the object model can be adjusted according to the parsing results, and then the corresponding so library interface function can be called to convert the adjusted fields into corresponding device control data to achieve control of the smart home devices;
[0129] In one example, taking the air conditioner object model as an example, it includes the cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the control command is issued, the object model will parse the control command and adjust the cmd field in the object model according to the parsing result, and then use the so library to convert the adjusted field into control data that can be recognized by the air conditioner, thereby achieving the control effect of the air conditioning equipment.
[0130] Step 304: Perform device status monitoring processing on the smart home device according to the object model and the dynamic link library.
[0131] In the specific implementation, the changes of smart home devices can be monitored in real time through polling or event-driven methods, and the collected data can be converted into a json structure through the corresponding so library to realize the reporting of smart home device status change data;
[0132] In one example, taking the air conditioner object model as an example, it includes the cmd field (control field), mode mode, speed wind speed, tem temperature, etc. (status field); when the state of the smart home device changes (such as wind speed), the data corresponding to the state change can be collected, and the collected data can be further used as input data for the SO library conversion processing. After the SO library conversion, the value corresponding to the wind speed field in the object model can be adjusted according to the SO library conversion result. When the value of one or more status fields is adjusted, the result information of the above adjustment can be reported to the cloud and kept synchronized with the cloud.
[0133] The following will be combined Figure 4 The embodiments of the present invention are further described as follows:
[0134] Reference Figure 4 The overall execution process of the smart home device control method provided by the present invention can be summarized as follows:
[0135] Step 1: During the registration and initialization phase of smart home devices, a so configuration table is generated according to the type of smart home devices, and a physical model file corresponding to the smart home devices is created and defined according to the category (type) of smart home devices;
[0136] Step 2: Monitor the status of smart home devices and parse control commands. At this time, the so library can be called to execute corresponding functions according to corresponding monitoring or control requirements;
[0137] Step three, determine whether there is a newly added smart home device. If not, perform smart home device status monitoring and control command parsing as usual. If so, further determine whether the newly added smart home device is a smart home device of the existing device type.
[0138] Step 4: If the newly added smart home device is a smart home device of an existing device type, modify the configuration table and add the corresponding so library file; if the newly added smart home device is not a smart home device of an existing device type, modify the configuration table, add the corresponding so library file and create and update the object model file corresponding to the newly added smart home device type.
[0139] The present invention provides a method for controlling smart home devices, which determines the attribute information of smart home devices by responding to the access operation of smart home devices; wherein the attribute information at least includes the device type of the smart home devices; thereby creating a physical model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type; and then controlling the smart home devices according to the physical model and the dynamic link library. The method realizes the control of smart home devices by combining the physical model with the dynamic link library, which can not only uniformly control the same type of smart home devices through the same physical model, but also realize the output of specific control commands between different smart home devices through the configuration of the dynamic link library, thereby realizing flexible and unified control of different smart home devices, breaking the barriers of different protocols between different brands, reducing the operational complexity of users when controlling smart home devices, improving the response efficiency and user satisfaction of the smart home system, and enhancing the flexibility of users when interacting with smart home devices.
[0140] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0141] Reference Figure 5 , shows a schematic diagram of the structure of a smart home device control device provided by some embodiments of the present invention; specifically, it may include the following modules:
[0142] The attribute information determination module 501 is used to determine the attribute information of the smart home device in response to the access operation of the smart home device; wherein the attribute information at least includes the device type of the smart home device;
[0143] The object model and dynamic link library creation module 502 is used to create an object model according to the attribute information, and edit the dynamic link library corresponding to the device type according to the device type;
[0144] The smart home device control module 503 is used to control the smart home device according to the object model and the dynamic link library.
[0145] In some embodiments of the present invention, the device further comprises:
[0146] The device status monitoring processing module is used to perform device status monitoring processing on the smart home device according to the object model and the dynamic link library.
[0147] In some embodiments of the present invention, the device status monitoring processing module includes:
[0148] A first data acquisition submodule, configured to acquire first data corresponding to a state change in response to a state change of the smart home device;
[0149] A first conversion result generating submodule, configured to perform a first conversion process on the first data through the dynamic link library to generate a first conversion result;
[0150] a first adjustment result determination submodule, configured to adjust a corresponding field in the object model according to the first conversion result, and determine a first adjustment result of the corresponding field;
[0151] The information reporting processing submodule is used to perform information reporting processing on the first adjustment result.
[0152] In some embodiments of the present invention, the smart home device control module 503 includes:
[0153] A control command parsing submodule, used for receiving a control command through the physical model, parsing the control command through the physical model, and generating a parsing result;
[0154] a second adjustment result determination submodule, configured to adjust a corresponding field in the object model according to the parsing result, and determine a second adjustment result of the corresponding field;
[0155] a device control data generating submodule, configured to perform a second conversion process on the second adjustment result through the dynamic link library to generate device control data;
[0156] The smart home device control submodule is used to control the smart home device according to the device control data.
[0157] In some embodiments of the present invention, the information reporting processing submodule includes:
[0158] a device abnormality determination unit, configured to determine whether the smart home device has a device abnormality according to the first adjustment result;
[0159] An information reporting processing unit is used to generate device abnormality information if the smart home device has the device abnormality, and perform the information reporting processing on the first adjustment result and the device abnormality information.
[0160] In some embodiments of the present invention, the device further comprises:
[0161] A smart home device adding module, configured to respond to an access operation of a newly added smart home device and determine whether the smart home device and the newly added smart home device are of the same device type;
[0162] The dynamic link library update module is used to update the dynamic link library according to the newly added smart home device if the smart home device and the newly added smart home device are of the same device type.
[0163] In some embodiments of the present invention, the physical model and dynamic link library creation module 502 includes:
[0164] The object model creation submodule is used to create the object model according to the device type and any one or more of the basic attributes, state attributes, function attributes and event attributes.
[0165] Some embodiments of the present invention further provide an electronic device, which may include a processor, a memory, and a computer program stored in the memory and capable of running on the processor, and when the computer program is executed by the processor, the above-mentioned smart home device control method is implemented.
[0166] Some embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned smart home device control method is implemented.
[0167] Some embodiments of the present invention further provide a computer program product, including a computer program, which implements the above smart home device control method when executed by a processor.
[0168] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0169] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0170] Those skilled in the art will appreciate that the embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the embodiments of the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0171] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0172] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0174] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0175] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the above elements.
[0176] The above provides a detailed introduction to a smart home device control method and device, an electronic device, and a storage medium. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A smart home device control method, characterized in that: The method comprises: In response to an access operation of a smart home device, determining attribute information of the smart home device; wherein the attribute information at least includes a device type of the smart home device; Creating an object model according to the attribute information, and editing a dynamic link library corresponding to the device type according to the device type; The smart home device is controlled according to the object model and the dynamic link library.
2. The method according to claim 1, characterized in that: The method further comprises: The device status monitoring process is performed on the smart home device according to the object model and the dynamic link library.
3. The method according to claim 2, characterized in that The performing device status monitoring processing on the smart home device according to the object model and the dynamic link library includes: In response to a state change of the smart home device, acquiring first data corresponding to the state change; Performing a first conversion process on the first data through the dynamic link library to generate a first conversion result; Adjusting a corresponding field in the object model according to the first conversion result, and determining a first adjustment result of the corresponding field; Perform information reporting processing on the first adjustment result.
4. The method according to claim 1, characterized in that: The controlling the smart home device according to the object model and the dynamic link library includes: receiving a control command through the physical model, and parsing the control command through the physical model to generate a parsing result; Adjusting a corresponding field in the object model according to the parsing result, and determining a second adjustment result of the corresponding field; Performing a second conversion process on the second adjustment result by using the dynamic link library to generate device control data; The smart home device is controlled according to the device control data.
5. The method according to claim 3, characterized in that: The performing information reporting processing on the first adjustment result includes: According to the first adjustment result, determining whether the smart home device has a device abnormality; If the smart home device has the device abnormality, device abnormality information is generated, and the first adjustment result and the device abnormality information are reported.
6. The method according to claim 1, characterized in that The method further comprises: In response to an access operation of a newly added smart home device, determining whether the smart home device and the newly added smart home device are of the same device type; If the smart home device and the newly added smart home device are of the same device type, the dynamic link library is updated according to the newly added smart home device.
7. The method according to claim 1, characterized in that The attribute information also includes any one or more of basic attributes, state attributes, function attributes and event attributes.
8. The method according to claim 7, characterized in that The step of creating an object model according to the attribute information comprises: The object model is created according to the device type and any one or more of the basic attributes, state attributes, functional attributes and event attributes.
9. A smart home equipment control device, characterized in that: The device comprises: An attribute information determination module, configured to determine attribute information of a smart home device in response to an access operation of the smart home device; wherein the attribute information at least includes a device type of the smart home device; A physical model and dynamic link library creation module, used to create a physical model according to the attribute information, and edit a dynamic link library corresponding to the device type according to the device type; A smart home device control module is used to control the smart home device according to the object model and the dynamic link library.
10. An electronic device, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein when the computer program is executed by the processor, the smart home device control method as claimed in any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the smart home device control method according to any one of claims 1 to 8 is implemented.
12. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the smart home device control method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Data processing method and device, computer readable storage medium and computer equipment
CN113986349A
Cross-platform fusion access method and system of equipment, gateway and storage medium
CN114900387A
Electronic control logic adaptation method and system, electronic equipment and storage medium
CN116414450A
Method and device for executing operation instruction, control system, storage medium and electronic device
CN116430742A
Equipment control method, Internet of Things system and storage medium
CN117640707A