Method for implementing virtual gravity sensing, and display method for application interface of learning machine

By generating virtual gravity sensing parameters through system services, the problem of insufficient parameter acquisition by applications under the default posture of display devices is solved, enabling adaptive response of interface and functions and reducing hardware costs.

WO2026025280A1PCT designated stage Publication Date: 2026-02-05GUANGZHOU XIBEISI INTELLIGENT TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/108439
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2026-02-05

AI Technical Summary

Technical Problem

When the display device is in a default usage posture, the application cannot obtain the applicable gravity sensor parameters, resulting in interface switching and function implementation that do not meet user needs.

Method used

The system receives notifications from the target application through system services, determines the display status of the application interface, generates virtual gravity sensing parameters based on the default gravity sensing parameters, and feeds them back to the target application to simulate gravity sensing parameters that are adapted to the posture of the display device.

Benefits of technology

Without configuring a real gravity sensor, the application was able to obtain applicable gravity sensing parameters, ensuring that interface switching and function response met user needs and reducing hardware costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024108439_05022026_PF_FP_ABST
    Figure CN2024108439_05022026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a method for implementing virtual gravity sensing, and a display method for an application interface of a learning machine. The method for implementing virtual gravity sensing is applied to a display device, and the display device has a default usage orientation. The method for implementing virtual gravity sensing comprises: a system service of a display device receiving a notification that is used for acquiring gravity sensing parameters and sent by a target application installed in the display device; the system service determining a current display state of an application interface of the target application, wherein the display state is a landscape display state or a portrait display state; on the basis of the display state and default gravity sensing parameters, the system service obtaining virtual gravity sensing parameters applicable to the application interface; and the system service feeding back the virtual gravity sensing parameters to the target application. The technical means solves the technical problem in the related art of it not being possible for an application program in a display device to obtain applicable gravity sensing parameters when the display device has a default usage orientation.
Need to check novelty before this filing date? Find Prior Art

Description

Virtual gravity sensing implementation method and display method of learning machine application interface TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of virtual gravity sensing, and in particular to a virtual gravity sensing implementation method and a display method of a learning machine application interface. BACKGROUND

[0002] A gravity sensor is a new type of sensor technology that can complete the conversion of gravity changes to electrical signals, and is often configured in display devices such as mobile phones and tablet computers, so that the application program installed in the display device determines whether the application interface should be displayed in a horizontal screen or a vertical screen through the gravity sensor.

[0003] In related technologies, some display devices have a default use posture, for example, a learning machine type display device usually needs to be fixed on a desktop for use, and does not rotate or move during use. At this time, the gravity sensor configured in the display device with the default use posture does not play a big role, but the application program installed in the display device may still need the parameters collected by the gravity sensor, for example, after the user switches the interface of the application program from horizontal screen display to vertical screen display, the application program still needs to obtain the parameters collected by the gravity sensor to determine whether the display device is in a vertical screen state, and then determine whether to continue to display the application interface in a vertical screen. However, the value of the parameters collected by the gravity sensor does not change significantly under the default use posture, so that the current parameters collected by the gravity sensor cannot meet the actual needs of the application program, for example, the user switches the application interface to vertical screen display, but the parameters collected by the gravity sensor are still the parameters when the display device is in a horizontal screen, so the parameters collected by the gravity sensor are not suitable for the vertical screen display state of the application interface.

[0004] Therefore, when the display device (such as a learning machine) has a default use posture, how to make the application program in the display device obtain suitable parameters collected by the gravity sensor has become a problem to be solved.

[0005] SUMMARY

[0006] Embodiments of the present application provide a virtual gravity sensing implementation method and a display method of a learning machine application interface to solve the technical problem that the application program in the display device (such as a learning machine) cannot obtain suitable gravity sensing parameters when the display device has a default use posture in related technologies.

[0007] In a first aspect, one embodiment of the present application provides a virtual gravity sensing implementation method applied to a display device, wherein the display device has a default use posture,

[0008] The virtual gravity sensing implementation method comprises:

[0009] receiving, by a system service of the display device, a notification for acquiring a gravity sensing parameter from a target application, the target application being an application program installed in the display device and having a demand for acquiring the gravity sensing parameter;

[0010] determining, by the system service, a current display state of an application interface of the target application, the display state being a landscape display state or a portrait display state;

[0011] obtaining, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state and a default gravity sensing parameter;

[0012] feeding back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

[0013] In the above, when the target application needs to acquire the gravity sensing parameter, the target application notifies the system service, so that the system service receives the notification from the target application. Then, the system service determines whether the application interface of the target application is in the landscape display state or the portrait display state. Then, the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state of the application interface and the default gravity sensing parameter, and feeds back the virtual gravity sensing parameter to the target application. The technical means solves the technical problem that when the display device (such as a learning machine) has a default use posture, the application program in the display device cannot acquire the applicable gravity sensing parameter in the related technology. By setting the default gravity sensing parameter and adjusting the default gravity sensing parameter in combination with the display state of the application interface, the virtual gravity sensing parameter suitable for the display state can be obtained, and then the target application can simulate the use posture of the display device to adapt to the display state of the application interface, so as to acquire the applicable gravity sensing parameter when the target application has the demand for acquiring the gravity sensing parameter. Moreover, for the display device with a fixed use posture (i.e., the display device that does not need to acquire the tilt angle or cannot be moved and rotated), the simulation of the gravity sensor can be realized, and the real gravity sensor does not need to be configured, so that one hardware module of the display device can be reduced, and the cost of the display device is saved.

[0014] In an embodiment of the present application, when the system service determines the current display state of the application interface of the target application, the system service further comprises:

[0015] determining, by the system service, a current content display direction of the application interface, the content display direction being a content display positive direction or a content display reverse direction;

[0016] The system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state and the default gravity sensing parameter, comprising:

[0017] obtaining, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction and a default gravity sensing parameter.

[0018] The default gravity sensing parameter is adjusted according to the display state and the content display direction of the application interface to obtain a virtual gravity sensing parameter adapted to the display state and the content display direction, and then the target application simulates the use posture of the display device to adapt to the display state of the application interface to obtain an applicable gravity sensing parameter when the target application needs to obtain a gravity sensing parameter, and the gravity sensing parameter is applicable to the forward display and the reverse display of the application interface.

[0019] In an embodiment of the present application, the obtaining, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction and a default gravity sensing parameter comprises:

[0020] determining, by the system service, a corresponding parameter generation rule according to the display state and the content display direction;

[0021] obtaining, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the parameter generation rule and the values of the default gravity sensing parameter in three coordinate directions.

[0022] In an embodiment of the present application, the default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction and a third value in a third coordinate direction, the first coordinate direction is a vertical upward direction of the display device in a default use posture, the second coordinate direction is a horizontal left direction of the display device in the default use posture, and the third coordinate direction is a direction perpendicular to the plane on which the display device is located and outward in the default use posture;

[0023] The determining, by the system service, a corresponding parameter generation rule according to the display state and the content display direction comprises:

[0024] When the display state is a horizontal display state and the content display direction is a content display forward direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0025] In an embodiment of the present application, the default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward of the display device in the default use posture and perpendicular to a plane on which the display device is located;

[0026] The parameter generation rule determined by the system service according to the display state and the content display direction comprises:

[0027] When the display state is the horizontal display state and the content display direction is the content display reverse direction, the parameter generation rule determined by the system service is that a negative of the first value in the default gravity sensing parameter is taken as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, a negative of the second value in the default gravity sensing parameter is taken as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, and the third value in the default gravity sensing parameter is taken as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0028] In an embodiment of the present application, the default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward of the display device in the default use posture and perpendicular to a plane on which the display device is located;

[0029] The parameter generation rule determined by the system service according to the display state and the content display direction comprises:

[0030] When the display state is the vertical display state and the content display direction is the content display positive direction, the parameter generation rule determined by the system service is that the first value in the default gravity sensing parameter is taken as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, the second value in the default gravity sensing parameter is taken as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, and the third value in the default gravity sensing parameter is taken as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0031] In an embodiment of the present application, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction perpendicular to a plane on which the display device is located and outward of the display device in the default use posture;

[0032] The parameter generation rule determined by the system service according to the display state and the content display direction includes:

[0033] When the display state is a portrait display state and the content display direction is a reverse content display direction, the parameter generation rule determined by the system service is to take a negative of the first value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, take a negative of the second value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0034] In an embodiment of the present application, after the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction, and the default gravity sensing parameter, the system service further:

[0035] The system service determines a virtual gravity sensing direction corresponding to the display state and the content display direction;

[0036] When the system service feeds back the virtual gravity sensing parameter applicable to the application interface to the target application, the system service further:

[0037] The system service feeds back the virtual gravity sensing direction to the target application.

[0038] As described above, when determining the virtual gravity sensing parameter, the system service can also obtain the virtual gravity sensing direction applicable to the application interface and feed back to the target application, so that the target application obtains more types of parameters to implement more accurate business processing based on more types of parameters.

[0039] In an embodiment of the present application, after the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction, and the default gravity sensing parameter, the system service further:

[0040] determining, by the system service, a second screen angle corresponding to the display state and the content display direction, the second screen angle being equal to an included angle between a display device usage posture corresponding to the virtual gravity sensing parameter and a preset usage posture in a clockwise direction;

[0041] The system service feeding back the virtual gravity sensing parameter applicable to the application interface of the target application to the target application further includes:

[0042] The system service feeding back the second screen angle to the target application.

[0043] The system service can obtain the second screen angle applicable to the application interface when determining the virtual gravity sensing parameter, and feed back the second screen angle to the target application, so that the target application obtains more types of parameters to implement more accurate business processing based on more types of parameters.

[0044] In an embodiment of the present application, the system service determining the current display state of the application interface of the target application includes:

[0045] The system service obtaining a display size parameter of the application interface of the target application, the display size parameter including a width parameter of the application interface and a height parameter of the application interface;

[0046] The system service obtaining the current display state of the application interface according to the display size parameter, wherein the width parameter is greater than the height parameter in the horizontal display state, and the width parameter is less than the height parameter in the vertical display state.

[0047] In an embodiment of the present application, the system service determining the current content display direction of the application interface includes:

[0048] The system service obtaining a first screen angle, the first screen angle being a first angle value or a second angle value, the first angle value being a screen display angle of the application interface in a forward display state of the display device in a default usage posture, and the second angle value being a screen display angle of the application interface in a reverse display state of the display device in the default usage posture;

[0049] The system service determining the current content display direction of the application interface according to the first screen angle.

[0050] In an embodiment of the present application, the system service of the display device receiving a notification for obtaining a gravity sensing parameter issued by a target application includes:

[0051] receiving, by a system service of the display device, an inquiry of whether a gravity sensor is supported, the inquiry being sent by the target application when the target application needs to acquire a gravity sensing parameter;

[0052] feeding back, by the system service, to the target application that a gravity sensor is currently supported, so that the target application registers in the system service;

[0053] the feeding back, by the system service, of the virtual gravity sensing parameter applicable to the application interface to the target application, comprising:

[0054] feeding back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the registered target application.

[0055] In an embodiment of the present application, after the feeding back, by the system service, of the virtual gravity sensing parameter applicable to the application interface to the target application, the method further comprises:

[0056] stopping, by the system service, feeding back the virtual gravity sensing parameter to the target application when the target application cancels the registration.

[0057] In an embodiment of the present application, before the obtaining, by the system service, of the virtual gravity sensing parameter applicable to the application interface according to the display state and the default gravity sensing parameter, the method further comprises:

[0058] obtaining, by the system service, a default gravity sensing parameter from a gravity sensor process, the default gravity sensing parameter being pre-set in the gravity sensor process.

[0059] In an embodiment of the present application, before the receiving, by the system service of the display device, of the notification sent by the target application for acquiring a gravity sensing parameter, the method further comprises:

[0060] starting the system service and the gravity sensor process when the display device is powered on;

[0061] receiving, by the system service, a declaration of the gravity sensor process, the declaration being used to indicate that the display device supports the function of acquiring a gravity sensing parameter.

[0062] In a second aspect, an embodiment of the present application further provides a display method of an application interface of a learning machine, applied to the learning machine, the learning machine having a default display state, the default display state being a horizontal display state or a vertical display state, the horizontal display state being applicable to a horizontal screen state, and the vertical display state being applicable to a vertical screen state;

[0063] the display method of the application interface of the learning machine comprising:

[0064] determining, by a system service of the learning machine, a display state that an application interface of a target application should use, the display state being a landscape display state or a portrait display state, the target application being an application program installed in the learning machine;

[0065] determining, by the system service, whether the display state that should be used is consistent with the default display state, and when the display state that should be used is not consistent with the default display state, obtaining a virtual gravity sensing parameter suitable for the display state that should be used according to the display state that should be used and the default gravity sensing parameter;

[0066] feeding back, by the system service, the virtual gravity sensing parameter to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter and the display state that should be used, and the displayed application interface is still in the display state that should be used in a use posture corresponding to the default display state, the application interface only occupies part of the display area of the learning machine, and other display areas of the learning machine are background display areas.

[0067] The above, the learning machine with a default display state (the use posture of the learning machine suitable for the default display state is fixed) determines the display state that the application interface of the target application should use, and when the display state that the application interface should use is inconsistent with the default display state of the learning machine, the virtual gravity sensing parameter suitable for the display state that the application interface should use is obtained according to the display state that the application interface should use and the default gravity sensing parameter, and the virtual gravity sensing parameter is fed back to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter, and the application interface is still in the display state that should be used and suitable for the use posture corresponding to the default display state of the learning machine. The technical means solves the technical problem that the application program cannot obtain suitable gravity sensing parameters when the learning machine has a default use posture in the related art. By setting the default gravity sensing parameter suitable for the default display state, and adjusting the default gravity sensing parameter when the default display state of the learning machine is inconsistent with the display state that the application interface should use, the virtual gravity sensing parameter suitable for the display state that should be used can be obtained, so that suitable gravity sensing parameters can be obtained when the target application has a demand for obtaining gravity sensing parameters, so that the target application can simulate the use posture of the learning machine that is suitable for the display state of the application interface. At this time, the application interface can only occupy part of the display area of the learning machine, that is, the application interface that is inconsistent with the default display state in the learning machine is realized.

[0068] In a third aspect, an embodiment of the present application also provides a virtual gravity sensing implementation device applied to a display device, the display device having a default use posture,

[0069] The virtual gravity sensing implementation device comprises:

[0070] A notification receiving unit is configured to receive, by a system service of the display device, a notification for obtaining a gravity sensing parameter sent by a target application, the target application being an application program installed in the display device and having a demand for obtaining a gravity sensing parameter;

[0071] A state determining unit is configured to determine, by the system service, a current display state of an application interface of the target application, the display state being a landscape display state or a portrait display state;

[0072] A parameter determining unit is configured to obtain, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state and a default gravity sensing parameter;

[0073] A parameter feedback unit is configured to feed back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

[0074] In a fourth aspect, an embodiment of the present application further provides a display device, comprising a display screen, one or more processors and a memory,

[0075] The memory is configured to store one or more programs;

[0076] The display screen is configured to realize display;

[0077] When the one or more programs are executed by the one or more processors, the one or more processors realize the virtual gravity sensing implementation method according to the first aspect.

[0078] In a fifth aspect, an embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to realize the virtual gravity sensing implementation method according to the first aspect.

[0079] The virtual gravity sensing implementation device, the display device and the storage medium provided above have the beneficial effects of the virtual gravity sensing implementation method. BRIEF DESCRIPTION OF DRAWINGS

[0080] FIG. 1 is a schematic diagram of a display device in a landscape display mode in the related art;

[0081] FIG. 2 is a schematic diagram of a display device in a portrait display mode in the related art;

[0082] FIG. 3 is a first schematic diagram of a coordinate system applicable to a gravity sensor configured in a mobile phone in the related art;

[0083] FIG. 4 is a second schematic diagram of a coordinate system applicable to a gravity sensor configured in a mobile phone in the related art;

[0084] FIG. 5 is a schematic diagram of a coordinate system to which a gravity sensor configured in a learning machine in the related art is applicable;

[0085] FIG. 6 is an application interface of an application in a learning machine in the related art in a portrait display;

[0086] FIG. 7 is an application interface of an application in a learning machine in the related art in a landscape display;

[0087] FIG. 8 is a schematic diagram of a structure of a display device provided in an embodiment of the present application;

[0088] FIG. 9 is a schematic diagram of a system architecture of an operating system provided in an embodiment of the present application;

[0089] FIG. 10 is a flowchart of a virtual gravity sensor implementation method provided in an embodiment of the present application;

[0090] FIG. 11 is a schematic diagram of a landscape display state provided in an embodiment of the present application;

[0091] FIG. 12 is a schematic diagram of a portrait display state provided in an embodiment of the present application;

[0092] FIG. 13 is a schematic diagram of a terminal device rotation provided in an embodiment of the present application;

[0093] FIG. 14 is a flowchart of a virtual gravity sensor implementation method provided in another embodiment of the present application;

[0094] FIG. 15 is a first schematic diagram of an application interface provided in an embodiment of the present application;

[0095] FIG. 16 is a second schematic diagram of an application interface provided in an embodiment of the present application;

[0096] FIG. 17 is a first corresponding relationship diagram of an application interface and a display device posture provided in an embodiment of the present application;

[0097] FIG. 18 is a second corresponding relationship diagram of an application interface and a display device posture provided in an embodiment of the present application;

[0098] FIG. 19 is a third corresponding relationship diagram of an application interface and a display device posture provided in an embodiment of the present application;

[0099] FIG. 20 is a fourth corresponding relationship diagram of an application interface and a display device posture provided in an embodiment of the present application;

[0100] FIG. 21 is a first schematic diagram of a signal transmission type provided in an embodiment of the present application;

[0101] FIG. 22 is a second schematic diagram of a signal transmission type according to an embodiment of the present application;

[0102] FIG. 23 is a flowchart of a display method of a learning machine application interface according to an embodiment of the present application;

[0103] FIG. 24 is a structural schematic diagram of a virtual gravity sensor implementation device according to an embodiment of the present application;

[0104] FIG. 25 is a structural schematic diagram of a learning machine application interface display device according to an embodiment of the present application. DETAILED DESCRIPTION

[0105] The present application will be further described below in conjunction with the accompanying drawings and embodiments. It can be understood that the specific embodiments described herein are used to explain the present application, rather than limit the present application. In addition, it should be noted that, for the convenience of description, only the parts related to the present application are shown in the accompanying drawings, rather than all the parts.

[0106] The display device refers to a display device with a display screen for display, such as a learning machine, a mobile phone, a tablet computer, etc. The display screen installed in the display device is usually rectangular, having a long side and a short side. Based on the shape of the display screen, the display device can implement two use postures, and the two use postures are a landscape state and a portrait state respectively. The landscape state corresponds to landscape display, and the portrait state corresponds to portrait display. In the landscape display, the long side of the display screen serves as the width of the rectangle, and the short side of the display screen serves as the height of the rectangle. In the portrait display, the long side of the display screen serves as the height of the rectangle, and the short side of the display screen serves as the width of the rectangle. FIG. 1 is a schematic diagram of a display device in landscape display in the related art, and FIG. 2 is a schematic diagram of a display device in portrait display in the related art. As shown in FIGS. 1 and 2, the display device 10 has different use postures in the landscape display and the portrait display. At this time, some application programs installed in the display device have application interfaces suitable for the landscape display (i.e., the landscape state) and application interfaces suitable for the portrait display (i.e., the portrait state), so that the application interfaces of the application programs can be as full as possible on the display screen.

[0107] In the related art, the application program of the display device can determine whether the display device is currently in landscape display or portrait display through the configured gravity sensor.

[0108] Taking a mobile phone as an example of the display device, FIG. 3 is a first schematic diagram of a coordinate system applicable to a gravity sensor configured in a mobile phone in the related art. In FIG. 3, the plane on which the display screen of the mobile phone is located is a vertical plane, and the coordinate system used by the gravity sensor configured in the mobile phone in the working process can refer to FIG. 3. The coordinate system is a three-dimensional coordinate system, wherein the direction in which the y-axis is located is the direction in which the long side of the display screen 21 is located (the y-axis is the vertically upward direction when the mobile phone 20 is vertically placed and normally used), the direction in which the x-axis is located is the direction in which the short side of the display screen 21 is located (the x-axis is the horizontally right direction when the mobile phone 20 is vertically placed and normally used), and the direction in which the z-axis is located is the direction perpendicular to the display screen 21 and outward (i.e., facing the user). When the mobile phone rotates, the three-dimensional coordinate system also adaptively rotates. For example, FIG. 4 is a second schematic diagram of a coordinate system applicable to a gravity sensor configured in a mobile phone in the related art. When the mobile phone 20 is rotated counterclockwise by 90° from the posture shown in FIG. 3 to the posture shown in FIG. 4, the directions in which the x-axis, the y-axis, and the z-axis are located can refer to FIG. 4. Compared with FIG. 3, the x-axis, the y-axis, and the z-axis are also synchronously rotated counterclockwise by 90° in FIG. 4.

[0109] In the working process of the gravity sensor, the components of the gravity in three directions (i.e., the directions in which the x-axis, the y-axis, and the z-axis are located) can be measured, so that the application program of the display device determines the posture of the display device according to the components of the gravity in the three directions, i.e., determines whether the display device is in a horizontal screen state or a vertical screen state. Currently, the components in the three directions measured by the gravity sensor are referred to as gravity sensing parameters. For example, when the display device is in the posture shown in FIG. 3, the gravity sensing parameters collected by the gravity sensor are (0, 9.8, 0), which indicates that the component of the gravity in the y-axis direction is 9.8, and the components of the gravity in the x-axis direction and the z-axis direction are both 0.

[0110] The application program installed in the display device can obtain the gravity sensing parameters and identify whether the display device is in a horizontal screen state or a vertical screen state according to the gravity sensing parameters, and then perform some logical judgment. For example, the current application interface of the application program is applicable to the horizontal screen state. After the user switches the application interface to the vertical screen state, the application program needs to obtain the gravity sensing parameters through the gravity sensor and determine whether the display device is in the vertical screen state based on the gravity sensing parameters, i.e., determine whether the display device also rotates correspondingly. If it is the vertical screen state, the application program maintains the application interface in the vertical screen state. Otherwise, the application program automatically switches the application interface to the horizontal screen state. It can be understood that the display device is in the vertical screen state, and there are two postures. Taking the mobile phone shown in FIG. 3 as an example, the front camera 22 is located above the screen or the front camera 22 is located below the screen (i.e., the mobile phone is rotated by 180 degrees along the vertical direction clockwise or counterclockwise from the posture shown in FIG. 3), which can be considered as the vertical screen. However, the gravity sensing parameters corresponding to the two vertical screens are different, so the application program can further determine which vertical screen the display device is currently in according to the gravity sensing parameters. The same is true for the horizontal screen.

[0111] However, some display devices have a default usage posture. This default posture can be understood as the display device maintaining a fixed posture during operation (i.e., when used by the user), without movement or rotation. For example, a vertical learning machine (hereinafter referred to as a learning machine) can be considered a display device with a default usage posture. Learning machines can also be referred to as learning tablets or smart learning devices, and they come pre-installed with various learning applications for students to use. Learning machines are typically fixed on a desktop for landscape use, with the screen at a certain angle (e.g., 90° or close to 90°) to the desktop. Furthermore, considering eye protection for students (e.g., children), the screen size of learning machines is usually relatively large (e.g., 15 or 16 inches). This means that the learning machine usually does not rotate or move during use; therefore, it can be considered to have a default usage posture. When the learning machine's default usage posture is landscape, the long side of the screen is horizontal, the front-facing camera is located at the top of the learning machine, and the short side of the screen is vertical or approximately vertical. If a gravity sensor is installed in the learning machine, the coordinate system used by the gravity sensor during operation can be referenced in Figure 5. Figure 5 is a schematic diagram of the coordinate system applicable to the gravity sensor configured in the learning machine in related technologies. As shown in Figure 5, in the coordinate system used by the gravity sensor, the y-axis is in the direction of the long side of the display screen (when the learning machine 30 is in normal use, the y-axis is horizontal to the left), the x-axis is in the direction of the short side of the display screen (when the learning machine 30 is in normal use, the x-axis is vertically upward), and the z-axis is perpendicular to the display screen and points outward. The front-facing camera 31 is generally located above the learning machine 30. Since the learning machine has a default usage posture, the accuracy requirement of the gravity sensor is low, that is, the gravity sensing parameters measured by the gravity sensor will not change significantly. In this case, to save costs, there are also cases where a gravity sensor is not configured in the learning machine.

[0112] However, some applications in the learning machine can have the need for gravity sensing parameters. For example, as some applications can support the interface of portrait display (see FIG. 12, the interface of portrait display should be suitable for the portrait state) and the interface of landscape display (see FIG. 7, the interface of landscape display should be suitable for the landscape state), in the case that the application installed in the learning machine can support both the portrait display and the landscape display, in order to realize that the application interface of the application in the portrait display can meet the viewing experience of the user in the default use posture (the landscape state) of the learning machine, although the learning machine is in the landscape state, the application interface of the application is in the state of portrait display, at this time, the application interface only occupies part of the display area of the display screen. For example, FIG. 6 is the application interface of the application in the learning machine in the portrait display in the related art, referring to FIG. 6, the application interface 41 of the application is in the state of portrait display, at this time, the application interface 41 only occupies part of the display area of the display screen. The other display area of the display screen can be considered as the background display area 42, and the background display area 42 only displays the background pattern. The application interface of the application in the landscape display is suitable for the landscape state of the learning machine. FIG. 7 is the application interface of the application in the learning machine in the landscape display in the related art. The application interface 43 of the application is in the state of landscape display, at this time, the application interface 43 occupies the entire display area of the display screen, and can also be considered as full-screen display. It can be understood that the application interfaces shown in FIG. 6 and FIG. 7 are only for the purpose of understanding the difference between the application interfaces in the portrait display and the landscape display, and do not limit the content of the application interfaces.

[0113] When the application can support the portrait display and the landscape display, the user can switch the application interface of the application between the landscape display and the portrait display in the learning machine, and after the user performs the switching, the application needs to obtain the gravity sensing parameters to determine whether the switching is successful. Generally, the application interface in the portrait display should be suitable for the portrait state, and the application interface in the landscape display should be suitable for the landscape state. The inventors found in the development process that, as the learning machine is in the landscape state (i.e., the display screen displays in the landscape) at this time, even if the gravity sensing parameters collected by the gravity sensor are reported to the application, as the gravity sensing parameters are still the parameters of the learning machine in the landscape state, at this time, when the application interface is switched to the portrait display, the display state of the application interface contradicts the actual gravity sensing parameters, the application will confirm that the switching is not successful, and the portrait display will be automatically switched back to the landscape display, at this time, the portrait display of the application interface in the landscape state of the learning machine cannot be realized, i.e., the demand of the user for switching the application interface between the landscape display and the portrait display cannot be met.

[0114] It can be understood that in addition to the scenario of confirming whether the switching is successful after the horizontal and vertical display switching, the application program can also have the need to obtain the gravity sensing parameter in other function implementations. The inventors find that for some function implementation scenarios, the gravity sensing parameter collected by the gravity sensor in the learning machine can also make the implementation of some functions unable to meet the user's needs. For example, after the application interface of the application program is displayed in the vertical direction, the application program needs the front camera of the learning machine to shoot in the vertical state of the learning machine when using the front camera of the learning machine. However, since the learning machine is in a horizontal state at this time, even if the gravity sensing parameter collected by the gravity sensor is reported to the application program, since the gravity sensing parameter is still the parameter of the learning machine in the horizontal state, the application program will default that the front camera is currently in the horizontal state for shooting. At this time, the application program will constantly prompt the user to rotate the device, and the learning machine is not convenient to use in rotation, and the picture taken by the front camera will also be distorted in rotation. Therefore, the use experience of the user when using the front camera is affected.

[0115] Therefore, the inventors consider adjusting the gravity sensing parameter collected by the gravity sensor based on the display state of the current application interface (i.e., whether it is displayed horizontally or vertically), so that the learning machine can obtain the gravity sensing parameter suitable for the horizontal or vertical display of the application interface in the default use posture (i.e., without rotation and movement during use), that is, the gravity sensing parameter is adapted to the current horizontal or vertical display of the application interface, so as to ensure that the response result (such as confirming whether the switching is successful or determining whether to prompt the device rotation when using the front camera) after the application program processes the gravity sensing parameter can better meet the actual needs of the user.

[0116] The inventors further found in the research and development process that since the gravity sensing parameter collected by the gravity sensor can be affected by the use posture of the learning machine, the gravity sensing parameter can be inconsistent with the actual use scenario of the user, resulting in a failure to switch the display. Moreover, since the learning machine does not rotate and move during use, the gravity sensing parameter of the learning machine in the default use posture basically does not change significantly. Based on this, the inventors consider canceling the gravity sensor, using a virtual gravity sensor to feed back the gravity sensing parameter to the system service / target application, and pre-setting a set of gravity sensing parameters of the learning machine in the default use state to replace the gravity sensing parameter originally collected by the gravity sensor. In combination with the actual display state (i.e., whether it is displayed horizontally or vertically) of the application interface of the application program, the default gravity sensing parameter is adjusted to obtain the gravity sensing parameter suitable for the current display state of the application interface.

[0117] It should be noted that the inventor found that for some display devices (such as a tablet computer) which have configured a gravity sensor, the gravity sensing parameters suitable for the display state of the application interface can still be obtained by setting the default gravity sensing parameters in the development process based on the concept of presetting a set of learning machine gravity sensing parameters in the default use state. For example, some existing tablet computers have a landscape mode function, and the tablet computer is always in a fixed use posture (generally in a landscape state) in the landscape mode. At this time, the gravity sensing parameters collected by the gravity sensor will not change basically, but the application program will have a vertical display requirement, and the gravity sensing parameters collected by the gravity sensor are not suitable for the vertical display requirement. Therefore, the gravity sensing parameters suitable for the display state of the application interface can be obtained by setting the default gravity sensing parameters and adjusting the default gravity sensing parameters in combination with the actual display state of the application interface.

[0118] In this technology, the embodiment of the present application provides a virtual gravity sensing implementation method, so that when a real gravity sensor is not used, the gravity sensing parameters suitable for the display state of the application interface can be obtained in combination with the display state of the application interface.

[0119] The virtual gravity sensing implementation method provided in the embodiment of the present application can be executed by a display device. The display device can be implemented in a software and / or hardware manner, and the display device can be composed of two or more physical entities or one physical entity. At present, the display device can be a learning machine, a tablet computer in a landscape mode, and the like, which has a default use posture.

[0120] The usage posture can be understood as a posture of the display device when the display device is used by a user. The usage posture is related to a gravity direction (i.e., a vertical direction). Currently, the usage posture includes a horizontal screen state and a vertical screen state. The horizontal screen state is further divided into a horizontal positive direction posture and a horizontal negative direction posture. The vertical screen state is further divided into a vertical positive direction posture and a vertical negative direction posture. Taking a learning machine as an example, in the horizontal positive direction posture (as shown in FIG. 5), a long side of a display screen of the learning machine is in a horizontal direction (or a direction close to the horizontal direction), a short side of the display screen is in a vertical direction (or a direction close to the vertical direction), and a front camera of the learning machine is located above the display screen. The horizontal negative direction can be understood as an opposite direction of the horizontal positive direction (i.e., it can be considered that the learning machine is rotated by 180° in a plane of the display screen). In the horizontal negative direction posture, the long side of the display screen of the learning machine is in the horizontal direction (or the direction close to the horizontal direction), the short side of the display screen is in the vertical direction (or the direction close to the vertical direction), and the front camera of the learning machine is located below the display screen. In the vertical positive direction posture, the long side of the display screen of the learning machine is in the vertical direction (or a direction close to the vertical direction), the short side of the display screen is in the horizontal direction (or a direction close to the horizontal direction), and the front camera of the learning machine is located to the right of the display screen. In the vertical negative direction posture, the long side of the display screen of the learning machine is in the vertical direction (or the direction close to the vertical direction), the short side of the display screen is in the horizontal direction (or the direction close to the horizontal direction), and the front camera of the learning machine is located to the left of the display screen. In actual applications, the usage posture can also be other postures.

[0121] The display device has a default usage posture, which can also be understood as a posture of the display device in a use process and does not change, i.e., the display device does not rotate and move in the use process. Taking the learning machine as an example, the default usage posture of the learning machine is the horizontal positive direction posture in the horizontal screen state. Taking a tablet computer having a horizontal screen mode as an example, the tablet computer is in the horizontal screen mode, and the default usage posture is the horizontal positive direction posture in the horizontal screen state. In some cases, the default usage posture of the display device can also be other usage postures. Generally, the default usage posture of the display device is usually the horizontal positive direction posture or the vertical positive direction posture.

[0122] FIG. 8 is a structural schematic diagram of a display device provided in an embodiment of the present application. Referring to FIG. 8, the display device includes a processor 51, a memory 52, and a display screen 53. The processor 51, the memory 52, and the display screen 53 can be connected through a bus or other manners.

[0123] The number of processors 51 is one or more, and one processor 51 is taken as an example in FIG. 8. The processor 51 can include an application processor (AP), a graphics processing unit (GPU), a central processing unit (CPU), and the like.

[0124] The memory 52 is a computer-readable storage medium, which can be used to store software programs, computer-executable programs, and modules, such as program instructions / modules corresponding to the virtual gravity sensing implementation method in the embodiments of the present application. The memory 52 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the display device, and the like. In addition, the memory 52 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state memory device. In some examples, the memory 52 can further include a memory 52 remotely arranged with respect to the processor 51, which can be connected to the display device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0125] The display screen 53 displays based on the indication of the processor 51. The display screen 53 can be a liquid crystal display (LCD), an LED display, an organic light-emitting diode (OLED) display, or a flexible light-emitting diode (FLED) display, and the like. In one embodiment, the display screen can also be integrated with a touch function, and at this time, the display screen 53 includes a display panel and a touch panel. The display panel is used to complete visual output. The touch panel can be a touch assembly supporting infrared touch, electromagnetic touch, capacitive touch, and / or resistive touch, and the like.

[0126] The display device can also include one or more communication interfaces to realize communication with other devices through the communication interfaces. In addition, the display device can also include a power supply, a speaker, a camera, and the like, which are not limited by the embodiments.

[0127] On the basis of the foregoing hardware structure, the display device is installed with at least one operating system. The operating system can be an Android system, a Windows system, or a Linux system, etc. In one embodiment, the display device is installed with at least an Android system. FIG. 9 is a schematic diagram of a system architecture of an operating system according to one embodiment of the present application. As shown in FIG. 9, when the display device is installed with a layered architecture Android system, the Android system includes, from top to bottom, an application layer (Applications), a framework layer (Java API Framework), a core library (Libraries), a runtime (Runtime), a hardware abstraction layer (Hardware Abstraction Layer, HAL), and a kernel layer (Linux Kernel).

[0128] The application layer can include a series of application packages. For example, the application packages can include learning software, annotation application software, Bluetooth, music, etc. The application layer can interact with the user.

[0129] In one embodiment, the application layer includes at least one target application, i.e., the display device is installed with at least one target application. The target application is an application program installed in the display device and having a demand for obtaining a gravity sensing parameter.

[0130] The framework layer provides an application programming interface (application programming interface, API) and a programming framework for the application programs of the application layer. The framework layer includes some pre-defined functions. For example, the framework layer can include a window management service, a resource management service, a view system, etc. The window management service is used to manage the window program. The window management service can obtain the size of the display screen, determine whether there is a status bar, lock the screen, etc. The resource management service provides various resources for the application program, such as localized strings, icons, pictures, layout files, video files, etc. The view system includes visual controls, such as a control for displaying text, a control for displaying pictures, etc. The view system can be used to build the application interface of the application program. The application interface can be composed of one or more views. For example, a view for displaying text and a view for displaying pictures. It can be understood that the application interface of the target application can be built by the view system.

[0131] In one embodiment, the framework layer includes a system server, which is a basic requirement for running the Android system, and the services of the Android system are all based on the system server. The system server runs along with the start of the Android system. Currently, the display device supports the function of the gravity sensor, and the system server can obtain the gravity sensing parameters from the sensor process when the target application needs to obtain the gravity sensing parameters, and adaptively processes the gravity sensing parameters to obtain the gravity sensing parameters suitable for the target application, and feeds back to the target application.

[0132] As mentioned above, the application layer and the framework layer can run in the virtual machine. The virtual machine executes the java files of the application layer and the framework layer into binary files. The virtual machine can be used to perform the functions of the management of the object life cycle, the stack management, the thread management, the security and the exception management, and the garbage collection, etc.

[0133] The core libraries include open source function libraries, such as the standard C function library Libc, the surface manager, the media library, etc. The surface manager is used to manage the display subsystem, and provides the fusion of 2D and 3D layers for multiple applications. The media library supports multiple commonly used audio, video format playback and recording, and static image files, etc. The media library can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0134] The runtime includes the ART virtual machine and the Android core library set.

[0135] The hardware abstraction layer provides a standardized interface for the upper layer of the Android system to access, and hides the specific implementation details of the underlying hardware.

[0136] In one embodiment, the hardware abstraction layer includes a sensor process, which contains a plurality of sensor functions, and can obtain parameters collected by various sensors in the display device from various sensor drivers and provide the parameters to the upper layer. At present, the sensor process contains at least a gravity sensor function. If the display device is equipped with a gravity sensor, the gravity sensor function can be used to obtain gravity sensor parameters collected by the gravity sensor based on the gravity sensor driver and provide the parameters to the upper layer of the Android system (e.g., to a system service). In one embodiment, a set of gravity sensor parameters are built in the sensor process. Then, when the upper layer of the Android system needs gravity sensor parameters, the sensor process can feed back the built-in gravity sensor parameters to the upper layer of the Android system for use. At this time, whether the display device is equipped with a gravity sensor or not, the sensor process can use the built-in gravity sensor parameters as the currently obtained gravity sensor parameters to virtually implement the function of the gravity sensor. The built-in gravity sensor parameters in the sensor process can be set according to actual conditions. In an embodiment, the built-in gravity sensor parameters in the sensor process are the real gravity sensor parameters of the display device in a default use posture, i.e., the gravity sensor parameters collected by the real gravity sensor when the display device is in the default use posture. Taking a learning machine as an example, if the learning machine is equipped with a gravity sensor, the gravity sensor parameters collected by the gravity sensor are approximately (9.8, 0, 0) when the learning machine is in a default use posture (e.g., the use state of the learning machine in FIG. 5). Therefore, the built-in gravity sensor parameters in the sensor process should be (9.8, 0, 0). Generally, the built-in gravity sensor parameters in the sensor process cannot be changed.

[0137] The kernel layer (also referred to as the Linux kernel layer) is a layer between hardware and software. The kernel layer contains a touch driver, a display driver, a camera driver, an audio driver, a sensor driver, a Bluetooth driver, a WIFI driver, etc.

[0138] Under the framework of the foregoing Android system, when a target application has a demand for obtaining gravity sensor parameters, the system service can be notified, i.e., the system service receives the notification of the target application, then obtains the gravity sensor parameters (the currently obtained gravity sensor parameters can be the built-in gravity sensor parameters in the sensor process) from the sensor process, and then adjusts the gravity sensor parameters according to the display state (specifically, a horizontal display state or a vertical display state) of the current application interface of the target application to obtain gravity sensor parameters suitable for the current application interface and feed back to the target application for use, i.e., to implement the virtual gravity sensor implementation method provided in the present application. Specifically, FIG. 10 is a flowchart of a virtual gravity sensor implementation method according to one embodiment of the present application. Referring to FIG. 10, the virtual gravity sensor implementation method includes:

[0139] Step 610, receiving, by the system service of the display device, a notification issued by a target application for acquiring the gravity sensing parameter, the target application being an application program installed in the display device and having a demand for acquiring the gravity sensing parameter.

[0140] For example, the operating system of the display device starts the system service when starting running, and then the system service continuously runs in the background to acquire the required gravity sensing parameter through the system service when the target application has a demand for acquiring the gravity sensing parameter.

[0141] For example, the target application needs to acquire the gravity sensing parameter when the user switches the application interface of the target application from horizontal display to vertical display or from vertical display to horizontal display.

[0142] When the target application has a demand for acquiring the gravity sensing parameter, the current demand is notified to the system service, that is, the system service receives the notification of the target application to explicitly indicate that the target application needs the gravity sensing parameter.

[0143] Optionally, when the target application notifies the system service, the target application first inquires the system service whether the gravity sensor is currently supported. The support of the gravity sensor can be understood as the support of the acquisition of the gravity sensing parameter, that is, the display device can acquire the gravity sensing parameter collected by the gravity sensor. The non-support of the gravity sensor can be understood as the non-support of the acquisition of the gravity sensing parameter, that is, the display device cannot acquire the gravity sensing parameter collected by the gravity sensor. After receiving the inquiry, the system service feeds back to the target application that the gravity sensor is currently supported when it is determined that the gravity sensor is supported, and feeds back to the target application that the gravity sensor is currently not supported when it is determined that the gravity sensor is not supported. In the embodiment, the currently used display device supports the gravity sensor, that is, the system service can determine that the gravity sensor is supported. Optionally, the operating system of the display device also starts the sensor process when starting running, and then the sensor process declares to the system service that the display device supports the gravity sensor, so that the system service can determine that the gravity sensor is currently supported when the target application inquires the system service whether the gravity sensor is currently supported. It should be noted that the aforementioned layer description of the Android system indicates that the sensor service process in the current Android system contains the gravity sensor function and has a fixed gravity sensing parameter built-in.

[0144] After the target application determines that the gravity sensor is supported based on the feedback of the system service, the target application is registered in the system service, so that the system service explicitly indicates that the registered target application needs to acquire the gravity sensing parameter, and then the system service can determine the gravity sensing parameter suitable for the target application through steps 620-630.

[0145] In step 620, the system service determines the current display state of the application interface of the target application, which is either a landscape display state or a portrait display state.

[0146] In one embodiment, the application interface of the target application can be in either a landscape display state or a portrait display state. In the landscape display state, the long side of the application interface is the width of the rectangular region in which the application interface is located, and the short side of the application interface is the height of the rectangular region in which the application interface is located. That is, in the landscape display state, the width of the application interface is greater than the height of the application interface. In the portrait display state, the long side of the application interface is the height of the rectangular region in which the application interface is located, and the short side of the application interface is the width of the rectangular region in which the application interface is located, that is, the height of the application interface is greater than the width of the application interface. For example, when the display device is a learning machine, the application interface in the landscape display state can refer to FIG. 7, and the application interface in the portrait display state can refer to FIG. 6. For another example, when the default use posture of the display device is the vertical forward direction posture, the application interface in the landscape display state is as shown in FIG. 11, which is a landscape display state diagram provided by one embodiment of the present application. In FIG. 11, the application interface 71 in the display device 70 occupies only part of the display region of the display screen, and the other display region of the display screen can be considered as a background display region 72, which only displays a background pattern. When the default use posture of the display device is the vertical forward direction posture, the application interface in the portrait display state is as shown in FIG. 12, which is a portrait display state diagram provided by one embodiment of the present application. In FIG. 12, the application interface 73 in the display device 70 occupies the entire display region of the display screen.

[0147] The aforementioned application interface can also be referred to as a software interface, which is the part of the application program with which the user interacts, including all the graphics, elements that the user watches, and the way the user interacts with the application program.

[0148] The application interface displayed by the target application can be in either a landscape display state or a portrait display state, and when the application interface can be switched between landscape and portrait, the user can switch the application interface in the landscape display state to the application interface in the portrait display state, or switch the application interface in the portrait display state to the landscape display state.

[0149] Currently, the gravity sensing parameter fed back by the system service to the target application needs to be suitable for the display state of the application interface currently displayed by the target application, which is either a horizontal display state or a vertical display state. Specifically, generally, for a terminal device that is installed with a gravity sensor and can be rotated during use, if the terminal device is in a horizontal screen state, the application interface of the application program in the terminal device should use an application interface in a horizontal display state. If the terminal device is in a vertical screen state, the application interface of the application program in the terminal device should use an application interface in a vertical display state, so as to provide a better viewing effect for the user. At this time, the application program can determine whether the posture of the terminal device (i.e., whether the terminal device is in a horizontal screen or a vertical screen) and the display state of the application interface are suitable according to the gravity sensing parameter collected by the gravity sensor. In the embodiments, although the display device has a default use posture, in order to enable the target application to determine that the use posture of the display device is suitable for the display state of the application interface, when the current application interface of the target application is in a horizontal display state, the gravity sensing parameter needed should be the gravity sensing parameter when the display device is in a horizontal screen state, and when the current application interface displayed by the target application is in a vertical display state, the gravity sensing parameter needed should be the gravity sensing parameter when the display device is in a vertical screen state. Currently, whether the display device is in a horizontal screen state or a vertical screen state, the plane where the display screen is located in the display device is a vertical plane or a plane close to a vertical plane. On this basis, in order to enable the system service to obtain the gravity sensing parameter suitable for the display state of the application interface, it is needed to enable the system service to first determine the current display state of the application interface.

[0150] Optionally, the system service can obtain the height parameter and the width parameter of the current application interface, and determine the display state of the application interface through the height parameter and the width parameter. The height parameter can be understood as the height of the rectangular area where the application interface is located in the display screen, which can be embodied by a pixel value, i.e., the number of pixels occupied by the height can be used as the height parameter. The width parameter can be understood as the width of the rectangular area where the application interface is located in the display screen, which can also be embodied by a pixel value. Currently, when the height parameter is greater than the width parameter, the application interface can be considered to be in a vertical display state. When the height parameter is less than the width parameter, the application interface can be considered to be in a horizontal display state.

[0151] Step 630: obtaining, by the system service, a virtual gravity sensing parameter suitable for the application interface according to the display state and the default gravity sensing parameter.

[0152] The default gravity sensing parameter is the real gravity sensing parameter of the display device in the default use posture.

[0153] For example, when the system service determines that the target application needs to be fed back the gravity sensing parameter, the system service first acquires the default gravity sensing parameter from the sensor process. The gravity sensing parameter built in the sensor process can be used as the default gravity sensing parameter for the system service to acquire, i.e., the sensor process has the default gravity sensing parameter built in. The default gravity sensing parameter is equal to the gravity sensing parameter actually collected by the gravity sensor of the display device in the default use posture. Generally, in the default use posture of the display device, the component on the z-axis in the default gravity sensing parameter is generally 0, and one of the components on the x-axis and the y-axis is about 0 and the other is about 9.8. For example, when the display device is a learning machine, the default gravity sensing parameter is about (9.8, 0, 0).

[0154] It can be understood that, since the sensor process has the default gravity sensing parameter built in, when the system service needs to acquire the gravity sensing parameter from the sensor process, the sensor process can virtually report the built-in default gravity sensing parameter to the system service as the gravity sensing parameter currently collected by the gravity sensor, i.e., the built-in default gravity sensing parameter is used to simulate the working of the gravity sensor, and therefore, the display device can not have the real gravity sensor. In actual application, the display device can also have the real gravity sensor, and in this case, the system service can still acquire the default gravity sensing parameter.

[0155] After the system service acquires the default gravity sensing parameter and the display state of the application interface, the system service can acquire the gravity sensing parameter suitable for the display state of the application interface, which is currently referred to as the virtual gravity sensing parameter. The virtual gravity sensing parameter can also be understood as the virtual rough gravity sensing parameter obtained based on the display state, and the virtual gravity sensing parameter can be different from the current real gravity sensing parameter of the display device.

[0156] In one embodiment, when the display state is the landscape display state, the target application should consider that the real use posture of the display device should be consistent with the use posture of the learning machine shown in FIG. 5, and the obtained virtual gravity sensor parameter should be (9.8, 0, 0), that is, the display device has a component in the x-axis direction. When the display state is the portrait display state, the real use posture of the display device should be consistent with the use posture of the mobile phone shown in FIG. 3 (it can also be understood as the use posture of the learning machine shown in FIG. 5 after being rotated clockwise by 90° in the plane of the display screen), and the obtained virtual gravity sensor parameter should be (0, 9.8, 0). On this basis, after the system service obtains the default gravity sensor parameter and the display state, the system service can adjust the components in the three coordinate directions (that is, the x-axis, the y-axis and the z-axis) of the default gravity sensor parameter to obtain the corresponding virtual gravity sensor parameter according to the description logic above. The rule used by the system service in the adjustment can be recorded as a parameter generation rule, and the parameter generation rule used is different in different display states. For example, when the default gravity sensor parameter is (9.8, 0, 0) and the display state is the landscape display state, the parameter generation rule used by the system service is to directly use the default gravity sensor parameter as the virtual gravity sensor parameter. When the display state is the portrait display state, the parameter generation rule used by the system service is to use the component of the x-axis in the default gravity sensor parameter as the component of the y-axis in the virtual gravity sensor parameter, use the component of the y-axis in the default gravity sensor parameter as the component of the x-axis in the virtual gravity sensor parameter, and keep the z-axis component unchanged to obtain the virtual gravity sensor parameter (0, 9.8, 0).

[0157] In one embodiment, in the landscape display state, the application interface can exist in two directions. Taking the application interface shown in FIG. 7 as an example, the display content of the application interface viewed by the user is normal. After the application interface is inverted (which can also be understood as rotating the application interface by 180°), the width parameter of the application interface is still greater than the height parameter, and it can be considered that the application interface is still in the landscape display state, only the display content of the application interface viewed by the user is inverted. The same is true for the portrait display state, that is, in the portrait display state, the display content of the application interface viewed by the user can be normal or inverted. At present, the content display direction when the display content is normal is recorded as the normal content display direction, and the content display direction when the display content is inverted is recorded as the inverted content display direction. The content display direction can be understood as the direction of the display content in the application interface from the perspective of the user when viewed by the user. The normal content display direction can also be understood as the display content being displayed from top to bottom, and the inverted content display direction can also be understood as the display content being displayed from bottom to top. Taking FIG. 7 as an example, in the landscape display state, when the normal content display direction, the virtual gravity sensing parameter should be (9.8, 0, 0), and when the inverted content display direction, in order to make the user view the normal display content, the terminal device needs to be rotated, that is, the terminal device is rotated to the posture when the gravity sensing parameter is (-9.8, 0, 0). For ease of understanding, FIG. 13 is a terminal device rotation schematic diagram provided by one embodiment of the present application. Referring to FIG. 13, the application interface in the terminal device 80 is in the landscape display state and in the inverted content display direction. In the case that the application interface is fixed, the terminal device 80 is rotated to the posture corresponding to (-9.8, 0, 0) (that is, the terminal device is rotated by 180° along the plane where the display screen is located), and the posture of the terminal device 80 is shown on the lower side of FIG. 13. The application interface is still in the landscape display state and the user can view the normal display content. At this time, for a display device with a default use posture, the virtual gravity sensing parameter obtained by the display device should also be (-9.8, 0, 0), so as to simulate the posture of the display device to adapt to the display state of the application interface and make the user view the normal display content. The virtual gravity sensing parameter corresponding to the application interface in the portrait display state and in the inverted content display direction is also processed similarly, and embodiments will not make further description. On this basis, the system service can obtain the content display direction in addition to the display state, and adjust the components in the three directions of the default gravity sensing parameter according to the content display direction and the display state, to obtain the virtual gravity sensing parameter.For example, when the default gravity sensing parameter is (9.8, 0, 0), the display state is a landscape display state, and the content display direction is a content display reverse direction, the parameter generation rule used by the system service is to take the negative of the x-axis component of the default gravity sensing parameter as the x-axis component of the virtual gravity sensing parameter, take the negative of the y-axis component of the default gravity sensing parameter as the y-axis component of the virtual gravity sensing parameter (the negative of 0 is still 0), and take the z-axis component of the default gravity sensing parameter as the z-axis component of the virtual gravity sensing parameter, so as to obtain the virtual gravity sensing parameter (-9.8, 0, 0).

[0158] Step 640: feeding, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

[0159] For example, after obtaining the virtual gravity sensing parameter, the system service can pass the virtual gravity sensing parameter to the target application in the application layer, so that the target application obtains the virtual gravity sensing parameter and performs subsequent processing, such as determining whether the display state of the application interface needs to be adjusted by using the virtual gravity sensing parameter.

[0160] It can be understood that in actual application, there is a case where multiple target applications of a display device all need to obtain virtual gravity sensing parameters. In this case, the system service can determine the virtual gravity sensing parameter of each target application respectively according to the foregoing manner, and feed the virtual gravity sensing parameter to the corresponding target application.

[0161] Optionally, after obtaining the virtual gravity sensing parameter, the target application can notify the system service that the gravity sensing parameter is no longer needed. In this case, the system service stops determining the virtual gravity sensing parameter of the target application. Optionally, when the system service does not receive the notification that the gravity sensing parameter is no longer needed from the target application, the system service continues to feed the virtual gravity sensing parameter to the target application.

[0162] The technical means is that when the target application needs to acquire the gravity sensing parameter, the target application notifies the system service, so that the system service receives the notification sent by the target application, then the system service determines whether the application interface of the target application is in a horizontal display state or a vertical display state, and then the system service obtains the virtual gravity sensing parameter suitable for the application interface according to the display state of the application interface and the default gravity sensing parameter and feeds back to the target application. The technical means solves the technical problem that when the display device (such as a learning machine) has a default use posture, the application program in the display device cannot acquire the applicable gravity sensing parameter in the related art. By setting the default gravity sensing parameter and adjusting the default gravity sensing parameter in combination with the display state of the application interface, the virtual gravity sensing parameter suitable for the display state can be obtained, and then the target application simulates the result that the use posture of the display device is adapted to the display state of the application interface by using the virtual gravity sensing parameter, so that the applicable gravity sensing parameter can be obtained when the target application needs to acquire the gravity sensing parameter. For example, the default use posture of the display device is a horizontal screen state, and the application interface is in a vertical display state. When the application interface in the vertical display state is displayed in the display device in the horizontal screen state, the gravity sensing parameter suitable for the vertical display state can be obtained. Moreover, for the display device with a fixed use posture (that is, the display device that does not need to acquire the tilt angle or cannot be moved and rotated), the simulation of the gravity sensor can be realized, and the real gravity sensor does not need to be configured, so that one hardware module of the display device can be reduced, and the cost of the display device is saved.

[0163] FIG. 14 is a flowchart of a virtual gravity sensing implementation method provided by another embodiment of the present application. The virtual gravity sensing implementation method shown in FIG. 14 is a specific embodiment of the virtual gravity sensing implementation method shown in FIG. 10. Referring to FIG. 14, the virtual gravity sensing implementation method specifically includes:

[0164] Step 910: When the display device is powered on, start the system service and the gravity sensor process.

[0165] The sensor process of the current display device contains the gravity sensor function and has the default gravity sensing parameter built-in. In the embodiment, the sensor process is mainly used for the gravity sensor function in the sensor process, and therefore, the sensor process in the embodiment can also be referred to as the gravity sensor process.

[0166] For example, when the display device is powered on, the operating system starts the system service and the gravity sensor process. Then, the system service and the gravity sensor process are both run in the background, so that when the target application needs the gravity sensing parameter, the virtual gravity sensing parameter suitable for the target application can be sent to the target application.

[0167] Step 920: The system service receives the declaration of the gravity sensor process. The declaration is used to indicate that the display device supports the function of acquiring the gravity sensing parameter.

[0168] For example, after the gravity sensor process is started, the gravity sensor process declares to the system service that the current display device supports the function of obtaining the gravity sensing parameter, i.e., supports the gravity sensor. At this time, the system service receives the declaration of the gravity sensor process and determines that the gravity sensing parameter can be obtained from the gravity sensor process. Currently, the gravity sensor process internally stores the default gravity sensing parameter for the system service to use.

[0169] Step 930: The system service of the display device receives a notification for obtaining the gravity sensing parameter sent by the target application.

[0170] In one embodiment, step 930 can include steps 931-932:

[0171] Step 931: The system service of the display device receives an inquiry about whether the gravity sensor is supported, which is sent by the target application when the target application needs to obtain the gravity sensing parameter.

[0172] For example, when the target application needs to obtain the gravity sensing parameter, the target application can inquire (i.e., determine) whether the gravity sensor is supported, i.e., the system service can receive the inquiry about whether the gravity sensor is supported by the target application.

[0173] Step 932: The system service feeds back to the target application that the gravity sensor is currently supported, so that the target application is registered in the system service.

[0174] After the system service receives the inquiry of the target application, the system service feeds back to the target application that the gravity sensor is currently supported. It can be understood that, since the gravity sensor process notifies the system service that the function of obtaining the gravity sensing parameter is supported after the gravity sensor process is started, the system service confirms that the gravity sensor is currently supported.

[0175] For example, after the system service feeds back to the target application that the gravity sensor is supported (i.e., the target application explicitly confirms that the system service supports the gravity sensor), the target application is registered in the system service. The registration process can also be understood as a registration process, and the target application tells the system service that the target application needs the gravity sensing parameter through the registration. After the target application is registered, the target application can listen to the system service to receive the gravity sensing parameter reported by the system service.

[0176] It can be understood that, during the running of the system service, the system service can feed back the applicable virtual gravity sensing parameter to the target application that has been registered. The target application that has not been registered cannot obtain the virtual gravity sensing parameter.

[0177] After the target application completes the registration, the target application can wait for the callback of the system service, i.e., wait for the system service to return the applicable gravity sensing parameter.

[0178] Step 940, the system service acquires the default gravity sensing parameter from the gravity sensor process, and the gravity sensor process is pre-configured with the default gravity sensing parameter.

[0179] For example, the system service sets up a listening callback in the gravity sensor process, so that the gravity sensor process determines that the system service needs to acquire the gravity sensing parameter based on the listening callback. At this time, the gravity sensor process reports the built-in default gravity sensing parameter to the system service, so that the system service acquires the default gravity sensing parameter.

[0180] In an embodiment, the gravity sensor process provides the default gravity sensing parameter to the system service as the current gravity sensing parameter collected by the gravity sensor. At this time, the process of the gravity sensor process obtaining the built-in default gravity sensing parameter and providing it to the system service can also be considered as a simulation of the process of the gravity sensor process obtaining the gravity sensing parameter collected by the gravity sensor and providing it to the system service. In other words, after the gravity sensor process is built-in with the default gravity sensing parameter, it can be considered that a virtual gravity sensor is used in the display device, and the virtual gravity sensor can continuously collect the default gravity sensing parameter for the gravity sensor process to acquire. That is, no matter what posture the display device is actually in, the gravity sensing parameter collected by the gravity sensor process is always the default gravity sensing parameter.

[0181] Step 950, the system service determines the current display state of the application interface of the target application, which is a horizontal display state or a vertical display state, and determines the current content display direction of the application interface, which is a content display positive direction or a content display reverse direction.

[0182] In one embodiment, when the system service determines the current display state of the application interface of the target application, it can further include steps 951-952:

[0183] Step 951, the system service acquires the display size parameter of the application interface of the target application, which includes the width parameter of the application interface and the height parameter of the application interface.

[0184] For example, the display size parameter is a parameter that can reflect the size of the display area of the application interface in the display screen. The display size parameter includes the width parameter of the application interface and the height parameter of the application interface. The height parameter can be understood as the height of the rectangular area of the application interface in the display screen, which can be represented by a pixel value, i.e. the number of pixels occupied by the height can be used as the height parameter. The width parameter can be understood as the width of the rectangular area of the application interface in the display screen, which can also be represented by a pixel value.

[0185] In one embodiment, the system service can obtain the height parameter and the width parameter by constructing an application interface related function (e.g., a view system).

[0186] At step 952, the system service obtains a current display state of the application interface according to the display size parameter, wherein the width parameter is greater than the height parameter in a landscape display state, and the width parameter is less than the height parameter in a portrait display state.

[0187] For example, after obtaining the height parameter and the width parameter, the system service compares the height parameter and the width parameter. Generally, the height parameter and the width parameter of the application interface are not equal. If the height parameter is greater than the width parameter, the system service can determine that the application interface is in a portrait display state. If the width parameter is greater than the height parameter, the system service can determine that the application interface is in a landscape display state.

[0188] In one embodiment, when determining the display state of the application interface, the system service also determines a content display direction of the application interface. Currently, the content display direction is a content display normal direction or a content display reverse direction. In the use of the display device, when the content display normal direction, the display content of the application interface viewed by the user is normal, and the application interfaces shown in FIGS. 6 and 7 both belong to the content display normal direction. In the use of the display device with a default use posture, when the content display reverse direction, the display content of the application interface viewed by the user is upside down. For example, FIG. 15 is a first schematic diagram of an application interface provided by one embodiment of the present application, referring to FIG. 15, the display device 110 is in a horizontal normal direction posture, the application interface 111 in the display device 110 is in a landscape display state, and the display content of the application interface is upside down from the perspective of the user, that is, the text "application interface" in FIG. 15 is upside down, and thus the application interface is in the content display reverse direction. FIG. 16 is a second schematic diagram of an application interface provided by one embodiment of the present application, referring to FIG. 16, the display device 110 is in a horizontal normal direction posture, the application interface 112 in the display device 110 is in a portrait display state, and the display content of the application interface is upside down from the perspective of the user, and thus the application interface is in the content display reverse direction. It can be known from FIGS. 6, 7, 15 and 16 that, in the default use posture of the display device, the application interface of the target application can be in a landscape display state and a content display normal direction, a landscape display state and a content display reverse direction, a portrait display state and a content display normal direction, or a portrait display state and a content display reverse direction.

[0189] It can be understood that generally, the application interface is in the content display normal direction, and in a few cases, the application interface can be in the content display reverse direction.

[0190] For example, the system service can determine the content display direction by the screen angle. The screen angle can also be recorded as the screen display angle, which can be considered as the rotation angle required when the display screen (which can also be understood as a display device) rotates from the current posture to a pre-set posture in the clockwise direction. At present, the pre-set posture is the posture of the display device when the gravity sensing parameter actually collected by the gravity sensor is (0, 9.8, 0), which is consistent with the posture of the mobile phone when it is used in the vertical direction. For example, when the display screen is in the portrait mode as shown in FIG. 3, the corresponding gravity sensing parameter is about (0, 9.8, 0), and at this time, the screen angle is 0, and when the display screen is in the inverted state of the portrait mode (i.e., the front camera is at the bottom) as shown in FIG. 3, the corresponding gravity sensing parameter should be (0, -9.8, 0), and at this time, the screen angle is 180, i.e., the display screen can reach the pre-set posture after rotating 180° in the clockwise direction. When the display screen is in the landscape mode as shown in FIG. 5, the corresponding gravity sensing parameter should be (9.8, 0, 0), and at this time, the screen angle is 90, i.e., the display screen can reach the pre-set posture after rotating 90° in the clockwise direction. When the display screen is in the inverted state of the landscape mode (i.e., the front camera is at the bottom) as shown in FIG. 5, the corresponding gravity sensing parameter should be (-9.8, 0, 0), and at this time, the screen angle is 270, i.e., the display screen can reach the pre-set posture after rotating 270° in the clockwise direction. In one embodiment, when the content display direction is determined by the screen angle, the system service can further include steps 953-954 to determine the current content display direction of the application interface:

[0191] In step 953, the system service obtains a first screen angle, which is a first angle value or a second angle value. The first angle value is the screen display angle of the display device when the application interface is displayed in the normal direction in the default use posture, and the second angle value is the screen display angle of the display device when the application interface is displayed in the reverse direction in the default use posture.

[0192] For example, the screen angle used by the system service to determine the content display direction is recorded as the first screen angle. The first screen angle is determined by the operating system of the display device, i.e., the operating system of the display device can obtain the first screen angle when the display screen is used for display. The process of determining the first screen angle is the original process of the operating system, which can be realized by the code "lcm display rotation".

[0193] Currently, the first screen angle of the display device in the default use posture generally has only two angle values, which are currently referred to as a first angle value and a second angle value. When the first screen angle is the first angle value, the application interface of the display device (in the default use posture) is forward display, that is, the display content of the application interface is normal. When the first screen angle is the second angle value, the application interface of the display device (in the default use posture) is reverse display, that is, the display content of the application interface is inverted.

[0194] Taking the display device as a learning machine, when the application interface displayed by the learning machine is forward display, the application interface can refer to FIGS. 6 and 7. If the content in the display screen is regarded as a picture, the point of the upper left corner of the picture when the picture is normally displayed (that is, the content of the picture is not inverted) is the point of the upper left corner of the current display screen. At this time, it can be considered that the posture of the display screen should be the posture when the gravity sensing parameter collected by the gravity sensor is (9.8, 0, 0). If it is desired to change the posture of the display screen to the posture when the gravity sensing parameter is (0, 9.8, 0) (that is, the pre-set posture), the display screen needs to be rotated by 90° in the clockwise direction. Therefore, the operating system determines that the first angle value should be 90°. When the application interface displayed by the learning machine is reverse display, the application interface can refer to FIGS. 15 and 16. If the content in the display screen is regarded as a picture, the point of the upper left corner of the picture when the picture is normally displayed (that is, the content of the picture is not inverted) is the point of the lower right corner of the current display screen. At this time, it can be considered that the posture of the display screen should be the posture when the gravity sensing parameter collected by the gravity sensor is (-9.8, 0, 0). If it is desired to change the posture of the display screen to the posture when the gravity sensing parameter is (0, 9.8, 0), the display screen needs to be rotated by 270° in the clockwise direction. Therefore, the operating system determines that the second angle value should be 270°. That is, for the learning machine, the operating system determines that the first screen angle can be 90° or 270°. When the first screen angle is 90°, the application interface is forward display, and when the first screen angle is 270°, the application interface is reverse display.

[0195] In step 954, the system service determines the current content display direction of the application interface according to the first screen angle.

[0196] It can be known from the foregoing that when the first screen angle is the first angle value, the display content of the application interface is normal, and when the first screen angle is the second angle value, the display content of the application interface is inverted. Therefore, when the system service determines that the first screen angle is the first angle value, it can be considered that the content display direction is the content display forward direction, and when the system service determines that the first screen angle is the second angle value, it can be considered that the content display direction is the content display reverse direction.

[0197] It can be understood that the execution order of step 940 and step 950 is not limited at present, and they can be executed in sequence or simultaneously.

[0198] Step 960, obtaining, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction, and a default gravity sensing parameter.

[0199] The default gravity sensing parameter is a real gravity sensing parameter of the display device in a default use posture.

[0200] For example, when the display device can be rotated, the application interface can be as full as possible on the screen in the display device (i.e., the application interface is in a horizontal display state when the display device is in a horizontal screen state, and the application interface is in a vertical display state when the display device is in a vertical screen state), and the display content is in a normal direction (i.e., the display content viewed by the user is normal and not inverted), it can be considered that the application interface is adapted to the current posture of the display device, i.e., the target application determines that the currently displayed application interface is applicable to the display device in the current posture. The system service can adjust the default gravity sensing parameter according to the display state and the content display direction when the display device has a default use posture, so that the posture of the display device represented by the virtual gravity sensing parameter obtained after adjustment is adapted to the application interface.

[0201] In one embodiment, parameter generation rules corresponding to different display states and content display directions can be set in advance, and the system service can adjust the default gravity sensing parameter according to the parameter generation rules to obtain the corresponding virtual gravity sensing parameter. At this time, the present step can further include steps 961-962:

[0202] Step 961, determining, by the system service, a corresponding parameter generation rule according to the display state and the content display direction.

[0203] The parameter generation rule refers to a rule for adjusting the default gravity sensing parameter to obtain the corresponding virtual gravity sensing parameter, and the parameter generation rules corresponding to different display states and content display directions are different, i.e., each parameter generation rule has a corresponding display state and content display direction. At present, there should be four parameter generation rules, and each is applicable to a horizontal display state and a normal content display direction, a horizontal display state and an inverted content display direction, a vertical display state and a normal content display direction, and a vertical display state and an inverted content display direction. After the system service determines the display state and the content display direction, the corresponding parameter generation rule can be obtained.

[0204] In one embodiment, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction perpendicular to a plane on which the display device is located and outward of the display device in the default use posture. In a three-dimensional coordinate system applicable to the gravity sensor, the directions of the three coordinate axes are respectively denoted as the first coordinate direction, the second coordinate direction, and the third coordinate direction, the coordinate value in the first coordinate direction is denoted as the first value, the coordinate value in the second coordinate direction is denoted as the second value, and the coordinate value in the third coordinate direction is denoted as the third value. Taking the display device as a learning machine for example, referring to FIG. 5, the default gravity sensing parameter is (9.8, 0, 0), the first coordinate direction is the direction of the x-axis, the first value is 9.8, the second coordinate direction is the direction of the y-axis, the second value is 0, the third coordinate direction is the direction of the z-axis, and the third value is 0.

[0205] Then, in the aforementioned three coordinate directions, the parameter generation rule determined by the system service according to the display state and the content display direction can specifically include the following four cases:

[0206] Case one, when the display state is the horizontal display state and the content display direction is the content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as the fourth value in the first coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as the fifth value in the second coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as the sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0207] Taking the display device as the learning machine, FIG. 17 is a schematic diagram of a first corresponding relationship between an application interface and a display device posture provided by one embodiment of the present application. In FIG. 17, the learning machine 120 is a display device with a default use posture. The application interface 121 currently displayed by the learning machine is in a horizontal display state and the content display direction is a normal direction. When the learning machine can be rotated, the posture of the learning machine adapted to the application interface 121 should be as shown in the posture of the learning machine 130 in FIG. 17. At this time, the posture of the learning machine 130 is consistent with the posture of the learning machine 120. The corresponding gravity sensing parameter in the posture of the learning machine 130 should be (9.8, 0, 0). That is, the virtual gravity sensing parameter obtained by the system service of the learning machine 120 should be (9.8, 0, 0). Therefore, the parameter generation rule can be: taking the first value (i.e., 9.8) in the default gravity sensing parameter as the coordinate value in the first coordinate direction of the virtual gravity sensing parameter, currently recorded as the fourth value, and the fourth value is 9.8; taking the second value (i.e., 0) in the default gravity sensing parameter as the coordinate value in the second coordinate direction of the virtual gravity sensing parameter, currently recorded as the fifth value, and the fifth value is 0; and taking the third value (i.e., 0) in the default gravity sensing parameter as the coordinate value in the third coordinate direction of the virtual gravity sensing parameter, currently recorded as the sixth value, and the sixth value is 0.

[0208] Case two: the display state is a horizontal display state and the content display direction is a reverse content display direction. The parameter generation rule determined by the system service is: taking the negative of the first value in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, taking the negative of the second value in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, and taking the third value in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter.

[0209] Taking the learning machine as an example, FIG. 19 is a third corresponding relationship between an application interface and a display device posture provided by an embodiment of the present application. In FIG. 19, the learning machine 120 is a display device with a default use posture. The application interface 121 currently displayed by the learning machine is a horizontal display interface and the content display direction is reverse. When the learning machine can be rotated, the posture of the learning machine adapted to the application interface 121 should be as shown in the posture of the learning machine 130 in FIG. 19. At this time, the posture of the learning machine 120 after being rotated by 180° is consistent with the posture of the learning machine 130. The corresponding gravity sensing parameter of the posture of the learning machine 130 should be (-9.8, 0, 0). That is, the virtual gravity sensing parameter obtained by the system service of the learning machine 120 should be (-9.8, 0, 0). Therefore, the parameter generation rule can be: taking the negative of the first value (i.e., 9.8) in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, and the fourth value is -9.8; taking the negative of the second value in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, and the fifth value is 0 (the negative of 0 is still 0); and taking the third value (i.e., 0) in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter, and the sixth value is 0.

[0210] Case three: when the display state is a vertical display state and the content display direction is a content display forward direction, the parameter generation rule determined by the system service is: taking the first value in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, taking the second value in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, and taking the third value in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter.

[0211] Taking the learning machine as an example, FIG. 18 is a schematic diagram of a second corresponding relationship between an application interface and a display device posture provided by an embodiment of the present application. In FIG. 18, the learning machine 120 is a display device having a default use posture. The application interface 121 currently displayed by the learning machine is a portrait display interface and the content display direction is a normal direction. When the learning machine can be rotated, the posture of the learning machine adapted to the application interface 121 should be as shown in the posture of the learning machine 130 in FIG. 18. At this time, the posture of the learning machine 120 after being rotated clockwise by 90° is consistent with the posture of the learning machine 130. The corresponding gravity sensing parameter of the learning machine 130 in the posture should be (0, 9.8, 0). That is, the virtual gravity sensing parameter obtained by the system service of the learning machine 120 should be (0, 9.8, 0). Therefore, the parameter generation rule can be: taking the first value (i.e., 9.8) in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, and the fifth value is 9.8; taking the second value in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, and the fourth value is 0; and taking the third value (i.e., 0) in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter, and the sixth value is 0.

[0212] Case four: when the display state is a portrait display state and the content display direction is a reverse content display direction, the parameter generation rule determined by the system service is: taking the negative of the first value in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, taking the negative of the second value in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, and taking the third value in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter.

[0213] Taking the display device as the learning machine, FIG. 20 is a schematic diagram of a fourth correspondence between an application interface and a display device posture according to an embodiment of the present application. In FIG. 20, the learning machine 120 is a display device with a default use posture. The application interface 121 currently displayed by the learning machine is a vertical display interface and the content display direction is reversed. When the learning machine can be rotated, the posture of the learning machine that is adapted to the application interface 121 should be as shown in the posture of the learning machine 130 in FIG. 20. At this time, the posture of the learning machine 120 after being rotated clockwise by 270° is consistent with the posture of the learning machine 130. The corresponding gravity sensing parameter of the learning machine 130 in the posture should be (0, -9.8, 0). That is, the virtual gravity sensing parameter obtained by the system service of the learning machine 120 should be (0, -9.8, 0). Therefore, the parameter generation rule can be: taking the negative of the first value (i.e., 9.8) in the default gravity sensing parameter as the fifth value in the second coordinate direction of the virtual gravity sensing parameter, and the fifth value is -9.8; taking the negative of the second value in the default gravity sensing parameter as the fourth value in the first coordinate direction of the virtual gravity sensing parameter, and the fourth value is 0 (the negative of 0 is still 0); and taking the third value (i.e., 0) in the default gravity sensing parameter as the sixth value in the third coordinate direction of the virtual gravity sensing parameter, and the sixth value is 0.

[0214] In step 962, the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the parameter generation rule and the values in the three coordinate directions of the default gravity sensing parameter.

[0215] For example, the system service obtains the virtual gravity sensing parameter according to the parameter generation rule and the values in the three coordinate directions (i.e., x-axis, y-axis and z-axis) of the default gravity sensing parameter. For example, the default gravity sensing parameter is (9.8, 0, 0), the virtual gravity sensing parameter is (0, -9.8, 0), and the parameter generation rule is: taking the negative of the value in the x-axis (i.e., the first coordinate direction) of the default gravity sensing parameter as the value in the y-axis (i.e., the second coordinate direction) of the virtual gravity sensing parameter, taking the negative of the value in the y-axis (i.e., the second coordinate direction) of the default gravity sensing parameter as the value in the x-axis (i.e., the first coordinate direction) of the virtual gravity sensing parameter (the value in the y-axis of the current default gravity sensing parameter is 0, and the negative of 0 is still 0), and taking the value in the z-axis (i.e., the third coordinate direction) of the default gravity sensing parameter as the value in the z-axis (i.e., the third coordinate direction) of the virtual gravity sensing parameter. The system service can obtain the virtual gravity sensing parameter according to the parameter generation rule.

[0216] In actual applications, the parameter generation rule can also only include the final required virtual gravity sensing parameter. The system service can directly obtain the virtual gravity sensing parameter according to the parameter generation rule.

[0217] In one embodiment, the gravity sensing direction can also be obtained according to the gravity sensing parameter, and the gravity sensing direction is equal to the included angle between the direction in which the y-axis points in the three-dimensional coordinate system corresponding to the gravity sensor in the current posture and the direction opposite to the gravity (i.e. the vertical upward direction) in the counterclockwise direction when the display device is located in the vertical plane. Generally, when the display device is in the posture shown in Fig. 3 (i.e. when the direction of the three-dimensional coordinate system is as shown in Fig. 3), the component of the gravity in the y-axis direction is a positive number other than zero, the components of the gravity in the x-axis direction and the z-axis direction are zero, and generally the gravity sensing parameter is (0, 9.8, 0). Correspondingly, the gravity sensing direction should be 0. When the display device is in the posture shown in Fig. 5 (i.e. when the direction of the three-dimensional coordinate system is as shown in Fig. 5), the gravity sensing parameter is (9.8, 0, 0), and correspondingly the gravity sensing direction should be 270. When the display device is in the inverted state of the posture shown in Fig. 3 (i.e. when the three-dimensional coordinate system is rotated by 180° in the clockwise direction), the gravity sensing parameter is (0, -9.8, 0), and correspondingly the gravity sensing direction should be 180. When the display device is in the inverted state of the posture shown in Fig. 5 (i.e. when the three-dimensional coordinate system is rotated by 180° in the clockwise direction), the gravity sensing parameter is (-9.8, 0, 0), and correspondingly the gravity sensing direction should be 90. On this basis, after the system service obtains the virtual gravity sensing parameter, the virtual gravity sensing direction corresponding to the virtual gravity sensing parameter can also be obtained. At this time, after step 960, the system service further determines the virtual gravity sensing direction corresponding to the display state and the content display direction.

[0218] Optionally, after the system service obtains the virtual gravity sensing parameter, the corresponding gravity sensing direction can be obtained according to the virtual gravity sensing parameter. In an embodiment, the gravity sensing direction is referred to as the virtual gravity sensing direction, which is not the real gravity sensing direction of the display device, but the gravity sensing direction suitable for the virtual gravity sensing parameter. It can be understood that the obtained virtual gravity sensing direction can be considered to correspond to the current display state and the content display direction.

[0219] Further optionally, the virtual gravity sensing direction corresponding to different display states and content display directions can be directly pre-set in the display device in combination with the default use posture of the display device. After the system service obtains the display state and the content display direction, the corresponding virtual gravity sensing direction can be obtained according to the corresponding relationship.

[0220] In one embodiment, after the system service obtains the virtual gravity sensing parameter, the rotation angle required for rotating the posture corresponding to the virtual gravity sensing parameter to the pre-set posture in the clockwise direction can also be determined, i.e. the virtual screen angle is obtained based on the virtual gravity sensing parameter. At this time, step 960 can further include: determining, by the system service, a second screen angle corresponding to the display state and the content display direction, the second screen angle being equal to the included angle between the use posture of the display device corresponding to the virtual gravity sensing parameter and the pre-set use posture in the clockwise direction.

[0221] The preset use posture refers to a posture of the display device if the display device is configured with a gravity sensor and the gravity sensor collects a gravity sensing parameter of (0, 9.8, 0) (for reference to the posture of the learning machine 130 in FIG. 18). After obtaining the virtual gravity sensing parameter, the system service can also determine the use posture of the display device corresponding to the virtual gravity sensing parameter. The use posture of the display device can be understood as a posture of the display device in which the gravity sensor is installed in the display device and the real gravity sensing parameter collected by the gravity sensor is the virtual gravity sensing parameter. Then, the system service can determine an angle by which the display device is rotated clockwise from the use posture of the display device to reach the preset use posture, and the angle can be used as the second screen angle.

[0222] Taking the display device as the learning machine, when the virtual gravity sensing parameter is (0, 9.8, 0), the second screen angle should be 0, that is, the learning machine is rotated 0° clockwise from the posture corresponding to the virtual gravity sensing parameter (for reference to the posture of the learning machine 130 in FIG. 18) to reach the preset use posture. When the virtual gravity sensing parameter is (9.8, 0, 0), the second screen angle should be 90°, that is, the learning machine is rotated 90° clockwise from the posture corresponding to the virtual gravity sensing parameter (for reference to the posture of the learning machine 130 in FIG. 17) to reach the preset use posture. When the virtual gravity sensing parameter is (0, -9.8, 0), the second screen angle should be 180°, that is, the learning machine is rotated 180° clockwise from the posture corresponding to the virtual gravity sensing parameter (for reference to the posture of the learning machine 130 in FIG. 20) to reach the preset use posture. When the virtual gravity sensing parameter is (-9.8, 0, 0), the second screen angle should be 270°, that is, the learning machine is rotated 270° clockwise from the posture corresponding to the virtual gravity sensing parameter (for reference to the posture of the learning machine 130 in FIG. 19) to reach the preset use posture.

[0223] In one embodiment, based on the foregoing, the second screen angle corresponding to different virtual gravity sensing parameters can be preset, or the second screen angle corresponding to different display states and content display directions can be preset, and the system service can obtain the corresponding second screen angle according to the corresponding relationship after obtaining the virtual gravity sensing parameter or the display state and the content display direction. In actual application, the calculation rule of the second screen angle can also be preset, and the system service can obtain the second screen angle by combining the preset use posture and the virtual gravity sensing parameter according to the preset calculation rule after obtaining the virtual gravity sensing parameter.

[0224] It can be understood that the virtual gravity sensing direction and the second screen angle are both for the target application in a specific business scenario, that is, when the target application uses the virtual gravity sensing parameter in the business scenario, the virtual gravity sensing direction and / or the second screen angle can also be selectively used to ensure that the business scenario can be accurately processed, that is, to ensure the accuracy of business processing. For example, when the target application performs face detection, the virtual gravity sensing parameter, the virtual gravity sensing direction, and the second screen angle can be combined to determine which direction to detect the face. For example, after the application interface displayed by the target application is rotated, the direction of the face also rotates. At this time, the target application can combine the virtual gravity sensing parameter, the virtual gravity sensing direction, and the second screen angle to determine the direction in which the face should be (theoretically) detected, and then perform face detection based on the current direction of the face. For another example, when the target application determines whether the application interface currently displayed needs to be rotated, the virtual gravity sensing parameter and the virtual gravity sensing direction can be combined to determine whether the application interface needs to be rotated. The specific business scenario to which the virtual gravity sensing direction and the second screen angle are applicable can be set according to the actual situation of the target application, and embodiments do not limit this. It can be understood that for a device with a real gravity sensor, when the device feeds back the gravity sensing parameter to the upper-layer application program, it also feeds back the real gravity sensing direction and the real screen angle to meet the business processing needs of the application program. Therefore, in the embodiments, when the virtual gravity sensing parameter is determined, the virtual gravity sensing direction and the second screen angle are also determined synchronously to ensure that the business processing needs of the target application can be normally implemented.

[0225] Step 970: feeding back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

[0226] It can be understood that the system service feeds back the virtual gravity sensing parameter applicable to the application interface to the target application registered.

[0227] When the virtual gravity sensing direction is determined, step 970 can further include feeding back, by the system service, the virtual gravity sensing direction to the target application.

[0228] When the second screen angle is determined, step 970 can further include feeding back, by the system service, the second screen angle to the target application.

[0229] For example, the system service can obtain the virtual gravity sensing direction and / or the second screen angle according to actual needs, and feed back the obtained virtual gravity sensing direction and / or the second screen angle to the target application (registered) together with the virtual gravity sensing parameter, so that the target application uses the received parameters to make subsequent logical judgments.

[0230] In one embodiment, after step 970, the method further comprises: determining, by the system service, that the target application cancels the registration, and stopping feeding the virtual gravity sensor parameter to the target application.

[0231] For example, when the target application determines that it no longer needs to obtain the gravity sensor parameter, it can notify the system service to cancel the registration in the system service, i.e., the system service deletes the registration of the target application (i.e., the system service determines that the target application cancels the registration). At this time, since there is no registration of the target application in the system service, the system service no longer sends the virtual gravity sensor parameter to the target application, i.e., the system service no longer needs to obtain the display state of the target application and determine the virtual gravity sensor parameter.

[0232] In the above, when the display device is powered on, the system service and the gravity sensor process are started, the system service receives the declaration sent by the gravity sensor process, which is used to indicate that the display device supports the function of obtaining the gravity sensor parameter. Then, when the target application needs to obtain the gravity sensor parameter, the system service receives the notification of the target application that needs to obtain the gravity sensor parameter. Then, the system service obtains the default gravity sensor parameter in the gravity sensor process and determines the display state of the application interface of the target application and the content display direction. Then, the system service obtains the virtual gravity sensor parameter, the virtual gravity sensor direction, and the second screen angle suitable for the application interface according to the display state of the application interface, the content display direction, and the currently obtained default gravity sensor parameter, and feeds back to the target application. The technical means solve the technical problem in the related art that when the display device has a default use posture, the application program in the display device cannot obtain the applicable gravity sensor parameter. By setting the default gravity sensor parameter in the gravity sensor process and adjusting the default gravity sensor parameter according to the display state and the content display direction of the application interface, the virtual gravity sensor parameter suitable for the display state and the content display direction is obtained, and then the target application simulates the use posture of the display device to adapt to the display state of the application interface, so as to obtain the applicable gravity sensor parameter when the target application needs to obtain the gravity sensor parameter, and the gravity sensor parameter is suitable for the forward display and the reverse display of the application interface. Moreover, for the display device with a fixed use posture (i.e., the display device that does not need to obtain the tilt angle or cannot be moved and rotated), the simulation of the gravity sensor can be realized, and the real gravity sensor does not need to be configured, which can reduce one hardware module of the display device and save the cost of the display device. Moreover, the second screen angle and the virtual gravity sensor direction suitable for the application interface can be obtained and fed back to the target application, so that the target application obtains more types of parameters to realize more accurate business processing based on more types of parameters.

[0233] The virtual gravity sensor implementation method provided by the foregoing embodiments is exemplarily described as follows. Currently, the display device is a learning machine, the default use posture is a horizontal positive direction posture, the default gravity sensor parameter is (9.8, 0, 0), and the preset use posture used when determining the second screen angle is (0, 9.8, 0).

[0234] FIG. 21 is a first schematic diagram of a signal transmission type provided by one embodiment of the present application, which shows the signal type transmitted between a target application, a system service, and a gravity sensor process. As shown in FIG. 21, after starting the system service and the gravity sensor process, the gravity sensor process declares to the system service that the learning machine supports the function of obtaining the gravity sensor parameter. Then, when the target application needs to obtain the gravity sensor parameter, the target application inquires whether the system service supports the gravity sensor. After the system service feeds back to the target application that the gravity sensor is supported, the target application is registered in the system service, i.e., the target application registers to listen to the parameter reported by the system service. Then, the system service establishes a listening callback to the gravity sensor process, so that the gravity sensor process reports the default gravity sensor parameter to the system service. Then, the system service determines the display state of the application interface currently displayed by the target application and the content display direction, and feeds back the virtual gravity sensor parameter, the second screen angle, and the virtual gravity sensor direction to the target application in combination with the feedback default gravity sensor parameter. When the display state is a horizontal display state and the content display direction is a content display positive direction (i.e., the application interface shown in FIG. 7), the virtual gravity sensor parameter determined by the system service is (9.8, 0, 0), the virtual gravity sensor direction is 270, and the second screen angle is 90. When the display state is a vertical display state and the content display direction is a content display positive direction (i.e., the application interface shown in FIG. 6), the virtual gravity sensor parameter determined by the system service is (0, 9.8, 0), the virtual gravity sensor direction is 0, and the second screen angle is 0. When the display state is a horizontal display state and the content display direction is a content display reverse direction (i.e., the application interface shown in FIG. 15), the virtual gravity sensor parameter determined by the system service is (-9.8, 0, 0), the virtual gravity sensor direction is 90, and the second screen angle is 270. When the display state is a vertical display state and the content display direction is a content display reverse direction (i.e., the application interface shown in FIG. 16), the virtual gravity sensor parameter determined by the system service is (0, -9.8, 0), the virtual gravity sensor direction is 180, and the second screen angle is 180. Then, the target application can perform subsequent logical judgment according to the obtained parameters.

[0235] It can be understood that for a tablet computer with a landscape mode, the tablet computer can also use the foregoing virtual gravity sensor implementation method in the landscape mode. When the landscape mode is cancelled, the tablet computer has a demand for obtaining a gravity sensor parameter, the gravity sensor parameter collected by the real gravity sensor can be obtained, and FIG. 22 is a second schematic diagram of a signal transmission type provided by one embodiment of the present application, which shows the signal type transmitted between a target application, a system service, and a gravity sensor process when the real gravity sensor parameter is obtained. The difference between FIG. 22 and FIG. 21 is that the gravity sensor process feeds back to the system service the real gravity sensor parameter collected by the real-time gravity sensor, and when the target application has a demand for obtaining a gravity sensor parameter, the system service obtains the real gravity sensor parameter and directly feeds back to the target application.

[0236] One embodiment of the present application further provides a display method of a learning machine application interface. The display method of the learning machine application interface takes a learning machine as an example of a display device, and describes a specific application scenario of the foregoing virtual gravity sensor implementation method. The display method of the learning machine application interface is executed by the learning machine, and the related description of the learning machine can refer to the related description of the foregoing display device, that is, the related description of the foregoing display device is fully applicable to the learning machine.

[0237] Currently, the learning machine has a default display state. The default display state can be understood as a display state that should be used by an application interface in the learning machine in a default use posture. The default display state can be a horizontal display state or a vertical display state (the related description of the horizontal display state and the vertical display state can refer to the content in the foregoing embodiments).

[0238] The use posture suitable for the horizontal display state is a landscape state. The use posture suitable for the vertical display state is a portrait state. It can be known from the content in the foregoing embodiments that, as shown in FIG. 7, the interface in the horizontal display state (that is, the horizontal display state) should generally be suitable for the landscape state. As shown in FIG. 12, the interface in the vertical display state (that is, the vertical display state) should generally be suitable for the portrait state. It can be understood that the use posture suitable for the default display state can be used as the default use posture. Currently, the landscape state can be further divided into a horizontal positive direction posture and a horizontal negative direction posture, and the portrait state can be further divided into a vertical positive direction posture and a vertical negative direction posture.

[0239] FIG. 23 is a flowchart of a display method of a learning machine application interface provided by one embodiment of the present application. Referring to FIG. 23, the display method of the learning machine application interface can include the following steps.

[0240] In step 1510, the system service of the learning machine determines a display state that should be used by an application interface of a target application, the display state that should be used is a horizontal display state or a vertical display state, and the target application is an application program installed in the learning machine.

[0241] The system service and the target application have the same function as described above.

[0242] Optionally, the system service is notified when the target application needs to acquire the gravity sensor parameter. Then, the system service can determine the display state that should be used by the application interface of the target application.

[0243] The display state that should be used can be understood as the display state used by the application interface when the application interface is displayed on the learning machine. The display state that should be used can be a horizontal display state or a vertical display state. The display state that should be used can be set by the target application or by the user. For example, the default display state of each application interface when the target application displays each application interface can be considered as the display state that should be used set by the target application. For another example, when the application interface has a function of switching between horizontal display and vertical display, the display state after the user switches between horizontal display and vertical display (switching from horizontal to vertical or switching from vertical to horizontal) can be considered as the display state that should be used set by the user.

[0244] Optionally, the technical means of determining the display state that should be used by the system service is the same as the technical means of determining the current display state of the application interface by the system service in the foregoing embodiment, which is not described herein.

[0245] Optionally, the application interface of the target application can be displayed on the learning machine according to the display state that should be used, or can be accurately displayed according to the display state that should be used but not yet displayed on the learning machine.

[0246] Step 1520, determining by the system service whether the display state that should be used is consistent with the default display state, and when not consistent, obtaining a virtual gravity sensor parameter suitable for the display state that should be used according to the display state that should be used and the default gravity sensor parameter.

[0247] The definitions of the default gravity sensor parameter and the virtual gravity sensor parameter can be understood with reference to the related descriptions in the foregoing embodiments.

[0248] For example, the system service determines whether the display state that should be used is consistent with the default display state after obtaining the display state that should be used. It can be understood that if the display state that should be used and the default display state are both horizontal display states or vertical display states, it is determined that the two are consistent, and if one is a horizontal display state and the other is a vertical display state, it is determined that the two are not consistent.

[0249] When the display state to be used is inconsistent with the default display state, it indicates that the use posture corresponding to the display state to be used is inconsistent with the default use posture corresponding to the default display state. For example, the display state to be used is a portrait display state, the target application considers that the real use posture of the learning machine should be a portrait screen state, however, the default display state is a landscape display state, which indicates that the real use posture of the learning machine should be a landscape screen state (referring to the landscape screen state in FIG. 5). At this time, in order to display the application interface in the portrait display state in the learning machine in the landscape screen state, the system service needs to adjust the default gravity sensing parameter to obtain a virtual gravity sensing parameter suitable for the portrait display state, so that the target application determines that the learning machine is in the portrait screen state (this is a virtual use posture) based on the virtual gravity sensing parameter, and then the application interface in the portrait display state can be displayed in the learning machine.

[0250] The technical means for the system service to obtain the virtual gravity sensing parameter is consistent with the technical means for the system service to obtain the virtual gravity sensing parameter in the foregoing embodiments (the content display direction can be referred to for determining the virtual gravity sensing parameter), and will not be described herein.

[0251] In actual application, after the system service obtains the display state to be used, the system service can directly obtain the virtual gravity sensing parameter according to the display state to be used and the default gravity sensing parameter without judging the consistency of the display state. The process can be referred to the related description in the foregoing embodiments.

[0252] In step 1530, the system service feeds back the virtual gravity sensing parameter to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter and the display state to be used, and the displayed application interface is still in the display state to be used in the use posture corresponding to the default display state. The application interface only occupies part of the display area of the learning machine, and the other display area of the learning machine is a background display area.

[0253] For example, after the system service obtains the virtual gravity sensing parameter, the system service delivers the virtual gravity sensing parameter to the target application in the application layer, so that the target application obtains the virtual gravity sensing parameter and performs subsequent processing. After the target application obtains the virtual gravity sensing parameter, the target application displays the application interface based on the virtual gravity sensing parameter and the display state to be used, so that the application interface presents the display state to be used in the learning machine in the default display state (i.e., presents the display state inconsistent with the default display state).

[0254] Optionally, the usage posture of the target application determined according to the virtual gravity sensing parameter (which is a virtual usage posture) is consistent with the usage posture corresponding to the display state that should be used, and thus the application interface can be displayed in the display state corresponding to the usage posture (i.e., the display state that should be used). When displayed, since the default display state is inconsistent with the display state that should be used, the target application determines that the application interface should be non-full-screen display, i.e., the application interface only occupies part of the display area of the learning machine, and other display areas of the learning machine are background display areas. Furthermore, for aesthetic purposes, the part of the display area where the application interface is located is in the middle of the display screen of the learning machine, and the two sides are background display areas. It can be understood that, taking the default display state as a horizontal display state as an example, at this time, the width of the display screen is greater than the height (for reference, see FIG. 5). When the display state that should be used is a vertical display state, the width of the application interface is less than the height. At this time, in order to display the application interface in the vertical display state in the display screen, a region with a width less than a height needs to be selected in the display screen, and the application interface is displayed in the region, and the remaining part of the display screen can display a background, i.e., as a background display area. When the default display state is a vertical display state and the display state that should be used is a horizontal display state, the principle is the same. Based on this, when the default display state is inconsistent with the display state that should be used, the target application determines that the application interface should be non-full-screen display. Furthermore, for aesthetic purposes, the part of the display area where the application interface is located can be set to be in the middle of the display screen of the learning machine, and the two sides are background display areas. For example, FIG. 6 and FIG. 11 are display layouts of the application interface when the default display state is inconsistent with the display state that should be used. At this time, it can also be considered that the target application maintains the display state of the application interface.

[0255] Optionally, when the target application displays the application interface, the application interface can present a content display forward direction or a content display reverse direction. At this time, the virtual gravity sensing parameter is different under different content display directions, and thus the target application can make the application interface maintain the current content display forward direction or content display reverse direction when the application interface is displayed based on the virtual gravity sensing parameter.

[0256] Optionally, when the display state that should be used is consistent with the default display state, it indicates that the usage posture corresponding to the display state that should be used is consistent with the default usage posture corresponding to the default display state, and thus the default gravity sensing parameter can be directly used as the virtual gravity sensing parameter. Alternatively, when the default display state is consistent with the display state that should be used, it can be further determined whether the content display direction of the application interface is a content display forward direction. If it is not a content display forward direction, it indicates that the usage posture suitable for the application interface should be an inverted posture of the default usage posture, and thus the suitable virtual gravity sensing parameter can still be determined and fed back to the target application for use, so that the application interface presents a content display reverse direction.

[0257] Optionally, when the default display state is consistent with the display state to be used, the application interface should be full-screen display, at this time, the target application can display the application interface in full screen.

[0258] Optionally, when the default display state is consistent with the display state to be used, the system service can also not feedback the virtual gravity sensing parameter, at this time, the target application determines to display the application interface in full screen.

[0259] The technical details not mentioned in the display method of the learning machine application interface can refer to the technical details of the aforementioned virtual gravity sensing implementation method.

[0260] In the above, the learning machine with the default display state (the use posture of the learning machine applicable in the default display state is fixed) determines the display state to be used by the application interface of the target application, and when the display state to be used by the application interface is inconsistent with the default display state of the learning machine, the virtual gravity sensing parameter applicable to the display state to be used by the application interface is obtained by combining the display state to be used by the application interface and the default gravity sensing parameter, and the virtual gravity sensing parameter is fed back to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter, and the application interface is still in the display state to be used and is applicable to the use posture corresponding to the default display state of the learning machine. The technical means solves the technical problem in the related art that when the learning machine has a default use posture, the application program cannot obtain the applicable gravity sensing parameter. By setting the default gravity sensing parameter applicable to the default display state, and adjusting the default gravity sensing parameter when the default display state of the learning machine is inconsistent with the display state to be used by the application interface, the virtual gravity sensing parameter suitable for the display state to be used can be obtained, so that the applicable gravity sensing parameter can be obtained when the target application has a demand for obtaining the gravity sensing parameter, so that the target application can simulate the use posture of the learning machine that is suitable for the display state of the application interface, at this time, the application interface can only occupy part of the display area of the learning machine, that is, the application interface with a display state inconsistent with the default display state in the learning machine is realized.

[0261] One embodiment of the present application also provides a virtual gravity sensing implementation device. The virtual gravity sensing implementation device is applied to a display device, the display device has a default use posture, and the display device is installed with at least one target application. FIG. 24 is a structural schematic diagram of a virtual gravity sensing implementation device provided by one embodiment of the present application. Referring to FIG. 24, the virtual gravity sensing implementation device includes a notification receiving unit 1401, a state determining unit 1402, a parameter determining unit 1403, and a parameter feedback unit 1404.

[0262] The notification receiving unit 1401 is configured to receive, by a system service of the display device, a notification for acquiring a gravity sensing parameter issued by a target application, the target application being an application program installed in the display device and having a demand for acquiring the gravity sensing parameter; the state determining unit 1402 is configured to determine, by the system service, a current display state of an application interface of the target application, the display state being a horizontal display state or a vertical display state; the parameter determining unit 1403 is configured to obtain, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state and a default gravity sensing parameter; and the parameter feedback unit 1404 is configured to feed back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

[0263] In an embodiment of the present application, the virtual gravity sensing implementation device further comprises a first direction determining unit configured to determine, by the system service, a current content display direction of the application interface when determining, by the system service, the current display state of the application interface of the target application, the content display direction being a content display positive direction or a content display reverse direction. Correspondingly, the parameter determining unit 1403 is specifically configured to obtain, by the system service, the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction and the default gravity sensing parameter.

[0264] In an embodiment of the present application, the parameter determining unit 1403 comprises a rule determining sub-unit configured to determine, by the system service, a corresponding parameter generation rule according to the display state and the content display direction; and a sensing parameter determining sub-unit configured to obtain, by the system service, the virtual gravity sensing parameter applicable to the application interface according to the parameter generation rule and values in three coordinate directions of the default gravity sensing parameter.

[0265] In an embodiment of the present application, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward of the display device perpendicular to a plane on which the display device is located in the default use posture; and the rule determining subunit is specifically configured to: when the display state is the horizontal display state and the content display direction is a content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0266] In an embodiment of the present application, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward of the display device perpendicular to a plane on which the display device is located in the default use posture; and the rule determining subunit is specifically configured to: when the display state is the horizontal display state and the content display direction is a content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0267] In an embodiment of the present application, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction is a direction vertically upward of the display device in a default use posture, the second coordinate direction is a direction horizontally left of the display device in the default use posture, and the third coordinate direction is a direction perpendicular to a plane where the display device is located and outward in the default use posture; the rule determining sub-unit is specifically configured to: when the display state is the portrait display state and the content display direction is the content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0268] In an embodiment of the present application, the default gravity sensing parameter includes a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction is a direction vertically upward of the display device in a default use posture, the second coordinate direction is a direction horizontally left of the display device in the default use posture, and the third coordinate direction is a direction perpendicular to a plane where the display device is located and outward in the default use posture; the rule determining sub-unit is specifically configured to: when the display state is the portrait display state and the content display direction is the content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameter as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, take the second value in the default gravity sensing parameter as a fourth value in the first coordinate direction in the virtual gravity sensing parameter, and take the third value in the default gravity sensing parameter as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

[0269] In an embodiment of the present application, the virtual gravity sensing implementation device further includes: a second direction determining unit configured to, after the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction, and the default gravity sensing parameter, the system service determines a virtual gravity sensing direction corresponding to the display state and the content display direction; and a direction feedback unit configured to, when the system service feeds back the virtual gravity sensing parameter applicable to the application interface to the target application, the system service also feeds back the virtual gravity sensing direction to the target application.

[0270] In one embodiment of the present application, the virtual gravity sensor implementation device further comprises: an angle determination unit, configured to determine, by the system service, a second screen angle corresponding to the display state and the content display direction after obtaining the virtual gravity sensor parameter applicable to the application interface according to the display state, the content display direction and the default gravity sensor parameter, wherein the second screen angle is equal to an included angle between a preset use posture and a use posture corresponding to the virtual gravity sensor parameter in a clockwise direction; and an angle feedback unit, configured to feed back, by the system service, the second screen angle to the target application when feeding back, by the system service, the virtual gravity sensor parameter applicable to the application interface to the target application.

[0271] In one embodiment of the present application, the state determination unit 1402 comprises: a size parameter acquisition sub-unit, configured to acquire, by the system service, a display size parameter of the application interface of the target application, wherein the display size parameter comprises a width parameter of the application interface and a height parameter of the application interface; and a display state determination sub-unit, configured to obtain, by the system service, a current display state of the application interface according to the display size parameter, wherein the width parameter is greater than the height parameter in the horizontal display state, and the width parameter is less than the height parameter in the vertical display state.

[0272] In one embodiment of the present application, the first direction determination unit comprises: an angle acquisition sub-unit, configured to acquire, by the system service, a first screen angle, wherein the first screen angle is a first angle value or a second angle value, the first angle value is a screen display angle of the display device in a default use posture when the application interface is forwardly displayed, and the second angle value is a screen display angle of the display device in the default use posture when the application interface is reversely displayed; and a content display direction determination sub-unit, configured to determine, by the system service, a current content display direction of the application interface according to the first screen angle.

[0273] In one embodiment of the present application, the notification receiving unit 1401 comprises: an inquiry receiving sub-unit, configured to receive, by the system service of the display device, an inquiry about whether to support a gravity sensor, wherein the inquiry is sent by the target application when the target application needs to acquire a gravity sensor parameter; and an inquiry feedback sub-unit, configured to feed back, by the system service, to the target application that the gravity sensor is currently supported, so that the target application is registered in the system service. Correspondingly, the parameter feedback unit 1404 is specifically configured to feed back, by the system service, to the registered target application, the virtual gravity sensor parameter applicable to the application interface.

[0274] In one embodiment of the present application, the virtual gravity sensor implementation device further comprises a stopping feedback unit, configured to, after the system service feeds back the virtual gravity sensor parameter applicable to the application interface to the target application, stop feeding back the virtual gravity sensor parameter to the target application when the system service determines that the target application cancels the registration.

[0275] In one embodiment of the present application, the virtual gravity sensor implementation device further comprises a default parameter obtaining unit, configured to, before the system service obtains the virtual gravity sensor parameter applicable to the application interface according to the display state and the default gravity sensor parameter, obtain the default gravity sensor parameter from a gravity sensor process by the system service, wherein the gravity sensor process is pre-configured with the default gravity sensor parameter.

[0276] In one embodiment of the present application, the virtual gravity sensor implementation device further comprises a service and process starting unit, configured to, before the system service of the display device receives the notification for obtaining the gravity sensor parameter sent by the target application, start the system service and the gravity sensor process when the display device is powered on; and a support declaration unit, configured to, by the system service, receive a declaration of the gravity sensor process, wherein the declaration is used to indicate that the display device supports the function of obtaining the gravity sensor parameter.

[0277] The virtual gravity sensor implementation device provided by the embodiments of the present application is contained in a display device, and can be used to execute the virtual gravity sensor implementation method provided in any of the above embodiments, and has the corresponding functions and advantages.

[0278] One embodiment of the present application further provides a display device of a learning machine application interface. The display device of the learning machine application interface is applied to a learning machine. The learning machine has a default display state, and the default display state is a horizontal display state or a vertical display state. The horizontal display state is applicable to a horizontal screen state, and the vertical display state is applicable to a vertical screen state. FIG. 25 is a structural schematic diagram of the display device of the learning machine application interface provided by one embodiment of the present application. Referring to FIG. 25, the display device of the learning machine application interface comprises an applicable state determining unit 1601, a state consistency judging unit 1602 and a display interface determining unit 1603.

[0279] The application further provides a learning machine application interface display device, which comprises a should-use state determining unit 1601, a state consistency judging unit 1602, and a display interface determining unit 1603. The should-use state determining unit 1601 is configured to determine, by a system service of the learning machine, a display state that should be used by an application interface of a target application, the display state that should be used being a horizontal display state or a vertical display state, and the target application being an application program installed in the learning machine. The state consistency judging unit 1602 is configured to judge, by the system service, whether the display state that should be used is consistent with a default display state, and when the display state that should be used is not consistent with the default display state, obtain a virtual gravity sensing parameter suitable for the display state that should be used according to the display state that should be used and a default gravity sensing parameter. The display interface determining unit 1603 is configured to feed back, by the system service, the virtual gravity sensing parameter to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter and the display state that should be used, and the displayed application interface is still in the display state that should be used in a use posture corresponding to the default display state. The application interface only occupies a part of a display region of the learning machine, and other display regions of the learning machine are background display regions.

[0280] The learning machine application interface display device provided by the embodiments of the application is contained in a learning machine and can be used to execute the learning machine application interface display method provided in any of the embodiments.

[0281] It should be noted that, in the embodiments of the virtual gravity sensing implementation device and the learning machine application interface display device, each unit and module included is only logically divided according to functions, but is not limited to the above division, as long as the corresponding functions can be implemented. In addition, the specific names of the functional units are only used for mutual distinction and do not limit the protection scope of the application.

[0282] An embodiment of the application further provides a display device. Referring to FIG. 8, the display device comprises a processor 51, a memory 52, and a display screen 53. The processor 51, the memory 52, and the display screen 53 can be connected through a bus or other means. The display screen 53 is configured to realize display. The memory 52 is configured to store one or more programs. When the one or more programs are executed by the one or more processors 51, the one or more processors 11 realize the virtual gravity sensing implementation method described in any of the preceding embodiments. The related content of each component can be referred to the foregoing description.

[0283] The display device described above contains the virtual gravity sensing implementation method device, which can be used to execute any virtual gravity sensing implementation method, has the corresponding functions and advantages, and the specific details not described at present can be referred to the foregoing description of the virtual gravity sensing implementation method.

[0284] One embodiment of the present application further provides a learning machine, which can also refer to FIG. 8, comprising a processor 51, a memory 52, and a display screen 53. The processor 51, the memory 52, and the display screen 53 can be connected through a bus or other means. The display screen 53 is configured to display; the memory 52 is configured to store one or more programs; and when the one or more programs are executed by the one or more processors 51, the one or more processors 11 implement the display method of the learning machine application interface as described in any of the preceding embodiments. The related content of each component can refer to the foregoing description.

[0285] The learning machine described above comprises a display device of a learning machine application interface, which can be used to execute any display method of a learning machine application interface, has the corresponding functions and advantages, and the specific details not described herein can refer to the related description of the display method of the learning machine application interface.

[0286] One embodiment of the present application further provides a storage medium containing computer executable instructions, which, when executed by a processor, are used to perform the related operations in the virtual gravity sensing implementation method and the display method of the learning machine application interface provided in any of the embodiments of the present application, and have the corresponding functions and advantages.

[0287] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product.

[0288] Accordingly, embodiments of the present application can be embodied in the form of complete hardware embodiments, complete software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present application can take the form of a computer program product on one or more computer-readable storage media (including, but not limited to, disk memory, CD-ROMs, optical storage devices, etc.) embodying computer readable program code. Embodiments of the present application are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing system or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart illustration and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart illustration and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart illustration and / or block diagram block or blocks.

[0289] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to computing devices. According to the definition herein, computer readable media does not include transitory media such as modulated data signals and carrier waves.

[0290] It is also to be noted that the terms "comprising", "including", and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0291] Note that the above merely describes preferred embodiments of the present application and the applied technical principles. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, reconfigurations, and substitutions can be made without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for implementing virtual gravity sensing, applied to a display device, wherein, The display device has a default use posture, The virtual gravity sensing implementation method comprises: A system service of the display device receives a notification for obtaining gravity sensing parameters sent by a target application, the target application being an application program installed in the display device and having a demand for obtaining gravity sensing parameters; The system service determines a current display state of an application interface of the target application, the display state being a horizontal display state or a vertical display state; The system service obtains virtual gravity sensing parameters applicable to the application interface according to the display state and default gravity sensing parameters; The system service feeds back the virtual gravity sensing parameters applicable to the application interface to the target application.

2. The virtual gravity sensing implementation method of claim 1, wherein, When the system service determines the current display state of the application interface of the target application, the method further comprises: The system service determines a current content display direction of the application interface, the content display direction being a content display positive direction or a content display reverse direction; The system service obtains virtual gravity sensing parameters applicable to the application interface according to the display state and default gravity sensing parameters, comprising: The system service obtains virtual gravity sensing parameters applicable to the application interface according to the display state, the content display direction and default gravity sensing parameters.

3. The method of claim 2, wherein, The system service obtains virtual gravity sensing parameters applicable to the application interface according to the display state and the content display direction, comprising: The system service determines a corresponding parameter generation rule according to the display state and the content display direction; The system service obtains virtual gravity sensing parameters applicable to the application interface according to the parameter generation rule and the values of the three coordinate directions in the default gravity sensing parameters.

4. The virtual gravity sensing implementation method of claim 3, wherein, The default gravity sensing parameters comprise a first value in a first coordinate direction, a second value in a second coordinate direction and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in the default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction perpendicular to a plane on which the display device is located and outward in the default use posture of the display device; The system service determines a corresponding parameter generation rule according to the display state and the content display direction, comprising: When the display state is a horizontal display state and the content display direction is a content display positive direction, the parameter generation rule determined by the system service is to take the first value in the default gravity sensing parameters as a fourth value in the first coordinate direction in the virtual gravity sensing parameters, take the second value in the default gravity sensing parameters as a fifth value in the second coordinate direction in the virtual gravity sensing parameters, and take the third value in the default gravity sensing parameters as a sixth value in the third coordinate direction in the virtual gravity sensing parameters.

5. The method of claim 3, wherein, The default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward and perpendicular to a plane where the display device is located in the default use posture; The parameter generation rule determined by the system service according to the display state and the content display direction comprises: When the display state is a horizontal display state and the content display direction is a content display reverse direction, the parameter generation rule determined by the system service is that a negative of the first value in the default gravity sensing parameter is taken as a fourth value in the first coordinate direction in a virtual gravity sensing parameter, a negative of the second value in the default gravity sensing parameter is taken as a fifth value in the second coordinate direction in the virtual gravity sensing parameter, and the third value in the default gravity sensing parameter is taken as a sixth value in the third coordinate direction in the virtual gravity sensing parameter.

6. The method of claim 3, wherein, The default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward and perpendicular to a plane where the display device is located in the default use posture; The parameter generation rule determined by the system service according to the display state and the content display direction comprises: When the display state is a vertical display state and the content display direction is a content display positive direction, the parameter generation rule determined by the system service is that the first value in the default gravity sensing parameter is taken as the fifth value in the second coordinate direction in a virtual gravity sensing parameter, the second value in the default gravity sensing parameter is taken as the fourth value in the first coordinate direction in the virtual gravity sensing parameter, and the third value in the default gravity sensing parameter is taken as the sixth value in the third coordinate direction in the virtual gravity sensing parameter.

7. The method of claim 3, wherein, The default gravity sensing parameter comprises a first value in a first coordinate direction, a second value in a second coordinate direction, and a third value in a third coordinate direction, the first coordinate direction being a direction vertically upward of the display device in a default use posture, the second coordinate direction being a direction horizontally left of the display device in the default use posture, and the third coordinate direction being a direction outward and perpendicular to a plane where the display device is located in the default use posture; The parameter generation rule determined by the system service according to the display state and the content display direction comprises: When the display state is the portrait display state and the content display direction is the content display reverse direction, the parameter generation rule determined by the system service is to take a negative of a first value in the default gravity sensing parameter as a fifth value in the second coordinate direction of the virtual gravity sensing parameter, take a negative of a second value in the default gravity sensing parameter as a fourth value in the first coordinate direction of the virtual gravity sensing parameter, and take a third value in the default gravity sensing parameter as a sixth value in the third coordinate direction of the virtual gravity sensing parameter.

8. The method of claim 2, wherein, After the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction and the default gravity sensing parameter, the method further includes: determining, by the system service, a virtual gravity sensing direction corresponding to the display state and the content display direction; when the system service feeds back the virtual gravity sensing parameter applicable to the application interface to the target application, the method further includes: feeding back, by the system service, the virtual gravity sensing direction to the target application.

9. The method of claim 2, wherein, After the system service obtains the virtual gravity sensing parameter applicable to the application interface according to the display state, the content display direction and the default gravity sensing parameter, the method further includes: determining, by the system service, a second screen angle corresponding to the display state and the content display direction, the second screen angle being equal to an included angle between a display device use posture corresponding to the virtual gravity sensing parameter and a preset use posture in a clockwise direction; when the system service feeds back the virtual gravity sensing parameter applicable to the application interface to the target application, the method further includes: feeding back, by the system service, the second screen angle to the target application.

10. The method of Claim 1, wherein, The method of determining, by the system service, the current display state of the application interface of the target application includes: obtaining, by the system service, a display size parameter of the application interface of the target application, the display size parameter including a width parameter of the application interface and a height parameter of the application interface; obtaining, by the system service, the current display state of the application interface according to the display size parameter, wherein the width parameter is greater than the height parameter in the landscape display state, and the width parameter is less than the height parameter in the portrait display state.

11. The method of claim 2, wherein, The method of determining, by the system service, the current content display direction of the application interface includes: obtaining, by the system service, a first screen angle, the first screen angle being a first angle value or a second angle value, the first angle value being a screen display angle of the display device in a default use posture when the application interface is displayed in a forward direction, and the second angle value being a screen display angle of the display device in the default use posture when the application interface is displayed in a reverse direction; determining, by the system service, the current content display direction of the application interface according to the first screen angle.

12. The method of claim 1, wherein, The method of receiving, by a system service of the display device, a notification for obtaining a gravity sensing parameter sent by a target application includes: receiving, by a system service of the display device, an inquiry about whether a gravity sensor is supported, the inquiry being sent by a target application when the target application needs to acquire a gravity sensing parameter; feeding back, by the system service, to the target application that a gravity sensor is currently supported, so that the target application is registered in the system service; the feeding back, by the system service, of the virtual gravity sensing parameter applicable to the application interface to the target application comprises: feeding back, by the system service, to the registered target application, a virtual gravity sensing parameter applicable to the application interface.

13. The method of claim 12, wherein, after the feeding back, by the system service, of the virtual gravity sensing parameter applicable to the application interface to the target application, the method further comprises: stopping, by the system service, feeding back the virtual gravity sensing parameter to the target application when the target application is unregistered.

14. The method of Claim 1, wherein, before the obtaining, by the system service, of the virtual gravity sensing parameter applicable to the application interface according to the display state and the default gravity sensing parameter, the method further comprises: obtaining, by the system service, a default gravity sensing parameter from a gravity sensor process, the default gravity sensing parameter being pre-set in the gravity sensor process.

15. The method of claim 14, wherein, before the receiving, by the system service of the display device, of a notification sent by a target application for acquiring a gravity sensing parameter, the method further comprises: starting the system service and the gravity sensor process when the display device is powered on; receiving, by the system service, a declaration of the gravity sensor process, the declaration being used to indicate that the display device supports a function of acquiring a gravity sensing parameter.

16. A display method of a learning machine application interface, applied to a learning machine, wherein, the learning machine has a default display state, the default display state being a landscape display state or a portrait display state, the landscape display state being applicable to a landscape state of a use posture, and the portrait display state being applicable to a portrait state of a use posture; the display method of the application interface of the learning machine comprises: determining, by a system service of the learning machine, a display state that an application interface of a target application should use, the display state that should be used being a landscape display state or a portrait display state, and the target application being an application program installed in the learning machine; judging, by the system service, whether the display state that should be used is consistent with the default display state, and when the display state that should be used is not consistent with the default display state, obtaining a virtual gravity sensing parameter applicable to the display state that should be used according to the display state that should be used and a default gravity sensing parameter; feeding back, by the system service, the virtual gravity sensing parameter to the target application, so that the target application displays the application interface based on the virtual gravity sensing parameter and the display state that should be used, and the displayed application interface is still in the display state that should be used in a use posture corresponding to the default display state, the application interface only occupies a part of a display area of the learning machine, and other display areas of the learning machine are background display areas.

17. A virtual gravity sensor implementation apparatus applied to a display device, wherein, the display device has a default use posture, the virtual gravity sensing implementation device comprises: The notification receiving unit is configured to receive, by a system service of the display device, a notification for obtaining a gravity sensing parameter issued by a target application, the target application being an application program installed in the display device and having a demand for obtaining the gravity sensing parameter; The state determining unit is configured to determine, by the system service, a current display state of an application interface of the target application, the display state being a horizontal display state or a vertical display state; The parameter determining unit is configured to obtain, by the system service, a virtual gravity sensing parameter applicable to the application interface according to the display state and a default gravity sensing parameter; The parameter feedback unit is configured to feed back, by the system service, the virtual gravity sensing parameter applicable to the application interface to the target application.

18. A display device, wherein, The display device comprises a display screen, one or more processors, and a memory; The memory is configured to store one or more programs; The display screen is configured to realize display; When the one or more programs are executed by the one or more processors, the one or more processors realize the virtual gravity sensing implementation method according to any one of claims 1-15.

19. A computer readable storage medium having stored thereon a computer program, wherein, The computer program is executed by the processor to realize the virtual gravity sensing implementation method according to any one of claims 1-15.

Citation Information

Patent Citations

  • Method and device for acquiring gravity sensing data and electronic device

    CN103268158A

  • Virtual keyboard adjustment method and mobile terminal

    CN103677632A

  • Electronic device, gravity center adjustment method and device, and terminal device

    CN109525723A

  • A virtual key display method and a terminal

    CN109743449A

  • Information processing method and device, electronic equipment and storage medium

    CN112416238A