A mobile phone landscape / portrait screen switching method, mobile phone and computer program product
By using a user model trained with a logical recognition method and a user dataset, combined with built-in sensors and a spatiotemporal graph neural network, the accuracy and security issues of switching between portrait and landscape modes on mobile phones under special postures are solved, achieving efficient and secure switching between portrait and landscape modes.
Patent Information
- Application Number
- CN202511182508.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-22
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-08-22
AI Technical Summary
Existing methods for switching between portrait and landscape modes on mobile phones are not accurate enough in special usage situations such as lying on your back or side, and their reliance on the camera leads to high power consumption and privacy and security risks. The actual user experience of AI models is also not good.
The user model is trained by combining a logical recognition method with a user dataset. Data is collected through a built-in gyroscope, accelerometer and touch sensor. The model integrates steady state, state, gravity switching and intent recognition, and is trained using a spatiotemporal graph neural network to realize the switching between portrait and landscape modes on the mobile phone.
While ensuring accurate switching, it expands the application scenarios, reduces power consumption, improves security, reduces reliance on cameras, and adapts to various application scenarios.
Smart Images

Figure CN121078167B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of mobile phone display, more particularly, to: 1. A mobile phone horizontal and vertical screen switching method; 2. A mobile phone; 3. A computer program product. BACKGROUND
[0002] The mobile phone horizontal and vertical screen switching function is an important technology for improving the user's mobile phone use experience, and this function usually relies on the built-in accelerometer and gyroscope sensors of the mobile phone to achieve.
[0003] The current mobile phone horizontal and vertical screen switching methods on the market are mostly based on the method of judging the gravity direction, that is, the gravity and the screen state are one-to-one corresponding, and the use case of the mobile phone horizontal and vertical screen switching when the mobile phone is in the supine and lateral position is not considered. Although there are also some mobile phone horizontal and vertical screen switching methods that consider special use cases such as lying on the side, but most of them are methods of following recognition through the camera - the image recognition of the front camera and the rear camera is used to judge the horizontal and vertical screen switching; among them, the front camera is used to follow the face and identify the specific orientation of the face after identifying the facial features to switch the horizontal and vertical screen; the rear camera is used to identify the change of the scene, and the horizontal and vertical screen switching of the mobile phone is judged based on the scene change rule. Although this method of following recognition through the camera has higher accuracy in direction judgment, it will cause the power consumption to be significantly higher than using other switching schemes because it involves continuous calling of the camera; and using the camera involves the user's privacy, which may pose a certain security risk. With the development of neural network technology, there are also some methods of relying on AI models to switch the horizontal and vertical screen of the mobile phone, but the effect of these methods in actual experience is not satisfactory. SUMMARY
[0004] Therefore, it is necessary to provide a mobile phone horizontal and vertical screen switching method, a mobile phone and a computer program product in view of the problem that the actual experience of the existing mobile phone horizontal and vertical screen switching method is not good.
[0005] The present application adopts the following technical solutions:
[0006] In a first aspect, the present application discloses a mobile phone horizontal and vertical screen switching method, comprising:
[0007] Step one, initialize the user data set Udata to be empty;
[0008] Step two, obtain the nine-dimensional data D k-1 of the target mobile phone in the last time k-1 and the nine-dimensional data D k of the target mobile phone in the current time k; wherein the dimension types of D k-1 and D k are the same, and both include three-axis acceleration, three-axis angular velocity and three-axis angle;
[0009] Step three, using a logical recognition method to process D k-1 , D k to obtain the logical judgment result P sout [k] at k; wherein the logical recognition method is a multi-condition judgment method that fuses steady-state recognition, state recognition, gravity switching recognition, and intention recognition;
[0010] Step four, removing the three-axis acceleration from D k to obtain six-dimensional data X k ;
[0011] Step five, adding X k and P sout [k] to Udata, and adding 1 to the update number K;
[0012] Step six, when K has not reached a preset number threshold K0, the target mobile phone performs screen display at k according to P sout [k], and then repeats steps two to six;
[0013] When K reaches K0, the user model is obtained by training the spatiotemporal graph neural network based on Udata and performance verification is performed; if the performance of the user model exceeds a preset performance threshold Per0, X k is processed using the user model to obtain a model judgment result Y sout [k] of the target mobile phone at k, the target mobile phone performs screen display at k according to Y sout [k], and then repeats steps two, four, and six; otherwise, K is cleared, the target mobile phone performs screen display at k according to P sout [k], and then repeats steps two to six.
[0014] The mobile phone screen switching method realizes the method or process according to the embodiments of the present disclosure.
[0015] In a second aspect, the present disclosure discloses a mobile phone that uses the mobile phone screen switching method disclosed in the first aspect.
[0016] In a third aspect, the present disclosure discloses a computer program product including a computer program. When the computer program is executed by a processor, the steps of the mobile phone screen switching method disclosed in the first aspect are implemented.
[0017] Compared with the prior art, the present disclosure has the following beneficial effects:
[0018] 1. In the initial stage of use of the target mobile phone, the logical recognition method is used to determine the screen display result, and the screen display result is added to the user data set as a true value, and then the user model is trained based on the user data set to fit the user's use habit, so that after the target mobile phone is used for a period of time, the screen display result is determined directly by relying on the user model meeting the performance requirement, so as to further expand the use scene while ensuring the switching accuracy.
[0019] 2. The logical recognition method of the present application is a multi-condition judgment method combining steady-state recognition, state recognition, gravity switching recognition and intention recognition, which comprehensively considers various scenes in actual use, reduces the calculation amount through mode division and dynamic decoupling, and not only ensures the accuracy of the logical recognition result, but also ensures the reliability of the user model training data.
[0020] 3. The present application only uses data of built-in gyroscope, accelerometer and touch sensor, without calling the camera, and has high safety. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0022] Figure 1 A flow chart of a mobile phone horizontal and vertical screen switching method according to the first embodiment of the present application is shown in the figure.
[0023] Figure 2 A schematic diagram of four preset screen modes of the target mobile phone is shown in the figure.
[0024] Figure 3 A schematic diagram of four preset gravity modes of the target mobile phone is shown in the figure.
[0025] Figure 4 A schematic diagram of four touch sensing areas of the target mobile phone is shown in the figure.
[0026] Figure 5 A flow chart of the logical recognition method in the present application is shown in the figure. Figure 1 DETAILED DESCRIPTION
[0027] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments of the present application, all the other embodiments obtained by a person of ordinary skill in the art without creative work belong to the scope of protection of the present application.
[0028] It should be noted that when a component is referred to as being "mounted on" another component, it can be directly on the other component or there can be a middle component. When a component is referred to as being "disposed on" another component, it can be directly disposed on the other component or there can be a middle component. When a component is referred to as being "fixed on" another component, it can be directly fixed on the other component or there can be a middle component.
[0029] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0030] First of all, as mentioned in the background, the actual experience effect of the existing method of relying on an AI model to switch the horizontal and vertical screens of a mobile phone is not satisfactory. After analysis, it is found that these AI models are generally trained by using general sample data and cannot be well adapted to different users; although some models collect user use data, in order to ensure data accuracy, they rely on a camera to collect data, which has a security risk.
[0031] Based on this, the present application mainly provides a mobile phone horizontal and vertical screen switching method. In the initial stage of use of a target mobile phone, a logical recognition method is used to determine a screen display result and add it to a user data set as a true value, and then a user model that fits the user's use habits is trained based on the user data set, so that after the target mobile phone is used for a period of time, the screen display result can be determined directly by relying on the user model that meets the performance requirements, so as to further expand the use scenarios while ensuring the switching accuracy. It should be noted that this method only uses data from the built-in gyroscope, accelerometer and touch sensor, and does not need to call the camera, so it is safe.
[0032] Embodiment 1
[0033] Reference Figure 1The flow chart of the method for switching the horizontal and vertical screens of the mobile phone provided in Embodiment 1 is shown in FIG. 1, which is applied to the target mobile phone. It should be noted that the target mobile phone is a touch screen mobile phone and is provided with an accelerometer and a gyroscope.
[0034] For the target mobile phone, the mode division and touch division are performed in advance to realize dynamic decoupling.
[0035] ① The target mobile phone has four preset screen modes: preset screen mode one, preset screen mode two, preset screen mode three and preset screen mode four.
[0036] Referring to FIG. 2, Figure 2 the preset screen mode one is that the mobile phone is in a vertical screen and is displayed in a vertical screen; the serial number of the preset screen mode one is 1.
[0037] The preset screen mode two is that the mobile phone is in a vertical screen and is displayed in a forward horizontal screen (i.e. a horizontal screen after the screen is rotated counterclockwise by 90 degrees); the serial number of the preset screen mode two is 2.
[0038] The preset screen mode three is that the mobile phone is in a vertical screen and keeps the screen display at the previous moment; the serial number of the preset screen mode three is 3.
[0039] The preset screen mode four is that the mobile phone is in a vertical screen and is displayed in a reverse horizontal screen (i.e. a horizontal screen after the screen is rotated clockwise by 90 degrees); the serial number of the preset screen mode four is 4.
[0040] Therefore, there are the following corresponding formulas:
[0041]
[0042] In the formulas, k represents the current moment; P state [k] represents the screen mode of the target mobile phone at the current moment k, which is 1, indicating the preset screen mode one, 2, indicating the preset screen mode two, 3, indicating the preset screen mode three and 4, indicating the preset screen mode four.
[0043] It should be noted that the preset screen mode three is a transition state: if the preset screen mode changes from 2 to 3, the screen display is still performed according to the preset screen mode two.
[0044] ② The target mobile phone has four preset gravity modes: preset gravity mode one, preset gravity mode two, preset gravity mode three and preset gravity mode four.
[0045] Referring to FIG. 3, Figure 3 the preset gravity mode one is that the mobile phone is in a vertical screen and is displayed in a vertical screen; the serial number of the preset gravity mode one is 1.
[0046] The preset gravity mode two is that the mobile phone is in reverse landscape and is displayed in reverse landscape. The serial number of the preset gravity mode two is 2.
[0047] The preset gravity mode three is that the mobile phone is in upside down and is displayed in upside down. The serial number of the preset gravity mode three is 3.
[0048] The preset gravity mode four is that the mobile phone is in normal landscape and is displayed in normal landscape. The serial number of the preset gravity mode four is 4.
[0049] The preset gravity mode is set independently of the preset screen mode to realize decoupling of screen display and gravity sensing.
[0050] Generally, the gravity mode is determined according to a conventional rule, that is, according to the x-axis acceleration and y-axis acceleration of the target mobile phone. If P g [k] represents the gravity mode in which the target mobile phone is located, then the conventional determination method of P g [k] includes:
[0051] If -V g <a x [k]<V g and a y [k]<0, then P g [k] is 1, indicating that the preset gravity mode one is adopted.
[0052] If -V g <a y [k]<V g and a x [k]<0, then P g [k] is 2, indicating that the preset gravity mode two is adopted.
[0053] If -V g <a x [k]<V g and a y [k]>0, then P g [k] is 3, indicating that the preset gravity mode three is adopted.
[0054] If -V g <a y [k]<V g and a x [k]>0, then P g [k] is 4, indicating that the preset gravity mode four is adopted.
[0055] In other cases, P g [k] remains P g [k-1].
[0056] wherein a x[k] represents the x-axis acceleration of the target mobile phone at time k; a y [k] represents the y-axis acceleration of the target mobile phone at time k; -V g represents the lower limit of the gravity mode threshold; V g represents the upper limit of the gravity mode threshold. It should be noted that -V g , V g Generally, the empirical value is taken.
[0057] Therefore, there is the following general judgment formula:
[0058]
[0059] Of course, there are some special cases, and the gravity mode will be determined according to special rules - which will be explained in the subsequent specific introduction of the mobile phone screen switching method, which will not be expanded here.
[0060] ③, the screen of the target mobile phone is divided into touch sensing area one, touch sensing area two, touch sensing area three, and touch sensing area four according to the upper left, upper right, lower left, and lower right, as shown in Figure 4 .
[0061] The screen is built-in with a touch sensor, so that the touch sensor built-in in the screen detects whether it is touched, and further provides the target mobile phone screen touch condition.
[0062] Therefore, there is the following judgment formula:
[0063]
[0064] In the formula, P state1 [k], P state2 [k], P state3 [k], P state4 [k] respectively represent the touch condition of touch sensing area one, touch sensing area two, touch sensing area three, and touch sensing area four at time k, and the value of 0 represents no touch, and the value of 1 represents touch.
[0065] Then, on the basis of the above-mentioned preset mode division and touch division, the mobile phone screen switching method of embodiment 1 includes the following steps:
[0066] Step one, initialize the user data set Udata to be empty.
[0067] This step corresponds to the initial use of the target mobile phone by the user. The target mobile phone can save Udata in the local storage, or upload Udata to the cloud server through the cloud service.
[0068] Step two, obtaining nine-dimensional data D of the target mobile phone at the last time k-1 when the target mobile phone is in use by the target user k-1 , nine-dimensional data D at the current time k k .
[0069] wherein, D k-1 , D k have the same dimension type, and both include three-axis acceleration, three-axis angular velocity and three-axis angle.
[0070] That is to say:
[0071] D k is expressed as:
[0072] D k ={a x [k],a y [k],a z [k],ω x [k],ω y [k],ω z [k],θ x [k],θ y [k],θ z [k]}.
[0073] wherein, a x [k], a y [k], a z [k] are three-axis accelerations of the target mobile phone at k; ω x [k], ω y [k], ω z [k] are three-axis angular velocities of the target mobile phone at k; θ x [k], θ y [k], θ z [k] are three-axis angles of the target mobile phone at k.
[0074] The expression of D k-1 is similar to that of D k , that is:
[0075] D k-1 ={a x [k-1],a y [k-1],a z [k-1],ω x [k-1],ω y [k-1],ω z [k-1],θ x [k-1],θ y [k-1],θ z [k-1]}.
[0076] It should be noted that:
[0077] 1. D k The triaxial acceleration (i.e., a) in x [k]、a y [k]、a z [k] is obtained through the accelerometer built into the target mobile phone, which is the collected value.
[0078] 2. D k The three-axis angular velocity (i.e., ω) x [k]、ω y [k]、ω z [k) The collected value is obtained by the gyroscope built into the target mobile phone.
[0079] 3. D k The three-axis angle (i.e., θ) x [k]、θ y [k]、θ z [k]) Based on D k-1 The estimated values are obtained by calculating the triaxial acceleration and triaxial angular velocity.
[0080] Specifically, θ i The formula for calculating [k] is:
[0081]
[0082] In the formula, i represents the variables of the x-axis, y-axis, and z-axis; α represents the filter coefficient; θ i [k-1] represents the i-axis angle at the previous time k-1; T represents the acquisition interval; θ i,a [k] represents the angle between the i-axis and the direction of gravity at time k; g[k] represents the combined acceleration at time k.
[0083] Step 3: Use logical recognition methods to analyze D. k-1 D k Process to obtain the logical judgment result P at time k. sout [k].
[0084] Among them, the logic recognition method is a multi-condition judgment method that integrates steady-state recognition, state recognition, gravity switching recognition, and intent recognition.
[0085] See Figure 5 Step three specifically includes:
[0086] S301, based on D k Steady-state identification is performed to determine whether the target mobile phone is in a steady state at time k;
[0087] If so, then obtain the target mobile phone screen touch status at time k and perform S302;
[0088] If no, the target mobile phone screen is touched at k time, and S304 is performed.
[0089] Wherein, the steady state recognition is based on the three-axis acceleration of the target mobile phone, and the specific method comprises:
[0090] Based on a x [k], a y [k], a z [k] is calculated g[k], that is:
[0091] If V s_lb <g[k]<V s_ub , the target mobile phone is in steady state at k time; otherwise, the target mobile phone is in non-steady state at k time.
[0092] Wherein, g[k] represents the combined acceleration at k time; V s_lb represents the lower limit of steady state recognition threshold; V s_ub represents the upper limit of steady state recognition threshold. It should be noted that V s_lb , V s_ub are generally taken as empirical values.
[0093] That is, the judgment formula of steady state recognition is:
[0094]
[0095] In the formula, P stability [k] represents the steady state recognition result at k time, and its value is 1 when it is in steady state, and its value is 0 when it is in non-steady state.
[0096] S302, if any of the touch sensing area one, touch sensing area two, touch sensing area three, touch sensing area four is touched at k time, S303 is performed; otherwise, P sout [k] remains the logical judgment result P sout [k-1] at k-1 time.
[0097] That is,
[0098] If P state1 [k] = 1 or P state2 [k] = 1 or P state3 [k] = 1 or P state4 [k] = 1, S303 is performed.
[0099] If P state1 [k] = P state2 [k] = P state3 [k] = P state4 [k] = 0, P sout[k] remains the logical judgment result P of k-1 sout [k-1].
[0100] S303, state recognition is performed to determine P sout [k].
[0101] The state recognition aims to recognize the holding state of the user through the touch condition, and then determine the correct screen display.
[0102] Specifically, the specific method of state recognition includes:
[0103] According to the target mobile phone screen touch condition at k, the screen mode P at k is determined state [k], and P state [k] is taken as P sout [k].
[0104] P state [k] exists as follows:
[0105] ①, if only touch sensing area three has touch, or only touch sensing area four has touch, or only touch sensing area three and touch sensing area four have touch at k, then P state [k] is 1, indicating that the preset screen mode one is adopted.
[0106] ②, if touch sensing area one has touch and touch sensing area two has no touch at k, then P state [k] is 2, indicating that the preset screen mode two is adopted.
[0107] ③, if touch sensing area one has no touch and touch sensing area two has touch at k, then P state [k] is 4, indicating that the preset screen mode four is adopted.
[0108] ④, in other cases, P state [k] remains the screen mode P of k-1 state [k-1].
[0109] That is, the judgment formula of state recognition is:
[0110]
[0111] It should be noted that in the process of S303, P g [k] is determined according to the conventional rule, which will not be repeated here.
[0112] S304, if any of touch sensing area one, touch sensing area two, touch sensing area three, and touch sensing area four has touch at k, then S305 is performed; otherwise, S306 is performed.
[0113] That is,
[0114] If P state1 [k] = 1 or P state2 [k] = 1 or P state3 [k] = 1 or P state4 [k] = 1, S305 is performed.
[0115] If P state1 [k] = P state2 [k] = P state3 [k] = P state4 [k] = 0, S306 is performed.
[0116] S305, based on D k-1 , D k , gravity switching recognition is performed to determine whether the target mobile phone has gravity switching at k;
[0117] If yes, S303 is performed;
[0118] If no, P sout [k] remains P sout [k-1] at k-1.
[0119] In S305, for gravity switching recognition, the comparison objects are P g [k] and P g [k-1], and the specific method includes:
[0120] Comparing whether P g [k] and P g [k-1] are the same;
[0121] If yes, the target mobile phone has gravity switching at k; otherwise, the target mobile phone has no gravity switching at k;
[0122] Wherein, P g [k] and P g [k-1] represent the gravity mode of the target mobile phone at k and the gravity mode of the target mobile phone at k-1 respectively. It should be noted that in gravity switching recognition, P g [k] is determined according to the conventional rule; but P g [k-1] is the final gravity mode judgment result at k-1, which may be determined according to the conventional rule or the special rule.
[0123] That is, the judgment formula of gravity switching recognition is:
[0124]
[0125] In the formula, ΔP g[k] represents whether the target mobile phone has gravity switching at time k, and its value is 1 when the target mobile phone has gravity switching and its value is 0 when the target mobile phone has no gravity switching.
[0126] S306, based on D k-1 , D k performing intention recognition to determine whether the target mobile phone has gravity switching at time k. sout [k].
[0127] The intention recognition is intended to reflect the operation intention of the user. Specifically, the method of intention recognition includes:
[0128] S600, performing state judgment to determine whether the target mobile phone is in a plane state;
[0129] If the target mobile phone is in a plane state at time k and time k-1, S601 is performed.
[0130] If the target mobile phone is in a non-plane state at time k and time k-1, S602 is performed.
[0131] If the target mobile phone is in a plane state at time k and in a non-plane state at time k-1, S603 is performed.
[0132] If the target mobile phone is in a non-plane state at time k and in a plane state at time k-1, S604 is performed.
[0133] That is, S601 corresponds to a plane state in an unswitched state; S602 corresponds to a non-plane state in an unswitched state; S603 corresponds to switching from a plane state to a non-plane state; and S604 corresponds to switching from a non-plane state to a plane state.
[0134] The state judgment is based on the z-axis acceleration of the target mobile phone, and the specific method includes:
[0135] If -V z ≤a z [k]≤V z , the target mobile phone is in a plane state at time k;
[0136] If a z [k]>V z or a z [k]<-V z , the target mobile phone is in a non-plane state at time k;
[0137] In the formula, a z [k] represents the z-axis acceleration of the target mobile phone at time k; -V z represents the lower limit of the plane state threshold; and V z represents the upper limit of the plane state threshold. It should be noted that -V z , V zGenerally, the experience value is taken.
[0138] That is, the judgment formula of the state judgment is:
[0139]
[0140] In the formula, P plane [k] represents whether the target mobile phone is in the plane state at time k, and the value of 1 indicates that it is in the plane state, and the value of 0 indicates that it is in the non-plane state.
[0141] S601, according to Δθ z [k] determines the reference recognition result P Ip [k] at time k, and according to P Ip [k] determines P sout [k] at time k.
[0142] Where, Δθ z [k] represents the change amount of θ z [k] compared with θ z [k-1]; Δθ z [k] = θ z [k] - θ z [k-1]; θ z [k] represents the z-axis angle of the target mobile phone at time k; and θ z [k-1] represents the z-axis angle of the target mobile phone at time k-1.
[0143] I, Δθ z [k], and the relationship between P Ip [k] is:
[0144] 1. If Δθ z [k] > 0 and the absolute value of Δθ z [k] is greater than V az , P sout [k-1] is added by 1 to obtain P Ip [k].
[0145] 2. If Δθ z [k] < 0 and the absolute value of Δθ z [k] is greater than V az , P sout [k-1] is subtracted by 1 to obtain P Ip [k].
[0146] Wherein, V az represents a preset angle change threshold. It should be noted that V az is generally taken as an experience value.
[0147] Then there is the following judgment formula:
[0148]
[0149] where abs(.) denotes the absolute value.
[0150] II, P Ip [k], P sout The relationship between P
[0151] If P Ip [k] is 1 or 5, P sout [k] is 1, indicating that the preset screen mode one is adopted.
[0152] If P Ip [k] is 2, P sout [k] is 2, indicating that the preset screen mode two is adopted.
[0153] If P Ip [k] is 2, P sout [k] is 3, indicating that the preset screen mode three is adopted.
[0154] If P Ip [k] is 4 or 0, P sout [k] is 4, indicating that the preset screen mode four is adopted.
[0155] It should be noted that P Ip [k] can be in a special case: 0 or 5, which does not match the serial number of the preset screen mode. Then, when P Ip [k] is 0, P sout [k] is set to 4; when P Ip [k] is 5, P sout [k] is set to 1.
[0156] Then there is the following judgment formula:
[0157]
[0158] It should be noted that in the process of S601, P g [k] is determined according to the conventional rule, which is not repeated here.
[0159] S602, if θ x [k] > V ax or θ y [k] > V ay , P sout [k-1] is added to ΔP' g [k] to obtain P sout [k]; otherwise, P sout [k] remains the screen mode P sout [k-1] when k-1.
[0160] wherein ΔP' g [k] represents the gravity mode variable at k, which satisfies:
[0161] If P g [k] is 1 or -3, then ΔP' g [k] is 1. g [k] is 1.
[0162] If P g [k] is -1 or 3, then ΔP' g [k] is -1. g [k] is -1.
[0163] wherein P g [k-1] represents the gravity mode of the target mobile phone at k-1; and P g [k] represents the gravity mode of the target mobile phone at k.
[0164] In S602, the screen mode follows the change of the gravity mode, and the mode switching is performed by the incremental method. If the set mode can only change continuously, then the difference between P g [k] and P g [k-1] is generally 1 or -1. It should be noted that the difference between P g [k] and P g [k-1] can be special: 3 or -3. When the difference between P g [k] and P g [k-1] is 3, ΔP' g [k] is set to -1; and when the difference between P g [k] and P g [k-1] is -3, ΔP' g [k] is set to 1.
[0165] Then there is the following judgment formula:
[0166]
[0167] It should be noted that in S601, P g [k] is determined according to the conventional rule; but P g [k-1] is the final gravity mode judgment result at k-1 — it can be determined according to the conventional rule, or it can be determined according to the special rule.
[0168] In S603, P sout [k] remains the screen mode P sout [k-1] at k-1; and P g [k] remains P g [k-1].
[0169] S603 is switching from the flat state to the non-flat state, which is a special case for the gravity mode. Then set: the screen mode is unchanged, the gravity mode is unchanged (i.e. the special rule), that is, there is a judgment formula as follows:
[0170]
[0171] S604, P sout [k] remains the screen mode P of k-1 sout [k-1], P g The value of [k] is updated to P sout The value of [k].
[0172] S604 is switching from the non-flat state to the flat state, which is a special case for the gravity mode. Then set: the screen mode is unchanged, the gravity mode is changed to the same as the screen mode (i.e. the special rule), that is, there is a judgment formula as follows:
[0173]
[0174] The above logical identification method considers multiple conditions for judgment, more comprehensively covers the user's use scene, and also provides accurate judgment results.
[0175] The logical identification method actually splits 10 state scenes: preset gravity mode (4), preset screen mode (4), flat or non-flat state (2), avoids specific judgment of human body posture, reduces calculation amount. And through condition judgment to realize decoupling, separate the gravity mode and the screen mode, reduce the dependence on the sensor, only rely on the built-in gyroscope, accelerometer, touch sensor can realize the collection of related support data.
[0176] Step four, D k Remove the three-axis acceleration to get six-dimensional data X k .
[0177] Wherein, the expression of X k is:
[0178] X k ={ω x [k],ω y [k],ω z [k],θ x [k],θ y [k],θ z [k]}.
[0179] Step five, X k and P sout [k] are added to Udata, and the update times K is increased by 1.
[0180] In Udata, X k as a model input variable, P sout [k] as a true label.
[0181] Step six, determine whether to select which recognition result according to K, specifically:
[0182] I. When K does not reach the preset number threshold K0, the target mobile phone displays the screen according to P sout [k] at k, and repeats steps two to six. K0 is generally an empirical value, but should not be too small to avoid resource waste caused by frequent model training.
[0183] That is, corresponding to the early use of the target mobile phone by the user - the target mobile phone completely relies on logical recognition method to switch between horizontal and vertical screens.
[0184] II. When K reaches K0, train the spatio-temporal graph neural network based on Udata to obtain the user model and perform performance verification.
[0185] It should be noted that the spatio-temporal graph neural network (ST-GNNs) is mainly used to process data with spatio-temporal characteristics. It combines graph neural networks (GNN) and time series modeling to capture spatial dependencies and temporal evolution relationships in spatio-temporal data, and is particularly suitable for application in the present invention to achieve mode switching.
[0186] Specifically, divide Udata into training set and test set: use the training set to train the spatio-temporal graph neural network for multiple rounds to obtain the user model; use the test set to verify whether the user model meets the performance requirements.
[0187] In training, X k as a model input variable, and input into the spatio-temporal graph neural network to obtain the model output variable Y k ; P sout [k] as a true label, and Y k to construct a cross-entropy loss function Γ k ; based on Γ k , the network parameters of the spatio-temporal graph neural network are updated by gradient descent method.
[0188] It should be noted that the data calculation amount is not reduced, Y k removes the preset screen mode three transition state, and only retains the preset screen mode one, preset screen mode two, and preset screen mode four, that is, Y k ∈{1,2,4}.
[0189] In the performance verification, the results output by the user model are compared with the results in the test set to calculate the overall accuracy to reflect the performance of the user model. Generally, a preset performance threshold Per0 is set, and if the performance of the user model exceeds Per0, it means that the performance of the user model is good; otherwise, it means that the performance of the user model is not good. Generally, Per0 takes an empirical value.
[0190] Then there is:
[0191] If the performance of the user model exceeds Per0, the user model is used to process X k to obtain the model judgment result Y sout [k] of the target mobile phone at time k, and the target mobile phone displays the screen according to Y sout [k] at time k, and then repeats steps two, four and six (that is, only the user model is used for processing thereafter); otherwise, K is cleared, and the target mobile phone displays the screen according to P sout [k] at time k, and then repeats steps two to six (that is, the logical recognition method is still used for processing when the performance of the user model is not good).
[0192] Of course, considering the configuration of the target mobile phone, if the target mobile phone has a high configuration, the spatio-temporal graph neural network can be built into the target mobile phone for local end-to-end processing; if the target mobile phone has a low configuration, the spatio-temporal graph neural network can be placed on a cloud server to avoid resource consumption caused by local training.
[0193] It should be noted that the user model is trained by the spatio-temporal graph neural network based on Udata, which fully adapts to the user's usage habits, and can also make relatively accurate judgments when perceiving unknown scenes by utilizing the network characteristics of the spatio-temporal graph neural network.
[0194] In addition, it should be noted that the three-axis angles in D k are estimated values and may have cumulative calculation errors. In order to eliminate this interference, in step six, after completing the screen display, before repeating step two, it is determined whether to clear the angles.
[0195] Specifically:
[0196] 1. If P g [k] is not the same as P g [k-1], then θ x [k], θ y [k], and θ z [k] are all cleared.
[0197] 2. If P sout [k] is not the same as P sout [k-1], then θx [k], θ y [k], θ z [k] are all cleared.
[0198] 3. If the target handset is in the flat state at k and in the non-flat state at k-1, θ x [k], θ y [k], θ z [k] are all cleared.
[0199] 4. If the target handset is in the non-flat state at k and in the flat state at k-1, θ x [k], θ y [k], θ z [k] are all cleared.
[0200] 5. If P sout [k] is 1 and P g [k] is 1, θ x [k] is cleared, θ y [k], θ z [k] remain unchanged;
[0201] 6. If P sout [k] is 2 and P g [k] is 2, θ y [k] is cleared, θ x [k], θ z [k] remain unchanged;
[0202] 7. If P sout [k] is 4 and P g [k] is 4, θ y [k] is cleared, θ x [k], θ z [k] remain unchanged;
[0203] 8. In other cases, θ x [k], θ y [k], θ z [k] remain unchanged.
[0204] That is, the angle clearing exists the following judging formula:
[0205]
[0206] In the formula, ΔP g [k] represents whether the target handset has gravity switching at k, and its value of 1 represents that there is gravity switching, and its value of 0 represents that there is no gravity switching;
[0207] ΔP sout [k] = P sout[k]-P sout [k-1] ; ΔP sout [k] represents whether the target mobile phone has display mode switching at k, and the value of 1 represents that there is display mode switching, and the value of 0 represents that there is no display mode switching;
[0208] ΔP plane [k] = P plane [k]-P plane [k-1] ; ΔP plane [k] represents whether the target mobile phone has gravity mode switching at k, and the value of 1 represents that there is gravity mode switching, and the value of 0 represents that there is no gravity mode switching.
[0209] In addition, the embodiment 1 also synchronously discloses a mobile phone which adopts the above disclosed mobile phone horizontal and vertical screen switching method.
[0210] Since the mobile phone uses the above mobile phone horizontal and vertical screen switching method, it also has the same effect, which is not repeated here.
[0211] Embodiment 2
[0212] The embodiment 2 discloses a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps of the mobile phone horizontal and vertical screen switching method disclosed in the embodiment 1.
[0213] Among them, the computer device can be: mobile terminal, fixed terminal. The former is, for example: mobile phone, notebook computer, digital broadcast receiver, PDA (Personal Digital Assistant: Personal Digital Assistant), PAD (Portable Application Description: tablet computer), PMP (Portable Media Player: Portable Media Player), vehicle terminal (such as vehicle navigation terminal) and the like; The latter is, for example: digital TV, desktop computer and the like.
[0214] The embodiment 2 also discloses a readable storage medium, the readable storage medium stores computer program instructions, and the computer program instructions are read and run by a processor to execute the steps of the mobile phone horizontal and vertical screen switching method disclosed in the embodiment 1.
[0215] The readable storage medium can include, but is not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0216] The embodiment 2 also discloses a computer program product comprising the computer program. The computer program is executed by a processor to implement the steps of the mobile phone portrait / landscape screen switching method disclosed in the embodiment 1.
[0217] It should be noted that the computer program for executing the above-mentioned computer program can be written in one or more programming languages or a combination thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" language or similar programming languages. The computer program can be completely executed on a user computer, partially executed on a user computer, partially executed on a user computer and partially executed on a remote computer, or completely executed on a remote computer or server. In the case involving a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN).
[0218] The technical features of the above-mentioned embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above-mentioned embodiments are not described, however, as long as the combinations of the technical features do not contradict, they should be considered as the scope of the present disclosure.
[0219] The above-mentioned embodiments only express several embodiments of the present application, and the description is relatively specific and detailed, but it should not be understood as a limitation on the scope of the patent. It should be noted that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of the present application. Therefore, the scope of the patent of the present application should be subject to the appended claims.
Claims
1. A method for switching between portrait and landscape modes of a mobile phone, characterized in that, It comprises: Step one, initialize user data set Udata Empty set; Step two, obtaining the nine-dimensional data of the target mobile phone at the last time when the target mobile phone is in use by the target user k -1 D k-1 , the nine-dimensional data of the target mobile phone at the current time k D k ; wherein, D k-1 , D k The dimension types of the three are the same, all including three-axis acceleration, three-axis angular velocity, and three-axis angle. Step three, using a logical identification method to process the data obtained in step two to obtain a logical judgment result D k-1 、 D k k P sout [ k ]; wherein the logical identification method is a multi-condition judgment method that combines steady-state identification, state identification, gravity switching identification, and intent identification. Step four, remove the three-axis acceleration to obtain six-dimensional data D k Remove the three-axis acceleration to obtain six-dimensional data X k ; Step five, add X k and P sout [ k ] to Udata , and increment K by 1. Step six, in K The preset number threshold is not reached K 0, the target mobile phone displays the screen according to P sout [ k ]in k , and steps two to six are repeated. exist K achieve K At 0 o'clock, based on Udata The spatiotemporal graph neural network is trained to obtain the user model, and its performance is verified; if the performance of the user model exceeds a preset performance threshold... Per If 0, then the user model is used. X k Processing is performed to obtain the target phone's... k Model judgment results at that time Y sout [ k The target mobile phone is based on Y sout [ k ]exist k If the screen display is active, repeat steps two, four, and six; otherwise, [then the screen will be displayed]. K Reset, target phone based on P sout [ k ]exist k Then display the screen and repeat steps two through six. The target mobile phone has preset screen modes one, two, three and four; wherein, the preset screen mode one is that the mobile phone is in portrait screen and displays in portrait screen; the serial number of the preset screen mode one is 1; the preset screen mode two is that the mobile phone is in portrait screen and displays in positive landscape screen; the serial number of the preset screen mode two is 2; the preset screen mode three is that the mobile phone is in portrait screen and keeps the screen display of the last moment; the serial number of the preset screen mode three is 3; the preset screen mode four is that the mobile phone is in portrait screen and displays in reverse landscape screen; the serial number of the preset screen mode four is 4; The target mobile phone has preset gravity modes one, two, three and four; wherein, the preset gravity mode one is that the mobile phone is in portrait screen and displays in portrait screen; the serial number of the preset gravity mode one is 1; the preset gravity mode two is that the mobile phone is in reverse landscape screen and displays in reverse landscape screen; the serial number of the preset gravity mode two is 2; the preset gravity mode three is that the mobile phone is in upside down and displays in upside down; the serial number of the preset gravity mode three is 3; the preset gravity mode four is that the mobile phone is in positive landscape screen and displays in positive landscape screen; the serial number of the preset gravity mode four is 4; The screen of the target mobile phone is divided into touch sensing areas one, two, three and four according to the upper left, upper right, lower left and lower right, and whether it is touched is detected by the touch sensor built in the screen; D k The triaxial acceleration in the three directions is collected by an accelerometer built in the target mobile phone; D k The three-axis angular velocities in the three axes are obtained by a gyroscope built in the target mobile phone. D k The triaxial angle in the formula (1) is based on D k-1 The triaxial acceleration and triaxial angular velocity in the formula (1) are calculated. Step three comprises: S301, based on D k steady state recognition is performed to determine whether the target mobile phone is in a steady state or not at k the time; If so, then obtain k The target mobile phone screen is touched at that time, and S302 is performed; If not, then acquiring k the target mobile phone screen being touched at the time, and proceeding to S304; S302, if any of the touch sensing area one, touch sensing area two, touch sensing area three, touch sensing area four is touched, then proceed to S303; otherwise k S303, if the touch sensing area one is touched, then proceed to S304; otherwise P sout [ k ] the logic judgment result of the touch sensing area one is kept as k -1 P sout [ k -1] ; S303, state recognition is performed to determine whether the target mobile phone is in a state of P sout [ k ] is determined according to a conventional rule P g [ k ] is determined according to a conventional rule; wherein, P g [ k ] represents a gravity mode in which the target mobile phone is located k S304, if in k If any of the four touch sensing areas (touch sensing area 1, touch sensing area 2, touch sensing area 3, touch sensing area 4) is touched, proceed to S305; otherwise, proceed to S306. S305, based on D k-1 , D k performing gravity switch recognition to determine whether the target mobile phone has a gravity switch at k ; If yes, S303 is performed; If not, then P sout [ k ] remains as k the logical decision result of -1 P sout [ k -1] ; S306, based on D k-1 、 D k performing intent recognition to determine that P sout [ k ]; The method for intention recognition comprises: S600, state judgment is performed to determine whether the target mobile phone is in a plane state; If the target mobile phone is in a flat state at k , k -1, S601 is performed. If the target mobile phone is in a non-planar state at k , k -1, S602 is performed. If the target mobile phone is in a flat state at k -1 and in a non-flat state at k S603 is performed. If the target mobile phone is in a non-flat state at k and in a flat state at k -1, S604 is performed. The method for state judgment comprises: If -V z ≤ a z [ k ]≤ V z , the target mobile phone is in a flat state at k . If a z [ k ]> V z Or a z [ k ]< -V z The target mobile phone is in a non-planar state at k time. wherein a z [ k ] represents the target phone's k z axis acceleration at V z represents the floor state threshold lower bound; V z represents the floor state threshold upper bound; S601, according to Delta theta z [ k ] determine k reference identification result P Ip [ k ], and according to P Ip [ k ] determine P sout [ k ]; according to the conventional rule P g [ k ]. wherein, Delta theta z [ k ] represents Theta z [ k ] compared to Theta z [ k -1] the amount of change; Delta theta z [ k ]= Theta z [ k ]- Theta z [ k -1]; Theta z [ k ] represents k the target mobile phone's z axis angle; Theta z [ k -1] represents k the target mobile phone's z-axis angle; If Delta theta z [ k ] is greater than 0 and Delta theta z [ k ] is greater than 0, then V az , the absolute value of P sout [ k -1] is added by 1 to obtain P Ip [ k ]; wherein, V az denotes a preset angle change threshold value; If Delta theta z [ k ] is less than Delta theta z [ k ] and the absolute value of V az , then P sout [ k -1] is subtracted from P Ip [ k ]; If P Ip [ k ] is 1 or 5, then P sout [ k ] is 1, indicating that preset screen mode one is adopted; if P Ip [ k ] is 2, then P sout [ k ] is 2, indicating that preset screen mode two is adopted; if P Ip [ k ] is 2, then P sout [ k ] is 3, indicating that preset screen mode three is adopted; if P Ip [ k ] is 4 or 0, then P sout [ k ] is 4, indicating that preset screen mode four is adopted; S602, if Theta x [ k ]> V ax or Theta y [ k ]> V ay then P sout [ k -1] is added to Delta P' g [ k ] to obtain P sout [ k ] ; otherwise, P sout [ k ] remains the screen mode at k -1 P sout [ k -1] ; wherein Delta P' g [ k ] represents k a time gravity pattern variable which satisfies: If P g [ k ] is 1 or -3, then P g [ k -1] is 1 or -3, then Delta P' g [ k ] is 1; If P g [ k ] is -1 or 3, then P g [ k -1] is -1 or 3, then Delta P' g [ k ] is -1; wherein, P g [ k -1] represents k the gravity mode in which the target mobile phone is located when the value of the parameter is -1; P g [ k ] represents k the gravity mode in which the target mobile phone is located when the value of the parameter is -1; P g [ k ] is determined according to a conventional rule; P g [ k -1] is k the final gravity mode determination result when the value of the parameter is -1; S603, P sout [ k ] remains as k -1 when the screen mode P sout [ k -1]; P g [ k ] remains as P g [ k -1]; S604, P sout [ k ] is maintained as k -1 when the screen mode P sout [ k -1], P g [ k ] is updated to P sout [ k ] value.
2. The method of claim 1, wherein, The method for steady state recognition comprises: based on a x [ k ], a y [ k ], a z [ k ] calculated g [ k ] ; If V s_lb < g [ k ]< V s_ub , the target mobile phone is in steady state at k ; otherwise, the target mobile phone is in non-steady state at k . wherein, a x [ k ] represents the k axis acceleration of the target handset at x ; a y [ k ] represents the k axis acceleration of the target handset at y ; a z [ k ] represents the k axis acceleration of the target handset at z ; g [ k ] represents the k combined acceleration at ; V s_lb represents the lower limit of the steady state recognition threshold; V s_ub represents the upper limit of the steady state recognition threshold; And / or, the method for state recognition comprises: According to k a target mobile phone screen being touched at the time, determine k a screen mode at the time P state [ k ] and send P state [ k ] as P sout [ k ] If only touch sensing area three has touch, or only touch sensing area four has touch, or only touch sensing area three and touch sensing area four have touch, then k the screen mode is preset screen mode one. P state [ k ] is 1, indicating that preset screen mode one is adopted; if, at the time when k touch sensing area one has touch and touch sensing area two has no touch, then P state [ k ] is 2, indicating that preset screen mode two is adopted; if, at the time when k touch sensing area one has no touch and touch sensing area two has touch, then P state [ k ] is 4, indicating that preset screen mode four is adopted; otherwise P state [ k ] remains the screen mode k -1 at the time P state [ k -1].
3. The method of claim 2, wherein, The method for gravity switching recognition comprises: compare P g [ k ] with P g [ k -1] whether the same; If same, target phone in k has gravity switch; otherwise target phone in k has no gravity switch; wherein, P g [ k ], P g [ k -1] respectively represent k the gravity mode in which the target mobile phone is located 、k -1 the gravity mode in which the target mobile phone is located; at the time of gravity switching identification, P g [ k ] is determined according to the conventional rule, P g [ k -1] is k -1 the final gravity mode judgment result.
4. The method of claim 1, wherein, In step six, during training, X k as model input variables, and input into the spatio-temporal graph neural network to obtain model output variables Y k ; P sout [ k ] as real labels, and Y k a cross-entropy loss function Γ is constructed k ; based on Γ k network parameters of the spatio-temporal graph neural network are updated by back propagation through gradient descent method; In step six, after the screen display is completed, before step two is repeated, it is determined whether to clear the angle; wherein, if P g [ k ] is not equal to P g [ k -1], then Theta x [ k ], Theta y [ k ], Theta z [ k ] are all cleared. If P sout [ k ] and P sout [ k -1] are not identical, then Theta x [ k ], Theta y [ k ], Theta z [ k ] are all cleared. If the target mobile phone is in a flat state at k -1 and in a non-flat state at k -1, then the values of Theta x [ k ]、 Theta y [ k ]、 Theta z [ k ] are all cleared. If the target mobile phone is in a non-planar state at k time, and in a planar state at k -1 time, then the Theta x [ k ]、 Theta y [ k ]、 Theta z [ k ] are all cleared. if P sout [ k ] is 1 and P g [ k ] is 1, then Theta x [ k ] is cleared, Theta y [ k ], Theta z [ k ] remains unchanged; If P sout [ k ] is 2 and P g [ k ] is 2, then Theta y [ k ] is cleared, Theta x [ k ], Theta z [ k ] remains unchanged; if P sout [ k ] is 4 and P g [ k ] is 4, then Theta y [ k ] is cleared, Theta x [ k ], Theta z [ k ] remains unchanged; Other cases are Theta x [ k ], Theta y [ k ], Theta z [ k ] remain unchanged; wherein Theta x [ k ] denotes the axis angle of the target handset when k x Theta y [ k ] denotes the axis angle of the target handset when k y Theta z [ k ] denotes the axis angle of the target handset when k z z z z z z z z z z z z z z z z z z z z z z z z z z < 5. The method of claim 3 or 4, wherein, determined in accordance with conventional rules P g [ k ] the method comprises: If -V g < a x [ k ]< V g And a y [ k ]< P g [ k ]is 1, indicating that the preset gravity mode one is adopted; If -V g < a y [ k ]< V g And a x [ k ]< 0, then P g [ k ] is 2, indicating that the preset gravity mode two is adopted; If -V g < a x [ k ]< V g and a y [ k ]>0, then P g [ k ] is 3, indicating that the preset gravity mode three is adopted; If -V g < a y [ k ]< V g And a x [ k ]>0, then P g [ k ] is 4, indicating that the preset gravity mode four is adopted; Other cases are P g [ k ] kept as P g [ k -1] wherein, a x [ k ] represents the k axis acceleration of the target handset at x a y [ k ] represents the k axis acceleration of the target handset at y V g represents a lower gravity mode threshold value; V g represents an upper gravity mode threshold value. 6. A handset, comprising: It adopts the mobile phone landscape / portrait screen switching method according to any one of claims 1-5.
7. A computer program product, characterised in that, It comprises a computer program; when the computer program is executed by a processor, the steps of the mobile phone landscape / portrait screen switching method according to any one of claims 1-5 are realized.
Citation Information
Patent Citations
Method for horizontal and vertical switching of touch screen of mobile terminal and mobile terminal
CN101800816A
Method for controlling switchover between horizontal screen and vertical screen states of mobile phone
CN103336655A