Detailed Description
The environment sensing data detection method is suitable for being implemented as a computer program, is installed and applied to various intelligent devices which need to rely on a temperature and humidity sensor to detect environment sensing data, and is called from a memory to a central processing unit by a control chip in the intelligent device to run, so that each step of the method is executed. The intelligent device can be various devices needing to use a temperature and humidity sensor, such as a temperature and humidity device like a household hygrothermograph, an atmosphere lamp device, a humidifier device, a large-scale temperature and humidity control device and the like.
An exemplary intelligent device is a temperature and humidity device, which can be designed as a portable hygrothermograph, as shown in the schematic circuit diagram of fig. 1, and includes a control unit 11, a temperature and humidity sensor 12 electrically connected to the control unit 11, an output device 13, an input device 14, and a battery component 10 for supplying power to the whole machine. The control unit 11 comprises a control chip comprising a central processor and a memory, the central processor being arranged to invoke the steps of running a computer program stored in said memory for performing the context-aware data detection method of the present application.
Another exemplary intelligent device is an atmosphere lamp device, which plays a role of playing a light atmosphere of an indoor space of a lamp effect, as shown in a schematic circuit diagram of fig. 2, the atmosphere lamp device includes a control unit 21, a temperature and humidity sensor 22 electrically connected with the control unit 21, an output device 23, an input device 24, and a light circuit 28 for playing the lamp effect, and in addition, the battery component 20 may be configured as required. The light circuit is an energy consumption component of the atmosphere lamp equipment, the consumed electric energy occupies a larger proportion of the consumed electric energy of the whole machine, and the control unit can adjust the working power consumption of the atmosphere lamp equipment by modifying the luminous brightness of each lamp bead in the light circuit. Similarly, the control unit comprises a control chip, and the control chip comprises a central processing unit and a memory, wherein the central processing unit is used for calling and running a computer program stored in the memory to execute the steps of the environment-aware data detection method.
While the above is given by way of example of the structure of two kinds of intelligent devices, it should also be understood that some intelligent devices, on the basis of following the basic control circuit, may also include both a battery component and a corresponding energy consumption component consuming greater power, for example, in a humidifier, not only may the corresponding battery component be carried, so that the charging function can be controlled according to the temperature and humidity by means of the method of the present application, but also an air pump for driving atomization may be carried, so that the gear of the air pump thereof may be controlled by means of the method of the present application, thereby realizing power saving control. And the like, can be flexibly applied.
The control Chip adopted by the intelligent device can be realized by adopting various embedded chips, such as a Bluetooth Chip of a self-communication module, namely a Bluetooth SoC (System on Chip), a WiFi SoC of the self-communication module, an MCU (Micro Controller Unit, microcontroller) of the self-communication module, a DSP (Digital Signal Processing ) and the like, and the chips of the self-communication module are configured in addition.
The output device in the intelligent device can be a display screen and used for displaying a graphical user interface, various data can be output in the graphical user interface, the data comprise environment sensing data generated by detection of a temperature and humidity sensor, and the data can be specifically temperature data and/or humidity data carried in the data. The input device in the intelligent device can provide a plurality of control keys, so that a user is allowed to generate corresponding operation events by operating each control key so as to drive the control chip to make corresponding responses.
According to the various intelligent devices illustrated in the above examples, it can be understood that the intelligent device can control the temperature and humidity sensor connected with the intelligent device through the control chip to detect the environment sensing data, the environment sensing data can be obtained with lower power consumption in the control process, and the obtained environment sensing data can further serve for power saving control of the intelligent device.
Referring to fig. 3, in an embodiment of the present application, the method for detecting environmental awareness data includes:
step S5100, a control chip of the current equipment sends a data detection instruction to a temperature and humidity sensor at the last moment of the current working period, and the temperature and humidity sensor is driven to detect current environment sensing data;
the current device may be any intelligent device defined in the present application, such as the temperature and humidity device shown in fig. 1 or the atmosphere lamp device shown in fig. 2, or other intelligent devices that are not illustrated, but in which the control chip and the temperature and humidity sensor defined in the present application are used, and so on.
The control chip of the current equipment supports sleep control, can be clocked by an internal working clock, and is triggered to wake up the control chip to work by timing, so that the control chip alternately enters a working period and a sleep period, the environmental perception data which is generated by the temperature and humidity sensor and is detected by the temperature and humidity sensor is read in each working period, the temperature and humidity sensor is actively switched to the sleep period after the environmental perception data is read, and the temperature and humidity sensor is waited to detect the environmental perception data in each sleep period until the control chip is triggered to wake up by a timing arrival event of the working clock, and then enters a new working period again.
In the process of alternately entering the working period and the dormant period, a continuous iteration loop mechanism exists, in one embodiment, the control chip takes the working period corresponding to the current iteration as the current working period in the working state, after various instructions corresponding to the current working period are executed, the control chip sends a data detection instruction to the temperature and humidity sensor, the moment corresponding to the data detection instruction is regarded as the last moment of the current working period, that is, the control chip sends the data detection instruction to the temperature and humidity sensor at the last moment of the current working period, and the temperature and humidity sensor is driven to start detecting environment sensing data corresponding to the current iteration.
The duration of the working period of the control chip does not need to depend on the working clock to trigger the corresponding event to switch, but naturally triggers to send the data detection instruction to the temperature and humidity sensor to reach the corresponding final moment by executing each instruction corresponding to the business logic corresponding to each working period.
After the temperature and humidity sensor receives the data detection instruction, according to the preset service logic, the temperature and humidity sensor starts to detect sensing data corresponding to the external environment, such as temperature data and/or humidity data, in response to the data detection instruction, and the detected sensing data is constructed as environment sensing data.
The temperature and humidity sensor may also have the capability of detecting other types of sensing data, so as to carry other types of sensing data in the generated environment sensing data, where the other types of sensing data include, but are not limited to, any one or more of air pressure data, voltage data, vibration data, and the like. The ability of a temperature and humidity sensor to detect other types of sensed data is determined by the inherent ability of its own sensing chip.
The control chip and the temperature and humidity sensor can be in wired connection, but also can be in wireless connection for communication, for example, in one embodiment, the control chip can be provided with a communication component or a communication component separately, and can be in data communication connection with the temperature and humidity sensor in advance and can be in wireless communication with the temperature and humidity sensor, so that bidirectional instruction and data transmission are realized.
Step S5200, the control chip enters a sleep period corresponding to the current working period after sending the data detection instruction, where the sleep period is sufficient for the temperature and humidity sensor to generate the current environmental perception data;
the control chip automatically switches to enter a sleep state after sending out a data detection instruction at the last moment of each working period, and starts a sleep period corresponding to the current working period. At this time, the working clock of the control chip starts to time the sleep period, and the control chip pauses to execute the instruction until the working clock triggers a corresponding wake-up event according to the end of the sleep period time, and the control chip is activated from the sleep state to enter the working state corresponding to the next working period in response to the wake-up event.
In one embodiment, the sleep periods have a corresponding determined duration. The corresponding time length of the sleep period should be set to be greater than or equal to the time length required by the temperature and humidity sensor to complete the detection and generation of the primary environment sensing data, so that the temperature and humidity sensor can smoothly complete the detection and generation of the current environment sensing data in each sleep period of the control chip.
Generally, the temperature and humidity sensor needs to detect temperature data and/or humidity data by the airflow flowing through the sensor chip after entering the airflow channel by means of physical and electrical structures in the mems, so the time required for the temperature and humidity sensor to detect and generate the environmental sensing data is longer than the time required for the duty cycle of the control chip. Therefore, the sleep period is set by referring to the time length corresponding to the detection and generation of the environmental perception data completed by the temperature and humidity sensor, and the control chip can be dormant to the maximum extent, so that the effect of saving electricity is realized.
After the temperature and humidity sensor responds to the data detection instruction, the detection of the environmental perception data is completed in the dormant period, various sensing data including, but not limited to, any one or any plurality of temperature data, humidity data and the like are obtained, and then the various sensing data are packaged into the environmental perception data corresponding to the current working period, namely the current environmental perception data, so as to be transmitted back to the control chip.
Step S5300, the control chip enters a next working period after the sleep period is ended, a data reading instruction is sent to the temperature and humidity sensor at the initial time of the next working period, and the current environmental perception data returned by the temperature and humidity sensor is received within a preset reading duration range;
when the control chip is awakened after finishing one sleep period and enters the next working period, a data reading instruction is sent to the temperature and humidity sensor at the initial moment of the next working period. The initial time corresponding to the data reading instruction is sent, the corresponding instruction can be set to be the first executed instruction in each working cycle, that is, when one working cycle is entered, the control chip sends the data reading instruction at the first time, and the first time is the corresponding initial time.
The data reading instruction mainly indicates the temperature and humidity sensor to return the environment sensing data generated in the sleep period corresponding to the previous working period. After the temperature and humidity sensor receives the data reading instruction, the temperature and humidity sensor responds to the data reading instruction and transmits the generated environmental perception data belonging to the current time back to the control chip through a data communication link established with the control chip.
After the control chip sends out a data reading instruction, the temperature and humidity sensor starts to receive and transmit back the environment sensing data to the temperature and humidity sensor. In one embodiment, the control chip may clock the read duration corresponding to the receiving of the environmental awareness data by the control chip through its working clock, where the read duration is generally set corresponding to a reasonable duration for receiving the environmental awareness data, so that the control chip may complete receiving of the environmental awareness data within the read duration range, so that when the read duration is timed, the control chip may consider that the receiving of the environmental awareness data has been completed, and then execute other subsequent instructions in its preset service logic to complete the subsequent task.
In some embodiments, the control chip may perform anomaly detection and/or integrity verification on the environmental awareness data received by the control chip to ensure that more reliable data communication is maintained with the temperature and humidity sensor.
Step S5400, after the read duration is terminated, the control chip uses the next working period as a new current working period, and the step of sending the data detection instruction to the temperature and humidity sensor continues to iterate, so as to continuously obtain the environmental perception data.
After the control chip passes through the preset reading time, whether the control chip correctly receives the environmental perception data of the temperature and humidity sensor or not, the business logic for receiving the environmental perception data can be finished, then the next working period which is entered in the previous step is regarded as a new current working period, the control chip returns to the step S5100 to continue the loop iteration, and the temperature and humidity sensor is controlled to detect and return the environmental perception data again for the next working period. Similarly, it will be understood that, through continuous loop iteration, the control chip can alternately work between a working period and a sleep period, so as to continuously control the temperature and humidity sensor to continuously detect and return environmental perception data, and further can utilize the environmental perception data, for example:
in one embodiment, the control chip parses the environmental awareness data obtained each time, extracts various sensing data carried in the environmental awareness data, such as temperature data and/or humidity data, and transmits the sensing data to the output device of the current device, so that the sensing data is displayed in the graphical user interface of the output device, and a user can intuitively track and read the environmental awareness data at each moment.
In another embodiment, the control chip may fit a corresponding change curve according to the same sensing data, such as temperature data or humidity data, in the continuously obtained environmental sensing data, and display the corresponding change curve in the graphical user interface of the previous embodiment, so as to reflect the change effect of the corresponding sensing data.
In still another embodiment, the control chip may perform security detection on a certain sensing data, such as temperature data or humidity data, in real time, in the environmental sensing data obtained each time, and when the sensing data is lower than or higher than a corresponding threshold, perform power saving control on the energy consumption component of the current device, or perform real-time functional control on the battery component of the current device.
In this application, the time difference between the initial time and the final time of each current working period is determined by the time consumed by the instruction set required by the control chip to complete one working period, and since the fewer instructions to be executed in each working period are mainly responsible for issuing data detection instructions and data reading instructions and executing sleep switching, the time difference is usually less than 2ms. The sleep period in the present application needs to be set in conjunction with the time consumed by the temperature and humidity sensor to detect and generate the environmental perception data, so that the time required to be consumed is usually a priori value, and on the basis of the priori value, a moderate extension setting is performed in combination with the actual requirement, for example, when the time required for the temperature and humidity sensor to detect and generate the environmental perception data is 7ms, the sleep time can be set to be greater than or equal to 8ms. Therefore, the time range of the sleep period is reasonably set, and the stability of the control chip for acquiring the environment sensing data can be improved.
According to the above embodiment, compared with the prior art, the control chip of the present device controls the temperature and humidity sensor to continuously and iteratively detect and return the environmental sensing data, and when iterating each time, the control chip sends a data detection instruction to the temperature and humidity sensor at the last time of the last working period, controls the temperature and humidity sensor to start detecting and generating the environmental sensing data, and the control chip quickly enters a sleep period after sending the data detection instruction, wherein the sleep period is enough for the temperature and humidity sensor to generate the environmental sensing data corresponding to the current iteration, that is, in the process that the temperature and temperature sensor generates the environmental sensing data corresponding to the current iteration, the control chip is always in a sleep state until the sleep period is ended and enters the next working period, and at the initial time of the next working period, the control chip sends a data reading instruction to the temperature and humidity sensor, receives the environmental sensing data just generated by the temperature and humidity sensor in a preset reading time range, and then takes the next working period as a new current working period, continues to iterating and sending the data detection instruction, and so on, and continuously cycling to obtain the environmental sensing data. In the process, the control chip utilizes the temperature and humidity sensor to detect the time slot for generating the environment sensing data to carry out dormancy, the dormancy period is extruded for the control chip on the basis that the whole original working period needs to cover the whole period of the data detection instruction and the data reading instruction, and the time consumed by the temperature and humidity sensor for detecting the environment sensing data is generally far longer than the time of a single working period of the control chip, so that the time for waiting for acquiring the environment sensing data after the control chip enters the working period can be effectively reduced, the actual working time of the control chip for acquiring the whole period of the environment sensing data is reduced, the electric energy loss is greatly saved, the cruising ability of the current equipment is improved, and the service life of a battery part of the current equipment is prolonged.
The applicant carries out a comparison test on the Bluetooth chip with respect to the technical scheme realized by the application and the traditional technical scheme, and confirms through the comparison test that the technical scheme can effectively reduce the time for the Bluetooth chip to wake up to work, can effectively reduce average power consumption and increase the cruising ability of the intelligent equipment. In the actual measurement case, the battery capacity of the product of the intelligent device to be tested is 1000mA/h, the Bluetooth communication service of the control chip is not connected with external control equipment, under the test condition, the average current measured by the traditional technical scheme is 175uA, and the derivation is carried out according to the average current, and the endurance time of the product is as follows: 1000 mA/h/0.175 ma=5714h/24 h/day=238 days/30=7.9 months. And after the technical scheme is applied, the average current is about 145uA, and accordingly, the product endurance time is 1000 mA/h/0.145 mA=6896 h/24 h/day=287 days/30=9.5 months. Therefore, in the actual measurement case, compared with the prior art, the method has the advantages that the cruising effect played in the same intelligent device can be remarkably increased by 1.6 months, and the electricity-saving effect is remarkable.
On the basis of any embodiment of the method of the present application, referring to fig. 4, a control chip of a current device sends a data detection instruction to a temperature and humidity sensor at a final moment of a current working period, and before driving the temperature and humidity sensor to detect current environmental perception data, the method includes:
Step S4100, after the control chip of the current device is powered on, a first data detection instruction is sent to the temperature and humidity sensor, and the temperature and humidity sensor is driven to detect first environmental perception data;
the control chip of the intelligent device inevitably sets an initialization flow after power-on so as to initialize the whole intelligent device through the initialization flow, thereby completing the starting of the intelligent device and enabling the whole intelligent device to enter a normal use state.
The initialization process generally needs to consume a relatively long time, so if the temperature and humidity sensor is controlled to detect and return the environmental sensing data after the current device is started after the initialization is completed, the environmental sensing data is transmitted to the graphical user interface of the output device by the control chip for display, the user is generally given a sense that the loading of the sensing data is slower, the user experience is poor, and the control chip cannot check the environmental state as early as possible through the environmental sensing data, and cannot find the environmental abnormality in time, so that the method is necessary to be improved.
In order to discover environmental abnormality as soon as possible, the method and the device are set to be capable of driving the temperature and humidity sensor to instantly start sensing on environmental live at the first time by sending the first data detection instruction to the temperature and humidity sensor at the first time after the control chip is electrified on the basis that the control chip is connected with the temperature and humidity sensor based on wired communication after the control chip is electrified, so that various sensing data are obtained, and first environmental sensing data are generated.
Step S4200, after the control chip issues the first data detection instruction, executing a preset device initialization procedure to complete the starting of the current device;
after the control chip sends out the first data detection instruction, the device initialization flow preset according to the inherent business logic is executed, so that the current device is started. By means of the initialization procedure, the initialization of the individual functional modules of the present device, such as output devices, input devices, communication components, and other on-demand combinations of components, such as energy consuming components, can be achieved. After the initialization of each functional module carried by the current device is completed, the starting of the current device is completed. After the current equipment is started, the output equipment and the input equipment can be used for realizing man-machine interaction.
Step S4300, after completing the execution of the equipment initialization flow, the control chip starts a first working cycle, and sends a data reading instruction to the temperature and humidity sensor at the initial time of the first working cycle so as to read the first environmental perception data from the temperature and humidity sensor;
after the execution of the equipment initialization flow is completed, the control chip can start a first working period for acquiring environment sensing data from the temperature and humidity sensor, and at the initial moment of the first working period, a data reading instruction is sent to the temperature and humidity sensor, and the temperature and humidity sensor is driven by the first data detection instruction sent after being electrified in advance to generate first environment sensing data, so that the first environment sensing data can be returned to the control chip after the first environment sensing data reading instruction is received by the control chip.
Step S4400, after finishing the first reading of the environmental awareness data, the control chip uses the first working period as the current working period to continue to execute the subsequent steps.
After the control chip receives the first environmental perception data returned by the temperature and humidity sensor, the process of reading the environmental perception data is completed, and then the first working period can be used as the current working period to start to enter an iterative process of continuously acquiring the environmental perception data, namely, the process of circularly executing the steps S5100 to S5400.
According to the embodiment, by improving the service flow of the control chip, a data detection instruction is sent to the temperature and humidity sensor at the first time after the control chip is powered on to drive the temperature and humidity sensor to quickly generate first environment sensing data, then the control chip starts to initialize the current device, when the current device is initialized to complete the device starting, the elapsed time is enough for the temperature and humidity sensor to complete the detection and generation of the first environment sensing data, therefore, the control chip sends a data reading instruction to the temperature and humidity sensor to obtain the first environment sensing data, the first environment sensing data can be quickly reflected to a user for sensing through the output device at the first time after the control chip is started, the link of the control chip for waiting for obtaining the environment sensing data is combined with the link of the control chip for executing the initialization flow, the response speed of the intelligent device for displaying the environment sensing data after the intelligent device is powered on is improved, the user experience is greatly improved, and the safety coefficient of the use device is improved by making abnormal check according to the first environment sensing data at the first time.
On the basis of any embodiment of the method of the present application, referring to fig. 5, after the first reading of the environment-aware data is completed, the control chip includes:
step S4500, the control chip extracts temperature data and humidity data in the first environmental perception data;
after the first environmental perception data is obtained, the control chip can safely identify the use environment of the current equipment according to the environmental perception data. According to the method, the environment sensing data are analyzed according to a protocol between the environment sensing data and the temperature and humidity sensor, so that various sensing data including temperature data and humidity data are obtained.
Step S4600, the control chip determines an environment type according to data to be detected, wherein the data to be detected comprises the humidity data and/or the humidity data;
the data to be detected may include temperature data or humidity data alone or may include both temperature data and humidity data. The control chip can determine the corresponding environment type according to any one or combination of temperature data and humidity data as the data to be detected in various modes, for example:
In an embodiment, the control chip may use a preset rule to perform corresponding verification on each specific data in the data to be detected, and when the data to be detected meets a matching condition set in the preset rule, determine that an environmental security state of the current device belongs to an environmental type corresponding to the matching condition, where the environmental type may be a security type or a non-security type.
For example, when the data to be detected includes temperature data or humidity data alone, whether the corresponding temperature threshold or humidity threshold is exceeded may be set as a matching condition in a preset rule, and when the temperature data or humidity data exceeds the corresponding temperature threshold or humidity threshold, it may be determined that the environment type of the current device belongs to a non-secure type, or else belongs to a secure type. Similarly, if the data to be detected contains both temperature data and humidity data, more complex matching conditions can be provided simultaneously in preset rules to determine whether the environment type of the current equipment belongs to a safe type or a non-safe type.
In another embodiment, the control chip may utilize a preset classification model, input data to be detected into the classification model, and infer a classification result from the classification model, where the classification result indicates that the environmental type of the current device belongs to a safe type or a non-safe type. The classification model can be a machine learning model or a deep learning model, and is trained to be converged by adopting a corresponding training data set in advance, so that the capability of the classification model for predicting a corresponding classification result according to the data to be detected is written into the control chip for calling.
When the classification model is used for deciding the environment type corresponding to the data to be detected, no matter how many kinds of sensing data are contained in the data to be detected, the sensing data are encoded into corresponding input parameters only by inputting parameter entering requirements corresponding to training samples in a training stage according to the classification model, the classification model is input, a corresponding classification result can be obtained by the classification model, and the corresponding environment type can be determined according to the classification result.
Step S4700, when the environment type belongs to a non-safety type, the control chip outputs alarm information through an output device in the current device, and the non-safety type characterizes that the temperature data and/or the humidity number in the data to be detected are respectively higher than corresponding preset thresholds.
After the control chip determines the environment type of the current device based on the environment sensing data acquired for the first time, if the environment type belongs to a safety type, the normal use state of the current device can be kept, otherwise, if the environment type belongs to a non-safety type, the non-safety type characterizes that the temperature data and/or the humidity quantity in the data to be detected are respectively higher than the corresponding preset threshold value, so that the conditions of overhigh temperature and/or overhigh humidity exist, and the like, in the case, the current device is possibly not suitable for normal use, and therefore, the control chip can output corresponding alarm information to the output device of the current device, for example, when the output device is a display screen, an alarm image or an alarm text can be output; when the output device is a loudspeaker, an alarm sound can be output; or if the current device is an atmosphere lamp device, the control chip can also control the light circuit of the current device to flash and give out light to give out an alarm so as to draw attention of a user, and timely troubleshoot the fault to ensure safe use of the intelligent device.
According to the embodiment, after the intelligent device is powered on, the control chip controls the temperature and humidity sensor to detect the environment sensing data, the environment sensing data is obtained after the control chip completes the initialization process, and the safety of the environment of the intelligent device is detected according to the environment sensing data, so that whether the environment type of the current device belongs to an unsafe type or not is checked in time, and when the environment type belongs to the unsafe type, a user is reminded of carrying out obstacle clearance treatment in time by outputting alarm information, so that potential hidden danger of the intelligent device can be found in a most rapid mode, and the use safety of the intelligent device is ensured.
On the basis of any embodiment of the method of the present application, referring to fig. 6, the control chip executes a preset device initialization procedure after issuing a first data detection instruction, where the device initialization procedure includes:
step S4210, initializing output equipment in the current equipment to enter a working state, and displaying a graphical user interface on the output equipment, wherein the graphical user interface is used for displaying the environment perception data;
in the initialization process of the control chip, the output device of the current device needs to be initialized, the output device is an exemplary display screen, the initialization of the output device can be realized by loading a driver of the output device, after the initialization of the display screen is completed, the display device can be controlled to display a graphical user interface, the graphical user interface can be used for displaying environment sensing data obtained by the control chip from a temperature and humidity sensor each time, and particularly, various sensing data in the environment sensing data can be output to the graphical user interface in any form of text, graphics and the like for display so as to enhance the user sensing.
Step S4220, initializing an input device in the current device to enter a working state, and starting response service to an operation event triggered by the input device;
in the initialization process of the control chip, the input device of the current device needs to be initialized, and the input device is an exemplary control panel, which comprises a plurality of control keys for triggering different operation events respectively, and the control chip can initialize the input device through configuration of the I/O port of the control chip. After the input device is initialized, the service responding to the operation event in the control chip, namely the response service is started, and when the user triggers the corresponding operation event through any control key in the control panel, the response and the processing of the response service loaded by the control chip can be obtained, so that the man-machine interaction is realized.
Step S4230, initializing and starting communication service of the control chip, wherein the communication service is used for realizing communication connection between the control chip and external control equipment, and the external control equipment is used for controlling the current equipment to work.
In the initialization flow of the control chip, the control chip further loads communication services corresponding to the communication component which is provided with the control chip or is externally matched with the control chip, so that the communication component can be responsible for the communication between the control chip and external control equipment, the control chip can be controlled by the external control equipment to adjust the functions of the current equipment, and the current equipment is controlled to execute corresponding work. Preferably, the communication component can be a Bluetooth communication component, the control chip loads corresponding Bluetooth communication service for the communication component, and the Bluetooth communication service is applied to intelligent equipment in such small scenes and has relatively economic value. In other embodiments, the control chip may also be responsible for initializing other related peripheral devices in the initialization process, for example, when the intelligent device is an atmosphere lamp device, the control chip may also be responsible for initializing a light circuit of the atmosphere lamp device, for example, loading spatial layout information of the light circuit for analyzing a light effect playing instruction, so as to generate control data for controlling the light circuit to play a corresponding light effect, and so on.
According to the embodiment, when the control chip executes the initialization flow, each peripheral device electrically connected with the control chip can be activated to a normal use state, so that the intelligent device can normally open service, meanwhile, the temperature and humidity sensor can generate first environmental perception data by utilizing the time of executing the initialization flow by the control chip, the control chip and the temperature and humidity sensor are executed in parallel, the control chip is very efficient, and the smart utilization of the opportunity of the initialization flow of the intelligent device is realized.
On the basis of any embodiment of the method of the present application, referring to fig. 7, after the read duration is terminated, the control chip includes:
step S6100, judging whether the current environmental perception data is successfully received within the reading time range, and accumulating the reading failure times when the current environmental perception data is unsuccessful;
and the control chip waits for reading the environment sensing data according to the preset reading time length when receiving the corresponding environment sensing data each time. However, sometimes, due to circuit failure or other abnormal reasons, the control chip may not successfully receive the environmental awareness data, in this case, the control chip is clocked by its working clock according to the read duration, and at the end of the clocking, the control chip detects whether the environmental awareness data is successfully received, and if the environmental awareness data is successfully received, the subsequent service flow may be continued. If the receiving is unsuccessful, the abnormal condition occurs, and accordingly the number of times of reading failure can be accumulated, namely the number of times corresponding to unsuccessful reading of the environment sensing data occurs.
Step S6200, when successful, checking whether the received current environmental perception data is complete, and when the data is incomplete, accumulating the reading failure times;
even if the context aware data read successfully, the context aware data may be incomplete. In general, in the context-aware data, besides carrying various sensing data, a corresponding CRC, that is, a check code may be carried, and the data integrity of the context-aware data may be checked according to the check code, where when the check result indicates that the data is complete, a subsequent service flow may be continued, otherwise, the data is considered as a reading failure, and accordingly, the number of times of the reading failure is also accumulated.
And step S6300, judging whether the reading failure times reach a preset abnormal times threshold, and outputting alarm information to the output equipment of the current equipment when the reading failure times reach the preset abnormal times threshold.
It is easy to understand that if the current device is started once, a plurality of reading failures occur, that is, the number of reading failures is too large, the performance of the current device is abnormal. Accordingly, by presetting an abnormal frequency threshold, comparing the counted reading failure frequency after each acquisition of the environment sensing data with the abnormal frequency threshold, and when the reading failure frequency does not reach the abnormal frequency threshold, not processing; when the number of the reading failures reaches the threshold value of the abnormal number, the abnormality is triggered, and accordingly alarm information is output to the output equipment of the current equipment so as to remind a user of further obstacle clearing treatment.
According to the embodiment, in the process that the control chip continuously receives each environmental perception data generated by the temperature and humidity sensor successively, the communication stability and the data integrity corresponding to each acquired environmental perception data are analyzed, the reading failure times are counted, and the reading failure times are compared with the preset abnormal times threshold, so that whether the current equipment is abnormal or not can be determined, the further utilization of the environmental perception data is realized, the equipment abnormality can be timely checked, and the healthy use of the intelligent equipment is ensured.
On the basis of any embodiment of the method of the present application, after checking whether the received current context-aware data is complete, the method includes:
step S7100, when the current environmental perception data is complete, extracting temperature data from the environmental perception data;
the temperature data is an important index corresponding to the measurement of the internal environment or the external environment where the intelligent equipment is located, when the temperature and humidity sensor is located in the intelligent equipment body, the detected temperature data indicate the temperature of the intelligent equipment body, and when the temperature and humidity sensor is exposed outside the intelligent equipment body, the detected temperature data generally indicate the temperature of an external space, and according to the purpose of the intelligent equipment and the internal and external positions of the temperature and humidity sensor relative to the intelligent equipment body, the corresponding temperature data have the effect of reflecting the safety of the internal and external environments of the intelligent equipment from different sides.
Accordingly, after the control chip completely obtains the current environment sensing data through each iteration, the environment sensing data is analyzed, the temperature data in the environment sensing data is extracted, and the analysis of the environment condition of the intelligent equipment is realized so as to perform corresponding processing.
And step 7200, judging whether the temperature data is higher than a preset first temperature threshold or lower than a preset second temperature threshold, when the temperature data is higher than the first temperature threshold, controlling the energy consumption component of the current device to switch to a low power consumption mode, and when the temperature data is lower than the second temperature threshold, controlling the energy consumption component of the current device to switch to a normal power consumption mode.
When the intelligent device further carries a power consumption component with larger power consumption, for example, a light circuit carried by the atmosphere lamp device belongs to a power consumption component, if the light emitted by the light circuit is too bright, the occupied power consumption is larger, and in a relatively closed indoor space, the heat energy emitted by the light circuit is accumulated, so that the indoor temperature is increased, the rising process is slow, but the result is inevitable. The temperature and humidity sensor carried in the atmosphere lamp device can be used for detecting temperature data of indoor space environment and generating corresponding environment sensing data. The temperature data in the environment sensing data can be used for sensing the temperature of the current indoor space, and then whether the power consumption mode of the energy consumption components such as the lamplight circuit is adjusted or not can be determined through the indoor temperature. Of course, if the indoor space is relatively open and ventilated, the influence of the light circuit on the room temperature is naturally smaller, and the frequency of controlling the power consumption mode according to the temperature data in the environment sensing data is also inevitably reduced, so that the power consumption mode of the intelligent equipment is controlled by utilizing the temperature data, and the intelligent equipment can correspond to the size and ventilation condition of the space where the intelligent equipment is located and is more ingenious.
Besides the exemplary atmosphere lamp device, in intelligent devices such as intelligent air blowing cylinders, intelligent floor sweeping machines and the like, temperature data detected by the temperature and humidity sensor can be temperature data in the machine body, so that corresponding energy consumption components, mainly motors, can be controlled by identifying whether the machine body is overheated, and the power consumption mode is adjusted.
In particular, two temperature thresholds may be set, wherein the first temperature threshold is a higher value for indicating that the control chip switches the energy consuming components of the current device from a high power consumption mode to a low power consumption mode when the temperature data in the context awareness data is higher than the higher value; wherein the second temperature threshold is a lower value for indicating that the control chip switches the energy consuming component of the current device from the low power consumption mode to the high power consumption mode when the temperature data in the context-aware data is below the lower value. Therefore, when the temperature data is in the temperature interval, no matter the energy consumption component is in the low-power consumption mode or the high-power consumption mode, the power consumption mode is not required to be switched, and frequent switching of the power consumption mode can be avoided.
For example, when the intelligent device is an atmosphere lamp device, the light circuit is an energy consumption component, and different power consumption modes can be represented by the light brightness of the intelligent device, that is, when the intelligent device is switched to a high power consumption mode, the intelligent device can emit light according to the conventional brightness to play corresponding light effects, and when the intelligent device is switched to a low power consumption mode, the light brightness of the intelligent device can be reduced according to a preset attenuation coefficient, and the corresponding light effects can be played at lower brightness, so that the aim of saving energy is fulfilled.
It is easy to understand that when the temperature data detected by the temperature and humidity sensor of the intelligent device applying the technical scheme of the embodiment is too high, the energy consumption component of the intelligent device is switched to a low-power consumption mode, so that the energy-saving effect is achieved; when the temperature data detected by the temperature and humidity sensor is too low, the energy consumption component can be switched to a high power consumption mode, so that the normal performance of the energy consumption component is ensured. In addition, the embodiment also decides to switch the power consumption mode through the two temperature thresholds, so that frequent switching of the power consumption mode is avoided, good use experience of a user can be ensured, and the effect of power consumption adjustment is also ensured.
On the basis of any embodiment of the method of the present application, after checking whether the received current context-aware data is complete, the method includes:
Step S8100, when the current environmental perception data is complete, extracting humidity data from the environmental perception data;
the humidity data is an important index corresponding to the measurement of the internal and external environments where the intelligent equipment is located, and if the humidity of the internal and external environments is too high, the intelligent equipment is used as an electrical equipment, and electricity safety accidents such as short circuits are easy to occur, particularly when the humidity of air around a charging interface is high, the charging is at high risk. In order to ensure the electricity safety by utilizing the environment sensing data, the control chip can analyze the environment sensing data after completely obtaining the environment sensing data and extract the humidity data in the environment sensing data.
Step S8200, judging whether the humidity data is higher than a preset humidity threshold, when the humidity data is higher than the preset humidity threshold, turning off the charging function of the current equipment, and when the humidity data is lower than the preset humidity threshold, turning on the charging function of the current equipment.
After the humidity data is extracted from the environment sensing data, a preset humidity threshold value is utilized to be compared with the humidity data, when the humidity data is higher than the humidity threshold value, the fact that the humidity in the current environment is higher is indicated, short-circuit phenomenon is easy to occur due to thicker moisture, particularly, moisture is easy to accumulate at a charging interface of the intelligent equipment, so that a control chip can control the charging function of a charging circuit of the current equipment to be closed, reminding information can be output through a graphical user interface of the output equipment, and a user is reminded of keeping the charging in a drier environment. When the humidity data is lower than the humidity threshold, the humidity in the current environment is indicated to be at a relatively safe degree, and at the moment, if the charging function of the charging circuit of the intelligent device is in an off state, the charging function of the charging circuit can be controlled by the control chip to be switched to an on state, so that a user can charge the intelligent device normally.
It is not difficult to understand that the intelligent device applying the technical scheme of the embodiment can determine whether to start the charging function of the charging circuit according to the humidity degree in the use environment of the intelligent device, and when the humidity is higher than the humidity, the charging function is closed timely so as to keep the electricity safety of the intelligent device and realize ingenious utilization of the humidity data in the environment sensing data.
Referring to fig. 8, another embodiment of the present application further provides an environmental awareness data detection device, which includes a detection control module 5100, a sleep control module 5200, a read control module 5300, and an iteration control module 5400, wherein the detection control module 5100 is configured to send a data detection instruction to a temperature and humidity sensor at the last moment of a current working cycle, so as to drive the temperature and humidity sensor to detect current environmental awareness data; the sleep control module 5200 is configured to enter a sleep period corresponding to the current working period after the data detection instruction is sent, where the sleep period is sufficient for the temperature and humidity sensor to generate the current environmental perception data; the reading control module 5300 is configured to enter a next working period after the sleep period is ended, send a data reading instruction to the temperature and humidity sensor at an initial time of the next working period, and receive the current environmental perception data returned by the temperature and humidity sensor within a preset reading duration range; the iteration control module 5400 is configured to take the next working period as a new current working period after the reading duration is terminated, and continue iteration from the detection control module 5100 so as to continuously acquire environment sensing data.
On the basis of any embodiment of the apparatus of the present application, the environment-aware data detection apparatus of the present application includes a plurality of modules that operate prior to the detection control module 5100, including: the power-on detection module is arranged to send a first data detection instruction to the temperature and humidity sensor after power-on, and drive the temperature and humidity sensor to detect first environmental perception data; the initialization module is used for executing a preset equipment initialization flow after a first data detection instruction is sent out so as to finish the starting of the current equipment; the initial reading module is used for starting a first working period after the execution of the equipment initialization flow is completed, and sending a data reading instruction to the temperature and humidity sensor at the initial time of the first working period so as to read the first environmental perception data from the temperature and humidity sensor; and the iteration starting module is used for taking the first working period as the current working period and continuing to operate the subsequent module after the first reading of the environment sensing data is completed.
On the basis of any embodiment of the apparatus of the present application, the environment-aware data detection apparatus of the present application includes a plurality of modules that operate after the iteration start module, including: the data extraction module is used for extracting temperature data and humidity data in the first environmental perception data; the state detection module is arranged for the control chip to determine the environment type according to data to be detected, wherein the data to be detected comprises the humidity data and/or the humidity data; and the alarm processing module is arranged to output alarm information through the output equipment in the current equipment when the environment type belongs to the non-safety type.
On the basis of any embodiment of the apparatus of the present application, the initialization module includes: the output initialization unit is used for initializing output equipment in the current equipment to enter a working state, and displaying a graphical user interface on the output equipment, wherein the graphical user interface is used for displaying the environment perception data; an input initialization unit configured to initialize an input device in a current device to enter a working state, and to start a response service to an operation event triggered by the input device; the communication initialization unit is used for initializing communication service of the starting control chip and is used for realizing communication connection between the control chip and external control equipment, and the external control equipment is used for controlling the current equipment to work.
On the basis of any embodiment of the device, the time difference between the initial time and the final time of the current working period is less than or equal to 2ms, and the duration of the dormancy period is more than or equal to 8ms.
On the basis of any embodiment of the apparatus of the present application, the iteration control module 5400 includes: the receiving judging unit is used for judging whether the current environment sensing data is successfully received within the reading duration range, and accumulating the reading failure times when the current environment sensing data is unsuccessful; the data verification unit is used for verifying whether the received current environmental perception data is complete or not when the received current environmental perception data is successful, and accumulating the reading failure times when the received current environmental perception data is incomplete; and the abnormal alarming unit is used for judging whether the reading failure times reach a preset abnormal times threshold value, and outputting alarming information to the output equipment of the current equipment when the reading failure times reach the preset abnormal times threshold value.
On the basis of any embodiment of the apparatus of the present application, the environment-aware data detection apparatus of the present application includes a plurality of units that operate subsequent to the data verification unit, including: a temperature extraction unit configured to extract temperature data from the current environmental awareness data when the current environmental awareness data is complete; and the mode switching unit is used for judging whether the temperature data is higher than a preset first temperature threshold or lower than a preset second temperature threshold, controlling the energy consumption component of the current equipment to switch to a low power consumption mode when the temperature data is higher than the first temperature threshold, and controlling the energy consumption component of the current equipment to switch to a normal power consumption mode when the temperature data is lower than the second temperature threshold.
On the basis of any embodiment of the apparatus of the present application, the environment-aware data detection apparatus of the present application includes a plurality of units that operate subsequent to the data verification unit, including: the humidity extraction unit is used for extracting humidity data from the current environment sensing data when the current environment sensing data is complete; and the function switching unit is used for judging whether the humidity data is higher than a preset humidity threshold, closing the charging function of the current equipment when the humidity data is higher than the preset humidity threshold, and opening the charging function of the current equipment when the humidity data is lower than the preset humidity threshold.
On the basis of any embodiment of the application, please refer to fig. 9, another embodiment of the application further provides an environment sensing data detection device, where the environment sensing data detection device may be an intelligent device such as a temperature and humidity device or an atmosphere lamp device, and a controller carried in the intelligent device may be implemented based on a computer device, as shown in fig. 9, and an internal structure diagram of the computer device is shown. The computer device includes a processor, a computer readable storage medium, a memory, and a network interface connected by a system bus. The computer readable storage medium of the computer device stores an operating system, a database and computer readable instructions, the database can store a control information sequence, and the computer readable instructions, when executed by a processor, can enable the processor to realize an environment-aware data detection method. The processor of the computer device is used to provide computing and control capabilities, supporting the operation of the entire computer device. The memory of the computer device may have stored therein computer readable instructions that, when executed by the processor, may cause the processor to perform the context-aware data detection method of the present application. The network interface of the computer device is for communicating with a terminal connection. It will be appreciated by those skilled in the art that the structure shown in fig. 9 is merely a block diagram of a portion of the structure associated with the present application and is not limiting of the computer device to which the present application applies, and that a particular computer device may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
The processor in this embodiment is configured to execute specific functions of each module and its sub-module in fig. 8, and the memory stores program codes and various data required for executing the above modules or sub-modules. The network interface is used for data transmission between the user terminal or the server. The memory in this embodiment stores program codes and data required for executing all modules/sub-modules in the context-aware data detection apparatus of this application, and the server can call the program codes and data of the server to execute the functions of all sub-modules.
The present application also provides a storage medium storing computer readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the context-aware data detection method according to any embodiment of the present application.
The present application also provides a computer program product comprising computer programs/instructions which, when executed by one or more processors, implement the steps of the context-aware data detection method of any embodiment of the present application.
Those skilled in the art will appreciate that implementing all or part of the above-described methods of embodiments of the present application may be accomplished by way of a computer program stored on a computer readable storage medium, which when executed, may comprise the steps of embodiments of the methods described above. The storage medium may be a computer readable storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a random access Memory (Random Access Memory, RAM).
The foregoing is only a partial embodiment of the present application, and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.
In summary, the control chip of the present application utilizes the temperature and humidity sensor to detect the time slot for generating the environmental perception data to sleep, and because the time spent by the temperature and humidity sensor to detect the environmental perception data is generally much longer than the time of a single working period of the control chip, the electric energy loss can be greatly saved, the endurance of the current device is improved, and the service life of the battery component of the current device is prolonged.