A smart home device control method and device, electronic device, and storage medium
By creating object models and dynamic link libraries, the problem of inconsistent control of smart home devices from different brands has been solved, enabling flexible unified control and improving user experience and system efficiency.
Patent Information
- Application Number
- CN202411625273.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-11-14
AI Technical Summary
Because different brands of smart home devices use different communication protocols and operating standards, users face high operational complexity and cannot achieve unified control when using multiple brands of devices, which limits the flexibility of user interaction.
By determining the attribute information of smart home devices, creating object models and editing dynamic link libraries, and using the combination of object models and dynamic link libraries for control, unified control of different smart home devices can be achieved.
It enables flexible and unified control of different smart home devices, reduces the complexity of user operation, improves the response efficiency and user satisfaction of the smart home system, and enhances the flexibility of user interaction.
Smart Images

Figure CN119414725B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of smart home device control, and in particular to a smart home device control method and device, an electronic device, and a storage medium. BACKGROUND
[0002] In today's rapid development of information technology, smart home devices have entered more and more families. In related technologies, smart home devices are mainly connected to corresponding networks through technologies such as the Internet of Things, and are controlled through communication technologies and control technologies.
[0003] For example, a smart home system usually includes various smart home devices such as smart lamps, thermostats, and security cameras, which can improve living comfort, security, and energy efficiency. Users can interact with these smart home devices by inputting instructions in various ways.
[0004] However, due to the wide range of the Internet of Things, different models, categories, and even different brands of devices are often connected to the network. Because different devices are not developed using common standard protocols, these devices often use different communication protocols and operation standards, making it difficult for users to operate multiple brands of devices, and making it difficult to control multiple brands of smart home devices uniformly, limiting the flexibility of user interaction. SUMMARY
[0005] In view of the above problems, a smart home device control method and device, an electronic device, and a storage medium are provided to overcome the above problems or at least partially solve the above problems, comprising:
[0006] A smart home device control method, the method comprising:
[0007] In response to an access operation of a smart home device, attribute information of the smart home device is determined, wherein the attribute information at least includes a device type of the smart home device;
[0008] A physical model is created according to the attribute information, and a dynamic link library corresponding to the device type is edited according to the device type;
[0009] The smart home device is controlled according to the physical model and the dynamic link library.
[0010] Optionally, the method further comprises:
[0011] The smart home device is monitored and processed according to the physical model and the dynamic link library.
[0012] Optionally, the device state monitoring processing of the smart home device according to the object model and the dynamic link library comprises:
[0013] In response to the state change of the smart home device, first data corresponding to the state change is obtained;
[0014] The first data is processed by the dynamic link library for first conversion processing to generate a first conversion result;
[0015] According to the first conversion result, the corresponding field in the object model is adjusted, and a first adjustment result of the corresponding field is determined;
[0016] The first adjustment result is reported for information processing.
[0017] Optionally, the control of the smart home device according to the object model and the dynamic link library comprises:
[0018] The control command is received through the object model, and the control command is analyzed through the object model to generate an analysis result;
[0019] According to the analysis result, the corresponding field in the object model is adjusted, and a second adjustment result of the corresponding field is determined;
[0020] The second adjustment result is processed by the dynamic link library for second conversion processing to generate device control data;
[0021] According to the device control data, the smart home device is controlled.
[0022] Optionally, the information reporting processing of the first adjustment result comprises:
[0023] According to the first adjustment result, it is judged whether the smart home device has a device exception;
[0024] If the smart home device has the device exception, device exception information is generated, and the first adjustment result and the device exception information are reported for information processing.
[0025] Optionally, the method further comprises:
[0026] In response to the access operation of the newly added smart home device, it is judged 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 further comprises any one or more of a basic attribute, a state attribute, a function attribute and an event attribute.
[0029] Optionally, the creating the object model according to the attribute information comprises:
[0030] creating the object model according to the device type and any one or more of the basic attribute, the state attribute, the function attribute and the event attribute.
[0031] A smart home device control apparatus, the apparatus comprising:
[0032] an attribute information determining 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 comprises at least a device type of the smart home device;
[0033] an object model and dynamic link library creating module configured to create an object 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 configured to control the smart home device according to the object model and the dynamic link library.
[0035] Optionally, the apparatus further comprises:
[0036] a device state monitoring processing module configured to perform device state monitoring processing on the smart home device according to the object model and the dynamic link library.
[0037] Optionally, the device state monitoring processing module comprises:
[0038] a first data obtaining sub-module configured to obtain first data corresponding to a state change of the smart home device in response to the state change of the smart home device;
[0039] a first conversion result generating sub-module configured to perform first conversion processing on the first data through the dynamic link library to generate a first conversion result;
[0040] a first adjustment result determining sub-module 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] an information reporting processing sub-module configured to perform information reporting processing on the first adjustment result.
[0042] Optionally, the smart home device control module comprises:
[0043] The control command analysis submodule is configured to receive a control command through the thing model, analyze the control command through the thing model, and generate an analysis result;
[0044] The second adjustment result determination submodule is configured to adjust a corresponding field in the thing model according to the analysis result, and determine a second adjustment result of the corresponding field;
[0045] The device control data generation submodule is configured to perform second conversion processing on the second adjustment result through the dynamic link library, and generate device control data;
[0046] The smart home device control submodule is configured to control the smart home device according to the device control data.
[0047] Optionally, the information reporting processing submodule includes:
[0048] The device exception determination unit is configured to determine whether the smart home device has a device exception according to the first adjustment result;
[0049] The information reporting processing unit is configured to generate device exception information if the smart home device has the device exception, and perform the information reporting processing on the first adjustment result and the device exception information.
[0050] Optionally, the apparatus further includes:
[0051] The smart home device adding module is configured to determine whether the smart home device and the newly added smart home device are of the same device type in response to an access operation of adding a smart home device.
[0052] The dynamic link library updating module is configured 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 thing model and dynamic link library creation module includes:
[0054] The thing model creation submodule is configured to create the thing model according to the device type, and any one or more of the basic attribute, the state attribute, the function attribute, and the event attribute.
[0055] An electronic device includes a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and the computer program is executed by the processor to implement the smart home device control method described above.
[0056] A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program, the computer program is executed by a processor to implement the smart home device control method as described above.
[0057] A computer program product, comprising a computer program, the computer program is executed by a processor to implement the smart home device control method as described above.
[0058] The embodiments of the present application have the following advantages:
[0059] The present application provides a kind of smart home device control method, by responding to the attribute information of smart home device determination of access operation of smart home device;Wherein, attribute information at least includes the device type of smart home device;To create thing model according to attribute information, and edit the dynamic link library corresponding to device type according to device type;Further, according to the control mode of thing model and dynamic link library to smart home device.It is realized by the combination application of thing model and dynamic link library to carry out smart home device control, not only can the same type smart home device be controlled by the same thing model, it can also be realized by the specific control command output between different smart home devices through dynamic link library configuration mode, further realize the flexible unified control to different smart home devices, break the communication barrier between different brands and different protocols, reduce the operation complexity when user carries out smart home device control, improve the response efficiency and user satisfaction of smart home system, enhance the flexibility when user and smart home device interact. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions of the present application, the following will briefly introduce the drawings needed to be used in the description of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained according to these drawings without creative labor for those skilled in the art.
[0061] Figure 1 It is a step flow chart of the smart home device control method provided by some embodiments of the present application;
[0062] Figure 2 It is a step flow chart of another smart home device control method provided by some embodiments of the present application;
[0063] Figure 3 It is a step flow chart of another smart home device control method provided by some embodiments of the present application;
[0064] Figure 4 It is the overall execution flow schematic diagram of the smart home device control method provided by some embodiments of the present application.
[0065] Figure 5 Fig. 1 is a structural schematic diagram of an intelligent home device control device according to some embodiments of the present application. DETAILED DESCRIPTION
[0066] In order to make the above objectives, characteristics and advantages of the present application more apparent, comprehensible and easier to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.
[0067] In the embodiments of the present application, the terms "first", "second", etc. are used to distinguish the same or similar items with basically the same functions and effects, only for the purpose of clearly describing the technical solutions of the embodiments of the present application, and cannot be understood as indicating or implying the 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 the orientation or positional relationship shown in the drawings, only for the purpose of facilitating the description of the present application and simplifying the description, and are not intended to indicate or imply that the indicated device or element must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation on the present application.
[0069] In today's rapid development of information technology, intelligent home devices have entered more and more families. The intelligent home devices in related technologies are mainly connected to the corresponding network through technologies such as the Internet of Things, and the control of different intelligent home devices under the network is realized through communication technologies and control technologies.
[0070] For example, an intelligent home system usually includes various intelligent home devices, such as intelligent lamps, thermostats, security cameras, etc., which can improve the comfort, safety and energy efficiency of living. Users can interact with these intelligent home devices by inputting instructions in various ways.
[0071] However, due to the universality of the Internet of Things, different models, different categories, and even different brands of devices are often connected to the network. Since different devices are not developed using a universal standard protocol, these devices often use different communication protocols and operation standards, making it difficult for users to operate multiple brands of devices, and making it impossible to control multiple brands of intelligent home devices uniformly, limiting the flexibility of user interaction.
[0072] In order to solve the above problems, the application is based on the core technical concept of applying the combination of the object model and the dynamic link library to carry out the intelligent home equipment control, and the intelligent home equipment control method in the related art is improved. The application will be described in detail below in combination with the drawings.
[0073] Referring to Figure 1 , a step flow chart of an intelligent home equipment control method provided by some embodiments of the application is shown, which can specifically include the following steps:
[0074] Step 101, in response to the access operation of the intelligent home equipment, the attribute information of the intelligent home equipment is determined; wherein the attribute information at least includes the device type of the intelligent home equipment;
[0075] In the specific implementation, the attribute information of the intelligent home equipment can be determined when the intelligent home equipment accesses the control system, and the attribute information at least includes the device type of the intelligent home equipment; so that the corresponding object model file can be created according to the intelligent home equipment accessing the system in the subsequent steps. Specifically, the object model file can be mainly created according to the device type information in the attribute information, and the attribute information can also include the device basic attribute (such as the unique identification of the device, the device communication mode, etc.), the state attribute (the device switch, the temperature, the color temperature, etc.), the function attribute (adjusting the temperature, opening, closing and various modes, etc.) and the event attribute (the fault state, the state change, etc.) to be applied to different use scenarios according to the actual demand and improve the control efficiency of the intelligent home equipment.
[0076] In some embodiments of the application, the attribute information further includes any one or more of the basic attribute, the state attribute, the function attribute and the event attribute.
[0077] In actual application, the attribute information can also include the device basic attribute (such as the unique identification of the device, the device communication mode, etc.), the state attribute (the device switch, the temperature, the color temperature, etc.), the function attribute (adjusting the temperature, opening, closing and various modes, etc.) and the event attribute (the fault state, the state change, etc.) in order to improve the control efficiency of the intelligent home equipment in the subsequent process.
[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 thing model file can be created according to an intelligent home device accessing a system. Specifically, the thing model file can be mainly created according to device type information in attribute information. The thing model file corresponding to the intelligent home device can further include device basic attributes (such as a unique identifier of the device and a device communication mode) in the attribute information, state attributes (device switch, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off, and various modes, etc.), and event attributes (fault state, state change, etc.). The thing model file can be expressed in the form of a JSON (JavaScript Object Notation) structure body.
[0080] Further, a so (shared object) library corresponding to a device type can also be written for different types of intelligent home devices. Each so library file can include a driver and control logic of the intelligent home device, to implement bottom-layer control of the intelligent home device. The so library can adopt a standard interface specification, to facilitate system calling and extension. The so library file can be numbered according to a device type, to take a switch as an example. The switch type can be numbered as 10001, so that the number of the so library can indicate that this library is a so library file of the switch type. The so library configuration table can be further deployed to a predefined path of a host, to facilitate calling.
[0081] In some embodiments of the present application, the creating a thing model according to the attribute information comprises:
[0082] The thing model is created according to the device type, and any one or more of the basic attributes, the state attributes, the function attributes, and the event attributes.
[0083] In a specific implementation, when creating a thing model file, the thing model file can be mainly created according to device type information in attribute information. Any one or more of device basic attributes (such as a unique identifier of the device and a device communication mode), state attributes (device switch, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off, and various modes, etc.), and event attributes (fault state, state change, etc.) can be combined according to actual requirements when creating the thing model file, to meet various different actual application scenarios.
[0084] Step 103: controlling the intelligent home device according to the thing model and the dynamic link library.
[0085] In actual application, the smart home device can be controlled by using the object model and the dynamic link library after the object model and the dynamic link library are both created, specifically, after the user issues a control command through an app or a voice assistant, the object model can analyze the specific content of the control command, and according to the analysis result, the corresponding field in the object model is adjusted, then the adjusted field is converted into corresponding device control data by calling the so library interface function, thereby the control of the smart home device is realized.
[0086] In an example, taking an air conditioner object model as an example, which includes a cmd field (control field), mode, speed, tem temperature and the like (state field); when a control command is issued, the object model will analyze and process the control command, and according to the analysis result, the cmd field in the object model is adjusted, and then the adjusted field is converted into control data recognizable by the air conditioner by using the so library, thereby the control effect of the air conditioner device is realized.
[0087] In some embodiments of the present application, the control of the smart home device according to the object model and the dynamic link library comprises:
[0088] The control command is received by the object model, and the control command is analyzed and processed by the object model to generate an analysis result;
[0089] According to the analysis result, the corresponding field in the object model is adjusted, and a second adjustment result of the corresponding field is determined;
[0090] The second adjustment result is secondly converted by 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 application, after the user issues a control command through an app or a voice assistant, the object model can analyze the specific content of the control command, and according to the analysis result, the corresponding field in the object model is adjusted, then the adjusted field is converted into corresponding device control data by calling the so library interface function, thereby the control of the smart home device is realized.
[0093] In an example, taking an air conditioner object model as an example, which includes a cmd control field, mode, speed, tem temperature and the like state field; when a control command is issued, the object model will analyze and process the control command, and according to the analysis result, the cmd field in the object model is adjusted, and then the adjusted field is converted into control data recognizable by the air conditioner by using the so library, thereby the control effect of the air conditioner device is realized.
[0094] In some embodiments of the present application, the method further comprises:
[0095] According to the object model and the dynamic link library, the device state of the smart home device is monitored.
[0096] In a specific implementation, the change of the smart home device can be monitored in real time through polling or event-driven mode, and the collected data can be converted into a json structure through the corresponding so library to realize the reporting of the smart home device state change data.
[0097] In an example, also taking the air conditioner object model as an example, which includes the cmd field (control field), mode, speed, tem temperature, etc. (state field); when the smart home device state changes (such as wind speed), the corresponding data of the state change can be collected, and the collected data can be further used as the input data of 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 state fields is adjusted, the above adjustment result information can be reported to the cloud and kept in synchronization with the cloud.
[0098] In some embodiments of the present application, the device state of the smart home device is monitored according to the object model and the dynamic link library, comprising:
[0099] In response to the state change of the smart home device, the first data corresponding to the state change is obtained;
[0100] The first data is converted through the dynamic link library to generate a first conversion result;
[0101] According to the first conversion result, the corresponding field in the object model is adjusted, and a first adjustment result of the corresponding field is determined;
[0102] The first adjustment result is reported.
[0103] In a specific implementation, the change of the smart home device can be monitored in real time through polling or event-driven manner, and the collected data can be converted into a json structure through a corresponding so library to realize the reporting of the smart home device state change data; specifically, taking the air conditioner model as an example, which includes a cmd field (control field), a mode, a speed, a temperature, etc. (state field); when the smart home device state changes (such as the wind speed), the corresponding data of the state change can be collected, and the collected data can be further used as the input data of the so library conversion processing, and after the so library conversion, the value corresponding to the wind speed field in the model can be adjusted according to the so library conversion result, and when the value of one or more state fields is adjusted, the above adjustment result information can be reported to the cloud and kept in cloud synchronization.
[0104] In some embodiments of the application, the information reporting processing of the first adjustment result comprises:
[0105] According to the first adjustment result, it is judged whether the smart home device has a device exception;
[0106] If the smart home device has the device exception, device exception information is generated, and the first adjustment result and the device exception information are subjected to the information reporting processing.
[0107] In actual application, when the device has an exception or a state change, the event attribute can be captured and processed, and for different types of events, corresponding processing operations can be performed, for example, device exception information can be generated when it is confirmed that the smart home device has a device exception, and the field adjustment result of the model at this time and the device exception information can be sent to the cloud or trigger the linkage control of other devices accordingly.
[0108] In an example, taking the air conditioner as an example, when the state of the air conditioner changes (for example, from on to off), if the cloud has a linkage setting that the fan is synchronously turned off when the air conditioner is turned off at this time, the cloud can compare the state information of the air conditioner at this time, and if it meets the air conditioner off state, the cloud can issue a control command to turn off the fan, realizing the linkage control between devices.
[0109] In some embodiments of the application, the method further comprises:
[0110] In response to the access operation of the newly added smart home device, it is judged 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 a specific implementation, when a home device is added, a corresponding update operation can be performed according to the device type of the added smart home device. For example, when the added smart home device is of a device type corresponding to an existing thing model, only the so configuration table and the corresponding so file need to be updated. If the added smart home device is not of a device type corresponding to an existing thing model, in addition to updating the so configuration table and the corresponding so file, a corresponding thing model file also needs to be created and updated, thereby realizing system expansion and greatly increasing the expansibility and flexibility of the system.
[0113] Referring to Figure 2 , a step flowchart of another smart home device control method provided by some embodiments of the present application is shown, which can specifically include the following steps:
[0114] Step 201, in response to an access operation of a smart home device, attribute information of the smart home device is determined; wherein the attribute information includes a device type of the smart home device, and any one or more of a basic attribute, a state attribute, a function attribute and an event attribute;
[0115] In a specific implementation, the attribute information of the smart home device can be determined when the smart home device accesses the control system, and the attribute information at least includes the device type of the smart home device; thereby a corresponding thing model file can be created according to the smart home device accessing the system in the subsequent steps. Specifically, the thing model file can be mainly created according to the device type information in the attribute information, and the attribute information can also include device basic attributes (such as a unique identifier of the device, a device communication mode, etc.), state attributes (device on / off, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off and various modes, etc.) and event attributes (fault state, state change, etc.) to be applied to different use scenarios according to actual needs and to improve the control efficiency of the smart home device.
[0116] Step 202, according to the device type, and any one or more of the basic attribute, the state attribute, the function attribute and the event attribute, the thing model is created, and a dynamic link library corresponding to the device type is edited according to the device type;
[0117] In a specific implementation, a corresponding thing model file can be created according to an intelligent home device accessing a system. Specifically, the thing model file can be created mainly according to device type information in attribute information. The thing model file corresponding to the intelligent home device can further include one or more of device basic attributes (such as a unique identifier of the device, a device communication mode, etc.), state attributes (device on-off, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off, and various modes, etc.), and event attributes (fault status, state change, etc.), thereby meeting various different actual application scenarios.
[0118] Further, a so (shared object, dynamic link) library corresponding to a device type can be written for different types of intelligent home devices. Each so library file can include a driver and control logic of the intelligent home device, implementing bottom-layer control of the intelligent home device. The so library can adopt a standard interface specification, facilitating system calling and extension. The so library file can be numbered according to a device type, taking a switch as an example. The switch type can be numbered as 10001, so that the number of the so library can indicate that this library is a so library file of the switch type. The so library configuration table can be further deployed to a predefined path of a host, facilitating calling.
[0119] Step 203: controlling the intelligent home device according to the thing model and the dynamic link library.
[0120] In actual application, the intelligent home device can be controlled after the thing model and the dynamic link library are both created. Specifically, after a user issues a control command through an app or a voice assistant, the thing model can analyze the specific content of the control command, adjust a corresponding field in the thing model according to the analysis result, and then call a corresponding so library interface function to convert the adjusted field into corresponding device control data, thereby implementing control of the intelligent home device.
[0121] In an example, taking an air conditioner thing model as an example, the thing model includes a cmd field (control field), mode, speed, and tem (state field). When a control command is issued, the thing model analyzes the control command, adjusts the cmd field in the thing model according to the analysis result, and then converts the adjusted field into control data recognizable by the air conditioner through the so library, thereby implementing control of the air conditioner device.
[0122] Referring to Figure 3 FIG. 2 shows a step flowchart of another intelligent home device control method provided by some embodiments of the present application, which can specifically include the following steps:
[0123] In step 301, in response to the access operation of the smart home device, attribute information of the smart home device is determined; 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 accesses the control system, and the attribute information at least includes the device type of the smart home device; thus, in subsequent steps, a corresponding thing model file can be created according to the smart home device accessing the system. Specifically, the thing model file can be mainly created according to the device type information in the attribute information, and the attribute information can further include device basic attributes (such as a unique identifier of the device, a device communication mode, etc.), state attributes (device switch, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off, and various modes, etc.), and event attributes (fault state, state change, etc.) to be applied to different use scenarios according to actual needs and to improve the control efficiency of the smart home device.
[0125] In step 302, a thing model is created according to the attribute information, and a dynamic link library corresponding to the device type is edited according to the device type.
[0126] In a specific implementation, a corresponding thing model file can be created according to the smart home device accessing the system. Specifically, the thing model file can be mainly created according to the device type information in the attribute information, and the thing model file corresponding to the smart home device can further include device basic attributes (such as a unique identifier of the device, a device communication mode, etc.), state attributes (device switch, temperature, color temperature, etc.), function attributes (adjusting temperature, on, off, and various modes, etc.), and event attributes (fault state, state change, etc.) in the attribute information.
[0127] In step 303, the smart home device is controlled according to the thing model and the dynamic link library.
[0128] In actual application, the smart home device can be controlled by using the thing model and the dynamic link library after the thing model and the dynamic link library are both created. Specifically, after a user issues a control command through an app or a voice assistant, the specific content of the control command can be parsed by the thing model, and the corresponding field in the thing model can be adjusted according to the parsing result, and then a corresponding so library interface function is called to convert the adjusted field into corresponding device control data, thereby realizing the control of the smart home device.
[0129] In an example, taking the air conditioner thing model as an example, which includes a cmd field (control field), mode, speed, tem, etc. (state field); when the control command is issued, the thing model will analyze and process the control command, and adjust the cmd field in the thing model according to the analysis result, and then convert the adjusted field into control data that can be recognized by the air conditioner by using the so library, thereby realizing the control effect of the air conditioner.
[0130] Step 304, according to the thing model and the dynamic link library, performing device state monitoring processing on the smart home device.
[0131] In a specific implementation, the change of the smart home device can be monitored in real time through polling or event-driven mode, and the collected data can be converted into a json structure by using the corresponding so library to realize the reporting of the smart home device state change data.
[0132] In an example, taking the air conditioner thing model as an example, which includes a cmd field (control field), mode, speed, tem, etc. (state field); when the smart home device state changes (such as wind speed), the data corresponding to the state change can be collected, and the collected data can be further used as the input data of the so library conversion processing, and after the so library conversion, the value corresponding to the wind speed field in the thing model can be adjusted according to the so library conversion result, and when the value of one or more state fields is adjusted, the above adjustment result information can be reported to the cloud and kept in synchronization with the cloud.
[0133] The following will be combined with Figure 4 The embodiments of the application are further described:
[0134] Referring to Figure 4 The overall execution process of the smart home device control method provided by the application can be summarized as follows:
[0135] Step one, in the smart home device registration and initialization stage, generating an so configuration table according to the smart home device type and creating and defining the thing model file corresponding to the smart home device according to the smart home device category (type);
[0136] Step two, performing smart home device state monitoring and control command analysis, at this time, the so library can be called to execute the corresponding function according to the corresponding monitoring or control requirement;
[0137] Step three, judging whether there is a new smart home device, if not, the smart home device state monitoring and control command analysis are performed as usual, if yes, further judging whether the new smart home device is a smart home device of the existing device type.
[0138] Step four, if the new 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 new 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 an updated physical model file corresponding to the new smart home device type.
[0139] The application provides a smart home device control method, which comprises the following steps: determining attribute information of a smart home device in response to an access operation of the smart home device; wherein the attribute information at least comprises a device type of the smart home device; 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 device according to the physical model and the dynamic link library. The application realizes smart home device control through the combination and application of a physical model and a dynamic link library, can not only realize unified control of smart home devices of the same type through the same physical model, but also realizes specific control command output between different smart home devices through dynamic link library configuration, thereby realizing flexible and unified control of different smart home devices, breaking the barriers between different brands and different protocols, reducing the operation 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 method embodiments, in order to simply describe, they are all described as a series of action combinations, but those skilled in the art should know that the application embodiments are not limited to the action sequence described, because according to the application embodiments, certain steps can be performed in other sequences or at the same time. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions involved are not necessarily necessary for the application embodiments.
[0141] Referring to Figure 5 , a structural schematic diagram of a smart home device control device provided by some embodiments of the application is shown; specifically, it can comprise the following modules:
[0142] An attribute information determination module 501 is 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 comprises a device type of the smart home device;
[0143] A physical model and dynamic link library creation module 502 is configured 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;
[0144] The smart home device control module 503 is configured to control the smart home device according to the thing model and the dynamic link library.
[0145] In some embodiments of the present application, the device further comprises:
[0146] The device state monitoring processing module is configured to monitor the state of the smart home device according to the thing model and the dynamic link library.
[0147] In some embodiments of the present application, the device state monitoring processing module comprises:
[0148] The first data acquisition submodule is configured to acquire first data corresponding to a state change of the smart home device in response to the state change.
[0149] The first conversion result generation submodule is configured to perform first conversion processing on the first data through the dynamic link library to generate a first conversion result.
[0150] The first adjustment result determination submodule is configured to adjust a corresponding field in the thing model according to the first conversion result and determine a first adjustment result of the corresponding field.
[0151] The information reporting processing submodule is configured to perform information reporting processing on the first adjustment result.
[0152] In some embodiments of the present application, the smart home device control module 503 comprises:
[0153] The control command analysis submodule is configured to receive a control command through the thing model, analyze the control command through the thing model, and generate an analysis result.
[0154] The second adjustment result determination submodule is configured to adjust a corresponding field in the thing model according to the analysis result and determine a second adjustment result of the corresponding field.
[0155] The device control data generation submodule is configured to perform second conversion processing on the second adjustment result through the dynamic link library to generate device control data.
[0156] The smart home device control submodule is configured to control the smart home device according to the device control data.
[0157] In some embodiments of the present application, the information reporting processing submodule comprises:
[0158] The device exception judgment unit is configured to determine whether the smart home device has a device exception according to the first adjustment result.
[0159] The information reporting processing unit is configured 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 application, the device further comprises:
[0161] The smart home device adding module is configured to, in response to an access operation of adding a smart home device, determine whether the smart home device and the added smart home device are of the same device type.
[0162] The dynamic link library updating module is configured to, if the smart home device and the added smart home device are of the same device type, update the dynamic link library according to the added smart home device.
[0163] In some embodiments of the present application, the physical model and dynamic link library creating module 502 comprises:
[0164] The physical model creating submodule is configured to create the physical model according to the device type, and any one or more of the basic attribute, the state attribute, the function attribute and the event attribute.
[0165] Some embodiments of the present application further provide an electronic device, which can comprise a processor, a memory, and a computer program stored on the memory and capable of running on the processor, and the computer program is executed by the processor to implement the above smart home device control method.
[0166] Some embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above smart home device control method.
[0167] Some embodiments of the present application further provide a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the above smart home device control method.
[0168] For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts refer to the part of the method embodiments.
[0169] Each embodiment in the specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment refer to each other.
[0170] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In one embodiment, the present application can be implemented in software and / or firmware. In particular, various
[0171] Embodiments of the present application are described in terms of flowcharts and / or block diagrams in which several operational flows are presented, and / or several portions of code are presented. It should be understood that the various operational flows or portions of code can be implemented by a computer program, software, or firmware tangibly embodied in a computer-readable storage medium for execution by a processor. It should also be understood that the various operational flows or portions of code can be implemented by a processor, such as a processing unit, a processor of an embedded system, or a processor of a computer. Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the block or blocks.
[0172] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the block or blocks.
[0173] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow Figure 1 one or more flows and / or blocks Figure 1 means for performing the function specified by the block or blocks.
[0174] While preferred embodiments of the application have been described, those skilled in the art will appreciate that other modifications than those specifically described can be made within the scope of the present application. Accordingly, all changes coming within the meaning and equivalency range of the appended claims are intended to be embraced therein.
[0175] Finally, it is to be understood that the phraseology or terminology such as "first" and "second" etc. used herein is merely intended to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any actual such relationship or order between such entities or operations. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the aforesaid element.
[0176] The above provides a kind of smart home equipment control method and device, electronic equipment, storage medium, are introduced in detail, the principle and implementation of the present application are described in this paper by specific examples, the above example is only for helping to understand the method of the present application and its core idea;For the person skilled in the art, according to the idea of the present application, there will be changes in specific implementation and application range, in view of the above, the content of the specification should not be understood as the limitation of the present application.
Claims
1. A smart home device control method, characterized by, The method comprises: In response to an access operation of a smart home device, attribute information of the smart home device is determined; wherein the attribute information at least comprises a device type of the smart home device; An object model is created according to the attribute information, and a dynamic link library corresponding to the device type is edited according to the device type; The smart home device is controlled according to the object model and the dynamic link library; The control of the smart home device according to the object model and the dynamic link library comprises: A control command is received through the object model, and the control command is parsed and processed through the object model to generate a parsing result; According to the parsing result, a corresponding field in the object model is adjusted, and a second adjustment result of the corresponding field is determined; The second adjustment result is subjected to a second conversion processing through the dynamic link library to generate device control data; The smart home device is controlled according to the device control data.
2. The method of claim 1, wherein, The method further comprises: According to the object model and the dynamic link library, a device state monitoring processing is performed on the smart home device.
3. The method of claim 2, wherein, The device state monitoring processing on the smart home device according to the object model and the dynamic link library comprises: In response to a state change of the smart home device, first data corresponding to the state change is obtained; The first data is subjected to a first conversion processing through the dynamic link library to generate a first conversion result; According to the first conversion result, a corresponding field in the object model is adjusted, and a first adjustment result of the corresponding field is determined; The first adjustment result is subjected to an information reporting processing.
4. The method of claim 3, wherein, The information reporting processing of the first adjustment result comprises: According to the first adjustment result, it is judged 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 information reporting processing of the first adjustment result and the device abnormality information is performed.
5. The method of claim 1, wherein, The method further comprises: In response to an access operation of a newly added smart home device, it is judged 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.
6. The method of claim 1, wherein, The attribute information further comprises any one or more of a basic attribute, a state attribute, a function attribute, and an event attribute.
7. The method of claim 6, wherein, The creation of the 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 attribute, the state attribute, the function attribute, and the event attribute.
8. A smart home device control apparatus, characterized by comprising: The device comprises: An attribute information determination module is 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 comprises a device type of the smart home device; An object model and dynamic link library creation module is configured to create an object model according to the attribute information, and edit a dynamic link library corresponding to the device type according to the device type; The smart home device control module is configured to control the smart home device according to the object model and the dynamic link library. The smart home device control module comprises: A control command analysis submodule configured to receive a control command through the object model, analyze the control command through the object model, and generate an analysis result; A second adjustment result determination submodule configured to adjust a corresponding field in the object model according to the analysis result, and determine a second adjustment result of the corresponding field; A device control data generation submodule configured to perform a second conversion on the second adjustment result through the dynamic link library, and generate device control data; A smart home device control submodule configured to control the smart home device according to the device control data.
9. An electronic device, comprising: A computer program stored on the memory and capable of running on the processor, and the computer program is executed by the processor to implement the smart home device control method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, A computer program stored on the computer readable storage medium, and the computer program is executed by the processor to implement the smart home device control method of any one of claims 1 to 7.
11. A computer program product comprising a computer program, the computer program being executed by a processor to implement the smart home device control method of any one of claims 1 to 7.
Citation Information
Patent Citations
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