Device status determination method, device, storage medium and electronic device
By combining a wireless module with a timer/counter, the opening and closing status of the cooking equipment cover can be accurately determined, which solves the problem of complex and inaccurate judgment in the existing technology and improves safety and efficiency.
Patent Information
- Application Number
- CN202210178529.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2042-02-24
AI Technical Summary
The existing methods for determining the status of the lid of cooking equipment are complex and inaccurate, and cannot effectively determine whether the lid is in an open or closed state, which may lead to accidents.
The target data sent by the first wireless module is obtained through the second wireless module, the time interval and the number of data acquisition times are used to determine the opening and closing status of the cover, and the timer and counter are combined to improve the judgment efficiency and accuracy.
It achieves accurate judgment on the status of the cooking equipment cover, reduces the risk of misjudgment, and improves the safety and efficiency of the equipment.
Smart Images

Figure CN115081562B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of device status determination, and more specifically, to a device status determination method, device, storage medium, and electronic device. Background Art
[0002] In the process of cooking with cooking equipment, whether the cooking equipment can maintain a normal operating state is related to whether the cooking task can be successfully completed. Therefore, it is very important to accurately judge the operating state of the cooking equipment. The judgment of the operating state of the cooking equipment includes the judgment of the state of the cover of the cooking equipment, such as whether the upper cover is tightly closed, whether the side door is tightly closed, etc. Untimely and inaccurate judgment of the state of the cover of the cooking equipment will affect the execution of the cooking task and may even cause accidents.
[0003] In the related art, the state of the cover of the cooking equipment is determined by a special cover opening and closing detection mechanism, for example, a cover opening and closing detection mechanism including a reed switch. However, the cover opening and closing detection mechanism has a complex structure, and the long-term use of the equipment will cause aging of the connection structure, thereby affecting the accuracy of the cover opening and closing detection. At the same time, the traditional detection method cannot determine whether the current state of the cover is a moving state or a stationary state. For example, the cover is currently closing, resulting in an incorrect judgment of the state of the equipment cover.
[0004] With regard to the problem in the related art that a complex opening and closing cover detection mechanism is required to detect the cover status of the cooking device, and the detection result of the cover status of the cooking device is inaccurate, no effective solution has been proposed yet. Summary of the invention
[0005] The present application provides a method, device, storage medium and electronic device for determining the state of an appliance to solve the problem in the related art that a complex opening and closing cover detection mechanism is required to detect the state of the cover of a cooking appliance, and the detection result of the state of the cover of the cooking appliance is inaccurate.
[0006] According to one aspect of the present application, a method for determining the state of a device is provided. The method includes: acquiring target data sent by a first wireless module through a second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device; determining the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data, and judging whether the time interval is greater than or equal to the preset time length, and obtaining the first state of the cover when the time interval is greater than or equal to the preset time length, wherein the first state is used to characterize the open cover state; counting the number of acquisitions of the target data according to the first preset time period, and judging whether the number of acquisitions of the target data is greater than or equal to the preset number of times, and obtaining the second state of the cover when the number of acquisitions of the target data is greater than or equal to the preset number of times, wherein the second state is used to characterize the closed cover state; determining the current state of the cover according to the first state and the second state. The open and closed state of the device cover is determined by combining the time required to acquire the target data and the number of times the target data is acquired within the preset time.
[0007] Optionally, determining the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data includes: starting a first timer, and determining whether the target data is acquired before the first timer times to a preset time length; when the target data is acquired, determining the current timing time of the first timer as the time interval, and controlling the first timer to re-time; when the target data is not acquired, determining the preset time length as the time interval, and controlling the first timer to re-time. The time interval between acquiring two frames of data is determined by the first timer, and a method for determining the time interval when the first timer is started for the first time, and a method for determining the time interval when the target data cannot be acquired after exceeding the preset time length are provided, thereby improving the efficiency of determining the cover state of the device by acquiring the time interval between two adjacent frames of target data.
[0008] Optionally, counting the number of acquisitions of target data according to the first preset time period includes: starting the second timer, controlling the second timer to time according to the first preset time period, and controlling the second timer to reset and restart after completing the timing of each first preset time period; when the second timer is started, starting the counter to count the number of acquisitions of target data, and controlling the counter to reset and restart after the second timer completes the timing of each first preset time period; during the timing of the second timer, determining whether there is a situation where the timing of the first timer reaches the preset duration; when there is no situation where the timing of the first timer reaches the preset duration, obtaining the counting result of the counter when the timing of the second timer reaches the duration corresponding to the first preset time period, and determining the counting result as the number of acquisitions of target data. By using the timing result of the first timer as a prerequisite for determining the state of the cover, the ineffective operation of the second timer and the counter when the cover is opened is avoided, thereby improving the accuracy and efficiency of determining the state of the cover of the device.
[0009] Optionally, during the timing of the second timer, after determining whether the timing of the first timer reaches a preset duration, the method further includes: when the timing of the first timer reaches the preset duration, controlling the second timer to reset and restart the timing, and controlling the counter to reset and restart the counting. By simultaneously resetting the second timer and the counter when the timing of the first timer reaches the preset duration within the first preset time period, the effect of reducing the ineffective work of the second timer and the counter is achieved.
[0010] Optionally, during the timing of the second timer, after determining whether the timing of the first timer reaches a preset duration, the method further includes: when the timing of the first timer reaches the preset duration, controlling the counter to stop counting or reset the count until the second timer starts timing again. By stopping the counter and clearing the data when the timing of the first timer reaches the preset duration within the first preset time period, the effect of reducing the ineffective work of the counter is achieved.
[0011] Optionally, determining the current state of the cover body according to the first state and the second state includes: judging whether the first state and the second state both appear within the second preset time period according to the second preset time period, wherein the second preset time period is greater than or equal to the first preset time period; and determining the first state as the current state of the cover body when the first state and the second state both appear within the second preset time period. By determining the cover-open state as the device cover state when different states appear at the same time, the safety of the target device is ensured.
[0012] Optionally, determining the current state of the cover body according to the first state and the second state includes: judging the order of appearance of the first state and the second state within the third preset time period according to a third preset time period, wherein the duration corresponding to the third preset time period is greater than or equal to the preset duration; in the case where the first state appears first, determining the first state as the current state of the cover body; in the case where the second state appears first, determining the second state as the current state of the cover body. By determining the current state of the device cover body according to the order of appearance of the states when different states appear, the efficiency of determining the state of the device cover body is improved.
[0013] Optionally, before counting the number of acquisitions of the target data according to the first preset time period and determining whether the number of acquisitions of the target data is greater than or equal to the preset number, the method further includes: when the cover is in the closed state, counting the number of acquisitions of the target data corresponding to multiple first preset time periods to obtain multiple acquisition times; determining the minimum acquisition number among the multiple acquisition times, and determining the preset number based on the minimum acquisition number. The preset number is determined by the minimum acquisition number among multiple first preset time periods in the closed state, thereby ensuring the accuracy of the judgment of the state of the device cover.
[0014] Optionally, determining the preset number of times based on the minimum acquisition number includes: calculating the difference between the minimum acquisition number and the error number, and determining the difference as the preset number of times. By considering the error number when determining the preset number of times, it is avoided that the closed cover state is misjudged as the open cover state, thereby improving the accuracy of the device cover state judgment.
[0015] Optionally, each time the target data is acquired, the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data is determined, and it is judged whether the time interval is greater than or equal to the preset time length. The method also includes: when the cover is in the open state, statistically acquiring the corresponding time intervals of multiple frames of target data to obtain multiple time intervals; determining the maximum time interval among the multiple time intervals, and determining the preset time length based on the maximum time interval. The preset time length is determined by the maximum time interval among the multiple time intervals in the open state, thereby ensuring the accuracy of the device cover state judgment.
[0016] Optionally, determining the preset duration based on the maximum time interval includes: calculating the sum of the maximum time interval and the error time interval, and determining the sum as the preset duration. By adding the error time interval when determining the preset duration, it is avoided that the open cover state is misjudged as the closed cover state, thereby improving the accuracy of the device cover state judgment.
[0017] According to another aspect of the present application, a device for determining the state of a device is provided. The device includes: an acquisition unit, which is used to acquire target data sent by a first wireless module through a second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device; a first determination unit, which is used to determine the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data, and to determine whether the time interval is greater than or equal to a preset time length, and when the time interval is greater than or equal to the preset time length, obtain a first state of the cover, wherein the first state is used to characterize the open cover state; a second determination unit, which is used to count the number of acquisitions of the target data according to a first preset time period, and to determine whether the number of acquisitions of the target data is greater than or equal to a preset number of times, and when the number of acquisitions of the target data is greater than or equal to a preset number of times, obtain a second state of the cover, wherein the second state is used to characterize the closed cover state; and a third determination unit, which is used to determine the current state of the cover according to the first state and the second state.
[0018] According to another aspect of an embodiment of the present invention, a computer storage medium is provided. The computer storage medium is used to store a program. When the program is executed, the device where the non-volatile storage medium is located is controlled to execute a method for determining the device status.
[0019] According to another aspect of an embodiment of the present invention, an electronic device is provided, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein a method for determining a device status is executed when the computer-readable instructions are executed.
[0020] Through the present application, the following steps are adopted: acquiring the target data sent by the first wireless module through the second wireless module, wherein the second wireless module is set on the main body of the target device, and the first wireless module is set on the cover of the target device; determining the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data, and judging whether the time interval is greater than or equal to the preset time length, and obtaining the first state of the cover when the time interval is greater than or equal to the preset time length, wherein the first state is used to characterize the open cover state; counting the number of acquisitions of the target data according to the first preset time period, and judging whether the number of acquisitions of the target data is greater than or equal to the preset number of times, and obtaining the second state of the cover when the number of acquisitions of the target data is greater than or equal to the preset number of times, wherein the second state is used to characterize the closed cover state; determining the current state of the cover according to the first state and the second state. The problem that a complex opening and closing cover detection mechanism is required to detect the cover state of the cooking device in the related art, and the detection result of the cover state of the cooking device is inaccurate is solved. The opening and closing state of the device cover is determined by combining the time required to acquire the target data and the number of times the target data is acquired within the preset time, thereby achieving the effect of accurately detecting the cover state of the cooking device. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The illustrative embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0022] Figure 1 is a flow chart of a method for determining a device status according to an embodiment of the present application;
[0023] Figure 2 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 1 ;
[0024] Figure 3 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 2 ;
[0025] Figure 4 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 3 ;
[0026] Figure 5 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 4 ;
[0027] Figure 6 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 5 ;
[0028] Figure 7 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 6 ;
[0029] Figure 8 It is a schematic diagram of a device for determining the status of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0031] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] According to an embodiment of the present application, a method for determining a device status is provided.
[0034] Figure 1 FIG. 1 is a flow chart of a method for determining a device status according to an embodiment of the present application. Figure 1 As shown, the method comprises the following steps:
[0035] Step S102: acquiring target data sent by the first wireless module through the second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device.
[0036] Specifically, the first wireless module and the second wireless module can be communication devices, and the data in the first wireless module can be obtained through the second wireless module, so that the main body of the target device can receive the target data sent by the cover of the target device, thereby determining the state of the cover according to the frequency of the received data.
[0037] For example, the second wireless module may be a sweep frequency oscillator, which may be installed on the main body of the target device, and the first wireless module may be a transponder with a resonant frequency of a preset fixed value, which may be installed on the cover of the target device. The sweep frequency oscillator and the transponder may communicate using RFID (Radio Frequency Identification) technology, and the sweep frequency oscillator may send a radio frequency signal with a frequency within a certain range to the transponder through an inductor coil at a preset frequency (for example, sending a radio frequency signal once every 200 ms), and when the resonant frequency of the radio frequency signal sent by the sweep frequency oscillator is the same as the preset resonant frequency in the transponder, the sweep frequency oscillator receives the target data signal sent from the transponder to obtain the target data.
[0038] Step S104, determine the time interval between the acquisition time of the previous frame target data and the acquisition time of the next frame target data, and judge whether the time interval is greater than or equal to the preset time length. When the time interval is greater than or equal to the preset time length, obtain the first state of the cover body, wherein the first state is used to characterize the open cover state.
[0039] Specifically, the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data can be recorded through a timer. The timer starts timing after the second wireless module receives a frame of target data, and restarts timing when the next frame of target data is received. Before restarting timing, the time interval between the previous frame and the current frame (that is, the next frame of data of the previous frame data) is recorded, and the time interval is compared with a preset duration. Based on the comparison result, it is determined whether the target device is in an open cover state, wherein the preset duration can be determined by the time interval between two adjacent frames of target data received by the second wireless module in the open cover state.
[0040] For example, Figure 2 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 1 ,like Figure 2 As shown, the timer can be a T1 timer, and the preset duration can be 800ms. Each time the T1 timer obtains the target data, the timing is reset and restarted, and the timing duration of the T1 timer is recorded. The timing duration is determined as the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data. When the time interval is greater than or equal to 800ms, the cover state of the target device is judged to be an open state.
[0041] In order to accurately determine the time interval between the acquisition time of the previous frame target data and the acquisition time of the next frame target data, optionally, in the device status judgment method provided in the embodiment of the present application, determining the time interval between the acquisition time of the previous frame target data and the acquisition time of the next frame target data includes: starting a first timer, and judging whether the target data is acquired before the first timer times out a preset duration; when the target data is acquired, determining the current timing time of the first timer as the time interval, and controlling the first timer to retime; if the target data is not acquired, determining the preset duration as the time interval, and controlling the first timer to retime.
[0042] Specifically, the first timer can be used to record the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data. When the target data is acquired by the second wireless module, the first timer is reset to zero. When the target data is acquired again by the second wireless module, the timing time before the first timer is reset to zero is the time interval between the two frames of data.
[0043] It should be noted that, when the first timer is started for the first time, since there is no previous frame of data, the timing time when the timer first obtains the target data can be determined as the time interval between two frames of data.
[0044] It should also be noted that when the device is in an open cover state, there is a situation where the second wireless module cannot receive the target data. In order to avoid the first timer from continuously timing and being unable to reset to zero, if the target data is not obtained before the first timer reaches a preset time length, the preset time length can be determined as the time interval between two frames of data, and the first timer can be controlled to restart timing.
[0045] This embodiment determines the time interval between obtaining two frames of data through a first timer, and provides a method for determining the time interval when the first timer is started for the first time, as well as a method for determining the time interval when the target data cannot be obtained after a preset time period, thereby improving the efficiency of determining the cover state of the device by obtaining the time interval between two adjacent frames of target data.
[0046] Step S106, counting the number of times the target data is acquired according to the first preset time period, and determining whether the number of times the target data is acquired is greater than or equal to the preset number, and when the number of times the target data is acquired is greater than or equal to the preset number, obtaining the second state of the cover body, wherein the second state is used to represent the closed state.
[0047] Specifically, the number of times the target data is acquired within the first preset time period can be recorded by a timer and a timer, wherein the preset number can be determined by the number of times the second wireless module acquires the target data within the first preset time period in the closed state.
[0048] For example, Figure 3 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 2 ,like Figure 3 As shown, the first preset time period can be 2s, and the preset number of times can be 3 times. The T2 timer can be used to time the 2s time, and the counter can be used to count the number of times the target data is obtained within 2s. When the number of acquisitions is greater than or equal to 3 times, it can be judged that the cover state of the target device is in the closed state.
[0049] Step S108, determining the current state of the cover according to the first state and the second state.
[0050] Specifically, when only the first state or the second state appears within a period of time, the state that appears is determined as the current state of the cover body. When both the first state and the second state appear within a period of time, the current state of the cover body can be determined according to the order of appearance of the first state and the second state within a period of time. The state that appears first is determined as the current state of the cover body, and the first state can also be determined as the current state of the cover body.
[0051] The device status determination method provided by the embodiment of the present application is to obtain the target data sent by the first wireless module through the second wireless module, wherein the second wireless module is set on the main body of the target device, and the first wireless module is set on the cover of the target device; determine the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data, and determine whether the time interval is greater than or equal to the preset time length, and obtain the first state of the cover when the time interval is greater than or equal to the preset time length, wherein the first state is used to characterize the open cover state; count the number of acquisitions of the target data according to the first preset time period, and determine whether the number of acquisitions of the target data is greater than or equal to the preset number of times, and obtain the second state of the cover when the number of acquisitions of the target data is greater than or equal to the preset number of times, wherein the second state is used to characterize the closed cover state; determine the current state of the cover according to the first state and the second state. The method solves the problem that a complex open and close cover detection mechanism is required to detect the cover state of the cooking device in the related art, and the detection result of the cover state of the cooking device is inaccurate. The open and close state of the device cover is determined by combining the time required to obtain the target data and the number of times the target data is obtained within the preset time, thereby achieving the effect of accurately detecting the cover state of the cooking device.
[0052] Figure 4 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 3 ,like Figure 4 As shown:
[0053] After the target device starts to start, the first timer T1, the second timer T2 and the counter are started at the same time. On the one hand, the first timer T1 can be reset to zero after receiving the target data and record the timing duration, that is, the time interval between the previous frame data and the next frame data. At the same time, it is determined whether the duration of the first timer T1 is greater than 800ms. When the duration of the first timer T1 is greater than 800ms, the state of the device cover is determined to be the first state.
[0054] On the other hand, the second timer T2 is reset and restarted every time the continuous timing reaches 2s. At the same time, the counter records the number of times the target data is received within 2s, and determines whether the number of times the target data is received is greater than 3 times. If it is greater than 3 times, the state of the device cover can be determined as the second state.
[0055] Optionally, in the device status judgment method provided in the embodiment of the present application, counting the number of times target data is acquired according to the first preset time period includes: starting a second timer, controlling the second timer to time according to the first preset time period, and controlling the second timer to reset and restart after completing the timing of each first preset time period; when the second timer is started, starting a counter to count the number of times target data is acquired, and controlling the counter to reset and restart after the second timer completes the timing of each first preset time period; during the timing of the second timer, judging whether there is a situation where the timing of the first timer reaches a preset duration; when the timing of the first timer does not reach the preset duration, obtaining the counting result of the counter when the second timer reaches the duration corresponding to the first preset time period, and determining the counting result as the number of times the target data is acquired.
[0056] For example, Figure 5 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 4 ,like Figure 5 As shown, when the first timer T1 is started, the second timer T2 and the counter can be started at the same time, wherein the second timer T2 is used to count according to the first preset time period, and the first preset time period is a statistical period for counting the number of times the target data is obtained, for example, it can be 2s. At the same time, when the second timer T2 starts counting, the counter starts to count the number of times the target data is received within the first preset time period.
[0057] Furthermore, after the second timer T2 completes the timing of the first preset time period each time, the second timer T2 and the counter are cleared at the same time and restart the timing and counting operations. For example, the second timer T2 and the counter start running at the same time, and are cleared and restarted at the same time after 2s, and record the number of target data receptions obtained by the counter within the second preset time period.
[0058] It should be noted that in order to avoid ineffective operation of the second timer T2 and the counter when the cover is opened, in each second preset time period counted by the second timer T2, it is necessary to determine in real time whether the timing of the first timer has reached the preset duration. If the timing of the first timer T1 has not reached the preset duration, the counting result of the counter within the period is determined as the number of times the target data is obtained.
[0059] For example, the preset duration is 800ms, the counter obtains the target data 5 times within 2s, and the maximum time recorded by the first timer within 2s is 500ms, and it does not reach 800ms, then the number of acquisitions of the target data is determined to be 5 times. For another example, if the timing of the first timer T1 reaches 800ms within 2s, the cover state of the target device can be directly determined as the first state, and the timing of the second timer T2 in this cycle and the technology of the counter can be stopped. This embodiment uses the timing result of the first timer as a prerequisite for determining the cover state, avoids the invalid operation of the second timer and the counter when the cover is opened, and improves the accuracy and efficiency of determining the cover state of the device.
[0060] Optionally, in the device status determination method provided in the embodiment of the present application, during the timing of the second timer, after determining whether there is a situation where the timing of the first timer has reached a preset duration, the method further includes: when there is a situation where the timing of the first timer has reached a preset duration, controlling the timing of the second timer to be reset and restarted, and controlling the counter to be reset and restarted.
[0061] Specifically, when the timing of the first timer reaches the preset time length within a first preset time period, since it can be determined that the current device cover state is the open state through the timing result of the first timer, the second timer and the counter can be cleared at the same time, and the timing and counting are restarted to determine the device cover state in the next time period. This embodiment achieves the effect of reducing the ineffective work of the second timer and the counter by clearing the second timer and the counter at the same time when the timing of the first timer reaches the preset time length within the first preset time period.
[0062] Optionally, in the device status determination method provided in the embodiment of the present application, during the timing of the second timer, after determining whether the timing of the first timer has reached a preset duration, the method further includes: when the timing of the first timer has reached a preset duration, controlling the counter to stop counting or reset the count until the second timer restarts timing.
[0063] Specifically, when the first timer reaches the preset duration within a first preset time period, since it can be determined that the current device cover state is the open state through the timing result of the first timer, it is also possible to only stop the operation of the counter, or only clear the count of the counter, and the second timer continues to time according to the original cycle until the timing cycle ends, and restarts the counter in the next cycle, so that the counter starts counting again from zero. This embodiment achieves the effect of reducing the ineffective work of the counter by stopping the operation of the counter and clearing the data when the first timer reaches the preset duration within the first preset time period.
[0064] Optionally, in the device status determination method provided in the embodiment of the present application, determining the current state of the cover body according to the first state and the second state includes: determining whether the first state and the second state both appear within the second preset time period according to a second preset time period, wherein the second preset time period is greater than or equal to the first preset time period; and when the first state and the second state both appear within the second preset time period, determining the first state as the current state of the cover body.
[0065] Specifically, the second preset time period can be any time greater than the first preset time period. For example, the first preset time period can be 2s, and the second preset time period can be 4s. Within a second preset time period, if the first state and the second state appear at the same time, the result of the first state shall prevail, that is, the state of the device cover is open.
[0066] For example, Figure 6 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 5 ,like Figure 6 As shown, within 5s, if the second wireless module does not receive a signal for 800ms continuously, it can be determined that the current state of the cover is the first state. However, in the timing period of 2s-4s, the timing result of the first timer is not greater than or equal to 800ms, and the statistical result of the counter is 4 times in the timing period of 2s-4s, it can be determined that the current state is the second state.
[0067] It should be noted that, if two states appear at the same time within the 5s judgment period, and the target device is operating in the closed state, in order to ensure the safe operation of the target device, the current state of the device cover can be set to the first state, that is, the open state. This embodiment ensures the safety of the target device by determining the open state as the device cover state when different states appear.
[0068] Optionally, in the device status determination method provided in the embodiment of the present application, determining the current state of the cover body according to the first state and the second state includes: determining the order of appearance of the first state and the second state within the third preset time period according to a third preset time period, wherein the duration corresponding to the third preset time period is greater than or equal to the preset duration; when the first state appears first, determining the first state as the current state of the cover body; when the second state appears first, determining the second state as the current state of the cover body.
[0069] Specifically, the third preset time period can be any time period greater than or equal to the preset time length. For example, the preset time length can be 800ms, and the third preset time period can be 4s. Within a third preset time period, if the first state and the second state appear at the same time, the device state can also be determined according to the order in which the two states appear.
[0070] For example, Figure 7 This is a flow chart of an optional device status determination method provided in an embodiment of the present application. Figure 6 ,like Figure 7 As shown, within any 4 seconds of the device operation, if no signal is received from 0 to 800 ms, it can be determined that the cover of the target device is currently in the first state. However, in the timing period of 2s-4s, the timing result of the first timer does not appear to be greater than or equal to 800ms, and the statistical result of the counter in the timing period of 2s-4s is 5 times, it can be determined that the cover of the target device is currently in the second state.
[0071] It should be noted that, since two states appear simultaneously within the 4s judgment period, and since the first state appears first, the state of the device cover within the third preset time period can be determined as the first state, that is, the open state. This embodiment improves the efficiency of determining the state of the device cover by determining the current state of the device cover according to the order in which the states appear when different states appear.
[0072] In order to accurately obtain the preset number of times corresponding to the counter, optionally, in the device status judgment method provided in the embodiment of the present application, before counting the number of times the target data is obtained according to the first preset time period and judging whether the number of times the target data is obtained is greater than or equal to the preset number of times, the method also includes: when the cover body is in a closed state, counting the number of times the target data is obtained corresponding to multiple first preset time periods to obtain multiple acquisition times; determining the minimum acquisition number among the multiple acquisition times, and determining the preset number based on the minimum acquisition number.
[0073] Specifically, before performing the target data acquisition count, it is necessary to determine the target data acquisition times of the device in the closed state within the first preset time period, and set the preset times according to the acquisition times. Multiple acquisition times within multiple first preset time periods can be acquired, and the minimum acquisition times can be selected from the multiple acquisition times, and the preset times can be determined according to the minimum acquisition times, thereby ensuring the accuracy of the device cover state judgment.
[0074] For example, 10 sample data are obtained, each sample data is the number of times the target data can be obtained within 2 seconds when the device cover is in the closed state, thereby obtaining 10 sample data, and selecting the minimum acquisition number 4 from the 10 sample data, and determining the preset number based on the minimum acquisition number 4.
[0075] In order to improve the accuracy of setting the preset number of times, optionally, in the method for determining the device status provided in an embodiment of the present application, determining the preset number of times based on the minimum acquisition number includes: calculating the difference between the minimum acquisition number and the error number, and determining the difference as the preset number of times.
[0076] Specifically, the error number may be an error value of a preset acquisition number. After the minimum acquisition number is obtained, in order to avoid the preset number being too large, resulting in the number of times the target data is received being less than the preset number when the device is in the closed state, thereby causing an error in the device cover state judgment, the minimum acquisition number may be subtracted from the error number, and the difference may be used as the preset number. For example, if the minimum acquisition number is 4 and the error number is 1, the preset number may be 3. This embodiment takes the error number into account when determining the preset number, avoids misjudging the closed state as the open state, and thus improves the accuracy of the device cover state judgment.
[0077] In order to accurately obtain the preset duration corresponding to the first timer, optionally, in the device status judgment method provided in the embodiment of the present application, each time the target data is obtained, the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data is determined, and it is judged whether the time interval is greater than or equal to the preset duration. The method also includes: when the cover body is in an open state, counting the corresponding time intervals of multiple frames of target data to obtain multiple time intervals; determining the maximum time interval among the multiple time intervals, and determining the preset duration based on the maximum time interval.
[0078] Specifically, before counting the number of times the target data is acquired, it is necessary to determine the time interval between two consecutive acquisitions of the target data by the device in the open state, and determine the preset duration corresponding to the first timer according to the time interval. Multiple time intervals can be acquired, and the largest time interval is selected from the multiple time intervals as the preset duration corresponding to the first timer, thereby ensuring the accuracy of the device cover state judgment. For example, when the device is in the open state, the target data is acquired 11 times continuously, thereby obtaining 10 time intervals, and the largest time interval of 700ms is selected from the 10 standard time intervals, and the preset duration is determined according to the largest time interval of 700ms.
[0079] In order to improve the accuracy of setting the preset duration, optionally, in the method for determining the device status provided in an embodiment of the present application, determining the preset duration based on the maximum time interval includes: calculating the sum of the maximum time interval and the error time interval, and determining the sum as the preset duration.
[0080] Specifically, the error time interval may be an error value of the preset acquisition time. After the maximum time interval is obtained, in order to avoid the preset time length being too short, resulting in the time interval between two target data being received being less than the preset time length when the device is in the open cover state, thereby causing an error in the device cover state judgment, the maximum time interval and the error time interval may be added, and the sum may be used as the preset number of times. For example, if the maximum time interval is 700ms and the error time interval is 100ms, the preset time length may be 800ms. In this embodiment, the error time length is added when determining the preset time length, so as to avoid misjudging the open cover state as the closed cover state, thereby improving the accuracy of the device cover state judgment.
[0081] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0082] The embodiment of the present application also provides a device for determining the state of a device. It should be noted that the device for determining the state of a device in the embodiment of the present application can be used to execute the method for determining the state of a device provided in the embodiment of the present application. The device for determining the state of a device provided in the embodiment of the present application is introduced below.
[0083] Figure 8 Schematic diagram of a device for determining the state of a device according to an embodiment of the present application. Figure 8 As shown, the device includes: an acquisition unit 81, a first determination unit 82, a second determination unit 83, and a third determination unit 84.
[0084] The acquisition unit 81 is used to acquire target data sent by the first wireless module through the second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device.
[0085] The first determination unit 82 is used to determine the time interval between the acquisition time of the previous frame target data and the acquisition time of the next frame target data, and to judge whether the time interval is greater than or equal to a preset time length. When the time interval is greater than or equal to the preset time length, a first state of the cover body is obtained, wherein the first state is used to characterize the open cover state.
[0086] The second determination unit 83 is used to count the number of times the target data is acquired according to the first preset time period, and to determine whether the number of times the target data is acquired is greater than or equal to the preset number. When the number of times the target data is acquired is greater than or equal to the preset number, a second state of the cover body is obtained, wherein the second state is used to represent the closed state.
[0087] The third determining unit 84 is configured to determine a current state of the cover according to the first state and the second state.
[0088] The device for judging the state of the device provided in the embodiment of the present application, through the acquisition unit 81, the target data sent by the first wireless module is acquired through the second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device; the first determination unit 82 determines the time interval between the acquisition time of the previous frame of target data and the acquisition time of the next frame of target data, and determines whether the time interval is greater than or equal to the preset time length, and obtains the first state of the cover when the time interval is greater than or equal to the preset time length, wherein the first state is used to characterize the open cover state; the second determination unit 83 counts the number of acquisitions of the target data according to the first preset time period, and determines whether the number of acquisitions of the target data is greater than or equal to the preset number of times, and obtains the second state of the cover when the number of acquisitions of the target data is greater than or equal to the preset number of times, wherein the second state is used to characterize the closed cover state; the third determination unit 84 determines the current state of the cover according to the first state and the second state. The problem that a complex open and close cover detection mechanism is required to detect the cover state of the cooking device in the related art, and the detection result of the cover state of the cooking device is inaccurate is solved. The open and close state of the device cover is determined by combining the time required to acquire the target data and the number of times the target data is acquired within the preset time, thereby achieving the effect of accurately detecting the cover state of the cooking device.
[0089] Optionally, in the device for determining the status of the equipment provided in the embodiment of the present application, the first determination unit 82 includes: a first determination module, used to start the first timer, and determine whether the target data is acquired before the first timer times out a preset duration; a first determination module, used to determine the current timing time of the first timer as the time interval when the target data is acquired, and control the first timer to re-time; a second determination module, used to determine the preset duration as the time interval when the target data is not acquired, and control the first timer to re-time.
[0090] Optionally, in the device status judgment apparatus provided in the embodiment of the present application, the second determination unit 83 includes: a first control module, used to start the second timer, control the second timer to time according to the first preset time period, and control the second timer to reset and restart after completing the timing of each first preset time period; a second control module, used to start the counter to count the number of times the target data is obtained when the second timer is started, and control the counter to reset and restart after the second timer completes the timing of each first preset time period; a second judgment module, used to determine whether there is a situation in which the timing of the first timer reaches a preset duration during the timing of the second timer; an acquisition module, used to obtain the counting result of the counter when the second timer reaches the duration corresponding to the first preset time period when the timing of the first timer does not reach the preset duration, and determine the counting result as the number of times the target data is obtained.
[0091] Optionally, in the device for determining the status of an equipment provided in an embodiment of the present application, the device further includes: a first control unit, for controlling the second timer to be reset and restarted, and controlling the counter to be reset and restarted when the timing of the first timer reaches a preset duration.
[0092] Optionally, in the device for determining the status of the device provided in the embodiment of the present application, the device also includes: a second control unit, for controlling the counter to stop counting or reset the count when the timing of the first timer reaches a preset duration, until the second timer restarts.
[0093] Optionally, in the device for judging the status of the equipment provided in the embodiment of the present application, the third determination unit 84 includes: a third judgment module, used to judge whether the first state and the second state both appear within the second preset time period according to the second preset time period, wherein the second preset time period is greater than or equal to the first preset time period; and a third determination module, used to determine the first state as the current state of the cover body when the first state and the second state both appear within the second preset time period.
[0094] Optionally, in the device for judging the equipment status provided in the embodiment of the present application, the third determination unit 84 includes: a fourth judgment module, used to judge the order of appearance of the first state and the second state within the third preset time period according to a third preset time period, wherein the duration corresponding to the third preset time period is greater than or equal to the preset duration; a fourth determination module, used to determine the first state as the current state of the cover body when the first state appears first; and a fifth determination module, used to determine the second state as the current state of the cover body when the second state appears first.
[0095] Optionally, in the device for determining the status of the equipment provided in the embodiment of the present application, the device further includes: a first statistical unit, for counting the number of acquisitions of target data corresponding to multiple first preset time periods when the cover body is in a closed state, to obtain multiple acquisition numbers; a fourth determination unit, for determining the minimum acquisition number among the multiple acquisition numbers, and determining the preset number based on the minimum acquisition number.
[0096] Optionally, in the device for determining the status of a device provided in an embodiment of the present application, the fourth determination unit includes: a first calculation module, configured to calculate a difference between a minimum number of acquisitions and a number of errors, and determine the difference as a preset number of times.
[0097] Optionally, in the device for determining the status of the equipment provided in the embodiment of the present application, the device also includes: a second statistical unit, used to count the corresponding time intervals for acquiring multiple frames of target data when the cover is in an open state, to obtain multiple time intervals; a fifth determination unit, used to determine the maximum time interval among the multiple time intervals, and determine the preset duration based on the maximum time interval.
[0098] Optionally, in the device for determining the status of a device provided in an embodiment of the present application, the fifth determination unit includes: a second calculation module, configured to calculate the sum of a maximum time interval and an error time interval, and determine the sum as a preset duration.
[0099] The above-mentioned device status judgment device includes a processor and a memory. The above-mentioned acquisition unit 81, the first determination unit 82, the second determination unit 83, the third determination unit 84, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.
[0100] The processor includes a kernel, and the kernel retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problem that a complex opening and closing cover detection mechanism is required in the related art to detect the cover state of the cooking device, and the detection result of the cover state of the cooking device is inaccurate.
[0101] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0102] An embodiment of the present application further provides a computer storage medium, which is used to store a program, wherein when the program is running, the device where the non-volatile storage medium is located is controlled to execute a method for determining the status of the device.
[0103] The embodiment of the present application also provides an electronic device, comprising a processor and a memory; the memory stores computer-readable instructions, and the processor is used to run the computer-readable instructions, wherein when the computer-readable instructions are run, a method for determining a device status is executed. The electronic device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0104] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0105] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0106] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0107] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0108] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0109] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0110] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0111] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0112] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A method for determining a device status, characterized in that: include: Acquiring target data sent by the first wireless module through the second wireless module, wherein the second wireless module is arranged on the main body of the target device, and the first wireless module is arranged on the cover of the target device; Determine the time interval between the acquisition time of the target data of the previous frame and the acquisition time of the target data of the next frame, and judge whether the time interval is greater than or equal to a preset time length, and obtain the first state of the cover body when the time interval is greater than or equal to the preset time length, wherein the first state is used to represent the cover-opening state; Counting the number of acquisitions of the target data according to a first preset time period, and determining whether the number of acquisitions of the target data is greater than or equal to a preset number, and obtaining a second state of the cover body when the number of acquisitions of the target data is greater than or equal to the preset number, wherein the second state is used to represent a closed cover state; A current state of the cover is determined according to the first state and the second state.
2. The method according to claim 1, characterized in that Determining the time interval between the acquisition time of the target data of the previous frame and the acquisition time of the target data of the next frame includes: Starting a first timer, and determining whether the target data is acquired before the first timer reaches the preset time length; When the target data is acquired, the current timing time of the first timer is determined as the time interval, and the first timer is controlled to re-time; In the case that the target data is not obtained, the preset duration is determined as the time interval, and the first timer is controlled to restart timing.
3. The method according to claim 2, characterized in that Counting the number of acquisitions of the target data according to the first preset time period includes: Starting a second timer, controlling the second timer to count according to the first preset time period, and controlling the second timer to reset and restart after completing the timing of each first preset time period; When the second timer is started, a counter is started to count the number of acquisitions of the target data, and the counter is controlled to reset and restart counting after the second timer completes the timing of each of the first preset time periods; During the timing of the second timer, determining whether the timing of the first timer reaches the preset duration; When the timing of the first timer does not reach the preset duration, the counting result of the counter is obtained when the timing of the second timer reaches the duration corresponding to the first preset time period, and the counting result is determined as the number of times the target data is obtained.
4. The method according to claim 3, characterized in that During the timing of the second timer, after determining whether the timing of the first timer reaches the preset duration, the method further includes: When the timing of the first timer reaches the preset time length, the second timer is controlled to be reset and restarted, and the counter is controlled to be reset and restarted.
5. The method according to claim 3, characterized in that: During the timing of the second timer, after determining whether the timing of the first timer reaches the preset duration, the method further includes: When the timing of the first timer reaches the preset time length, the counter is controlled to stop counting or reset to zero until the second timer starts counting again.
6. The method according to claim 1, characterized in that Determining the current state of the cover body according to the first state and the second state includes: Determine whether both the first state and the second state occur within a second preset time period according to a second preset time period, wherein the second preset time period is greater than or equal to the first preset time period; In a case where both the first state and the second state appear within the second preset time period, the first state is determined as the current state of the cover body.
7. The method according to claim 1, characterized in that Determining the current state of the cover body according to the first state and the second state includes: Determine, according to a third preset time period, an order of occurrence of the first state and the second state within the third preset time period, wherein the duration corresponding to the third preset time period is greater than or equal to the preset duration; In the case where the first state appears first, determining the first state as the current state of the cover body; In the case where the second state appears first, the second state is determined as the current state of the cover body.
8. The method according to claim 1, characterized in that Before counting the number of acquisitions of the target data according to the first preset time period and determining whether the number of acquisitions of the target data is greater than or equal to the preset number, the method further includes: When the cover is in a closed state, counting the number of acquisitions of the target data corresponding to a plurality of the first preset time periods to obtain a plurality of acquisition numbers; A minimum acquisition number among the multiple acquisition times is determined, and the preset number is determined based on the minimum acquisition number.
9. The method according to claim 8, characterized in that Determining the preset number of times based on the minimum number of acquisitions includes: The difference between the minimum acquisition times and the error times is calculated, and the difference is determined as the preset times.
10. The method according to claim 1, characterized in that Each time the target data is acquired, determining the time interval between the acquisition time of the previous frame of the target data and the acquisition time of the next frame of the target data, and judging whether the time interval is greater than or equal to a preset time length, the method further includes: When the cover is in an open state, statistically acquiring corresponding time intervals of a plurality of frames of the target data to obtain a plurality of time intervals; A maximum time interval among the multiple time intervals is determined, and the preset duration is determined based on the maximum time interval.
11. The method according to claim 10, characterized in that Determining the preset duration based on the maximum time interval includes: The sum of the maximum time interval and the error time interval is calculated, and the sum is determined as the preset duration.
12. A device for determining a device status, characterized in that: include: an acquisition unit, configured to acquire target data sent by the first wireless module through a second wireless module, wherein the second wireless module is arranged on a main body of the target device, and the first wireless module is arranged on a cover of the target device; a first determining unit, configured to determine a time interval between a time when the target data of a previous frame is acquired and a time when the target data of a next frame is acquired, and to determine whether the time interval is greater than or equal to a preset time length, and to obtain a first state of the cover body when the time interval is greater than or equal to the preset time length, wherein the first state is used to represent an open cover state; a second determining unit, configured to count the number of acquisitions of the target data according to a first preset time period, and determine whether the number of acquisitions of the target data is greater than or equal to a preset number, and obtain a second state of the cover body when the number of acquisitions of the target data is greater than or equal to the preset number, wherein the second state is used to represent a closed state of the cover body; The third determining unit is configured to determine a current state of the cover according to the first state and the second state.
13. A non-volatile storage medium, characterized in that: The non-volatile storage medium includes a stored program, wherein when the program is executed, the device where the non-volatile storage medium is located is controlled to execute the method for determining the device status as described in any one of claims 1 to 11.
14. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores computer-readable instructions, and the processor is used to execute the computer-readable instructions, wherein the computer-readable instructions, when executed, execute the method for determining the device status as described in any one of claims 1 to 11.
