Screen display picture adjusting method and device, electronic equipment, medium and product
By using geomagnetic intensity and gyroscope data to determine the device's attitude when the accelerometer malfunctions, and adjusting the screen display orientation, the problem of the screen not being able to flip properly due to accelerometer data lag is solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2026-03-24
AI Technical Summary
Accelerometers may experience data lag after electronic devices are dropped or impacted, causing the screen display to fail to follow the device's posture changes properly, thus affecting the user experience.
By determining whether the accelerometer is in an abnormal working state, the device's attitude is determined using geomagnetic intensity and gyroscope data, and the orientation of the screen display is adjusted according to the attitude.
When the accelerometer malfunctions, the screen display orientation is adjusted according to the device's posture, improving the user experience and preventing the screen from failing to rotate properly.
Smart Images

Figure CN121722296A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of adjusting screen display images, and more particularly to a method, apparatus, electronic device, medium, and product for adjusting screen display images. Background Technology
[0002] In electronic devices, accelerometers are widely used for the automatic horizontal and vertical rotation of screen displays. However, accelerometers are quite sensitive to stress. If an electronic device is dropped or impacted during use, the data from at least one axis of the accelerometer may become stuck in the same range, preventing it from functioning properly. In this case, the accelerometer data cannot change normally with changes in the electronic device's orientation, causing the screen display to fail to rotate correctly and resulting in a poor user experience. Summary of the Invention
[0003] To overcome the problems existing in the related technologies, this disclosure provides a method, apparatus, electronic device, medium and product for adjusting screen display images.
[0004] According to a first aspect of the present disclosure, a method for adjusting a screen display is provided, applied to an electronic device, the electronic device including a screen, the adjustment method comprising:
[0005] Determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in a non-normal working state;
[0006] In response to the accelerometer being in the first preset state, the attitude of the electronic device is determined;
[0007] The adjustment method for the screen display is determined based on the posture of the electronic device;
[0008] The screen display of the electronic device is adjusted according to the adjustment method.
[0009] In some exemplary embodiments of this disclosure, determining whether the accelerometer of the electronic device is in a first preset state includes:
[0010] After the accelerometer is turned on, multiple acceleration data from the accelerometer are acquired;
[0011] Based on multiple acceleration data, determine whether the accelerometer is in the first preset state.
[0012] In some exemplary embodiments of this disclosure, determining whether the accelerometer is in the first preset state based on the plurality of acceleration data includes:
[0013] Based on the data of multiple acceleration data points on preset coordinate axes in a preset coordinate system, it is determined whether the accelerometer is in the first preset state.
[0014] In some exemplary embodiments of this disclosure, determining whether the accelerometer is in the first preset state based on the data of the plurality of acceleration data on preset coordinate axes in a preset coordinate system includes:
[0015] When the variance of the data of any of the preset coordinate axes in the preset coordinate system meets the first preset condition, the accelerometer is determined to be in the first preset state.
[0016] In some exemplary embodiments of this disclosure, the first preset condition includes:
[0017] The variance is less than or equal to a first preset value.
[0018] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device in response to the accelerometer being in the first preset state includes:
[0019] Determine the geomagnetic intensity at the geographical location of the electronic device;
[0020] Obtain the offset geomagnetic intensity of the electronic device;
[0021] The attitude of the electronic device is determined based on the geomagnetic intensity and the offset geomagnetic intensity.
[0022] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device based on the geomagnetic intensity and the offset geomagnetic intensity includes:
[0023] The attitude of the electronic device is determined based on the geomagnetic component of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system and the geomagnetic component of the offset geomagnetic intensity on the preset coordinate axis in the preset coordinate system.
[0024] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis and a second axis; the geomagnetic component includes a first geomagnetic component under the first axis and a second geomagnetic component under the second axis; the offset geomagnetic component includes a first offset geomagnetic component under the first axis and a second offset geomagnetic component under the second axis.
[0025] Determining the attitude of the electronic device based on the geomagnetic components of the geomagnetic intensity along a preset coordinate axis in a preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axis in the preset coordinate system includes:
[0026] The first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component, and / or
[0027] The second included angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component;
[0028] If the first included angle and / or the second included angle is greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0029] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis, a second axis, and a third axis; the geomagnetic component includes a first geomagnetic component under the first axis, a second geomagnetic component under the second axis, and a third geomagnetic component under the third axis; the offset geomagnetic component includes a first offset geomagnetic component under the first axis, a second offset geomagnetic component under the second axis, and a third offset geomagnetic component under the third axis.
[0030] Determining the attitude of the electronic device based on the geomagnetic components of the geomagnetic intensity along a preset coordinate axis in a preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axis in the preset coordinate system includes:
[0031] A first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component; a second angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component; and a third angle between the third geomagnetic component and the third offset geomagnetic component is determined based on the geomagnetic intensity, the third geomagnetic component, and the third offset geomagnetic component.
[0032] Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product;
[0033] If the sum of the first product, the second product, and the third product is greater than or equal to a third preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0034] In some exemplary embodiments of this disclosure, determining the geomagnetic intensity of the geographical location of the electronic device includes:
[0035] Obtain the latitude and longitude information of the geographical location of the electronic device;
[0036] The geomagnetic intensity of the geographical location of the electronic device is determined based on the latitude and longitude information.
[0037] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device in response to the accelerometer being in the first preset state includes:
[0038] Obtain the angular velocity of the gyroscope of the electronic device;
[0039] The attitude of the electronic device is determined based on the initial angle and the angular velocity, wherein the initial angle is the angle of the electronic device in a preset coordinate system when the accelerometer is turned on.
[0040] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device based on the initial angle and the angular velocity includes:
[0041] The attitude of the electronic device is determined based on the initial angle component of the preset coordinate axis in the preset coordinate system and the angular velocity component of the preset coordinate axis in the preset coordinate system.
[0042] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis and a second axis; the initial angle includes a first initial angle component under the first axis and a second initial angle component under the second axis; the angular velocity includes a first angular velocity component under the first axis and a second angular velocity component under the second axis.
[0043] Determining the attitude of the electronic device based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system includes:
[0044] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis.
[0045] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis includes:
[0046] A first rotation angle is determined based on the first initial angle component and the first angular velocity component, and / or a second rotation angle is determined based on the second initial angle component and the second angular velocity component;
[0047] If the first rotation angle and / or the second rotation angle are greater than or equal to a fourth preset value, the posture of the electronic device is determined to be a first posture, which includes the posture in which the screen display needs to be flipped.
[0048] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis, a second axis, and a third axis; the initial angle includes a first initial angle component under the first axis, a second initial angle component under the second axis, and a third initial angle component under the third axis; the angular velocity includes a first angular velocity component under the first axis, a second angular velocity component under the second axis, and a third angular velocity component under the third axis.
[0049] Determining the attitude of the electronic device based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system includes:
[0050] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis.
[0051] In some exemplary embodiments of this disclosure, determining the attitude of the electronic device based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis includes:
[0052] A first rotation angle is determined based on the first initial angle component and the first angular velocity component; a second rotation angle is determined based on the second initial angle component and the second angular velocity component; and a third rotation angle is determined based on the third initial angle component and the third angular velocity component.
[0053] Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product.
[0054] If the sum of the fourth, fifth, and sixth products is greater than or equal to a fifth preset value, the posture of the electronic device is determined to be a first posture, which includes postures where the screen display needs to be flipped. In some exemplary embodiments of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device.
[0055] In some exemplary embodiments of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device; and the third axis is an axis along the thickness direction of the electronic device.
[0056] In some exemplary embodiments of this disclosure, determining the adjustment method of the screen display image based on the posture of the electronic device includes:
[0057] If the electronic device is in the first posture, the adjustment method of the screen display is determined to be the first adjustment method, which is to flip the screen display.
[0058] According to a second aspect of the present disclosure, a screen display adjustment device is provided, applied to an electronic device, the electronic device including a screen, the adjustment device comprising:
[0059] An accelerometer state determination module is configured to determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in an abnormal working state;
[0060] An attitude determination module is configured to determine the attitude of the electronic device in response to the accelerometer being in the first preset state;
[0061] The adjustment method determination module is configured to determine the adjustment method of the screen display based on the posture of the electronic device;
[0062] The adjustment module is configured to adjust the screen display of the electronic device according to the adjustment method.
[0063] In some exemplary embodiments of this disclosure, the accelerometer state determination module is further configured to:
[0064] After the accelerometer is turned on, multiple acceleration data from the accelerometer are acquired;
[0065] Based on multiple acceleration data, determine whether the accelerometer is in the first preset state.
[0066] In some exemplary embodiments of this disclosure, the accelerometer state determination module is further configured to:
[0067] Based on the data of multiple acceleration data points on preset coordinate axes in a preset coordinate system, it is determined whether the accelerometer is in the first preset state.
[0068] In some exemplary embodiments of this disclosure, the accelerometer state determination module is further configured to:
[0069] When the variance of the data of any of the preset coordinate axes in the preset coordinate system meets the first preset condition, the accelerometer is determined to be in the first preset state.
[0070] In some exemplary embodiments of this disclosure, the first preset condition includes:
[0071] The variance is less than or equal to a first preset value.
[0072] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0073] Determine the geomagnetic intensity at the geographical location of the electronic device;
[0074] Obtain the offset geomagnetic intensity of the electronic device;
[0075] The attitude of the electronic device is determined based on the geomagnetic intensity and the offset geomagnetic intensity.
[0076] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0077] The attitude of the electronic device is determined based on the geomagnetic component of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system and the geomagnetic component of the offset geomagnetic intensity on the preset coordinate axis in the preset coordinate system.
[0078] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis and a second axis; the geomagnetic component includes a first geomagnetic component under the first axis and a second geomagnetic component under the second axis; the offset geomagnetic component includes a first offset geomagnetic component under the first axis and a second offset geomagnetic component under the second axis.
[0079] The attitude determination module is further configured to:
[0080] The first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component, and / or
[0081] The second included angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component;
[0082] If the first included angle and / or the second included angle is greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0083] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis, a second axis, and a third axis; the geomagnetic component includes a first geomagnetic component under the first axis, a second geomagnetic component under the second axis, and a third geomagnetic component under the third axis; the offset geomagnetic component includes a first offset geomagnetic component under the first axis, a second offset geomagnetic component under the second axis, and a third offset geomagnetic component under the third axis.
[0084] The attitude determination module is further configured to:
[0085] A first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component; a second angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component; and a third angle between the third geomagnetic component and the third offset geomagnetic component is determined based on the geomagnetic intensity, the third geomagnetic component, and the third offset geomagnetic component.
[0086] Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product;
[0087] If the sum of the first product, the second product, and the third product is greater than or equal to a third preset value, the posture of the electronic device is determined to be a first posture, which includes the posture in which the screen display needs to be flipped. In some exemplary embodiments of this disclosure, the posture determination module is further configured to:
[0088] Obtain the latitude and longitude information of the geographical location of the electronic device;
[0089] The geomagnetic intensity of the geographical location of the electronic device is determined based on the latitude and longitude information.
[0090] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0091] Obtain the angular velocity of the gyroscope of the electronic device;
[0092] The attitude of the electronic device is determined based on the initial angle and the angular velocity, wherein the initial angle is the angle of the electronic device in a preset coordinate system when the accelerometer is turned on.
[0093] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0094] The attitude of the electronic device is determined based on the initial angle component of the preset coordinate axis in the preset coordinate system and the angular velocity component of the preset coordinate axis in the preset coordinate system.
[0095] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis and a second axis; the initial angle includes a first initial angle component under the first axis and a second initial angle component under the second axis; the angular velocity includes a first angular velocity component under the first axis and a second angular velocity component under the second axis.
[0096] The attitude determination module is further configured to:
[0097] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis.
[0098] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0099] A first rotation angle is determined based on the first initial angle component and the first angular velocity component, and / or a second rotation angle is determined based on the second initial angle component and the second angular velocity component;
[0100] If the first rotation angle and / or the second rotation angle are greater than or equal to a fourth preset value, the posture of the electronic device is determined to be a first posture, which includes the posture in which the screen display needs to be flipped.
[0101] In some exemplary embodiments of this disclosure, the preset coordinate axis includes a first axis, a second axis, and a third axis; the initial angle includes a first initial angle component under the first axis, a second initial angle component under the second axis, and a third initial angle component under the third axis; the angular velocity includes a first angular velocity component under the first axis, a second angular velocity component under the second axis, and a third angular velocity component under the third axis.
[0102] The attitude determination module is further configured to:
[0103] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis.
[0104] In some exemplary embodiments of this disclosure, the attitude determination module is further configured to:
[0105] A first rotation angle is determined based on the first initial angle component and the first angular velocity component; a second rotation angle is determined based on the second initial angle component and the second angular velocity component; and a third rotation angle is determined based on the third initial angle component and the third angular velocity component.
[0106] Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product.
[0107] If the sum of the fourth product, the fifth product, and the sixth product is greater than or equal to a fifth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0108] In some exemplary embodiments of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device.
[0109] In some exemplary embodiments of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device; and the third axis is an axis along the thickness direction of the electronic device.
[0110] In some exemplary embodiments of this disclosure, the adjustment method determination module is further configured to:
[0111] If the electronic device is in the first posture, the adjustment method of the screen display is determined to be the first adjustment method, which is to flip the screen display.
[0112] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0113] processor;
[0114] Memory used to store processor-executable instructions;
[0115] The processor is configured to perform the screen display adjustment method as described in the first aspect of this disclosure.
[0116] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, wherein when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform a screen display adjustment method as described in the first aspect of the present disclosure.
[0117] According to a fifth aspect of the present disclosure, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the electronic device to perform the screen display adjustment method described in the first aspect of the present disclosure.
[0118] The method described in this disclosure has the following beneficial effects: determining whether the accelerometer of the electronic device is in a first preset state, the first preset state including a state where the accelerometer is not operating normally; determining the attitude of the electronic device in response to the accelerometer being in the first preset state; determining the adjustment method of the screen display based on the attitude of the electronic device; and adjusting the screen display based on the adjustment method. When the accelerometer of the electronic device is in a state of abnormal operation, the orientation of the screen display can be adjusted according to the attitude of the electronic device, thereby improving the user experience.
[0119] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0120] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.
[0121] Figure 1 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0122] Figure 2 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0123] Figure 3 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0124] Figure 4 This is according to exemplary embodiments shown in this disclosure. Figure 3 Flowchart of step S302.
[0125] Figure 5This is a flowchart illustrating, according to an exemplary embodiment of the present disclosure, the determination of the attitude of an electronic device based on the geomagnetic component of the geomagnetic intensity on a preset coordinate axis in a preset coordinate system and the offset geomagnetic component of the geomagnetic intensity on the preset coordinate axis in a preset coordinate system.
[0126] Figure 6 This is a flowchart illustrating, according to an exemplary embodiment of the present disclosure, the determination of the attitude of an electronic device based on the geomagnetic component of the geomagnetic intensity on a preset coordinate axis in a preset coordinate system and the offset geomagnetic component of the geomagnetic intensity on the preset coordinate axis in a preset coordinate system.
[0127] Figure 7 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0128] Figure 8 This is a flowchart illustrating, according to an exemplary embodiment of the present disclosure, the determination of the attitude of an electronic device based on a first initial angle component and a first angular velocity component of a first axis, and / or a second initial angle component and a second angular velocity component of a second axis.
[0129] Figure 9 This is a flowchart illustrating, according to an exemplary embodiment of the present disclosure, the determination of the attitude of an electronic device based on a first initial angle component and a first angular velocity component of a first axis, a second initial angle component and a second angular velocity component of a second axis, and a third initial angle component and a third angular velocity component of a third axis.
[0130] Figure 10 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0131] Figure 11 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0132] Figure 12 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0133] Figure 13 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure.
[0134] Figure 14 This is a block diagram of a screen display adjustment device according to an exemplary embodiment of the present disclosure.
[0135] Figure 15 This is a block diagram of an electronic device 1500 shown according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0136] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.
[0137] In electronic devices, accelerometers are widely used for the automatic horizontal and vertical rotation of screen displays. However, accelerometers are quite sensitive to stress. If an electronic device is dropped or impacted during use, the data from at least one axis of the accelerometer may become stuck in the same range, preventing it from functioning properly. In this case, the accelerometer data cannot change normally with changes in the electronic device's orientation, causing the screen display to fail to rotate correctly and resulting in a poor user experience.
[0138] To address the aforementioned issues, this disclosure provides a method for adjusting a screen display, comprising: determining whether the accelerometer of an electronic device is in a first preset state, the first preset state including a state where the accelerometer is in an abnormal operating state; determining the posture of the electronic device in response to the accelerometer being in the first preset state; determining an adjustment method for the screen display based on the posture of the electronic device; and adjusting the screen display of the electronic device according to the adjustment method. When the accelerometer of the electronic device is in an abnormal operating state, the orientation of the screen display can be adjusted according to the posture of the electronic device, thereby improving the user experience.
[0139] The exemplary embodiments of this disclosure provide a method for adjusting the screen display, which is applied to electronic devices, including mobile phones, tablets, and other devices with screens.
[0140] like Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0141] S101. Determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in an abnormal working state.
[0142] An accelerometer is a sensor that measures acceleration and is widely used in electronic devices for automatically rotating the screen. When using an accelerometer to control the automatic rotation of the screen, if the accelerometer is not functioning properly, the screen will not rotate automatically.
[0143] Abnormal operating conditions of an accelerometer can include axis jamming, which means that the data of at least one axis of the accelerometer is stuck and cannot change with the attitude of the electronic device.
[0144] After the accelerometer is turned on, the processor of the electronic device can collect multiple data points from the accelerometer and determine whether the accelerometer is in an abnormal working state by judging whether the multiple data points show a jamming effect.
[0145] S102. In response to the accelerometer being in a first preset state, determine the attitude of the electronic device.
[0146] When the accelerometer is malfunctioning, its data cannot be used as the basis for automatically rotating the screen display. In this case, the orientation of the electronic device can be determined, and the automatic rotation of the screen display can be controlled based on the orientation of the electronic device. The orientation of the electronic device can be either an orientation where the screen display needs to be rotated or an orientation where the screen display does not need to be rotated.
[0147] The attitude of an electronic device can be determined using data collected from its GPS and geomagnetic sensors, or it can be determined using data collected from its gyroscope.
[0148] S103. Determine the adjustment method for the screen display based on the posture of the electronic device.
[0149] The screen display is adjusted according to the posture of the electronic device. For example, if the posture of the electronic device is a first posture, the first posture may include a posture in which the screen display needs to be flipped. In this case, the adjustment method of the screen display is determined to be the first adjustment method, which may be to flip the screen display.
[0150] For example, if the electronic device is in a second posture, the second posture may include a posture in which the screen display does not need to be flipped. In this case, the adjustment method of the screen display is determined to be the second adjustment method, which may be to not adjust the screen display.
[0151] S104. Adjust the screen display of the electronic device according to the adjustment method.
[0152] The screen display of the electronic device is adjusted according to the determined adjustment method. For example, if the adjustment method is the first adjustment method, the screen display is flipped; if the adjustment method is the second adjustment method, the screen display is not adjusted and remains in its current orientation.
[0153] In the exemplary embodiments of this disclosure, if the accelerometer of the electronic device is in an abnormal working state, the attitude of the electronic device is determined, and the screen display is adjusted based on the attitude of the electronic device. This avoids the situation where the screen display cannot be flipped normally due to the accelerometer being in an abnormal working state, thus improving the user experience.
[0154] like Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0155] S201. After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer.
[0156] Users can manually turn on the accelerometer through the accelerometer on / off function in the electronic device's settings interface, or the accelerometer will be automatically turned on when the user launches an application that has permission to turn on the accelerometer.
[0157] Once the accelerometer is activated, the processor of the electronic device can issue corresponding instructions to instruct the accelerometer to upload multiple acceleration data points to the processor. For example, the processor may instruct the accelerometer to upload 10 consecutively collected data points after activation to the processor.
[0158] Once the accelerometer is turned on, it can automatically upload multiple acceleration data points to the processor of the electronic device. For example, it can upload 10 consecutively collected data points after the accelerometer is turned on to the processor.
[0159] S202. Based on multiple acceleration data, determine whether the accelerometer is in the first preset state.
[0160] By checking whether changes in multiple acceleration data points are abnormal, it can be determined whether the accelerometer is stuck, and thus whether the accelerometer is in an abnormal working state.
[0161] Each acceleration data point includes data for a preset coordinate system and its preset axes. The preset coordinate system can be a spatial Cartesian coordinate system, which consists of three mutually perpendicular axes sharing a common origin. The preset coordinate axes can include a first axis (the axis along the length of the electronic device) and a second axis (the axis along the width of the electronic device). The preset coordinate axes can also include a third axis (the axis along the thickness of the electronic device). Each acceleration data point can include data for the first axis, the second axis, and the third axis.
[0162] Based on the data from multiple acceleration data points on preset coordinate axes in a preset coordinate system, it can be determined whether the accelerometer is in a first preset state. This first preset state may include a state where the accelerometer is not operating normally. When the preset coordinate system is a spatial rectangular coordinate system, it can be determined whether the data from the first, second, and third axes show signs of jamming to indicate whether the accelerometer is in a malfunctioning state. If any axis shows signs of jamming, the accelerometer is determined to be in a malfunctioning state.
[0163] When the electronic device is handheld, the acceleration data on the third axis (the thickness direction) has little impact on determining whether the screen display needs to be flipped. Therefore, when determining the device's attitude, only the data on the first and second axes need to be considered. This allows us to determine if the accelerometer is malfunctioning by checking for axis jamming in the first and second axis data. If any axis shows jamming, the accelerometer is considered to be malfunctioning.
[0164] In exemplary embodiments of this disclosure, the accelerometer's state of operation can be determined based on the deviation between multiple acceleration data points along preset coordinate axes in a preset coordinate system. For example, the variance of the data along any preset coordinate axis in the preset coordinate system can be used to determine if the accelerometer is in the first preset state. For instance, the accelerometer is determined to be in the first preset state when the variance of the data along any preset coordinate axis in the preset coordinate system meets a first preset condition. The first preset condition may include a variance less than or equal to a first preset value. The first preset value can be a critical value characterizing the magnitude of the deviation between multiple acceleration data points along preset coordinate axes in the preset coordinate system. That is, when the variance of the data along any preset axis in the preset coordinate system is less than or equal to the first preset value, it indicates that the deviation between the multiple acceleration data points along preset axes in the preset coordinate system is small, thus determining that the accelerometer is in an abnormal operating state. The first preset value could be, for example, 0.002 m / s². 2 Variance is the average of the squared differences between each sample value and the mean of all sample values. For example, if there are 10 acceleration data points, the variance for each axis is the average of the squared differences between each acceleration data point on that axis and the mean of all 10 acceleration data points on that axis. If the variance of one axis is less than or equal to 0.002 m / s², then... 2 If so, it can be determined that the accelerometer is in an abnormal operating state.
[0165] S203. In response to the accelerometer being in a first preset state, determine the attitude of the electronic device.
[0166] S204. Determine the adjustment method for the screen display based on the posture of the electronic device.
[0167] S205. Adjust the screen display of the electronic device according to the adjustment method.
[0168] The implementation methods for steps S203-S205 are the same as those for steps S102-S104, and will not be repeated here.
[0169] In an exemplary embodiment of this disclosure, when the accelerometer is activated, multiple acceleration data are collected, and the variance of the data for each preset coordinate axis in a preset coordinate system is calculated. If the variance of at least one axis is less than or equal to a first preset value, the accelerometer is determined to be in an abnormal operating state. At this time, by determining the posture of the electronic device, the adjustment of the screen display is controlled based on the posture of the electronic device, avoiding the situation where the screen display cannot rotate normally due to the accelerometer being in an abnormal operating state, thus improving the user experience.
[0170] like Figure 3 As shown, Figure 3 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0171] S301. Determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in an abnormal working state.
[0172] The implementation methods of step S301 and step S101 are the same, and will not be described again here.
[0173] S302. Determine the geomagnetic intensity of the geographical location of the electronic device.
[0174] Geomagnetic intensity refers to the strength of the Earth's magnetic field at a specific point on the Earth's surface. The geomagnetic intensity at each point on Earth corresponds one-to-one with latitude and longitude. Therefore, the geomagnetic intensity at the location of an electronic device can be determined by identifying its latitude and longitude.
[0175] In exemplary embodiments of this disclosure, such as Figure 4 As shown, step S302 specifically includes:
[0176] S302-1. Obtain the latitude and longitude information of the electronic device's geographical location.
[0177] The latitude and longitude information of an electronic device can be determined using systems such as the built-in Global Positioning System (GPS) or the BeiDou Navigation Satellite System. Both GPS and BeiDou are based on space positioning technology, which involves measuring the distance between the electronic device and at least four satellites, and then using the principle of tri-sphere intersection to determine the latitude and longitude of the device.
[0178] S302-2. Determine the geomagnetic intensity of the geographical location of the electronic device based on latitude and longitude information.
[0179] There is a one-to-one correspondence between the geomagnetic intensity and latitude / longitude at every point on Earth. Electronic devices can pre-store this correspondence. After obtaining the latitude / longitude information of the electronic device's location, the geomagnetic intensity at that location can be determined by querying this correspondence.
[0180] S303. Obtain the offset geomagnetic intensity of the electronic device.
[0181] Offset geomagnetic intensity can be measured by a geomagnetic sensor in an electronic device. A geomagnetic sensor is a device that determines direction by detecting changes in the Earth's magnetic field. When the electronic device rotates within a preset coordinate system, the offset geomagnetic intensity measured by the geomagnetic sensor will differ from the actual geomagnetic intensity.
[0182] S304. Determine the attitude of the electronic equipment based on the geomagnetic intensity and the offset geomagnetic intensity.
[0183] The attitude of an electronic device can be determined based on the geomagnetic components of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system and the offset geomagnetic components of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system.
[0184] The preset coordinate system can be a spatial rectangular coordinate system, which is a coordinate system composed of three mutually perpendicular number axes that share a common origin. The preset coordinate axes can include a first axis and a second axis. The first axis can be an axis along the length direction of the electronic device, and the second axis can be an axis along the width direction of the electronic device. The preset coordinate axes can also include a third axis, which can be an axis along the thickness direction of the electronic device. The geomagnetic components include a first geomagnetic component under the first axis, a second geomagnetic component under the second axis, and a third geomagnetic component under the third axis. The offset geomagnetic components include a first offset geomagnetic component under the first axis, a second offset geomagnetic component under the second axis, and a third offset geomagnetic component under the third axis.
[0185] When the electronic device is a handheld device, the geomagnetic component data along the third axis, i.e., the thickness direction of the electronic device, has little impact on determining whether the screen display needs to be flipped. Therefore, when determining the attitude of the electronic device, only the first geomagnetic component of the first axis and the second geomagnetic component of the second axis can be considered. Similarly, only the first offset geomagnetic component of the first axis and the second offset geomagnetic component of the second axis can be considered to determine the attitude of the electronic device.
[0186] In exemplary embodiments of this disclosure, such as Figure 5 As shown, the attitude of the electronic device is determined based on the geomagnetic components of the geomagnetic intensity along the preset coordinate axes in the preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axes in the preset coordinate system. Specifically, this includes:
[0187] S304-1. Determine the first angle between the first geomagnetic component and the first offset geomagnetic component based on the geomagnetic intensity, the first geomagnetic component and the first offset geomagnetic component, and / or determine the second angle between the second geomagnetic component and the second offset geomagnetic component based on the geomagnetic intensity, the second geomagnetic component and the second offset geomagnetic component.
[0188] For example, the first included angle can be calculated using the following three formulas.
[0189] Δθ=θ′-θ
[0190] Δθ is the first included angle, and B is the geomagnetic intensity at the geographical location of the electronic device. x M is the first geomagnetic component. x θ′ represents the first offset geomagnetic component, θ is the angle of the first geomagnetic component relative to the first axis, and θ′ represents the angle of the first offset geomagnetic component relative to the first axis.
[0191] For example, the second included angle can be calculated using the following three formulas.
[0192] Δφ=φ′-φ
[0193] Δφ is the second included angle, and B is the geomagnetic intensity at the geographical location of the electronic device. y M is the second geomagnetic component. y φ′ represents the second offset geomagnetic component, φ is the angle of the second geomagnetic component relative to the second axis, and φ′ represents the angle of the second offset geomagnetic component relative to the second axis.
[0194] You can calculate the first included angle and the second included angle at the same time, or you can calculate only the first included angle, or only the second included angle.
[0195] S304-2. If the first included angle and / or the second included angle are greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0196] It can simultaneously determine whether the first included angle and the second included angle are greater than or equal to a second preset value. When both the first and second included angles are greater than or equal to the second preset value, the posture of the electronic device is determined to be the posture in which the screen display needs to be flipped. Alternatively, it can only determine whether the first included angle is greater than or equal to the second preset value. If the first included angle is greater than or equal to the second preset value, the posture of the electronic device is determined to be the posture in which the screen display needs to be flipped. It can also only determine whether the second included angle is greater than or equal to the second preset value. If the second included angle is greater than or equal to the second preset value, the posture of the electronic device is determined to be the posture in which the screen display needs to be flipped.
[0197] The angle between the geomagnetic component on the same axis and the offset geomagnetic component reflects the rotation angle of the electronic device relative to this axis. The second preset value can be set according to the angle at which the screen display needs to be flipped when the electronic device rotates. For example, if the second preset value is set to 60°, and the first angle and / or the second angle is greater than or equal to 60°, it means that the rotation angle of the electronic device relative to the first axis and / or the second axis is greater than or equal to 60°. At this time, the screen display needs to be flipped to adapt to the user's viewing angle.
[0198] To more comprehensively determine the attitude of an electronic device, the first geomagnetic component of the first axis, the second geomagnetic component of the second axis, and the third geomagnetic component of the third axis can be considered to determine the attitude of the electronic device. Simultaneously, the first offset geomagnetic component of the first axis, the second offset geomagnetic component of the second axis, and the third offset geomagnetic component of the third axis can also be considered to determine the attitude of the electronic device.
[0199] In exemplary embodiments of this disclosure, such as Figure 6 As shown, the attitude of the electronic device is determined based on the geomagnetic components of the geomagnetic intensity along the preset coordinate axes in the preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axes in the preset coordinate system. Specifically, this includes:
[0200] S304-3. Determine the first angle between the first geomagnetic component and the first offset geomagnetic component based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component; determine the second angle between the second geomagnetic component and the second offset geomagnetic component based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component; determine the third angle between the third geomagnetic component and the third offset geomagnetic component based on the geomagnetic intensity, the third geomagnetic component, and the third offset geomagnetic component.
[0201] For example, the first included angle can be calculated using the following three formulas.
[0202] Δθ=θ′-θ
[0203] Δθ is the first included angle, and B is the geomagnetic intensity at the geographical location of the electronic device. x M is the first geomagnetic component. x θ′ represents the first offset geomagnetic component, θ is the angle of the first geomagnetic component relative to the first axis, and θ′ represents the angle of the first offset geomagnetic component relative to the first axis.
[0204] For example, the second included angle can be calculated using the following three formulas.
[0205] Δφ=φ′-φ
[0206] Δφ is the second included angle, and B is the geomagnetic intensity at the geographical location of the electronic device. y M is the second geomagnetic component. y φ′ represents the second offset geomagnetic component, φ is the angle of the second geomagnetic component relative to the second axis, and φ′ represents the angle of the second offset geomagnetic component relative to the second axis.
[0207] For example, the third included angle can be calculated using the following three formulas.
[0208] Δα=α′-α
[0209] Δα is the third included angle, and B is the geomagnetic intensity at the geographical location of the electronic device. z M is the third geomagnetic component. z ' is the third offset geomagnetic component, α is the angle of the third geomagnetic component relative to the third axis, and α′ is the angle of the third offset geomagnetic component relative to the third axis.
[0210] The angle between the geomagnetic component on the same axis and the offset geomagnetic component can reflect the rotation angle of the electronic device relative to this axis.
[0211] S304-4. Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product.
[0212] When the electronic device is handheld, the first, second, and third included angles have different degrees of influence on determining the device's posture. Different weights can be assigned based on these varying degrees of influence. The first weight represents the degree of influence of the first included angle on determining the device's posture, the second weight represents the degree of influence of the second included angle on determining the device's posture, and the third weight represents the degree of influence of the third included angle on determining the device's posture. For example, if the first and second included angles have a greater influence on determining the device's posture, and the third included angle has a smaller influence, then the first weight can be set to 1, the second weight to 1, and the third weight to 0.01.
[0213] For example, if the first included angle is 60°, the second included angle is 70°, and the third included angle is 90°, then the first product is 60°, the second product is 70°, and the third product is 0.9°.
[0214] The first, second, and third weights can also be set to other values according to actual needs, and no restrictions are imposed here.
[0215] S304-5. If the sum of the first product, the second product, and the third product is greater than or equal to the third preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0216] The first product reflects both the rotation angle of the electronic device relative to the first axis and the weight of this rotation angle in evaluating the attitude of the electronic device. Similarly, the second product reflects both the rotation angle of the electronic device relative to the second axis and the weight of this rotation angle in evaluating the attitude of the electronic device; the third product reflects both the rotation angle of the electronic device relative to the third axis and the weight of this rotation angle in evaluating the attitude of the electronic device.
[0217] The sum of the first, second, and third products reflects the degree of rotation of the electronic device relative to the Cartesian coordinate system. The third preset value can be set based on the standard value required to flip the screen display when the electronic device rotates. For example, if the third preset value is set to 120°, and the sum of the first, second, and third products is greater than or equal to 120°, it means that the degree of rotation of the electronic device relative to the Cartesian coordinate system exceeds the standard value required to flip the screen display. In this case, the screen display needs to be flipped to fit the user's viewing angle.
[0218] S305. Determine the adjustment method for the screen display based on the posture of the electronic device.
[0219] S306. Adjust the screen display of the electronic device according to the adjustment method.
[0220] The implementation methods for steps S305-S306 are the same as those for steps S103-S104, and will not be repeated here.
[0221] In the exemplary embodiments of this disclosure, if the accelerometer of the electronic device is in an abnormal working state, the geomagnetic intensity of the geographical location of the electronic device is obtained, and then the geomagnetic sensor of the electronic device is used to obtain the offset geomagnetic intensity. The attitude of the electronic device is determined by the geomagnetic component and the offset geomagnetic component. The screen display is adjusted by the attitude of the electronic device, which avoids the situation where the screen display cannot be flipped normally due to the accelerometer being in an abnormal working state, thus improving the user experience.
[0222] like Figure 7 As shown, Figure 7 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0223] S701. Determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in an abnormal working state.
[0224] The implementation methods of step S701 and step S101 are the same, and will not be described again here.
[0225] S702, Obtain the angular velocity of the gyroscope of the electronic device.
[0226] A gyroscope is a device for measuring angular velocity. The processor of an electronic device can instruct the gyroscope to report the current angular velocity when needed.
[0227] S703. Determine the attitude of the electronic device based on the initial angle and angular velocity. The initial angle is the angle of the electronic device in the preset coordinate system when the accelerometer is turned on.
[0228] The attitude of the electronic device is determined based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system.
[0229] The preset coordinate system can be a spatial rectangular coordinate system, which is a coordinate system composed of three mutually perpendicular number axes that share a common origin. The preset coordinate axes can include a first axis and a second axis. The first axis can be the axis along the length direction of the electronic device, and the second axis can be the axis along the width direction of the electronic device. The preset coordinate axes can also include a third axis, which can be the axis along the thickness direction of the electronic device. The initial angle includes a first initial angle component under the first axis, a second initial angle component under the second axis, and a third initial angle component under the third axis. The angular velocity includes a first angular velocity component under the first axis, a second angular velocity component under the second axis, and a third angular velocity component under the third axis.
[0230] When the electronic device is handheld, the angular velocity component along the third axis (i.e., the thickness direction of the electronic device) has little impact on determining whether the screen display needs to be flipped. Therefore, when determining the attitude of the electronic device, only the first angular velocity component of the first axis and the second angular velocity component of the second axis can be considered. Similarly, only the first initial angle component of the first axis and the second initial angle component of the second axis can be considered to determine the attitude of the electronic device.
[0231] The first initial angle component and the first angular velocity component can represent the rotation angle of the electronic device relative to the first axis, and the second initial angle component and the second angular velocity component can represent the rotation angle of the electronic device relative to the second axis. Therefore, the attitude of the electronic device can be determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis.
[0232] In exemplary embodiments of this disclosure, such as Figure 8 As shown, the attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis, specifically including:
[0233] S703-1. Determine a first rotation angle based on a first initial angle component and a first angular velocity component, and / or determine a second rotation angle based on a second initial angle component and a second angular velocity component.
[0234] S703-2. If the first rotation angle and / or the second rotation angle are greater than or equal to the fourth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0235] If the attitude of the electronic device is determined solely based on the first initial angular component and the first angular velocity component, the first rotation angle can be determined using the following formula. Wherein, The first rotation angle, Let ω be the first initial angular component. x Let t be the first angular velocity component, and t be the time interval from when the accelerometer is turned on to when the angular velocity is acquired.
[0236]
[0237] The fourth preset value can be set according to the angle at which the screen display needs to be flipped when the electronic device rotates. For example, if the fourth preset value is set to 60°, and the first rotation angle is greater than or equal to 60°, it means that the rotation angle of the electronic device relative to the first axis is greater than or equal to 60°. At this time, the screen display needs to be flipped to adapt to the user's viewing angle.
[0238] If the attitude of the electronic device is determined solely based on the second initial angle component and the second angular velocity component, the second rotation angle can be determined using the following formula: where ψ is the second rotation angle, ψ0 is the second initial angle component, and ω... y The second angular velocity component is denoted by t, which is the time interval from when the accelerometer is turned on to when the angular velocity is acquired.
[0239] ψ=ψ0+∫ω y dt
[0240] For example, if the fourth preset value is set to 60°, and the second rotation angle is greater than or equal to 60°, it means that the rotation angle of the electronic device relative to the second axis is greater than or equal to 60°. At this time, the screen display needs to be flipped to adapt to the user's viewing angle.
[0241] If it is necessary to determine the posture of the electronic device based on the first initial angle component and the first angular velocity component of the first axis, and the second initial angle component and the second angular velocity component of the second axis, the first rotation angle and the second rotation angle can be calculated using the above formulas respectively. When both the first rotation angle and the second rotation angle are greater than or equal to the fourth preset value, the posture of the electronic device is determined to be the posture in which the screen display needs to be flipped.
[0242] To more comprehensively determine the attitude of the electronic device, the first angular velocity component of the first axis, the second angular velocity component of the second axis, and the third angular velocity component of the third axis can be considered to determine the attitude of the electronic device. Simultaneously, the first initial angle component of the first axis, the second initial angle component of the second axis, and the third initial angle component of the third axis can be considered to determine the attitude of the electronic device.
[0243] The first initial angle component and the first angular velocity component can represent the rotation angle of the electronic device relative to the first axis, the second initial angle component and the second angular velocity component can represent the rotation angle of the electronic device relative to the second axis, and the third initial angle component and the third angular velocity component can represent the rotation angle of the electronic device relative to the third axis. Therefore, the attitude of the electronic device can be determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis.
[0244] In exemplary embodiments of this disclosure, such as Figure 9 As shown, the attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis. Specifically, this includes:
[0245] S703-3. Determine the first rotation angle based on the first initial angle component and the first angular velocity component, determine the second rotation angle based on the second initial angle component and the second angular velocity component, and determine the third rotation angle based on the third initial angle component and the third angular velocity component.
[0246] The first rotation angle can be determined using the following formula. Where, The first rotation angle, Let ω be the first initial angular component. x Let t be the first angular velocity component, and t be the time interval from when the accelerometer is turned on to when the angular velocity is acquired.
[0247]
[0248] The second rotation angle can be determined using the following formula: where ψ is the second rotation angle, ψ0 is the second initial angle component, and ω... y The second angular velocity component is denoted by t, which is the time interval from when the accelerometer is turned on to when the angular velocity is acquired.
[0249] ψ=ψ0+∫ω y dt
[0250] The third rotation angle can be determined using the following formula: where β is the third rotation angle, β0 is the third initial angle component, and ω... z The third angular velocity component is denoted by t, which is the time interval from when the accelerometer is turned on to when the angular velocity is acquired.
[0251] β=β0+∫ω z dt
[0252] S703-4. Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product.
[0253] When the electronic device is handheld, the first, second, and third rotation angles have different degrees of influence on determining the device's posture. Different weights can be assigned based on these varying degrees of influence. A fourth weight can represent the influence of the first rotation angle on the device's posture, a fifth weight can represent the influence of the second rotation angle, and a sixth weight can represent the influence of the third rotation angle. For example, if the first and second rotation angles have a greater influence on the device's posture, while the third rotation angle has a smaller influence, then the fourth weight can be set to 1, the fifth weight to 1, and the sixth weight to 0.01.
[0254] For example, if the first rotation angle is 60°, the second rotation angle is 70°, and the third rotation angle is 90°, then the fourth product is 60°, the fifth product is 70°, and the sixth product is 0.9°.
[0255] The fourth, fifth, and sixth weights can also be set to other values according to actual needs, and no restrictions are imposed here.
[0256] S703-5. If the sum of the fourth, fifth, and sixth products is greater than or equal to the fifth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0257] The fourth product can reflect both the rotation angle of the electronic device relative to the first axis and the weight of this rotation angle in evaluating the attitude of the electronic device. Similarly, the fifth product can reflect both the rotation angle of the electronic device relative to the second axis and the weight of this rotation angle in evaluating the attitude of the electronic device; the sixth product can reflect both the rotation angle of the electronic device relative to the third axis and the weight of this rotation angle in evaluating the attitude of the electronic device.
[0258] The sum of the fourth, fifth, and sixth products reflects the degree of rotation of the electronic device relative to the Cartesian coordinate system. The fifth preset value can be set based on the standard value required for screen rotation when the electronic device rotates. For example, if the fifth preset value is set to 120°, and the sum of the fourth, fifth, and sixth products is greater than or equal to 120°, it indicates that the degree of rotation of the electronic device relative to the Cartesian coordinate system exceeds the standard value required for screen rotation. In this case, the screen display needs to be rotated to fit the user's viewing angle.
[0259] S704. Determine the adjustment method for the screen display based on the posture of the electronic device.
[0260] S705. Adjust the screen display of the electronic device according to the adjustment method.
[0261] The implementation methods of steps S704-S705 are the same as those of steps S103-S104, and will not be repeated here.
[0262] In the exemplary embodiments of this disclosure, if the accelerometer of the electronic device is in an abnormal working state, the angular velocity detected by the gyroscope of the electronic device is obtained. The attitude of the electronic device is determined by the initial angle of the electronic device in the preset coordinate system when the accelerometer is turned on and the obtained angular velocity. The screen display is adjusted by the attitude of the electronic device, which avoids the situation where the screen display cannot be flipped normally due to the accelerometer being in an abnormal working state, thus improving the user experience.
[0263] like Figure 10 As shown, Figure 10 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0264] S1001. After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer.
[0265] S1002. When the variance of multiple acceleration data on any preset coordinate axis in the preset coordinate system is less than or equal to the first preset value, the accelerometer is determined to be in an abnormal working state.
[0266] S1003. Obtain the latitude and longitude information of the electronic device's geographical location.
[0267] S1004. Determine the geomagnetic intensity of the geographical location of the electronic device based on latitude and longitude information.
[0268] S1005. Obtain the offset geomagnetic intensity of the electronic device.
[0269] S1006. Determine the first included angle between the first geomagnetic component and the first offset geomagnetic component based on the geomagnetic intensity, the first geomagnetic component of the first axis of the geomagnetic intensity in the preset coordinate system, and the first offset geomagnetic component of the geomagnetic intensity on the first axis, and / or determine the second included angle between the second geomagnetic component and the second offset geomagnetic component based on the geomagnetic intensity, the second geomagnetic component of the second axis of the geomagnetic intensity in the preset coordinate system, and the second offset geomagnetic component of the geomagnetic intensity on the second axis.
[0270] S1007. If the first included angle and / or the second included angle are greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0271] S1008. If the electronic device is in the first posture, determine the adjustment method of the screen display as the first adjustment method, which is to flip the screen display.
[0272] S1009. Adjust the screen display of the electronic device according to the adjustment method.
[0273] In an exemplary embodiment of this disclosure, after the accelerometer is activated, multiple acceleration data points are acquired. The variance of the multiple acceleration data points on each preset coordinate axis in a preset coordinate system is calculated. If the variance of at least one axis is less than or equal to a first preset value, it is determined that the accelerometer is in an abnormal operating state, and in this case, the accelerometer cannot be used to control the screen display rotation. The geomagnetic intensity of the electronic device's geographical location is acquired, and then the offset geomagnetic intensity is acquired using the electronic device's geomagnetic sensor. The attitude of the electronic device is determined by whether the angle between the geomagnetic component of the geomagnetic intensity on the coordinate axis and the offset geomagnetic component of the offset geomagnetic intensity on the same coordinate axis is greater than or equal to a second preset value. If the attitude of the electronic device is the attitude in which the screen display needs to be rotated, then the adjustment method for the screen display is determined to be rotating the screen display, and the screen display is rotated using this adjustment method. This avoids the situation where the screen display cannot rotate normally due to the accelerometer being in an abnormal operating state, thus improving the user experience.
[0274] like Figure 11 As shown, Figure 11 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0275] S1101. After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer.
[0276] S1102. When the variance of multiple acceleration data on any preset coordinate axis in the preset coordinate system is less than or equal to the first preset value, the accelerometer is determined to be in an abnormal working state.
[0277] S1103. Obtain the latitude and longitude information of the electronic device's geographical location.
[0278] S1104. Determine the geomagnetic intensity of the geographical location of the electronic device based on latitude and longitude information.
[0279] S1105. Obtain the offset geomagnetic intensity of the electronic device.
[0280] S1106. Determine the first angle between the first magnetic component and the first offset magnetic component based on the geomagnetic intensity, the first geomagnetic component of the first axis of the geomagnetic intensity in the preset coordinate system, and the first offset magnetic component of the geomagnetic intensity on the first axis. Determine the second angle between the second magnetic component and the second offset magnetic component based on the geomagnetic intensity, the second geomagnetic component of the second axis of the geomagnetic intensity in the preset coordinate system, and the second offset magnetic component of the geomagnetic intensity on the second axis. Determine the third angle between the third magnetic component and the third offset magnetic component based on the geomagnetic intensity, the third geomagnetic component of the third axis of the geomagnetic intensity in the preset coordinate system, and the third offset magnetic component of the geomagnetic intensity on the third axis.
[0281] S1107. Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product.
[0282] S1108. If the sum of the first product, the second product, and the third product is greater than or equal to the third preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0283] S1109. If the electronic device is in a first posture, determine the adjustment method of the screen display as a first adjustment method, which is to flip the screen display.
[0284] S1110. Adjust the screen display of the electronic device according to the adjustment method.
[0285] In an exemplary embodiment of this disclosure, after the accelerometer is activated, multiple acceleration data points are acquired. The variance of the multiple acceleration data points on each preset coordinate axis in a preset coordinate system is calculated. If the variance of at least one axis is less than or equal to a first preset value, it is determined that the accelerometer is in an abnormal operating state, and in this case, the accelerometer cannot be used to control the screen display rotation. The geomagnetic intensity of the electronic device's geographical location is acquired, and then the offset geomagnetic intensity is acquired using the electronic device's geomagnetic sensor. The attitude of the electronic device is determined by the angle between the geomagnetic component of the geomagnetic intensity on the coordinate axis and the offset geomagnetic component of the offset geomagnetic intensity on the same coordinate axis, and their corresponding weights. If the attitude of the electronic device is one in which the screen display needs to be rotated, then the adjustment method for the screen display is determined to be rotating the screen display. This method is used to rotate the screen display. This avoids the situation where the screen display cannot rotate normally due to the accelerometer being in an abnormal operating state, thus improving the user experience.
[0286] like Figure 12 As shown, Figure 12 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0287] S1201. After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer.
[0288] S1202. When the variance of multiple acceleration data on any preset coordinate axis in the preset coordinate system is less than or equal to the first preset value, the accelerometer is determined to be in an abnormal working state.
[0289] S1203. Obtain the angular velocity of the gyroscope of the electronic device.
[0290] S1204. Determine a first rotation angle based on the first initial angle component of the first axis and the first angular velocity component of the first axis in the preset coordinate system, and / or determine a second rotation angle based on the second initial angle component of the second axis and the second angular velocity component of the second axis in the preset coordinate system; the initial angle is the angle of the electronic device in the preset coordinate system when the accelerometer is turned on.
[0291] S1205. If the first rotation angle and / or the second rotation angle are greater than or equal to the fourth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0292] S1206. If the electronic device is in the first posture, determine the adjustment method of the screen display as the first adjustment method, which is to flip the screen display.
[0293] S1207. Adjust the screen display of the electronic device according to the adjustment method.
[0294] In an exemplary embodiment of this disclosure, after the accelerometer is turned on, multiple acceleration data are acquired, and the variance of the multiple acceleration data on each preset coordinate axis in a preset coordinate system is calculated. If the variance of at least one axis is less than or equal to a first preset value, it is determined that the accelerometer is in an abnormal working state, and in this case, the accelerometer cannot be used to control the flipping of the screen display. The angular velocity detected by the gyroscope of the electronic device is acquired, and the attitude of the electronic device is determined by the rotation angle determined by the initial angular component of the initial angle of the electronic device in the preset coordinate system on the coordinate axis when the accelerometer is turned on and the angular velocity component of the acquired angular velocity on the same coordinate axis. If the attitude of the electronic device is the attitude in which the screen display needs to be flipped, the adjustment method for the screen display is determined to be flipping the screen display, and the screen display is flipped using this adjustment method. This avoids the situation where the screen display cannot be flipped normally due to the accelerometer being in an abnormal working state, thus improving the user experience.
[0295] like Figure 13 As shown, Figure 13 This is a flowchart illustrating a method for adjusting a screen display image according to an exemplary embodiment of the present disclosure, comprising:
[0296] S1301. After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer.
[0297] S1302. When the variance of multiple acceleration data on any preset coordinate axis in a preset coordinate system is less than or equal to the first preset value, the accelerometer is determined to be in an abnormal working state.
[0298] S1303. Obtain the angular velocity of the gyroscope of the electronic device.
[0299] S1304. Determine a first rotation angle based on the first initial angle component of the first axis and the first angular velocity component of the first axis in the preset coordinate system; determine a second rotation angle based on the second initial angle component of the second axis and the second angular velocity component of the second axis in the preset coordinate system; determine a third rotation angle based on the third initial angle component of the third axis and the third angular velocity component of the third axis in the preset coordinate system; the initial angle is the angle of the electronic device in the preset coordinate system when the accelerometer is turned on.
[0300] S1305. Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product.
[0301] S1306. If the sum of the fourth product, the fifth product, and the sixth product is greater than or equal to the fifth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0302] S1307. If the electronic device is in a first posture, determine the adjustment method of the screen display as a first adjustment method, which is to flip the screen display.
[0303] S1308. Adjust the screen display of the electronic device according to the adjustment method.
[0304] In an exemplary embodiment of this disclosure, after the accelerometer is activated, multiple acceleration data points are acquired. The variance of the acceleration data points on each preset coordinate axis in a preset coordinate system is calculated. If the variance of at least one axis is less than or equal to a first preset value, it is determined that the accelerometer is in an abnormal operating state, and in this case, the accelerometer cannot be used to control the screen display rotation. The angular velocity detected by the gyroscope of the electronic device is acquired, the initial angle of the electronic device in the preset coordinate system when the accelerometer is activated is acquired, the rotation angle is calculated, and the attitude of the electronic device is determined by combining weights. If the attitude of the electronic device is the attitude in which the screen display needs to be rotated, the adjustment method for the screen display is determined to be to rotate the screen display. This method is used to rotate the screen display. This avoids the situation where the screen display cannot rotate normally due to the accelerometer being in an abnormal operating state, thus improving the user experience.
[0305] This disclosure provides an exemplary embodiment of a screen display adjustment device, applicable to electronic devices, which may include devices with screens such as mobile phones and tablets. Figure 14 As shown, Figure 14This is a block diagram of a screen display adjustment device according to an exemplary embodiment of the present disclosure. The screen display adjustment device includes: an accelerometer state determination module 1401, configured to determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including an accelerometer in a non-normal working state; an attitude determination module 1402, configured to determine the attitude of the electronic device in response to the accelerometer being in the first preset state; an adjustment method determination module 1403, configured to determine the adjustment method of the screen display based on the attitude of the electronic device; and an adjustment module 1404, configured to adjust the screen display of the electronic device according to the adjustment method.
[0306] In the exemplary embodiments of this disclosure, if the accelerometer state determination module 1401 determines that the accelerometer of the electronic device is in an abnormal working state, the attitude determination module 1402 determines the attitude of the electronic device, the adjustment method determination module 1403 determines the adjustment method of the screen display based on the attitude of the electronic device, and the adjustment module 1404 adjusts the screen display of the electronic device according to the adjustment method. This achieves the adjustment of the screen display based on the attitude of the electronic device, avoiding the situation where the screen display cannot be flipped normally due to the accelerometer being in an abnormal working state, thus improving the user experience.
[0307] In an exemplary embodiment of this disclosure, the accelerometer state determination module 1401 is further configured to:
[0308] After the accelerometer is turned on, acquire multiple acceleration data from the accelerometer;
[0309] Based on multiple acceleration data, determine whether the accelerometer is in the first preset state.
[0310] In an exemplary embodiment of this disclosure, the accelerometer state determination module 1401 is further configured to:
[0311] Based on the data of multiple acceleration data on preset coordinate axes in a preset coordinate system, determine whether the accelerometer is in the first preset state.
[0312] In an exemplary embodiment of this disclosure, the accelerometer state determination module 1401 is further configured to:
[0313] When the variance of the data on any preset coordinate axis in the preset coordinate system meets the first preset condition, the accelerometer is determined to be in the first preset state.
[0314] In the exemplary embodiments of this disclosure, the first preset condition includes:
[0315] The variance is less than or equal to the first preset value.
[0316] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0317] Determine the geomagnetic intensity at the geographical location of the electronic device;
[0318] Obtain the offset geomagnetic intensity of electronic devices;
[0319] The attitude of electronic equipment is determined based on geomagnetic intensity and offset geomagnetic intensity.
[0320] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0321] The attitude of the electronic device is determined based on the geomagnetic components of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system and the offset geomagnetic components of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system.
[0322] In an exemplary embodiment of this disclosure, the preset coordinate axes include a first axis and a second axis; the geomagnetic components include a first geomagnetic component under the first axis and a second geomagnetic component under the second axis; the offset geomagnetic components include a first offset geomagnetic component under the first axis and a second offset geomagnetic component under the second axis.
[0323] Attitude determination module 1402 is also configured as follows:
[0324] The first angle between the first magnetic component and the first offset magnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component, and / or
[0325] The second included angle between the second magnetic component and the second offset magnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component.
[0326] If the first included angle and / or the second included angle are greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0327] In an exemplary embodiment of this disclosure, the preset coordinate axes include a first axis, a second axis, and a third axis; the geomagnetic components include a first geomagnetic component under the first axis, a second geomagnetic component under the second axis, and a third geomagnetic component under the third axis; the offset geomagnetic components include a first offset geomagnetic component under the first axis, a second offset geomagnetic component under the second axis, and a third offset geomagnetic component under the third axis.
[0328] Attitude determination module 1402 is also configured as follows:
[0329] The first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component. The second angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component. The third angle between the third geomagnetic component and the third offset geomagnetic component is determined based on the geomagnetic intensity, the third geomagnetic component, and the third offset geomagnetic component.
[0330] Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product.
[0331] If the sum of the first product, the second product, and the third product is greater than or equal to the third preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0332] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0333] Obtain the latitude and longitude information of the electronic device's geographical location;
[0334] The geomagnetic intensity of the electronic device's location is determined based on latitude and longitude information.
[0335] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0336] Obtain the angular velocity of the gyroscope in the electronic device;
[0337] The attitude of the electronic device is determined based on the initial angle and angular velocity. The initial angle is the angle of the electronic device in the preset coordinate system when the accelerometer is turned on.
[0338] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0339] The attitude of the electronic device is determined based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system.
[0340] In an exemplary embodiment of this disclosure, the preset coordinate axes include a first axis and a second axis; the initial angle includes a first initial angle component under the first axis and a second initial angle component under the second axis; the angular velocity includes a first angular velocity component under the first axis and a second angular velocity component under the second axis.
[0341] Attitude determination module 1402 is also configured as follows:
[0342] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis.
[0343] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0344] A first rotation angle is determined based on a first initial angle component and a first angular velocity component, and / or a second rotation angle is determined based on a second initial angle component and a second angular velocity component;
[0345] If the first rotation angle and / or the second rotation angle are greater than or equal to the fourth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0346] In an exemplary embodiment of this disclosure, the preset coordinate axes include a first axis, a second axis, and a third axis; the initial angle includes a first initial angle component under the first axis, a second initial angle component under the second axis, and a third initial angle component under the third axis; the angular velocity includes a first angular velocity component under the first axis, a second angular velocity component under the second axis, and a third angular velocity component under the third axis.
[0347] Attitude determination module 1402 is also configured as follows:
[0348] The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis.
[0349] In an exemplary embodiment of this disclosure, the attitude determination module 1402 is further configured to:
[0350] A first rotation angle is determined based on a first initial angle component and a first angular velocity component; a second rotation angle is determined based on a second initial angle component and a second angular velocity component; and a third rotation angle is determined based on a third initial angle component and a third angular velocity component.
[0351] Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product.
[0352] If the sum of the fourth, fifth, and sixth products is greater than or equal to the fifth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
[0353] In an exemplary embodiment of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device.
[0354] In an exemplary embodiment of this disclosure, the first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device; and the third axis is an axis along the thickness direction of the electronic device.
[0355] In an exemplary embodiment of this disclosure, the adjustment method determination module 1403 is further configured to:
[0356] If the electronic device is in the first posture, the adjustment method for the screen display is determined to be the first adjustment method, which is to flip the screen display.
[0357] Figure 15 This is a block diagram of an electronic device 1500 shown according to an exemplary embodiment of the present disclosure.
[0358] Reference Figure 15 The electronic device 1500 may include one or more of the following components: a processing component 1502, a memory 1504, a power supply component 1506, a multimedia component 1508, an audio component 1510, an input / output (I / O) interface 1512, a sensor component 1514, and a communication component 1516.
[0359] Processing component 1502 typically controls the overall operation of electronic device 1500, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 1502 may include one or more processors 1520 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1502 may include one or more modules to facilitate interaction between processing component 1502 and other components. For example, processing component 1502 may include a multimedia module to facilitate interaction between multimedia component 1508 and processing component 1502.
[0360] Memory 1504 is configured to store various types of data to support the operation of electronic device 1500. Examples of this data include instructions for any application or method operating on electronic device 1500, contact data, phonebook data, messages, pictures, videos, etc. Memory 1504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0361] Power supply component 1506 provides power to various components of electronic device 1500. Power supply component 1506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1500.
[0362] Multimedia component 1508 includes a screen that provides an output interface between the electronic device 1500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1508 includes a front-facing camera and / or a rear-facing camera. When the electronic device 1500 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0363] Audio component 1510 is configured to output and / or input audio signals. For example, audio component 1510 includes a microphone (MIC) configured to receive external audio signals when electronic device 1500 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1504 or transmitted via communication component 1516. In some embodiments, audio component 1510 also includes a speaker for outputting audio signals.
[0364] I / O interface 1512 provides an interface between processing component 1502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0365] Sensor assembly 1514 includes one or more sensors for providing state assessments of various aspects of electronic device 1500. For example, sensor assembly 1514 may detect the on / off state of electronic device 1500, the relative positioning of components such as the display and keypad of electronic device 1500, changes in position of electronic device 1500 or a component of electronic device 1500, the presence or absence of user contact with electronic device 1500, the orientation or acceleration / deceleration of electronic device 1500, and temperature changes of electronic device 1500. Sensor assembly 1514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 1514 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0366] Communication component 1516 is configured to facilitate wired or wireless communication between electronic device 1500 and other devices. Electronic device 1500 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 1516 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1516 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0367] In an exemplary embodiment, the electronic device 1500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0368] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1504 including instructions, which can be executed by a processor 1520 of an electronic device 1500 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0369] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform a screen display adjustment method provided in an exemplary embodiment of this disclosure.
[0370] A computer program product includes computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the screen display adjustment method provided in the exemplary embodiments of this disclosure.
[0371] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.
[0372] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A method for adjusting a screen display image, characterized in that, Applied to an electronic device, the electronic device including a screen, the adjustment method includes: Determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in a non-normal working state; In response to the accelerometer being in the first preset state, the attitude of the electronic device is determined; The adjustment method for the screen display is determined based on the posture of the electronic device; The screen display of the electronic device is adjusted according to the adjustment method.
2. The method for adjusting the screen display image according to claim 1, characterized in that, Determining whether the accelerometer of the electronic device is in a first preset state includes: After the accelerometer is turned on, multiple acceleration data from the accelerometer are acquired; Based on multiple acceleration data, determine whether the accelerometer is in the first preset state.
3. The method for adjusting the screen display image according to claim 2, characterized in that, Determining whether the accelerometer is in the first preset state based on multiple acceleration data includes: Based on the data of multiple acceleration data points on preset coordinate axes in a preset coordinate system, it is determined whether the accelerometer is in the first preset state.
4. The method for adjusting the screen display image according to claim 3, characterized in that, Determining whether the accelerometer is in the first preset state based on the data of multiple acceleration data on preset coordinate axes in a preset coordinate system includes: When the variance of the data of any of the preset coordinate axes in the preset coordinate system meets the first preset condition, the accelerometer is determined to be in the first preset state.
5. The method for adjusting the screen display image according to claim 4, characterized in that, The first preset conditions include: The variance is less than or equal to a first preset value.
6. The method for adjusting the screen display image according to any one of claims 1-5, characterized in that, The step of determining the attitude of the electronic device in response to the accelerometer being in the first preset state includes: Determine the geomagnetic intensity of the geographical location of the electronic device; Obtain the offset geomagnetic intensity of the electronic device; The attitude of the electronic device is determined based on the geomagnetic intensity and the offset geomagnetic intensity.
7. The method for adjusting the screen display image according to claim 6, characterized in that, Determining the attitude of the electronic device based on the geomagnetic intensity and the offset geomagnetic intensity includes: The attitude of the electronic device is determined based on the geomagnetic component of the geomagnetic intensity on the preset coordinate axis in the preset coordinate system and the geomagnetic component of the offset geomagnetic intensity on the preset coordinate axis in the preset coordinate system.
8. The method for adjusting the screen display image according to claim 7, characterized in that, The preset coordinate axes include a first axis and a second axis; the geomagnetic components include a first geomagnetic component under the first axis and a second geomagnetic component under the second axis; the offset geomagnetic components include a first offset geomagnetic component under the first axis and a second offset geomagnetic component under the second axis. Determining the attitude of the electronic device based on the geomagnetic components of the geomagnetic intensity along a preset coordinate axis in a preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axis in the preset coordinate system includes: The first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component, and / or The second included angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component; If the first included angle and / or the second included angle is greater than or equal to the second preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
9. The method for adjusting the screen display image according to claim 7, characterized in that, The preset coordinate axes include a first axis, a second axis, and a third axis; the geomagnetic components include a first geomagnetic component under the first axis, a second geomagnetic component under the second axis, and a third geomagnetic component under the third axis; the offset geomagnetic components include a first offset geomagnetic component under the first axis, a second offset geomagnetic component under the second axis, and a third offset geomagnetic component under the third axis. Determining the attitude of the electronic device based on the geomagnetic components of the geomagnetic intensity along a preset coordinate axis in a preset coordinate system and the offset geomagnetic components of the geomagnetic intensity along the preset coordinate axis in the preset coordinate system includes: A first angle between the first geomagnetic component and the first offset geomagnetic component is determined based on the geomagnetic intensity, the first geomagnetic component, and the first offset geomagnetic component; a second angle between the second geomagnetic component and the second offset geomagnetic component is determined based on the geomagnetic intensity, the second geomagnetic component, and the second offset geomagnetic component; and a third angle between the third geomagnetic component and the third offset geomagnetic component is determined based on the geomagnetic intensity, the third geomagnetic component, and the third offset geomagnetic component. Multiply the first included angle by the first weight to obtain the first product, multiply the second included angle by the second weight to obtain the second product, and multiply the third included angle by the third weight to obtain the third product; If the sum of the first product, the second product, and the third product is greater than or equal to a third preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
10. The method for adjusting the screen display image according to claim 6, characterized in that, Determining the geomagnetic intensity of the geographical location of the electronic device includes: Obtain the latitude and longitude information of the geographical location of the electronic device; The geomagnetic intensity of the geographical location of the electronic device is determined based on the latitude and longitude information.
11. The method for adjusting the screen display image according to any one of claims 1-5, characterized in that, The step of determining the attitude of the electronic device in response to the accelerometer being in the first preset state includes: Obtain the angular velocity of the gyroscope of the electronic device; The attitude of the electronic device is determined based on the initial angle and the angular velocity, wherein the initial angle is the angle of the electronic device in a preset coordinate system when the accelerometer is turned on.
12. The method for adjusting the screen display image according to claim 11, characterized in that, Determining the attitude of the electronic device based on the initial angle and the angular velocity includes: The attitude of the electronic device is determined based on the initial angle component of the preset coordinate axis in the preset coordinate system and the angular velocity component of the preset coordinate axis in the preset coordinate system.
13. The method for adjusting the screen display image according to claim 12, characterized in that, The preset coordinate axes include a first axis and a second axis; the initial angle includes a first initial angle component under the first axis and a second initial angle component under the second axis; the angular velocity includes a first angular velocity component under the first axis and a second angular velocity component under the second axis. Determining the attitude of the electronic device based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system includes: The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis.
14. The method for adjusting the screen display image according to claim 13, characterized in that, Determining the attitude of the electronic device based on the first initial angle component and the first angular velocity component of the first axis, and / or the second initial angle component and the second angular velocity component of the second axis, includes: A first rotation angle is determined based on the first initial angle component and the first angular velocity component, and / or a second rotation angle is determined based on the second initial angle component and the second angular velocity component; If the first rotation angle and / or the second rotation angle are greater than or equal to a fourth preset value, the posture of the electronic device is determined to be a first posture, which includes the posture in which the screen display needs to be flipped.
15. The method for adjusting the screen display image according to claim 12, characterized in that, The preset coordinate axes include a first axis, a second axis, and a third axis; the initial angle includes a first initial angle component under the first axis, a second initial angle component under the second axis, and a third initial angle component under the third axis; the angular velocity includes a first angular velocity component under the first axis, a second angular velocity component under the second axis, and a third angular velocity component under the third axis. Determining the attitude of the electronic device based on the initial angle component of the initial angle on the preset coordinate axis in the preset coordinate system and the angular velocity component of the angular velocity on the preset coordinate axis in the preset coordinate system includes: The attitude of the electronic device is determined based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis.
16. The method for adjusting the screen display image according to claim 15, characterized in that, Determining the attitude of the electronic device based on the first initial angle component and the first angular velocity component of the first axis, the second initial angle component and the second angular velocity component of the second axis, and the third initial angle component and the third angular velocity component of the third axis includes: A first rotation angle is determined based on the first initial angle component and the first angular velocity component; a second rotation angle is determined based on the second initial angle component and the second angular velocity component; and a third rotation angle is determined based on the third initial angle component and the third angular velocity component. Multiply the first rotation angle by the fourth weight to obtain the fourth product, multiply the second rotation angle by the fifth weight to obtain the fifth product, and multiply the third rotation angle by the sixth weight to obtain the sixth product. If the sum of the fourth product, the fifth product, and the sixth product is greater than or equal to a fifth preset value, the posture of the electronic device is determined to be the first posture, which includes the posture in which the screen display needs to be flipped.
17. The method for adjusting the screen display image according to claim 8 or 13, characterized in that, The first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device.
18. The method for adjusting the screen display image according to claim 9 or 15, characterized in that, The first axis is an axis along the length direction of the electronic device; the second axis is an axis along the width direction of the electronic device; and the third axis is an axis along the thickness direction of the electronic device.
19. The method for adjusting the screen display image according to any one of claims 8, 9, 14, and 16, characterized in that, Determining the adjustment method of the screen display based on the posture of the electronic device includes: If the electronic device is in the first posture, the adjustment method of the screen display is determined to be the first adjustment method, which is to flip the screen display.
20. A device for adjusting the screen display image, characterized in that, Applied to an electronic device, the electronic device including a screen, the adjustment device includes: An accelerometer state determination module is configured to determine whether the accelerometer of the electronic device is in a first preset state, the first preset state including the accelerometer being in an abnormal working state; An attitude determination module is configured to determine the attitude of the electronic device in response to the accelerometer being in the first preset state; The adjustment method determination module is configured to determine the adjustment method of the screen display based on the posture of the electronic device; The adjustment module is configured to adjust the screen display of the electronic device according to the adjustment method.
21. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to perform the screen display adjustment method as described in any one of claims 1 to 19.
22. A non-transitory computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the screen display adjustment method as described in any one of claims 1 to 19.
23. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; a processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions to cause the electronic device to perform the screen display adjustment method as described in any one of claims 1 to 19.