CN115077460A - Hinge angle detection method and related equipment - Google Patents

Hinge angle detection method and related equipment Download PDF

Info

Publication number
CN115077460A
CN115077460A CN202111398158.5A CN202111398158A CN115077460A CN 115077460 A CN115077460 A CN 115077460A CN 202111398158 A CN202111398158 A CN 202111398158A CN 115077460 A CN115077460 A CN 115077460A
Authority
CN
China
Prior art keywords
hinge angle
sensor
screen
algorithm
magnetic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111398158.5A
Other languages
Chinese (zh)
Other versions
CN115077460B (en
Inventor
王鹏
贾现召
刘铁良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310316673.7A priority Critical patent/CN116399283B/en
Priority to CN202111398158.5A priority patent/CN115077460B/en
Publication of CN115077460A publication Critical patent/CN115077460A/en
Application granted granted Critical
Publication of CN115077460B publication Critical patent/CN115077460B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/22Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring angles or tapers; for testing the alignment of axes
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01PMEASURING LINEAR OR ANGULAR SPEED, ACCELERATION, DECELERATION, OR SHOCK; INDICATING PRESENCE, ABSENCE, OR DIRECTION, OF MOVEMENT
    • G01P3/00Measuring linear or angular speed; Measuring differences of linear or angular speeds
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R33/00Arrangements or instruments for measuring magnetic variables
    • G01R33/02Measuring direction or magnitude of magnetic fields or magnetic flux
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Condensed Matter Physics & Semiconductors (AREA)
  • Telephone Function (AREA)

Abstract

The application discloses a hinge angle detection method and related equipment, relates to the technical field of folding screens, and aims to accurately calculate a hinge angle. The specific scheme is applied to foldable electronic equipment, and foldable electronic equipment's folding screen includes first screen and second screen, and the organism that first screen corresponds is provided with first gyroscope sensor and magnetic sensor, and the organism that the second screen corresponds is provided with second gyroscope sensor and magnet, and magnetic sensor is used for detecting the magnetic field intensity of magnet, and the specific scheme is: and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor. Because the data of the magnetic sensor can make up the accumulated error in the data calculation process using the first gyroscope sensor and the second gyroscope sensor, and the accuracy of the fusion algorithm is not affected by whether the common axis is perpendicular to the horizontal plane or not, the hinge angle can be accurately calculated.

Description

Hinge angle detection method and related equipment
Technical Field
The application relates to the technical field of folding screens, in particular to a hinge angle detection method and related equipment.
Background
With the gradual maturity of folding screen technology, folding screen cell-phones on the market are also more and more. To enhance the user experience when using a folding screen handset, many developers have developed a range of functions associated with folding screen technology. For example, a function of displaying and playing a video in a self-adaptive large screen after a folding screen mobile phone is unfolded is designed.
However, in the process of implementing the series of functions, the hinge angle of the current folding-screen mobile phone is often required to be acquired to determine the posture of the current folding-screen mobile phone. Therefore, the existing folding screen mobile phone has the requirement of acquiring an accurate hinge angle.
Disclosure of Invention
The application provides a hinge angle detection method and related equipment, and aims to accurately calculate a hinge angle.
In order to achieve the above object, the present application provides the following technical solutions:
in a first aspect, the application discloses a method for detecting a hinge angle, which is applied to a foldable electronic device, wherein the foldable screen of the foldable electronic device comprises a first screen and a second screen, a body corresponding to the first screen is provided with a first gyroscope sensor and a magnetic sensor, a body corresponding to the second screen is provided with a second gyroscope sensor and a magnet, the magnetic sensor is used for detecting the magnetic field intensity of the magnet, and the method for detecting the hinge angle comprises the following steps: the method comprises the steps of obtaining data of a magnetic sensor, a first gyroscope sensor and a second gyroscope sensor, and then calculating the hinge angle of the electronic device by using a fusion algorithm according to the obtained data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
In the embodiment of the application, the hinge angle of the electronic device is calculated by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor, and because the precision of the data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor is not affected by whether a common axis of the electronic device is perpendicular to a horizontal plane or not when the hinge angle is calculated, the data of the magnetic sensor can make up for the accumulated error of the data of the first gyroscope sensor and the second gyroscope sensor when the hinge angle is calculated, and the hinge angle of the electronic device can be accurately calculated.
In one possible implementation, calculating a hinge angle of an electronic device using an acceleration algorithm includes:
and calculating the hinge angle of the electronic equipment by using an acceleration sensor algorithm according to the projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system and the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system. The projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system is acquired by the first acceleration sensor, and the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system is acquired by the second acceleration sensor.
In another possible implementation manner, calculating the hinge angle of the electronic device by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor includes: according to the magnetic force data collected by the magnetic sensors, the hinge angle corresponding to the magnetic force data is determined, then according to the hinge angle corresponding to the magnetic force data, the angular speed around the common axis collected by the first gyroscope sensor and the angular speed around the common axis collected by the second gyroscope sensor, the hinge angle of the electronic equipment is calculated through a fusion algorithm.
In another possible implementation manner, calculating the hinge angle of the electronic device by using a fusion algorithm according to the hinge angle corresponding to the magnetic data, the angular velocity around the common axis acquired by the first gyroscope sensor, and the angular velocity around the common axis acquired by the second gyroscope sensor includes: and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the process covariance, the key parameter measurement error, the sampling period, the hinge angle corresponding to the magnetic data, the angular velocity around the common axis acquired by the first gyroscope sensor and the angular velocity around the common axis acquired by the second gyroscope sensor. Wherein the fusion algorithm is based on a Kalman filtering construction.
In another possible implementation, acquiring data of the magnetic sensor, the first gyro sensor, and the second gyro sensor includes: and if the folding screen is determined not to be in the closed state, acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
In another possible implementation manner, the determining that the folding screen is not in the closed state includes: and determining that the folding screen is not in a closed state according to the magnetic data.
In another possible implementation manner, determining that the foldable screen is not in the closed state according to the magnetic data includes: and if the magnetic force data is less than or equal to the first preset magnetic force value, determining that the folding screen is not in the closed state.
In another possible implementation manner, the method further includes:
and if the folding screen is determined to be in the closed state, controlling a sensor in the electronic equipment not to be in the working state.
In a second aspect, the application discloses a hinge angle detection method, which is applied to a foldable electronic device, the foldable screen of the foldable electronic device includes a first screen and a second screen, a first gyroscope sensor, a magnetic sensor and a first acceleration sensor are arranged on a machine body corresponding to the first screen, a second gyroscope sensor, a magnet and a second acceleration sensor are arranged on a machine body corresponding to the second screen, the magnetic sensor is used for detecting the magnetic field intensity of the magnet, and the hinge angle detection method includes: and determining a target algorithm according to the motion state of the electronic equipment and the relative position of the common shaft and the horizontal plane. Wherein, the target algorithm at least comprises: and a fusion algorithm or an acceleration sensor algorithm, wherein the common axis is the axis of the folding edge of the folding screen. And if the determined target algorithm is a fusion algorithm, acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor, and then calculating the hinge angle of the electronic equipment by using the fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
In the embodiment of the application, if and only if the algorithm which is determined by the motion state of the electronic device and the relative position of the common shaft and the horizontal plane and is more suitable for use and has the highest accuracy is the fusion algorithm, the hinge angle of the electronic device is calculated by using the fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor, so that the accuracy of calculating the hinge angle by using the fusion algorithm is improved.
In one possible implementation, determining a motion state of an electronic device includes: if the difference value between the modular length of the acceleration vector of the electronic equipment and the gravity acceleration is smaller than or equal to a first preset value, the motion state of the electronic equipment is determined to be a static state, and if the difference value between the modular length of the acceleration vector and the gravity acceleration is larger than the first preset value, the motion state of the electronic equipment is determined not to be in the static state.
In another possible implementation, determining a motion state of an electronic device includes: if the difference value between the modular length of the acceleration vector of the electronic equipment and the gravity acceleration is smaller than or equal to a first preset value, the motion state of the electronic equipment is determined to be a static state, and if the difference value between the modular length of the acceleration vector and the gravity acceleration is larger than the first preset value, the motion state of the electronic equipment is determined not to be in the static state.
In another possible implementation, determining the relative position of the common axis and the horizontal plane includes: and if the difference between the component of the acceleration vector on the common axis and the gravity acceleration is greater than the first preset value, determining that the common axis is not perpendicular to the horizontal plane.
In another possible implementation manner, determining a target algorithm according to the motion state of the electronic device and the relative position of the common axis and the horizontal plane includes: and if the electronic equipment is in a static state and the common axis is not vertical to the horizontal plane, determining the acceleration sensor algorithm as a target algorithm, if the electronic equipment is not in the static state, determining the target algorithm as a fusion algorithm, and if the electronic equipment is in the static state and the common axis is vertical to the horizontal plane, determining the target algorithm as the fusion algorithm.
In another possible implementation manner, if the determined target algorithm is a fusion algorithm and the hinge angle is determined to be changed, data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor are obtained.
In another possible implementation, determining that the hinge angle changes includes: and if the difference value between the angular speed difference and zero is greater than a second preset value, determining that the hinge angle changes. Wherein the angular velocity difference is a difference between an angular velocity of the first gyro sensor about the common axis and an angular velocity of the second gyro sensor about the common axis.
In another possible implementation manner, the method further includes: and if the determined target algorithm is the acceleration algorithm, calculating the hinge angle of the electronic equipment by using the acceleration algorithm.
In another possible implementation, calculating the hinge angle of the electronic device using an acceleration algorithm includes:
and calculating the hinge angle of the electronic equipment by using an acceleration sensor algorithm according to the projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system and the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system. The projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system is acquired by the first acceleration sensor, and the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system is acquired by the second acceleration sensor.
In another possible implementation manner, calculating a hinge angle of the electronic device by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor, and the second gyroscope sensor includes: the hinge angle corresponding to the magnetic data is determined according to the magnetic data collected by the magnetic sensors, and then the hinge angle of the electronic device is calculated by using a fusion algorithm according to the hinge angle corresponding to the magnetic data, the angular velocity around the common axis collected by the first gyroscope sensor and the angular velocity around the common axis collected by the second gyroscope sensor.
In another possible implementation manner, calculating a hinge angle of the electronic device by using a fusion algorithm according to the hinge angle corresponding to the magnetic data, the angular velocity around the common axis acquired by the first gyroscope sensor, and the angular velocity around the common axis acquired by the second gyroscope sensor includes: and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the process covariance, the key parameter measurement error, the sampling period, the hinge angle corresponding to the magnetic data, the angular velocity around the common axis acquired by the first gyroscope sensor and the angular velocity around the common axis acquired by the second gyroscope sensor. Wherein the fusion algorithm is based on a Kalman filtering construction.
In another possible implementation, acquiring data of the magnetic sensor, the first gyro sensor, and the second gyro sensor includes: and if the folding screen is determined not to be in the closed state, acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
In another possible implementation manner, the determining that the folding screen is not in the closed state includes: and determining that the folding screen is not in a closed state according to the magnetic data.
In another possible implementation manner, determining that the foldable screen is not in the closed state according to the magnetic data includes: and if the magnetic force data is less than or equal to the first preset magnetic force value, determining that the folding screen is not in the closed state.
In another possible implementation manner, the method further includes:
and if the folding screen is determined to be in the closed state, controlling a sensor in the electronic equipment not to be in the working state.
Drawings
Fig. 1a is a schematic diagram illustrating a change of a folding screen mobile phone disclosed in an embodiment of the present application in an unfolding and folding process;
fig. 1b is a schematic view illustrating a video interface change in the process of unfolding and folding a folding screen mobile phone disclosed in the embodiment of the present application in the process of playing a video;
FIG. 1c is a schematic diagram illustrating a change in hinge angle according to various algorithms disclosed in an embodiment of the present application;
fig. 2a is a schematic hardware structure diagram of a foldable electronic device disclosed in an embodiment of the present application;
fig. 2b is a schematic hardware layout diagram of a folding screen mobile phone disclosed in the embodiment of the present application;
fig. 3 is a software framework diagram of a foldable electronic device disclosed in an embodiment of the present application;
FIG. 4a is a schematic diagram of an angle between two planes disclosed in the embodiments of the present application;
FIG. 4b is a schematic diagram illustrating a variation of the magnetic force detected by the magnetic sensor during the unfolding process disclosed in the embodiment of the present application;
fig. 5a is a first schematic flow chart of a hinge angle detection method disclosed in the embodiment of the present application;
FIG. 5b is a schematic diagram illustrating a variation of the magnetic force detected by the magnetic sensor during the unfolding process disclosed in the embodiment of the present application;
fig. 6a is a schematic flow chart of a hinge angle detection method disclosed in the embodiment of the present application;
fig. 6b is a first scene view of detecting the hinge angle of the folding screen mobile phone disclosed in the embodiment of the present application;
fig. 6c is a view of a second scene in which the hinge angle is detected by the folding-screen mobile phone disclosed in the embodiment of the present application;
fig. 6d is a third scene view of detecting the hinge angle of the folding screen mobile phone disclosed in the embodiment of the present application;
fig. 6e is a fourth scene view of detecting the hinge angle by the folding-screen mobile phone disclosed in the embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the embodiments of the present application, "one or more" means one, two, or more than two; "and/or" describes the association relationship of the associated objects, indicating that three relationships may exist; for example, a and/or B, may represent: a alone, both A and B, and B alone, where A, B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.
The embodiments of the present application relate to a plurality of numbers greater than or equal to two. It should be noted that, in the description of the embodiments of the present application, the terms "first", "second", and the like are used for distinguishing the description, and are not to be construed as indicating or implying relative importance or order.
For the sake of understanding, the following related art principles are introduced to the embodiments of the present application:
with the gradual maturity of folding screen technique, folding screen cell-phones on the market are also more and more. As shown in fig. 1a, the folding screen of the folding screen mobile phone includes: a first screen and a second screen. The folded screen is folded along the folded edge to form a first screen and a second screen. The virtual axes of the folded edges are common. The first screen may include an inner screen and an outer screen of the first screen, and the second screen may also include an inner screen and an outer screen of the second screen. The inner screen refers to the screen which is positioned inside when the folding screen is in the folding state, and the outer screen is positioned outside when the folding screen is in the closing state. The included angle between the first screen and the second screen is the hinge angle alpha of the folding screen mobile phone. Folding screen cell-phone includes: the machine body corresponding to the first screen (the first machine body for short) and the machine body corresponding to the second screen (the second machine body). The first machine body is connected with the second machine body through a connecting shaft.
The form of the folding screen mobile phone can be changed according to the needs of users. For example, when a user wants to carry the mobile phone conveniently, the mobile phone with a folding screen can be folded, and the folding process can change the mobile phone form from the folding direction shown in fig. 1a according to the sequence of (1) the unfolding state, (2) the support state, and (3) the folding state. When a user wants to watch a video on a large screen, the folding screen mobile phone can be unfolded. As shown in fig. 1a, the folding screen mobile phone can be unfolded, and during the unfolding process, the folding screen mobile phone can change the mobile phone shape according to the sequence of (3) folding state, (2) support state, and (1) unfolding state shown in fig. 1 a.
To enhance the user experience with a folding screen handset, many developers have developed a range of functions associated with folding screens. For example, a function of adaptively enlarging display content after expansion and adaptively reducing display content after expansion is designed. For example, as shown in fig. 1b, when the folding-screen mobile phone is unfolded from (1) to (2) in fig. 1b, the interface for playing the video is adaptively enlarged and the playing task is still continued, and when the folding-screen mobile phone is folded from (2) in fig. 1b to (1), the interface for playing the video is adaptively reduced and the playing task is still continued.
Specifically, a series of functions related to the folding screen are many, and the description of the functions is omitted. While it is often necessary to obtain the hinge angle of a folding screen handset in the course of performing a series of functions associated with the folding screen. For example, as a folding screen mobile phone is unfolded or folded, an interface for playing a video needs to adaptively adjust a display size. Therefore, the folding screen mobile phone has a requirement for obtaining an accurate hinge angle. The hinge angle of the folding screen mobile phone refers to a folding included angle of the folding screen mobile phone. For example, the hinge angle shown in fig. 1a (2) is α.
At present, algorithms for calculating the hinge angle mainly include an algorithm for calculating the hinge angle by using an Acceleration sensor (ACC algorithm for short) and an algorithm for calculating the hinge angle by using a gyroscope sensor (Gyro algorithm for short).
However, when the common axis of the folding screen mobile phone (i.e. the virtual axis where the folding edge of the folding screen mobile phone is located) is perpendicular to the horizontal plane, the acceleration vector has no component in the x1o1z1 plane of the first screen coordinate system and no component in the x2o2z2 plane of the second screen coordinate system, and the hinge angle cannot be calculated through the acceleration vector, so that the hinge angle can only be calculated by using the Gyro algorithm. And the y1 axis of the first screen coordinate system and the y2 axis of the second screen coordinate system are parallel to or coincident with the common axis, so that the x1o1z1 plane and the x2o2z2 plane are the same plane.
However, with the increase of time for using the Gyro algorithm, the angular velocity error collected by the Gyro sensor is accumulated continuously, so that the calculated hinge angle error is larger and larger. For example, as shown in fig. 1c, fig. 1c is a graph of angle change of hinge angle detected by using ACC algorithm and Gyro algorithm. Specifically, the motion state of the folding screen mobile phone with the hinge angle of 67 degrees is changed from static to shaking, and finally, the folding screen mobile phone returns to static. As can be seen from fig. 1c, compared to the hinge angle calculated by the ACC algorithm shown in (1) of fig. 1c, the measured angle gradually deviates from the true value by 67 degrees with the increase of time under the side Gyro algorithm shown in (2) of fig. 1 c. Therefore, when the hinge angle is calculated by using the Gyro algorithm, the accuracy is low.
Therefore, in order to meet the requirement of obtaining an accurate hinge angle, the hinge angle detection method provided in the embodiment of the present application may be applied to foldable electronic devices such as a tablet Personal Computer, a notebook Computer, an Ultra-mobile Personal Computer (UMPC), a handheld Computer, and a netbook, in addition to a mobile phone with a foldable screen, that is, the hinge angle of any foldable electronic device may be calculated in the embodiment of the present application.
As shown in fig. 2a, the foldable electronic device 200 may include: a processor 210, a smart sensor hub 210A, a sensor module 220, a first gyro sensor 220A, a first acceleration sensor 220B, a second gyro sensor 220C, a second acceleration sensor 220D, a magnetic sensor 220E, a folding screen 230, an audio module 240, and a magnet 240A.
Among them, the first gyro sensor 220A, the first acceleration sensor 220B, and the magnetic sensor 220E may be disposed in the first body as shown in fig. 1a, and the second gyro sensor 220C, the second acceleration sensor 220D, and the magnet 240A may be disposed in the second body as shown in fig. 1 a.
It is to be understood that the illustrated structure of the present embodiment does not constitute a specific limitation to the foldable electronic device. In other embodiments, a foldable electronic device may include more or fewer components than shown, or combine certain components, or split certain components, or a different arrangement of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Processor 210 may include one or more processing units, such as: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), among others. The different processing units may be separate devices or may be integrated into one or more processors.
A smart Sensor hub (Sensor hub)210A may also be included in the processor 210 for interfacing with and processing data from various Sensor devices. For example, in this embodiment of the application, the smart sensor hub 210A may further connect and process data of the first gyro sensor 220A, the second gyro sensor 220C, and the magnetic sensor 220E, and execute the hinge angle detection method shown in fig. 5a according to the data of the sensors, where the specific execution process may refer to the following description of the hinge angle detection method shown in fig. 5a, and is not described herein again. In other embodiments, the smart sensor hub 210A is connected to and processes data of the first gyro sensor 220A, the first acceleration sensor 220B, the second gyro sensor 220C, the second acceleration sensor 220D, and the magnetic sensor 220E, and executes the hinge angle detection method shown in fig. 6a according to the data of the sensors, where the specific execution process may refer to the description of the hinge angle detection method shown in fig. 6a, and is not described herein again.
The folding screen 230 is used to display images, videos, and the like. The folding screen 230 may be understood to be a foldable flexible screen. The folding screen 230 includes a display panel. The display panel may adopt a Liquid Crystal Display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (active-matrix organic light-emitting diode, AMOLED), a flexible light-emitting diode (FLED), a miniature, a Micro-OLED, a quantum dot light-emitting diode (QLED), and the like. The folding screen 230 includes a first screen 230A and a second screen 230B. The folded screen 230 may be unfolded or folded along the folded edges to form a first screen 230A and a second screen 230B. The description of the first screen 230A and the second screen 230B may refer to the first screen and the second screen in fig. 1 a.
The first gyro sensor 220A may be used to determine a motion pose of the electronic device. For example, the angular velocities of the first screen about three axes of the first screen (i.e., the x1, y1, and z1 axes) may be determined by first gyro sensor 220A. In the present embodiment, first gyro sensor 220A may be used to determine the angular velocity of the first screen about the y1 axis of the first screen coordinate system (i.e., the common axis of the folded screens). The first gyro sensor 220A may also be used for photographing anti-shake.
The second gyro sensor 220C may also be used to determine the motion attitude of the electronic device. In the present embodiment, the angular velocities of the second screen about three axes of the second screen (i.e., the x2, y2, and z2 axes) may be determined by the second gyro sensor 220C. In the present embodiment, second gyro sensor 220C may be used to determine the angular velocity of the second panel about the y2 axis of the second panel (i.e., the common axis of the folded panels, with the y1 and y2 axes being the same axis). The second gyro sensor 220C may also be used for photographing anti-shake.
The first acceleration sensor 220B detects the magnitude of acceleration of the first screen in all directions (typically the three axes x1, y1, and z1 defined by the first screen). When the electronic device is stationary, the magnitude and direction of gravity can be detected. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The second acceleration sensor 220D detects the magnitude of acceleration of the second screen in various directions (typically the three axes x2, y2, and z2 defined by the second screen). When the electronic device is at rest, the magnitude and direction of gravity can be detected. The method can also be used for recognizing the posture of the electronic equipment, and is applied to horizontal and vertical screen switching, pedometers and other applications.
The magnetic sensor 220E detects the magnetic field intensity of the magnet 240A to obtain magnetic force data. In the embodiment of the present application, the magnetic sensor 220E is disposed in a body (first body) corresponding to the first screen. In this embodiment, the smart sensor hub 210A may detect the hinge angle of the foldable screen according to the magnetic data detected by the magnetic sensor 220E. The magnetic sensor 220E may sense magnetic field strength variations between 0 and 180 degrees, and the resolution of the magnetic sensor 220E may be dependent on the requirements of the application scenario, and may be less than 10 degrees, for example. In some embodiments, the magnetic sensor 220E may be a Hall sensor (Hall). Specifically, for the processing procedure of the magnetic data detected by the magnetic sensor 220E by the smart sensor hub 210A, reference may be made to relevant portions from step S501 to step S503 in the hinge angle detection method shown in fig. 5a and relevant portions from step S601 to step S603 shown in fig. 6a, which are not described herein again.
The magnet 240A is used to generate a magnetic field. In the embodiment of the present application, the magnet 240A is disposed in the body (second body) corresponding to the second screen. In some embodiments, magnet 240A may also be a speaker, since the speaker has a magnet therein. Speakers, also known as "horns," are used to convert electrical audio signals into sound signals. The electronic device may listen to music through a speaker or listen to a hands-free conversation. The magnet 240A may enable the magnetic sensor 220E to detect a magnetic force, and along with a change in an opening/closing state of the folding screen, a distance between the magnetic sensor 220E and the magnet 240A is correspondingly changed, a magnetic field strength of the magnet 240A detected by the magnetic sensor 220E is also changed, and then magnetic data collected by the magnetic sensor 220E is also changed accordingly, so that the intelligent sensing hub 210A may detect a hinge angle of the folding screen through the magnetic data detected by the magnetic sensor 220E.
For example, in some embodiments, if the foldable device shown in fig. 2a is a folding screen phone, the hardware layout inside the folding screen phone may be as shown in fig. 2 b. The first gyro sensor 220A, the first acceleration sensor 220B, and the magnetic sensor 220E are provided in the body corresponding to the first screen, and the second gyro sensor 220C, the second acceleration sensor 220D, and the magnet 240A are provided in the body corresponding to the second screen. The first gyro sensor 220A and the second gyro sensor 220C are disposed in parallel, and the first acceleration sensor 220B and the second acceleration sensor 220D are disposed in parallel, so that the y1 axis in the first screen coordinate system can be parallel to the y2 axis in the second screen coordinate system. The distance between the magnet 240A and the magnetic sensor 220E may be set to 2cm, depending on the application scenario requiring precision. Since the magnetic sensor 220E is easily interfered by an external magnetic field, the magnetic sensor 220E may not be placed at an edge position of the first screen.
It should be noted that, in other embodiments, for example, when the hinge angle detection method shown in fig. 4B is performed, the hardware inside the folding screen mobile phone may not include the first acceleration sensor 220B and the second acceleration sensor 220D.
In addition, an operating system runs on the above components. Such as an iOS operating system, an Android open source operating system, a Windows operating system, etc. An operating application may be installed on the operating system.
The operating system of the foldable electronic device 200 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiment of the application takes an Android system with a layered architecture as an example, and exemplifies a software structure of a foldable electronic device.
Fig. 3 is a block diagram of a software structure of a foldable electronic device according to an embodiment of the present application.
The layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, an application layer, an application framework layer, an Android runtime (Android runtime) and system library, and a kernel layer from top to bottom.
The application layer may include a series of application packages. As shown in fig. 3, the application package may include applications such as camera, gallery, calendar, phone call, map, navigation, WLAN, bluetooth, music, video, short message, etc.
The application framework layer provides an Application Programming Interface (API) and a programming framework for the application program of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 3, the application framework layers may include a window manager, content provider, view system, phone manager, resource manager, notification manager, and the like.
The window manager is used for managing window programs. The window manager can obtain the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
The view system includes visual controls such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
The phone manager is used to provide communication functions of the electronic device. Such as management of call status (including on, off, etc.).
The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and the like.
The notification manager enables the application to display notification information in the status bar, can be used to convey notification-type messages, can disappear automatically after a short dwell, and does not require user interaction. Such as a notification manager used to notify download completion, message alerts, etc. The notification manager may also be a notification that appears in the form of a chart or scroll bar text at the top status bar of the system, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window.
The Android Runtime comprises a core library and a virtual machine. The Android runtime is responsible for scheduling and managing an Android system.
The core library comprises two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. And executing java files of the application program layer and the application program framework layer into a binary file by the virtual machine. The virtual machine is used for performing the functions of object life cycle management, stack management, thread management, safety and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface managers (surface managers), Media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), angle algorithm modules, and closure detection algorithm modules, among others. In the embodiment of the present application, the angle algorithm module and the closing detection algorithm module are configured to cooperate to execute the hinge angle detection method shown in fig. 5a or fig. 6a, and in particular, refer to the related contents of the hinge angle detection method shown in fig. 5a and fig. 6 a.
The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
The media library supports a variety of commonly used audio, video format playback and recording, and still image files, among others. The media library may support a variety of audio-video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, and the like.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Although the Android system is taken as an example in the embodiment of the present application for description, the basic principle is also applicable to electronic devices based on an os, a hong meng, or Windows, or other operating systems.
For ease of understanding, the following related art principles are presented in relation to embodiments of the present application:
(1) a first screen coordinate system and a second screen coordinate system. As shown in FIG. 2b, the x1 and y1 axes of the first screen coordinate system x1y1z1 are parallel to or coincident with the length and width of the first screen, respectively, and the z1 axis is perpendicular to the plane of the first screen. The origin o1 selected for the first screen coordinate system may be selected at other locations on the first screen as the origin, in addition to the location shown in fig. 2 b. The second screen coordinate system x2y2z2 is also established in a similar manner to the first screen coordinate system, and will not be described herein again. When the selected origins of the first screen coordinate system and the second screen coordinate system coincide, the y1 axis and the y2 axis also coincide, and are virtual axes of the foldable electronic device where the folding edges are located (i.e. the common axes of the foldable electronic device).
(2) An algorithm for calculating the hinge angle by using an Acceleration sensor is called an Acceleration sensor (ACC) algorithm for short. The hinge angle is calculated by the ACC algorithm through acceleration data acquired by the acceleration sensor. The acceleration data may specifically be coordinates of an acceleration vector.
In particular, the hinge angle is calculated using the ACC algorithmThe principle is as follows: as shown in fig. 4a, the calculation of the hinge angle α of the foldable electronic device can be converted into the calculation of the normal vector of the plane where the first screen is located
Figure RE-GDA0003612484910000091
And the normal vector of the plane of the second screen
Figure RE-GDA0003612484910000092
The angle between them theta.
In a static state, the foldable electronic device is only subjected to gravity, and a gravity vector is equivalent to a Z axis of a terrestrial coordinate system, and a coordinate of the gravity vector in a mobile phone coordinate system (namely, a coordinate system of a first screen or a coordinate system of a second screen) is equivalent to a relative coordinate of the terrestrial coordinate system relative to the mobile phone coordinate system, so that the problem of calculating the hinge angle between the first screen and the second screen can be converted into the problem of calculating the included angle of the gravity vector (namely, a gravity acceleration vector) in the first screen coordinate system and the included angle of the gravity vector (namely, a gravity acceleration vector) in the second screen coordinate system.
Specifically, in a stationary state, an acceleration vector (i.e., a gravity acceleration vector) under a first screen coordinate system x1y1z1 acquired by the first acceleration sensor is (a) 1 ,B 1 ,C 1 ) The acceleration vector under the second screen coordinate system x2y2z2 acquired by the second acceleration sensor is (A) 2 ,B 2 ,C 2 ) Thus, A is 1 ,B 1 ,C 1 ,A 2 ,B 2 ,C 2 Substituting the first screen into a formula I, and calculating to obtain a normal vector of the first screen pi 1
Figure RE-GDA0003612484910000101
And the normal vector of the second screen
Figure RE-GDA0003612484910000102
The angle between them theta. The operation principle of the first acceleration sensor can be referred to the description of the first acceleration sensor 220B in fig. 2a, and the operation principle of the second acceleration sensor can be referred to the description of the first acceleration sensor 220D in fig. 2 a.
The first formula is as follows:
Figure RE-GDA0003612484910000103
wherein the hinge angle alpha is equal to 180-theta.
And because the y-axes of the first screen coordinate system and the second screen coordinate system are parallel, the formula I can be converted into the formula II, namely the projection vector (A) of the acceleration vector acquired by the first acceleration sensor on the x1o1z1 plane of the first screen coordinate system 1 ,C 1 ) And the projection vector (A) of the acceleration vector acquired by the second acceleration sensor on the x2o2z2 plane of the second screen coordinate system 2 ,C 2 ) And substituting the angle into a formula II, and calculating to obtain the hinge angle.
The second formula is
Figure RE-GDA0003612484910000104
Wherein the hinge angle alpha is equal to 180-theta.
The ACC algorithm may be in the form of an algorithm such as formula one or formula two, or may have other specific algorithm forms, which is not limited herein.
As can be seen from the second formula, when the gravity acceleration vector is parallel to or coincident with the common axis, the projection vector (A) of the acceleration vector acquired by the first acceleration sensor on the x1o1z1 plane of the first screen coordinate system 1 ,C 1 ) And the projection vector (A) of the acceleration vector acquired by the second acceleration sensor on the x2o2z2 plane of the second screen coordinate system 2 ,C 2 ) It will be 0 and therefore the hinge angle cannot be calculated.
(3) And (3) calculating the hinge angle by adopting a gyroscope sensor, which is called a gyroscope sensor (Gyro) algorithm for short. The Gyro algorithm is an algorithm for calculating the hinge angle through the angular velocity acquired by the gyroscope sensor. Specifically, as can be seen in fig. 2b, the y-axes of the first screen coordinate system and the second screen coordinate system are parallel or coincident (i.e., the axis of the folding edge), and only rotation along the y-axis will affect the size of the hinge angle. Therefore, when the hinge angle is calculated using the angular velocity, only the y-axis component can be integrated.
Specifically, for each sampling period, the angular velocity Gyroy1 of the first gyroscope sensor rotating around the y1 axis acquired in the sampling period, the angular velocity Gyroy2 of the second gyroscope sensor rotating around the y2 axis acquired in the sampling period, and the hinge angle a calculated in the previous sampling period are substituted into the formula three, and the current hinge angle α is calculated. The operation principle of the first gyro sensor may be described with reference to the first gyro sensor 220A in fig. 2a, and the operation principle of the second gyro sensor may be described with reference to the second gyro sensor 220C in fig. 2 a.
The third formula is: α ═ a + (Gyroy2-Gyroy1) × delatT. Where delatT is the value of the sampling period.
The Gyro algorithm may be in the form of an algorithm such as formula three, and may have other specific algorithm forms, which is not limited herein.
(4) And determining the hinge angle hAngle corresponding to the magnetic force data through the magnetic force data detected by the magnetic sensor. The length of the magnetic force vector is in negative correlation with the angle of the hinge. Specifically, as shown in fig. 4B, when the foldable screen 230 of the electronic device of fig. 2a is folded into the first screen 230A and the second screen 230B, the magnetic sensing line emitted by the magnet inside the magnet 240A passes through the magnetic sensor 220E, so that the magnetic sensor 220E collects the modulus length of the magnetic force vector. When the folding screen mobile phone is unfolded according to the sequence of (1), (2), and (3), the hinge angle between the first screen 230A and the second screen 230B gradually increases, and as can be seen from (1), (2), and (3) in fig. 4B, as the hinge angle increases, the number of magnetic induction lines passing through the magnetic sensor 220E decreases, and the module length of the magnetic vector detected by the magnetic sensor 220E decreases.
For example, as shown in table i, when the magnetic sensor 220E senses that the magnetic vector has a die length of 3500, the corresponding detected hinge angle is 5 degrees, when the magnetic vector has a die length of 3200, the corresponding hinge angle is 15 degrees, and when the magnetic vector has a die length of 500, the corresponding hinge angle is 180 degrees. Therefore, when the hinge angle hAngle corresponding to the magnetic data is determined through the magnetic data detected by the magnetic sensor, the corresponding hinge angle can be determined through the first lookup table only by reading the magnetic data detected by the magnetic sensor 220E.
Table one:
magnetic sensor senses the modular length of magnetic force vector Corresponding hinge angle
3500 5
3200 15
…… ……
500 180
It should be noted that the table is only one of correspondence tables between the die length of the magnetic force vector sensed by the magnetic sensor and the hinge angle, and if the distance between the magnetic sensor 220E and the magnet 240A is different, the placement position is different, and the like, the obtained correspondence table between the die length of the magnetic force vector and the hinge angle is also different. Specifically, the relationship between the magnetic data detected by the magnetic sensor and the hinge angle can be determined according to actual scene detection. It should be noted that the resolution in the relationship table between the magnetic force data and the hinge angle may be set arbitrarily. When the resolution is 10 degrees, i.e. every 10 degrees of hinge angle is changed, a corresponding magnetic force data is determined. The higher the resolution ratio is, the closer the hinge angle determined through the magnetic data is to a true value, and the resolution ratio can be specifically set according to the actual scene requirement.
(5) The fusion algorithm for calculating the hinge angle by adopting the gyroscope sensor and the magnetic sensor is called as the fusion algorithm of the gyroscope sensor and the magnetic sensor for short, namely, the Gyro + Hall fusion algorithm, and can be further called as the fusion algorithm for short in the embodiment of the application. The fusion algorithm is an algorithm for calculating the hinge angle by fusing the angular velocity data acquired by the gyro sensor and the hinge angle (hereinafter, referred to as "angle") determined by the magnetic force data acquired by the magnetic sensor. There are many fusion algorithms that can be used for fusing the angular velocity and the hAngle, for example, the hinge angle can be calculated by using the fusion angular velocity and the hAngle, such as complementary filtering, or kalman filtering.
A Gyro + Hall fusion algorithm model constructed based on Kalman filtering is as follows:
the estimation process comprises the following steps:
eAngle=eAngle+delatT×(Gyroy2-Gyroy1)
P=P+Q;
and (3) measurement calculation process:
K=P/(P+R);
eAngle=eAngle+K×(hAngle-eAngle);
P=(1-K)×P。
wherein, Gyroy1 is the angular velocity of the first gyro sensor rotating around the y1 axis collected in a certain sampling period, and Gyroy2 is the angular velocity of the second gyro sensor rotating around the y2 axis collected in the sampling period. delatT is the value of the sampling period. The eAngle is the hinge angle estimated by the hinge angle algorithm model, eAngle initially input into the model can be randomly assumed, for example, the hinge angle calculated last time can be used as eAngle, the value of eAngle can also be set to 0, and the value of eAngle tends to a fixed value after repeated iterative operation in the fusion algorithm model. P is an a priori estimated covariance, and P initially input into the model may be a number different from 0 between 0 and 1, and may be set arbitrarily, for example, may be set to 1 initially. Q is a process covariance equivalent to a system error inside a Gyro + Hall fusion algorithm model constructed based on kalman filtering, and is a fixed value that is preset empirically in advance, and may be, for example, 0.000001. R is a measurement error of a key parameter, which is equivalent to an error of an algorithm for calculating the hinge angle by using the acceleration sensor, and is a fixed value which is preset by experience, and may be, for example, 1.2. K is covariance, belongs to parameters generated in the internal operation process of the model, and does not need to be input into the model from the outside. The angle of the hinge is determined by magnetic data collected by the magnetic sensor, and the relationship between the magnetic data detected by the magnetic sensor and the angle of the hinge mentioned in (4) can be referred to in the process of specifically obtaining the angle.
In a Gyro + Hall fusion algorithm model constructed based on Kalman filtering, values of Q and R are preset, and a new eAngle and P can be estimated through a formula of an estimation calculation process by assuming that any eAngle and P are input into the model. eAngle and P can then be updated by measuring formulas in the calculation process. And iterating eAngle and P updated in the measurement and calculation process to a formula in the estimation and calculation process, and after iterating repeatedly for multiple times, outputting a relatively accurate hinge angle eAngle.
The Gyro + Hall fusion algorithm model constructed based on Kalman filtering has the advantages of simplicity in calculation, high efficiency and high convergence speed, and can be applied to any scene, and hinge angles can be accurately calculated whether electronic equipment is static or not and whether a common shaft is perpendicular to a horizontal plane or not. In addition, the hinge has the advantages of being capable of filtering out high-frequency and low-frequency interference, not depending on an accurate initial hinge angle and the like.
In the Gyro + Hall fusion algorithm, the hinge angle algorithm calculated by the gyroscope sensor is mainly used, the hinge angle hAngle determined by the magnetic sensor is fused, and an accurate hinge angle is calculated. No matter whether the public axis of folding electronic equipment is perpendicular to the horizontal plane, whether be in quiescent condition, do not influence the process of determining hinge angle hAngle through magnetic sensor yet, do not influence the data of the gyroscope sensor who gathers yet, consequently under arbitrary scene, can both compensate the error of Gyro algorithm through hAngle through Gyro + Hall fusion algorithm, in order to obtain more accurate hinge angle.
The method for detecting the hinge angle provided by the embodiment of the present application will be described below with specific reference to fig. 5a and 6 a.
Example one
Referring to fig. 5a, fig. 5a is a method for detecting a hinge angle according to an embodiment of the present application, which is applied to a foldable electronic device according to an embodiment of the present application, and includes the following steps:
s501, the closing detection algorithm module determines whether the folding screen is in a closing state or not according to the magnetic data.
The magnetic data are acquired through a magnetic sensor in the electronic equipment, and a corresponding relation exists between the magnetic data and the hinge angle of the folding screen. Through the magnetic data that magnetic sensor gathered, can determine a corresponding hinge angle, and then according to the hinge angle, determine whether folding screen is in the closed condition again.
The closed state refers to a state that the hinge angle of the folding screen is close to zero, and the non-closed state refers to a state that the hinge angle is larger than zero, and can also be considered as a state that the folding screen is opened. As shown in fig. 1a, when the folding screen is completely unfolded as shown in (1) in fig. 1a, the unfolded state of the folding screen is formed, i.e. not in the closed state, and after the folding screen is folded in the folding direction shown in (1), as shown in (2) in fig. 1a, the folding angle α of the folding screen is greater than zero, and when the folding screen is in the bracket state, the folding screen is also in the unfolded state, i.e. not in the closed state. As shown in (3) of fig. 1a, when the hinge angle α is almost zero, the first panel and the second panel are overlapped, and the closed state (or the folded state) is obtained.
In some embodiments, the magnetic force data may be a modulus length of the magnetic force vector. The closing detection algorithm module determines the current hinge angle through the corresponding relation between the die length of the magnetic force vector and the hinge angle, and then can determine whether the folding screen is in a closing state or not according to the determined hinge angle. In the process of determining the hinge angle through the magnetic data, the aforementioned magnetic data detected by the magnetic sensor can be referred to determine the relevant content of the hinge angle hang corresponding to the magnetic data, and details are not repeated here.
In some embodiments, when the determined hinge angle is greater than or equal to the first preset angle value, that is, the module length of the magnetic force vector is less than or equal to the first preset magnetic force value, it is determined that the folding screen is not in the closed state (that is, in the open state). For example, as shown in fig. 5b, the second preset angle may be set to 10 degrees, and the corresponding second preset magnetic force value is 1930. When the modular length of the magnetic force vector is smaller than or equal to 1930, the hinge angle is larger than or equal to 10 degrees, and the folding screen is determined not to be in the closed state.
In some embodiments, when the determined hinge angle is smaller than or equal to the second preset angle value, that is, the module length of the magnetic force vector is greater than or equal to the second preset magnetic force value, it is determined that the folding screen is in the closed state. For example, as shown in fig. 5b, a first preset angle value may be set to 5 degrees, and a corresponding first preset magnetic force value is 2800, that is, when the module length of the magnetic force vector is greater than or equal to 2800, it indicates that the hinge angle is less than or equal to 5 degrees, and it is determined that the folding screen is in the closed state. The first preset angle value and the second preset angle value may be equal or unequal. And then the first preset magnetic force value and the second preset magnetic force value can be equal or unequal.
If it is determined in step S501 that the foldable screen is not in the closed state, the angle algorithm module is required to start detecting the hinge angle of the foldable screen, so step S502 needs to be executed, and if it is determined in step S501 that the foldable screen is in the closed state, it indicates that the hinge angle of the foldable screen does not need to be detected, so step S503 needs to be executed.
It should be noted that step S501 is executed in real time or periodically, and step S501 may be executed after determining whether the folding screen is in the closed state each time step S502 or step S503 is executed, or may be executed after step S502 or step S503 is executed only when the determined state of the folding screen is changed (for example, the state is changed from the closed state to the non-closed state).
S502, the closing detection algorithm module informs the angle algorithm module of starting.
The angle algorithm module is started, and the angle algorithm module is started to detect the hinge angle of the folding screen. When the folding screen is not in the closed state (i.e. in the opened state), it turns out that it may be necessary to open the folding screen to implement functions (such as the functions presented in the scenes of fig. 1a and 1 b) that require the current posture of the folding screen to be detected, i.e. that the hinge angle of the folding screen needs to be known, and therefore an angle algorithm module is required to start detecting the hinge angle.
In some embodiments, the manner in which the closure detection algorithm module notifies the angle algorithm module of the start may be many, for example, by sending a start command to notify the angle algorithm module. For another example, the angle algorithm module may be notified by sending a start request. The specific manner of notifying the angle algorithm module is not limited.
The angle algorithm module starts detecting the hinge angle in response to the start notification of the closing detection algorithm module, and starts executing step S504. In some embodiments, the preparation process to initiate detection of the hinge angle may be: the method comprises the steps of creating a thread for executing hinge angle detection and controlling sensor starting work required in the process of starting the hinge angle detection. For example, the first gyro sensor 220A, the second gyro sensor 220C, and the magnetic sensor 220E shown in fig. 2a may be controlled to start operation.
S503, the closing detection algorithm informs the angle algorithm module to close.
The angle algorithm module is turned off, and the angle algorithm module stops detecting the hinge angle of the folding screen. When the folding screen is in a closed state, it is proved that any function requiring the use of the hinge angle is not required to be executed currently, so that the angle algorithm module can be informed to be closed, power consumption is saved, and operation efficiency is improved.
In some embodiments, the closing detection algorithm module notifies the angle algorithm module of the closing in many ways, for example, by sending a closing command. For another example, the angle algorithm module may be notified by sending a close request. The specific manner of notifying the angle algorithm module is not limited.
The angle algorithm module stops detecting the hinge angle in response to the closing notification of the closing detection algorithm module. In some embodiments, the process of closing the detection hinge angle may be: and finishing the thread of hinge angle detection, and controlling the sensor which is needed to be used in the process of starting the hinge angle detection to stop working, namely stopping collecting data by the sensor. For example, it may be possible to control the first gyro sensor 220A, the second gyro sensor 220C, and the magnetic sensor 220E shown in fig. 2 a. When the folding screen is in a closed state, the angle algorithm module does not work, the sensor required in the hinge angle detection process does not work, and hinge angle detection is stopped, so that power consumption is reduced, and operation efficiency is improved.
S504, the angle algorithm module obtains magnetic force data collected by the magnetic sensors, angular velocities around a common axis collected by the first gyroscope sensor, and angular velocities around the common axis collected by the second gyroscope sensor.
Because the closing detection algorithm module informs the angle algorithm module to start, the angle algorithm module starts to execute the detection process of the hinge angle, and each sensor in the electronic equipment also starts to work. Specifically, taking a process of detecting a hinge angle at a certain moment as an example: the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor in the electronic device report the acquired data to the angle algorithm module, and then the angle algorithm module acquires magnetic data acquired by the magnetic sensor, angular velocity around a common axis acquired by the first gyroscope sensor and angular velocity around the common axis acquired by the second gyroscope sensor from the reported data.
The process, specific content and reporting mode of reporting data by the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor may refer to the specification of an operating system such as an android or an IOS, and the embodiment of the present application is not limited herein.
In some embodiments, the functional descriptions of the magnetic sensor, the first gyro sensor and the second gyro sensor may refer to the related contents shown in fig. 2a, and the layout of the magnetic sensor, the first gyro sensor and the second gyro sensor in the electronic device may refer to fig. 2b, which is not described herein again.
And S505, the angle algorithm module determines the hinge angle corresponding to the magnetic data according to the magnetic data.
The magnetic sensor detects the magnetic field intensity of the magnet to obtain magnetic force data reflecting the magnetic force intensity of the magnet.
In some embodiments, the correspondence between the magnetic data and the hinge angle may be stored inside the electronic device, and after the angle algorithm module of the electronic device acquires the magnetic data acquired by the magnetic sensor, the hinge angle corresponding to the magnetic data may be determined according to the correspondence between the magnetic data and the hinge angle. The corresponding relationship between the magnetic force data and the hinge angle may be stored in a table form, such as the aforementioned table one, and may also be stored in other forms, and the embodiment of the present application is not limited.
Specifically, according to the magnetic data collected by the magnetic sensor, the process and the principle of determining the hinge angle corresponding to the magnetic data can refer to the following: the magnetic data detected by the magnetic sensor determines the relevant content of the hinge angle hAngle corresponding to the magnetic data, and the details are not repeated here.
In some embodiments, the magnetic sensor is the magnetic sensor 220E shown in fig. 2a, the magnet is the magnet 240A shown in fig. 2a, the layout of the magnetic sensor 220E and the magnet 240A in the electronic device may refer to the related content shown in fig. 2b, and the working principle of the magnetic sensor 220E and the magnet 240A may refer to the related content shown in fig. 2a, which is not described herein again.
Note that the hinge angle corresponding to the magnetic force data determined in step S505 is not the hinge angle of the electronic device detected by the final angle algorithm module, and the hinge angle corresponding to the magnetic force data needs to be calculated in step S506 by using a fusion algorithm.
S506, calculating the hinge angle of the electronic equipment by using a Gyro + Hall fusion algorithm according to the angular velocity around the common shaft acquired by the first gyroscope sensor, the angular velocity around the common shaft acquired by the second gyroscope sensor and the hinge angle corresponding to the magnetic data.
In some embodiments, the Gyro + Hall fusion algorithm may be a kalman filter algorithm, and specifically, the hinge angle of the electronic device may be calculated by using a Gyro + Hall fusion algorithm model constructed based on kalman filtering according to a preset process covariance Q, a preset key parameter measurement error R, an angular velocity around a common axis collected by the first Gyro sensor, an angular velocity around a common axis collected by the second Gyro sensor, a sampling period, and a hinge angle corresponding to the magnetic data. Illustratively, a preset process covariance Q, a preset key parameter measurement error R, an angular velocity around a common axis collected by a first gyroscope sensor, an angular velocity around the common axis collected by a second gyroscope sensor, and a hinge angle corresponding to magnetic data are input into a Gyro + Hall fusion algorithm model constructed based on Kalman filtering, and iteration is performed for N times, so that a hinge angle eAngle of the electronic device can be output and serves as a hinge angle currently detected by an angle algorithm module. The value of N may be set empirically, for example, when N is determined to be 150 times empirically, the error between the output eagle and the real hinge angle is small, that is, N may be set to 150.
In other embodiments, other types of Gyro + Hall fusion algorithms may be used to calculate the hinge angle of the electronic device by fusing the angular velocity about the common axis collected by the first Gyro sensor, the angular velocity about the common axis collected by the second Gyro sensor, and the hinge angle corresponding to the magnetic force data.
Specifically, the process and the principle of calculating the hinge angle of the electronic device by using the Gyro + Hall fusion algorithm may refer to the foregoing description of the fusion algorithm for calculating the hinge angle by using the gyroscope sensor and the magnetic sensor, and are not described herein again.
It should be noted that steps S504 to S506 are only processes for calculating the hinge angle once. In some embodiments, the steps S504 to S506 may be periodically executed according to a preset detection period, that is, the hinge angle of the electronic device is periodically calculated, so as to continuously provide the latest calculated hinge angle to the functional module of the electronic device that needs to use the hinge angle.
It should be noted that, in other embodiments, steps S501 to S503 may not be executed, that is, the angle algorithm module may also be in the activated state all the time, that is, the hinge angle is detected all the time.
As can be seen from the foregoing steps S504 to S506 of fig. 5a, the process of calculating the hinge angle by the angle algorithm module mainly includes acquiring data of the magnetic sensor, the first gyroscope sensor, and the second gyroscope sensor, and then calculating the hinge angle of the electronic device by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor, and the second gyroscope sensor. In other embodiments, the specific process of calculating the hinge angle through the fusion algorithm using the acquired data of the magnetic sensor, the first gyroscope sensor, and the second gyroscope sensor may be different from that of steps S504 to S506.
In the embodiment of the application, because the Gyro + Hall fusion algorithm can fuse the data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor, the accumulated error of the Gyro algorithm only using the data of the first gyroscope sensor and the second gyroscope sensor can be made up, and the hinge angle of the electronic device calculated by using the fusion algorithm is more accurate according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor. And when the hinge angle is calculated according to the data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor by using a fusion algorithm, the accuracy is not influenced by whether the horizontal axis is vertical to the horizontal plane or not, and the method and the device can be suitable for calculating the hinge angle in any scene.
Example two
Referring to fig. 6a, fig. 6a is a method for detecting a hinge angle, which is applied to a foldable electronic device provided in the embodiment of the present application, and specifically includes the following steps:
s601, the closing detection algorithm module determines whether the folding screen is in a closing state or not according to the magnetic data.
If the step S601 determines that the foldable screen is not in the closed state, the angle algorithm module is required to start to detect the hinge angle of the foldable screen, so that the step S602 is required to be executed, and if the step S601 determines that the foldable screen is in the closed state, it indicates that the hinge angle of the foldable screen is not required to be detected, so that the step S603 is required to be executed.
The execution principle and process of step S601 may refer to the foregoing description of step S501, and are not described herein again.
S602, the closing detection algorithm module informs the angle algorithm module of starting.
The execution principle and process of step S602 may refer to the foregoing description of step S502, and are not described herein again.
And S603, informing the angle algorithm module to close by the closing detection algorithm.
The execution principle and process of step S603 may refer to the foregoing description of step S503, and are not described herein again.
S604, the angle algorithm module judges whether the mobile terminal is in a static state.
When the angle algorithm module starts to detect the hinge angle of the folding screen mobile phone, the current motion state of the folding screen mobile phone needs to be judged first, so that a proper angle algorithm is selected to calculate the hinge angle. The static state in the embodiment of the present application may be understood as a relative static state, and in the static state, the folding screen mobile phone is equivalently subjected to only gravity.
As can be seen from (1) of fig. 1c, when the hinge is in the stationary state, the hinge angle can be accurately calculated by using the ACC algorithm, and therefore, when the angle algorithm module determines that the hinge is in the stationary state, it indicates that, among the ACC algorithm and the fusion algorithm, the ACC algorithm with higher calculation accuracy in the stationary state may be preferentially used to calculate the hinge angle. As can be seen from (1) in fig. 1c, the hinge angle cannot be accurately calculated by the ACC algorithm when the hinge is in a wobbling state (not in a stationary state), and when the angle algorithm module is not in a stationary state, it indicates that a fusion algorithm with higher accuracy should be preferentially used in the non-stationary state to calculate the hinge angle.
It should be noted that, in the static state, the reason why the hinge angle is calculated more accurately by using the ACC algorithm is that: as can be seen from the foregoing description of the Gyro algorithm, the Gyro algorithm needs to calculate the current hinge angle by the hinge angle a calculated in the previous sampling period. Therefore, if the Gyro algorithm is used for calculating the hinge angle, the initial hinge angle needs to be very accurate, and the error of the angular velocity acquired by the gyroscope sensor is more and more accumulated along with the increase of time. However, in the stationary state, when the hinge angle is calculated by using the ACC algorithm, there is no cumulative error, and particularly in the stationary state, the hinge angle calculated by using the ACC algorithm is relatively high in accuracy due to the influence of only the gravitational acceleration. In the non-static state, the ACC algorithm is low in precision, and the fusion algorithm is better than the Gyro algorithm in precision, so that the hinge angle can be calculated by preferentially using the fusion algorithm.
However, since a further determination is still required as to whether or not the hinge angle needs to be calculated using the ACC algorithm in the stationary state, if it is determined that the hinge angle is in the stationary state, S605 is executed. Similarly, in the non-stationary state, whether a fusion algorithm is needed to calculate the hinge angle still needs to be further determined, so if it is determined that the hinge is not in the stationary state, step S606 is executed.
And S605, judging whether the common axis is vertical to the horizontal plane by the angle algorithm module.
Wherein the common axis is the axis of the folded edge as shown in fig. 2b, and can also be understood as the y1 axis under the first screen coordinate system x1y1z1 or the y2 axis under the second screen coordinate system x2y2z 2. The horizontal plane refers to the horizontal plane in the terrestrial coordinate system.
After the static state is determined in step S604, it indicates that the ACC algorithm may be preferentially selected currently, but the ACC algorithm may accurately calculate the hinge angle when the common axis is not perpendicular to the horizontal plane, so it needs to further determine whether the common axis is perpendicular to the horizontal plane.
When the common axis is perpendicular to the horizontal plane and the step S604 further determines that the electronic device is in the static state, step S607 is performed. When the common axis is not perpendicular to the horizontal plane and it is determined in step 604 that the foldable screen mobile phone is in the stationary state, step S608 is executed.
In some embodiments, the manner of performing step S605 may be: and judging whether the common axis is vertical to the horizontal plane according to the component of the acceleration on the common axis. Specifically, the components of the acceleration vectors on the common axis are obtained by the acceleration sensors, for example, by the first acceleration sensor 220B or the second acceleration sensor 220D in fig. 2 a. If the component of the acceleration vector on the common axis (i.e., the component of the y1 axis in the first screen coordinate system, or the component of the y2 axis in the second screen coordinate system) is close to 9.8, it is determined that the common axis is perpendicular to the horizontal plane.
In some embodiments, it is determined that the common axis is perpendicular to the horizontal plane if the difference between the component of the acceleration vector on the common axis and the acceleration of gravity is less than or equal to a first predetermined value. And if the difference value between the component of the acceleration vector on the common axis and the gravity acceleration is larger than a first preset value, determining that the common axis is not vertical to the horizontal plane. Wherein the first preset value can be a number close to 0, and the value of the gravity acceleration is 9.8. And when the difference value between the component of the acceleration vector on the common axis and the gravity acceleration is less than or equal to a first preset value, considering that the component of the acceleration vector on the common axis is close to the gravity acceleration 9.8, and judging that the common axis is vertical to the horizontal plane. Since it is determined in step S604 that the vehicle is in a stationary state and is subjected to only gravity, when all values of the gravitational acceleration are on a common axis, it is indicated that the direction of gravity coincides with the common axis, and the common axis is perpendicular to the horizontal plane. On the contrary, when the difference between the component of the acceleration vector on the common axis and the gravity acceleration is greater than the first preset value, the component of the acceleration vector on the common axis is not close to the gravity acceleration, and the common axis is judged not to be vertical to the horizontal plane.
And S606, judging whether the hinge angle changes or not by the angle algorithm module.
When the angle algorithm module determines that the hinge angle is not changed and step S604 determines that the hinge is not in the static state, step S609 is executed, that is, the hinge angle is not recalculated. Although the accurate hinge angle can be calculated by preferentially using the fusion algorithm when the electronic device is not in the static state, the hinge angle can be directly taken as the hinge angle of the currently detected electronic device without calculating the hinge angle because the current hinge angle is not changed (namely the hinge angle calculated by the angle algorithm module for the last time).
When the angle algorithm module determines that the hinge angle has changed, step S610 is executed to calculate the hinge angle using the fusion algorithm.
In some embodiments, one way to perform step S606 is to: the angle algorithm module determines whether the hinge angle changes according to the angular speed acquired by the gyroscope sensor. Specifically, the change in angular velocity of the y-axis causes the hinge angle to change. Thus, in some embodiments, the angular algorithm module may obtain the angular velocity Gyroy1 of the rotation about the y1 axis collected by the first gyro sensor and obtain the angular velocity Gyroy2 of the rotation about the y2 axis collected by the second gyro sensor. When the difference between Gyroy2 and Gyroy1 is equal to zero (or close to zero), that is, the difference between Gyroy2 and Gyroy1 (angular velocity difference) and zero is less than or equal to the second preset value, it indicates that the hinge angle is not changed. Wherein the second preset value may be a value close to zero. On the contrary, when the difference between Gyroy1 and Gyroy2 is not equal to zero (or not close to zero), that is, the difference between Gyroy2 and Gyroy1 (angular velocity difference) and zero is greater than the second preset value, it indicates that the hinge angle is changed.
And S607, the angle algorithm module calculates the hinge angle of the electronic equipment by using a fusion algorithm.
Although the electronic device is determined to be in a stationary state in step S604 and the ACC algorithm may be preferentially used, the common axis is determined to be perpendicular to the horizontal plane in step S605 and is not suitable for the ACC algorithm, so that the hinge angle of the electronic device may be calculated by using the fusion algorithm. The process of calculating the hinge angle of the electronic device by using the fusion algorithm may refer to the related contents from step S504 to step S506 in fig. 5a, and the process of calculating the hinge angle by using the fusion algorithm is described in step S504 to step S506, which is not described herein again.
As can be seen from the foregoing description, when the angle algorithm module determines that the electronic device is in the resting state and the common axis is perpendicular to the horizontal plane, the hinge angle of the electronic device may be calculated by using the fusion algorithm, or the hinge angle may not be calculated again. To illustrate, the scenario shown in fig. 6b, the user places the common axis of the folded screen handset perpendicular to the horizontal plane and browses the folded screen handset. In the process of browsing the folding screen mobile phone by a user, the folding screen mobile phone is in a static state, and at the moment, the hinge angle is calculated by using a fusion algorithm in the folding screen mobile phone, or the hinge angle is not calculated again.
In other embodiments, when the angle algorithm module determines that the electronic device is in the stationary state and the common axis is not perpendicular to the horizontal plane, the hinge angle may not be recalculated, that is, the hinge angle calculated by the angle algorithm module last time may be used as the current hinge angle. Specifically, when the electronic device is in a stationary state, the hinge angle of the electronic device is not changed, and therefore the hinge angle may not be calculated.
And S608, the angle algorithm module calculates the hinge angle of the electronic equipment by using an ACC algorithm.
In some embodiments, when it is determined that the electronic device is in a stationary state and the common axis is not perpendicular to the horizontal plane, it may be preferable to calculate the hinge angle using the ACC algorithm. As can be seen from the foregoing description of fig. 1c, the accuracy of calculating the hinge angle by using the ACC algorithm in the static state is high, and the current common axis is not perpendicular to the horizontal plane, the first acceleration sensor can acquire the projection of the acceleration vector on the x1o1z1 plane of the first screen coordinate system, and the second acceleration sensor can acquire the projection of the acceleration vector on the x2o2z2 plane of the second screen coordinate system, so that the condition for using the ACC algorithm is satisfied.
For example, as shown in fig. 6c, the folding screen mobile phone is placed on the desktop by the user at rest, and the common axis is not perpendicular to the horizontal plane, and the hinge angle is calculated by the folding screen mobile phone using the ACC algorithm.
In some embodiments, the angular algorithm module obtains an acceleration vector (A) collected by the first acceleration sensor 1, B 1, C 1 ) And the acceleration vector (A) acquired by the second acceleration sensor 2 ,B 2 ,C 2 ) And substituting the obtained product into the aforementioned first formula to calculate cos theta, determining theta, and calculating the hinge angle by subtracting theta from 180 of the hinge angle alpha.
In other embodiments, since the y-axes of the first screen coordinate system and the second screen coordinate system are the same, the angle algorithm module may also obtain the projection (a) of the acceleration vector acquired by the first acceleration sensor on the x1o1z1 plane 1 ,C 1 ) And the projection (A) of the acceleration vector acquired by the second acceleration sensor on the x2o2z2 plane 2 ,C 2 ) And substituting the obtained result into the aforementioned second formula to calculate cos theta, determining theta, and calculating the hinge angle by subtracting theta from 180 of the hinge angle alpha.
Specifically, the technical principle of the ACC algorithm may refer to the foregoing description of the ACC algorithm, and is not described herein again. And the description of the first acceleration sensor and the second acceleration sensor can refer to the relevant parts shown in fig. 2a, and will not be described herein again. The layout of the first acceleration sensor and the second acceleration sensor inside the electronic device can also refer to fig. 2b, and is not described herein again.
In a static state, although the hinge angle is not changed, the hinge angle with high accuracy can be calculated by using an ACC algorithm, and when the hinge angle obtained before has an error, the accurate hinge angle can be calculated by using the ACC algorithm, so that the error in the calculation process before is corrected.
And S609, the angle algorithm module does not recalculate the hinge angle.
By judging whether the hinge is in the static state or not and judging whether the common axis is perpendicular to the horizontal plane or not, the hinge angle can be determined to be not in the static state, and the hinge angle can be calculated by using the fusion algorithm preferentially, but the hinge angle calculated last time can be directly used because the hinge angle of the folding screen does not need to be recalculated in the step S606, namely the current hinge angle is not calculated in the process of detecting the hinge angle at the current time, and the hinge angle calculated last time (or last time) is used as the currently detected hinge angle.
For example, as shown in fig. 6d, when the user holds the folding-screen mobile phone to watch the mobile phone while walking, the folding edge of the folding-screen mobile phone is not perpendicular to the horizontal plane, and although the folding-screen mobile phone is not in a static state, the user does not change the form of the folding-screen mobile phone, that is, the hinge angle is not changed, so that the folding-screen mobile phone does not recalculate the hinge angle in the scene shown in fig. 6 d.
S610, the angle algorithm module calculates the hinge angle of the electronic equipment by using a fusion algorithm.
By judging whether the hinge is in a static state or not and judging whether the common axis is perpendicular to the horizontal plane or not, the algorithm which is suitable for determining that the hinge is not in the static state at present is a fusion algorithm, and the change of the current hinge angle is determined by judging whether the hinge angle is changed or not, so that the hinge angle needs to be calculated by using the fusion algorithm.
For example, as shown in fig. 6e, when the user is opening the folding screen mobile phone during walking, the folding screen mobile phone is not in a static state, and the hinge angle is changed, so the folding screen mobile phone calculates the hinge angle by using a fusion algorithm.
It should be noted that, when it is determined that the electronic device is not in the stationary state, the reason why the fusion algorithm may be used is as follows: as can be seen from fig. 1c, when the hinge is not in a static state, the hinge angle is not accurately calculated by using the ACC algorithm, but errors are accumulated over time in the Gyro algorithm, and the Gyro algorithm is not suitable for calculating the hinge angle. As can be known from the foregoing description of the fusion algorithm, the hinge angle hang determined by the fusion algorithm through the magnetic data can make up for the error of the Gyro algorithm, so that when the hinge angle of the electronic device is calculated by using the Gyro + Hall fusion algorithm, a more accurate hinge angle can be obtained.
Specifically, the process of calculating the hinge angle of the electronic device by using the fusion algorithm may refer to the related contents of step S504 to step S506 in fig. 5a, and the process of calculating the hinge angle by using the fusion algorithm is described in step S504 to step S506, which is not described herein again.
It should be noted that steps S604 to S610 are only processes for calculating the hinge angle once. In some embodiments, the steps S604 to S610 may be periodically performed according to a preset detection period, that is, the hinge angle of the electronic device is periodically calculated, so as to continuously provide the latest calculated hinge angle to the functional module of the electronic device that needs to use the hinge angle.
It should be noted that, in other embodiments, steps S601 to S603 may not be executed, that is, the angle algorithm module may also be in the activated state all the time, that is, the hinge angle is detected all the time.
As can be seen from the foregoing steps S604 to S610, in this embodiment of the application, the angle algorithm module determines the current motion state (i.e., whether the current motion state is in a static state) through step S604, and determines the relative position relationship between the common axis of the folding screen and the horizontal plane (i.e., whether the common axis is perpendicular to the horizontal plane) through step S605, so that a target algorithm (i.e., a hinge angle algorithm with higher calculation accuracy in the current scene) can be determined from the ACC algorithm and the fusion algorithm according to the current motion state and the relative position relationship between the common axis and the horizontal plane, so as to improve the accuracy of detecting the hinge angle. Specifically, when the hinge is in a static state and the common axis is not perpendicular to the horizontal plane, the hinge angle is calculated using the ACC algorithm as a target algorithm. When in the static state and the common axis is perpendicular to the horizontal plane, the hinge angle is calculated using the fusion algorithm as the target algorithm. When the hinge is not in a static state, the hinge angle can be calculated by using a fusion algorithm as a target algorithm.
As can be seen from steps S606 to S610, in some embodiments, when the hinge is not in the static state, the hinge angle may be calculated by using the fusion algorithm as the target algorithm only when the hinge angle changes. If the hinge angle is not changed, the hinge angle can not be calculated, so that the power consumption caused by operation is saved, and the efficiency is improved.
In the embodiment of the application, a target algorithm (namely, a hinge angle algorithm with higher calculation accuracy in the current scene) is determined according to the current motion state and the relative position relationship between the common axis and the horizontal plane, and when the determined target algorithm is a fusion algorithm, the hinge angle is calculated by using the fusion algorithm, so that the fusion algorithm is used in the applicable scene, and the accuracy of detecting the hinge angle is improved.

Claims (17)

1. The utility model provides a detection method of hinge angle, its characterized in that is applied to folding electronic equipment, folding screen of folding electronic equipment includes first screen and second screen, the organism that first screen corresponds is provided with first gyroscope sensor and magnetic sensor, the organism that the second screen corresponds is provided with second gyroscope sensor and magnet, magnetic sensor is used for detecting the magnetic field intensity of magnet, the detection method of hinge angle includes:
acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor;
and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
2. The utility model provides a detection method of hinge angle, its characterized in that is applied to folding electronic equipment, folding screen of folding electronic equipment includes first screen and second screen, the organism that first screen corresponds is provided with first gyroscope sensor, magnetic sensor and first acceleration sensor, the organism that the second screen corresponds is provided with second gyroscope sensor, magnet and second acceleration sensor, magnetic sensor is used for detecting the magnetic field intensity of magnet, the detection method of hinge angle includes:
determining a target algorithm according to the motion state of the electronic equipment and the relative position of the common shaft and the horizontal plane; wherein the target algorithm at least comprises: a fusion algorithm, or an acceleration sensor algorithm; wherein the common axis is an axis of a folded edge of the folded screen;
if the determined target algorithm is the fusion algorithm, acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor;
and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the acquired data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
3. The hinge angle detection method according to claim 2, wherein the motion state of the electronic device includes: at rest or not; the relative position of the common axis to the horizontal plane comprises: the common axis is perpendicular to the horizontal plane or the common axis is not perpendicular to the horizontal plane.
4. The hinge angle detection method of claim 3, wherein the determining the motion state of the electronic device comprises:
if the difference value between the modular length of the acceleration vector of the electronic equipment and the gravity acceleration is smaller than or equal to a first preset value, determining that the motion state of the electronic equipment is a static state;
and if the difference value between the modular length of the acceleration vector and the gravity acceleration is larger than the first preset value, determining that the motion state of the electronic equipment is not in a static state.
5. A method for detecting a hinge angle according to claim 3 or 4, wherein said determining the relative position of the common axis to the horizontal comprises:
if the difference value between the component of the acceleration vector on the common axis and the gravity acceleration is smaller than or equal to a first preset value, determining that the common axis is vertical to the horizontal plane;
and if the difference value between the component of the acceleration vector on the common axis and the gravity acceleration is greater than the first preset value, determining that the common axis is not vertical to the horizontal plane.
6. The method for detecting the hinge angle according to any one of claims 3 to 5, wherein the determining a target algorithm according to the motion state of the electronic device and the relative position of the common axis and the horizontal plane comprises:
if the electronic equipment is in a static state and the common axis is not vertical to the horizontal plane, determining the acceleration sensor algorithm as a target algorithm;
if the electronic equipment is not in a static state, determining the target algorithm as a fusion algorithm;
and if the electronic equipment is in a static state and the common axis is vertical to the horizontal plane, determining the target algorithm as a fusion algorithm.
7. The method for detecting a hinge angle according to any one of claims 2 to 6, wherein if the determined target algorithm is the fusion algorithm and it is determined that the hinge angle has changed, data of the magnetic sensor, the first gyro sensor, and the second gyro sensor is acquired.
8. The method for detecting the hinge angle according to claim 7, wherein the determining that the hinge angle has changed comprises:
if the difference value between the angular speed difference and zero is larger than a second preset value, determining that the angle of the hinge changes; wherein the difference in angular velocity is a difference between an angular velocity of the first gyro sensor about a common axis and an angular velocity of the second gyro sensor about the common axis.
9. The hinge angle detection method according to any one of claims 2 to 8, further comprising:
and if the determined target algorithm is an acceleration algorithm, calculating the hinge angle of the electronic equipment by using the acceleration algorithm.
10. The hinge angle detection method of claim 9, wherein the calculating a hinge angle of the electronic device using an acceleration algorithm comprises:
calculating the hinge angle of the electronic equipment by using an acceleration sensor algorithm according to the projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system and the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system; the projection vector of the acceleration vector on the x1o1z1 plane of the first screen coordinate system is acquired by a first acceleration sensor; the projection vector of the acceleration vector on the x2o2z2 plane of the second screen coordinate system is acquired by the second acceleration sensor.
11. The method for detecting the hinge angle according to any one of claims 1 to 10, wherein the calculating the hinge angle of the electronic device using a fusion algorithm based on the acquired data of the magnetic sensor, the first gyro sensor, and the second gyro sensor includes:
determining a hinge angle corresponding to the magnetic data according to the magnetic data acquired by the magnetic sensor;
and calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the hinge angle corresponding to the magnetic data, the angular velocity around the common axis and acquired by the first gyroscope sensor and the angular velocity around the common axis and acquired by the second gyroscope sensor.
12. The hinge angle detection method according to claim 11, wherein the calculating a hinge angle of the electronic device using a fusion algorithm based on the hinge angle corresponding to the magnetic data, the angular velocity about the common axis acquired by the first gyro sensor, and the angular velocity about the common axis acquired by the second gyro sensor comprises:
calculating the hinge angle of the electronic equipment by using a fusion algorithm according to the process covariance, the measurement error of the key parameter, the sampling period, the hinge angle corresponding to the magnetic data, the angular velocity around the common axis and acquired by the first gyroscope sensor and the angular velocity around the common axis and acquired by the second gyroscope sensor; wherein the fusion algorithm is based on a Kalman filtering configuration.
13. The method for detecting a hinge angle according to any one of claims 1 to 12, wherein the acquiring data of the magnetic sensor, the first gyro sensor, and the second gyro sensor includes:
and if the folding screen is determined not to be in the closed state, acquiring data of the magnetic sensor, the first gyroscope sensor and the second gyroscope sensor.
14. The hinge angle detection method of claim 13, wherein the determining that the foldable screen is not in the closed state comprises:
and determining that the folding screen is not in a closed state according to the magnetic data.
15. The hinge angle detection method of claim 14, wherein determining that the foldable screen is not in the closed state based on the magnetic data comprises:
and if the magnetic force data is smaller than or equal to the first preset magnetic force value, determining that the folding screen is not in the closed state.
16. The method for detecting the hinge angle according to any one of claims 1 to 15, further comprising:
and if the folding screen is determined to be in the closed state, controlling a sensor in the electronic equipment not to be in the working state.
17. A foldable electronic device, comprising:
a folding screen comprising a first screen and a second screen; the machine body corresponding to the first screen is provided with a first gyroscope sensor and a magnetic sensor, the machine body corresponding to the second screen is provided with a second gyroscope sensor and a magnet, and the magnetic sensor is used for detecting the magnetic field intensity of the magnet;
one or more processors;
a memory having a program stored thereon;
the program, when executed by the one or more processors, causes the foldable electronic device to perform a hinge angle detection method according to any one of claims 1 to 16.
CN202111398158.5A 2021-11-19 2021-11-19 Hinge angle detection method and related equipment Active CN115077460B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310316673.7A CN116399283B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment
CN202111398158.5A CN115077460B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111398158.5A CN115077460B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN202310316673.7A Division CN116399283B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment

Publications (2)

Publication Number Publication Date
CN115077460A true CN115077460A (en) 2022-09-20
CN115077460B CN115077460B (en) 2023-05-09

Family

ID=83246007

Family Applications (2)

Application Number Title Priority Date Filing Date
CN202310316673.7A Active CN116399283B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment
CN202111398158.5A Active CN115077460B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment

Family Applications Before (1)

Application Number Title Priority Date Filing Date
CN202310316673.7A Active CN116399283B (en) 2021-11-19 2021-11-19 Hinge angle detection method and related equipment

Country Status (1)

Country Link
CN (2) CN116399283B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116592756A (en) * 2023-07-17 2023-08-15 荣耀终端有限公司 Detection method for included angle of folding screen and electronic equipment
CN117630414A (en) * 2024-01-25 2024-03-01 荣耀终端有限公司 Acceleration sensor calibration method, folding electronic device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840061A (en) * 2019-01-31 2019-06-04 华为技术有限公司 The method and electronic equipment that control screen is shown
CN110536004A (en) * 2019-07-23 2019-12-03 华为技术有限公司 Multisensor is applied to the method and electronic equipment of the electronic equipment with flexible screen
WO2021128245A1 (en) * 2019-12-27 2021-07-01 Intel Corporation Hinge angle detection
WO2021147712A1 (en) * 2020-01-21 2021-07-29 华为技术有限公司 Display method for foldable screen, and related apparatus

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2801389B1 (en) * 2013-05-08 2022-06-08 Consejo Superior De Investigaciones Científicas (CSIC) Neuroprosthetic device for monitoring and suppression of pathological tremors through neurostimulation of the afferent pathways
CN204706119U (en) * 2015-07-04 2015-10-14 王旭尧 A kind of intelligent anti-theft alarm device that can identify angle
KR20170092359A (en) * 2016-02-03 2017-08-11 주식회사 아큐랩 System for detecting 3-axis position information using 3-dimention rotation motion sensor
CN113804191B (en) * 2016-11-17 2024-03-19 格兰菲智能科技有限公司 Mobile device and method for calculating gesture of mobile device
IT201700057066A1 (en) * 2017-05-25 2018-11-25 St Microelectronics Srl PROCESSING SYSTEM IMPLEMENTING AN ALGORITHM FOR THE MERGER OF DATA FROM INERTIAL SENSORS, AND METHOD
CN108848321B (en) * 2018-09-28 2021-03-19 南昌努比亚技术有限公司 Exposure optimization method, device and computer-readable storage medium
CN111121705A (en) * 2019-05-07 2020-05-08 浙江利尔达客思智能科技有限公司 System and method for detecting door opening state based on six-axis detection
WO2020256168A1 (en) * 2019-06-18 2020-12-24 엘지전자 주식회사 Mobile terminal
CN113418493B (en) * 2021-07-23 2024-02-27 广东工业大学 Method for auxiliary measurement of angle of servo motor based on gyroscope

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109840061A (en) * 2019-01-31 2019-06-04 华为技术有限公司 The method and electronic equipment that control screen is shown
WO2020155876A1 (en) * 2019-01-31 2020-08-06 华为技术有限公司 Screen display control method and electronic device
CN110536004A (en) * 2019-07-23 2019-12-03 华为技术有限公司 Multisensor is applied to the method and electronic equipment of the electronic equipment with flexible screen
WO2021128245A1 (en) * 2019-12-27 2021-07-01 Intel Corporation Hinge angle detection
WO2021147712A1 (en) * 2020-01-21 2021-07-29 华为技术有限公司 Display method for foldable screen, and related apparatus

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116592756A (en) * 2023-07-17 2023-08-15 荣耀终端有限公司 Detection method for included angle of folding screen and electronic equipment
CN116592756B (en) * 2023-07-17 2023-10-20 荣耀终端有限公司 Detection method for included angle of folding screen and electronic equipment
CN117630414A (en) * 2024-01-25 2024-03-01 荣耀终端有限公司 Acceleration sensor calibration method, folding electronic device and storage medium
CN117630414B (en) * 2024-01-25 2024-05-24 荣耀终端有限公司 Acceleration sensor calibration method, folding electronic device and storage medium

Also Published As

Publication number Publication date
CN116399283A (en) 2023-07-07
CN115077460B (en) 2023-05-09
CN116399283B (en) 2023-10-24

Similar Documents

Publication Publication Date Title
CN116399283B (en) Hinge angle detection method and related equipment
US9898161B2 (en) Method and apparatus for controlling multitasking in electronic device using double-sided display
JP2018523243A (en) Device and method for processing touch input based on its strength
US20080150921A1 (en) Supplementing and controlling the display of a data set
WO2021169992A1 (en) Content presentation method and apparatus, terminal device, and computer-readable storage medium
KR20210101684A (en) Electronic device for providing execution screen of application and method for operating thereof
US20120221317A1 (en) Operating system and method based on sensor data
WO2021052035A1 (en) Display method for side region of screen, and electronic apparatus
WO2023087832A1 (en) Hinge angle detection method and related device
CN113409427A (en) Animation playing method and device, electronic equipment and computer readable storage medium
WO2022089407A1 (en) Display method and electronic device
US20180089131A1 (en) Physical configuration of a device for interaction mode selection
WO2021098460A1 (en) Screenshot display method and apparatus, and terminal device
US10852836B2 (en) Visual transformation using a motion profile
WO2022062949A1 (en) Dynamic element control method, electronic device and computer-readable storage medium
CN116225274A (en) Identification method and device for touch operation, electronic equipment and storage medium
WO2024066976A1 (en) Control display method and electronic device
CN116708615B (en) Device registration method, device registration apparatus and storage medium
CN113821153B (en) Gesture navigation method, electronic device and readable storage medium
CN116033051B (en) Folding angle detection method and device for folding screen and readable storage medium
WO2023072113A1 (en) Display method and electronic device
CN117376694B (en) Time synchronization method
US20230400975A1 (en) Thermal management of an electronic device
CN116071523A (en) Display method and electronic equipment
WO2024067601A1 (en) Window switching method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant