Environmental data detection and processing method, device, electronic device and storage medium
Through environmental data detection and processing methods, the threshold range of the light sensor is adaptively adjusted, the wireless transmission frequency is reduced and the adaptability is improved, which solves the problems of high energy consumption and poor adaptability of the light sensor, and improves user experience and system efficiency.
Patent Information
- Application Number
- CN202210032434.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-12
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-01-12
AI Technical Summary
The frequent sending of telegrams by existing light sensors leads to increased equipment energy consumption and poor adaptability of fixed environmental data thresholds, which cannot meet the human body's nonlinear sensing needs for environmental data.
The environmental data detection and processing method is adopted to discard the current environmental data if it does not exceed the threshold. If it exceeds the threshold, it will be reported and updated. The threshold range is adaptively adjusted based on the preset level and adjustment strategy, reducing the wireless signal transmission frequency and improving adaptability.
It reduces the power consumption of electronic devices, improves the constant state of the human body's perception of the environment, enhances the product experience, and reduces wireless system interference and cloud storage load.
Smart Images

Figure CN114531397B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of sensor technology, and in particular to an environmental data detection and processing method, device, electronic device and 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. With the continuous release of smart home products, many of them are the basic products of smart home systems, such as smart gateways, light sensors, infrared human body sensors, door and window sensors, etc.
[0003] At present, since the environmental data included in different scenarios are different, in order to realize smart homes in different scenarios, electronic devices that can collect environmental data will detect the environmental data in each scenario, and after obtaining the detected environmental data, directly transmit it to other devices that need the environmental data through wireless signals, resulting in frequent sending of telegrams, thereby increasing the energy consumption of the equipment. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device, light sensor and storage medium for adjusting the light intensity range, so as to solve the problem in the prior art that the light sensor frequently sends telegrams, thereby increasing the energy consumption of the device.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, the present invention provides an environmental data detection and processing method, the method comprising:
[0007] Obtain current environmental data collected in the target environment;
[0008] If the current environment data does not exceed the current environment threshold, the current environment data is discarded; the current environment threshold is determined according to the environment data acquired last time;
[0009] If the current environment data exceeds the current environment threshold, the current environment data is reported to the target device, and the current environment threshold is updated according to the current environment data;
[0010] Continue to collect environmental data under the target environment, and process the collected environmental data based on the updated environmental threshold.
[0011] In a second aspect, the present invention provides an environmental data detection and processing device, the device comprising:
[0012] A discarding module, used to discard the current environment data when the current environment data does not exceed the current environment threshold; the current environment threshold is determined according to the environment data acquired last time;
[0013] An updating module, configured to report the current environment data to a target device when the current environment data exceeds the current environment threshold, and to update the current environment threshold according to the current environment data;
[0014] The acquisition module is used to continue to acquire environmental data under the target environment and process the acquired environmental data based on the updated environmental threshold. In an optional embodiment, the update module is also used to obtain environmental threshold ranges corresponding to multiple preset levels, and determine the target level corresponding to the environmental threshold range to which the current environmental data belongs; wherein each of the preset levels has a corresponding threshold adjustment strategy;
[0015] The current environmental threshold is updated according to the threshold adjustment strategy corresponding to the target level to obtain an updated environmental threshold.
[0016] In an optional implementation manner, the updating module is further configured to, if the target grade is the first grade, obtain a first adjustment value included in the threshold adjustment strategy corresponding to the first grade;
[0017] Based on the sum of the current environmental data and the first adjustment value, and the difference between the current environmental data and the first adjustment value, the upper limit and the lower limit of the current environmental threshold are updated to obtain an updated environmental threshold.
[0018] In an optional implementation manner, the updating module is further configured to, if the target grade is the second grade, obtain a second adjustment value included in the threshold adjustment strategy corresponding to the second grade;
[0019] Based on the sum of the current environmental data and the second adjustment value, and the difference between the current environmental data and the second adjustment value, the upper limit and the lower limit of the current environmental threshold are updated to obtain an updated environmental threshold.
[0020] In an optional implementation manner, the updating module is further configured to, if the target grade is the third grade, obtain a third adjustment value included in the threshold adjustment strategy corresponding to the third grade;
[0021] Based on the sum of the current environmental data and the product of the current environmental data and the third adjustment value, and the difference between the current environmental data and the product of the current environmental data and the third adjustment value, the upper limit and lower limit of the current environmental threshold are updated to obtain an updated environmental threshold.
[0022] In an optional implementation manner, the updating module is further configured to, if the target level is the fourth level, obtain the environmental change parameter and the preset coefficient included in the threshold adjustment strategy corresponding to the fourth level;
[0023] According to the current environmental data, the environmental change parameter and the preset coefficient, the upper limit value and the lower limit value of the current environmental threshold are adjusted to obtain an updated environmental threshold.
[0024] In an optional embodiment, the update module is also used to report the current environment data to the control device if the current environment data exceeds the current environment threshold, so as to instruct the control device to obtain a target control scenario matching the current environment data, and control the device corresponding to the target control scenario to execute corresponding control instructions.
[0025] In a third aspect, the present invention provides an electronic device comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the environmental data detection and processing method as described in any one of the aforementioned embodiments.
[0026] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the environmental data detection and processing method as described in any one of the aforementioned embodiments are implemented.
[0027] The environmental data detection and processing method, device, electronic device and storage medium provided in the embodiments of the present invention screen the acquired environmental data by discarding the current environmental data collected in the acquired target environment when the current environmental data does not exceed the current environmental threshold, and uploading the current environmental data again when the current environmental data exceeds the current environmental threshold. There is no need to transmit all the acquired environmental data through wireless signals, thereby reducing the frequency of telegram uploads and further reducing the power consumption of the electronic device. In addition, since the current environmental threshold is the environmental threshold determined based on the environmental data acquired last time, and the current environmental threshold is updated based on the current environmental data when the current environmental data exceeds the current environmental threshold, adaptive adjustment of the current environmental threshold in different environments is achieved, which is beneficial to ensure that the human body's perception of the environment is maintained in a constant state and improve the product experience.
[0028] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention 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 creative work.
[0030] Figure 1 A schematic diagram of an application environment applicable to an embodiment of the present invention is shown;
[0031] Figure 2 A schematic diagram of a flow chart of the environmental data detection and processing method provided by the present invention is shown;
[0032] Figure 3 Another schematic diagram of the process of the environmental data detection and processing method provided by the present invention is shown;
[0033] Figure 4 Another schematic diagram of the process of the environmental data detection and processing method provided by the present invention is shown;
[0034] Figure 5 Another schematic diagram of the process of the environmental data detection and processing method provided by the present invention is shown;
[0035] Figure 6 Another schematic diagram of the process of the environmental data detection and processing method provided by the present invention is shown;
[0036] Figure 7 Another schematic diagram of the process of the environmental data detection and processing method provided by the present invention is shown;
[0037] Fig. 8A A schematic diagram showing the relationship between human eye perception and light value;
[0038] Figure 8B A schematic diagram showing the upper and lower limits of the light intensity threshold under different light intensities is shown;
[0039] Fig. 9 shows a hardware block diagram of a light sensor;
[0040] Fig.10 A functional module diagram of an environmental data detection and processing device provided by the present invention is shown;
[0041] Fig.11 The hardware structure block diagram of the electronic device provided by the present invention is shown.
[0042] Icons: 10-smart home system; 100-gateway; 200-electronic device; 300-server; 400-terminal device; 500-router; 10A-upper limit of light intensity threshold; 10B-power of upper limit of light intensity threshold; 20-standard light intensity; 30A-lower limit of light intensity threshold; 30B-power of lower limit of light intensity threshold; 310-main control chip; 320-ambient light sensor; 330-battery; 340-switch ;350-peripherals;351-indicator light;352-button;600-environmental data detection and processing device;610-acquisition module;620-discarding module;630-update module;640-collection module;1110-processor;1130-memory;1120-storage medium;1121-operating system;1122-data;1123-application;1140-input and output interface;1150-wired or wireless network interface;1160-power supply. DETAILED DESCRIPTION
[0043] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0045] 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.
[0046] At present, in smart home systems, corresponding controls are often performed based on environmental data collected by various electronic devices to achieve home intelligence. For example, the lights are turned on when someone enters the room, the curtains are drawn when the light intensity exceeds a certain threshold, and the music player is turned on when someone enters the bathroom. All of these require electronic devices that are set up in advance to collect environmental data and transmit them to achieve this.
[0047] In the prior art, environmental data is often uploaded in the following ways:
[0048] One is that when the electronic device collects environmental data, it directly transmits the environmental data to other devices that need lighting parameters through wireless signals, so as to facilitate the execution of subsequent related controls;
[0049] The second is to pre-set the environmental data threshold. After measuring the environmental data, the environmental data is compared with the pre-set fixed environmental threshold. When the environmental data meets the environmental data threshold, it is uploaded. If the environmental data does not meet the preset environmental threshold, it is not uploaded.
[0050] However, the first uploading method has a higher measurement frequency, and a telegram must be sent for each measurement, which will increase the energy consumption of electronic equipment. In addition, more telegrams will easily increase the interference of the radio frequency environment in the wireless system, and consume more cloud storage space.
[0051] Although the second uploading method sets an environmental data threshold for certain screening, the set environmental data threshold is generally a fixed value and has poor adaptability in the smart home system. For example, if the collected environmental data is light intensity, and the light data is uploaded when the light intensity exceeds the light threshold, if the current environment is a strong light environment, the light intensity value collected at a certain frequency will frequently exceed the light threshold, and in this case, data will be continuously reported; if the current environment is a weak light environment, the light intensity value collected at a certain frequency will not exceed the light threshold for a long time, resulting in an unresponsive smart home. In addition, since the human body's perception of environmental data is not linear, setting a fixed environmental data threshold cannot meet the human body's expectations and feelings.
[0052] Based on the above problems, the present application proposes an environmental data detection and processing method to solve the above problems.
[0053] An application environment involved in the present invention is introduced below.
[0054] See also Figure 1 , Figure 1 Schematic diagram of an application environment applicable to an embodiment of the present invention. Figure 1A 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.
[0055] In the embodiment of the present invention, 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 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 smart interactive terminals in a wireless manner. The gateway 100 also has a wireless routing function, excellent wireless performance, network security, and coverage area.
[0056] In an embodiment of the present invention, the electronic device 200 may be an electronic device capable of collecting environmental data, such as a sensor device, a detection device, etc. If the electronic device 200 is a sensor device, the electronic device 200 may be a light sensor, a temperature and humidity sensor, etc. If the electronic device is a detection device, it may be a light intensity detection device, etc. The electronic device 200 connected to the gateway 100 can exchange information and instructions with the gateway 100. The gateway 100 and the electronic device 200 can be connected through communication methods such as Bluetooth, WiFi (Wireless-Fidelity), ZigBee (Purple Peak Technology), etc. Of course, the connection method between the gateway 100 and the electronic device 200 may not be limited in the embodiment of the present invention. In an embodiment of the present invention, the server 300 may be a local server, a cloud server, etc., and the specific server type may not be limited in the embodiment of the present invention. The server 300 connected to the gateway 100 can exchange information with the gateway 100 in a wireless manner. 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.
[0057] Furthermore, the smart home system 10 may further include a terminal device 400. 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 may 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 invention. In some embodiments, the terminal device 400 may also be used to interact with users, so that users can wirelessly communicate 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.
[0058] 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.
[0059] Based on the above Figure 1 The application environment diagram shown in the figure is combined with Figure 2 Taking the application of the method to an electronic device as an example, the environmental data detection and processing method provided by the embodiment of the present invention is described. Figure 2 As shown, the method comprises the following steps:
[0060] Step S110, obtaining current environment data collected in the target environment;
[0061] Optionally, the target environment is an environment in which environmental data collection is currently required, and the current environmental data is environmental data in the target environment collected by the electronic device.
[0062] In this embodiment, the electronic device collects the current environment data in the target at a preset time interval. In one example, if the electronic device is a light sensor, and the light sensor is used to collect the light intensity value in the target environment, on this basis, the light sensor collects the current light intensity value in the current environment every 5 seconds.
[0063] Step S120, if the current environment data does not exceed the current environment threshold, discard the current environment data;
[0064] In this embodiment, the current environment threshold is determined according to the environment data acquired last time.
[0065] Step S130, if the current environment data exceeds the current environment threshold, the current environment data is reported to the target device, and the current environment threshold is updated according to the current environment data;
[0066] Optionally, the target device may be a gateway, or a terminal device or a server capable of communicating with the target device. In a possible implementation, the terminal device may be a PC, or a mobile phone or a tablet computer.
[0067] In this embodiment, when the electronic device obtains the current environmental data collected in the target environment, it compares the data with the current environmental threshold to determine whether the environmental data exceeds the current environmental threshold. If the current environmental data does not exceed the current environmental threshold, it will be discarded; if the current environmental data exceeds the current environmental threshold, it will be reported to the target device and the current environmental threshold will be updated based on the current environmental data.
[0068] It can be understood that when the current environmental data exceeds the current environmental threshold, the current environmental threshold is updated according to the current environmental data, and the updated environmental threshold is used as the "current environmental threshold" for reference during the next environmental data processing.
[0069] Step S140, continue to collect environmental data under the target environment, and process the collected environmental data based on the updated environmental threshold.
[0070] In this embodiment, after discarding the current environmental data or uploading the current environmental data, environmental data in the target environment can continue to be collected at certain preset intervals. After obtaining the environmental data, it is determined whether the environmental data exceeds the current environmental threshold, and the above-mentioned step S120 or step S130 is executed.
[0071] The environmental data detection and processing method provided by the embodiment of the present invention obtains the current environmental data collected under the target environment; if the current environmental data does not exceed the current environmental threshold, the current environmental data is discarded, wherein the current environmental threshold is determined according to the environmental data obtained last time; if the current environmental data exceeds the current environmental threshold, the current environmental data is reported to the target device, and the current environmental threshold is updated according to the current environmental data; and the environmental data under the target environment is continued to be collected, and the collected environmental data is processed based on the updated environmental threshold. Through this method, the acquired environmental data can be screened, so that there is no need to transmit all the acquired environmental data through wireless signals, which reduces the frequency of telegram uploads and further reduces the power consumption of electronic devices; in addition, the adaptive adjustment of the current environmental threshold in different environments is conducive to ensuring that the human body's perception of the environment is maintained in a constant state, thereby improving the product experience.
[0072] Optionally, in order to update the current environment threshold, Figure 2 On the basis of Figure 3 For another flow chart of the environmental data detection and processing method provided in the embodiment of the present application, please refer to Figure 3 The updating of the current environment threshold according to the current environment data in the above step S130 can also be achieved through the following sub-steps:
[0073] Sub-step S131, obtaining environmental threshold ranges corresponding to a plurality of preset levels, and determining a target level corresponding to the environmental threshold range to which the current environmental data belongs;
[0074] Among them, each preset level has a corresponding threshold adjustment strategy;
[0075] Optionally, the environmental threshold range refers to an interval range consisting of an environmental lower limit value and an environmental upper limit value. The threshold adjustment strategy can be used to adjust the environmental threshold range corresponding to the grade. The target grade is the grade corresponding to the environmental threshold range to which the current environmental data belongs.
[0076] Optionally, in order to better meet the needs of users, multiple preset levels can be pre-set in the electronic device, wherein each preset level corresponds to a certain environmental threshold range and threshold adjustment strategy. It can be understood that different numbers of preset levels can be set for different environmental data, and threshold adjustment strategies can be set according to different preset levels of different environmental data. In a possible implementation, the threshold adjustment strategies corresponding to each level can be the same or different.
[0077] In one example, if the electronic device is a light sensor, the current environment data may be a light intensity value, and the corresponding environment threshold is a light intensity threshold. Before applying the light sensor, it is necessary to set the initial light intensity threshold range corresponding to each preset level in advance. In a possible implementation, at least 4 preset levels may be set, and before the light sensor is put into use, each preset level may correspond to an initial light intensity threshold range. For example, the 4 preset levels may be [0Lux, 10Lux], [11Lux, 40Lux], [41Lux, 150Lux], and [151Lux, 83000Lux]. It can be understood that in this example, the current light intensity value collected is 8Lux, then it can be determined that the current light intensity value belongs to the initial light intensity range corresponding to the first level, and then it is determined that the current light intensity value belongs to the first level. Similarly, if the current light intensity value is 30Lux, it can be determined that the current light intensity value belongs to the second level.
[0078] Sub-step S132, updating the current environmental threshold according to the threshold adjustment strategy corresponding to the target grade to obtain an updated environmental threshold.
[0079] In this embodiment, after obtaining the current environmental data, the target level corresponding to the environmental threshold range to which the current environmental data belongs can be determined based on the value of the current environmental data. Since each level has its own threshold adjustment strategy, the current environmental threshold can be updated according to the threshold adjustment strategy corresponding to the target level to obtain an updated environmental threshold.
[0080] It can be understood that the current environmental threshold is the environmental threshold within the environmental threshold range of the target level. After the current environmental threshold is updated, the updated environmental threshold is the "current environmental threshold" corresponding to the target level during the next data processing.
[0081] Please continue to refer to the above example. If the initial light intensity threshold ranges corresponding to the four preset levels are [0Lux, 10Lux], [11Lux, 40Lux], [41Lux, 150Lux] and [151Lux, 83000Lux] respectively, and the current light intensity threshold collected by the light sensor is 30Lux, then it can be determined that the current light intensity value belongs to the second level, that is, [11Lux, 40Lux]. It can be understood that the second level is the target level corresponding to the environmental threshold range to which the current environmental data belongs. The current environmental thresholds are 11Lux and 40Lux. After the threshold adjustment strategy corresponding to the second level is adopted to update it, if the updated environmental thresholds are A and B respectively, then when the next data processing is performed, the light intensity threshold range corresponding to the second level is [A Lux, B Lux]. It should be noted that the above-mentioned current environmental data, the number of preset levels and the environmental threshold range are only examples. In practical applications, they can be set according to actual conditions, and the present invention does not limit this.
[0082] The environmental data detection and processing method provided by the embodiment of the present invention first determines the target level corresponding to the environmental threshold range to which the current environmental data belongs, and then updates the current environmental threshold according to the threshold adjustment strategy corresponding to the target level, thereby obtaining the updated environmental threshold, thereby realizing the adaptive adjustment of the current environmental threshold range and improving the efficiency of the adaptive adjustment of the environmental threshold range. Next, taking the preset levels as 4 levels as an example, how to update the current environmental threshold and obtain the updated environmental threshold when the current environmental data belongs to each preset level is described in detail.
[0083] Optionally, the preset level includes a first level, and the current environmental threshold includes an upper limit and a lower limit. If the environmental threshold range described in the current environmental data is the environmental threshold range of the first level, the threshold adjustment strategy corresponding to the first level can be called to adjust the upper limit and the lower limit of the current environmental threshold. Specifically, Figure 3 On the basis of Figure 4 Another flow chart of the environmental data detection and processing method provided in the embodiment of the present application is shown in FIG. Figure 4 , the above sub-step S132 can also be implemented by the following steps:
[0084] Step S132-A1, if the target grade is the first grade, obtaining a first adjustment value included in the threshold adjustment strategy corresponding to the first grade;
[0085] The threshold adjustment strategy refers to a strategy for adjusting the current environmental data collected each time. Each level has a corresponding threshold adjustment strategy, and the threshold adjustment strategy corresponding to each level may be different. Each threshold adjustment strategy includes a corresponding adjustment value.
[0086] Optionally, the first adjustment value is an adjustment value included in a threshold adjustment strategy of a first level.
[0087] In this embodiment, if the environmental threshold range to which the current environmental data belongs corresponds to the first level, the target level is the first level. Therefore, the threshold adjustment strategy corresponding to the first level can be called, and the threshold adjustment strategy includes a first adjustment value, and then the current environmental threshold can be adjusted according to the first adjustment value.
[0088] The first adjustment value can be set according to actual needs. For example, if the current environment data is the light intensity value, and the upper and lower limits of the current environment threshold corresponding to the first level are the upper and lower limits of the light intensity, respectively, then considering that the light intensity can change instantly, due to the blocking, reflection, refraction of the light source by objects, or the ripple of the power supply of the light source, the stability of the semiconductor, etc., the light intensity is unstable under low light intensity. The first adjustment value can be set to 3Lux to filter out the influence of the above-mentioned various interferences on the change of light intensity, and at the same time facilitate users to finely set the on / off light intensity value.
[0089] Step S132-A2, based on the sum of the current environmental data and the first adjustment value, and the difference between the current environmental data and the first adjustment value, update the upper limit and lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0090] In this embodiment, the sum of the current environmental data and the first adjustment value, and the difference between the current environmental data and the first adjustment value can be calculated respectively. When the current environmental threshold is updated, the upper limit value of the current environmental threshold can be updated to the sum of the current environmental data and the first adjustment value, and the lower limit value of the current environmental threshold can be updated to the difference between the current environmental data and the first adjustment value.
[0091] It can be understood that if the difference between the current environment data and the first adjustment value is a negative number, the absolute value of the difference can be used as the lower limit value.
[0092] Please continue to refer to the above example. If the current environmental data is the current light intensity value, and the current light intensity value is 6Lux, the environmental threshold range is the light intensity threshold range, the light intensity threshold range corresponding to the first level is [0Lux, 10Lux], and the first adjustment value is 3Lux, then the updated environmental threshold corresponding to the first level is [3Lux, 9Lux].
[0093] It can be understood that since the light intensity threshold range corresponding to the first level is updated according to the light intensity value collected this time, it is [3Lux, 9Lux]. On this basis, if the light intensity value obtained next time is 7Lux, it does not exceed the current environmental threshold and can be discarded; if the light intensity value obtained next time is 10Lux, it belongs to the first preset level. Since the upper limit value of the current light threshold corresponding to the first preset level is 9Lux, it exceeds the current environmental threshold. Therefore, the value can be uploaded to the target device, and the light intensity threshold of the first level can be updated according to 10Lux and the first adjustment value.
[0094] In another embodiment, the preset level includes a second level, and the current environment threshold includes an upper limit and a lower limit. Figure 3 On the basis of Figure 5 For another flow chart of the environmental data detection and processing method provided in the embodiment of the present application, please refer to Figure 5 , the above sub-step S132 can also be implemented by the following steps:
[0095] Step S132-B1, if the target grade is the second grade, obtaining a second adjustment value included in the threshold adjustment strategy corresponding to the second grade;
[0096] Optionally, the second adjustment value is an adjustment value included in a threshold adjustment strategy of a second level.
[0097] In this embodiment, if the environmental threshold range to which the current environmental data belongs corresponds to the second level, the target level is the second level. Therefore, the threshold adjustment strategy corresponding to the second level can be called, and the threshold adjustment strategy includes a second adjustment value, and then the current environmental threshold can be adjusted according to the second adjustment value.
[0098] The second adjustment value can be set according to actual needs. For example, if the current environment data is the light intensity value, and the upper limit value and lower limit value of the current environment threshold corresponding to the second level are the upper limit value and lower limit value of the light intensity, then in the case of dim light, in order to reduce the data rate and reduce the impact of shadows, the first preset value can be set to 6Lux to filter out the impact of various interferences on the change of light intensity.
[0099] Step S132-B2, based on the sum of the current environmental data and the second adjustment value, and the difference between the current environmental data and the second adjustment value, update the upper limit and the lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0100] In this embodiment, the sum of the current environmental data and the second adjustment value, and the difference between the current environmental data and the second adjustment value can be calculated respectively. When the current environmental threshold is updated, the upper limit value of the current environmental threshold can be updated to the sum of the current environmental data and the second adjustment value, and the lower limit value of the current environmental threshold can be updated to the difference between the current environmental data and the second adjustment value.
[0101] It can be understood that if the difference between the current environment data and the second adjustment value is a negative number, the absolute value of the difference can be used as the updated lower limit value.
[0102] Please continue to refer to the above example. If the current environmental data is the current light intensity value, and the current light intensity value is 30Lux, the environmental threshold range is the light intensity threshold range, the light intensity threshold range corresponding to the second level is [11Lux, 40Lux], and the second adjustment value is 6Lux, then the updated environmental threshold corresponding to the second level is [24Lux, 36Lux].
[0103] It can be understood that since the light intensity threshold range corresponding to the second level is updated according to the light intensity value collected this time, it is [24Lux, 36Lux]. On this basis, if the light intensity value obtained next time is 25Lux, it does not exceed the current environmental threshold and can be discarded; if the light intensity value obtained next time is 12Lux, it belongs to the second preset level. Since the lower limit value of the current light threshold corresponding to the second preset level is 25Lux, it exceeds the current environmental threshold. Therefore, the value can be uploaded to the target device and the light intensity threshold of the second level can be updated according to 12Lux and the second adjustment value.
[0104] In another embodiment, the preset level includes a third level, and the current environment threshold includes an upper limit and a lower limit. Figure 3 On the basis of Figure 6 For another flow chart of the environmental data detection and processing method provided in the embodiment of the present application, please refer to Figure 6 , the above sub-step S132 can also be implemented by the following steps:
[0105] Sub-step S132-C1, if the target level is the third level, obtaining a third adjustment value included in the threshold adjustment strategy corresponding to the third level;
[0106] Optionally, the third adjustment value is an adjustment value included in a threshold adjustment strategy of a third level.
[0107] In this embodiment, if the environmental threshold range to which the current environmental data belongs corresponds to the third level, the target level is the third level. Therefore, the threshold adjustment strategy corresponding to the third level can be called, and the threshold adjustment strategy includes the third adjustment value, and then the current environmental threshold can be adjusted according to the third adjustment value.
[0108] Among them, the third adjustment value can be set according to actual needs. Taking the current environmental data as the light intensity value, the upper limit value and the lower limit value of the current environmental threshold corresponding to the third level are the upper limit value and the lower limit value of the light intensity respectively. For example, according to the Weber-Fechner law, the minimum value of the third adjustment value varies from person to person, and is also different in studies at different times. In a possible implementation, the third adjustment value can be 0.14, so that the human eye's induction of the relative change in light intensity (△Lux / Lux) within the current light intensity range is almost constant.
[0109] Sub-step S132-C2, based on the sum of the current environmental data and the product of the current environmental data and the third adjustment value, and the difference between the current environmental data and the product of the current environmental data and the third adjustment value, update the upper limit and lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0110] In this embodiment, the product of the current environmental data and the third adjustment value can be calculated first, and then the sum of the current environmental data and the product, and the difference between the current environmental data and the product can be calculated respectively. When the current environmental threshold is updated, the upper limit value of the current environmental threshold can be updated to the sum of the current environmental data and the product, and the lower limit value of the current environmental threshold can be updated to the difference between the current environmental data and the product.
[0111] It can be understood that if the difference between the current environment data and the product is a negative number, the absolute value of the difference can be used as the updated lower limit value.
[0112] It can be understood that if the third preset value is X, the upper limit value of the current environmental threshold can be updated to current environmental data + current environmental data * X (i.e. current environmental data * (1 + X)), and the lower limit value of the current environmental threshold can be updated to current environmental data - current environmental data * X (i.e. current environmental data * (1 - X)).
[0113] In another embodiment, the preset level includes a fourth level, and the current environment threshold includes an upper limit and a lower limit. Figure 3 On the basis of Figure 7 For another flow chart of the environmental data detection and processing method provided in the embodiment of the present application, please refer to Figure 7 , the above sub-step S132 can also be implemented by the following steps:
[0114] Sub-step S132-D1, if the target level is the fourth level, obtaining the environment change parameter and the preset coefficient included in the threshold adjustment strategy corresponding to the fourth level;
[0115] Optionally, the environmental change parameter and the preset coefficient are preset data included in the fourth level threshold adjustment strategy.
[0116] In this embodiment, if the environmental threshold range to which the current environmental data belongs corresponds to the fourth level, the target level is the fourth level. Therefore, the threshold adjustment strategy corresponding to the fourth level can be called, and the threshold adjustment strategy includes environmental change parameters and preset coefficients. The current environmental threshold can then be adjusted according to the environmental change parameters and preset coefficients.
[0117] Among them, the environmental change parameter and the preset coefficient can be set according to actual needs.
[0118] Sub-step S132-D2, adjusts the upper limit and lower limit of the current environmental threshold according to the current environmental data, environmental change parameters and preset coefficients to obtain an updated environmental threshold.
[0119] In this embodiment, the upper limit and lower limit of the current environmental threshold can be adjusted according to the current environmental data, environmental change parameters and preset coefficients in combination with a preset formula to obtain an updated environmental threshold.
[0120] In one possible implementation, if the current environmental data is a light intensity value, the upper limit value and the lower limit value of the current environmental threshold corresponding to the fourth level are respectively the upper limit value and the lower limit value of the light intensity, then the environmental change parameter is the light intensity change parameter, and the preset coefficient is a preset constant coefficient.
[0121] The upper limit of the current light intensity threshold range can be updated according to the following formula:
[0122] The updated current light intensity range
[0123]
[0124] The lower limit of the current light intensity threshold range can be updated according to the following formula:
[0125] The updated current light intensity range
[0126]
[0127] Where Lux0 is the current light intensity value, ΔS is the light intensity change parameter, and k is the preset constant coefficient.
[0128] Next, combine Figure 8A-8BFor the reasons for setting the above threshold adjustment strategy, please refer to Fig. 8A , is a schematic diagram of the relationship between human eye perception and light value in the above example. The three straight lines in the figure represent the relationship between light intensity and human eye perception. Fig. 8A Combined with the Weber-Fechner law, it can be seen that the relationship between human eye perception and the change in light intensity is logarithmic, and because the eye is inert, the human eye will feel the same under the same light intensity, but the threshold when the light intensity rises is different from the threshold when the light intensity decreases. Therefore, the light threshold in the fourth gear can be adjusted by logarithmic change, and the threshold adjustment strategy from the first gear to the third gear can be adjusted by setting the adjustment value. Please refer to Figure 8B , is a schematic diagram of the upper and lower limits of the light intensity threshold under different light intensities, which includes five straight lines, namely: the upper limit value of the light intensity threshold 10A, the power of the upper limit value of the light intensity threshold 10B, the standard light intensity 20, the lower limit value of the light intensity threshold 30A, and the power of the lower limit value of the light intensity threshold 30B.
[0129] It can be understood that in this example, the above method can achieve fine adjustment in low-light conditions, and achieve a threshold range in different light intensity environments that is similar or close to the range of light intensity changes perceived by the human eye. Therefore, it can be uploaded to the gateway only when the human eye feels the light change, thereby triggering the response of the smart home, which can be consistent with the human eye's perception, thereby ensuring user experience.
[0130] In this example, according to the Weber-Fechner law, within the fourth range of light intensity, there is a logarithmic relationship between the degree of human eye's perception of light intensity and the change in light intensity. Therefore, a logarithmic change mode is selected when setting the threshold value, so that the light sensor can report the light intensity value when the human eye senses the change in light intensity. Because of the inertia of eye perception, the perception is the same under the same light intensity, but the threshold value corresponding to the increase in light intensity is different from the threshold value corresponding to the decrease in light intensity. Therefore, in order to ensure that the human eye's induction of light intensity changes is in a constant state, the value of the light intensity value change ΔS can be 0.1, and the value of the constant coefficient k can be 2 / 2.3.
[0131] In addition, for the case where the target level in this example is the fourth level, if the current light intensity value obtained is greater than or equal to the upper limit value in the current light intensity threshold range corresponding to the fourth level, the light sensor will send the upper limit value to the gateway instead of the current light intensity value; if the current light intensity value obtained is less than the lower limit value in the current light intensity threshold range corresponding to the fourth level, the light sensor will send the current light intensity value to the gateway.
[0132] It should be noted that in the above-mentioned environmental data detection and processing method, if the current environmental data obtained is the first environmental data obtained, the current environmental threshold range can be calculated based on the threshold adjustment strategy of the target level corresponding to the environmental threshold range to which the current environmental data belongs.
[0133] It can be understood that for the current environmental data obtained for the first time, since there is no current environmental threshold at this time, there is no need to determine whether the current environmental data exceeds the current environmental threshold. Instead, it is necessary to directly determine the target level to which the current environmental data belongs, and calculate the current environmental threshold based on the threshold adjustment strategy corresponding to the target level. The current environmental threshold is used to make a judgment on the current environmental data obtained next time.
[0134] It can be seen that the environmental data detection and processing method provided by the embodiment of the present invention determines the target level and updates the current environmental threshold according to the threshold adjustment strategy corresponding to the target level, thereby realizing the adaptive adjustment of the current environmental threshold while improving the adaptive adjustment efficiency of the current environmental threshold.
[0135] Optionally, in order to realize a smart home, the target device may further include a control device. Specifically, if the current environment data exceeds the current environment threshold in step S130, the current environment data is reported to the target device, which may also be achieved by the following steps:
[0136] If the current environment data exceeds the current environment threshold, the current environment data is reported to the control device to instruct the control device to obtain the target control scenario matching the current environment data, and control the device corresponding to the target control scenario to execute the corresponding control instruction.
[0137] Optionally, the control device is used to control home appliances in the smart home system to execute corresponding control instructions. The target control scene is pre-set and can be controlled according to current environmental data to achieve the scene. It can be understood that the device corresponding to the target control scene is used to execute the control instructions of the control device to achieve the target control scene.
[0138] In one embodiment, the electronic device that executes the above-mentioned environmental data detection and processing method is a light sensor as an example to introduce the structure of the light sensor. For details, see Fig. 9 , is a hardware structure block diagram of a light sensor, which may include a main control chip 310 , an ambient light sensor 320 , a battery 330 , a switch 340 and a peripheral 350 .
[0139] Among them, the main control chip 310 can be connected to the peripheral device 350, the ambient light sensor 320 and the switch 340 respectively through signal lines, and the main control chip can be connected to the antenna; the battery 330 can be connected to the main control chip 310, the switch 340 and the peripheral device 350 respectively through a power line; the switch 340 can be connected to the ambient light sensor 320 through a power line.
[0140] Optionally, the main control chip 310 is used to control the ambient light sensor 320 to perform sampling, update the current light intensity threshold, and send the light intensity to the target device via a wireless message when the light intensity exceeds the current light intensity threshold; the ambient light sensor 320 is used to collect the light intensity value in the target environment and send it to the main control chip; the peripheral device 350 is used to realize human-computer interaction.
[0141] In a possible implementation, the main control chip 310 may be a Zigbee chip JN5189; the peripheral device 350 may include an indicator light 351 and a button 352; and the battery may be a button battery CR2450.
[0142] based on Fig. 9 The present application also provides an application scenario for the light sensor shown, and the application of the above-mentioned environmental data detection and processing method in this scenario is as follows:
[0143] When the user is at home, the main control chip 310 in the light sensor can control the ambient light sensor 320 to collect the current light intensity value in the current environment, and determine whether the current light intensity value exceeds the current light intensity threshold determined according to the light intensity value collected last time. If not, it means that the change in light intensity is not enough to cause changes in human eye perception, and there is no need to control the devices in the smart home to achieve the corresponding scene. Therefore, the collected light intensity value can be discarded and continued to be collected after a period of time.
[0144] If it exceeds the current light intensity threshold determined according to the light intensity value collected last time, it means that the change in light intensity at this time causes a change in the perception of the human eye. Therefore, the devices in the smart home need to realize certain scenes and perform adaptive changes in the current light intensity threshold. The main control chip 310 can report the currently collected light intensity value to the gateway or terminal device in the form of a wireless message. In addition, the main control chip 310 also reports the light intensity value to the control device, and the control device can obtain the target control scene that needs to be triggered by the light intensity value, thereby controlling the device corresponding to the target control scene to execute the corresponding control instruction to realize the target control scene; at the same time, the main control chip also updates the current light intensity threshold according to the current light intensity value in the above manner.
[0145] In one example, if the target scene is to control the curtains to close according to the light intensity value when a light intensity value is received, the control device can control the curtains to execute the closing control instruction, thereby achieving the target control scene of closing the curtains.
[0146] It can be seen that this method can make the response of the smart home consistent with the perception of the human eye, improve the user experience, and control the power consumption of the light sensor in a high-illuminance environment, so that it can react more sensitively in a low-illuminance environment. At the same time, this method also reduces the number of telegram reports in a high-illuminance environment, reduces the power consumption of the light sensor, prolongs its life, and reduces the data load on the cloud. In order to execute the corresponding steps in the above embodiments and various possible methods, an implementation method of the environmental data detection and processing device 600 is given below. For further information, please refer to Fig.10 , Fig.10 A functional module diagram of an environmental data detection and processing device 600 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the environmental data detection and processing device 600 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. The environmental data detection and processing device 600 includes: an acquisition module 610, a discarding module 620, an updating module 630 and a collection module 640.
[0147] The acquisition module 610 is used to acquire current environment data collected in the target environment.
[0148] It can be understood that the acquisition module 610 can execute the above step S110.
[0149] The discarding module 620 is used to discard the current environment data when the current environment data does not exceed the current environment threshold; the current environment threshold is determined according to the environment data obtained last time.
[0150] It can be understood that the discarding module 620 can execute the above step S120.
[0151] The updating module 630 is used to report the current environment data to the target device when the current environment data exceeds the current environment threshold, and to update the current environment threshold according to the current environment data.
[0152] It can be understood that the updating module 630 can execute the above step S130.
[0153] The collection module 640 is used to continue collecting environmental data under the target environment and process the collected environmental data based on the updated environmental threshold.
[0154] It can be understood that the acquisition module 640 can execute the above step S140.
[0155] Optionally, the update module 630 is also used to obtain the environmental threshold ranges corresponding to multiple preset levels, and determine the target level corresponding to the environmental threshold range to which the current environmental data belongs; wherein each preset level has a corresponding threshold adjustment strategy; the current environmental threshold is updated according to the threshold adjustment strategy corresponding to the target level to obtain an updated environmental threshold.
[0156] It can be understood that the updating module 630 can execute the above sub-steps S131 to S132.
[0157] Optionally, the update module 630 is also used to obtain the first adjustment value included in the threshold adjustment strategy corresponding to the first level if the target level is the first level; based on the sum of the current environmental data and the first adjustment value, and the difference between the current environmental data and the first adjustment value, update the upper limit and lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0158] It can be understood that the update module 630 can execute the above steps S132-A1 to S132-A2.
[0159] Optionally, the update module 630 is also used to obtain the second adjustment value included in the threshold adjustment strategy corresponding to the second level if the target level is the second level; based on the sum of the current environmental data and the second adjustment value, and the difference between the current environmental data and the second adjustment value, update the upper limit and lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0160] It can be understood that the update module 630 can execute the above steps S132-B1 to S132-B2.
[0161] Optionally, the update module 630 is also used to obtain the third adjustment value included in the threshold adjustment strategy corresponding to the third level if the target level is the third level; based on the sum of the current environmental data and the product of the current environmental data and the third adjustment value, and the difference between the current environmental data and the product of the current environmental data and the third adjustment value, update the upper limit and lower limit of the current environmental threshold to obtain an updated environmental threshold.
[0162] It can be understood that the update module 630 can execute the above steps S132-C1 to S132-C2.
[0163] Optionally, the update module 630 is also used to obtain the environmental change parameters and preset coefficients included in the threshold adjustment strategy corresponding to the fourth level if the target level is the fourth level; adjust the upper and lower limits of the current environmental threshold according to the current environmental data, environmental change parameters and preset coefficients to obtain an updated environmental threshold.
[0164] It can be understood that the update module 630 can execute the above steps S132-D1 to S132-D2.
[0165] Optionally, the update module 630 is also used to report the current environmental data to the control device if the current environmental data exceeds the current environmental threshold, so as to instruct the control device to obtain a target control scenario matching the current environmental data, and control the device corresponding to the target control scenario to execute corresponding control instructions.
[0166] The environmental data detection and processing device provided in the embodiment of the present application obtains the current environmental data collected under the target environment through the acquisition module; the current environmental data is discarded by the discard module when the current environmental data does not exceed the current environmental threshold; the current environmental threshold is determined according to the environmental data obtained last time; the current environmental data is reported to the target device by the update module when the current environmental data exceeds the current environmental threshold, and the current environmental threshold is updated according to the current environmental data; the environmental data under the target environment is continuously collected by the acquisition module, and the collected environmental data is processed based on the updated environmental threshold. There is no need to transmit all the acquired environmental data through wireless signals, which reduces the frequency of telegram uploads and thus reduces the power consumption of the electronic device; in addition, the adaptive adjustment of the current environmental threshold under different environments is conducive to ensuring that the human body's perception of the environment is maintained in a constant state and improving the product experience. The embodiment of the present invention provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the environmental data detection and processing method provided by the above method embodiment.
[0167] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0168] Fig.11 2 is a hardware structure block diagram of an electronic device 200 provided in an embodiment of the present invention. Fig.11As shown, the electronic device 200 may have relatively large differences due to different configurations or performances, and may include one or more processors (Processing Units, CPU) 1110 (the processor 1110 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1130 for storing data, and one or more storage media 1120 (such as one or more mass storage devices) for storing application programs 1123 or data 1122. Among them, the memory 1130 and the storage medium 1120 can be short-term storage or permanent storage. The program stored in the storage medium 1120 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the processor 1110 can be configured to communicate with the storage medium 1120 and execute a series of instruction operations in the storage medium 1120 on the electronic device 200. The electronic device 200 may also include one or more power supplies 1160, one or more wired or wireless network interfaces 1150, one or more input and output interfaces 1140, and / or one or more operating systems 1121, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM, etc.
[0169] The input / output interface 1140 may be used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by a communication provider of the electronic device 200. In one example, the input / output interface 1140 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the input / output interface 1140 may be a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
[0170] It can be understood by those skilled in the art that Fig.11 The structure shown is only for illustration and does not limit the structure of the electronic device 200. For example, the electronic device 200 may further include Fig.11 More or fewer components as shown, or with Fig.11 Different configurations shown.
[0171] The electronic device 200 provided in the embodiment of the present invention can screen the acquired environmental data by executing the above-mentioned environmental data detection and processing method, thereby eliminating the need to transmit all acquired environmental data via wireless signals, reducing the frequency of telegram uploads, and thereby reducing the power consumption of the electronic device; in addition, the adaptive adjustment of the current environmental threshold under different environments is conducive to ensuring that the human body's perception of the environment remains in a constant state, thereby improving the product experience.
[0172] The embodiment of the present invention further 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 environmental data detection and processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0173] 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 invention, 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 enabling 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 invention.
[0174] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
Claims
1. A method for detecting and processing environmental data, characterized in that: The method comprises: Obtain current environmental data collected in the target environment; If the current environment data does not exceed the current environment threshold, the current environment data is discarded; the current environment threshold is determined according to the environment data acquired last time; If the current environmental data exceeds the current environmental threshold, the current environmental data is reported to the target device, and the environmental threshold ranges corresponding to multiple preset levels are obtained to determine the target level corresponding to the environmental threshold range to which the current environmental data belongs; the current environmental threshold is updated according to the threshold adjustment strategy corresponding to the target level to obtain the updated environmental threshold; wherein, The preset level includes a first level, the current environment threshold includes an upper limit value and a lower limit value, and the updating of the current environment threshold according to the threshold adjustment strategy corresponding to the target level includes: if the target level is the first level, obtaining a first adjustment value included in the threshold adjustment strategy corresponding to the first level; based on the sum of the current environment data and the first adjustment value, and the difference between the current environment data and the first adjustment value, updating the upper limit value and the lower limit value of the current environment threshold to obtain an updated environment threshold; Continue to collect environmental data under the target environment, and process the collected environmental data based on the updated environmental threshold.
2. The method according to claim 1, characterized in that Each of the preset levels has a corresponding threshold adjustment strategy.
3. The method according to claim 1, characterized in that: The preset level includes a second level, the current environment threshold includes an upper limit value and a lower limit value, and the updating of the current environment threshold according to the threshold adjustment strategy corresponding to the target level includes: If the target level is the second level, obtaining a second adjustment value included in the threshold adjustment strategy corresponding to the second level; Based on the sum of the current environmental data and the second adjustment value, and the difference between the current environmental data and the second adjustment value, the upper limit and the lower limit of the current environmental threshold are updated to obtain an updated environmental threshold.
4. The method according to claim 1, characterized in that: The preset level includes a third level, the current environment threshold includes an upper limit value and a lower limit value, and the updating of the current environment threshold according to the threshold adjustment strategy corresponding to the target level includes: If the target level is the third level, obtaining a third adjustment value included in the threshold adjustment strategy corresponding to the third level; Based on the sum of the current environmental data and the product of the current environmental data and the third adjustment value, and the difference between the current environmental data and the product of the current environmental data and the third adjustment value, the upper limit and lower limit of the current environmental threshold are updated to obtain an updated environmental threshold.
5. The method according to claim 1, characterized in that The preset level includes a fourth level; the current environment threshold includes an upper limit value and a lower limit value; and updating the current environment threshold according to the threshold adjustment strategy corresponding to the target level includes: If the target level is the fourth level, then obtaining the environmental change parameters and preset coefficients included in the threshold adjustment strategy corresponding to the fourth level; According to the current environmental data, the environmental change parameter and the preset coefficient, the upper limit value and the lower limit value of the current environmental threshold are adjusted to obtain an updated environmental threshold.
6. The method according to any one of claims 1 to 5, characterized in that: The target device includes a control device, and if the current environment data exceeds the current environment threshold, reporting the current environment data to the target device includes: If the current environment data exceeds the current environment threshold, the current environment data is reported to the control device to instruct the control device to obtain a target control scenario matching the current environment data, and control the device corresponding to the target control scenario to execute corresponding control instructions.
7. An environmental data detection and processing device, characterized in that: The device comprises: An acquisition module is used to obtain the current environment data collected in the target environment; A discarding module, used to discard the current environment data when the current environment data does not exceed the current environment threshold; the current environment threshold is determined according to the environment data acquired last time; An updating module, configured to report the current environmental data to a target device when the current environmental data exceeds the current environmental threshold, and obtain environmental threshold ranges corresponding to a plurality of preset grades, and determine a target grade corresponding to the environmental threshold range to which the current environmental data belongs; update the current environmental threshold according to the threshold adjustment strategy corresponding to the target grade, and obtain an updated environmental threshold; wherein the preset grades include a first grade, and the current environmental threshold includes an upper limit value and a lower limit value; the updating module is further configured to obtain a first adjustment value included in the threshold adjustment strategy corresponding to the first grade when the target grade is the first grade; based on the sum of the current environmental data and the first adjustment value, and the difference between the current environmental data and the first adjustment value, update the upper limit value and the lower limit value of the current environmental threshold, and obtain an updated environmental threshold; The collection module is used to continue collecting environmental data under the target environment and process the collected environmental data based on the updated environmental threshold.
8. An electronic device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the environmental data detection and processing method as claimed in any one of claims 1 to 6.
9. 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 steps of the environmental data detection and processing method according to any one of claims 1 to 6 are implemented.
