Display method, and electronic device and storage medium

By identifying the face direction through the front camera and determining the horizontal and vertical screen directions in combination with the natural direction, it solves the problem that the horizontal screen display of electronic devices does not meet expectations when the user is lying on his side, and achieves consistency and functionality between the screen display direction and the face direction. consumption optimization.

WO2024174623A1PCT designated stage expired Publication Date: 2024-08-29HONOR DEVICE CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/133412
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-24
Filing Date
2023-11-22
Publication Date
2024-08-29

Smart Images

  • Figure CN2023133412_29082024_PF_FP_ABST
    Figure CN2023133412_29082024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a display method, and an electronic device and a storage medium. The method comprises: if an electronic device is in or enters a landscape edge-on state, determining a landscape or portrait orientation of the electronic device according to a recognized face orientation; and when the electronic device is determined to be in a portrait orientation on the basis of the face orientation, setting a screen display orientation of the electronic device to be in a portrait orientation for displaying. In this way, in a scenario in which a user lies on their side, the problem of landscape display of an electronic device not meeting a usage expectation of the user is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Display method, electronic device and storage medium

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on February 24, 2023, with application number 202310196597.0 and application name “Display method, electronic device and storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the technical field of smart terminals, and in particular to a display method, an electronic device, and a storage medium. Background Art

[0003] The screens of electronic devices such as mobile phones are typically rectangular. Mobile phone usage scenarios can be divided into portrait and landscape scenarios. When the mobile phone is in portrait mode, the screen orientation is portrait; when the mobile phone is in landscape mode, the screen orientation is landscape.

[0004] When the "auto-rotate screen" function on an electronic device is turned on, the electronic device will use its own physical sensors such as the accelerometer and gyroscope to determine its deflection angle in the sensor coordinate system. When it is determined that its deflection angle meets certain conditions, the electronic device will automatically rotate the screen display direction, switching from portrait to landscape display, or from landscape to portrait display.

[0005] However, the automatic screen rotation function based on physical sensors sometimes cannot meet the actual usage needs of users for electronic devices. For example, in some cases where the user does not expect the screen display direction to rotate, the electronic device automatically rotates the screen display direction.

[0006] Summary of the Invention

[0007] To solve the above technical problems, embodiments of the present application provide a display method, an electronic device, and a storage medium. The method can solve the problem that the horizontal screen display of an electronic device does not meet the user's usage expectations when the user is lying on his side.

[0008] In a first aspect, embodiments of the present application provide a display method. The method is applied to an electronic device, comprising: when the electronic device is in or enters a landscape orientation, the electronic device obtains a first landscape orientation of the electronic device determined based on a face orientation; if the first landscape orientation is a portrait orientation, the electronic device sets its screen display orientation to portrait display.

[0009] The first horizontal-vertical screen direction is the horizontal-vertical screen direction B determined based on the face direction mentioned in the following embodiments.

[0010] In this way, when the user is lying on his side, the electronic device still displays the screen in portrait mode, which is consistent with the direction of the face, solving the problem that the horizontal screen display of the electronic device does not meet the user's expectations.

[0011] According to the first aspect, the electronic device obtains a first horizontal or vertical screen orientation of the electronic device determined based on a face direction, including: the electronic device obtains a face direction identified based on image data collected by a front camera; the electronic device determines the first horizontal or vertical screen orientation based on an angle α between the face direction and a natural direction of the electronic device; wherein the natural direction of the electronic device is a direction from the lower end of the electronic device to the upper end, and the upper end is the end where the front and rear cameras are located.

[0012] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the first horizontal or vertical screen orientation based on the angle between the face direction and the natural orientation of the electronic device, including:

[0013] When α∈(0°-β, 0°+β), the first horizontal-vertical screen direction is the vertical screen 0° direction;

[0014] When α∈(90°-β, 90°+β), the first horizontal-vertical screen direction is the horizontal screen 90° direction;

[0015] When α∈(180°-β, 180°+β), the first horizontal-vertical screen direction is the vertical screen 180° direction;

[0016] When α∈(270°-β, 270°+β), the first horizontal-vertical screen direction is the horizontal screen 270° direction;

[0017] β represents the direction recognition range threshold, which is greater than 0° and less than 45°. The selection of β depends on the angular resolution of the chip platform used by the electronic device for face direction detection.

[0018] According to the first aspect, or any implementation of the first aspect above, the electronic device determines the first horizontal or vertical screen orientation based on an angle α between the direction of the face and the natural direction of the electronic device, further comprising:

[0019] When α∈[β, 90°-β] or α∈[90°+β, 180°-β] or α∈[180°+β, 270°-β] or α∈[270°+β, 360°-β], the value of the first horizontal-vertical screen direction indicates unknown.

[0020] According to the first aspect, or any implementation of the first aspect above, the chip platform used by the electronic device has an angular resolution of 30° when performing face direction recognition, β=30°.

[0021] In this way, the effective angle range for identifying the orientation of the face is (-30°, 30°), (60°, 120°), (150°, 210°), and (240°, 300°). The boundary angle values ​​of 30° to the left and right of the center axis, 30°, 60°, 120°, 150°, 210°, 240°, 300°, and 330° (or -30°), do not fall within the effective angle range for identifying the orientation of the face. Therefore, even if the face recognition results jitter between these boundary angle values, there will be no frequent switching of the horizontal and vertical screen displays.

[0022] When the chip platform used by the electronic device has an angular resolution of 30° when detecting the direction of a person's face, the electronic device may determine the first horizontal or vertical screen orientation based on the angle α between the direction of the person's face and the natural orientation of the electronic device, and may also be implemented based on an axial algorithm. Specifically, when α = 0, the first horizontal or vertical screen orientation is the 0° vertical screen orientation; when α = 90°, the first horizontal or vertical screen orientation is the 90° horizontal screen orientation; when α = 180°, the first horizontal or vertical screen orientation is the 180° vertical screen orientation; and when α = 270°, the first horizontal or vertical screen orientation is the 270° horizontal screen orientation.

[0023] According to the first aspect, or any implementation of the first aspect above, the method further includes: when the electronic device is in or enters a horizontal screen side stand state, obtaining image data captured by the front camera; and the electronic device performing face direction recognition on the image data.

[0024] In this way, face recognition is performed only when the electronic device maintains a horizontal or sideways state, minimizing the duration of continuous detection of the face direction and reducing system power consumption.

[0025] According to the first aspect, or any implementation of the first aspect above, the electronic device performs face direction recognition on the image data, including: if only one face is recognized based on the image data, then performing face direction recognition on the one face.

[0026] In this way, the electronic device only performs the face direction recognition operation when it recognizes a face, avoiding the problem of incorrect screen rotation caused by inaccurate recognition results.

[0027] According to the first aspect, or any implementation of the first aspect above, the method also includes: if no face is recognized based on the image data or multiple faces are recognized, or an abnormality occurs in the recognition, the electronic device determines that the value indication of the first horizontal and vertical screen direction is unknown.

[0028] Exemplarily, the value of the first horizontal or vertical screen direction may be -1, -2, or -3, as shown in FIG. 4d .

[0029] According to the first aspect, or any implementation of the first aspect above, the method further includes: if the value indication of the first horizontal or vertical screen direction is unknown, the electronic device maintains its current screen display direction.

[0030] In this way, in the scenario where the user is lying on his side and using the mobile phone, if the mobile phone is in a landscape or side-standing scenario, regardless of whether the face direction calculation module can determine the landscape or portrait state of the mobile phone, if the face is not recognized or the face recognition is abnormal, the landscape or portrait display decision module will not decide the screen display direction of the mobile phone based on the gravity direction, so as to avoid the screen display direction of the mobile phone determined based on the gravity direction (i.e., landscape display) not meeting the horizontal or portrait display expectations when the user is lying on his side (i.e., portrait display).

[0031] According to the first aspect, or any implementation of the first aspect above, the method also includes: if the first horizontal or vertical screen direction is the horizontal screen direction, the electronic device maintains its current screen display direction; wherein the horizontal screen direction includes a horizontal screen 90° direction and a horizontal screen 270° direction.

[0032] When the first horizontal or vertical screen orientation is the horizontal screen orientation, the first horizontal or vertical screen orientation is irrelevant to solving the problem that the horizontal screen display does not meet the user's expectations when the user is lying on his side. At this time, the original display orientation can be maintained.

[0033] According to the first aspect, or any implementation of the first aspect above, the method also includes: when the electronic device exits the landscape orientation state or is in a non-landscape orientation state, obtaining a second landscape or portrait orientation of the electronic device determined based on the direction of gravity; and determining the screen display direction of the electronic device based on the second landscape or portrait orientation.

[0034] The second horizontal-vertical screen direction is the horizontal-vertical screen direction A determined based on the face direction mentioned in the following embodiments.

[0035] When the electronic device exits the landscape orientation state or is in a non-landscape orientation state, determining the screen display direction of the electronic device based on the direction of gravity can meet the needs of most application scenarios.

[0036] According to the first aspect, or any implementation method of the first aspect above, when the electronic device is in or enters a horizontal screen side stand state, the electronic device obtains image data captured by the front camera, including: when the electronic device is in or enters a horizontal screen side stand state, and the current scene requires automatic rotation of the horizontal or vertical screen, the electronic device obtains image data captured by the front camera.

[0037] In this way, only when the electronic device maintains a horizontal or sideways state and there is a need for automatic rotation of the screen in the current scene, the electronic device will perform a horizontal or vertical screen detection operation based on the face direction, reducing system power consumption while meeting user needs.

[0038] According to the first aspect, or any implementation of the first aspect above, image data captured by the front camera is acquired in a real-time sampling manner.

[0039] In this way, the horizontal and vertical screen detection based on the face direction is performed in a real-time sampling manner, so that the face direction voting can be timely when the screen display direction is determined.

[0040] According to the first aspect, or any implementation of the first aspect above, the method also includes: when the electronic device exits the horizontal screen side stand state, or when there is no demand for automatic rotation of the horizontal or vertical screen in the current scene, the electronic device switches the sampling method of the image data captured by the front camera from the real-time sampling method to the interval sampling method; obtains the image data captured by the front camera in the interval sampling method, and performs face direction recognition on the image data.

[0041] If the face direction calculation module is turned off when it does not need to perform horizontal and vertical screen detection based on face direction, the face direction calculation module may take a long time to start running, resulting in the face direction calculation module being unable to output the detection results in a timely manner. At this time, if the horizontal and vertical screen display decision module waits for the output results of the face direction calculation module before making a fusion decision, the horizontal and vertical screen rotation experience during scene switching will become very sluggish. In order to solve this problem and minimize the high power consumption caused by horizontal and vertical screen direction detection based on face direction, even if the face direction calculation module does not need to report the detection results to the horizontal and vertical screen display decision module, the horizontal and vertical screen detection based on face direction will not be stopped. Instead, the horizontal and vertical screen detection based on face direction will be performed based on interval sampling.

[0042] According to the first aspect, or any implementation of the first aspect above, the electronic device switches the sampling mode of image data captured by the front camera from the real-time sampling mode to the interval sampling mode, including:

[0043] When the electronic device determines that it is necessary to switch the sampling mode of the image data collected by the front camera from real-time sampling to interval sampling, it obtains the delay duration; when the delay duration is reached, the electronic device switches the sampling mode of the image data collected by the front camera from real-time sampling to interval sampling.

[0044] In this way, when the sampling mode is switched from real-time sampling to interval sampling, a delayed switching method is adopted to avoid the problem that the face direction calculation module cannot output the detection result in time due to frequent user operations.

[0045] According to the first aspect, or any implementation method of the above first aspect, after the electronic device switches the sampling method of the image data collected by the front camera from the real-time sampling method to the interval sampling method, it also includes: when the electronic device enters or is in the landscape screen side state and the current scene has the requirement of automatic rotation of the landscape screen and portrait screen, the electronic device will immediately switch the sampling method of the image data collected by the front camera from the interval sampling method to the real-time sampling method.

[0046] In this way, when the sampling mode is switched from real-time sampling to interval sampling, an immediate switching or direct switching method is adopted to avoid the problem of not being able to obtain face direction votes due to untimely switching.

[0047] According to the first aspect, or any implementation method of the first aspect above, the electronic device performs facial direction recognition on image data, including: the electronic device determines on the application processor side whether it is necessary to fuse the first horizontal and vertical screen directions determined based on the facial direction and the second horizontal and vertical screen directions determined based on the gravity direction to determine the screen display direction of the electronic device; or, the electronic device determines on the coprocessor side whether it is necessary to fuse the first horizontal and vertical screen directions determined based on the facial direction and the second horizontal and vertical screen directions determined based on the gravity direction to determine the screen display direction of the electronic device.

[0048] Among them, when the electronic device performs face direction fusion judgment on the application processor side, its architecture scalability is better, and when the electronic device performs face direction fusion judgment on image data on the coprocessor side, its power consumption is lower.

[0049] According to the first aspect, or any implementation method of the first aspect above, the electronic device includes a horizontal and vertical screen orientation calculation module and a face direction calculation module; when the electronic device is in or enters a horizontal screen side-standing state, the electronic device obtains the first horizontal and vertical screen orientation of the electronic device determined based on the face direction, including: when the horizontal and vertical screen orientation calculation module determines that the posture of the electronic device is a horizontal screen side-standing state, the electronic device starts the face direction calculation module, and obtains image data collected by the front camera, identifies the face direction according to the image data, and determines the first horizontal and vertical screen orientation of the electronic device based on the face direction; the electronic device turns off the face direction calculation module.

[0050] In this way, the face direction calculation module will only be turned on when it is necessary to query the horizontal and vertical screen status based on the face direction, which greatly reduces the system power consumption.

[0051] In a second aspect, an embodiment of the present application provides an electronic device. The electronic device includes: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device performs the display method of the first aspect and any one of the first aspects.

[0052] The second aspect and any implementation of the second aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the second aspect and any implementation of the second aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0053] In a third aspect, an embodiment of the present application provides a computer-readable storage medium comprising a computer program, which, when executed on an electronic device, causes the electronic device to execute the display method of the first aspect and any one of the first aspects.

[0054] The third aspect and any implementation of the third aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the third aspect and any implementation of the third aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0055] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising a computer program, which, when executed, enables a computer to execute a display method as described in the first aspect or any one of the items in the first aspect.

[0056] The fourth aspect and any implementation of the fourth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fourth aspect and any implementation of the fourth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here.

[0057] In a fifth aspect, the present application provides a chip comprising a processing circuit and a transceiver pin. The transceiver pin and the processing circuit communicate with each other via an internal connection path, and the processing circuit executes the display method according to the first aspect or any one of the first aspects to control the receiving pin to receive a signal and to control the transmitting pin to send a signal.

[0058] The fifth aspect and any implementation of the fifth aspect correspond to the first aspect and any implementation of the first aspect, respectively. The technical effects corresponding to the fifth aspect and any implementation of the fifth aspect can be referred to the technical effects corresponding to the first aspect and any implementation of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] FIG1 is an exemplary application scenario;

[0060] FIG2 is an exemplary application scenario;

[0061] FIG3 a is a schematic diagram of determining the screen display direction based on the gravity direction;

[0062] FIG3 b is an exemplary diagram showing the horizontal and vertical screen states of a mobile phone;

[0063] FIG3 c is an exemplary output value example of the horizontal and vertical screen direction calculation module;

[0064] FIG4a is a schematic diagram of determining the screen display direction based on the gravity direction and the face direction;

[0065] FIG4 b is an exemplary illustration of a face direction;

[0066] FIG4c is an exemplary diagram showing the correspondence between the angle between the face direction and the natural direction of the phone and the horizontal and vertical screen states of the phone;

[0067] FIG4 d is an exemplary output value example of a face direction calculation module;

[0068] FIG4e is a decision logic diagram of the horizontal and vertical screen display decision module for the screen display direction;

[0069] FIG5 is a schematic diagram showing how to determine the screen display orientation based on the direction of gravity, the orientation of a person's face, and the sideways and horizontal screen state;

[0070] FIG6 is a schematic diagram of a mobile phone in a horizontal position;

[0071] FIG7 is a decision logic diagram of the screen display direction by the horizontal or vertical screen display decision module provided in an embodiment of the present application;

[0072] FIG8a is a schematic diagram showing how to determine the screen display direction based on the direction of gravity, the orientation of a person's face, and the sideways and horizontal screen state;

[0073] FIG8 b is an exemplary output value example of the horizontal and vertical screen direction calculation module;

[0074] FIG8c is a decision logic diagram of the screen display direction by the horizontal or vertical screen display decision module provided in an embodiment of the present application;

[0075] FIG9 is a schematic diagram showing an exemplary module interaction;

[0076] FIG10a is a schematic diagram showing an exemplary module interaction;

[0077] FIG10b is a schematic diagram showing an exemplary module interaction;

[0078] FIG11a is a processing logic diagram of an exemplary face direction calculation module;

[0079] FIG11b is a schematic diagram showing the switching of the sampling detection mode of the face direction calculation module;

[0080] FIG12 is a schematic diagram illustrating a hardware structure of an electronic device;

[0081] FIG13a is a schematic diagram showing an exemplary module interaction;

[0082] FIG13 b is a schematic diagram showing an exemplary module interaction. DETAILED DESCRIPTION

[0083] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0084] The term "and / or" in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0085] In the description and claims of the embodiments of this application, the terms "first" and "second" are used to distinguish different objects, rather than to describe a specific order of objects. For example, the terms "first target object" and "second target object" are used to distinguish different objects, rather than to describe a specific order of objects.

[0086] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0087] In the description of the embodiments of this application, unless otherwise specified, "multiple" means two or more. For example, "multiple processing units" means two or more processing units; "multiple systems" means two or more systems.

[0088] Taking a mobile phone as an example, the usage scenarios of an electronic device can be divided into a portrait screen usage scenario and a landscape screen usage scenario. When the mobile phone usage scenario is a portrait screen usage scenario, the mobile phone screen display direction is a portrait screen display, as shown in (1) in FIG1 ; when the mobile phone usage scenario is a landscape screen usage scenario, the mobile phone screen display direction is a landscape screen display, as shown in (2) in FIG1 . Among them, the screen display direction of the electronic device is the direction from the bottom of the electronic device display screen to the top. If the screen display direction of the electronic device is parallel to the long side direction of the electronic device, the screen display direction of the electronic device is a portrait screen display; if the screen display direction of the electronic device is parallel to the short side direction of the electronic device, the screen display direction of the electronic device is a landscape screen display.

[0089] After the "auto-rotate screen" function on an electronic device is turned on, if the deflection angle of the electronic device in the sensor coordinate system meets certain conditions, the electronic device will automatically rotate its screen display direction, such as switching from portrait to landscape display, or from landscape to portrait display.

[0090] Specifically, when the deflection angle of the electronic device in the sensor coordinate system indicates that the electronic device is in a portrait state, the screen display orientation of the electronic device is portrait display; when the deflection angle of the electronic device in the sensor coordinate system indicates that the electronic device is in a landscape state, the screen display orientation of the electronic device is landscape display. Thus, after the "auto-rotate screen" function on the electronic device is turned on, if the electronic device changes from a landscape state to a portrait state, the electronic device switches from landscape display to portrait display; if the electronic device changes from a portrait state to a landscape state, the electronic device switches from portrait display to landscape display.

[0091] FIG2 exemplifies an application scenario. When a user is sitting and using a mobile phone, the mobile phone is in a portrait mode, and the screen display direction of the mobile phone is a portrait mode, as shown in FIG2 (1). At this time, if the user continues to use the mobile phone while lying on his side (or lying on his side), and the "auto-rotate screen" function of the mobile phone is turned on, then since the posture of the mobile phone is adjusted from a portrait mode to a landscape mode, the screen display direction of the mobile phone will switch from a portrait mode to a landscape mode, as shown in FIG2 (2). However, when the user holds the mobile phone and lies on his side, the landscape mode of the mobile phone is not suitable for human eyes to watch. At this time, the user needs to manually adjust (such as turning off the "auto-rotate screen" function) to switch the mobile phone back to a portrait mode. In other words, when the user lies on his side, the screen display direction of the mobile phone automatically switches from a portrait mode to a landscape mode, which is not what the user wants to happen. Continuing to maintain the portrait mode is more in line with the user's usage expectations.

[0092] The poor user experience shown in Figure 2 occurs because electronic devices typically only use their own physical sensors, such as accelerometers and gyroscopes, to determine whether their deflection angle in the sensor coordinate system has changed, and automatically rotate the screen display direction when the deflection angle change meets certain conditions.

[0093] As shown in FIG3a, in an electronic device, a horizontal and vertical screen direction calculation module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the acceleration sensor and the angular velocity data collected in real time by the gyroscope, and determines the horizontal and vertical screen direction of the electronic device based on the calculated deflection angle, such as 0° for vertical screen, 90° for horizontal screen, 180° for vertical screen, and 270° for horizontal screen. Wherein, the deflection angle of the electronic device (such as 90°, 180°, 270°) is defined in a clockwise rotation direction, with the opposite direction of the gravity direction as 0°. FIG3b (1) exemplarily shows a schematic diagram of an electronic device with a horizontal and vertical screen direction of 0° for vertical screen, FIG3b (2) exemplarily shows a schematic diagram of an electronic device with a horizontal and vertical screen direction of 90° for horizontal screen, FIG3b (3) exemplarily shows a schematic diagram of an electronic device with a horizontal and vertical screen direction of 180° for vertical screen, and FIG3b (4) exemplarily shows a schematic diagram of an electronic device with a horizontal and vertical screen direction of 270° for horizontal screen. After the horizontal and vertical screen direction calculation module determines the horizontal and vertical screen direction of the electronic device, the horizontal and vertical screen display decision module in the electronic device can determine the screen display direction of the electronic device, such as vertical screen display or horizontal screen display, according to the horizontal and vertical screen direction of the electronic device.

[0094] In an embodiment of the present application, after the horizontal and vertical screen direction calculation module determines the horizontal and vertical screen directions of the electronic device, it can output different numerical values ​​to represent different horizontal and vertical screen directions. As shown in Figure 3c, the horizontal and vertical screen direction calculation module outputs the numerical value "0" to indicate that the horizontal and vertical screen directions of the electronic device are 0° vertical screen, the horizontal and vertical screen direction calculation module outputs the numerical value "1" to indicate that the horizontal and vertical screen directions of the electronic device are 90° horizontal screen, the horizontal and vertical screen direction calculation module outputs the numerical value "2" to indicate that the horizontal and vertical screen directions of the electronic device are 180° vertical screen, and the horizontal and vertical screen direction calculation module outputs the numerical value "3" to indicate that the horizontal and vertical screen directions of the electronic device are 270° horizontal screen and vertical screen. If the horizontal and vertical screen direction calculation module determines the horizontal and vertical screen directions of the electronic device, it can output the numerical value "-1" to indicate that the horizontal and vertical screen directions of the electronic device are unknown directions.

[0095] Among them, the vertical screen display can also be divided into vertical screen 0° display and vertical screen 180° display, and the horizontal screen display can also be divided into horizontal screen 90° display and horizontal screen 270° display. It can be understood that when the electronic device is in the vertical screen 0° state, its screen display direction can be called vertical screen 0° display, from the short side of the lower end of the display screen to the short side of the upper end of the display screen (the end where the front camera is located), refer to (1) in Figure 3b; when the electronic device is in the horizontal screen 90° state, its screen display direction can be called horizontal screen 90° display, from the right end of the display screen to the left end of the display screen, refer to (2) in Figure 3b; when the electronic device is in the vertical screen 180° state, its screen display direction can be called vertical screen 180° display, from the upper end of the display screen to the lower end of the display screen, refer to (3) in Figure 3b; when the electronic device is in the horizontal screen 270° state, its screen display direction can be called horizontal screen 270° display, from the left end of the display screen to the right end of the display screen, refer to (4) in Figure 3b.

[0096] In addition, when the horizontal and vertical screen display decision module determines the screen display direction of the electronic device, it is also necessary to consider whether the currently displayed APP (Application) supports horizontal and vertical screen rotation. In the case that the currently displayed APP supports horizontal and vertical screen rotation (the following text also uses this premise as an example to explain the automatic rotation of the horizontal and vertical screen): if the horizontal and vertical screen direction calculation module determines that the horizontal and vertical screen direction of the electronic device is 0° vertical screen, the horizontal and vertical screen display decision module can determine that the screen display direction of the electronic device is 0° vertical screen display; if the horizontal and vertical screen direction calculation module determines that the horizontal and vertical screen direction of the electronic device is 90° horizontal screen, the horizontal and vertical screen display decision module can determine that the screen display direction of the electronic device is 90° horizontal screen display; if the horizontal and vertical screen direction calculation module determines that the horizontal and vertical screen direction of the electronic device is 270° horizontal screen, the horizontal and vertical screen display decision module can determine that the screen display direction of the electronic device is 270° horizontal screen display.

[0097] It should be noted that some electronic devices, such as tablets, support 180° portrait display, while some electronic devices, such as mobile phones, do not. Furthermore, when the electronic device's landscape orientation changes to 180° portrait, the landscape-portrait display decision module can determine its screen display orientation based on the actual situation, such as maintaining the original orientation or displaying 180° portrait, and this embodiment does not limit this.

[0098] When an electronic device performs automatic screen rotation control based solely on sensor data, the screen display orientation is portrait when the electronic device is in portrait mode, and landscape when the electronic device is in landscape mode. Therefore, in the application scenario shown in FIG2 , the phone is in portrait mode before the user lies on their side, and the phone displays the screen in portrait mode, which is consistent with the user's usage habits. However, after the user lies on their side, the phone is in landscape mode, and the phone's landscape-portrait display decision module determines that the screen display orientation is landscape, so it automatically switches the screen display orientation to landscape, which is clearly inconsistent with the user's usage habits.

[0099] In order to solve this problem and improve the user experience, the horizontal and vertical screen display decision module in the electronic device not only refers to the horizontal and vertical screen directions calculated based on the gravity direction of the electronic device when determining the screen display direction to realize the horizontal and vertical screen automatic rotation function, but also refers to the user's face direction, so that the horizontal and vertical screen automatic rotation function of the electronic device is more in line with the user's usage habits. Among them, the screen display direction of the electronic device is consistent with the face direction to meet the user's usage habits. The face direction refers to the direction from the philtrum to the center of the eyebrows. Furthermore, in the scenario where the user lies on his side and holds the mobile phone, although the mobile phone is in the horizontal screen state, the vertical screen display of the mobile phone must be consistent with the user's face direction to meet the user's usage habits.

[0100] Figure 4a exemplifies an embodiment. As shown in Figure 4a, in the electronic device, the horizontal and vertical screen orientation calculation module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the acceleration sensor and the angular velocity data collected in real time by the gyroscope, and determines the horizontal and vertical screen orientation A of the electronic device based on the calculated deflection angle, such as 0° for portrait, 90° for landscape, 180° for portrait, 270° for landscape, or an unknown orientation. At the same time, in the electronic device, the face orientation calculation module performs face recognition on the image data collected by the front camera, and when only one face is recognized, determines the angle between the face orientation (or face direction) and the natural orientation of the electronic device, and determines the horizontal and vertical screen orientation B of the electronic device based on the angle, such as 0° for portrait, 90° for landscape, 180° for portrait, 270° for landscape, or an unknown orientation. The horizontal and vertical screen orientation A is the horizontal and vertical screen orientation determined based on the gravity direction of the electronic device, while the horizontal and vertical screen orientation B is the horizontal and vertical screen orientation determined based on the user's face orientation.

[0101] In this way, the landscape / portrait display decision module can simultaneously refer to landscape / portrait orientation A and landscape / portrait orientation B when determining the screen display orientation. That is, it can simultaneously refer to the electronic device's gravity direction and the user's facial orientation. If landscape / portrait orientation A and landscape / portrait orientation B are inconsistent, the landscape / portrait display decision module will use landscape / portrait orientation B, determined based on the user's facial orientation, as the standard. This better meets the user's expectations for the electronic device's screen display orientation.

[0102] As shown in FIG4b , the face direction calculation module performs face recognition on the image data collected by the front camera, and determines the angle α between the face direction and the natural direction of the electronic device when only one face is recognized. The natural direction of the electronic device is the direction from the lower end of the electronic device to the upper end, and the upper end is the end where the front and rear cameras of the electronic device are located. When α = 0°, the face is facing upward, as shown in FIG4b (1), and the horizontal and vertical screen direction of the electronic device is 0° vertical; when α = 90°, the face is facing left, as shown in FIG4b (2), and the horizontal and vertical screen direction of the electronic device is 90° horizontal; when α = 180°, the face is facing downward, as shown in FIG4b (3), and the horizontal and vertical screen direction of the electronic device is 180° vertical; when α = 270°, the face is facing right, as shown in FIG4b (4), and the horizontal and vertical screen direction of the electronic device is 270° horizontal.

[0103] In an embodiment of the present application, the face direction calculation module performs face recognition on the image data collected by the front camera, and determines the angle α between the face direction and the natural direction of the electronic device when only one face is recognized, and determines the angle range to which the angle α belongs. Among them, different angle ranges can indicate different face orientations, that is, different angle ranges can indicate different horizontal and vertical screen states of the electronic device. Furthermore, the face direction calculation module can output the horizontal and vertical screen directions of the electronic device (that is, the horizontal and vertical screen directions B of the electronic device determined based on the face direction mentioned above) according to the angle range to which the angle α belongs.

[0104] As shown in Figure 4c, when α∈(0°-β, 0°+β), it means that the face is facing upward, and the horizontal and vertical screen orientation of the electronic device is 0° vertical; when α∈(90°-β, 90°+β), it means that the face is facing left, and the horizontal and vertical screen orientation of the electronic device is 90° horizontal; when α∈(180°-β, 180°+β), it means that the face is facing downward, and the horizontal and vertical screen orientation of the electronic device is 180° vertical; when α∈(270°-β, 270°+β), it means that the face is facing right, and the horizontal and vertical screen orientation of the electronic device is 270° horizontal; when α∈[β, 90°-β] or α∈[90°+β, 180°-β] or α∈[180°+β, 270°-β] or α∈[270°+β, 360°-β], it means that the face direction is unknown, and the horizontal and vertical screen orientation of the electronic device cannot be determined.

[0105] Where β is the direction recognition range threshold, which is greater than 0° and less than 45°. This value can be determined based on actual user experience.

[0106] At present, considering that the chip platform has angular resolution when performing face direction recognition, this embodiment can determine the β value in combination with the angular resolution of the chip platform used by the electronic device when performing face direction detection, so as to avoid the problem of improper setting of the β value and the introduction of a large number of misidentifications of the horizontal and vertical screen directions, resulting in frequent switching of the horizontal and vertical screen displays.

[0107] When the chip platform has an angular resolution of 30° when performing face direction recognition, if the β value is set to 35°, the effective angle range for identifying face orientation is (-35°, 35°), (55°, 125°), (145°, 215°), (235°, 305°), then the boundary angle values ​​of 30° to the left and right of the central axis, 30°, 60°, 120°, 150°, 210°, 240°, 300°, and 330°, all fall within the effective angle range for identifying face orientation, and the face recognition result will jitter between these boundary angle values, causing the horizontal and vertical screen displays to switch frequently. For example, when the angle α is around 45°, if the chip platform recognition result is 30°, the electronic device will display the vertical screen at 0°, and if the chip platform recognition result is 60°, the electronic device will display the horizontal screen at 90°. In this way, the face recognition result will jitter between 30° and 60°, causing the horizontal and vertical screen displays to switch frequently.

[0108] In the embodiment of the present application, when the angular resolution of the chip platform for face recognition is 30°, the β value is set to 30°. At this time, the valid angle range for identifying the face orientation is (-30°, 30°), (60°, 120°), (150°, 210°), and (240°, 300°). The boundary angle values ​​of 30° to the left and right of the central axis, 30°, 60°, 120°, 150°, 210°, 240°, 300°, and 330° (or -30°), do not fall within the valid angle range for identifying the face orientation. Therefore, even if the face recognition results jitter between these boundary angle values, the phenomenon of frequent switching between horizontal and vertical screen display will not occur.

[0109] In an embodiment of the present application, after the face direction calculation module determines the horizontal and vertical screen orientation of the electronic device, it can output different values ​​to represent different horizontal and vertical screen orientations. As shown in Figure 4d, when α∈(0°-β, 0°+β), the face direction calculation module outputs the value "0" to indicate that the horizontal and vertical screen orientation of the electronic device is 0° vertical; when α∈(90°-β, 90°+β), the face direction calculation module outputs the value "1" to indicate that the horizontal and vertical screen orientation of the electronic device is 90° horizontal; when α∈(180°-β, 180°+β), the face direction calculation module outputs the value "2" to indicate that the horizontal and vertical screen orientation of the electronic device is 180° vertical; when α∈(270°-β, 270°+β), the face direction calculation module outputs the value "3" to indicate that the horizontal and vertical screen orientation of the electronic device is 270° vertical. When α∈[β, 90°-β] or α∈[90°+β, 180°-β] or α∈[180°+β, 270°-β] or α∈[270°+β, 360°-β], the face direction calculation module cannot determine the horizontal or vertical screen direction of the electronic device, and can output the value "-1" to indicate that the horizontal or vertical screen direction of the electronic device is unknown.

[0110] When the chip platform used by the electronic device has an angular resolution of 30° when detecting the direction of a face, the electronic device may determine the first horizontal or vertical screen direction based on the angle α between the direction of the face and the natural direction of the electronic device, and may also be implemented based on an axial algorithm. When α = 0, the first horizontal or vertical screen direction is the 0° vertical screen direction, and the face direction calculation module outputs a value of "0"; when α = 90°, the first horizontal or vertical screen direction is the 90° horizontal screen direction, and the face direction calculation module outputs a value of "1"; when α = 180°, the first horizontal or vertical screen direction is the 180° vertical screen direction, and the face direction calculation module outputs a value of "2"; when α = 270°, the first horizontal or vertical screen direction is the 270° horizontal screen direction, and the face direction calculation module outputs a value of "3".

[0111] In addition, the face direction calculation module performs face recognition on the image data captured by the front camera. If multiple faces are recognized, the module may also output a value of "-1" to indicate that the landscape or portrait orientation of the electronic device is unknown. With the evolution of face recognition capabilities, if the face direction calculation module can distinguish between a living face and a face in a photograph when performing face recognition on the image data captured by the front camera, and can identify the face of the owner of the device, the module may further determine the landscape or portrait orientation of the electronic device when multiple faces are recognized, and output a value indicating the landscape or portrait orientation. This embodiment does not impose any limitation on this.

[0112] The face direction calculation module performs face recognition on the image data collected by the front camera. If no face is recognized, it can output the value "-2" to indicate that no face is recognized. The face direction calculation module performs face recognition on the image data collected by the front camera. If other abnormalities occur, such as errors or timeouts, it can output the value "-3" to indicate that there is an abnormality in face recognition.

[0113] It should be pointed out that for the same horizontal and vertical screen orientation, the horizontal and vertical screen orientation calculation module and the face orientation calculation module can use the same numerical value for identification, or they can use different numerical values ​​for identification. The embodiment of the present application uses the same numerical value for identification as an example and does not limit this.

[0114] Among them, the logic of the horizontal and vertical screen display decision module making a screen display direction decision based on the horizontal and vertical screen direction A output by the horizontal and vertical screen direction calculation module and the horizontal and vertical screen direction B output by the face direction calculation module can be shown in Figure 4e.

[0115] Referring to FIG. 4e , the horizontal / portrait orientation A is determined based on the electronic device's gravity data, and the horizontal / portrait orientation B is determined based on the user's facial orientation. Therefore, after receiving both the horizontal / portrait orientations A and B, the horizontal / portrait display decision module prioritizes the horizontal / portrait orientation B. If the value of horizontal / portrait orientation B is "0," indicating that the horizontal / portrait orientation is 0° portrait, the decision result is 0° portrait display. If the value of horizontal / portrait orientation B is "1," indicating that the horizontal / portrait orientation is 90° landscape, the decision result is 90° landscape display. If the value of horizontal / portrait orientation B is "2," indicating that the horizontal / portrait orientation is 180° portrait, the decision result is 180° portrait display. If the value of horizontal / portrait orientation B is "3," indicating that the horizontal / portrait orientation is 270° landscape, the decision result is 270° landscape display. If the value of horizontal / portrait orientation B is "-1," indicating that the horizontal / portrait orientation is unknown, the decision result is to maintain the original display orientation (or the current display orientation).

[0116] If the value of the horizontal or vertical screen direction B is "-2" or "-3", indicating that there is no face or there is an abnormality in face recognition, the horizontal or vertical screen display decision module gives priority to the horizontal or vertical screen direction A, that is, the screen display direction is determined based on the horizontal or vertical screen direction A.

[0117] Similarly, if the value of the horizontal and vertical screen direction A is "0", indicating that the horizontal and vertical screen direction is the vertical screen 0° direction, the decision result is vertical screen 0° display; if the value of the horizontal and vertical screen direction A is "1", indicating that the horizontal and vertical screen direction is the horizontal screen 90° direction, the decision result is horizontal screen 90° display; if the value of the horizontal and vertical screen direction A is "2", indicating that the horizontal and vertical screen direction is the vertical screen 180° direction, the decision result is vertical screen 180° display; if the value of the horizontal and vertical screen direction A is "3", indicating that the horizontal and vertical screen direction is the horizontal screen 270° direction, the decision result is horizontal screen 270° display; if the value of the horizontal and vertical screen direction A is "-1", indicating that the horizontal and vertical screen direction is an unknown direction, the decision result is to maintain the original display direction.

[0118] In this way, the landscape / portrait display decision module prioritizes the orientation of the face when determining the screen display orientation, and the landscape / portrait state of the electronic device automatically rotates to follow the face. The face orientation calculation module continuously detects the face orientation. If it recognizes the face orientation and determines the landscape / portrait orientation B, the landscape / portrait display decision module determines the screen display orientation based on the landscape / portrait orientation B. If there is no face or the first frame recognition is abnormal, the landscape / portrait display decision module prioritizes the direction of gravity, that is, determines the screen display orientation based on the landscape / portrait orientation A.

[0119] However, the face direction calculation module continuously detects the face direction to determine the horizontal and vertical screen directions corresponding to the face direction, which not only increases the power consumption of the entire device and affects the standby time, but also has a high degree of dependence on face detection capabilities (such as accuracy, reliability and other performance). It may also increase the frequency of automatic rotation of the horizontal and vertical screens of electronic devices, resulting in a worse user experience in some scenarios.

[0120] The following uses mobile phones as an example to explain poor user experience through several example scenarios.

[0121] In an example scenario, a mobile phone is placed on a stand on a table, and the user is sitting in a position where the front camera cannot capture the phone. If someone passes by, the front camera captures the direction of their face. If the horizontal or vertical screen display mode determined based on the face direction is inconsistent with the current display mode, the phone screen automatically rotates, which does not meet the user's usage expectations.

[0122] In an example scenario, a user is holding a mobile phone. When the field of view of the front camera of the mobile phone changes, causing the output result of the face direction calculation module to switch between the presence or absence of a face, and the recognized face switches between the owner's face and someone else's face (in a different direction from the owner's face), the mobile phone screen will automatically rotate back and forth.

[0123] In one example scenario, there's a portrait photo on the wall behind the user. Multiple faces appear in the image captured by the phone's front camera, and automatic screen rotation based on face orientation doesn't work. However, when the user stands up to leave, the image captured by the phone's front camera only contains the portrait photo on the wall. This triggers automatic screen rotation based on the portrait's face orientation, resulting in a poor user experience.

[0124] Therefore, although full-scene face recognition is more in line with human factors in theory, it is subject to limitations such as the need to capture the face direction during use and the capabilities of the chip platform, and there may be erroneous or redundant screen rotation problems that violate the user's rotation intention.

[0125] In order to solve the above problems, an embodiment of the present application provides a display method. In this display method, if the user uses the electronic device (usually refers to a handheld electronic device, or a handheld portable electronic device, such as a mobile phone, tablet computer, etc.) in a side-lying usage scenario, the horizontal and vertical screen display decision module gives priority to the face direction when deciding the screen display direction, and the screen display direction of the electronic device automatically rotates following the face. If the user uses the electronic device in a non-side-lying usage scenario, the horizontal and vertical screen display decision module gives priority to the gravity direction when deciding the screen display direction, and the screen display direction of the electronic device automatically rotates following the gravity direction.

[0126] When automatically rotating the screen based on gravity, the 0-degree reference is the opposite direction of gravity. Since the direction of the face (from the philtrum to the center of the eyebrows) is in the opposite direction of gravity in most scenarios, automatic rotation based on gravity can meet the vast majority of user needs. In scenarios where the user is lying on their side, the direction of the face is approximately perpendicular to the opposite direction of gravity. Automatic rotation based on the face's direction is prioritized, preventing the electronic device from displaying in landscape mode, which doesn't meet the user's expectations.

[0127] Therefore, the display method provided in the embodiment of the present application can solve the user's key pain point scenarios, that is, it can solve the problem that the horizontal screen display of the electronic device does not meet the user's expectations of horizontal and vertical screen display when the user is lying on his side, and it can also solve the problem that the calculation results of the face direction are incorrect due to changes in light brightness, field of view angle, focus, etc., thereby causing the electronic device screen to rotate automatically by mistake.

[0128] In an optional embodiment, as shown in FIG5 , in an electronic device, a horizontal and vertical screen direction calculation module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the acceleration sensor and the angular velocity data collected in real time by the gyroscope, and determines the horizontal and vertical screen direction A of the electronic device based on the calculated deflection angle, such as 0° for vertical screen, 90° for horizontal screen, 180° for vertical screen, 270° for horizontal screen, or an unknown direction. At the same time, in the electronic device, a face direction calculation module performs face recognition on the image data collected by the front camera, and when only one face is recognized, determines the angle between the face orientation and the natural direction of the electronic device, and determines the horizontal and vertical screen direction B of the electronic device based on the angle, such as 0° for vertical screen, 90° for horizontal screen, 180° for vertical screen, 270° for horizontal screen, or an unknown direction. In addition, the side-stand horizontal screen recognition module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the acceleration sensor and the angular velocity data collected in real time by the gyroscope, and identifies whether the electronic device is in the side-stand horizontal screen state based on the calculated deflection angle, and sends the recognition result to the horizontal or vertical screen display decision module.

[0129] An electronic device being in a side-standing landscape state means that the electronic device is both in a landscape state and in a side-standing state. The side-standing state (i.e., the state in which the display screen is perpendicular or approximately perpendicular to the ground) is relative to the flat state (i.e., the state in which the display screen is parallel or approximately parallel to the ground). When the electronic device is in a side-standing landscape state, the long frame of the electronic device is parallel or approximately parallel to the ground, and the short frame of the electronic device is perpendicular or approximately perpendicular to the ground. Since the landscape state can be divided into a 90° landscape state and a 270° landscape state, the side-standing landscape state can also be divided into a 90° landscape state and a 270° landscape state. Figure 6 (1) exemplarily shows the 90° landscape state of a mobile phone, and Figure 6 (2) exemplarily shows the 270° landscape state of a mobile phone.

[0130] In the scenario where the user is lying on their side using the phone, the use scenario where the phone is in a horizontal position with the screen flat does not conform to the user's usage habits, and the use scenario where the phone is in a horizontal position with the screen sideways conforms to the user's usage habits. When the phone is in a horizontal position with the screen at 90° sideways, when the user is lying on their right side using the phone, the phone's natural orientation display conforms to the user's usage habits, but when the user is lying on their left side using the phone, the phone's natural orientation display does not conform to the user's usage habits. Similarly, when the phone is in a horizontal position with the screen at 270° sideways, when the user is lying on their right side using the phone, the phone's natural orientation display does not conform to the user's usage habits, but when the user is lying on their left side using the phone, the phone's natural orientation display conforms to the user's usage habits.

[0131] Therefore, in the scenario where the user is lying on their side using the phone, if the phone is in a landscape orientation, the landscape or portrait display decision module needs to consider the face orientation when determining the screen display direction, so that the phone screen display direction meets the user's landscape or portrait display expectations.

[0132] Continuing with FIG5 , when determining the screen display orientation, the landscape / portrait display decision module determines whether to refer to landscape / portrait orientation B determined based on the orientation of the person's face, based on whether the electronic device is in the landscape orientation. If the electronic device is in the landscape orientation, the landscape / portrait display decision module uses landscape / portrait orientation B determined based on the orientation of the person's face as the basis, prioritizing reference to landscape / portrait orientation B when determining the landscape / portrait display orientation. If the electronic device is not in the landscape orientation, the landscape / portrait display decision module uses landscape / portrait orientation A determined based on the direction of gravity as the basis, prioritizing reference to landscape / portrait orientation A when determining the landscape / portrait display orientation.

[0133] The logic of the horizontal and vertical screen display decision module for making screen display direction decisions based on the horizontal and vertical screen direction A output by the horizontal and vertical screen direction calculation module, the horizontal and vertical screen direction B output by the face direction calculation module, and whether the electronic device is in the sideways horizontal screen state can be shown in Figure 7.

[0134] Referring to Figure 7, the horizontal and vertical screen directions A are determined based on the gravity data of the electronic device, and the horizontal and vertical screen directions B are determined based on the user's face direction. Therefore, after the horizontal and vertical screen display decision module receives the horizontal and vertical screen directions A, B, and the recognition results of whether the electronic device is in the side-standing landscape state, if the electronic device is in the side-standing landscape state, for example, the recognition result of whether the electronic device is in the side-standing landscape state is "1", the horizontal and vertical screen display decision module will give priority to the horizontal and vertical screen direction B.

[0135] At this time, if the value of the horizontal-portrait screen direction B is "0", indicating that the horizontal-portrait screen direction is the vertical screen 0° direction, the decision result is vertical screen 0° display; if the value of the horizontal-portrait screen direction B is "1", indicating that the horizontal-portrait screen direction is the horizontal screen 90° direction, since the horizontal screen 90° display does not meet the user pain point scenario problem to be solved by this application (that is, the horizontal screen display of the electronic device in the side-lying scenario does not meet the user's expectations for the horizontal and vertical screen display), the decision result is to maintain the original display direction (or the current display direction); if the value of the horizontal-portrait screen direction B is "2", indicating that the horizontal-portrait screen direction is the vertical screen 180° direction, the decision result is vertical screen 180° display; if the value of the horizontal-portrait screen direction B is "3", indicating that the horizontal-portrait screen direction is the horizontal screen 270° direction, since the horizontal screen 270° display does not meet the user pain point scenario problem to be solved by this application, the decision result is to maintain the original display direction; if the value of the horizontal-portrait screen direction B is "-1", indicating that the horizontal-portrait screen direction is an unknown direction, the decision result is also to maintain the original display direction.

[0136] It should be emphasized that if the value of the horizontal or vertical screen direction B is "-2" or "-3", indicating that there is no face or there is an abnormality in face recognition, the decision result of the horizontal or vertical screen display decision module is also to maintain the original display direction.

[0137] In this way, in the scenario where the user is lying on their side using the phone, if the phone is in a horizontal or side-standing scenario, regardless of whether the face direction calculation module can determine the horizontal or vertical screen state of the phone, if the face is not recognized or the face recognition is abnormal, the horizontal or vertical screen display decision module will not decide the screen display direction of the phone based on the gravity direction, so as to avoid the screen display direction of the phone determined based on the gravity direction (i.e., horizontal screen display) not meeting the horizontal or vertical screen display expectation when the user is lying on his side (i.e., vertical screen display). At the same time, when the value of the horizontal or vertical screen direction B is "-2" or "-3", it indicates that the face direction calculation module is unable to provide a valid vote, so the horizontal or vertical screen display decision module decides to maintain the original display direction at this time.

[0138] In addition, it should be emphasized that when the value of the horizontal and vertical screen direction B is "1" or "3", it means that the horizontal and vertical screen direction is the horizontal screen direction, and the face direction is perpendicular to the natural direction of the mobile phone, which does not meet the user pain point scenario problem to be solved by this application. In the scenario where the user is not lying on his side, the automatic rotation of the horizontal and vertical screen based on the direction of gravity can meet the user's usage needs, and there is no need for the face direction calculation module to vote to determine the display direction of the mobile phone. Therefore, when the value of the horizontal and vertical screen direction B is "1" or "3", the vote of the face direction calculation module has nothing to do with solving the problem that the horizontal screen display does not meet the user's expectations in the scenario where the user is lying on his side. At this time, the horizontal and vertical screen display decision module decides to continue to maintain the original display direction.

[0139] If the electronic device is in a non-landscape state, for example, the recognition result of whether the electronic device is in the landscape state is "0", the landscape display decision module gives priority to referring to the landscape orientation A.

[0140] At this time, if the value of the horizontal or vertical screen direction A is "0", indicating that the horizontal or vertical screen direction is the vertical screen 0° direction, the decision result is vertical screen 0° display; if the value of the horizontal or vertical screen direction A is "1", indicating that the horizontal or vertical screen direction is the horizontal screen 90° direction (the electronic device is in a non-sideways state at this time), the decision result is horizontal screen 90° display; if the value of the horizontal or vertical screen direction A is "2", indicating that the horizontal or vertical screen direction is the vertical screen 180° direction, the decision result is vertical screen 180° display; if the value of the horizontal or vertical screen direction A is "3", indicating that the horizontal or vertical screen direction is the horizontal screen 270° direction (the electronic device is in a non-sideways state at this time), the decision result is horizontal screen 270° display; if the value of the horizontal or vertical screen direction A is "-1", indicating that the horizontal or vertical screen direction is an unknown direction, the decision result is to maintain the original display direction.

[0141] In this way, when the landscape / portrait display decision module determines the screen display orientation, if the electronic device is in landscape or sideways mode, the face orientation is prioritized, and the electronic device's landscape / portrait orientation automatically rotates to follow the face. If there is no face or the first frame recognition is abnormal, the landscape / portrait display decision module maintains the original display orientation. Only when the electronic device is in a non-landscape sideways mode does the direction of gravity take priority, and the electronic device's landscape / portrait orientation automatically rotates to follow gravity.

[0142] It should be pointed out that if the decision result is a 180° vertical screen display, taking a mobile phone as an example, a 180° vertical screen display (that is, an inverted mobile phone) does not conform to the user's usage habits. After the horizontal and vertical screen display decision module reports the decision result, the upper layer can determine the actual screen display direction of the mobile phone according to relevant settings (for example, maintain the original direction).

[0143] In an optional implementation, the landscape or portrait orientation calculation module may not only determine the landscape or portrait state of the electronic device, but may also determine whether the electronic device is in a landscape or sideways state.

[0144] As shown in Figure 8a, in the electronic device, the landscape orientation calculation module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the accelerometer and the angular velocity data collected in real time by the gyroscope. Based on the calculated deflection angle, the landscape orientation A of the electronic device is determined, such as 0° portrait, 90° landscape, 180° portrait, 270° landscape, or an unknown orientation. Furthermore, the landscape orientation calculation module calculates the deflection angle of the electronic device in the sensor coordinate system based on the acceleration data collected in real time by the accelerometer and the angular velocity data collected in real time by the gyroscope, and identifies whether the electronic device is in a sideways landscape orientation. Simultaneously, in the electronic device, the face orientation calculation module performs face recognition on image data collected by the front camera. When only one face is recognized, it determines the angle between the facial orientation and the natural orientation of the electronic device. Based on this angle, the landscape orientation B of the electronic device is determined, such as 0° portrait, 90° landscape, 180° portrait, 270° landscape, or an unknown orientation.

[0145] Among them, the horizontal and vertical screen orientation of the electronic device and whether it is in a sideways horizontal screen state can be represented by the output value of the horizontal and vertical screen orientation calculation module. As shown in Figure 8b, the horizontal and vertical screen orientation calculation module outputs the value "0" to indicate that the horizontal and vertical screen orientation of the electronic device is 0° vertical screen, the horizontal and vertical screen orientation calculation module outputs the value "1" to indicate that the horizontal and vertical screen orientation of the electronic device is 90° horizontal screen and sideways, the horizontal and vertical screen orientation calculation module outputs the value "2" to indicate that the horizontal and vertical screen orientation of the electronic device is 180° vertical screen, the horizontal and vertical screen orientation calculation module outputs the value "3" to indicate that the horizontal and vertical screen orientation of the electronic device is 270° horizontal screen and sideways, the horizontal and vertical screen orientation calculation module outputs the value "4" to indicate that the horizontal and vertical screen orientation of the electronic device is 90° horizontal screen and not sideways, and the horizontal and vertical screen orientation calculation module outputs the value "5" to indicate that the horizontal and vertical screen orientation of the electronic device is 270° horizontal screen and not sideways. If the horizontal and vertical screen orientation calculation module determines the horizontal and vertical screen orientation of the electronic device, it can output the value "-1" to indicate that the horizontal and vertical screen orientation of the electronic device is an unknown orientation.

[0146] In this case, the logic of the horizontal / vertical screen display decision module making a screen display direction decision based on the horizontal / vertical screen direction A output by the horizontal / vertical screen direction calculation module and the horizontal / vertical screen direction B output by the face direction calculation module can be shown in FIG8c .

[0147] Referring to Figure 8c, the horizontal and vertical screen direction A is determined based on the gravity data of the electronic device, and the horizontal and vertical screen direction B is determined based on the user's face direction. Therefore, after the horizontal and vertical screen display decision module receives the horizontal and vertical screen directions A and B, if the horizontal and vertical screen direction A is "1" or "3", the horizontal and vertical screen display decision module will give priority to the horizontal and vertical screen direction B.

[0148] At this time, if the value of the horizontal-portrait screen direction B is "0", indicating that the horizontal-portrait screen direction is the vertical screen 0° direction, the decision result is vertical screen 0° display; if the value of the horizontal-portrait screen direction B is "1", indicating that the horizontal-portrait screen direction is the horizontal screen 90° direction, since the horizontal screen 90° does not meet the user pain point scenario problem to be solved by this application, the decision result is to maintain the original display direction (or current display direction); if the value of the horizontal-portrait screen direction B is "2", indicating that the horizontal-portrait screen direction is the vertical screen 180° direction, the decision result is vertical screen 180° display; if the value of the horizontal-portrait screen direction B is "3", indicating that the horizontal-portrait screen direction is the horizontal screen 270° direction, since the horizontal screen 270° does not meet the user pain point scenario problem to be solved by this application, the decision result is to maintain the original display direction; if the value of the horizontal-portrait screen direction B is "-1", indicating that the horizontal-portrait screen direction is an unknown direction, the decision result is also to maintain the original display direction.

[0149] It should be emphasized that if the value of the horizontal or vertical screen direction B is "-2" or "-3", indicating that there is no face or there is an abnormality in face recognition, the decision result of the horizontal or vertical screen display decision module is also to maintain the original display direction.

[0150] After the horizontal / portrait display decision module receives the horizontal / portrait screen direction A and the horizontal / portrait screen direction B, if the horizontal / portrait screen direction A is neither "1" nor "3", the horizontal / portrait display decision module gives priority to the horizontal / portrait screen direction A.

[0151] At this time, if the value of the horizontal and vertical screen direction A is "0", indicating that the horizontal and vertical screen direction is the vertical screen 0° direction, the decision result is vertical screen 0° display; if the value of the horizontal and vertical screen direction A is "4", indicating that the horizontal and vertical screen direction is the horizontal screen 90° direction, the decision result is horizontal screen 90° display; if the value of the horizontal and vertical screen direction A is "2", indicating that the horizontal and vertical screen direction is the vertical screen 180° direction, the decision result is vertical screen 180° display; if the value of the horizontal and vertical screen direction A is "5", indicating that the horizontal and vertical screen direction is the horizontal screen 270° direction, the decision result is horizontal screen 270° display; if the value of the horizontal and vertical screen direction A is "-1", indicating that the horizontal and vertical screen direction is an unknown direction, the decision result is to maintain the original display direction.

[0152] Since the display method provided in the embodiment of the present application is mainly used to solve the problem that the horizontal screen display of the mobile phone does not meet the user's expected horizontal and vertical screen display when the user is lying on his side and holding the mobile phone, the face direction calculation module can calculate the horizontal and vertical screen directions based on the face direction only when the mobile phone is in the horizontal screen side state. There is no need to continuously calculate the horizontal and vertical screen directions based on the face direction, thereby reducing the power consumption of the electronic device and increasing the battery life of the electronic device.

[0153] It should be pointed out that, regardless of whether the electronic device changes to a horizontal or side-standing state from other states, or always maintains a horizontal or side-standing state, the face direction calculation module needs to calculate the horizontal or vertical screen direction based on the face direction. Among them, if no face is recognized or the face recognition is abnormal, the face direction calculation module cannot determine the corresponding horizontal or vertical screen state. At this time, the horizontal or vertical screen display decision module maintains the original display direction when deciding the screen display direction. If multiple faces are recognized, if the face direction of the real user can be identified, the horizontal or vertical screen direction is calculated based on the face direction, for reference by the horizontal or vertical screen display decision module to make a display direction decision. If multiple faces are recognized, if the face direction of the real user cannot be identified, the face direction calculation module outputs that the horizontal or vertical screen direction is unknown. At this time, the horizontal or vertical screen display decision module maintains the original display direction when deciding the screen display direction.

[0154] In addition, if the electronic device is not in the unlocked and screen-on state, such as the screen off, AOD, lock screen mode, leather case mode, anti-mistouch mode, etc., the face direction calculation module does not need to calculate the horizontal and vertical screen directions based on the face direction, so as to reduce the high power consumption caused by continuous face direction detection; if the electronic device currently displays an APP that does not support screen rotation, such as a browser, etc., the face direction calculation module does not need to calculate the horizontal and vertical screen directions based on the face direction, so as to reduce the high power consumption caused by continuous face direction detection.

[0155] In addition, if the user locks the rotation state of the application (supports screen rotation), or the user does not need the screen to rotate with the face, such as in navigation scenarios, or the current environment (such as dark light) is not suitable for the face recognition algorithm to run, the face direction calculation module does not need to calculate the horizontal and vertical screen directions based on the face direction, so as to reduce the high power consumption caused by continuous face direction detection.

[0156] Therefore, the face direction calculation module needs to calculate the horizontal and vertical screen directions based on the face direction only when the electronic device is switched to the horizontal screen side stand state, or is in the horizontal screen side stand state and the foreground APP supports automatic rotation of the horizontal and vertical screens.

[0157] In an embodiment of the present application, the horizontal and vertical screen direction calculation module calculates the horizontal and vertical screen direction of the electronic device and whether the electronic device is in a horizontal screen side-standing state based on acceleration data and angular velocity data. The power consumption caused is extremely low and can be ignored. The horizontal and vertical screen direction calculation module can run in real time in all scenarios after the electronic device turns on the screen.

[0158] However, if the face direction calculation module also runs in real time after the electronic device screen is turned on, the electronic device will need to collect images and run related face recognition algorithms at a certain frequency, which will significantly increase the power consumption.

[0159] To address the high power consumption caused by the face direction calculation module continuously calculating the landscape or portrait orientation based on the face direction, Figure 9 illustrates an exemplary embodiment. As shown in Figure 9, after receiving the landscape or portrait orientation A output by the landscape or portrait orientation calculation module, the landscape or portrait display decision module determines whether landscape or portrait orientation A is "1" or "3," and also determines whether the screen is currently in landscape or side-mounted mode. If so, it sends a start-up and detection result query command to the face direction calculation module. Upon receiving this command, the face direction calculation module starts running, acquires images captured by the front camera, performs facial recognition, determines the landscape or portrait orientation B corresponding to the face direction, and sends this orientation B to the landscape or portrait display decision module for fusion decision processing. After sending orientation B to the landscape or portrait display decision module, the face direction calculation module shuts down and ceases operation, thereby reducing the high power consumption caused by the prolonged operation of the face direction calculation module. Furthermore, the landscape / portrait display decision module can make a fusion decision based on landscape / portrait orientation A and landscape / portrait orientation B to obtain a corresponding decision result. The logic for the fusion decision can be referred to the logic shown in Figure 8c and will not be repeated here. After the landscape / portrait display decision module receives the landscape / portrait orientation A output by the landscape / portrait orientation calculation module, if landscape / portrait orientation A is neither "1" nor "3", the face orientation calculation module remains in the off state until it receives an on command.

[0160] In the embodiment shown in FIG9 , the landscape / portrait display decision module determines whether the electronic device is currently in the landscape orientation based on the output of the landscape / portrait orientation calculation module. If the output of the landscape / portrait orientation calculation module cannot indicate whether the electronic device is currently in the landscape orientation (as shown in FIG3 c ), the landscape / portrait display decision module may also determine whether the electronic device is currently in the landscape orientation based on the output of the landscape / portrait orientation recognition module, and send a start and detection result query instruction to the face orientation calculation module if the electronic device is currently in the landscape orientation.

[0161] Among them, in order to implement the implementation shown in Figure 9, the hardware chip corresponding to the face direction calculation module needs to meet certain high performance requirements to avoid the face direction calculation module taking a long time to start and run, which causes the face direction calculation module to be unable to output the horizontal and vertical screen directions determined based on the face direction in a timely manner.

[0162] In order to solve the high power consumption problem caused by the face direction calculation module continuously calculating the horizontal and vertical screen directions based on the face direction, FIG10a exemplarily shows an implementation method. As shown in FIG10a, after the horizontal and vertical screen direction calculation module outputs the horizontal and vertical screen direction A, it determines whether the horizontal and vertical screen direction A is "1" or "3", and also determines whether the current state is horizontal screen side-standing. If it is, it provides the face direction calculation module with an indication that the electronic device is currently in the horizontal screen side-standing state. When the face direction calculation module determines that the electronic device is currently in the horizontal screen side-standing state, it continuously reports the horizontal and vertical screen directions determined based on the face direction to the horizontal and vertical screen display decision module, so that the horizontal and vertical screen display decision module can make a fusion decision based on the horizontal and vertical screen directions A and B to obtain a corresponding decision result. The logic of the fusion decision can be referred to the logic shown in FIG8c, which will not be repeated here.

[0163] In this embodiment, the face orientation calculation module continuously reports the landscape or portrait orientation determined based on the face orientation to the landscape or portrait display decision module only while the electronic device is in the landscape or sideways position, thereby minimizing the duration of the face orientation calculation module's detection. If the electronic device is not in the landscape or sideways position, the face orientation calculation module no longer needs to perform landscape or portrait detection based on the face orientation and can be shut down and no longer run.

[0164] In the embodiment shown in FIG10a, the face direction calculation module determines whether the electronic device is currently in the landscape orientation based on the indication information of the landscape / portrait orientation calculation module. If the output of the landscape / portrait orientation calculation module cannot indicate whether the electronic device is currently in the landscape orientation (as shown in FIG3c), the face direction calculation module may also determine whether the electronic device is currently in the landscape orientation based on the output of the landscape / portrait orientation recognition module.

[0165] Taking into account that when the electronic device is in the landscape or side stand state, some scenarios do not require landscape or side stand detection based on face direction, such as lock screen scenarios, navigation scenarios, and scenarios where the foreground APP does not support automatic screen rotation. Therefore, in order to further reduce the power consumption caused by face detection, the upper layer can add a screen rotation requirement detection module to detect whether there is a landscape or side stand rotation requirement in the current scene. When the output of the screen rotation requirement detection module indicates that there is a landscape or side stand rotation requirement in the current scene, if the screen rotation requirement value is "1", the face direction calculation module continues to report the landscape or side stand direction determined based on the face direction to the landscape or side stand display decision module while the electronic device is in the landscape or side stand state; when the output of the screen rotation requirement detection module indicates that there is no landscape or side stand rotation requirement in the current scene, if the screen rotation requirement value is "0", the face direction calculation module does not need to perform landscape or side stand detection based on face direction while the electronic device is in the landscape or side stand state. At this time, the face direction calculation module can be closed and no longer run.

[0166] As shown in Figure 10b, after the landscape / portrait orientation calculation module outputs the landscape / portrait orientation A, it determines whether landscape / portrait orientation A is "1" or "3," and also determines whether the current state is landscape / side-up. If so, it indicates to the face orientation calculation module that the current state is landscape / side-up. Simultaneously, the screen rotation requirement detection module detects whether the current scene requires landscape / portrait detection based on face orientation and sends the screen rotation requirement value to the landscape / portrait display decision module. Alternatively, the landscape / portrait display decision module or the screen rotation requirement detection module sends the screen rotation requirement value to the face orientation calculation module.

[0167] When the face direction calculation module determines that the electronic device is currently in a landscape orientation state, and the screen rotation requirement value indicates that there is a demand for landscape or portrait rotation (such as "1"), the landscape or portrait screen display decision module continuously reports the landscape or portrait screen direction determined based on the face direction, so that the landscape or portrait screen display decision module can make a fusion decision based on the landscape or portrait screen direction A and the landscape or portrait screen direction B to obtain a corresponding decision result. The logic of the fusion decision can be referred to the logic shown in Figure 8c, which will not be repeated here.

[0168] When the face direction calculation module determines that the electronic device is currently in a landscape orientation, and the screen rotation requirement value indicates that there is currently no landscape or portrait screen rotation requirement (such as "0"), the face direction calculation module does not need to perform landscape or portrait screen detection based on the face direction. At this time, the face direction calculation module can be closed and no longer run.

[0169] Similarly, in the embodiment shown in FIG10b , the face direction calculation module determines whether the electronic device is currently in the landscape orientation based on the indication information from the landscape / portrait orientation calculation module. If the output of the landscape / portrait orientation calculation module cannot indicate whether the electronic device is currently in the landscape orientation (as shown in FIG3c ), the face direction calculation module may also determine whether the electronic device is currently in the landscape orientation based on the output of the landscape / portrait orientation recognition module.

[0170] Given the complex and diverse usage scenarios of electronic devices by users, whether there is a need for horizontal or vertical screen rotation in the current scenario may change frequently. For example, if a user frequently switches between two APPs, one APP supports automatic horizontal and vertical screen rotation, and the other APP does not support automatic horizontal and vertical screen rotation, then whether the face direction calculation module needs to perform horizontal and vertical screen detection based on face direction may also change frequently. Among them, if the face direction calculation module is turned off when it does not need to perform horizontal and vertical screen detection based on face direction, it may take a long time for the face direction calculation module to start running, resulting in the problem that the face direction calculation module cannot output the detection results in time. At this time, if the horizontal and vertical screen display decision module waits for the output results of the face direction calculation module before making a fusion decision, the horizontal and vertical screen rotation experience during scene switching will become very sluggish.

[0171] In order to solve this problem and minimize the high power consumption caused by the horizontal and vertical screen direction detection based on the face direction, in an optional implementation, even if the face direction calculation module does not need to report the detection results to the horizontal and vertical screen display decision module, the horizontal and vertical screen detection based on the face direction will not be stopped, but the horizontal and vertical screen detection based on the face direction will be performed based on the interval sampling method.

[0172] In this embodiment, if the face direction calculation module needs to continuously report the horizontal and vertical screen directions determined based on the face direction to the horizontal and vertical screen display decision module, such as the electronic device is in a horizontal screen side-standing state and the screen rotation requirement value is "1", the face direction calculation module samples in real time to perform horizontal and vertical screen detection based on the face direction, refer to Figure 11a; if the face direction calculation module does not need to report the horizontal and vertical screen directions determined based on the face direction to the horizontal and vertical screen display decision module, such as the electronic device is not in a horizontal screen side-standing state or the screen rotation requirement value is "0", the face direction calculation module samples at intervals to perform horizontal and vertical screen detection based on the face direction, refer to Figure 11a.

[0173] Among them, the mode of the face direction calculation module for horizontal and vertical screen detection based on the face direction needs to be switched between real-time sampling detection calculation mode and interval sampling detection calculation mode.

[0174] As shown in FIG11b, when the current detection mode of the face direction calculation module is the real-time sampling detection calculation mode, if it is necessary to switch to the interval sampling detection calculation mode, the switch is performed by delaying the switching. For example, when the face direction calculation module determines that the current detection mode needs to be switched from the real-time sampling detection calculation mode to the interval sampling detection calculation mode, it obtains the delay time (e.g., a few seconds) and switches the real-time sampling detection calculation mode to the interval sampling detection calculation mode when the delay time is reached.

[0175] As shown in Figure 11b, when the current detection mode of the face direction calculation module is the interval sampling detection calculation mode, if it is necessary to switch to the real-time sampling detection calculation mode, it is determined whether there is an interval sampling task to be executed. If not, the interval sampling detection calculation mode is immediately switched to the real-time sampling detection calculation mode. If so, the interval sampling task to be executed is canceled, and the interval sampling detection calculation mode is directly switched to the real-time sampling detection calculation mode.

[0176] When the face direction calculation module adopts the real-time sampling detection calculation mode, the cached horizontal and vertical screen direction values ​​corresponding to the face direction are the horizontal and vertical screen direction values ​​obtained by the most recent detection and calculation; when the face direction calculation module adopts the interval sampling detection calculation mode, after the horizontal and vertical screen direction values ​​obtained by the most recent detection and calculation are sent to the horizontal and vertical screen display decision module for the horizontal and vertical screen display decision module to complete the fusion decision, the cached horizontal and vertical screen direction values ​​corresponding to the face direction can be "-2" to indicate that the face direction calculation module cannot provide a valid vote at this time. At this time, the horizontal and vertical screen display decision module can decide that the original display direction needs to be maintained.

[0177] Regarding the effectiveness of the interval sampling detection calculation mode or the real-time sampling detection calculation mode of the face direction calculation module, the AP (application processor) side sends a corresponding sampling request to the sensor subsystem side corresponding to the face direction calculation module. When the real-time sampling detection calculation mode is effective, the sampling request is a real-time sampling request; when the interval sampling detection calculation mode is effective, the sampling request is an interval sampling request. Exemplarily, the real-time sampling request includes but is not limited to a real-time mode identifier and a real-time mode sampling interval (a value of 0 indicates no interval time); the interval sampling request includes but is not limited to an interval mode identifier and an interval mode sampling interval (in milliseconds). Furthermore, the sensor subsystem side corresponding to the face direction calculation module can complete the corresponding mode configuration according to the corresponding sampling request, and perform the horizontal and vertical screen detection operation based on the face direction according to the corresponding sampling mode.

[0178] In scenarios where the face direction calculation module needs to continuously report detection results to the landscape or portrait display decision module, a real-time sampling detection and calculation solution is adopted, and the user experience will not be affected during the real-time sampling period. In scenarios where the face direction calculation module does not need to report detection results to the landscape or portrait display decision module, an interval sampling detection and calculation solution is adopted. For example, if the face direction calculation module works for 500ms every 10 seconds to output a frame of face direction detection results, since its working time is reduced to 1 / 20 of the original time, its power consumption will also drop to about 1 / 20 of the original time, effectively and significantly reducing power consumption.

[0179] Functionally, since the face orientation is sampled every 10 seconds to update the landscape / portrait display state of the landscape / portrait display decision module, as long as the relative relationship between the face and the landscape / portrait state does not change, the screen will not rotate a second time regardless of how the application scenario is switched. The secondary rotation experience problem will only occur if the landscape / portrait orientation based on face orientation detection differs from that based on gravity direction detection within the sampling interval (for example, 10 seconds), such as when the user rotates the phone so that the landscape / portrait orientation based on face orientation detection is inconsistent with that based on gravity direction detection.

[0180] In this way, this embodiment reduces power consumption to a theoretical value close to the stop detection value, and reduces the false triggering of the secondary rotation to the probability that it can be triggered only by special operations within the sampling interval, that is, the probability of the secondary rotation is controlled in a very small competition scenario, and the device power consumption and user experience are balanced as much as possible.

[0181] As shown in Figure 12, a schematic diagram of the structure of the electronic device 100 is shown. Optionally, the electronic device 100 can be a terminal, which can also be called a terminal device. The terminal can be a portable handheld terminal device such as a mobile phone or a tablet computer (pad), which is not limited in this application. It should be understood that the electronic device 100 shown in Figure 12 is only an example of an electronic device, and the electronic device 100 can have more or fewer components than shown in the figure, can combine two or more components, or can have different component configurations. The various components shown in Figure 12 can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0182] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor, a gyroscope sensor, an acceleration sensor, a temperature sensor, a motion sensor, an air pressure sensor, a magnetic sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0183] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0184] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0185] The processor 110 may further include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory.

[0186] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0187] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0188] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0189] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0190] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0191] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc.

[0192] The wireless communication module 160 can provide wireless communication solutions for application on the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

[0193] In some embodiments, antenna 1 of electronic device 100 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that electronic device 100 can communicate with the network and other devices through wireless communication technology.

[0194] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0195] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0196] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0197] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and skin tone. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0198] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0199] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function.

[0200] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121, such as enabling the electronic device 100 to implement the display method in the embodiment of the present application. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0201] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0202] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0203] Speaker 170A, also known as a "horn," is used to convert audio electrical signals into sound signals. Electronic device 100 can listen to music or make hands-free calls through speaker 170A. In some embodiments, electronic device 100 can be provided with multiple speakers 170A.

[0204] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0205] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0206] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0207] The pressure sensor is used to sense pressure signals and convert the pressure signals into electrical signals. In some embodiments, the pressure sensor can be provided on the display screen 194. The electronic device 100 can also calculate the touch position based on the detection signal of the pressure sensor.

[0208] The gyroscope sensor can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor.

[0209] The accelerometer can detect the magnitude of acceleration of the electronic device 100 in all directions (generally three axes). When the electronic device 100 is stationary, the accelerometer can detect the magnitude and direction of gravity. The accelerometer can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0210] In an embodiment of the present application, data collected by the gyroscope and the acceleration sensor can be used to determine the horizontal or vertical screen state of the electronic device, and whether the electronic device is in the horizontal or sideways state.

[0211] A touch sensor, also known as a "touch panel," can be mounted on display screen 194. The touch sensor and display screen 194 together form a touch screen, also known as a "touch screen." The touch sensor detects touch operations applied to or near the touch sensor. The touch sensor can communicate the detected touch operations to the application processor to determine the type of touch event.

[0212] Keys 190 include a power button (also known as a power button), a volume button, and the like. Keys 190 may be mechanical keys or touch-sensitive keys. Electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of electronic device 100.

[0213] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or touch vibration feedback. For example, touch operations on different applications (such as taking photos, playing audio, etc.) can correspond to different vibration feedback effects.

[0214] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0215] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a microservice architecture, or a cloud architecture. In the embodiment of the present application, the software structure of the electronic device 100 is illustrated by taking the layered architecture Android system and the layered architecture Sensor subsystem as examples. Among them, the Android system and the Sensor subsystem run on different cores (such as the AP core and the Sensor HUB core) respectively, and complete the interaction of data and commands based on inter-core communication.

[0216] Figure 13a is a software structure block diagram of the electronic device 100 in the embodiment of the present application. Figure 13b is a software structure block diagram of the electronic device 100 in the embodiment of the present application.

[0217] On the AP side, a layered architecture divides the software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries layer (also known as the native layer), the HAL (Hardware Abstraction Layer), and the kernel layer.

[0218] The application layer can include a series of application packages.

[0219] As shown in Figures 13a and 13b, an application package may include application apps such as camera, gallery, WLAN, Bluetooth, call, calendar, map, navigation, music, video, and short message. Some apps support automatic screen rotation between landscape and portrait, while others do not. Apps that support automatic screen rotation between landscape and portrait can rotate and adjust their display layout based on the screen rotation event.

[0220] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0221] As shown in FIG13 a , the application framework layer may include a window management service (Window Manager Service), a display management service (Display Manager Service), a scene recognition service (Swing Service), a motion detection service (Motion Detection Service), and an intelligent algorithm engine (AIEngine).

[0222] Among them, the window management service is a system service used to manage system windows, such as window size, hierarchy, visibility, focus, etc., and pass relevant information to the scene recognition service for scene judgment.

[0223] The display management service is a system service used to manage the device display, such as resolution, DPI, frame rate, orientation, etc.

[0224] The scene recognition service is responsible for establishing a connection between the system process and the intelligent perception service, registering gesture fences, gesture scene recognition, gesture event injection, and other processing. It is the interface service of the intelligent algorithm engine.

[0225] The intelligent algorithm engine is an intelligent algorithm module based on the AO (Always On) Camera, which implements the AP-side algorithm capabilities or channel control capabilities such as face presence and face direction;

[0226] The motion detection service can be used to provide some gesture recognition functions.

[0227] Unlike FIG13a , in the example shown in FIG13b , the window management service further includes a horizontal / portrait display decision module. In this embodiment, the horizontal / portrait display decision module is configured to combine the horizontal / portrait orientation determined based on the face orientation and the horizontal / portrait orientation determined based on the gravity direction to determine the horizontal / portrait display orientation.

[0228] The Android Runtime consists of a core library and a virtual machine. The Android Runtime is responsible for scheduling and managing the Android system. The core library consists of two parts: one for the Java language's callable functions and the other for the Android core library.

[0229] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0230] HAL is used to abstract the underlying hardware to provide a unified abstract service to the upper layer. Among them, HAL can encapsulate the driver in the kernel layer and provide a calling interface to the application framework layer, shielding the implementation details of the low-level hardware. As shown in Figures 13a and 13b, HAL can include motion interface services and AON interface services. Among them, the Motion interface service is used to provide the application framework layer with an interface for calling the Motion virtual sensor, and the AON interface service is used to provide the application framework layer with an interface for calling the AON camera module.

[0231] The kernel layer is the layer between hardware and software. The kernel layer can at least include display drivers, audio drivers, Wi-Fi drivers, etc.

[0232] Continuing with Figure 13a, on the Sensor Hub side, the layered architecture divides the software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, the Sensor subsystem is divided into two layers: the framework layer and the driver layer, from top to bottom.

[0233] As shown in Figures 13a and 13b, the framework layer includes an inter-core communication module, a sensor client manager, and an event distribution manager. The inter-core communication module is used for bidirectional communication of data and commands between cores; the sensor client manager is used to manage sensor clients; and the event distribution manager is used to manage event distribution.

[0234] As shown in Figure 13a, the driver layer includes the Sensor driver, which includes the Motion virtual sensor, the AON camera module, and the A (ACC, acceleration sensor) + G (Gyro, gyroscope) sensor driver.

[0235] The Motion Virtual Sensor runs the Sensor Fusion algorithm in the Sensorhub, providing advanced gesture recognition capabilities. For example, the phone's orientation is determined using the Motion Fusion algorithm. As shown in Figure 13a, the Motion Virtual Sensor includes a landscape / portrait orientation calculation module and a landscape / portrait display decision module.

[0236] In this embodiment, the horizontal / vertical screen display decision module is used to fuse and determine the horizontal / vertical screen display direction according to the horizontal / vertical screen direction determined based on the face direction and the horizontal / vertical screen direction determined based on the gravity direction.

[0237] The horizontal and vertical screen direction calculation module can detect the horizontal and vertical screen directions based on the direction of gravity, as well as the horizontal and sideways state detection of the screen. That is, it can detect the horizontal and vertical screen directions based on the acceleration data collected by the acceleration sensor and the angle data collected by the gyroscope sensor, as well as the horizontal and sideways state detection of the screen.

[0238] The AON camera module is used to continuously capture images based on the Camera AON mode to provide an image sequence of gestures or faces. In this application, it can implement the function corresponding to the face direction calculation module mentioned above, that is, based on the recognition of the face direction in the image, and determine the horizontal and vertical screen orientation of the electronic device based on the face direction.

[0239] Different from FIG13a , in the example shown in FIG13b , the Motion virtual sensor only includes a horizontal and vertical screen direction calculation module, and the horizontal and vertical screen display decision module is set on the AP side.

[0240] In one example, the display method provided by this application may be implemented as shown in FIG13a , and its data processing flow may include:

[0241] S101, the horizontal and vertical screen direction calculation module determines the horizontal and vertical screen direction A of the electronic device based on the acceleration data and the angular velocity data, and sends the horizontal and vertical screen direction A to the horizontal and vertical screen display decision module; the AON camera module collects image data and recognizes the face direction, determines the horizontal and vertical screen direction B of the electronic device based on the face direction, and sends the horizontal and vertical screen direction B to the horizontal and vertical screen display decision module.

[0242] S102: The horizontal / vertical screen display decision module makes a fusion decision based on the horizontal / vertical screen direction A and the horizontal / vertical screen direction B, determines the target horizontal / vertical screen display direction, and sends the target horizontal / vertical screen display direction to the sensor driver through the Motion virtual sensor.

[0243] S103: The sensor driver sends the target horizontal and vertical screen display directions to the sensor hub inter-core communication module via the event distribution manager and the sensor client manager.

[0244] S104: The Sensor HUB inter-core communication module sends the target horizontal and vertical screen display directions to the inter-core communication module on the AP side.

[0245] S105 : The inter-core communication module on the AP side sends the target horizontal and vertical screen display directions to the window management service via the Motion interface service and the Motion detection service.

[0246] S106, the window management service determines the target screen rotation direction based on the received target horizontal and vertical screen display direction, the horizontal and vertical screen display request of the foreground APP, and the horizontal and vertical screen display directions supported by the foreground APP, and notifies the display management service of the target screen rotation direction for interface rotation.

[0247] It's important to note that in actual use, video apps like iQiyi, Youku, and Tencent Video all register their own A+G sensors, independently calculate the landscape or portrait state, and request the system to rotate the display to either landscape or portrait (i.e., landscape or portrait request). In other words, in these scenarios, the Motion Detection Service takes effect in the landscape or portrait orientation corresponding to the foreground app's landscape or portrait request.

[0248] S107: The display management service updates the display resolution and other related data, and triggers the window management service to refresh all system windows to implement window rotation.

[0249] S108: The window management service notifies the foreground application through the Config Change mechanism to redraw the display interface according to the target display direction corresponding to the target screen rotation direction.

[0250] This application does not limit the execution order of each step in the above process, which can be determined according to the actual scenario. For any details not explained in detail in the above process, please refer to the previous text and existing technologies, and will not be repeated here.

[0251] The display method provided in this application may be implemented as shown in FIG13a . The control command processing flow for the Ap side to determine whether horizontal or vertical screen detection is required based on the face direction may include:

[0252] S201: The Swing service obtains application rotation requirement information from modules such as the window management service.

[0253] S202: The Swing service sends application rotation requirement information to the AON interface service via the intelligent algorithm engine.

[0254] S203: The AON interface service sends application rotation requirement information to the inter-core communication module on the AP side.

[0255] S204: The inter-core communication module on the AP side sends the application rotation requirement information to the inter-core communication module on the Sensor HUB.

[0256] S205: The Sensor HUB inter-core communication module sends the application rotation requirement information to the Sensor driver via the Sensor client manager and the event distribution manager.

[0257] S206: The sensor driver sends the application rotation requirement information to the AON camera module. The AON camera module determines whether to continue to perform landscape or portrait screen detection based on the face direction based on the application rotation requirement information, and sends the application rotation requirement information to the Motion virtual sensor.

[0258] S207, the Motion virtual sensor side landscape and portrait orientation calculation module notifies the AON camera module when the electronic device enters or exits the side-standing landscape state, and the AON camera module determines whether it is necessary to continue landscape and portrait detection based on the face orientation according to the side-standing landscape state information.

[0259] S208 , the Motion virtual sensor side determines whether to refer to the horizontal or vertical screen orientation determined based on the face orientation when deciding the horizontal or vertical screen orientation based on the application rotation requirement information.

[0260] This application does not limit the execution order of each step in the above process, which can be determined according to the actual scenario. For any details not explained in detail in the above process, please refer to the previous text and existing technologies, and will not be repeated here.

[0261] It should also be noted that the inter-module pathways shown in Figure 13a are bidirectional. The arrows in Figure 13a are merely illustrative of the direction of data or command transmission and are not limited in this embodiment. Furthermore, the real-time sampling and interval sampling instructions corresponding to the AON camera module can also be sent from the AP to the AON camera module on the Sensor Hub via the corresponding command transmission pathways.

[0262] Thus, in the implementation shown in Figure 13a, the fusion decision of landscape and portrait detection based on face orientation is implemented on the CP (baseband chip plus coprocessor). This minimizes communication link time and prevents high power consumption due to continuous detection. However, this setup relies on the CP's ability to detect face orientation, which is limited by the chip platform. If the sensor subsystem does not support face orientation detection, implementing face orientation fusion decision-making on the CP side is not friendly to AP scalability.

[0263] In another example, the display method provided in this application may also be implemented in the manner shown in FIG13b , and its data processing flow may include:

[0264] S301: The horizontal and vertical screen direction calculation module determines the horizontal and vertical screen direction A of the electronic device according to the acceleration data and the angular velocity data, and sends the horizontal and vertical screen direction A to the sensor driver via the Motion virtual sensor.

[0265] S302, the AON camera module collects image data and identifies the face direction, and sends the horizontal and vertical screen direction B determined based on the face direction to the sensor driver.

[0266] S303: The sensor driver sends the horizontal and vertical screen directions A and B to the sensor hub inter-core communication module via the event distribution manager and the sensor client manager.

[0267] S304: The Sensor HUB inter-core communication module sends the horizontal and vertical screen directions A and B to the inter-core communication module on the AP side.

[0268] S305 : The inter-core communication module on the AP side sends the horizontal and vertical screen orientation A to the window management service via the Motion interface service and the Motion detection service.

[0269] S306: The inter-core communication module on the AP side sends the horizontal and vertical screen direction B to the horizontal and vertical screen display decision module in the window manager via the AON interface service, the intelligent algorithm engine, and the Swing service.

[0270] S307 , the horizontal-portrait display decision module makes a fusion decision based on the horizontal-portrait screen direction A and the horizontal-portrait screen direction B, determines the target horizontal-portrait screen display direction, and notifies the window management service of the target horizontal-portrait screen display direction.

[0271] S308, the window management service determines the target screen rotation direction according to the target horizontal and vertical screen display direction, the horizontal and vertical screen display request of the foreground APP, and the horizontal and vertical screen display directions supported by the foreground APP, and notifies the display management service of the target screen rotation direction for interface rotation.

[0272] S309: The display management service updates the display resolution and other related data, and triggers the window management service to refresh all system windows to implement window rotation.

[0273] S310: The window management service notifies the foreground application through the Config Change mechanism to redraw the display interface according to the target display direction corresponding to the target screen rotation direction.

[0274] This application does not limit the execution order of each step in the above process, which can be determined according to the actual scenario. For any details not explained in detail in the above process, please refer to the previous text and existing technologies, and will not be repeated here.

[0275] The display method provided in this application may be implemented as shown in FIG13b . The control command processing flow for the Ap side to determine whether horizontal or vertical screen detection is required based on the face direction may include:

[0276] S401: The Swing service obtains application rotation requirement information from modules such as the window management service.

[0277] S402, the Swing service sends application rotation requirement information to the AON interface service via the intelligent algorithm engine.

[0278] S403: The AON interface service sends application rotation requirement information to the inter-core communication module on the AP side.

[0279] S404: The inter-core communication module on the AP side sends the application rotation requirement information to the inter-core communication module on the Sensor HUB.

[0280] S405: The Sensor HUB inter-core communication module sends the application rotation requirement information to the Sensor driver via the Sensor client manager and the event distribution manager.

[0281] S406: The sensor driver sends the application rotation requirement information to the AON camera module. The AON camera module determines whether to continue to perform landscape or portrait screen detection based on the face direction according to the application rotation requirement information.

[0282] This application does not limit the execution order of each step in the above process, which can be determined according to the actual scenario. For any details not explained in detail in the above process, please refer to the previous text and existing technologies, and will not be repeated here.

[0283] It should also be noted that the paths between modules shown in Figure 13b are bidirectional. The arrows shown in Figure 13b are merely illustrative of the direction of data or command transmission and are not limited in this embodiment of the present application. Furthermore, the real-time sampling instructions and interval sampling instructions corresponding to the AON camera module can also be sent from the AP to the AON camera module on the Sensor Hub side in the corresponding command transmission paths.

[0284] In the implementation shown in Figure 13b, the decision to combine landscape and portrait detection based on face orientation is made on the AP side. This solution offers excellent scalability and is compatible with scenarios where face orientation detection can be performed on both the AP and coprocessor sides. However, the time between triggering the AP and receiving the detection result increases inter-core communication, which does not affect the user experience and is not optimal. Furthermore, continuous detection leads to high power consumption.

[0285] The implementation shown in Figure 13b can meet the high-power AP-side Camera solution. It only needs to control the continuous detection time to a very short time (such as 15 seconds) after the first detection result is returned each time the horizontal and vertical screen detection based on the face direction is triggered, so that the horizontal and vertical screen display decision module has enough time to consider the horizontal and vertical screen detection results based on the face direction. This situation only loses the low-frequency usage experience where the content displayed on the horizontal side of the mobile phone remains unchanged while the face direction changes. Similarly, in all scenarios where the horizontal and vertical screen states change, the face direction can be detected for a short time and the face direction is prioritized. The interface rotation is only triggered when the rotation direction changes, thereby supporting the logic of face direction priority in all scenarios.

[0286] In another example, the display method provided in the present application can adopt the implementation scheme shown in Figure 13a, and be compatible with the AP side scheme shown in Figure 13b in system design, which will not be repeated here.

[0287] It is understood that the layers in the software structure shown in Figures 13a and 13b and the components contained in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, and this application does not limit this.

[0288] It is understandable that, in order to implement the display method in the embodiment of the present application, the electronic device includes hardware and / or software modules that perform the corresponding functions. In combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application in combination with the embodiments, but such implementation should not be considered to be beyond the scope of this application.

[0289] This embodiment further provides a computer storage medium, in which computer instructions are stored. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned related method steps to implement the display method in the above-mentioned embodiment.

[0290] This embodiment further provides a computer program product. When the computer program product is run on a computer, it enables the computer to execute the above-mentioned related steps to implement the display method in the above-mentioned embodiment.

[0291] In addition, an embodiment of the present application also provides a device, which can specifically be a chip, component or module, and the device may include a connected processor and memory; wherein the memory is used to store computer-executable instructions, and when the device is running, the processor can execute the computer-executable instructions stored in the memory to enable the chip to execute the display method in the above-mentioned method embodiments.

[0292] Among them, the electronic devices (such as mobile phones, etc.), computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0293] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

[0294] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0295] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A display method, characterized in that: Used in electronic equipment, including: When the electronic device is in or enters a horizontal screen side-standing state, obtaining a first horizontal or vertical screen orientation of the electronic device determined based on a face orientation; If the first horizontal-vertical screen orientation is a vertical screen orientation, the screen display orientation of the electronic device is set to vertical screen display.

2. The method according to claim 1, characterized in that Acquiring a first horizontal or vertical screen orientation of the electronic device determined based on a face orientation, comprising: Obtain the direction of the face recognized based on the image data collected by the front camera; Determining the first horizontal and vertical screen orientation according to an angle α between the human face orientation and the natural orientation of the electronic device; The natural direction of the electronic device is the direction from the lower end of the electronic device to the upper end, and the upper end is the end where the front and rear cameras are located.

3. The method according to claim 2, characterized in that Determining the first horizontal and vertical screen orientation according to the angle between the face orientation and the natural orientation of the electronic device includes: When α∈(0°-β, 0°+β), the first horizontal-vertical screen direction is the vertical screen 0° direction; When α∈(90°-β, 90°+β), the first horizontal and vertical screen direction is the horizontal screen 90° direction; When α∈(180°-β, 180°+β), the first horizontal-vertical screen direction is a 180° vertical screen direction; When α∈(270°-β, 270°+β), the first horizontal and vertical screen direction is the horizontal screen 270° direction; Wherein, β represents the direction recognition range threshold, and β is greater than 0° and less than 45°.

4. The method according to claim 3, characterized in that Determining the first horizontal and vertical screen orientation according to the angle between the face orientation and the natural orientation of the electronic device further includes: When α∈[β, 90°-β] or α∈[90°+β, 180°-β] or α∈[180°+β, 270°-β] or α∈[270°+β, 360°-β], the value of the first horizontal and vertical screen direction indicates unknown.

5. The method according to claim 3 or 4, characterized in that: The chip platform used by the electronic device has an angular resolution of 30° when performing face direction recognition, β=30°.

6. The method according to claim 2, characterized in that Also includes: When the electronic device is in or enters a horizontal screen side stand state, acquiring image data captured by the front camera; Perform face direction recognition on the image data.

7. The method according to claim 6, characterized in that Performing face direction recognition on the image data includes: If only one face is recognized based on the image data, face direction recognition is performed on the one face.

8. The method according to claim 7, characterized in that Also includes: If no face is recognized according to the image data, or multiple faces are recognized, or an abnormality occurs in the recognition, it is determined that the value of the first horizontal and vertical screen direction indicates unknown.

9. The method according to claim 4 or 8, characterized in that: Also includes: If the value of the first horizontal or vertical screen orientation indicates unknown, the current screen display orientation of the electronic device is maintained.

10. The method according to claim 3, characterized in that Also includes: If the first horizontal-vertical screen orientation is a horizontal screen orientation, maintaining the current screen display orientation of the electronic device; The horizontal screen direction includes a horizontal screen direction of 90° and a horizontal screen direction of 270°.

11. The method according to claim 1, characterized in that: Also includes: When the electronic device exits the horizontal screen side-standing state or is in the non-horizontal screen side-standing state, acquiring a second horizontal or vertical screen orientation of the electronic device determined based on the gravity direction; The screen display direction of the electronic device is determined according to the second horizontal and vertical screen directions.

12. The method according to claim 6, characterized in that When the electronic device is in or enters a horizontal screen side stand state, acquiring image data captured by the front camera includes: When the electronic device is in or enters a horizontal screen side-standing state and there is a demand for automatic rotation of the horizontal screen to the vertical screen in the current scene, image data captured by the front camera is obtained.

13. The method according to claim 6 or 12, characterized in that: The image data collected by the front camera is acquired in a real-time sampling manner.

14. The method according to claim 13, characterized in that Also includes: When the electronic device exits the horizontal screen side stand state, or when there is no demand for automatic horizontal or vertical screen rotation in the current scene, the sampling mode for obtaining the image data collected by the front camera is switched from the real-time sampling mode to the interval sampling mode; The image data collected by the front camera is acquired in an interval sampling manner, and face direction recognition is performed on the image data.

15. The method according to claim 14, characterized in that Switching the sampling mode of acquiring the image data collected by the front camera from the real-time sampling mode to the interval sampling mode includes: When it is determined that the sampling mode for acquiring the image data collected by the front camera needs to be switched from real-time sampling to interval sampling, the delay duration is obtained; When the delay time is reached, the sampling method for acquiring the image data collected by the front camera is switched from the real-time sampling method to the interval sampling method.

16. The method according to claim 14, characterized in that After the sampling mode of acquiring the image data collected by the front camera is switched from the real-time sampling mode to the interval sampling mode, the method further includes: When the electronic device enters or is in a horizontal screen side-standing state and there is a demand for automatic horizontal and vertical screen rotation in the current scene, the sampling method for obtaining image data collected by the front camera is immediately switched from the interval sampling method to the real-time sampling method.

17. The method according to claim 1, characterized in that Also includes: Determine, on the application processor side, whether it is necessary to fuse a first horizontal or vertical screen direction determined based on the face direction and a second horizontal or vertical screen direction determined based on the gravity direction to determine the screen display direction of the electronic device; Alternatively, it is determined on the coprocessor side whether it is necessary to fuse the first horizontal and vertical screen directions determined based on the face direction and the second horizontal and vertical screen directions determined based on the gravity direction to determine the screen display direction of the electronic device.

18. The method according to claim 1, characterized in that The electronic device comprises a horizontal and vertical screen direction calculation module and a face direction calculation module; When the electronic device is in or enters a horizontal screen side-standing state, obtaining a first horizontal or vertical screen orientation of the electronic device determined based on a face orientation includes: When the horizontal and vertical screen direction calculation module determines that the posture of the electronic device is a horizontal screen sideways state, start the face direction calculation module, and obtain image data collected by the front camera, identify the face direction according to the image data, and determine the first horizontal and vertical screen direction of the electronic device based on the face direction; Close the face direction calculation module.

19. An electronic device, characterized in that: include: one or more processors; Memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and when the computer programs are executed by the one or more processors, the electronic device executes the display method as described in any one of claims 1-18.

20. A computer-readable storage medium comprising a computer program, characterized in that: When the computer program is executed on an electronic device, the electronic device executes the display method according to any one of claims 1 to 18.

Citation Information

Patent Citations

  • Display method, electronic equipment and storage medium

    CN118555320A

  • Screen rotation control method and system

    CN104125327A

  • Display direction switching method, device and electronic equipment

    CN104346030A

  • Transverse screen and vertical screen switching method and mobile terminal

    CN107483709A

  • Method and device for controlling electronic equipment, terminal and storage medium

    CN111464698A