Page processing method and device and electronic equipment
By collecting motion data at high frequency on electronic devices and selecting appropriate data based on screen refresh rate to generate display pages, the page update delay problem caused by insufficient real-time and accuracy of motion data in the prior art is solved, and more efficient page updates are achieved.
Patent Information
- Application Number
- CN202411847888.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-28
AI Technical Summary
In the prior art, the real-time and accuracy of the motion data of electronic equipment obtained through gyroscopes are low, resulting in a high update delay of the display page.
In the case of the first application running, the first motion data of the electronic device is acquired at a higher first frequency, and then the second motion data is determined from the first motion data based on the same but lower second frequency as the screen refresh rate, for processing and generating the display page.
By collecting motion data at high frequency and selecting the appropriate data for display page generation, the real-time and accuracy of the data are significantly improved, thereby reducing the delay in page updates.
Smart Images

Figure CN119719539A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a page processing method, device and electronic device. Background Art
[0002] Nowadays, when users use electronic devices such as mobile phones and tablets, some applications in the electronic devices require real-time motion data of the electronic devices to generate display pages, so as to ensure that the real-time display pages are synchronized with the user's movements.
[0003] In the related art, a gyroscope is usually used to assist in obtaining motion data in an electronic device. However, the real-time and accuracy of the motion data obtained by the gyroscope are low, which results in a high update delay of a display page generated based on the motion data. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a page processing method, device and electronic device, which can solve the technical problem of high update delay of existing display pages.
[0005] In a first aspect, an embodiment of the present application provides a page processing method, the method comprising:
[0006] When the first application is running, obtaining first motion data of the electronic device at a first frequency;
[0007] Determine second motion data from the first motion data according to a second frequency, where the second frequency is a screen refresh rate of the electronic device, and the second frequency is less than the first frequency;
[0008] Process the page of the first application according to the second motion data.
[0009] In a second aspect, an embodiment of the present application provides a page processing device, the device comprising:
[0010] A collection module, used for acquiring first motion data of the electronic device at a first frequency when a first application is running;
[0011] A first determining module, configured to determine second motion data from the first motion data according to a second frequency, where the second frequency is a screen refresh rate of the electronic device, and the second frequency is less than the first frequency;
[0012] A generation module is used to process the page of the first application according to the second motion data.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method provided in the first aspect are implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method provided in the first aspect are implemented.
[0015] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the method provided in the first aspect.
[0016] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method provided in the first aspect.
[0017] In the page processing method, device and electronic device of the present application, the first motion data of the electronic device can be obtained at a first frequency when the first application is running; the second motion data can be determined from the first motion data according to a second frequency, the second frequency is equal to the screen refresh rate of the electronic device, and the second frequency is less than the first frequency; the display page of the first application is generated according to the second motion data. In this way, the motion data can be collected at a higher first frequency, so that more detailed and continuous motion information can be obtained, and then the second motion frequency can be selected from the first motion data at a second frequency that is the same as the screen refresh rate to generate a display page, which can allow the system to select appropriate second motion data from the continuous motion information to draw the display page. Since the second motion data is selected from the high-frequency first motion data, the real-time and accuracy of the second motion data are relatively high, and it can more accurately reflect the real-time actions of the user, thereby significantly reducing the delay in page updates. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a page processing method provided by an embodiment of the present application;
[0019] Figure 2 is a structural schematic diagram of a page processing device provided by another embodiment of the present application;
[0020] Figure 3 is a structural schematic diagram of an electronic device provided by another embodiment of the present application;
[0021] Figure 4 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0023] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the terms used in this way are interchangeable where appropriate, so that the embodiments of the present application can be implemented in an order other than those illustrated or described herein, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0024] In order to solve the above technical problems, the present application provides a page processing method. The following is a detailed description of the page processing method provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings.
[0025] like Figure 1 As shown, Figure 1 : is a flow chart of a page processing method provided by an embodiment of the present application. The embodiment of the present application provides a page processing method, which may include:
[0026] S101, acquiring first motion data of an electronic device at a first frequency when a first application is running;
[0027] In this embodiment, the first application may be a game application or other application that requires real-time motion data, and the electronic device may be a handheld device such as a mobile phone or a tablet computer. The electronic device may include a gyroscope sensor, through which the angular velocity of the electronic device on three spatial axes can be measured, and the real-time motion data of the electronic device can be obtained in real time, so as to accurately track its direction and rotation changes. The gyroscope sensor may also include a sensor coprocessor (SensorHub) and a sensor service module (SensorService), wherein the sensor coprocessor is used for the collection and preliminary processing of sensor data, and the sensor service module is used to manage and distribute the data collected by the sensor coprocessor, and interact with the application engine of the first application.
[0028] After the first application is started, the first application first sends a motion data request to the system of the electronic device, the motion data request is used to request to obtain motion data at a third frequency, and the system sends the motion data request to the sensor coprocessor, usually the third frequency is lower;
[0029] The sensor coprocessor may modify the third frequency to the first frequency, and drive the gyroscope sensor to obtain the first motion data of the electronic device at the first frequency, wherein the first frequency is greater than the third frequency. For example, the third frequency may be 50 Hz, and the first frequency may be 500 Hz.
[0030] Although the frequency of collecting motion data is increased to the first frequency, this operation can be completed in the low-power mode of the sensor coprocessor. The sensor coprocessor is a piece of hardware specially designed to process sensor data. It can run in low-power mode and does not consume too much power even when working at a high frequency. The sensor coprocessor is optimized for such tasks and can collect data more efficiently than the main processor for the same task.
[0031] S102, determining second motion data from the first motion data according to a second frequency, where the second frequency is a screen refresh rate of the electronic device, and the second frequency is less than the first frequency;
[0032] In this embodiment, since the first application requires real-time motion data, the electronic device system will filter the first motion data according to a lower second frequency based on the first motion data collected at a higher first frequency. This second frequency is the same as the device refresh rate of the electronic device, and since the screen refresh rate is the same as the number of display pages generated per second by the first application, it is ensured that the frequency of data processing and output is synchronized with the screen refresh rate.
[0033] For example, after the sensor coprocessor collects the first motion data at the first frequency, the second motion data can be filtered according to the second frequency and reported to the application engine, and the application engine generates a display page of the first application based on the reported second motion data. The second frequency can be 60 Hz and the first frequency can be 500 Hz.
[0034] In this way, the sensor coprocessor can accurately capture more first motion data at a high frequency, and then filter out the required second motion data by reducing the frequency and report it to the application engine, thereby reducing the burden of data transmission and ensuring the accuracy of the data received by the application engine.
[0035] S103: Process the page of the first application according to the second motion data.
[0036] In the embodiment of the present application, the second motion data may be gyroscope data, that is, the angular velocity value of the electronic device in three-dimensional space, that is, the speed at which the electronic device rotates around its axis. The electronic device may calculate the content of the display page based on the second motion data and draw a corresponding game page.
[0037] For example, the first application is a game application. Based on the second motion data, the movement information of the game character in the game application can be calculated, and according to the movement information, the game engine can dynamically adjust the position and direction of the game character or the camera to generate the latest display page.
[0038] In the present application, when the first application is running, the first motion data of the electronic device can be obtained at a first frequency; the second motion data can be determined from the first motion data according to a second frequency, the second frequency is equal to the screen refresh rate of the electronic device, and the second frequency is less than the first frequency; the display page of the first application is generated according to the second motion data. In this way, the motion data can be collected at a higher first frequency, so that more detailed and continuous motion information can be obtained, and then the second motion frequency can be selected from the first motion data at a second frequency that is the same as the screen refresh rate to generate a display page, which can allow the system to select appropriate second motion data from the continuous motion information to draw the display page. Since the second motion data is selected from the high-frequency first motion data, the real-time and accuracy of the second motion data are relatively high, and it can more accurately reflect the real-time actions of the user, thereby significantly reducing the delay in page updates.
[0039] In some embodiments, S102 includes:
[0040] Among N first motion data collected at the first frequency within a first time period after a first drawing moment, second motion data corresponding to a second page is determined according to the collection time of each first motion data; wherein the first drawing moment is a drawing moment of the first page, the second page is any display page of the first application, the first page is a display page previous to the second page, and the first time period and the second frequency are reciprocals of each other;
[0041] The above S103 includes:
[0042] The second page is generated according to the second motion data corresponding to the second page.
[0043] In this embodiment, the second page is any display page in the first application. Taking the second page processing process as an example, after drawing the first drawing moment of the first page, the sensor coprocessor can collect N first motion data within the first time length according to the first frequency, and then filter the N first motion data according to the collection moment of each first motion data to obtain the second motion data, and report the second motion data to the application engine, which generates the second page based on the second motion data.
[0044] Since the first duration and the second frequency are reciprocals of each other, within the first duration, data is screened and reported once from the N collected first motion data, and a display page is generated, which can ensure that the motion data is screened and the display page is generated at the second frequency.
[0045] In this embodiment, the frequency of motion data collection and processing can be precisely controlled to capture the first motion data at a higher frequency, and then the required second motion data can be filtered out by frequency reduction and reported to the application engine for drawing the display page, so that the first application can update the display page more smoothly while reducing power consumption.
[0046] In some embodiments, the method is applied to an electronic device, the electronic device comprising a sensor coprocessor and a sensor service module;
[0047] The determining the second motion data corresponding to the second page according to the collection time of each first motion data includes:
[0048] When the sensor service module detects a vertical synchronization signal for the first time after the first drawing time, acquiring a first time at which the vertical synchronization signal is detected, and sending the first time to the sensor coprocessor;
[0049] The sensor coprocessor determines a second time point a first time length after the first time point;
[0050] The sensor coprocessor determines the P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection moments of the P first motion data among the N first motion data are closest to the second moment, and P is a positive integer less than or equal to N.
[0051] In this embodiment, the vertical synchronization signal (VSYNC) is used to indicate when the display screen of the electronic device starts a new refresh cycle to ensure that the update of the image data used to generate the display page is synchronized with the refresh rate of the display, thereby avoiding page tearing; its generation frequency is the same as the screen refresh rate.
[0052] Although the screen refresh rate is fixed, in theory the time interval between the drawing times of adjacent display pages should be certain. However, due to problems such as excessive processor load, system resource competition, or high complexity of graphics rendering, the time interval between the drawing times is unstable, and it is impossible to accurately know the drawing time of the next frame of the display page based on the drawing time of the previous frame of the display page.
[0053] For example, when the screen refresh rate is 60Hz, the drawing time of two adjacent display pages should be 16.67 milliseconds apart in theory. However, due to problems such as excessive processor load, system resource competition, or high graphics rendering complexity, the time interval between drawing times may be between 15ms and 20ms, and it is impossible to accurately know the drawing time of the next display page.
[0054] Since the generation frequency of the vertical synchronization signal is also the second frequency, the vertical synchronization signal instructs the screen to start a new refresh cycle. Therefore, the drawing time of the next frame display page can be predicted based on the vertical synchronization signal, thereby ensuring the synchronization of image rendering and screen refresh, avoiding page tearing and delay.
[0055] Specifically, the sensor service module can monitor the vertical synchronization signal on the application engine in real time. When the sensor service module detects the vertical synchronization signal for the first time after the first drawing moment, the vertical synchronization signal can be transmitted to the sensor coprocessor, or the vertical synchronization signal can be connected to the interrupt pin of the sensor coprocessor through hardware, so that the sensor coprocessor can receive the first moment when the vertical synchronization signal is detected; the sensor coprocessor waits for a first time period after the first moment to estimate the second moment for drawing the second page, and filters the P first motion data closest to the second moment as the second motion data corresponding to the second page and reports them to the sensor framework layer at one time. When the second page needs to be drawn, the application engine will obtain the P second motion data from the sensor framework layer and generate the second page based on the P second motion data.
[0056] In the above manner, the drawing time of the next display page is estimated based on the vertical synchronization signal, and the second motion data collected closest to the drawing time is selected for reporting, which can ensure that the display page is highly synchronized with the user's actual operation, greatly improving the responsiveness and interactive experience of the application.
[0057] In some embodiments, the method further comprises: determining a second time period after the first time and before the second time period;
[0058] Get the historical drawing time of multiple historical display pages and the historical generation time of historical vertical synchronization signals;
[0059] Determine a plurality of time differences between a plurality of historical drawing moments and their corresponding historical generation moments, and determine the first duration according to the plurality of time differences;
[0060] Determine a first difference between a maximum time difference and a minimum time difference among the plurality of time differences;
[0061] The P is determined according to the first difference and the first frequency.
[0062] In this embodiment, the historical display page is a display page that has been displayed before the first page, each historical display page corresponds to a historical drawing moment, the historical vertical synchronization signal is a vertical synchronization signal generated before the current moment, each vertical synchronization signal corresponds to a historical generation moment, and the historical drawing moment of a historical display page can be predicted based on each historical vertical synchronization signal, so the historical vertical synchronization signal and the historical display page have a one-to-one correspondence. The first duration and the value of P can be determined based on the historical drawing moment and the historical generation moment.
[0063] Specifically, the time difference between each historical drawing moment and the historical generation moment of the corresponding historical vertical synchronization signal can be determined. Then, the first duration is determined based on these time differences. Since the first duration is used to help estimate the moment of displaying the page in the future, so as to obtain the motion data more accurately, the minimum time difference among the multiple time differences can be determined as the first duration, and the difference between the minimum time difference and the first value can also be determined as the first duration.
[0064] For example, the range of multiple time differences can be 3ms-13ms, then the maximum time difference is 13ms, the minimum time difference can be 3ms, and the first value can be 1. The first duration can be set to 3ms, or (3-1)=2ms. In this way, the second motion data is reported at the minimum time difference after the drawing moment or before the minimum time difference, which can ensure that the reported second motion data can be received before the drawing moment of each display page, and the collection moment of the second motion data is very close to the drawing moment of the display page.
[0065] In addition, after determining the maximum time difference and the minimum time difference, the value of P can also be determined based on the maximum time difference and the minimum time difference. Specifically, a first difference value of the maximum time difference minus the minimum time difference can be determined, and then a first number of motion data that can be collected at a first frequency within a time range of the first difference can be determined as P, or the sum of the first number and a preset second number can be determined as P.
[0066] For example, the maximum time difference is 13ms, the minimum time difference can be 3ms, the second value can be 2, and the first frequency is 500hz. Then, the first difference is 10, and the first number of motion data collected at most within 10ms at the first frequency is 5 motion data. Therefore, P can be determined as 5, or P can be determined as 7.
[0067] By determining the first duration and P in the above manner, it can be ensured that the reported second motion data can be received before the drawing time of each display page, and the first motion data whose collection time is closest to the drawing time of the display page can be filtered as the second motion data.
[0068] In some embodiments, the method is applied to an electronic device, the electronic device comprising a sensor coprocessor and an application engine of the first application;
[0069] The determining the second motion data corresponding to the second page according to the collection time of each first motion data includes:
[0070] The sensor coprocessor receives a second drawing time of the second page sent by the first application;
[0071] The sensor coprocessor determines the third motion data as the second motion data corresponding to the second page before the second drawing time, wherein the collection time of the third motion data is closest to the second drawing time among the N first motion data.
[0072] In this embodiment, whenever the application engine of the first application wants to draw the display page, it can directly notify the sensor coprocessor of the drawing time. Then the sensor coprocessor can immediately determine the first motion data most recently collected before the current moment as the second motion data, and report it to the sensor framework layer, so as to ensure that the display page can be drawn based on the most recently collected motion data.
[0073] Through the above method, visual dislocation and delay can be reduced by ensuring that the rendered page is synchronized with the actual device movement.
[0074] In some embodiments, the method is applied to an electronic device, the electronic device includes a sensor coprocessor, and when a first application is running, first motion data of the electronic device is acquired at a first frequency, including:
[0075] When the first application is running, the sensor coprocessor receives a motion data request, where the motion data request is used to instruct to obtain motion data of the electronic device at a third frequency;
[0076] The sensor coprocessor modifies the third frequency to the first frequency, wherein the third frequency is less than the first frequency;
[0077] Acquire first motion data of the electronic device at the first frequency.
[0078] In this embodiment, the motion data request refers to an instruction sent by the first application to the sensor coprocessor, requiring the sensor coprocessor to obtain the motion data of the electronic device at a specific third frequency. However, since the third frequency may not be sufficient to provide a sufficient motion data update frequency for the first application with high real-time requirements, the sensor coprocessor will force the third frequency in the instruction to be modified to the first frequency, and obtain the first motion data of the electronic device at the first frequency, wherein the first frequency is greater than the third frequency.
[0079] For example, the third frequency may be 50 Hz, the first frequency may be 500 Hz, and the first application may be a game application. When the user enters the game application, the game application first sends a 50 Hz motion data request to the system. This request is passed layer by layer through the sensor framework and finally reaches the sensor coprocessor driver. At this time, the sensor coprocessor will force the frequency of 50 Hz to be changed to 500 Hz, so that the system can collect motion data at a frequency of 500 Hz.
[0080] In this way, by increasing the sampling frequency through the sensor coprocessor, more detailed and continuous motion data can be obtained, thereby improving the real-time and accuracy of the response of the electronic device.
[0081] Figure 2 is a schematic diagram of the structure of a page processing device provided by another embodiment of the present application. Figure 2 As shown, the page processing device may include:
[0082] The acquisition module 201 is used to acquire first motion data of the electronic device at a first frequency when the first application is running;
[0083] A first determining module 202, configured to determine second motion data from the first motion data according to a second frequency, wherein the second frequency is equal to a screen refresh rate of the electronic device and is less than the first frequency;
[0084] The generating module 203 is used to process the page of the first application according to the second motion data.
[0085] In the present application, when the first application is running, the first motion data of the electronic device can be obtained at a first frequency; the second motion data can be determined from the first motion data according to a second frequency, the second frequency is equal to the screen refresh rate of the electronic device, and the second frequency is less than the first frequency; the display page of the first application is generated according to the second motion data. In this way, the motion data can be collected at a higher first frequency, so that more detailed and continuous motion information can be obtained, and then the second motion frequency can be selected from the first motion data at a second frequency that is the same as the screen refresh rate to generate a display page, which can allow the system to select appropriate second motion data from the continuous motion information to draw the display page. Since the second motion data is selected from the high-frequency first motion data, the real-time and accuracy of the second motion data are relatively high, and it can more accurately reflect the real-time actions of the user, thereby significantly reducing the delay in page updates.
[0086] In another optional example, the first determining module 202 includes:
[0087] a determining unit, configured to determine, from N first motion data collected at the first frequency within a first time period after a first drawing time, second motion data corresponding to a second page according to a collection time of each first motion data; wherein the first drawing time period is a drawing time of the first page, the second page is any display page of the first application, the first page is a display page previous to the second page, and the first time period and the second frequency are reciprocals of each other;
[0088] The generating module 203 comprises:
[0089] A generating unit is configured to generate the second page according to second motion data corresponding to the second page.
[0090] In another optional example, the electronic device includes a sensor coprocessor and a sensor service module; the determining unit includes:
[0091] A first acquisition subunit is used for acquiring a first time when the vertical synchronization signal is detected by the sensor service module for the first time after the first drawing time, and sending the first time to the sensor coprocessor;
[0092] A first determining subunit, configured for the sensor coprocessor to determine a second moment of a first time length after the first moment;
[0093] The second determination subunit is used for the sensor coprocessor to determine the P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection time of the P first motion data among the N first motion data is closest to the second moment, and P is a positive integer less than or equal to N.
[0094] In another optional example, the device further includes:
[0095] An acquisition module, used to acquire the historical drawing moments of multiple historical display pages and the historical generation moments of historical vertical synchronization signals;
[0096] A second determination module is used to determine a plurality of time differences between a plurality of historical drawing moments and their corresponding historical generation moments, and determine the first duration according to the plurality of time differences;
[0097] A third determining module, configured to determine a first difference between a maximum time difference and a minimum time difference among the multiple time differences;
[0098] A fourth determination module is used to determine the P according to the first difference and the first frequency.
[0099] In another optional example, the electronic device includes a sensor coprocessor and an application engine of the first application; and the determining unit includes:
[0100] A first acquisition subunit is used for acquiring a first time when the vertical synchronization signal is detected by the sensor service module for the first time after the first drawing time, and sending the first time to the sensor coprocessor;
[0101] A first determining subunit, configured for the sensor coprocessor to determine a second moment of a first time length after the first moment;
[0102] The second determination subunit is used for the sensor coprocessor to determine the P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection time of the P first motion data among the N first motion data is closest to the second moment, and P is a positive integer less than or equal to N.
[0103] In another optional example, the electronic device includes a sensor coprocessor; the generating module 203 further includes:
[0104] a receiving unit, configured to, when the first application is running, receive, by the sensor coprocessor, a motion data request, wherein the motion data request is used to instruct to obtain the motion data of the electronic device at a third frequency;
[0105] a modifying unit, configured for the sensor coprocessor to modify the third frequency to the first frequency, wherein the third frequency is less than the first frequency;
[0106] An acquiring unit is used to acquire first motion data of the electronic device at the first frequency.
[0107] The page processing device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtual reality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0108] The page processing device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an IOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0109] The page processing device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0110] Alternatively, if Figure 3As shown, an embodiment of the present application also provides an electronic device 100, including a processor 110, a memory 119, and a program or instruction stored in the memory 119 and executable on the processor 110. When the program or instruction is executed by the processor 110, each process of the above-mentioned page processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0111] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0112] Please refer to Figure 4 , Figure 4 The hardware structure diagram of an electronic device for implementing an embodiment of the present application is shown in FIG. The electronic device 100 includes, but is not limited to, a radio frequency unit 121, a network module 122, an audio output unit 123, an input unit 124, a sensor 125, a display unit 126, a user input unit 127, an interface unit 128, a memory 129, and a processor 120.
[0113] Those skilled in the art will appreciate that the electronic device 100 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 120 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0114] The processor 120 is configured to obtain first motion data of the electronic device at a first frequency when the first application is running;
[0115] The processor 120 is configured to determine second motion data from the first motion data according to a second frequency, where the second frequency is equal to a screen refresh rate of the electronic device and is less than the first frequency;
[0116] The processor 120 is configured to process the page of the first application according to the second motion data.
[0117] In the present application, when the first application is running, the first motion data of the electronic device can be obtained at a first frequency; the second motion data can be determined from the first motion data according to a second frequency, the second frequency is equal to the screen refresh rate of the electronic device, and the second frequency is less than the first frequency; the display page of the first application is generated according to the second motion data. In this way, the motion data can be collected at a higher first frequency, so that more detailed and continuous motion information can be obtained, and then the second motion frequency can be selected from the first motion data at a second frequency that is the same as the screen refresh rate to generate a display page, which can allow the system to select appropriate second motion data from the continuous motion information to draw the display page. Since the second motion data is selected from the high-frequency first motion data, the real-time and accuracy of the second motion data are relatively high, and it can more accurately reflect the real-time actions of the user, thereby significantly reducing the delay in page updates.
[0118] In another optional example, the processor 120 is further configured to:
[0119] Among N first motion data collected at the first frequency within a first time period after a first drawing moment, second motion data corresponding to a second page is determined according to the collection time of each first motion data; wherein the first drawing moment is a drawing moment of the first page, the second page is any display page of the first application, the first page is a display page previous to the second page, and the first time period and the second frequency are reciprocals of each other;
[0120] The second page is generated according to the second motion data corresponding to the second page.
[0121] In another optional example, the electronic device includes a sensor coprocessor and a sensor service module; the processor 120 is further configured to:
[0122] When the sensor service module detects a vertical synchronization signal for the first time after the first drawing time, acquiring a first time at which the vertical synchronization signal is detected, and sending the first time to the sensor coprocessor;
[0123] The sensor coprocessor determines a second time instant a first time length after the first time instant;
[0124] The sensor coprocessor determines P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection moments of the P first motion data among the N first motion data are closest to the second moment, and P is a positive integer less than or equal to N.
[0125] In another optional example, the processor 120 is further configured to:
[0126] Get the historical drawing time of multiple historical display pages and the historical generation time of historical vertical synchronization signals;
[0127] used to determine a plurality of time differences between a plurality of historical drawing moments and their corresponding historical generation moments, and determine the first duration according to the plurality of time differences;
[0128] Determine a first difference between a maximum time difference and a minimum time difference among the plurality of time differences;
[0129] The P is determined according to the first difference and the first frequency.
[0130] In another optional example, the processor 120 is further configured to:
[0131] The sensor coprocessor receives a second drawing time of the second page sent by the first application;
[0132] The sensor coprocessor determines the third motion data as the second motion data corresponding to the second page before the second drawing time, wherein the collection time of the third motion data is closest to the second drawing time among the N first motion data.
[0133] In another optional example, the processor 120 is further configured to:
[0134] When the first application is running, the sensor coprocessor receives a motion data request, where the motion data request is used to instruct to obtain motion data of the electronic device at a third frequency;
[0135] The sensor coprocessor modifies the third frequency to the first frequency, wherein the third frequency is less than the first frequency;
[0136] Acquire first motion data of the electronic device at the first frequency.
[0137] It should be understood that in the embodiment of the present application, the input unit 124 may include a graphics processor (Graphics Processing Unit, GPU) 1241 and a microphone 1242, and the graphics processor 1241 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 126 may include a display panel 1261, and the display panel 1261 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 127 includes a touch panel 1271 and at least one of other input devices 1272. The touch panel 1271 is also called a touch screen. The touch panel 1271 may include two parts: a touch detection device and a touch controller. Other input devices 1272 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here.
[0138] The memory 129 can be used to store software programs and various data. The memory 129 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, an image playback function, etc.), etc. In addition, the memory 129 may include a volatile memory or a non-volatile memory, or the memory 129 may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDRSDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synchronous link dynamic random access memory (SLDRAM) and a direct memory bus random access memory (DRRAM). The memory 129 in the embodiment of the present application includes but is not limited to these and any other suitable types of memory.
[0139] The processor 120 may include one or more processing units; optionally, the processor 120 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 120.
[0140] The embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned page processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0141] The processor is the processor in the electronic device in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0142] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned page processing method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0143] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0144] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned page processing method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0145] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0146] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0147] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A page processing method, characterized in that: include: When the first application is running, obtaining first motion data of the electronic device at a first frequency; Determine second motion data from the first motion data according to a second frequency, where the second frequency is a screen refresh rate of the electronic device, and the second frequency is less than the first frequency; Process the page of the first application according to the second motion data.
2. The method according to claim 1, characterized in that The determining the second motion data from the first motion data according to the second frequency includes: Among N first motion data collected at the first frequency within a first time period after a first drawing moment, second motion data corresponding to a second page is determined according to the collection time of each first motion data; wherein the first drawing moment is a drawing moment of the first page, the second page is any display page of the first application, the first page is a display page previous to the second page, and the first time period and the second frequency are reciprocals of each other; Processing the page of the first application according to the second motion data includes: The second page is generated according to the second motion data corresponding to the second page.
3. The method according to claim 2, characterized in that The method is applied to an electronic device, the electronic device comprising a sensor coprocessor and a sensor service module; The determining the second motion data corresponding to the second page according to the collection time of each first motion data includes: When the sensor service module detects a vertical synchronization signal for the first time after the first drawing time, acquiring a first time at which the vertical synchronization signal is detected, and sending the first time to the sensor coprocessor; The sensor coprocessor determines a second time instant a first time length after the first time instant; The sensor coprocessor determines the P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection moments of the P first motion data among the N first motion data are closest to the second moment, and P is a positive integer less than or equal to N.
4. The method according to claim 3, characterized in that The determining of a second moment of a first duration after the first moment and before the second moment, the method further comprises: Get the historical drawing time of multiple historical display pages and the historical generation time of historical vertical synchronization signals; Determine a plurality of time differences between a plurality of historical drawing moments and their corresponding historical generation moments, and determine the first duration according to the plurality of time differences; Determine a first difference between a maximum time difference and a minimum time difference among the plurality of time differences; The P is determined according to the first difference and the first frequency.
5. The method according to claim 2, characterized in that: The method is applied to an electronic device, the electronic device comprising a sensor coprocessor; The determining the second motion data corresponding to the second page according to the collection time of each first motion data includes: The sensor coprocessor receives a second drawing time of the second page sent by the first application; The sensor coprocessor determines the third motion data as the second motion data corresponding to the second page before the second drawing time, wherein the collection time of the third motion data is closest to the second drawing time among the N first motion data.
6. The method according to claim 1, characterized in that The method is applied to an electronic device, the electronic device includes a sensor coprocessor, and when a first application is running, first motion data of the electronic device is acquired at a first frequency, including: When the first application is running, the sensor coprocessor receives a motion data request, where the motion data request is used to instruct to obtain motion data of the electronic device at a third frequency; The sensor coprocessor modifies the third frequency to the first frequency, wherein the third frequency is less than the first frequency; Acquire first motion data of the electronic device at the first frequency.
7. A page processing device, characterized in that: include: A collection module, used for acquiring first motion data of the electronic device at a first frequency when a first application is running; A first determining module, configured to determine second motion data from the first motion data according to a second frequency, where the second frequency is a screen refresh rate of the electronic device, and the second frequency is less than the first frequency; A generation module is used to process the page of the first application according to the second motion data.
8. The device according to claim 7, characterized in that The first determining module comprises: a determining unit, configured to determine, from N first motion data collected at the first frequency within a first time period after a first drawing time, second motion data corresponding to a second page according to a collection time of each first motion data; wherein the first drawing time period is a drawing time of the first page, the second page is any display page of the first application, the first page is a display page previous to the second page, and the first time period and the second frequency are reciprocals of each other; The generation module comprises: A generating unit is configured to generate the second page according to second motion data corresponding to the second page.
9. The device according to claim 8, characterized in that The electronic device includes a sensor coprocessor and a sensor service module; the determining unit includes: A first acquisition subunit is used for acquiring a first time when the vertical synchronization signal is detected by the sensor service module for the first time after the first drawing time, and sending the first time to the sensor coprocessor; A first determining subunit, configured for the sensor coprocessor to determine a second moment of a first time length after the first moment; The second determination subunit is used for the sensor coprocessor to determine the P first motion data after the second moment as the second motion data corresponding to the second page, wherein the collection time of the P first motion data among the N first motion data is closest to the second moment, and P is a positive integer less than or equal to N.
10. The device according to claim 9, characterized in that The device also includes: An acquisition module, used to acquire the historical drawing moments of multiple historical display pages and the historical generation moments of historical vertical synchronization signals; A second determination module is used to determine a plurality of time differences between a plurality of historical drawing moments and their corresponding historical generation moments, and determine the first duration according to the plurality of time differences; A third determining module, configured to determine a first difference between a maximum time difference and a minimum time difference among the multiple time differences; A fourth determination module is used to determine the P according to the first difference and the first frequency.
11. The device according to claim 8, characterized in that The electronic device includes a sensor coprocessor and an application engine of the first application; the determining unit includes: A receiving subunit, configured for the sensor coprocessor to receive a second drawing time of the second page sent by the first application; The third determining subunit is used for the sensor coprocessor to determine the third motion data as the second motion data corresponding to the second page before the second drawing time, wherein the collection time of the third motion data is closest to the second drawing time among the N first motion data.
12. The device according to claim 7, characterized in that The electronic device includes a sensor coprocessor; the generating module also includes: a receiving unit, configured to, when the first application is running, receive, by the sensor coprocessor, a motion data request, wherein the motion data request is used to instruct to obtain the motion data of the electronic device at a third frequency; a modifying unit, configured for the sensor coprocessor to modify the third frequency to the first frequency, wherein the third frequency is less than the first frequency; An acquiring unit is used to acquire first motion data of the electronic device at the first frequency.
13. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the page processing method according to any one of claims 1 to 6 are implemented.