Search

US-12625158-B2 - Method and device for detecting state of door or window

US12625158B2US 12625158 B2US12625158 B2US 12625158B2US-12625158-B2

Abstract

A method for detecting a state of a door or window is provided, comprising: receiving sensor data from a sensor arranged on the door or window, the sensor data comprising magnetometer data and at least one of angular velocity data and acceleration data; judging whether magnetic field distortion is present on the basis of the sensor data; and when it is judged that the magnetic field distortion is not present, determining the state of the door or window on the basis of the magnetometer data. The accuracy of state detection is thereby increased.

Inventors

  • Shangru Li
  • Dan Liu
  • Haibo Qin

Assignees

  • ROBERT BOSCH GMBH

Dates

Publication Date
20260512
Application Date
20210701
Priority Date
20200731

Claims (12)

  1. 1 . A method for detecting a state of a door or window, comprising: receiving sensor data from at least one sensor arranged on the door or window, the sensor data comprising magnetometer data and at least one of angular velocity data and acceleration data; judging whether magnetic field distortion is present in a detection environment of the at least one sensor based on the sensor data; when it is judged that the magnetic field distortion is not present, determining the state of the door or window based on the magnetometer data; and when it is judged that the magnetic field distortion is present, determining the state of the door or window based on the at least one of the angular velocity data and the acceleration data, wherein the method is implemented in a non-transitory machine-readable storage medium that stores computer program instructions which, when run, causes a processor to perform the method, wherein: the judging of whether magnetic field distortion is present based on the sensor data comprises: judging whether the door or window is stationary based on the sensor data; when it is judged that the door or window is stationary, judging whether magnetic field distortion is present based on the magnetometer data; when it is judged that the door or window is not stationary: determining one or more opening angle of the door or window based on the at least one of the angular velocity data and the acceleration data; determining magnetometer data for the one or more opening angle; and judging whether the magnetic field distortion is present based on the one or more opening angle, the magnetometer data determined for the one or more opening angle, and a predetermined correspondence between each opening angle of the door or window and corresponding magnetometer data, the predetermined correspondence being determined in the absence of the magnetic field distortion; and when it is judged that the magnetic field distortion is not present, the state of the door or window is determined based on the magnetometer data and the predetermined correspondence.
  2. 2 . The method as claimed in claim 1 , wherein the judging of whether the magnetic field distortion is present based on the one or more opening angle, the magnetometer data determined for the one or more opening angle, and a predetermined correspondence between each opening angle of the door or window and corresponding magnetometer data, comprises one of: determining first difference data between the magnetometer data determined for the one or more opening angle and magnetometer data in the predetermined correspondence that corresponds to the one or more opening angle, and determining whether magnetic field distortion is present based on the first difference data; and determining second difference data between the one or more opening angle and a corresponding opening angle in the predetermined correspondence that corresponds to the magnetometer data determined for the one or more opening angle; and determining whether magnetic field distortion is present based on the second difference data.
  3. 3 . The method as claimed in claim 1 , wherein: the one or more opening angle is determined based on the angular velocity data, angular velocity deviation data, and an initial opening angle of the door or window, and when it is judged that the magnetic field distortion is present, determining the state of the door or window based on the angular velocity data, the angular velocity deviation data, and the initial opening angle of the door or window.
  4. 4 . The method as claimed in claim 3 , further comprising: when it is judged that the door or window is stationary at a current opening angle greater than zero and the magnetic field distortion is not present, updating the initial opening angle of the door or window.
  5. 5 . The method as claimed in claim 3 , wherein the determining the state of the door or window based on the angular velocity data, the angular velocity deviation data, and the initial opening angle of the door or window comprises: determining the one or more opening angle of the door or window based on the angular velocity data, the angular velocity deviation data, and the initial opening angle of the door or window; and determining whether the door or window is closed based on the one or more opening angle.
  6. 6 . The method as claimed in claim 3 , further comprising: when it is judged that the door or window is stationary for a predetermined time period, updating the angular velocity deviation data based on angular velocity data within the predetermined time period.
  7. 7 . The method as claimed in claim 3 , wherein the determining the state of the door or window based on the magnetometer data and the predetermined correspondence comprises: determining a difference between the magnetometer data and magnetometer data in the predetermined correspondence that corresponds to an opening angle of zero; and determining whether the door or window is closed based on the difference.
  8. 8 . The method as claimed in claim 7 , further comprising: when it is determined that the door or window is closed, setting the initial opening angle of the door or window to zero.
  9. 9 . A device for detecting a state of a door or window, comprising: a non-transitory machine readable storage medium configured to store computer program instructions; and a processor configured to execute the computer program instructions, the processor comprising: a receiving unit configured to receive sensor data from at least one sensor arranged on the door or window, the sensor data comprising magnetometer data and at least one of angular velocity data and acceleration data; a judgment unit configured to judge whether magnetic field distortion is present in a detection environment of the at least one sensor based on the sensor data; and a state determining unit configured to: when it is judged that the magnetic field distortion is not present, determine the state of the door or window based on the magnetometer data; and when it is judged that the magnetic field distortion is present, determine the state of the door or window based on the at least one of the angular velocity and the acceleration data, wherein the judgment unit comprises: a first judgment unit configured to judge whether the door or window is stationary based on the sensor data; and a second judgment unit configured to: when the first judgment unit judges that the door or window is stationary, judge whether magnetic field distortion is present based on the magnetometer data; and when the first judgment unit judges that the door or window is not stationary: determine one or more opening angle of the door or window based on the at least one of the angular velocity data and the acceleration data; determine magnetometer data for the one or more opening angle; and judge whether the magnetic field distortion is present based on the one or more opening angle, corresponding magnetometer data, and a predetermined correspondence between each opening angle of the door or window and corresponding magnetometer data, the predetermined correspondence being determined in the absence of the magnetic field distortion, and wherein the state determining unit is configured to determine the state of the door or window based on the magnetometer data and the predetermined correspondence when the second judgment unit judges that the magnetic field distortion is not present.
  10. 10 . A system for detecting a state of a door of window, comprising: the device according to claim 9 ; and the at least one sensor, which includes an acceleration sensor installed on the door or window and configured to generate the acceleration data; an angular velocity sensor installed on the door or window and configured to generate the angular velocity data; and a magnetometer installed on the door or window and configured to generate the magnetometer data.
  11. 11 . The device as claimed in claim 9 , wherein: when the second judgment unit judges that the magnetic field distortion is present, the state of the door or window is determined based on the angular velocity data, angular velocity deviation data, and an initial opening angle of the door or window, the processor further comprises a first updating unit configured to: when the first judgment unit judges that the door or window is stationary at a current opening angle greater than zero and the second judgment unit judges that the magnetic field is not present, update the initial opening angle of the door or window; and set the initial opening angle of the door or window to zero when the state determining unit determines that the door or window is closed.
  12. 12 . The device as claimed in claim 11 , the processor further comprising: a second updating unit configured to, when the first judgment unit judges that the door or window is stationary for a predetermined time period, update the angular velocity deviation data based on angular velocity data within the predetermined time period.

Description

This application is a 35 U.S.C. § 371 National Stage Application of PCT/EP2021/068233, filed on Jul. 1, 2021, which claims the benefit of priority to Serial No. CN 202010764652.8, filed on Jul. 31, 2020 in China, the disclosures of which are incorporated herein by reference in their entirety. The present disclosure relates to the technical field of doors and windows, in particular to door or window detection. BACKGROUND As society advances, an ever growing number of detection methods are being used in our everyday lives, to provide convenience and safety for our lives, for example in the detection of the state of doors or windows, especially the state of opening/closing, or even the provision of the opening angle of doors or windows. Common detection methods include detection based on angular velocity data and detection based on magnetometer data. In a detection method based on angular velocity data, angular velocity data is integrated to calculate the opening angle of a door or window, and the state of the door or window is then detected on the basis of the calculated opening angle. Angular velocity data measured by an angular velocity sensor generally includes deviation which will increase with time, possibly resulting in deviation of the calculated opening angle from the actual value. In a detection method based on magnetometer data, the detection environment is required to be magnetically stable, but in real situations, magnetic field distortion is often present in the detection environment, so it is difficult to guarantee the magnetic stability thereof. SUMMARY It is hoped to provide a method and device for detecting a state of a door or window; the method and device first detect whether magnetic field distortion is present, and perform detection on the basis of magnetometer data only if no magnetic distortion is present, thereby increasing the accuracy of the detection result. According to one aspect, a method for detecting a state of a door or window is provided. The method comprises: receiving sensor data from a sensor arranged on the door or window, the sensor data comprising magnetometer data and at least one of angular velocity data and acceleration data; judging whether magnetic field distortion is present on the basis of the sensor data; and when it is judged that the magnetic field distortion is not present, determining the state of the door or window on the basis of the magnetometer data. According to another aspect, a device for detecting a state of a door or window is provided. The device comprises: a receiving unit, for receiving sensor data from a sensor arranged on the door or window, the sensor data comprising magnetometer data and at least one of angular velocity data and acceleration data; a judgment unit, for judging whether magnetic field distortion is present on the basis of the sensor data; and a state determining unit, for determining the state of the door or window on the basis of the magnetometer data when it is judged that the magnetic field distortion is not present. According to another aspect, a system for detecting a state of a door of window is provided, comprising: an acceleration sensor, an angular velocity sensor and a magnetometer installed on the door or window; and a processor, for performing the method according to any one of various embodiments. According to another aspect, a machine readable storage medium is provided, storing a computer program instruction which, when run, causes a computer to perform the method according to various embodiments of the present disclosure. According to various embodiments of various aspects of the present disclosure, first of all, a judgment is made as to whether magnetic field distortion is present on the basis of sensor data; in particular, a judgment is first made as to whether the door or window is in a stationary state, and different approaches are used for a stationary state and a non-stationary state to judge whether magnetic field distortion is present. If it is judged that no magnetic field distortion is present, the state of the door or window, in particular the door open/closed state or even the angle of door opening, is determined on the basis of magnetometer data. This increases the accuracy of the detection result. BRIEF DESCRIPTION OF THE DRAWINGS In the drawings, embodiments are explained merely by demonstration, in a non-limiting way. Similar reference labels in the drawings denote similar elements. FIG. 1 shows a method for detecting a state of a door or window according to one embodiment. FIG. 2 shows a method for setting a predetermined correspondence according to one embodiment. FIG. 3 shows a method for detecting a state of a door or window on the basis of magnetometer data according to one embodiment. FIG. 4 shows a method for detecting a state of a door or window on the basis of angular velocity data according to one embodiment. FIG. 5 shows a device for detecting a state of a door or window according to on