Device control method, device, electronic device and computer storage medium
By adjusting the sampling frequency and data update frequency according to environmental information and thresholds in smart home devices, the problem of high device power consumption is solved, the service life is extended, and the user experience is improved.
Patent Information
- Application Number
- CN202210031338.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-01-12
AI Technical Summary
When existing smart home devices collect environmental data, the sampling frequency and data update frequency are too high, resulting in increased power consumption and shortened service life.
By obtaining the target environment information and adjusting the sampling frequency and data update frequency according to the set threshold, the collection and update are only performed when specific conditions are met, such as collecting environmental information when the illumination threshold is met, and adjusting the data update frequency when the object detection information meets the threshold. .
The overall power consumption of the device is reduced, the service life of the device is extended, and the user experience is improved.
Smart Images

Figure CN114384816B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and more specifically, to a device control method, apparatus, electronic device and computer storage medium. Background Art
[0002] In recent years, with the continuous iterative development of Internet and Internet of Things technologies, the concept of smart home has begun to gain popularity, and new products in the smart home industry have been continuously released and launched on the market. Many of these products are the basic products of smart home systems, such as smart gateways and various electronic devices that can collect environmental data.
[0003] At present, the power consumption of electronic devices capable of collecting environmental data is affected by their sampling frequency and data update frequency. If the sampling frequency and data update frequency are too high, the power consumption of the electronic devices will be increased, which will greatly reduce the service life of the electronic devices. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide a device control method, apparatus, electronic device and computer storage medium to reduce the average power consumption of electronic devices capable of collecting environmental data and extend the service life of the electronic devices.
[0005] In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, the present application provides a device control method, the method comprising:
[0007] Acquire first environment information in a target environment collected by a target device;
[0008] If the first environmental information meets the first threshold, controlling the target device to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode;
[0009] If the second environment information satisfies the second threshold, the data update frequency of the target device is adjusted, and the target device is controlled to perform data update according to the adjusted data update frequency. In an optional implementation, the method further includes:
[0010] When the network status does not meet the network status threshold, the illumination information under the target environment is collected according to a preset sampling frequency.
[0011] In an optional embodiment, the method further comprises:
[0012] If the object detection information does not meet the object condition threshold, the target device is controlled to collect the object detection information according to the sampling frequency in the second sampling mode.
[0013] In a second aspect, the present application provides a device control apparatus, the apparatus comprising:
[0014] An acquisition module, used to acquire first environment information in a target environment collected by a target device;
[0015] A first control module, configured to control the target device to collect second environment information under the target environment according to a sampling frequency in a first sampling mode when the first environment information meets a first threshold;
[0016] The second control module is used to adjust the data update frequency of the target device when the second environment information meets a second threshold, and control the target device to update data according to the adjusted data update frequency.
[0017] In an optional implementation, the acquisition module is further used to acquire illumination information in the target environment collected by the target device;
[0018] The first control module is further configured to control the target device to collect second environmental information under the target environment according to the sampling frequency under the first sampling mode when the illumination information meets the illumination threshold.
[0019] In an optional implementation, the acquisition module is further used to acquire object detection information in the target environment collected by the target device;
[0020] If the object detection information satisfies the object condition threshold, controlling the target device to collect illumination information under the target environment;
[0021] The first control module is further configured to control the target device to collect second environmental information under the target environment according to the sampling frequency under the first sampling mode when the illumination information meets the illumination threshold.
[0022] In an optional embodiment, the device further comprises:
[0023] A detection module, configured to detect a network state of the target device when the target device is in a first network mode;
[0024] The third control module is used to control the target device to collect the first environment information under the target environment when the network state meets the network state threshold.
[0025] In an optional implementation manner, the third control module is further configured to obtain object detection information in the target environment collected by the target device when the network state meets the network state threshold;
[0026] If the object detection information meets the object condition threshold, the target device is controlled to collect the lighting information under the target environment.
[0027] In an optional embodiment, the device further comprises:
[0028] A fourth control module, configured to control the target device to collect first environmental information and illumination information under the target environment according to an initial sampling frequency when the target device is in the second network mode;
[0029] In an optional implementation, the first control module is further configured to control the target device to collect second environmental information under the target environment at a sampling frequency in a second sampling mode when the first environmental information does not meet the first threshold; the sampling frequency in the second sampling mode is lower than the sampling frequency in the first sampling mode;
[0030] Continue to control the target device to collect the first environment information under the target environment according to the initial sampling frequency.
[0031] In an optional implementation manner, the second control module is further configured to control the target device to suspend data updating when the second environment information does not meet a second threshold;
[0032] Continue to control the target device to collect second environment information under the target environment according to the sampling frequency in the first sampling mode.
[0033] In a third aspect, the present application provides an electronic device, including a processor and a memory, wherein the memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the method described in any one of the aforementioned embodiments.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the method described in any one of the aforementioned embodiments is implemented.
[0035] The device control method, apparatus, electronic device and computer storage medium provided in the embodiments of the present application collect second environmental information when the first environmental information meets the first threshold, and adjust the data update frequency to update the data when the second environmental information meets the second threshold, thereby reducing the sampling frequency and data update frequency of the second environmental information, thereby reducing the overall power consumption of the target device and extending the service life of the target device.
[0036] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A schematic diagram of an application environment of the device control method provided in an embodiment of the present application is shown;
[0039] Figure 2 A schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0040] Figure 3 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0041] Figure 4 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0042] Figure 5 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0043] Figure 6 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0044] Figure 7 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0045] Figure 8 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0046] Fig. 9 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0047] Fig.10 The hardware structure diagram of the TVOC sensor device is shown;
[0048] Fig.11 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0049] Fig.12 Another schematic diagram of a flow chart of a device control method provided in an embodiment of the present application is shown;
[0050] Fig.13A functional module diagram of a device control device provided in an embodiment of the present application is shown;
[0051] Fig.14 Another functional module diagram of the device control device provided in an embodiment of the present application is shown;
[0052] Fig.15 Another functional module diagram of the device control device provided in the embodiment of the present application is shown;
[0053] Fig.16 A hardware structure block diagram of an electronic device provided in an embodiment of the present application is shown.
[0054] Icons: 10-smart home system; 100-gateway; 200-electronic device; 210-memory; 220-processor; 230-communication module; 300-server; 400-terminal device; 500-router; 310-main control chip; 320-temperature and humidity sensor probe; 321-TVOC element; 322-photoresistor; 330-battery; 340-button; 350-indicator light; 360-electronic ink screen; 410-acquisition module; 420-first control module; 430-second control module; 440-detection module; 450-third control module; 460-fourth control module. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0056] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0057] It should be noted that relational terms such as "first" and "second" are used only 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 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 device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0058] An application environment involved in this application is introduced below.
[0059] Please refer to Figure 1 , is a schematic diagram of an application environment applicable to the embodiment of the present application. Among them, Figure 1 A smart home system 10 is provided, which includes a gateway 100, an electronic device 200 connected to the gateway 100, and a server 300 connected to the gateway 100. There may be at least one gateway 100, and there may be at least one electronic device 200. In addition, when there are multiple gateways 100, different gateways 100 may also be connected to each other in communication.
[0060] In this embodiment, the gateway 100 can be an intelligent gateway for smart home control, which can realize functions such as system information collection, information input, information output, centralized control, remote control, and linkage control. The gateway 100 can be responsible for specific security alarms, home appliance control, and electricity consumption information collection. The gateway 100 can also exchange information with products such as intelligent interactive terminals in a wireless manner. The gateway 100 also has wireless routing functions, excellent wireless performance, network security, and coverage area.
[0061] The electronic device 200 may be a device with a data acquisition function, such as a device capable of collecting environmental information, including a variety of sensor devices or environmental detection devices arranged in an indoor space, etc. The sensor device may be an indoor organic gaseous substance sensor (TVOC sensor), a temperature sensor, a humidity sensor, a pressure sensor, a smoke sensor, a human body sensor, a door and window sensor, etc. The environmental detection device may be a water quality detection device, an air pollution detection device, etc. The electronic device 200 connected to the gateway 100 may interact with the gateway for information and instructions. The gateway 100 and the electronic device 200 may be connected via Bluetooth, WiFi (Wireless-Fidelity), ZigBee (communication methods such as ZigBee technology), and of course, the connection method between the gateway 100 and the electronic device 200 may not be limited in the embodiment of the present application.
[0062] In the embodiment of the present application, the server 300 may be a local server, a cloud server or other server, and the specific server type may not be limited in the embodiment of the present application. The server 300 connected to the gateway 100 can exchange information with the gateway 100 wirelessly. The gateways 100 set in different indoor spaces can communicate with the same server 300 through the network to exchange information between the server 300 and the gateway 100.
[0063] Furthermore, the above-mentioned smart home system 10 may also include a terminal device 400. Among them, the terminal device 400 may include a personal computer (PC), a tablet computer, a smart phone, a personal digital assistant (PDA), etc., which are not limited here. The terminal device 400 can exchange information with the server 300 through wireless methods such as 2G / 3G / 4G / 5G / WiFi. Of course, the connection method between the terminal device 400 and the server 300 may not be limited in the embodiment of the present application. In some embodiments, the terminal device 400 can also be used to interact with users, so that users can communicate wirelessly with the gateway 100 based on the router 500 through the terminal device 400. In addition, the user can add an account information to the gateway 100 and the terminal device 400 at the same time, and realize the information synchronization of the gateway 100 and the terminal device 400 through the account information.
[0064] In some embodiments, the user can set different trigger scenarios or automation linkages through the application (Application, APP) of the terminal device 400. As a way, the terminal device 400 can upload the scene configuration information or automation scheme to the server 300, so that when the triggering condition of the triggering scene or automation is reached, the server 300 can find the device corresponding to the execution action in the scene configuration information or automation scheme according to the stored scene configuration information or automation scheme, so as to notify the device to perform the execution action to meet the execution result of the triggering scene or automation. As another way, the server 300 can also send the scene configuration information or automation scheme to the gateway 100, and the gateway 100 can find the device corresponding to the execution action in the scene configuration information or automation scheme according to the stored scene configuration information or automation scheme. At the same time, the gateway 100 can feedback the execution status of the device to the server 300.
[0065] The various embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0066] A possible implementation is given below to illustrate how the present application performs device control. Specifically, Figure 2 A schematic diagram of a flow chart of a device control method provided in an embodiment of the present application. It should be noted that the device control method in an embodiment of the present application is not based on Figure 2 The specific order below is for limitation. It should be understood that in other embodiments, the order of some steps in the device control method of the present application can be interchanged according to actual needs, or some steps can be omitted or deleted.
[0067] See also Figure 2 ,The method comprises: step S31, obtaining first environment information in a target environment collected by a target device;
[0068] Optionally, the target device may be an electronic device with a data collection function, such as an environmental information collection function. In a possible implementation, the target device may be a sensor device or an environmental detection device that is set indoors and can collect indoor environmental information. If the target device is a sensor device, the target device may be at least one of a TVOC sensor, a temperature sensor, a humidity sensor, a pressure sensor, a smoke sensor, and other sensor devices; if the target device is an environmental detection device, the target device may be at least one of a water quality detection device, an air pollution detection device, and other environmental detection devices.
[0069] It can be understood that in the above-mentioned smart home system, the target device can be the electronic device 200.
[0070] Optionally, the target environment may be an environment that currently requires environmental information collection, and the first environmental information may be environmental information of the target environment collected by the target device.
[0071] Step S32: if the first environment information meets the first threshold, control the target device to collect the second environment information in the target environment according to the sampling frequency in the first sampling mode;
[0072] Optionally, the first sampling mode may be a sleep mode, and when the first environmental information meets the first threshold, the target data may be controlled to enter sleep while timing the sleep duration, and the target device may be awakened after a preset sleep duration, thereby controlling it to perform sampling. It is understandable that the sampling frequency in the first sampling mode is to control the target device to perform sampling after a preset sleep duration.
[0073] Optionally, the preset sleep duration can be set according to usage requirements and pre-saved in the target device. In a possible implementation, the preset sleep duration can be 30 seconds.
[0074] Optionally, the second environmental information may be environmental information in a current environment collected by the target device. It can be understood that the second environmental information and the first environmental information are different environmental information in the same target environment.
[0075] Optionally, a first threshold can be set in advance and saved in the target device. After acquiring the first environmental information, the first environmental information can be compared with the pre-stored first threshold to determine whether the first environmental information meets the first threshold. When the first environmental information meets the first threshold, the target device is controlled to collect the second environmental information under the target environment according to the sampling frequency under the first sampling mode.
[0076] In this embodiment, the target device can collect at least two types of environmental information, wherein the second environmental information is the environmental information mainly collected by the target device. For example, if the target device is a TVOC sensor, the second environmental information is air quality data; if the target device is a temperature and humidity sensor, the second environmental information is temperature data and humidity data.
[0077] Step S33: If the second environment information meets the second threshold, the data update frequency of the target device is adjusted, and the target device is controlled to perform data update according to the adjusted data update frequency.
[0078] Optionally, a second threshold can be set in advance and saved in the target device. After the second environmental information is collected, the second environmental information can be compared with the pre-stored second threshold. When the collected second environmental information meets the second threshold, the data update frequency of the target device is adjusted, so that data is updated according to the adjusted data update frequency.
[0079] Optionally, the data can be updated by uploading the second environment information to the gateway. In addition, if a display is provided in the target device, the data can also be updated by refreshing the display.
[0080] Optionally, the data update frequency can be adjusted according to current needs. For example, the data update frequency of the target device can be adjusted to perform data update immediately when the second environmental information meets the second threshold, and then continue to collect the second environmental information, and judge whether the second environmental information meets the second threshold; the data update frequency of the target device can be adjusted to perform data update immediately when the second environmental information meets the second threshold, and then continue to collect the first environmental information, and judge whether the first environmental information meets the first threshold; a certain interval time can also be pre-set, and the data update frequency of the target device can be adjusted to refresh the display to display the second environmental information when the second environmental information meets the second threshold, and then no longer collect environmental information, and only refresh the display again after a preset interval time.
[0081] The device control method provided in the embodiment of the present application reduces the sampling frequency and data update frequency of the second environmental information by collecting the second environmental information when the first environmental information meets the first threshold, and adjusting the data update frequency to update the data when the second environmental information meets the second threshold, thereby reducing the overall power consumption of the target device and extending the service life of the target device.
[0082] Optionally, considering that in a weak light condition, even if the second environment information is collected and the data is updated, the user cannot view the updated data based on the dim light. Therefore, the first environment information may include light information, and the first threshold may be a light threshold.
[0083] Specifically, in Figure 2 On the basis of Figure 3 For another flow chart of the device control method provided in the embodiment of the present application, please refer to Figure 3 , the above step S31 can be implemented by the following steps:
[0084] Step S31-1, obtaining illumination information in a target environment collected by a target device;
[0085] Optionally, the lighting information is a lighting intensity value in a current target environment collected by the target device.
[0086] On this basis, the above step S32 can be implemented by the following steps:
[0087] Step S32-1: If the illumination information meets the illumination threshold, the target device is controlled to collect second environment information in the target environment according to the sampling frequency in the first sampling mode.
[0088] Optionally, when the illumination information is greater than or equal to the illumination threshold, it is considered that the illumination information satisfies the illumination threshold.
[0089] Optionally, the light threshold can be a light intensity threshold at which the user can clearly see the data update status. If the light information meets the light threshold, it means that the current light intensity can meet the user's need to view data. Therefore, the target device is controlled to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode.
[0090] The device control method provided in the embodiment of the present application controls the target device to collect the second environment information when the lighting information in the target environment meets the lighting threshold, thereby ensuring that when sampling the second environment information, the lighting intensity in the target environment meets the user's need to view data, avoiding real-time sampling of the second environment information, reducing the sampling frequency of the second environment information, thereby reducing sampling power consumption, and improving user experience.
[0091] Optionally, even if the lighting information meets the lighting threshold, if there is no one in the current environment, even if the second environmental information is collected and the data is updated, no one will view the updated data. Therefore, the first environmental information may include object detection information and lighting information, and the first threshold may include an object condition threshold and a lighting threshold.
[0092] Specifically, in Figure 2 On the basis of Figure 4 For another flow chart of the device control method provided in the embodiment of the present application, please refer to Figure 4 , the above step S31 can also be implemented by the following steps:
[0093] Step S31-2, obtaining object detection information in the target environment collected by the target device;
[0094] Step S31-3, if the object detection information meets the object condition threshold, control the target device to collect lighting information under the target environment;
[0095] Optionally, an object condition threshold may be preset and stored in the target device, and the object condition threshold may represent the presence of a person in the target environment.
[0096] Optionally, the target device can collect object detection information in the target environment and compare it with a preset object condition threshold to determine whether the object detection information meets the object condition threshold. If the object detection information meets the object condition threshold, it means that there is a person in the target environment, so the target device can be controlled to collect lighting information in the target environment.
[0097] Optionally, the target device can obtain object detection information in the target environment by accessing the gateway. Specifically, a human sensor, soft sensor or other device that can determine whether there is a person in the target environment can be set. When the device determines that there is someone, it can upload information about the person in the target environment to the gateway. The target device can initiate periodic queries to the gateway to obtain object detection information in the target environment, for example, by using Polling.
[0098] Optionally, the object detection information in the target environment can be stored in the gateway in the form of a digital mark. In one possible implementation, if there is someone, the object detection information in the target environment can be set to 1, and if there is no one, the object detection information in the target environment can be set to 0. It can be understood that at this time, the object condition threshold pre-stored in the target device can be 1. Therefore, when the target device performs a query, the obtained object detection information can be compared with the object condition threshold. If the collected object detection information is 1, the object detection information meets the object condition threshold, so the target device can be controlled to collect the lighting information in the target environment.
[0099] In addition, the user can also input object detection information to the target device by manual setting. For example, when the user is in the target environment, the user can input human information to the target device, and when the user is leaving, the user can input human information to the target device, so that the target device can directly obtain the object detection information in the target environment. In a possible implementation, the pre-stored object condition threshold is that there are people in the target environment. Therefore, when the object detection information obtained by the target device is human information, it means that the object detection information meets the object condition threshold, so the target device can be controlled to collect the lighting information in the target environment.
[0100] On this basis, the above step S32 can be implemented by the following steps:
[0101] Step S32-1: If the illumination information meets the illumination threshold, the target device is controlled to collect second environment information in the target environment according to the sampling frequency in the first sampling mode.
[0102] In this embodiment, the lighting information can be a lighting intensity value. If the lighting information meets the lighting threshold, it means that there are not only people in the target environment, but also the lighting intensity can meet the user's needs to view data. Therefore, the target device is controlled to collect the second environmental information in the target environment according to the sampling frequency in the first sampling mode.
[0103] The device control method provided in the embodiment of the present application controls the target device to collect the second environment information when the object detection information in the target environment meets the object condition threshold and the illumination information meets the illumination threshold, thereby ensuring that there are people in the target environment when the second environment information is sampled and the illumination intensity meets the user's need to view data, avoiding the sampling of the second environment information in an unmanned environment or an environment with low illumination intensity, reducing the sampling frequency of the second environment information, thereby reducing sampling power consumption and improving user experience.
[0104] Optionally, the target device may be connected to a network to be used online, or may not be connected to a network and used only offline. In a possible implementation, the network mode of the target device may be determined before collecting the first environment information. Specifically, Figure 2 Based on Figure 5 , is another flow chart of a device control method provided in an embodiment of the present application. Before the above step S31, the method further includes:
[0105] Step S40, if the target device is in the first network mode, detecting the network status of the target device;
[0106] Optionally, the first network mode is an access mode, that is, when the target device is in the access mode, it means that the target device has been connected to the network and can be used online. Considering that the target device cannot effectively access the gateway when the network status is poor, the network status of the target device can be detected before use.
[0107] Step S41, when the network status meets the network status threshold, control the target device to collect first environment information under the target environment.
[0108] Optionally, a network status threshold may be set to indicate that the target device is normally connected to the gateway. In one possible implementation, the network status threshold is the confirmation signal, such as an ACK signal, that the target device can receive from the gateway after initiating a query to the gateway. It is understandable that if the target device receives a confirmation signal sent by the gateway after initiating a query to the gateway, it means that the connection between the target device and the gateway is normal, and the network status of the target device meets the network status threshold.
[0109] Optionally, when the network status satisfies a network status threshold, the target device may be controlled to collect first environment information under the target environment.
[0110] Optionally, the first environment information may include object detection information and illumination information, and the first threshold may be an object condition threshold and an illumination threshold. Figure 5 On the basis of Figure 6 For another flow chart of the device control method provided in the embodiment of the present application, please refer to Figure 6 , the above step S41 can be implemented by the following steps:
[0111] Step S41-1, when the network state meets the network state threshold, obtaining object detection information in the target environment;
[0112] Step S41 - 2 : if the object detection information satisfies the object condition threshold, the target device is controlled to collect the lighting information in the target environment.
[0113] Optionally, the target device can collect object detection information by initiating periodic queries to the gateway. When the network status meets the network status threshold, the target device is normally connected to the gateway. Therefore, the target device can query the gateway to obtain object detection information in the target environment.
[0114] Optionally, the object detection information can be acquired by a device capable of detecting human body information, such as a human body sensor or a soft sensor, and uploaded to the gateway. It can also be manually input by a user through a terminal device and then uploaded to the gateway by the terminal device. In one possible implementation method, the terminal device may include a mobile phone, a PC, a tablet, etc.
[0115] In another possible mode, the target device and the gateway cannot be connected normally due to factors such as gateway power outage. In this case, when the network status does not meet the network status threshold, the target device cannot collect object detection information from the gateway. Therefore, the target device can be directly controlled to collect lighting information in the target environment according to the preset sampling frequency.
[0116] Optionally, the preset sampling frequency may be to collect lighting information only once, and determine whether the lighting information is greater than or equal to a preset lighting threshold. When the lighting information is less than the lighting threshold, do not continue to collect lighting information, but continue to determine whether the network status meets the network status threshold; the preset sampling frequency may also be to set a certain sampling time interval, so as to collect lighting information multiple times until the collected lighting information meets the lighting threshold.
[0117] In another possible implementation, if the object detection information in the target environment collected by the target device does not meet the object condition threshold, for example, the object condition threshold is a flag bit representing the presence or absence of human information is 1, that is, there are people in the target environment, and the collected object detection information is a flag bit representing the presence or absence of human information is 0, that is, there are no people in the target environment, then the object detection information can continue to be collected according to the second sampling mode.
[0118] Optionally, the second sampling mode may be a standby mode. When the second sampling mode is the standby mode, the sampling frequency is 0 and the target device stops sampling. In addition, the second sampling mode may also be a mode in which the sampling frequency is lower than the sampling frequency of the first sampling mode.
[0119] The device control method provided in the embodiment of the present application determines the working mode of the target device by detecting the network status, judging whether the object detection information meets the object condition threshold, and judging whether the illumination information meets the illumination threshold when the target device is in the first network mode; when the network status of the target device meets the network status threshold, the object detection information meets the object condition threshold, and the illumination information meets the illumination threshold, the target device is controlled to collect the second environment information, thereby reducing the collection frequency of the second environment information and reducing power consumption.
[0120] Optionally, if the target device is in the second network mode, Figure 2 On the basis of Figure 7 For another flow chart of a device control method provided in an embodiment of the present application, please refer to Figure 7 Before the above step S31, the method further includes:
[0121] Step S42: If the target device is in the second network mode, control the target device to collect illumination information in the target environment according to the initial sampling frequency.
[0122] Optionally, the second network mode is a non-network mode, that is, the target device is not connected to the gateway in the second network mode. In this case, the target device can be controlled to collect lighting information in the target environment according to the initial sampling frequency.
[0123] Optionally, the initial sampling frequency is a sampling frequency that is preset and stored in the target device. In a possible implementation, the initial sampling frequency may be continuous sampling or sampling at intervals.
[0124] The device control method provided in the embodiment of the present application collects lighting information in the target environment according to the initial sampling frequency when the target device is in the second network mode, so that when the lighting information meets the lighting threshold, the target device is controlled to collect the second environment information, thereby reducing the collection frequency of the second environment information and thus reducing power consumption.
[0125] Optionally, considering that the first environment information may not meet the first threshold, in this case, refer to Figure 8 , the method further comprises:
[0126] Step S43: if the first environment information does not meet the first threshold, control the target device to collect the second environment information under the target environment according to the sampling frequency in the second sampling mode;
[0127] Wherein, the sampling frequency in the second sampling mode is lower than the sampling frequency in the first sampling mode;
[0128] Step S44, continue to control the target device to collect the first environment information under the target environment according to the initial sampling frequency;
[0129] Optionally, the sampling frequency under the second sampling mode can be 0. It can be understood that at this time, the second sampling mode is a standby mode. In this mode, the target device does not collect environmental information and enters a standby state. In addition, the sampling frequency under the second sampling mode can also be a frequency value greater than 0 and lower than the sampling frequency in the first sampling mode.
[0130] Optionally, since the target device is also controlled to collect the first environment information in the target environment according to the initial sampling frequency, if the first environment information meets the first threshold, the sampling frequency of collecting the second environment information can be restored to the sampling frequency of the first sampling mode.
[0131] The device control method provided in the embodiment of the present application does not collect the second environmental information or reduces the sampling frequency of the second environmental information when the first environmental information does not meet the first threshold. That is, by not sampling the second environmental information when the first environmental information does not meet the condition, or reducing the sampling frequency of the target device, the overall power consumption of the target device is reduced.
[0132] Optionally, considering that there may be a situation where the second environment information does not meet the second threshold, in this case, see Fig. 9 , the method further comprises:
[0133] Step S45, if the second environment information does not meet the second threshold, controlling the target device to suspend data update;
[0134] Step S46, continue to control the target device to collect the second environment information under the target environment according to the sampling frequency in the first sampling mode.
[0135] Optionally, if the second environmental information does not meet the second threshold, it means that the second environmental information in the target environment is within a normal range and does not need to be displayed. Therefore, the target device may be controlled to suspend data updating.
[0136] Optionally, the suspension of data updating may include not uploading the second environment information to the gateway, or not updating the second environment information displayed on the display.
[0137] Optionally, since the second environmental information does not meet the second threshold, the target device can continue to be controlled to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode until the second environmental information meets the second threshold, and then the target device is controlled to resume data updating.
[0138] The device control method provided in the embodiment of the present application suspends data updating when the second environmental information does not meet the second threshold, and continues to control the target device to collect the second environmental information under the target environment according to the sampling frequency under the first sampling mode until the second environmental information meets the second threshold, and then controls the target device to resume data updating, thereby reducing the data update frequency and further reducing the power consumption of the target device.
[0139] Next, taking the target device as a TVOC sensor device as an example, the overall process of the above-mentioned device control method is introduced. The TVOC sensor is used to detect air quality and can collect temperature and humidity information and TVOC concentration information in the target environment. The TVOC concentration information can reflect the degree of air pollution.
[0140] Please refer to Fig.10 , is a hardware structure block diagram of a TVOC sensor device, the TVOC sensor at least comprises: a main control chip 310 and an environment acquisition module, wherein the environment acquisition module at least comprises: a temperature and humidity sensor probe 320, a TVOC element 321 and a photoresistor 322. The main control chip 310 is respectively connected to the temperature and humidity sensor probe 320, the TVOC element 321 and the photoresistor 322 through signal lines, and the photoresistor 322 is electrically connected to the TVOC element 321 through a power line.
[0141] Among them, the main control chip 310 is used to control the environment acquisition module to collect environmental information, and adjust the data update frequency and update the data according to the environmental information collected by the environment acquisition module; the temperature and humidity sensor probe 320 is used to collect the temperature and humidity in the target environment; the TVOC element 321 is used to collect air quality data in the target environment; the photoresistor 322 is used to collect lighting information in the target environment, and in a possible implementation method, the light intensity value can also be collected through a phototransistor.
[0142] Optionally, the main control chip 310 may be a JN5189 chip, and the main control chip may be communicatively connected to a gateway via an antenna.
[0143] Optionally, the TVOC sensor device may further include a battery 330, a button 340, an indicator light 350 and an electronic ink screen 360, and the battery 330 is electrically connected to the main control chip 310, the electronic ink screen 360, and the photoresistor 322 through a power line, the electronic ink screen 360 is electrically connected to the temperature and humidity sensor probe 320 through a power line, and the button 340, the indicator light 350 and the electronic ink screen 360 are respectively connected to the main control chip 310 through signal lines.
[0144] Among them, the battery 330 is used to power the TVOC sensor device. Optionally, the battery can be a button battery, such as CR2450; the button 340 is used to receive user operations and convert the user operations into electrical signals and send them to the main control chip 310; the indicator light 350 is used to indicate which mode the TVOC sensor device is in; the electronic ink screen 360 is used to display sampling data.
[0145] based on Fig.10 When the TVOC sensor is in the first network mode, please refer to Fig.11 , the method comprising:
[0146] Step 100, determining whether the network status of the target device meets the network status threshold;
[0147] If yes, execute step 101 , if no, execute step 102 .
[0148] Step 101, obtaining object detection information in a target environment collected by a target device;
[0149] Step 102, controlling the target device to collect illumination information in the target environment according to a preset sampling frequency;
[0150] In this embodiment, the TVOC sensor can initiate a query to the gateway through the main control chip 310, and determine whether its network status meets the network status threshold by receiving a confirmation signal from the network manager. If so, the object detection information in the target environment collected from the gateway is obtained through a query; if not, the target device is controlled to collect the lighting information in the target environment according to a preset sampling frequency.
[0151] Optionally, the preset sampling frequency can be to collect lighting information only once, and determine whether the lighting information is greater than or equal to a preset lighting threshold. When the lighting information is less than the lighting threshold, do not continue to collect lighting information, but continue to determine whether the network status meets the network status threshold; it can also be to set a certain sampling time interval, so as to collect lighting information multiple times until the collected lighting information meets the lighting threshold.
[0152] Step 103, determining whether the object detection information meets the object condition threshold;
[0153] If yes, execute step S104, if no, execute step S105.
[0154] Step S104, controlling the target device to collect illumination information in the target environment;
[0155] Step S105, collecting object detection information according to a second sampling mode;
[0156] In this embodiment, after the main control chip collects object detection information, it can determine whether the object detection information meets the object condition threshold. In one possible case, the object condition threshold is the presence of someone in the target environment. If the object detection information indicates that there is someone in the target environment, then the object detection information meets the object condition threshold. Therefore, the photoresistor can be controlled to collect lighting information in the target environment. In this embodiment, the lighting information is the light intensity value in the target environment. If the object detection information indicates that there is no one in the target environment, then the object detection information does not meet the object condition threshold. Therefore, the main control chip collects object detection information according to the second sampling mode.
[0157] Optionally, the second sampling mode can be a standby mode. When the second sampling mode is the standby mode, the sampling frequency is 0, and the object detection information is stopped from being collected from the gateway. In addition, the second sampling mode can also be a mode in which the sampling frequency is greater than 0 and lower than the sampling frequency of the first sampling mode, that is, at this time, the gateway can be periodically queried.
[0158] Step 106, determining whether the illumination information meets the illumination threshold;
[0159] If yes, execute step 107 , if no, execute step 108 .
[0160] Step 107, controlling the target device to collect second environment information under the target environment according to the sampling frequency in the first sampling mode;
[0161] Step 108, controlling the target device to collect second environment information under the target environment according to the sampling frequency in the second sampling mode, and continuing to control the target device to collect object detection information under the target environment according to the initial sampling frequency;
[0162] In this embodiment, after obtaining the illumination information, it can be determined whether the illumination information meets the illumination threshold. If the illumination information meets the illumination threshold, the TVOC sensor can be controlled to collect the second environment information under the target environment according to the sampling frequency under the first sampling mode; if the illumination information does not meet the illumination threshold, the target device can be controlled to collect the second environment information under the target environment according to the sampling frequency under the second sampling mode, and the target device can continue to be controlled to collect the object detection information under the target environment according to the initial sampling frequency;
[0163] In this embodiment, the first sampling mode may be a sleep mode, that is, the TVOC sensor may be controlled to enter sleep mode, and after the sleep time reaches a preset time, the TVOC sensor may be controlled to collect the second environmental information. It is understandable that the second environmental information collected by the TVOC sensor may be temperature and humidity information and TVOC concentration information.
[0164] In this embodiment, the second sampling mode can be a standby mode. When the second sampling mode is the standby mode, the sampling frequency is 0, and the object detection information is stopped from being collected from the gateway. In addition, the second sampling mode can also be a mode in which the sampling frequency is greater than 0 and lower than the sampling frequency of the first sampling mode, that is, at this time, the second environmental information in the target environment can be collected at a lower frequency.
[0165] In addition, since the target device is also controlled to collect the first environmental information in the target environment according to the initial sampling frequency, if the first environmental information meets the first threshold, the sampling frequency of collecting the second environmental information can be restored to the sampling frequency of the first sampling mode.
[0166] Step 109, determining whether the second environment information meets a second threshold;
[0167] If yes, execute step 110 , if no, execute step 111 .
[0168] Step 110, adjusting the data update frequency of the target device, and controlling the target device to update data according to the adjusted data update frequency;
[0169] Step 111, controlling the target device to suspend data updating, and continuing to control the target device to collect second environment information under the target environment according to the sampling frequency under the first sampling mode.
[0170] In this embodiment, if the second environmental information collected by the TVOC sensor includes temperature and humidity information and TVOC concentration information, the second threshold corresponding to the temperature and humidity information and the second threshold corresponding to the TVOC concentration information can be set respectively. If either the temperature and humidity information or the TVOC concentration information meets the corresponding second threshold, the data update frequency of the target device is adjusted, and the target device is controlled to update the data according to the updated data update frequency; if both the temperature and humidity information and the TVOC concentration information do not meet the corresponding second threshold, the TVOC sensor device is controlled to suspend data updating, and continue to collect the second environmental information under the target environment at the sampling frequency under the first sampling mode until either the temperature and humidity information or the TVOC concentration information meets the corresponding second threshold.
[0171] The device control method provided in the embodiment of the present application, when the target device is in the first network mode, determines the working mode of the target device by detecting the network state, judging whether the object detection information meets the object condition threshold, and judging whether the illumination information meets the illumination threshold, and when the network state of the target device meets the network state threshold, the object detection information meets the object condition threshold, and the illumination information meets the illumination threshold, controls the target device to collect the second environmental information, thereby reducing the collection frequency of the environmental information; in addition, when the second environmental information meets the second threshold, adjusts the data update frequency of the target device, and suspends data update when the second environmental information does not meet the second threshold, thereby reducing the data update frequency. Since this solution reduces the collection frequency of environmental information and the data update frequency, it can reduce the overall power consumption of the device.
[0172] based on Fig.10 When the TVOC sensor is in the second network mode, please refer to Fig.12 , the method comprising:
[0173] Step 200, controlling the target device to collect illumination information in the target environment according to the initial sampling frequency;
[0174] Step 201, determining whether the illumination information meets the illumination threshold;
[0175] If yes, execute step 202, if no, execute step 203.
[0176] Step 202, controlling the target device to collect second environment information in the target environment according to the sampling frequency in the first sampling mode;
[0177] Step 203, controlling the target device to collect second environmental information under the target environment according to the sampling frequency in the second sampling mode, and continuing to control the target device to collect first environmental information under the target environment according to the initial sampling frequency;
[0178] In this embodiment, the second network mode can be a non-network mode, that is, when the TVOC sensor is in the second network mode, it is not connected to the gateway. Therefore, it is not necessary to query the object detection information from the gateway, and directly control the target device to collect the light information in the target environment according to the initial sampling frequency, and determine whether the light information meets the light threshold. If it meets the threshold, the target device can be controlled to collect the second environment information in the target environment according to the sampling frequency in the first sampling mode; if it does not meet the threshold, the target device can be controlled to collect the second environment information in the target environment according to the sampling frequency in the second sampling mode, and continue to control the target device to collect the light information in the target environment according to the initial sampling frequency.
[0179] Optionally, the first sampling mode may be a sleep mode, and the second sampling mode may be a standby mode, that is, the sampling frequency is 0, or a mode in which the sampling frequency is greater than 0 but less than the sampling frequency of the first sampling mode.
[0180] Optionally, if the second sampling mode is a mode in which the sampling frequency is greater than 0 but less than the sampling frequency of the first sampling mode, since the target device continues to collect lighting information in the target environment when the lighting information does not meet the lighting threshold, if the lighting information collected later meets the lighting threshold, the sampling frequency of the second environment information can be adjusted to the sampling frequency in the first sampling mode.
[0181] Step 204, determining whether the second environment information meets a second threshold;
[0182] If yes, execute step 205 , if no, execute step 206 .
[0183] Step 205, adjusting the data update frequency of the target device, and controlling the target device to perform data update according to the adjusted data update frequency;
[0184] Step 206, controlling the target device to suspend data updating, and continuing to control the target device to collect the second environment information under the target environment according to the sampling frequency in the first sampling mode.
[0185] In this embodiment, it can be determined whether the collected second environmental information meets the second threshold. If so, the data update frequency of the target device is adjusted, and the target device is controlled to update the data according to the adjusted data update frequency; if not, the target device is controlled to pause data updating, and the target device continues to be controlled to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode.
[0186] The device control method provided in the embodiment of the present application, when the TVOC sensor device is in the second network mode, collects the illumination information in the target environment according to the initial sampling frequency, so that when the illumination information meets the illumination threshold, the target device is controlled to collect the second environment information, thereby reducing the collection frequency of the second environment information; and when the second environment information meets the second threshold, the data update frequency of the target device is adjusted, and when the second environment information does not meet the second threshold, the data update is suspended, thereby reducing the data update frequency. Since this solution reduces the collection frequency of environmental information and the data update frequency, the overall power consumption of the device can be reduced.
[0187] based on Fig.10 The TVOC sensor device shown in the present application also provides an application scenario, and the application of the above device control method in the application scenario is as follows:
[0188] The TVOC sensor can be installed indoors to realize home intelligence. The indoor environment can also include sensors that can collect human body information, such as soft sensors.
[0189] In one case, when the TVOC sensor is in the first network mode, if the user returns home, the soft sensor can detect the presence of people in the indoor environment, and can upload the information about people to the gateway. If the network status of the TVOC sensor meets the network status threshold, the information about people in the room can be obtained from the gateway. Therefore, the TVOC sensor can collect light information in the indoor environment through the photoresistor.
[0190] If the light information meets the light threshold, the TVOC sensor can enter sleep mode, collect indoor temperature and humidity information and TVOC concentration information, and determine whether the temperature and humidity information and TVOC concentration information meet the corresponding second threshold. If so, the TVOC sensor can update the temperature and humidity information and TVOC concentration information on the display screen, and upload it to the gateway for storage; if not, the TVOC sensor can continue to collect the temperature and humidity information and TVOC concentration information.
[0191] If the illumination information does not meet the illumination threshold, the TVOC sensor may enter a standby mode and obtain information on whether there is a person from the gateway according to the initial sampling frequency.
[0192] If the user leaves home, the soft sensor can detect that there is no one in the indoor environment, and the no-person information can be uploaded to the gateway. If the network status of the TVOC sensor meets the network status threshold, the no-person information in the indoor environment can be obtained from the gateway. Therefore, the TVOC sensor can enter standby mode and not perform sampling to reduce power consumption.
[0193] If the network status of the TVOC sensor does not meet the network status threshold at this time, the TVOC sensor cannot access the gateway normally, and therefore cannot obtain information about whether there is someone indoors. The TVOC sensor can then control the target device to collect lighting information in the target environment at a preset sampling frequency, and determine how to sample the second environment information based on the lighting information.
[0194] In another case, when the TVOC sensor is in the second network mode, it cannot communicate with the gateway, so it is impossible to query the gateway whether there is someone indoors. Therefore, the target device can be directly controlled to collect lighting information in the target environment according to a preset sampling frequency. If the lighting information meets the lighting threshold, the second environment information can be sampled; if the lighting information does not meet the lighting threshold, the second environment information may not be collected, and the lighting information in the target environment may be collected according to the initial sampling frequency until the lighting information meets the lighting threshold.
[0195] Please refer to Fig.13 , is a functional module diagram of a device control device provided in an embodiment of the present application. The device control device includes an acquisition module 410, a first control module 420 and a second control module 430.
[0196] The acquisition module 410 is used to acquire first environment information under a target environment collected by a target device;
[0197] It can be understood that the acquisition module 410 can execute the above step S31.
[0198] The first control module 420 is used to control the target device to collect second environment information in the target environment according to the sampling frequency in the first sampling mode when the first environment information meets the first threshold;
[0199] It can be understood that the first control module 420 can execute the above step S32.
[0200] The second control module 430 is used to adjust the data update frequency of the target device when the second environment information meets the second threshold, and control the target device to update data according to the adjusted data update frequency.
[0201] It can be understood that the second control module 430 can execute the above step S33.
[0202] The device control device provided in the embodiment of the present application obtains first environmental information under the target environment collected by the target device through an acquisition module; controls the target device to collect second environmental information under the target environment according to the sampling frequency in the first sampling mode when the first environmental information meets the first threshold through the first control module; adjusts the data update frequency of the target device when the second environmental information meets the second threshold through the second control module, and controls the target device to update the data according to the adjusted data update frequency, thereby reducing the sampling frequency and data update frequency of the second environmental information, thereby reducing the overall power consumption of the target device and extending the service life of the target device.
[0203] Optionally, the acquisition module 410 is further used to acquire illumination information in a target environment collected by a target device;
[0204] It can be understood that the acquisition module 410 can also execute the above step S31-1.
[0205] Optionally, the first control module 420 is further configured to control the target device to collect second environmental information in the target environment according to the sampling frequency in the first sampling mode when the illumination information reaches a satisfying illumination threshold.
[0206] It can be understood that the first control module 420 can also execute the above step S32-1.
[0207] Optionally, the acquisition module 410 is further used to acquire object detection information in the target environment collected by the target device; if the object detection information meets the object condition threshold, the target device is controlled to collect illumination information in the target environment;
[0208] It can be understood that the acquisition module 410 can also execute the above steps S31 - 2 to S31 - 3.
[0209] Optionally, see Fig.14 , is another functional module diagram of the device control device provided in the embodiment of the present application. The device control device also includes a detection module 440 and a third control module 450.
[0210] The detection module 440 is used to detect the network status of the target device when the target device is in the first network mode;
[0211] It can be understood that the detection module 440 can execute the above step S40.
[0212] The third control module 450 is used to control the target device to collect the first environment information under the target environment when the network state meets the network state threshold.
[0213] It can be understood that the third control module 450 can execute the above step S41.
[0214] Optionally, the third control module 450 is further used to obtain object detection information in the target environment collected by the target device when the network status meets the network status threshold; if the object detection information meets the object condition threshold, control the target device to collect lighting information in the target environment.
[0215] It can be understood that the third control module 450 can execute the above steps S41 - 1 to S41 - 2.
[0216] Optionally, see Fig.15 , is another functional module diagram of the device control device provided in the embodiment of the present application. The device control device also includes a fourth control module 460.
[0217] The fourth control module 460 is used to control the target device to collect the first environment information and illumination information in the target environment according to the initial sampling frequency when the target device is in the second network mode.
[0218] It can be understood that the fourth control module 460 can execute the above step S42.
[0219] Optionally, the first control module 420 is also used to control the target device to collect second environmental information in the target environment at a sampling frequency under a second sampling mode when the first environmental information does not reach or meet the first threshold; the sampling frequency under the second sampling mode is lower than the sampling frequency under the first sampling mode; and continue to control the target device to collect the first environmental information in the target environment at the initial sampling frequency.
[0220] It can be understood that the first control module 420 can execute the above steps S43 to S44.
[0221] Optionally, the second control module 430 is further configured to control the target device to suspend data updating when the second environment information does not meet the second threshold; and continue to control the target device to collect the second environment information under the target environment according to the sampling frequency under the first sampling mode.
[0222] It can be understood that the second control module 430 can execute the above steps S45 to S46.
[0223] Please refer to Fig.16 , is a hardware structure block diagram of an electronic device 200 provided in an embodiment of the present application. It can be understood that the electronic device is an electronic device in the above-mentioned smart home system. The electronic device 200 includes a memory 210, a processor 220 and a communication module 230. The memory 210, the processor 220 and the communication module 230 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.
[0224] The memory 210 is used to store programs or data. The memory 210 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0225] The processor 220 is used to read / write data or programs stored in the memory and execute the methods described in various embodiments of the present application.
[0226] The communication module 230 is used to establish a communication connection between the terminal device and other communication terminals through the network, and to send and receive data through the network.
[0227] It should be understood that Fig.16 The structure shown is only a schematic diagram of the structure of the electronic device 200. The terminal device may also include Fig.16 More or fewer components as shown, or with Fig.16 Different configurations shown. Fig.16 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0228] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned device control method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. Among them, the computer-readable storage medium, such as read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk, etc.
[0229] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0230] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A device control method, characterized in that: The method comprises: If the target device is in the first network mode, detecting the network status of the target device; the first network mode is a network access mode, and the network status indicates whether the target device can effectively access the gateway; When the network state meets the network state threshold, controlling the target device to collect the first environment information under the target environment; the network state threshold is used to indicate that the target device is normally connected to the gateway; Acquire first environment information in a target environment collected by a target device; If the first environmental information meets a first threshold, controlling the target device to collect second environmental information under the target environment according to the sampling frequency in the first sampling mode; If the first environmental information does not meet the first threshold, controlling the target device to collect the second environmental information under the target environment according to the sampling frequency under the second sampling mode; the sampling frequency under the second sampling mode is lower than the sampling frequency under the first sampling mode; If the second environment information satisfies a second threshold, adjusting the data update frequency of the target device, and controlling the target device to perform data update according to the adjusted data update frequency; If the second environment information does not meet the second threshold, the target device is controlled to suspend data updating.
2. The method according to claim 1, characterized in that The first environmental information includes illumination information, the first threshold includes an illumination threshold, and the acquiring of the first environmental information in the target environment collected by the target device includes: Acquire illumination information in a target environment collected by the target device; If the first environmental information satisfies the first threshold, controlling the target device to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode includes: If the illumination information satisfies the illumination threshold, the target device is controlled to collect second environment information under the target environment according to the sampling frequency in the first sampling mode.
3. The method according to claim 1, characterized in that The first environmental information includes object detection information and illumination information, the first threshold includes an object condition threshold and an illumination threshold, and the acquiring of the first environmental information in the target environment collected by the target device includes: Acquire object detection information in a target environment collected by the target device; If the object detection information satisfies the object condition threshold, controlling the target device to collect illumination information under the target environment; If the first environmental information satisfies the first threshold, controlling the target device to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode includes: If the illumination information satisfies the illumination threshold, the target device is controlled to collect second environment information under the target environment according to the sampling frequency in the first sampling mode.
4. The method according to claim 1, characterized in that: The first environmental information includes object detection information and illumination information, the first threshold includes an object condition threshold and an illumination threshold, and when the network state satisfies the network state threshold, controlling the target device to collect the first environmental information under the target environment includes: When the network state meets the network state threshold, obtaining object detection information in the target environment collected by the target device; If the object detection information meets the object condition threshold, the target device is controlled to collect the lighting information under the target environment.
5. The method according to claim 1, characterized in that The first environmental information includes illumination information; before acquiring the first environmental information in the target environment collected by the target device, the method further includes: If the target device is in the second network mode, the target device is controlled to collect lighting information in the target environment according to the initial sampling frequency; the second network mode is an off-network mode, and the initial sampling frequency is a sampling frequency pre-set and saved in the target device.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the first environmental information does not meet the first threshold, the target device continues to be controlled to collect the first environmental information under the target environment according to the initial sampling frequency.
7. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: If the second environmental information does not meet the second threshold, the target device continues to be controlled to collect the second environmental information under the target environment according to the sampling frequency in the first sampling mode.
8. A device control device, characterized in that: The device comprises: A detection module, configured to detect a network status of the target device if the target device is in a first network mode; the first network mode is a network access mode, and the network status indicates whether the target device can effectively access a gateway; A third control module, configured to control the target device to collect first environmental information under a target environment when the network state meets a network state threshold; the network state threshold is used to indicate that the target device is normally connected to the gateway; An acquisition module, used to acquire first environment information in a target environment collected by a target device; A first control module, configured to control the target device to collect second environment information under the target environment according to a sampling frequency in a first sampling mode when the first environment information meets a first threshold; The first control module is further configured to control the target device to collect second environmental information under the target environment at a sampling frequency under a second sampling mode if the first environmental information does not meet a first threshold; the sampling frequency under the second sampling mode is lower than the sampling frequency under the first sampling mode; A second control module, configured to adjust the data update frequency of the target device and control the target device to perform data update according to the adjusted data update frequency when the second environment information meets a second threshold; The second control module is further configured to control the target device to suspend data updating if the second environment information does not meet a second threshold.
9. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program executable by the processor, and the processor can execute the computer program to implement the method according to any one of claims 1 to 7.
10. 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 method according to any one of claims 1 to 7 is implemented.
