Folding angle determining method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of electronic equipment, in particular to a method and a device for determining a folding angle, electronic equipment and a storage medium.
Background
With the continuous development of electronic devices, more and more electronic devices with display screens, such as mobile phones, tablet computers, and the like, are widely applied to daily life and work of people, and change the life and working modes of people. In order to provide better use experience for people, the appearance of the electronic equipment is changed greatly, and particularly in the aspect of screens, the screen of the electronic equipment can have portability while being larger and larger due to the use of the folding screen, so that numerous imagination is brought to the future form of the electronic equipment, and the development direction of the future electronic equipment is provided.
At present, when the foldable screen is actually used, the folding angle of the foldable screen determines the display state of the foldable screen, in other words, in order to determine the display state of the foldable screen, it is often necessary to determine the folding angle of the foldable screen first, for example, when the foldable screen is unfolded or folded to 90 °, the foldable screen correspondingly enters into one display state, and when the foldable screen is unfolded or folded to 120 °, the foldable screen correspondingly enters into another display state.
In the prior art, a folding angle of a folding screen is calculated through ultrasonic waves, as shown in fig. 1, an ultrasonic transmitter (e.g., a receiver) in one of the folding screens transmits ultrasonic waves, and the ultrasonic waves are received by an ultrasonic receiver (e.g., a microphone) in the other of the folding screens, so that a linear distance c between the ultrasonic transmitter and the ultrasonic receiver is measured, and then a trigonometric function relation is calculated between the linear distance c and a side length (i.e., a side length a and a side length b in fig. 1) of each screen, so that an included angle between the two screens, i.e., the folding angle of the folding screen, can be finally obtained.
However, the above solution has obvious disadvantages: the ultrasonic ranging is easily interfered by external human factors, and when dirt is attached to an ultrasonic transmitting end or the ultrasonic transmitting end is shielded in the folding process, the measured linear distance c is inaccurate, so that the calculation of the folding angle of the folding screen is influenced.
Therefore, a new scheme for accurately acquiring the folding angle of the folding screen is needed.
Disclosure of Invention
The invention provides a method and a device for determining a folding angle, electronic equipment and a storage medium, which are used for solving the defects of the prior art.
In order to achieve the above purpose, the present invention provides the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for determining a folding angle, which is applied to an electronic device having a folding screen, where the folding screen is foldable to form a first display screen and a second display screen, a first acceleration sensor is disposed in the first display screen, and a second acceleration sensor is disposed in the second display screen, where the method includes:
acquiring a first included angle between a first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between a second display screen detected by the second acceleration sensor and the horizontal line in the same direction;
and calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
Further, in the method for determining a folding angle, the step of calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle includes:
calculating the obtained first included angle and the second included angle according to the following formula, and determining the folding angle of the folding screen:
the folding angle | second included angle — first included angle |;
the folding angle is an angle between the first display screen and the second display screen.
Further, in the method for determining the folding angle, before the step of obtaining a first angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction, the method further includes:
receiving the unfolding or folding operation of a user on the folding screen;
correspondingly, the step of obtaining a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction comprises:
and responding to the unfolding or folding operation of the folding screen by a user, and acquiring a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction.
In a second aspect, an embodiment of the present invention provides a device for determining a folding angle, which is applied to an intelligent electronic device having a folding display screen, where the folding display screen is foldable to form a first display screen and a second display screen, a first acceleration sensor is disposed in the first display screen, and a second acceleration sensor is disposed in the second display screen, where the device includes:
the acquisition module is used for acquiring a first included angle between a first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between a second display screen detected by the second acceleration sensor and the horizontal line in the same direction;
and the calculating module is used for calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
Further, in the device for determining a folding angle, the calculating module is specifically configured to:
calculating the obtained first included angle and the second included angle according to the following formula, and determining the folding angle of the folding screen:
the folding angle | second included angle — first included angle |;
the folding angle is an angle between the first display screen and the second display screen.
Further, the device for determining the folding angle further comprises:
the receiving module is used for receiving the unfolding or folding operation of the folding screen by a user;
correspondingly, the obtaining module is specifically configured to:
and responding to the unfolding or folding operation of the folding screen by a user, and acquiring a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction.
In a third aspect, an embodiment of the present invention provides an electronic device, where the electronic device includes:
one or more controllers;
a memory for storing one or more programs;
the one or more programs are executed by the one or more controllers, so that the one or more controllers implement the method for determining a folding angle according to any of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer program is stored, where the computer program is executed by a processor to implement the method for determining a folding angle according to any one of the embodiments of the present invention.
According to the folding angle determining method and device, the electronic device and the storage medium provided by the embodiment of the invention, the folding angle of the folding screen can be finally calculated and determined based on the angle relationship between the first included angle and the second included angle by acquiring the first included angle between the first display screen detected by the first acceleration sensor and the horizontal line and the second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction, so that the folding angle determining method and device have the characteristics of no fear of external environment interference, quick and accurate calculation result and the problem of inaccurate calculation result of the folding angle due to the easiness of external interference in the prior art is solved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
FIG. 1 is a schematic diagram of a prior art configuration for calculating a folding angle of a folding screen;
fig. 2 is a schematic flow chart of a method for determining a folding angle according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram for calculating a folding angle of a folding screen according to a solution provided in an embodiment of the present invention.
Fig. 4 is a schematic flowchart of a method for determining a folding angle according to a second embodiment of the present invention;
fig. 5 is a schematic structural diagram of a folding angle determining apparatus according to a third embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Referring to fig. 2, a schematic flow chart of a method for determining a folding angle according to an embodiment of the present invention is shown, where the method is applied to a scenario where a user determines a folding angle of a folding screen when unfolding or folding the folding screen, and is applied to an electronic device with the folding screen, as shown in fig. 3, the folding screen is foldable to form a first display screen and a second display screen, a first acceleration sensor a is disposed in the first display screen, a second acceleration sensor B is disposed in the second display screen, and the method is performed by a device for determining a folding angle, which may be implemented by software and/or hardware and is integrated inside the electronic device.
The method specifically comprises the following steps:
s101, a first included angle between a first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between a second display screen detected by the second acceleration sensor and the horizontal line in the same direction are obtained.
Wherein the first included angle is illustrated in fig. 2 as α, the second included angle is illustrated in fig. 2 as β, and the fold angle is illustrated in fig. 2 as γ.
It should be noted that, in the electronic devices with foldable screens on the market, one part may be provided with an acceleration sensor only in one screen, and the other part is provided with an acceleration sensor in both screens; the scheme provided by the embodiment can be directly applied to the electronic equipment with the acceleration sensors built in the two screens, and the scheme provided by the embodiment can be applied to the electronic equipment with the acceleration sensor built in only one screen only by adding one acceleration sensor in the other screen on the original basis.
Acceleration sensors, also known as gravity sensors, are mainly used to detect changes in forces due to falls, tilts, movements, positioning, vibrations, impacts and the like, and are currently used in electronic devices for functions such as step counting, automatic rotation of screens, and bright screen when the wrist is lifted.
Specifically, the present embodiment determines an included angle between the display screen and the horizontal line by using an angle value conversion principle of the three-axis acceleration sensor.
S102, calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
Specifically, the step S102 further includes:
calculating the obtained first included angle alpha and the second included angle beta according to the following formula, and determining the folding angle gamma of the folding screen:
fold angle γ ═ second angle β — first angle α |;
wherein the folding angle γ is an angle between the first display screen and the second display screen.
In this embodiment, the electronic device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
According to the folding angle determining method provided by the embodiment of the invention, the folding angle of the folding screen can be finally calculated and determined based on the angle relationship between the first included angle and the second included angle by acquiring the first included angle between the first display screen detected by the first acceleration sensor and the horizontal line and the second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction, so that the folding angle determining method has the characteristics of no fear of external environment interference and quick and accurate calculation result, and solves the problem of inaccurate calculation result of the folding angle caused by the easiness of external interference in the prior art.
Example two
Fig. 4 is a schematic flowchart of a method for determining a folding angle according to a second embodiment of the present invention, which is based on the first embodiment and is optimized before step S101, and accordingly, step S101 is also improved. The same or corresponding terms as those in the above embodiments are not repeated herein, and specifically, referring to fig. 4, the method includes:
s201, receiving unfolding or folding operation of a user on the folding screen;
it should be noted that, generally, only when the foldable screen is unfolded or folded, the folding angle of the foldable screen needs to be determined in consideration of determining the display state of the foldable screen, so the embodiment is set to perform the calculation and determination of the folding angle of the foldable screen only when the unfolding or folding operation of the foldable screen by the user is received, so as to save the system process and the power consumption.
S202, responding to the unfolding or folding operation of the folding screen by the user, and acquiring a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction.
S203, calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
According to the folding angle determining method provided by the embodiment of the invention, the folding angle of the folding screen can be finally calculated and determined based on the angle relationship between the first included angle and the second included angle by acquiring the first included angle between the first display screen detected by the first acceleration sensor and the horizontal line and the second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction, so that the folding angle determining method has the characteristics of no fear of external environment interference and quick and accurate calculation result, and solves the problem of inaccurate calculation result of the folding angle caused by the easiness of external interference in the prior art.
EXAMPLE III
Referring to fig. 5, a schematic structural diagram of a device for determining a folding angle according to a third embodiment of the present invention is shown, where the device is applied to an intelligent electronic device having a foldable display screen, the foldable display screen is foldable to form a first display screen and a second display screen, a first acceleration sensor is disposed in the first display screen, and a second acceleration sensor is disposed in the second display screen. The device specifically comprises the following modules:
an obtaining module 51, configured to obtain a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line, and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction;
and a calculating module 52, configured to calculate and determine a folding angle of the folding screen based on the first included angle and the second included angle.
Preferably, the calculation module 52 is specifically configured to:
calculating the obtained first included angle and the second included angle according to the following formula, and determining the folding angle of the folding screen:
the folding angle | second included angle — first included angle |;
the folding angle is an angle between the first display screen and the second display screen.
Preferably, the device for determining the folding angle further includes:
the receiving module is used for receiving the unfolding or folding operation of the folding screen by a user;
correspondingly, the obtaining module 51 is specifically configured to:
and responding to the unfolding or folding operation of the folding screen by a user, and acquiring a first included angle between the first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction.
According to the folding angle determining device provided by the embodiment of the invention, the folding angle of the folding screen can be finally calculated and determined based on the angle relationship between the first included angle and the second included angle by acquiring the first included angle between the first display screen detected by the first acceleration sensor and the horizontal line and the second included angle between the second display screen detected by the second acceleration sensor and the horizontal line in the same direction, so that the folding angle determining device has the characteristics of no fear of external environment interference and quick and accurate calculation result, and solves the problem of inaccurate calculation result of the folding angle caused by the easiness in external interference in the prior art.
Example four
Fig. 6 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention. The electronic device 12 shown in fig. 6 is only an example and should not bring any limitation to the function and the scope of use of the embodiment of the present invention.
As shown in FIG. 6, electronic device 12 is embodied in the form of a general purpose computing device. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
Bus 18 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 12 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 12 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
Electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), with one or more devices that enable a user to interact with electronic device 12, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 12 to communicate with one or more other computing devices. Such communication may be through an input/output (I/O) interface 22. Also, the electronic device 12 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via the network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via the bus 18. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 16 executes various functional applications and data processing by running a program stored in the system memory 28, for example, to implement the method for determining the folding angle provided by the embodiment of the present invention.
That is, the processing unit implements, when executing the program: acquiring a first included angle between a first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between a second display screen detected by the second acceleration sensor and the horizontal line in the same direction; and calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
EXAMPLE five
An embodiment five of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for determining a folding angle, as provided in all inventive embodiments of the present application:
that is, the processing unit implements, when executing the program: acquiring a first included angle between a first display screen detected by the first acceleration sensor and a horizontal line and a second included angle between a second display screen detected by the second acceleration sensor and the horizontal line in the same direction; and calculating and determining the folding angle of the folding screen based on the first included angle and the second included angle.
Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The above embodiments are merely to illustrate the technical solutions of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.