Screen control method and device, electronic equipment and storage medium
By acquiring and analyzing linear acceleration and angular velocity data without gravity parameters, determining the current screen mode of the terminal device and adjusting the display screen, the problem of inaccurate screen orientation recognition in the prior art is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202311541632.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-20
AI Technical Summary
In the prior art, the screen orientation of the terminal device is inaccurate, which affects the user's user experience.
By obtaining the linear acceleration data and angular velocity data of the terminal device, excluding gravity parameters, determining the current screen mode based on these data, and adjusting the screen of the display to match the mode.
Improve the accuracy of terminal device screen pattern recognition and improve user experience.
Smart Images

Figure CN120020686A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of terminal devices, and in particular, to a screen control method and apparatus, an electronic device, and a storage medium. Background Art
[0002] As terminal devices are increasingly favored by people and the time people use terminal devices is getting longer, in order to better protect users' eyes, current terminal devices support the screen auto-rotation function to meet users' visual needs.
[0003] In the prior art, in a terminal device, by using an in-built gravity sensor and gyroscope, the acceleration data obtained by the gravity sensor and the angular velocity data obtained by the gyroscope are used to obtain the current posture of the terminal device. Although the screen orientation of the terminal device can be determined, in some cases, this method is prone to incorrect determination of the screen orientation of the terminal device, which is not conducive to improving the user experience. Summary of the Invention
[0004] To overcome the problems existing in the related art, the present disclosure provides a screen control method and apparatus, an electronic device, and a storage medium, so as to overcome the problems of inaccurate recognition of the screen orientation of the terminal device and being not conducive to improving the user experience.
[0005] According to a first aspect of an embodiment of the present disclosure, a screen control method is provided, including:
[0006] Obtaining linear acceleration data and angular velocity data of a terminal device; wherein, the linear acceleration data does not include gravity parameters;
[0007] Based on the linear acceleration data and the angular velocity data, obtaining the current screen mode of the terminal device;
[0008] Adjusting the screen display of the terminal device to correspond to the current screen mode.
[0009] In some embodiments, the obtaining linear acceleration data and angular velocity data of the terminal device includes:
[0010] When the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset angle range, obtaining the linear acceleration data and the angular velocity data of the terminal device.
[0011] In some embodiments, the adjusting the screen display of the terminal device to correspond to the current screen mode includes:
[0012] When the current screen mode is a landscape screen mode, adjusting the screen display of the terminal device to be displayed horizontally;
[0013] When the current screen mode is the portrait mode, adjust the screen displayed on the display screen of the terminal device to be vertically displayed.
[0014] In some embodiments, when the current screen mode is the landscape mode, adjusting the screen displayed on the display screen of the terminal device to be horizontally displayed includes:
[0015] When it is determined based on the acceleration of gravity that the terminal device switches to the first landscape mode, a first screen is displayed on the display screen of the terminal device;
[0016] When it is determined based on the acceleration of gravity that the terminal device switches to the second landscape mode, a second screen is displayed on the display screen of the terminal device;
[0017] Wherein, the first screen and the second screen are mirror images of each other.
[0018] In some embodiments, the method further includes:
[0019] Determine the component of the acceleration of gravity in a preset axial direction;
[0020] When the component is greater than a first preset threshold, determine that the terminal device is in the first landscape mode;
[0021] When the component is less than or equal to the first preset threshold, determine that the terminal device is in the second landscape mode.
[0022] In some embodiments, obtaining the linear acceleration data and angular velocity data of the terminal device includes:
[0023] Obtain the linear acceleration data and angular velocity data collected by the terminal device within a preset sampling period from a preset buffer;
[0024] Based on the linear acceleration data and the angular velocity data, obtaining the current screen mode of the terminal device includes:
[0025] Input the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period into a target recognition model, determine the motion change parameters of the terminal device at each time node within the preset sampling period, and obtain the current screen mode of the terminal device based on the motion change parameters.
[0026] In some embodiments, the method further includes:
[0027] When the linear acceleration data collected at the current time node is less than a second preset threshold, determine that the linear acceleration data meets the first preset condition;
[0028] When the average of the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is greater than the third preset threshold, it is determined that the angular velocity data collected within the preset sampling period all meet the second preset condition.
[0029] In some embodiments, the method further comprises:
[0030] Construct a preset buffer area corresponding to the preset sampling period;
[0031] Storing each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period into the preset buffer area;
[0032] Clearing the linear acceleration data greater than or equal to the second preset threshold from the preset buffer area;
[0033] Based on the average value between each angular velocity data within the preset sampling period, the angular velocity data in the preset buffer area is updated.
[0034] In some embodiments, the method further comprises:
[0035] When the first execution cycle of the target recognition model ends and the first execution cycle ends for a preset time, the second execution cycle of the target recognition model is entered, and the current screen mode of the terminal device is updated.
[0036] According to a second aspect of an embodiment of the present disclosure, a screen control device is provided, including:
[0037] The first acquisition module is configured to acquire linear acceleration data and angular velocity data of the terminal device; wherein the linear acceleration data does not include gravity parameters;
[0038] A second acquisition module is configured to obtain a current screen mode of the terminal device based on the linear acceleration data and the angular velocity data;
[0039] The adjustment module is configured to adjust the image displayed on the display screen of the terminal device to correspond to the current screen mode.
[0040] In some embodiments, the first acquisition module is specifically configured to:
[0041] When the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset angle range, the linear acceleration data and angular velocity data of the terminal device are obtained.
[0042] In some embodiments, the adjustment module includes:
[0043] A first sub-module configured to adjust the screen displayed on the display screen of the terminal device to be horizontally displayed when the current screen mode is the landscape screen mode;
[0044] A second sub-module configured to adjust the screen displayed on the display screen of the terminal device to be vertically displayed when the current screen mode is the portrait screen mode.
[0045] In some embodiments, the second sub-module is specifically configured to:
[0046] When it is determined based on the acceleration of gravity that the terminal device switches to the first landscape screen mode, the first screen displayed on the display screen of the terminal device rotates from the first direction to be horizontally displayed;
[0047] When it is determined based on the acceleration of gravity that the terminal device switches to the second landscape screen mode, the second screen displayed on the display screen of the terminal device rotates from the second direction to be horizontally displayed;
[0048] Wherein, the first screen and the second screen are mirror images of each other.
[0049] In some embodiments, the screen control module further includes:
[0050] A first determination module configured to determine the component of the acceleration of gravity in a preset axial direction;
[0051] A second determination module configured to determine that the terminal device is in the first landscape screen mode when the component is greater than a first preset threshold;
[0052] A third determination module configured to determine that the terminal device is in the second landscape screen mode when the component is less than or equal to the first preset threshold.
[0053] In some embodiments, the first acquisition module is specifically configured to:
[0054] Obtain the linear acceleration data and angular velocity data collected by the terminal device within a preset sampling period from a preset buffer;
[0055] The second acquisition module is specifically configured to:
[0056] Input the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period into a target recognition model, determine the motion change parameters of the terminal device at each time node within the preset sampling period, and obtain the current screen mode of the terminal device based on the motion change parameters.
[0057] In some embodiments, the screen control module further includes:
[0058] A fourth determination module configured to determine that the linear acceleration data satisfies the first preset condition when the linear acceleration data collected at the current time node is less than a second preset threshold;
[0059] A fifth determination module configured to determine that the angular velocity data collected within the preset sampling period all satisfy the second preset condition when the mean value between the angular velocity data collected at the current time node and each of the angular velocity data collected before the current time node is greater than a third preset threshold.
[0060] In some embodiments, the screen control module further includes:
[0061] A construction module configured to construct a preset buffer corresponding to the preset sampling period;
[0062] A caching module configured to store each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period into the preset buffer;
[0063] A clearing module configured to clear the linear acceleration data greater than or equal to the second preset threshold from the preset buffer;
[0064] A first update module configured to update the angular velocity data in the preset buffer based on the mean value between each of the angular velocity data within the preset sampling period.
[0065] In some embodiments, the screen control module further includes:
[0066] A second update module configured to enter the second execution cycle of the target recognition model and update the current screen mode of the terminal device when the first execution cycle of the target recognition model ends and a preset duration has elapsed since the end of the first execution cycle.
[0067] According to a third aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0068] A processor;
[0069] A memory for storing instructions executable by the processor;
[0070] Wherein, the processor is configured to: when executing the executable command, implement the steps in any one of the screen control methods in the first aspect above.
[0071] According to a fourth aspect of an embodiment of the present disclosure, a non-transitory computer-readable storage medium is provided, comprising:
[0072] When the instructions in the storage medium are executed by a processor of an electronic device, the steps in any one of the screen control methods in the first aspect are implemented.
[0073] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects:
[0074] In the disclosed embodiment, the linear acceleration data and angular velocity data of the terminal device are first obtained; wherein the linear acceleration data does not include gravity parameters; then based on the linear acceleration data and the angular velocity data, the current screen mode of the terminal device is obtained; finally, the picture displayed on the display screen of the terminal device is adjusted to correspond to the current screen mode.
[0075] In this way, compared with the prior art that determines the rotation direction of the terminal device's screen through the acceleration data and angular velocity data of the terminal device, it is easy to cause the problem of low recognition accuracy of the current screen mode of the terminal device; in the embodiment of the present disclosure, the current screen mode of the terminal device is determined based on linear acceleration data and angular velocity data that do not include gravity parameters, so that the posture information of the terminal device does not participate in the judgment of the current screen mode, thereby improving the accuracy of judging the current screen mode of the terminal device, which is conducive to improving the user experience.
[0076] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory and cannot limit the present disclosure. Brief Description of the Figures
[0077] The accompanying drawings herein are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure.
[0078] Figure 1 is a schematic diagram of a screen control method according to an exemplary embodiment Figure 1 ;
[0079] Figure 2 is a schematic diagram of a screen structure according to an exemplary embodiment Figure 1 ;
[0080] Figure 3 is a schematic diagram of a screen structure according to an exemplary embodiment Figure 2 ;
[0081] Figure 4 is a schematic diagram of a screen structure according to an exemplary embodiment Figure 3 ;
[0082] Figure 5 Schematic structure diagram of a screen shown according to an exemplary embodiment Figure 4 ;
[0083] Figure 6 Flow schematic of a screen control method shown according to an exemplary embodiment Figure 2 ;
[0084] Figure 7 Block diagram of a screen control device shown according to an exemplary embodiment;
[0085] Figure 8 Hardware structure block diagram of an electronic device shown according to an exemplary embodiment Figure 1 ;
[0086] Figure 9 Hardware structure block diagram of an electronic device shown according to an exemplary embodiment Figure 2 . Detailed implementation manners
[0087] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0088] Figure 1 Flow schematic of a screen control method shown according to an exemplary embodiment Figure 1 , as Figure 1 shown, the screen control method mainly includes the following steps:
[0089] In step 101, linear acceleration data and angular velocity data of the terminal device are acquired; wherein, the linear acceleration data does not include gravity parameters;
[0090] In step 102, based on the linear acceleration data and the angular velocity data, the current screen mode of the terminal device is obtained;
[0091] In step 103, the picture displayed on the display screen of the terminal device is adjusted to correspond to the current screen mode.
[0092] It should be noted that the screen control method proposed in this disclosure can be applied to electronic devices. Here, the electronic device can include: terminal devices, such as mobile terminals or fixed terminals. Among them, the mobile terminal can include: devices such as mobile phones, tablet computers, laptop computers, wearable electronic devices, etc. The fixed terminal can include: desktop computers, smart TVs, vehicle-mounted devices, etc. In some other embodiments, the screen control method can also be applied to an application installed on an electronic device.
[0093] In some other embodiments, the screen control method in the embodiments of this disclosure can be configured in a screen control device, and this screen control device can be set in an electronic device, and the embodiments of this disclosure do not limit this. It should be noted that the execution subject of the embodiments of this disclosure can be the central processing unit (CPU) in the electronic device in terms of hardware, and can be the relevant background service in the electronic device in terms of software, and this is not limited.
[0094] It can be understood that the function of screen control can make the screen of the terminal device more intelligent, better adapt to different application scenarios, and improve the user experience. For example, when the user watches a horizontally displayed video, the function of screen control will rotate the display direction of the screen to horizontal display; when the user browses the web, some web pages may be suitable for the horizontal display mode, and some web pages may be suitable for the vertical display mode, and the function of screen control will rotate the display direction of the screen to the display mode suitable for the current web page.
[0095] It should be noted that in some scenarios, based on the acceleration data and angular velocity data of the terminal device, determining the attitude information of the terminal device and further determining the relative viewing angle between the user and the terminal device may cause a certain deviation in the judgment of the current screen mode of the terminal device.
[0096] Therefore, in the embodiments of this disclosure, by obtaining the linear acceleration data and angular velocity data of the terminal device, the attitude information of the terminal device is not involved in the recognition of the current screen mode, so as to improve the accuracy of determining the current screen mode of the terminal device.
[0097] Here, the linear acceleration data can be obtained by separately removing the gravity parameter from the acceleration data, or can be obtained by jointly removing the gravity parameter from the acceleration data and the angular velocity data, and the embodiments of this disclosure do not limit this.
[0098] In some embodiments, raw motion data detected by a motion sensor of a terminal device is obtained through the motion sensor. The raw motion data includes acceleration data and angular velocity data, and the motion sensor includes an acceleration sensor and an angular velocity sensor (such as a gyroscope). Since the gravity parameter belongs to the low-frequency component, a low-pass filter algorithm can be used to separate the gravity parameter from the acceleration data to determine the linear acceleration data.
[0099] In some other embodiments, after obtaining motion data (i.e., acceleration data and angular velocity data) using the motion sensor, a segmented bidirectional reverse gravity acceleration removal algorithm can be used to calculate the linear acceleration data of the terminal device. A sliding mean filter is used to denoise the collected acceleration data and angular velocity data to reduce random errors during sampling; the motion data is segmented by motion still points to reduce the cumulative error caused by integrating the angular velocity data into an angular signal; a rotation matrix is used to project the acceleration data combined with the angle information at the start and end points of each segment of motion data into the sensor coordinate systems of different poses at each moment to obtain two kinds of linear acceleration data as and at; according to the variation law of the accuracy of the two kinds of linear acceleration data, the two results are combined to obtain more accurate linear acceleration data.
[0100] It can be understood that after obtaining the linear acceleration data and angular velocity data of the terminal device, based on the linear acceleration data and the angular velocity data, the motion change parameters of the terminal device can be determined, and then the current screen mode of the terminal device can be determined.
[0101] In some embodiments, in order to improve the efficiency of determining the current screen mode of the terminal device, an identification model can be set. By inputting the obtained linear acceleration data and angular velocity data into the identification model, the motion change parameters of the terminal device are determined using the identification model, so as to determine the current screen mode of the terminal device.
[0102] Here, the identification model can be a pre-trained convolutional neural network model, such as Lenet, Alexnet, Googlenet, or VGG, etc., and the embodiments of the present disclosure do not limit this.
[0103] Exemplarily, the identification model is a pre-trained convolutional neural network model. After inputting the linear acceleration data and angular velocity data into the convolutional neural network model, the convolutional neural network model will judge the translation and rotation conditions of the terminal device and output the probability that the current screen mode is the landscape screen mode. If the probability that the current screen mode is the landscape screen mode is 1, it can be judged that the current screen mode of the terminal device is the landscape screen mode; if the probability that the current screen mode is the landscape screen mode is 0, it can be judged that the current screen mode of the terminal device is the portrait screen mode.
[0104] Another example is that after inputting the linear acceleration data and angular velocity data into the convolutional neural network model, the convolutional neural network model will judge the translation and rotation conditions of the terminal device and output the probability that the current screen mode is the portrait mode. If the probability that the current screen mode is the portrait mode is 1, it can be determined that the current screen mode of the terminal device is the portrait mode; if the probability that the current screen mode is the portrait mode is 0, it can be determined that the current screen mode of the terminal device is the landscape mode.
[0105] It can be understood that in order to facilitate the user's viewing, after obtaining the current mode of the terminal device, it is necessary to adjust the displayed picture on the display screen of the terminal device to correspond to the current screen mode.
[0106] Here, adjusting the displayed picture on the display screen of the terminal device can be rotating the displayed picture on the display screen to the left, to the right, upward or downward. The embodiments of the present disclosure do not limit this.
[0107] In the embodiments of the present disclosure, first, the linear acceleration data and angular velocity data of the terminal device are obtained; among them, the linear acceleration data does not include the gravity parameter; then, based on the linear acceleration data and the angular velocity data, the current screen mode of the terminal device is obtained; finally, the displayed picture on the display screen of the terminal device is adjusted to correspond to the current screen mode.
[0108] In this way, compared with the prior art, determining the rotation direction of the screen of the terminal device through the acceleration data and angular velocity data of the terminal device is likely to cause the problem of low recognition accuracy of the current screen mode of the terminal device; in the embodiments of the present disclosure, by inputting the linear acceleration data and angular velocity data that do not include the gravity parameter into the target recognition model to determine the current screen mode of the terminal device, the attitude information of the terminal device does not participate in the judgment of the current screen mode, so as to improve the accuracy of judging the current screen mode of the terminal device and is beneficial to improving the user experience.
[0109] In some embodiments, the obtaining of the linear acceleration data and angular velocity data of the terminal device includes:
[0110] When the included angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset included angle range, the linear acceleration data and angular velocity data of the terminal device are obtained.
[0111] It should be noted that when the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is small, the method of using the acceleration data and angular velocity data of the terminal device to determine the relative viewing angle between the user and the terminal device, and then determining the current screen mode of the terminal device is prone to the problem of inaccurate recognition of the current screen mode, which may cause the display screen of the terminal device to rotate frequently or the display screen of the terminal device not to rotate.
[0112] Therefore, in the embodiments of the present disclosure, a preset angle range is preset in advance. When the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within the preset angle range, by using the linear acceleration data and angular velocity data that do not include the gravity parameter, that is, the attitude information of the terminal device does not participate in the judgment of the current screen mode of the terminal device, the current screen mode of the terminal device is directly determined.
[0113] Here, the preset angle range can be set arbitrarily, and the embodiments of the present disclosure do not limit this.
[0114] At the same time, the scenario where the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within the preset angle range can be a scenario where the angle between the display screen and the horizontal axis is small, or a scenario where the user is in a lying position. The embodiments of the present disclosure do not limit this.
[0115] Exemplarily, the preset angle range is 87 degrees - 93 degrees. When the angle between the orientation of the display screen of the terminal device and the gravity of the terminal device is 91 degrees, it is determined that the angle is within the preset angle range. Then, the linear acceleration data and angular velocity data of the terminal device can be obtained to further judge the current screen mode of the terminal device.
[0116] In the embodiments of the present disclosure, when the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within the preset angle range, the linear acceleration data and angular velocity data of the terminal device are obtained, and then based on the linear acceleration data and angular velocity data, the current screen mode of the terminal device is determined. In this way, even in the scenario where the angle between the display screen and the horizontal axis is small or the user is in a lying position, the accuracy of recognizing the current screen mode can be ensured, which is beneficial to improving the user experience.
[0117] In some embodiments, the adjusting the picture displayed on the display screen of the terminal device to correspond to the current screen mode includes:
[0118] When the current screen mode is the landscape screen mode, the picture displayed on the display screen of the terminal device is adjusted to be displayed horizontally;
[0119] When the current screen mode is the portrait mode, adjust the screen displayed on the display screen of the terminal device to be vertically displayed.
[0120] It can be understood that the screen modes of the terminal device generally include the landscape mode and the portrait mode. To meet the visual experience of users and avoid the problem of frequent rotation of the display screen of the terminal device, in the embodiments of the present disclosure, when it is determined that the current screen mode is the landscape mode, the screen displayed on the display screen of the terminal device is adjusted to be horizontally displayed; and when it is determined that the current screen mode is the portrait mode, the screen displayed on the display screen of the terminal device is adjusted to be vertically displayed.
[0121] In some embodiments, when the screen displayed on the display screen of the terminal device is vertically displayed, after determining that the current screen mode of the terminal device is the landscape mode, the screen displayed on the display screen can be rotated 90 degrees clockwise, so that the screen displayed on the display screen changes from vertical display to horizontal display.
[0122] In other embodiments, when the screen displayed on the display screen of the terminal device is horizontally displayed, after determining that the current screen mode of the terminal device is the portrait mode, the screen displayed on the display screen can be rotated 90 degrees counterclockwise, so that the screen displayed on the display screen changes from horizontal display to vertical display.
[0123] Exemplarily, Figure 2 is a schematic structural diagram of a screen shown according to an exemplary embodiment Figure 1 , Figure 3 is a schematic structural diagram of a screen shown according to an exemplary embodiment Figure 2 , such as Figure 2-3 shown, when it is determined that the current screen mode is the landscape mode, the screen displayed on the display screen of the terminal device can be adjusted to be as shown in Figure 3 shown; and when it is determined that the current screen mode is the portrait mode, the screen displayed on the display screen of the terminal device can be adjusted to be as shown in Figure 2 shown.
[0124] In the embodiments of the present disclosure, when the current screen mode is the landscape mode, the screen displayed on the display screen of the terminal device is adjusted to be horizontally displayed; when the current screen mode is the portrait mode, the screen displayed on the display screen of the terminal device is adjusted to be vertically displayed. Thus, in the embodiments of the present disclosure, through the linear acceleration data and angular velocity data of the terminal device, first determine that the current screen mode of the terminal device is the landscape mode or the portrait mode, and then adjust the screen displayed on the display screen, so as to improve the accuracy of adjusting the screen displayed on the display screen of the terminal device, avoid the problem of frequent rotation of the display screen of the terminal device, and improve the user experience.
[0125] In some embodiments, when the current screen mode is the landscape mode, adjusting the screen displayed on the display screen of the terminal device to be horizontally displayed includes:
[0126] When it is determined based on the acceleration due to gravity that the terminal device switches to the first landscape mode, the display screen of the terminal device displays a first screen;
[0127] When it is determined based on the acceleration due to gravity that the terminal device switches to the second landscape mode, the display screen of the terminal device displays a second screen;
[0128] Wherein, the first screen and the second screen are mirror images of each other.
[0129] It should be noted that when the screen mode of the terminal device is in the landscape mode, it generally includes the first landscape mode and the second landscape mode. When the terminal device switches to the first landscape mode, the display screen of the terminal device displays a first screen; and when the terminal device switches to the second landscape mode, the display screen of the terminal device displays a second screen; wherein, the first screen and the second screen are mirror images of each other.
[0130] Here, the first landscape mode can be landscape with the right side horizontal, and the second landscape mode can be landscape with the left side horizontal.
[0131] It can be understood that in order to determine whether the current screen mode of the terminal device is the first landscape mode or the second landscape mode, the acceleration due to gravity data of the terminal device can be determined, so as to judge the current posture of the terminal device through the acceleration due to gravity data, and then determine the current screen mode of the terminal device.
[0132] In some embodiments, when the initial screen mode of the terminal device is the portrait mode, when it is determined based on the acceleration due to gravity that the terminal device is in the first landscape mode, in order to make the screen displayed on the display screen of the terminal device be the screen displayed in the first landscape mode, the screen displayed on the display screen of the terminal device can be rotated from the first direction to be horizontally displayed; and when it is determined based on the acceleration due to gravity that the terminal device is in the second landscape mode, in order to make the screen displayed on the display screen of the terminal device be the screen displayed in the second landscape mode, the screen displayed on the display screen of the terminal device can be rotated from the second direction to be horizontally displayed; wherein, the first direction and the second direction are opposite.
[0133] Exemplarily, Figure 4 is a schematic structural diagram of a screen shown according to an exemplary embodiment Figure 3 , Figure 5 is a schematic structural diagram of a screen shown according to an exemplary embodiment Figure 4 , such as Figure 4-5As shown; when the terminal device switches to the first landscape mode, the display screen of the terminal device displays image A1; when the terminal device switches to the second landscape mode, the display screen of the terminal device displays image A2.
[0134] For the terminal device, the shapes and sizes of image A1 and image A2 are exactly the same, and image A1 and image A2 are mirror images of each other with left and right reversed.
[0135] In the embodiments of the present disclosure, when it is determined based on the gravitational acceleration that the terminal device switches to the first landscape mode, the display screen of the terminal device displays the first screen; when it is determined based on the gravitational acceleration that the terminal device switches to the second landscape mode, the display screen of the terminal device displays the second screen; wherein, the first screen and the second screen are mirror images of each other. Thus, in the embodiments of the present disclosure, through the gravitational acceleration data of the terminal device, the landscape mode of the terminal device is first determined to be the first landscape mode or the second landscape mode, and then the display screen matching the current screen mode is output, thereby improving the accuracy of the display screen output by the display screen of the terminal device.
[0136] In some embodiments, the method further includes:
[0137] Determine the component of the gravitational acceleration in the preset axial direction;
[0138] When the component is greater than the first preset threshold, determine that the terminal device is in the first landscape mode;
[0139] When the component is less than or equal to the first preset threshold, determine that the terminal device is in the second landscape mode.
[0140] It should be noted that, in order to improve the accuracy of determining that the landscape mode of the terminal device is the first landscape mode or the second landscape mode, the first preset threshold can be set, the component of the gravitational acceleration and the preset axial direction can be determined, and then the component can be compared with the first preset threshold to determine the current screen mode of the terminal device.
[0141] Here, the first preset threshold can be set arbitrarily, and the embodiments of the present disclosure do not limit this.
[0142] It can be understood that since it is further determined whether the landscape mode is the first landscape mode or the second landscape mode when the current screen mode of the terminal device is in the landscape mode, the preset axial direction is the horizontal axial direction, and the magnitude of the component of the gravitational acceleration in the horizontal axial direction is determined.
[0143] In the embodiments of the present disclosure, when the component is greater than the first preset threshold, the placement position of the terminal device can be determined as the placement position in the first landscape screen state, so that the terminal device can be determined to be in the first landscape screen mode; when the component is less than or equal to the first preset threshold, the placement position of the terminal device can be determined as the placement position in the second landscape screen state, so that the terminal device can be determined to be in the second landscape screen mode.
[0144] Exemplarily, the first preset threshold is 0. Determine the component of the gravitational acceleration in the horizontal axial direction. When the component is greater than 0, determine that the terminal device is in the first landscape screen mode; when the component is less than or equal to 0, determine that the terminal device is in the second landscape screen mode.
[0145] In the embodiments of the present disclosure, by determining the component of the gravitational acceleration in the preset axial direction, comparing the component with the first preset threshold, when the component is greater than the first preset threshold, determining that the terminal device is in the first landscape screen mode; when the component is less than or equal to the first preset threshold, determining that the terminal device is in the second landscape screen mode, which is beneficial to improving the accuracy of determining whether the landscape screen mode of the terminal device is the first landscape screen mode or the second landscape screen mode, and further improving the user's operation experience.
[0146] In some embodiments, the obtaining of the linear acceleration data and angular velocity data of the terminal device includes:
[0147] Obtain the linear acceleration data and angular velocity data collected by the terminal device within a preset sampling period from a preset buffer.
[0148] The obtaining of the current screen mode of the terminal device based on the linear acceleration data and the angular velocity data includes:
[0149] Input the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period into the target recognition model, determine the motion change parameters of the terminal device at each time node within the preset sampling period, and obtain the current screen mode of the terminal device based on the motion change parameters.
[0150] It should be noted that, in order to ensure the accuracy of recognizing the current screen mode, a preset sampling period can be set, and then the linear acceleration data and angular velocity data collected by the terminal device within the preset sampling period can be obtained, and the motion parameters of the terminal device can be further judged.
[0151] Here, the preset sampling period can be set arbitrarily. For different terminal devices, the preset sampling period can be the same or different, and the embodiments of the present disclosure do not limit this.
[0152] In some embodiments, the preset sampling period refers to the time interval between two adjacent data acquisitions during the process of obtaining the linear acceleration data and angular velocity data of the terminal device. If the preset sampling period is set too short, it is easy to result in a small change in the data acquired in two adjacent times, making it difficult to obtain the motion parameters of the terminal device; while if the preset period is set too long, it is easy to cause the loss of useful data and is also not conducive to obtaining the motion parameters of the terminal device.
[0153] Therefore, the preset sampling period can be set according to the change information of the motion parameters of the terminal device.
[0154] It can be understood that the buffer is a temporary storage area for temporarily storing data to facilitate subsequent transmission and processing. To improve the efficiency of identifying the current screen mode of the terminal device, a buffer can be set to store the linear acceleration data and angular velocity data collected within the preset period.
[0155] It should be explained that, to improve the accuracy of identifying the current screen mode, in the embodiments of the present disclosure, the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period are input into the target recognition model to determine the current screen mode of the terminal device.
[0156] Here, the first preset condition and the second preset condition may be the same or different, and the embodiments of the present disclosure do not limit this.
[0157] In some embodiments, the target recognition model is a Temporal Convolutional Network (TCN), which is a deep learning algorithm for time series prediction. Compared with the Recurrent Neural Network (RNN), TCN uses convolutional operations and can perform efficient parallel computing. At the same time, TCN can flexibly process variable-length input sequences, making it more convenient to process data of different lengths. In addition, TCN can extract features of different scales by stacking multiple convolutional layers, where each convolutional layer processes the input through convolutional kernels of different sizes to capture features in different time ranges of the sequence data.
[0158] It can be understood that the preset sampling period includes time nodes. Therefore, after inputting the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period into the target recognition model, the target recognition model can obtain the motion change parameters of the terminal device at each time node within the preset sampling period, and thus determine the current screen mode of the terminal device based on the motion change parameters.
[0159] Here, the motion change parameters of the terminal device include but are not limited to translation parameters and rotation parameters.
[0160] Exemplarily, if the target recognition model is a TCN model, the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period are input into the TCN model. The TCN model can obtain the time series features of the linear acceleration data and the time series features of the angular velocity data, so as to determine the translation parameters and rotation parameters of the terminal device at each time point. After obtaining the translation parameters and the rotation parameters, the current screen mode of the terminal device can be judged.
[0161] In the embodiments of the present disclosure, first, the linear acceleration data and the angular velocity data collected by the terminal device within the preset sampling period are obtained from the preset buffer area; then, the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period are input into the target recognition model to determine the motion change parameters of the terminal device at each time node within the preset sampling period, and the current screen mode of the terminal device is obtained based on the motion change parameters. Thus, by using the target recognition model to determine the current screen mode of the terminal device, it is beneficial to improve the efficiency of judging the current screen mode of the terminal device and the accuracy of determining the current screen mode of the terminal device.
[0162] In some embodiments, the method further includes:
[0163] When the linear acceleration data collected at the current time node is less than the second preset threshold, it is determined that the linear acceleration data meets the first preset condition;
[0164] When the mean value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is greater than the third preset threshold, it is determined that all the angular velocity data collected within the preset sampling period meets the second preset condition.
[0165] It should be noted that when the included angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is small, the change amplitude of the linear acceleration data is larger than the change amplitude of the angular velocity. Therefore, in the embodiments of the present disclosure, the linear acceleration data collected at the current time point is compared with the second preset threshold, and the mean value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is compared with the third preset threshold, so as to screen out the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition.
[0166] In the embodiments of the present disclosure, when the linear acceleration data collected at the current time point is less than the second threshold, it is determined that the linear acceleration data meets the first preset condition; when the linear acceleration data collected at the current time point is greater than or equal to the second threshold, it is determined that the linear acceleration data does not meet the first preset condition.
[0167] When the average value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is greater than the third preset threshold, it is determined that all the angular velocity data collected within the preset sampling period meet the second preset condition; when the average value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is less than or greater than the third preset threshold, it is determined that not all the angular velocity data collected within the preset sampling period meet the second preset condition.
[0168] Here, the second preset threshold and the third preset threshold may be the same or different, and the embodiments of the present disclosure do not limit this.
[0169] Exemplarily, the second preset threshold corresponding to the linear acceleration is set to 10 m / s 2 , and the third preset threshold corresponding to the average angular velocity is set to 0.1 rad / s. If the linear acceleration data collected at the current time node is 9 m / s 2 , it can be determined that the linear acceleration data collected at the current time node is linear acceleration data that meets the first preset condition; and if the average value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is 0.3 rad / s, it can be determined that all the angular velocity data collected within the preset sampling period meet the second preset condition.
[0170] In the embodiments of the present disclosure, when the linear acceleration data collected at the current time node is less than the second preset threshold, it is determined that the linear acceleration data meets the first preset condition; when the average value between the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is greater than the third preset threshold, it is determined that all the angular velocity data collected within the preset sampling period meet the second preset condition. In this way, the embodiments of the present disclosure screen the obtained linear acceleration data and angular velocity data by setting preset conditions, namely the first preset condition and the second preset condition, which is beneficial to improving the accuracy of the target recognition model in judging the current screen mode of the terminal device.
[0171] In some embodiments, the method further includes:
[0172] Construct a preset buffer area corresponding to the preset sampling period;
[0173] Store each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period into the preset buffer;
[0174] Clear the linear acceleration data greater than or equal to the second preset threshold from the preset buffer;
[0175] Update the angular velocity data in the preset buffer based on the mean value among each of the angular velocity data within the preset sampling period.
[0176] It should be noted that, in order to ensure the real-time performance and effectiveness of the linear acceleration data and angular velocity data of the terminal device, a preset buffer corresponding to the preset sampling period can be constructed, so that the data stored in the preset buffer is the linear acceleration data and angular velocity data collected within the preset sampling period.
[0177] Exemplarily, if the preset sampling period is 2S and the sampling frequency is 25HZ, the buffered data in the preset buffer corresponding to the preset sampling period should be the linear acceleration data and angular velocity data collected within 2S.
[0178] It can be understood that since the input parameters of the target recognition model are the linear acceleration data that meet the first preset condition and the angular velocity data that meet the second preset condition in the preset buffer, therefore, it is necessary to preprocess each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period in the preset buffer.
[0179] It should be noted that in the case where the obtained linear acceleration data is greater than or equal to the second preset threshold, it can be determined that the terminal device is undergoing a large movement, so the current linear acceleration data is not reliable. Therefore, the preprocessing of the linear acceleration data is to clear the linear acceleration data greater than or equal to the second preset threshold from the preset buffer.
[0180] In some embodiments, after clearing the linear acceleration data greater than or equal to the second preset threshold from the preset buffer, the linear acceleration data of the terminal device will be obtained again.
[0181] And in the case where the mean value among each of the angular velocity data is less than or equal to the third preset threshold, it can be determined that the terminal device is undergoing a small rotation, so the current angular velocity data is not reliable. Therefore, the preprocessing of the angular velocity data is to update the angular velocity data in the preset buffer in the case where the mean value among each of the angular velocity data within the preset sampling period is less than or equal to the third preset threshold.
[0182] In some embodiments, when the mean value among the angular velocity data within a preset sampling period is less than or equal to a third preset threshold, the angular velocity data of the terminal device is re-acquired, and the mean value among the angular velocity data is recalculated.
[0183] In the embodiments of the present disclosure, first, a preset buffer corresponding to the preset sampling period is constructed; then, each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period are stored in the preset buffer; the linear acceleration data greater than or equal to the second preset threshold is cleared from the preset buffer; based on the mean value among the angular velocity data within the preset sampling period, the angular velocity data in the preset buffer is updated. In this way, in the embodiments of the present disclosure, by constructing a preset buffer to process the collected linear acceleration data and angular velocity data, the linear acceleration data finally stored in the preset buffer is the linear acceleration data that meets the first preset condition, and the angular velocity data finally stored is the angular velocity data that meets the second preset condition, which is beneficial to improving the accuracy of the target recognition model in recognizing the current screen mode.
[0184] In some embodiments, the method further includes:
[0185] When the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches a preset duration, enter the second execution cycle of the target recognition model and update the current screen mode of the terminal device.
[0186] It should be noted that, in order to ensure the accuracy of determining the current screen mode of the terminal device and reduce the computational loss of the target recognition model, a preset duration can be set. When the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches the preset duration, enter the second execution cycle of the target recognition model.
[0187] Here, the preset duration can be set arbitrarily, and the embodiments of the present disclosure do not limit this.
[0188] It can be understood that after entering the second execution cycle of the target recognition model, it is necessary to re-acquire the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period, and re-judge the motion transformation parameters of the terminal device to update the current screen mode of the terminal device.
[0189] Exemplarily, the preset duration can be 0.8S. When the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches 0.5S, the second execution cycle of the target recognition model will not be entered; while when the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches 0.8S, the second execution cycle of the target recognition model will be entered.
[0190] In the embodiments of the present disclosure, when the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches the preset duration, the second execution cycle of the target recognition model is entered, and the current screen mode of the terminal device is updated, which is beneficial to reducing the computational loss of the target recognition model and improving the accuracy of the target recognition model in recognizing the current screen mode.
[0191] Figure 6 It is a flowchart of a screen control method shown according to an exemplary embodiment Figure 2 , such as Figure 6 shown, input the linear acceleration data and the angular velocity data into the target recognition model to obtain the current screen mode of the terminal device. The method mainly includes the following steps:
[0192] In step 201, the linear acceleration data and the angular velocity data of the terminal device are acquired.
[0193] In some embodiments, when the included angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset included angle range, the acceleration data can be acquired by using an acceleration sensor, the angular velocity data can be acquired by using an angular velocity sensor, and then the gravity parameter processing is performed on the acceleration data and the angular velocity data to obtain the linear acceleration data and the angular velocity data of the terminal device.
[0194] In step 202, each linear acceleration data and each angular velocity data collected within a preset sampling period are stored in a preset buffer.
[0195] In some embodiments, a preset buffer corresponding to the preset sampling period is constructed, and each linear acceleration data and each angular velocity data collected within the preset sampling period are stored in the preset buffer.
[0196] In step 203, it is determined whether each linear acceleration data is greater than a second preset threshold.
[0197] In some embodiments, the linear acceleration data greater than or equal to the second preset threshold is cleared from the preset buffer.
[0198] In some other embodiments, when the linear acceleration data is less than a second preset threshold, it is determined that the linear acceleration data meets the first preset condition, and subsequent steps are continued.
[0199] In step 204, it is judged whether the mean value among the angular velocity data is greater than a third preset threshold.
[0200] In some embodiments, based on the mean value among the angular velocity data within the preset sampling period, the angular velocity data in the preset buffer is updated.
[0201] In some other embodiments, when the mean value between the angular velocity data collected at the current time node and the angular velocity data collected before the current time node is greater than a third preset threshold, it is determined that the angular velocity data collected within the preset sampling period all meet the second preset condition, and subsequent steps are continued.
[0202] In step 205, it is judged whether the time elapsed since the last calculation by the target recognition model exceeds a preset duration.
[0203] In some embodiments, when the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches a preset duration, the second execution cycle of the target recognition model is entered, and the current screen mode of the terminal device is updated.
[0204] In step 206, the target recognition model calculates.
[0205] Exemplarily, the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period are input into the target recognition model to determine the motion change parameters of the terminal device at each time node within the preset sampling period, and the current screen mode of the terminal device is obtained based on the motion change parameters. And the picture displayed on the display screen of the terminal device is adjusted to correspond to the current screen mode.
[0206] In some embodiments, when the current screen mode is the landscape screen mode, the picture displayed on the display screen of the terminal device is adjusted to be displayed horizontally.
[0207] In some other embodiments, when the current screen mode is the portrait screen mode, the picture displayed on the display screen of the terminal device is adjusted to be displayed vertically.
[0208] In step 207, it is judged whether the component of the gravitational acceleration data in the preset axis is greater than a first preset threshold.
[0209] In some embodiments, when the component is greater than the first preset threshold, it is determined that the terminal device is in the first landscape screen mode.
[0210] In some other embodiments, when the component is less than or equal to the first preset threshold, it is determined that the terminal device is in the second horizontal screen mode.
[0211] In the disclosed embodiment, the linear acceleration data and angular velocity data of the terminal device are obtained; wherein the linear acceleration data does not include gravity parameters; based on the linear acceleration data and the angular velocity data, the current screen mode of the terminal device is obtained; the picture displayed on the display screen of the terminal device is adjusted to correspond to the current screen mode, so that the posture information of the terminal device does not participate in the judgment of the current screen mode, thereby improving the accuracy of judging the current screen mode of the terminal device, which is conducive to improving the user experience.
[0212] Figure 7 is a block diagram of a screen control device according to an exemplary embodiment, such as Figure 7 As shown, the screen control device 400 includes:
[0213] The first acquisition module 401 is configured to acquire linear acceleration data and angular velocity data of the terminal device; wherein the linear acceleration data does not include gravity parameters;
[0214] The second acquisition module 402 is configured to obtain the current screen mode of the terminal device based on the linear acceleration data and the angular velocity data;
[0215] Adjustment module 403 is configured to adjust the picture displayed on the display screen of the terminal device to correspond to the current screen mode.
[0216] In some embodiments, the first acquisition module 401 is specifically configured to:
[0217] When the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset angle range, the linear acceleration data and angular velocity data of the terminal device are obtained.
[0218] In some embodiments, the adjustment module 403 includes:
[0219] The first submodule is configured to adjust the picture displayed on the display screen of the terminal device to horizontal display when the current screen mode is the horizontal screen mode;
[0220] The second submodule is configured to adjust the picture displayed on the display screen of the terminal device to vertical display when the current screen mode is the vertical screen mode.
[0221] In some embodiments, the second submodule is specifically configured as follows:
[0222] When it is determined that the terminal device switches to the first landscape mode based on the gravitational acceleration, a first screen is displayed on the display screen of the terminal device;
[0223] When it is determined that the terminal device switches to the second landscape mode based on the gravitational acceleration, a second screen is displayed on the display screen of the terminal device;
[0224] Wherein, the first screen and the second screen are mirror images of each other.
[0225] In some embodiments, the screen control module 400 further includes:
[0226] A first determination module, configured to determine a component of the gravitational acceleration in a preset axial direction;
[0227] A second determination module, configured to determine that the terminal device is in the first landscape mode when the component is greater than a first preset threshold;
[0228] A third determination module, configured to determine that the terminal device is in the second landscape mode when the component is less than or equal to the first preset threshold.
[0229] In some embodiments, the first acquisition module 401 is specifically configured to:
[0230] Obtain linear acceleration data and angular velocity data collected by the terminal device within a preset sampling period from a preset buffer;
[0231] The second acquisition module 402 is specifically configured to:
[0232] Input the linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period into a target recognition model, determine the motion change parameters of the terminal device at each time node within the preset sampling period, and obtain the current screen mode of the terminal device based on the motion change parameters.
[0233] In some embodiments, the screen control module 400 further includes:
[0234] A fourth determination module, configured to determine that the linear acceleration data meets the first preset condition when the linear acceleration data collected at the current time node is less than a second preset threshold;
[0235] A fifth determination module, configured to determine that the angular velocity data collected within the preset sampling period all meet the second preset condition when the mean value between the angular velocity data collected at the current time node and each of the angular velocity data collected before the current time node is greater than a third preset threshold.
[0236] In some embodiments, the screen control module 400 further includes:
[0237] A construction module, configured to construct a preset buffer area corresponding to the preset sampling period;
[0238] A caching module, configured to store each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period into the preset buffer area;
[0239] A clearing module, configured to clear the linear acceleration data that is greater than or equal to the second preset threshold from the preset buffer area;
[0240] A first update module, configured to update the angular velocity data in the preset buffer area based on the mean value between each of the angular velocity data within the preset sampling period.
[0241] In some embodiments, the screen control module 400 further includes:
[0242] A second update module, configured to enter the second execution cycle of the target recognition model and update the current screen mode of the terminal device when the first execution cycle of the target recognition model ends and the end of the first execution cycle reaches a preset duration.
[0243] Regarding the device in the above embodiments, the specific manners in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated here in detail.
[0244] Figure 8 is a hardware structure block diagram of an electronic device shown according to an exemplary embodiment Figure 1 . For example, the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0245] Referring to Figure 8 , the device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input / output (I / O) interface 812, a sensor component 814, and a communication component 816.
[0246] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, telephone calls, data communication, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0247] The memory 804 is configured to store various types of data to support the operation of the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 may 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 memory, flash memory, magnetic disk, or optical disk.
[0248] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0249] The multimedia component 808 includes a screen that provides an output interface between the device 800 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 touch screen 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 actions, but also detect the duration and pressure associated with the touch or swipe operations. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each of the front camera and the rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0250] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when the device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 804 or transmitted via the communication component 816. In some embodiments, the audio component 810 further includes a speaker for outputting audio signals.
[0251] The I / O interface 812 provides an interface between the processing component 802 and peripheral interface modules, and the peripheral interface modules may be a keyboard, click wheel, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a power button, and a lock button.
[0252] The sensor component 814 includes one or more sensors for providing an assessment of various aspects of the status of the device 800. For example, the sensor component 814 can detect the on / off state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor component 814 can also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor component 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 814 can also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 814 can further include an acceleration sensor, a gyro sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0253] The communication component 816 is configured to facilitate communication between the device 800 and other devices in a wired or wireless manner. The device 800 can access a wireless network based on communication standards, such as WiFi, 4G, or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0254] In an exemplary embodiment, the apparatus 800 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 for performing the above method.
[0255] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the above instructions can be executed by a processor 820 of the apparatus 800 to complete the above method. For example, the non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, magnetic tape, a floppy disk, and an optical data storage device, etc.
[0256] 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 execute a screen control method, and the method includes:
[0257] Obtaining linear acceleration data and angular velocity data of a terminal device; wherein, the linear acceleration data does not include gravity parameters;
[0258] Based on the linear acceleration data and the angular velocity data, obtaining the current screen mode of the terminal device;
[0259] Adjusting the picture displayed on the display screen of the terminal device to correspond to the current screen mode.
[0260] Figure 9 is a hardware structure block diagram of an electronic device shown according to an exemplary embodiment Figure 2 . For example, the apparatus 1900 may be provided as a server. Referring to Figure 9 , the apparatus 1900 includes a processing component 1922, which further includes one or more processors, and memory resources represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs. The application programs stored in the memory 1932 may include one or more modules each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method:
[0261] Obtaining linear acceleration data and angular velocity data of a terminal device; wherein, the linear acceleration data does not include gravity parameters;
[0262] Based on the linear acceleration data and the angular velocity data, obtaining the current screen mode of the terminal device;
[0263] Adjust the screen displayed on the display screen of the terminal device to correspond to the current screen mode.
[0264] Device 1900 may also include a power component 1926 configured to perform power management of device 1900, a wired or wireless network interface 1950 configured to connect device 1900 to a network, and an input / output (I / O) interface 1958. Device 1900 may operate based on an operating system stored in memory 1932, such as Windows ServerTM, MacOS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
[0265] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed herein. The specification and examples are only to be considered as exemplary, and the true scope and spirit of the present disclosure are pointed out by the following claims.
[0266] It should be understood that the present disclosure is not limited to the exact structures described above and shown in the drawings, and various modifications and changes may be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.
Claims
1. A screen control method, characterized in that: The method comprises: Acquire linear acceleration data and angular velocity data of the terminal device; wherein the linear acceleration data does not include gravity parameters; Based on the linear acceleration data and the angular velocity data, obtaining a current screen mode of the terminal device; The picture displayed on the display screen of the terminal device is adjusted to correspond to the current screen mode.
2. The method according to claim 1, characterized in that The obtaining of linear acceleration data and angular velocity data of the terminal device includes: When the angle between the orientation of the display screen of the terminal device and the gravity direction of the terminal device is within a preset angle range, linear acceleration data and angular velocity data of the terminal device are acquired.
3. The method according to claim 1, characterized in that The step of adjusting the picture displayed on the display screen of the terminal device to correspond to the current screen mode includes: When the current screen mode is the horizontal screen mode, adjusting the picture displayed on the display screen of the terminal device to the horizontal display mode; When the current screen mode is the portrait mode, the picture displayed on the display screen of the terminal device is adjusted to a portrait display.
4. The method according to claim 3, characterized in that When the current screen mode is the horizontal screen mode, adjusting the picture displayed on the display screen of the terminal device to a horizontal display, includes: When it is determined based on the gravity acceleration that the terminal device switches to the first horizontal screen mode, the display screen of the terminal device displays the first picture; When it is determined based on the gravity acceleration that the terminal device switches to the second horizontal screen mode, the display screen of the terminal device displays a second picture; The first picture and the second picture are mirror images of each other.
5. The method according to claim 4, characterized in that The method further comprises: Determining the component of the gravitational acceleration in a preset axial direction; When the component is greater than a first preset threshold, determining that the terminal device is in the first horizontal screen mode; When the component is less than or equal to the first preset threshold, it is determined that the terminal device is in the second horizontal screen mode.
6. The method according to claim 1, characterized in that The obtaining of linear acceleration data and angular velocity data of the terminal device includes: Acquire linear acceleration data and angular velocity data collected by the terminal device within a preset sampling period from a preset buffer area; The obtaining the current screen mode of the terminal device based on the linear acceleration data and the angular velocity data includes: The linear acceleration data that meets the first preset condition and the angular velocity data that meets the second preset condition within the preset sampling period are input into the target recognition model to determine the motion change parameters of the terminal device at each time node within the preset sampling period, and the current screen mode of the terminal device is obtained based on the motion change parameters.
7. The method according to claim 6, characterized in that The method further comprises: When the linear acceleration data collected at the current time node is less than a second preset threshold, determining that the linear acceleration data meets the first preset condition; When the average of the angular velocity data collected at the current time node and each angular velocity data collected before the current time node is greater than a third preset threshold, it is determined that the angular velocity data collected within the preset sampling period all meet the second preset condition.
8. The method according to claim 6, characterized in that The method further comprises: Constructing a preset buffer area corresponding to the preset sampling period; storing each of the linear acceleration data and each of the angular velocity data collected within the preset sampling period into the preset buffer area; Clearing linear acceleration data greater than or equal to the second preset threshold from the preset buffer area; The angular velocity data in the preset buffer area is updated based on the average value between each of the angular velocity data in the preset sampling period.
9. The method according to claim 6, characterized in that The method further comprises: When the first execution cycle of the target recognition model ends and the first execution cycle ends for a preset time, the second execution cycle of the target recognition model is entered, and the current screen mode of the terminal device is updated.
10. A screen control device, characterized in that: The device comprises: A first acquisition module is configured to acquire linear acceleration data and angular velocity data of a terminal device; wherein the linear acceleration data does not include a gravity parameter; A second acquisition module is configured to input the linear acceleration data and the angular velocity data into a target recognition model to obtain a current screen mode of the terminal device; The adjustment module is configured to adjust the picture displayed on the display screen of the terminal device to correspond to the current screen mode.
11. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: implement the steps in the screen control method according to any one of claims 1 to 9 when executing the executable command.
12. A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, the steps in the screen control method as claimed in any one of claims 1 to 9 are implemented.