Data processing method, electronic device, readable medium and program product
By adjusting the ratio of touch sampling rate to screen refresh rate, and employing frame deletion or skipping and interpolation techniques, the problem of high power consumption under high touch sampling rate was solved, achieving the effect of reducing power consumption of electronic devices while maintaining a responsive experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-10-25
- Publication Date
- 2026-04-17
AI Technical Summary
The problem of high power consumption in electronic devices with high touch sampling rates, especially in scenarios with frequent touch operations, is that existing technologies struggle to effectively reduce power consumption while maintaining a responsive user experience.
By adjusting the ratio of touch sampling rate to screen refresh rate, the amount of raw capacitance data processing is reduced. Preprocessing, feature extraction, and coordinate transformation are performed after deletion or frame skipping, combined with interpolation to generate touch event coordinates, thereby reducing data processing and power consumption.
Without compromising the accuracy of touch position recognition, it reduces the computational resources consumed by electronic devices, lowers device power consumption, and maintains a good responsiveness experience.
Smart Images

Figure CN121889760A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of terminal technology, and more specifically to a data processing method, electronic device, readable medium, and program product. Background Technology
[0002] The touch sampling rate of an electronic device's screen refers to the number of times the touch panel (TP) that makes up the screen can collect touch point capacitance data per unit time. It characterizes the touch panel's speed of recognizing changes in the position of a finger or stylus. Within a certain range, a higher touch sampling rate results in a better responsiveness and user experience, but also higher power consumption. This is because a higher touch sampling rate means the touch panel collects more raw capacitance signals per unit time, resulting in a larger amount of raw capacitance data and thus a larger data volume.
[0003] However, the larger the amount of data processing involved in calculating the original capacitance data to obtain the coordinates of the reporting point, the more computing resources are consumed, and the higher the power consumption of the electronic device will be. Summary of the Invention
[0004] This application provides a data processing method, electronic device, readable medium, and program product that can reduce the amount of processing and calculation required to process raw capacitance data into data such as point coordinates, thereby saving computing resources, reducing device power consumption, and maintaining the accuracy of touch events determined based on touch event coordinates.
[0005] In a first aspect, this application provides a data processing method applied to an electronic device, the electronic device including a screen. The method includes: displaying first image data of a first application on the screen; receiving a touch operation applied to the screen; acquiring first capacitance data corresponding to the touch operation, wherein the first capacitance data corresponds to a first frequency; acquiring second capacitance data corresponding to the first capacitance data, wherein the second capacitance data corresponds to a second frequency, the second frequency being lower than the first frequency; acquiring reporting point coordinate data corresponding to the second capacitance data, wherein the reporting point coordinate data corresponds to the second frequency; acquiring first touch event coordinate data corresponding to the reporting point coordinate data, wherein the first touch event coordinate data corresponds to the second frequency; acquiring second touch event coordinate data corresponding to the first touch event coordinate data, wherein the second touch event coordinate data corresponds to the first frequency; and sending the second touch event coordinate data to the first application.
[0006] For example, the aforementioned electronic device can be a mobile phone, tablet computer, or other electronic device with a touch-operable screen. This screen can be integrated with a touchscreen and a display screen, or with a touch sensor and a display screen, providing both touch operation and display functions; no limitation is made here. The aforementioned first application can be an application with fast-changing screens or high user operation frequency, such as a game application or a video application, or an application with slow-changing screens and low user operation frequency, such as a browser application. Correspondingly, the first image data of the aforementioned first application can include image data corresponding to the game screen, non-game screen, video playback screen, or non-video playback screen. The aforementioned touch operation can be, for example, a click or swipe on the aforementioned game screen, non-game screen, video playback screen, or non-video playback screen.
[0007] In response to the aforementioned touch operation, the operating system of the electronic device can control the screen to sample the touch capacitance signal (i.e., the original capacitance signal) to collect capacitance data (i.e., the original capacitance data). Specifically, the screen can collect the original capacitance data based on a higher touch sampling rate set according to the corresponding screen refresh rate, i.e., obtain the aforementioned first capacitance data. The first frequency at which the screen reports this first capacitance data corresponds to the touch sampling rate. This first frequency can be relatively high, correspondingly resulting in a larger number of first capacitance data points collected and reported by the screen within a preset time period, such as the first number mentioned below. Furthermore, the electronic device can control the reduction of the first capacitance data volume during or before further processing after reporting, i.e., processing the first capacitance data into second capacitance data corresponding to a second frequency. This second capacitance data corresponds to a lower second frequency, resulting in a smaller number of second capacitance data points reported within a preset time period, such as the second number mentioned below. In this way, the operating system of the electronic device can then process and obtain the reporting point coordinate data, the first touch event coordinate data, etc., based on the second capacitance data processed above, thereby reducing the amount of data processing on the original capacitance data, saving computing resources, and reducing device power consumption.
[0008] Meanwhile, in order to maintain the accuracy of the touch events determined based on the touch event coordinates, the first touch event coordinate data obtained above can be interpolated to obtain the second touch event coordinate data. The processed second touch event coordinate data is then sent to the application process of the first application to be processed into the corresponding touch event for touch response.
[0009] Therefore, based on the data processing method provided in the first aspect above, the amount of data processing for the original capacitance data (such as the first capacitance data mentioned above) collected from the screen can be reduced without affecting the accuracy of the touch position recognition, thereby saving the computing resources of electronic devices and reducing device power consumption.
[0010] In one possible implementation of the first aspect above, the method further includes: the electronic device includes a first thread; and obtaining the first capacitance data corresponding to the touch operation includes: obtaining the first capacitance data corresponding to the touch operation through the first thread.
[0011] In one possible implementation of the first aspect described above, the first thread is a thread used to report interruptions.
[0012] For example, the first thread mentioned above can be an interrupt thread, which can be the main thread used to report interrupts, such as the irq-thp main thread, or the irq-thp thread or irq-XXX thread, i.e., the interrupt touchpanel thread.
[0013] In one possible implementation of the first aspect above, the electronic device includes a second thread, which is different from the first thread, and obtaining the second capacitance data corresponding to the first capacitance data includes: obtaining the second capacitance data corresponding to the first capacitance data through the second thread.
[0014] In one possible implementation of the first aspect above, obtaining the reporting point coordinate data corresponding to the second capacity data includes: obtaining the reporting point coordinate data corresponding to the second capacity data through a second thread.
[0015] In one possible implementation of the first aspect described above, the second thread is a thread used to report the coordinate data of the reporting point.
[0016] For example, the second thread mentioned above can be a point reporting data reporting thread. This thread can be a thread in the daemon process used to perform the task of reporting point data, such as the aptouch_daemon thread or the XXX_daemon thread, without any restrictions.
[0017] In one possible implementation of the first aspect above, obtaining the second capacitance data corresponding to the first capacitance data includes: obtaining the first capacitance data through a second thread at a first moment; obtaining the interrupt reported by the first thread through the second thread at a second moment, and deleting the first capacitance data obtained at the second moment based on the interrupt; and obtaining the first capacitance data through the second thread at a third moment; wherein the first moment and the second moment are adjacent moments corresponding to the first frequency, and the first moment and the third moment are adjacent moments corresponding to the second frequency.
[0018] For example, the aforementioned second capacitance data can be obtained by deleting a portion of the collected first capacitance data. This deletion can be performed at the moment of reporting interruption, such as the aforementioned second moment. Specifically, of the first capacitance data reported from the first to the third moment, the first capacitance data reported at the second moment can be deleted, thus reducing the amount of data corresponding to the second capacitance data after processing.
[0019] In one possible implementation of the first aspect above, obtaining the second capacitance data corresponding to the first capacitance data includes: obtaining the first capacitance data through a second thread at a first moment; obtaining the interrupt reported by the first thread through the second thread at a second moment, and not obtaining the first capacitance data sent to the second thread at the second moment based on the interrupt; and obtaining the first capacitance data through the second thread at a third moment; wherein the first moment and the second moment are adjacent moments corresponding to the first frequency, and the first moment and the third moment are adjacent moments corresponding to the second frequency.
[0020] For example, the aforementioned second capacitance data can be obtained by performing frame skipping processing on a portion of the collected first capacitance data. The timing of this frame skipping processing can correspond to the moment of interruption reporting, such as the aforementioned second moment. Specifically, in the first capacitance data reported from the first to the third moment, the second thread of the electronic device can skip the signal corresponding to the first capacitance data reported at the second moment (i.e., frame skipping) and only receive the capacitance signals corresponding to the first capacitance data reported at the first and third moments. In this way, the amount of data corresponding to the first capacitance data after processing into second capacitance data can be reduced.
[0021] In one possible implementation of the first aspect above, the relationship between the first frequency and the second frequency includes: corresponding to a first frequency of 60Hz and a second frequency of 30Hz; corresponding to a first frequency of 120Hz and a second frequency of 60Hz; corresponding to a first frequency of 180Hz and a second frequency of 75Hz; corresponding to a first frequency of 240Hz and a second frequency of 120Hz; corresponding to a first frequency of 320Hz and a second frequency of 144Hz; and corresponding to a first frequency of 480Hz and a second frequency of 165Hz or 240Hz.
[0022] For example, the second frequency can be half of the first frequency, the first frequency can correspond to the touch sampling rate currently configured on the screen of the electronic device, and the second frequency can correspond to the screen refresh rate currently configured on the screen of the electronic device. Based on this, when the screen refresh rate decreases, for example from 60Hz to 30Hz, based on the data processing method provided in this application, the amount of raw capacitance data collected at a touch sampling rate of 60Hz can be reduced to half of the initial amount before processing, thereby saving computing resources and reducing power consumption of the electronic device. In other embodiments, the second frequency can be 1 / N of the first frequency, where N≥1. Based on this, the current screen refresh rate of the electronic device can also be any one of 60Hz, 75Hz, 120Hz, 144Hz, 165Hz, and 240Hz, and the corresponding second frequency can also be any one of these frequencies. The current touch sampling rate of the electronic device can be any of 120Hz, 180Hz, 240Hz, 320Hz, or 480Hz, and the first frequency can also be any of the above frequencies, without any restriction.
[0023] In one possible implementation of the first aspect above, the electronic device includes a third thread, and acquiring the first touch event coordinate data corresponding to the reporting point coordinate data includes: acquiring the first touch event coordinate data corresponding to the reporting point coordinate data through the third thread.
[0024] In one possible implementation of the first aspect above, the third thread includes an input event processing thread, an input event dispatch thread, and an input event publishing thread, and obtaining the first touch event coordinate data corresponding to the reported coordinate data includes: obtaining the first touch event coordinate data corresponding to the reported coordinate data sequentially through the input event processing thread, the input event dispatch thread, and the input event publishing thread.
[0025] In one possible implementation of the first aspect above, the electronic device includes a fourth thread, and obtaining the second touch event coordinate data corresponding to the first touch event coordinate data includes: obtaining the second touch event coordinate data corresponding to the first touch event coordinate data through the fourth thread.
[0026] In one possible implementation of the first aspect described above, the fourth thread includes an input event consuming thread, which generates a touch event based on second touch event coordinate data, the touch event being consumed by the first application.
[0027] In one possible implementation of the first aspect above, obtaining the second touch event coordinate data corresponding to the first touch event coordinate data includes: obtaining the first touch event coordinate data through a fourth thread, and performing an interpolation algorithm through the fourth thread to interpolate the first touch event coordinate data to obtain interpolated coordinate data; and adding the first touch event coordinate data and the interpolated coordinate data to the event queue through the fourth thread as the second touch event coordinate data.
[0028] For example, the threads controlled by various parts of the input subsystem in the operating system of an electronic device can perform interpolation processing on the acquired touch event coordinate data and then process it into touch events. Specifically, the input event processing (unit) can execute the aforementioned input event processing thread, the input event distribution (unit) can execute the aforementioned input event distribution thread, the input event publishing (unit) can execute the aforementioned input event publishing thread, and the input event consuming (unit) can execute the aforementioned input event consuming thread to implement the data processing method provided in this application.
[0029] In one possible implementation of the first aspect above, the electronic device includes a fifth thread, and sending the second touch event coordinate data to the first application includes: sending the second touch event coordinate data to the fifth thread, wherein the fifth thread is the main thread of the application process of the first application.
[0030] For example, the fifth thread mentioned above could be the android.Launcher main thread, or the main thread of another application process; there are no restrictions here.
[0031] In one possible implementation of the first aspect described above, after sending the second touch event coordinate data to the first application, the method further includes: calling the system user interface thread through the fifth thread to draw the image data corresponding to the second touch event coordinates. This system user interface thread can be a thread controlled by the System UI for performing drawing tasks, such as the UI thread.
[0032] In one possible implementation of the first aspect described above, after sending the second touch event coordinate data to the first application, the method further includes: calling a compositing service thread through a system user interface thread to render the image data corresponding to the completed second touch event coordinates; and calling a hardware compositor through the compositing service thread to composite the rendered image data corresponding to the second touch event coordinates to obtain the second image data of the first application; and calling a display driver through the hardware compositor to control the screen to display the second image data of the first application. This compositing service thread can be a thread controlled by the compositing service (SF) for performing rendering tasks.
[0033] For example, the second image data of the first application mentioned above can be image data of the touch response interface for the touch operation mentioned above.
[0034] In a second aspect, this application provides an electronic device, including: one or more processors; one or more memories; the one or more memories storing one or more programs, which, when executed by one or more processors, cause the electronic device to perform the data processing methods provided in the first aspect and various possible implementations of the first aspect.
[0035] Thirdly, this application provides a computer-readable medium storing instructions that, when executed on a computer, cause the computer to perform the data processing methods provided in the first aspect and various possible implementations of the first aspect.
[0036] Fourthly, this application provides a computer program product, a computer program / instruction, which, when executed by a processor, implements the data processing method provided in the first aspect and various possible implementations of the first aspect.
[0037] The beneficial effects of the second to fourth aspects mentioned above can be referred to the relevant descriptions in the first aspect and various possible implementations of the first aspect, which will not be repeated here. Attached Figure Description
[0038] Figure 1 The diagram shown is a schematic of a game interface display scenario to which a data processing method provided in this application is applicable.
[0039] Figure 2a The diagram illustrates a process of processing raw capacitance data into vertical synchronization signals (VSYNC) to trigger consumer touch event coordinates.
[0040] Figure 2b The diagram shown is a schematic of a process provided in this application embodiment of processing raw capacitance data into vertical synchronization signal (VSYNC) to trigger consumer touch event coordinates.
[0041] Figure 3 The diagram shown is a schematic diagram of the operating system software structure of an electronic device provided in an embodiment of this application.
[0042] Figure 4a The diagram shown is a partial illustration of the interactive implementation process of a data processing method provided in an embodiment of this application.
[0043] Figure 4b The diagram shown is another part of the interactive implementation flow of a data processing method provided in an embodiment of this application.
[0044] Figure 5 The diagram shown is a schematic representation of the implementation flow of another data processing method provided in this application embodiment.
[0045] Figure 6 The diagram shown is a schematic representation of another data processing method for identifying display scenes provided in this application.
[0046] Figure 7 The figure shown is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions in the embodiments of this application will be described in detail below with reference to the accompanying drawings and specific implementation methods.
[0048] It is understood that the electronic devices in the embodiments of this application may also be referred to as terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc. Electronic devices can be mobile phones, smart TVs, wearable devices, tablets, computers with wireless transceiver capabilities, virtual reality (VR) terminals, augmented reality (AR) terminals, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, and so on. The following description uses mobile phone 100 as an example.
[0049] Figure 1 A schematic diagram of a game interface display scenario to which a data processing method is applicable is shown.
[0050] like Figure 1 As shown, on the game interface 101 displayed on the mobile phone 100, the user can control the game character to fight by clicking the "Battle" button 102. The "rewards" and "experience" values generated during the game process can be continuously refreshed in area 103 of the game interface 101.
[0051] In the above Figure 1In the displayed scenario, the touchscreen of mobile phone 100 needs to continuously collect the touch point capacitance signal (hereinafter referred to as the raw capacitance signal) corresponding to the user's touch operation (such as the operation of clicking the "Battle" button 102 mentioned above), and calculate the reporting point coordinates, touch event coordinates, etc. based on the raw capacitance data provided by the raw capacitance signal, and then report the touch event to the game application. The reported touch events can include down events, up events, and move events, etc., and are not limited here.
[0052] Specifically, taking the touch sampling rate of mobile phone 100 as an example, which is 120Hz, refer to... Figure 2a For example, a mobile phone 100 can collect 15 frames of touch point capacitance signals within 125ms, for reference. Figure 2a The original capacitance signals S1 to S15 are shown. Further, the original capacitance data corresponding to the original capacitance signals S1 to S15 needs to undergo data preprocessing, feature extraction, coordinate transformation, and other processing operations to obtain the reporting point coordinates, such as P1 to P15. These reporting point coordinates can be further adjusted or calibrated to become the touch event coordinates used to determine touch events, such as T1 to T15.
[0053] Meanwhile, the screens of mobile phones and other electronic devices can periodically generate vertical sync signals (VSYNC) according to the set screen refresh rate, hereinafter referred to as hardware VSYNC, for example... Figure 2a The V shown h1 To V h7 The hardware VSYNC is captured by the compositing service (surface flinger, SF) and used to generate the application VSYNC, so that the application layer's drawing operations are synchronized with the hardware layer's display updates.
[0054] For example Figure 2a The V shown a1 To V a7Each frame of the application's VSYNC can trigger the system to generate a touch event based on the touch position determined by the aforementioned touch event coordinates, and report it to the game application for the game application to execute the event response. To improve the accuracy of the reported touch events, the system's input subsystem can obtain the coordinates of two adjacent touch events from the event queue to determine the touch position. The processing time of these two adjacent touch event coordinates can be adjacent to the generation time of the corresponding application's VSYNC. The input subsystem can then generate the corresponding touch event based on the determined touch position and report it. The game application, etc., can then, based on the reported touch event, call the thread controlled by the system user interface (System UI) (e.g., the UI thread) to control the rendering of the various display layers of the touch response interface corresponding to the touch event. It then calls the rendering thread controlled by the compositing service (SF) to render the rendered touch response interface's various display layers, and calls the hardware compositor to composite the rendered display layers to generate the touch response interface. Finally, in the hardware VSYNC, for example... Figure 2a The V shown h1 To V h7 When the display driver is activated, it controls the process of sending the synthesized touch response interface to the display screen, i.e., displaying the touch response interface on the display screen, such as the one described above. Figure 1 The game interface shown is 101.
[0055] It is understood that the screen of an electronic device can be a touchscreen covering a display screen and integrated with the display screen, or it can be composed of a touch sensor set on the display screen, in which case the screen is a touchscreen. The touchscreen can detect user touch operations. Taking a capacitive touchscreen as an example, the user's touch operation can cause a change in the capacitance value of the touchscreen surface. Based on this, the touchscreen can collect raw capacitance data by sampling the capacitance signal. The display screen can provide display functions, updating the images, videos, text, and other visual information sent by the system at a fixed screen refresh rate and displaying them to the user. In this embodiment, the touchscreen and the display screen can be collectively referred to as the screen. It is understood that the shorter the difference between the moment when the application VSYNC triggers the reporting of touch events to the game application and the moment when the hardware VSYNC triggers the display, the better the responsiveness of the mobile phone 100 will be. Therefore, in order to give the mobile phone 100 a good responsive experience, the touch sampling rate and screen refresh rate of the mobile phone 100 screen usually need to satisfy N:1, where N≥1.
[0056] Currently, in order to improve the responsiveness of some electronic devices with high screen refresh rates, the touch sampling rate of the electronic device is increased accordingly based on the ratio between the touch sampling rate and the screen refresh rate to match the changes in the screen refresh rate.
[0057] However, as mentioned earlier, increasing the touch sampling rate increases the power consumption of electronic devices. Therefore, to balance responsiveness and power consumption, in some common display scenarios, the ratio of touch sampling rate to screen refresh rate is configured as 2:1. This provides a better responsive experience while keeping power consumption low. For example, if the screen refresh rate is 60Hz, the touch sampling rate can be configured as 120Hz. In other display scenarios where users frequently use touch (such as gaming), the screen refresh rate is higher, and the corresponding touch sampling rate is also higher. In these scenarios, to ensure responsiveness, the ratio of touch sampling rate to screen refresh rate is configured as N:1, where N can be an integer greater than 2, such as N=4 or N=6, etc., without restriction. In some embodiments, the screen refresh rate may include any one of 30Hz, 60Hz, 75Hz, 120Hz, 144Hz, 165Hz, and 240Hz; the touch sampling rate may include any one of 120Hz, 180Hz, 240Hz, 320Hz, and 480Hz, wherein the touch sampling rate may be higher than the screen refresh rate, and there is no limitation herein.
[0058] As mentioned earlier, the higher the touch sampling rate, the larger the amount of raw capacitance data processed by the electronic device per unit time, the more computing resources are consumed, and the higher the power consumption of the electronic device.
[0059] To address the aforementioned issues, this application provides a data processing method. After acquiring the raw capacitance signal from the screen and before calculating the reporting coordinates based on the raw capacitance data provided by the raw capacitance signal, the method deletes or skips frames of the raw capacitance data that would otherwise be reported, based on the relationship between the screen refresh rate and the touch sampling rate, and then reports the processed raw capacitance data. Furthermore, the raw capacitance data undergoes preprocessing, feature extraction, and coordinate transformation to obtain the reporting coordinates and touch event coordinates. Finally, the method generates and reports the touch event, and displays the corresponding touch response interface. This reduces the computational workload of converting raw capacitance data into reporting coordinates, thereby saving computing resources and reducing device power consumption.
[0060] Meanwhile, in order to maintain the accuracy of the touch events determined based on the touch event coordinates, interpolation processing can be performed on the touch event coordinates obtained above to obtain touch event coordinate data that includes the touch event coordinates and the interpolated coordinates. The processed touch event coordinate data can be added to the event queue to determine the corresponding touch position and touch event.
[0061] The acquisition frequency of the original capacitance data before deletion or frame skipping can be a first frequency, corresponding to a first quantity of original capacitance data collected within a preset time. The acquisition frequency of the original capacitance data after deletion or frame skipping can be a second frequency, corresponding to a second quantity of original capacitance data successfully reported within a preset time. That is, the first quantity can correspond to the first frequency, which can be the reporting frequency of the original capacitance data or the frequency of receiving the reported original capacitance data. Based on this, the second quantity can correspond to a second frequency, which is less than the first frequency. In some embodiments, the second frequency can be half of the first frequency, and correspondingly, the second quantity can also be half of the first quantity.
[0062] For ease of description, the aforementioned first quantity of raw capacitance data can be described below as a first capacitance data set; correspondingly, the aforementioned second quantity of raw capacitance data can be described below as a second capacitance data set. It should be noted that the first capacitance data set and the second capacitance data set are merely illustrative descriptions of the corresponding quantities of capacitance data and do not constitute a limitation on the data integration form of the aforementioned first quantity and second quantity of raw capacitance data. In other words, the use of sets in this application does not imply that the data is first aggregated and then processed, but rather includes implementation scenarios such as real-time reporting of raw capacitance data collected at different times, and implementation scenarios such as caching raw capacitance data collected at different times and then reporting it sequentially in the form of a data stream according to the collection time. For example, in practical application scenarios, the aforementioned first quantity of raw capacitance data can be data reported (sent) frame by frame by the raw capacitance signals collected at each time; correspondingly, the second quantity of raw capacitance data reported after deletion processing can be raw capacitance data provided by raw capacitance signals reported in the order of collection time and through interval frame dropping. The aforementioned raw capacitance data can be capacitance array data collected from each touch unit grid of the touch panel, etc., and there are no restrictions on this.
[0063] Based on this, the above-mentioned deletion process of the first quantity of original capacitance data that originally needed to be reported, based on the relationship between the screen refresh rate and the touch sampling rate, can include the process of deleting data within the first capacitance data set to obtain a second capacitance data set. Specifically, the number of VSYNC events generated per unit time can be determined based on the screen refresh rate, and the amount of data to be deleted from the first capacitance data set, i.e., the optimization target, can be determined based on the number of VSYNC events generated per unit time. For example, the third quantity of original capacitance data to be deleted can be determined, and then the number of frames of the original capacitance signal corresponding to the original capacitance data that need to be spaced between the deleted original capacitance data can be determined. In some embodiments, the touch sampling rate and screen refresh rate of the screen usually need to satisfy N:1, and the third quantity can be (N-1) and should be an integer.
[0064] For example, if the ratio between the touch sampling rate and the screen refresh rate of an electronic device is 2:1, meaning the touch sampling rate is twice the screen refresh rate, then based on this ratio, it can be determined that 50% of the data in the first capacitance data set needs to be deleted. This means 50% of the original capacitance data in the first capacitance data set is deleted, resulting in a second capacitance data set. This second capacitance data set retains another portion of the original capacitance data that was not deleted. The preset time for obtaining the first quantity can be, for example, the time corresponding to sampling two consecutive frames of original capacitance signals. The first quantity is, for example, 2. The third quantity mentioned above can be 1, corresponding to a second quantity after deletion processing, for example, 2. This deletion processing method is the aforementioned interval frame dropping method. The deleted original capacitance data can be spaced one frame of original capacitance signal data between each frame. In other words, every two frames of original capacitance signals sampled can discard one frame and include another frame of original capacitance signal to provide the original capacitance data. Furthermore, the electronic device performs preprocessing, feature extraction, coordinate transformation, and other processing operations on the original capacitance data in the aforementioned second capacitance data set frame by frame, which can significantly reduce the amount of data processing computation.
[0065] It is understood that the rules followed in the above deletion process may include other ratios where the corresponding touch sampling rate is 2 times or more than 1 times the screen refresh rate, retaining the most recently acquired original capacitance data and discarding the original capacitance data provided by the previous frame's original capacitance signal. The most recently acquired time can correspond to the moment when the application VSYNC is received; for example, the most recently acquired time can be the same as or later than the moment the application VSYNC is received, without restriction.
[0066] refer to Figure 2bAs shown, taking an electronic device with a touch sampling rate of 120Hz and a screen refresh rate of 60Hz as an example, the thread used to report interrupts in the electronic device (referred to as the first thread), also known as the interrupt thread, can acquire the raw capacitance data (referred to as the first capacitance data) corresponding to the user's touch operation at a first frequency. This first frequency can correspond to the aforementioned touch sampling rate of 120Hz, meaning that a first amount of raw capacitance data can be acquired within a preset time. For example, the screen of this electronic device can acquire raw capacitance data provided by 15 frames of raw capacitance signals (e.g., S1 to S15) within 125ms. In some embodiments, the aforementioned first thread can be an IRQ-THP thread, i.e., an interrupt touch panel thread or an IRQ-XXX thread, without limitation.
[0067] Furthermore, the thread in the electronic device used to report point coordinate data (referred to as the second thread), also known as the point data reporting thread, can delete the first capacitance data acquired at certain times by dropping frames at intervals, or acquire the first capacitance data by skipping frames. The final acquired first capacitance data after deleting some data is, for example, the original capacitance data after deleting the original capacitance data provided by 7 frames of original capacitance signals (e.g., S2, S4, S6, S8, S10, S12, S14), that is, the original capacitance data provided by the remaining 8 frames of original capacitance signals (e.g., S1, S3, S5, S7, S9, S11, S13, S15), which is described below as the second capacitance data. At this time, the frequency at which the second thread acquires the second capacitance data can be referred to as the second frequency. In this embodiment, the second frequency can correspond to the screen refresh rate of 60Hz, that is, a second amount of original capacitance data can be acquired within a preset time.
[0068] In some embodiments, the second thread can be a thread within a daemon process, such as the `aptouch_daemon` thread or the `XXX_daemon` thread; no limitation is made here. The second thread can perform preprocessing, feature extraction, coordinate transformation, and other processing operations on the obtained second capacity data frame by frame to obtain the corresponding reporting coordinate data, for example... Figure 2b The reported point coordinates P1, P3, P5, P7, P9, P11, P13, and P15 are then processed into the first touch event coordinate data corresponding to the reported point coordinate data, for example... Figure 2b The touch event coordinates shown are T1, T3, T5, T7, T9, T11, T13, and T15. This processing method can reduce the amount of computation required to process the original capacitance data, thereby saving computing resources and reducing device power consumption.
[0069] The input subsystem of an electronic device executes threads for receiving reported touch event coordinates and generating touch events. These include an input event processing thread (InputReader thread), an input event dispatching thread (InputDispatcher thread), an input event publishing thread (InputPublisher thread), and an input event consuming thread (InputConsumer thread). These threads further process the obtained touch event coordinates into touch events before providing them to relevant applications. The input event processing thread, input event dispatching thread, and input event publishing thread can be referred to as the third thread, and the input event consuming thread as the fourth thread. The third thread can obtain the first touch event coordinate data corresponding to the reported coordinate data and provide it to the fourth thread.
[0070] For the interpolation process described above, the fourth thread can execute an interpolation algorithm to interpolate the obtained touch event coordinates (i.e., the first touch event coordinate data) to obtain the second touch event coordinate data corresponding to the first touch event coordinate data, and can add the processed second touch event coordinate data to the event queue. Then, the fourth thread can use the interpolated second touch event coordinate data in the event queue, including the interpolated coordinates and the adjacent first touch event coordinate data, to determine the corresponding touch position, thereby identifying the touch event and reporting it. (Reference) Figure 2b The aforementioned first touch event coordinate data may include touch event coordinates T1, T3, T5, T7, T9, T11, T13, and T15. After the above interpolation processing, the interpolated coordinates T2' (between T1 and T3), T4' (between T3 and T5), T6' (between T5 and T7), T8' (between T7 and T9), T10' (between T9 and T11), T12' (between T11 and T13), and T14' (between T13 and T15) can be obtained, and so on, to obtain... Figure 2b The interpolated touch event coordinates shown are the second touch event coordinate data mentioned above.
[0071] It is understood that the frequency at which the third thread obtains the first touch event coordinate data can be the second frequency, that is, the second number of touch event coordinates can be obtained within a preset time. Correspondingly, the frequency at which the second touch event coordinate data processed by the fourth thread is added to the event queue can correspond to the first frequency, that is, the first number of touch event coordinates can be added to the event queue within a preset time.
[0072] Furthermore, the fourth thread of the electronic device (i.e., the input event consumption thread) can sequentially retrieve the original touch event coordinates and interpolated coordinates, i.e., the second touch event coordinate data, from the event queue as the coordinate data used to determine the touch position. For example, when applying VSYNC (e.g., V... a1 To V a7 When a touch event is triggered, the fourth thread can determine the touch position based on T1 and T2' and report the corresponding V. a1 The touch event is determined based on T3 and T4', and the corresponding V is reported. a2 The touch event is determined based on T5 and T6', and the corresponding V is reported. a3 The touch event is determined based on T7 and T8', and the corresponding V is reported. a4 The touch event is determined based on T9 and T10', and the corresponding V is reported. a5 The touch event is determined based on T11 and T12', and the corresponding V is reported. a6 The touch event is determined based on T13 and T14', and the corresponding V is reported. a7 Touch events, and so on, provide application responses.
[0073] Similarly, when VSYNC triggers the reporting of touch events, the system can also report the corresponding V based on the touch positions determined by T1 and T2', T3 and T4', T5 and T6', T7 and T8', T9 and T10', T11 and T12', T13 and T14', etc. h1 V h2 V h3 V h4 V h5 V h6 V h7 Touch events are sent to the relevant application (referred to as the first application, such as a video application or a game application), for example, to the main thread of the first application's process (such as the android.Launcher main thread), so that the relevant application can respond. In this way, the touch event can still be determined based on the coordinates of multiple touch events, reducing the positional error caused by determining the touch event based on the coordinates of a single touch event, which helps to improve the accuracy of touch event reporting.
[0074] To facilitate a clear understanding of the data processing method provided in this application, the operating system architecture of the electronic device implementing the data processing method provided in this application will be described below with reference to the accompanying drawings.
[0075] Figure 3 According to an embodiment of this application, a schematic diagram of the operating system software structure of an electronic device is provided.
[0076] It is understood that, in the embodiments of this application, the electronic device may be as described above. Figure 1 In some embodiments, the mobile phone 100 shown in the scenario can also be a tablet computer, a laptop computer, or a smart TV, etc., and there is no limitation on this.
[0077] Furthermore, it is understood that the operating system of an electronic device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application's embodiments use a layered architecture like Android. TM Taking a system as an example, this paper illustrates the system software structure of an electronic device.
[0078] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, Android... TM The system is divided into five layers, from top to bottom: the application layer (application layer) 310, the application framework layer (framework layer) 320, and Android. TM runtime (Android) TM The system library 330 includes the runtime, the hardware abstraction layer (HAL) 340, and the kernel layer 350. The kernel layer 350 can interact with the hardware devices in the electronic device hardware layer, providing hardware drivers to operate the corresponding hardware structures within the hardware layer.
[0079] Specifically, such as Figure 3 As shown, application layer 310 may include a series of application packages. In this embodiment, the application packages of application layer 310 may include the System UI described above, as well as video applications, game applications, etc. installed by the user. In some embodiments, the application packages may also include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS, etc., without limitation.
[0080] The UI thread controlled by System UI is used to control the rendering of the relevant user interface (UI) based on the touch events reported by the system.
[0081] Furthermore, the user interface data that has been drawn can be rendered by the Compositing Service (SF) of the framework layer 320, composed by the hardware composer (HWC), and displayed by the display driver. Once the display is complete, the corresponding interface displayed on the screen is the system's response to the user's touch operations on applications such as video and games.
[0082] The framework layer 320 provides an application programming interface (API) and programming framework for the application package of the application layer 310. In some embodiments, the framework layer 320 may include some predefined functions.
[0083] In this embodiment, the framework layer 320 may include a touch service (TS) 321, a touch screen algorithm (TSA) 322, a daemon 323, an input subsystem 324, and a synthesis service (SF) 325. The input subsystem 324 may include units or modules such as an input event reader, an input event dispatcher, an input event publisher, and an input event consumer.
[0084] The touch service 321 can respond to calls from applications such as the System UI, instructing the daemon 323 to report touch coordinates. This process of reporting touch coordinates may include obtaining raw capacitance data and reporting touch event coordinates. It can be understood that applications such as the System UI can trigger the touch service 321 to work via VSYNC, instructing the daemon 323 to report touch coordinates.
[0085] The touch coordinate algorithm 322 is used to perform feature extraction and coordinate transformation operations based on the preprocessed raw capacitance data provided by the daemon process 323 to obtain the reporting point coordinates. In some embodiments, the touch coordinate algorithm 322 can further adjust or calibrate the obtained reporting point coordinates to obtain the touch event coordinates.
[0086] The daemon process 323 is used to obtain the raw capacitance data reported by the touch HAL 341, and determine the optimization target for deleting the data set formed by the raw capacitance data according to the data processing method provided in this application. After deleting the first number of raw capacitance data that originally needed to be reported (i.e., the capacitance data in the first capacitance data set), the daemon process 323 preprocesses the second number of raw capacitance data (i.e., the capacitance data in the second capacitance data set) frame by frame and sends them to the touch coordinate algorithm 322 for calculation to obtain the reported point coordinates and touch event coordinates. Furthermore, the daemon process 323 is also used to send the touch event coordinates to the touch HAL 341, touch driver 351, etc. In some embodiments, after obtaining the reported point coordinates calculated by the touch coordinate algorithm 322, the daemon process 323 can also execute corresponding adjustment or calibration processing algorithms to process the reported point coordinates into touch event coordinates before sending them to the touch HAL 341 and touch driver 351.
[0087] It is understood that daemon process 323 can have multiple threads to execute different tasks. For example, the point data reporting thread in daemon process 323 can be used to perform tasks such as reporting point data, including processing raw capacitance data into point data, and reporting point data, or processing the point data to be reported into touch event coordinates, etc. In some embodiments, the point data reporting thread in daemon process 323 may be, for example, an aptouch_daemon thread or an XXX_daemon thread, without limitation.
[0088] In this embodiment, the System UI and applications such as video and game applications can directly trigger the daemon process 323 through the VSYNC application to obtain raw capacitance data and report touch event coordinates. Correspondingly, the aforementioned touch service 321 can respond to calls from applications such as the System UI and identify the current display scene of the electronic device (e.g., mobile phone 100), such as game scenes, non-game display scenes, video playback scenes, and non-video playback display scenes. Among these, game scenes and video playback scenes typically involve rapid screen changes or high user operation frequency, requiring a high screen refresh rate and a correspondingly high touch sampling rate to ensure smooth screen display and good responsiveness; these scenes can be called high frame rate scenes. Conversely, non-game and non-video playback display scenes, such as when a user is reading an e-book or browsing web pages, typically involve slower screen changes and lower user operation frequency; these scenes can be called low frame rate scenes. In low frame rate scenarios, current electronic devices can reduce the screen refresh rate. If the configured touch sampling rate is still high, it will waste computing resources and the effect on improving responsiveness is not significant.
[0089] Therefore, for the aforementioned high frame rate scenarios, the data processing method provided in this application can save computing resources and reduce the power consumption of electronic devices to a certain extent while ensuring a smooth user experience. For low frame rate scenarios, the data processing method provided in this application can further save computing resources and reduce device power consumption while maintaining a smooth user experience.
[0090] In some embodiments, whether it is a high frame rate scenario or a low frame rate scenario, the mobile phone 100 and other electronic devices execute the data processing method provided in this application to save computing resources and reduce device power consumption.
[0091] In other embodiments, the data processing method provided in this application is executed by the mobile phone 100 or other electronic devices only when the aforementioned low frame rate scenario is detected. This allows for maintaining smooth image display and screen responsiveness in high frame rate scenarios, while reducing device power consumption in low frame rate scenarios.
[0092] The input event processing (unit) in the input subsystem 324 can receive touch event coordinates reported by the input driver 352 through the kernel layer 350 and forward them to the input event distribution (unit) for distribution, for example, assigning a corresponding consuming application process to the received touch event coordinates. The number of touch event coordinates can correspond to the number of the second quantity of original capacitance data mentioned above; that is, the received touch event coordinates can be the second quantity. After distribution is completed, the touch event coordinates can be published to the input event consuming (unit) via the input event publishing (unit) for consumption by the designated application process. In this embodiment, after obtaining the second quantity of touch event coordinates, the input event consuming (unit) can perform interpolation operations on these touch event coordinates to generate a first quantity of touch event coordinates including the interpolated coordinates. For ease of description, the second quantity of touch event coordinates can be described below as a first coordinate data set, and the first quantity of touch event coordinates after the interpolation operation can be described below as a second coordinate data set.
[0093] Furthermore, the input event consumption (unit) can add the touch event coordinates, including interpolated coordinates, from the second coordinate data set to the event queue. The touch event coordinates in the event queue can be resampled and combined in pairs (e.g., as mentioned above). Figure 2b The T1 and T2', T3 and T4', T5 and T6', T7 and T8', T9 and T10', T11 and T12', T13 and T14' shown are used to determine the corresponding touch positions and generate the corresponding VSYNC for each of the above applications (e.g., the above). Figure 2b The V shown a1 To V a7Touch events are displayed and can be read and consumed by the specified application process.
[0094] It is understood that the input event processing (unit) of the input subsystem 324 can execute the above-mentioned input event processing thread, the input event dispatching (unit) can execute the above-mentioned input event dispatching thread, the input event publishing (unit) can execute the above-mentioned input event publishing thread, and the input event consuming (unit) can execute the above-mentioned input event consuming thread to implement the data processing method provided in this application.
[0095] The compositing service 325 can receive buffer data from multiple data sources to be displayed, compose the received buffer data, and then send it to a display device (e.g., a screen) for display.
[0096] In other embodiments, the frame layer 320 may also include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The functions of each structure in the frame layer 320 can be found in the relevant descriptions in the prior art, and will not be elaborated here.
[0097] Android TM runtime (Android) TM Runtime includes the core libraries and the virtual machine. Android TM runtime is responsible for Android TM System scheduling and management.
[0098] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part is the Android core library. Application Layer 310 and Framework Layer 320 can run in a virtual machine. The virtual machine executes the Java files of Application Layer 310 and Framework Layer 320 as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0099] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.
[0100] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0101] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0102] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0103] A 2D graphics engine is a graphics engine for 2D drawing.
[0104] The hardware abstraction layer 340 provides a standard interface to the system's API framework (e.g., the Java API framework) of the functionalities possessed by the electronic device hardware. The hardware abstraction layer may contain multiple library modules, each providing an interface for implementing relevant functionalities for its corresponding type of hardware. Examples include a touch library module (touch HAL) 341, as well as audio HAL, Bluetooth HAL, camera HAL, etc. In some embodiments, the hardware abstraction layer 340 may also include a hardware synthesizer (HWC) 342, etc. When the API provided by the framework layer 320 requests access to the hardware of the electronic device (i.e., the hardware layer), the system loads the corresponding library module for the relevant hardware component.
[0105] For example, in this embodiment, the touch HAL 341 can be loaded by the system to support the daemon process 323 in accessing the touch panel (TP) of an electronic device (e.g., mobile phone 100). Correspondingly, the touch HAL 341 can call the touch driver 351 of the kernel layer 350 to trigger the TP to collect the user's original capacitance signal to obtain the original capacitance data.
[0106] The hardware compositor 342 is a graphical tool used by the compositor service 325 to control the compositoring of multiple display layers of a related interface. It can be understood that an interface may consist of multiple display layers, such as a status bar, an application interface (e.g., a touch-responsive interface), etc. The hardware compositor 342 is responsible for compositoring these display layers together to generate the final interface that can be displayed on the screen.
[0107] Furthermore, the hardware synthesizer 342 can call the display driver 353 to display the synthesized interface on the screen.
[0108] Kernel layer 350 is the layer between hardware and software. In the embodiments of this application, kernel layer 350 may include touch driver 351, input driver 352, and display driver 353. In other embodiments, kernel layer 350 may also include camera driver, audio driver, sensor driver, etc., which are not limited here.
[0109] As mentioned earlier, kernel 350 can interact with the hardware layer of electronic devices, providing hardware drivers to drive the corresponding hardware structures in the hardware layer. For example, the touch driver 351 provided by kernel layer 350 can drive the touch panel of the hardware layer to work, collecting raw capacitance signals to obtain raw capacitance data; as another example, the display driver 353 provided by kernel layer 350 can drive the screen of the hardware layer to work, and can control the hardware synthesizer 342 to control the synthesized interface, such as the touch response interface corresponding to the touch event, and send it to the screen for display, i.e., the display sending process.
[0110] Based on the above Figure 3 The structure shown below, along with relevant flowcharts, details the specific implementation process of the data processing method provided in this application.
[0111] Figures 4a to 4b An interactive implementation flowchart of a data processing method is shown according to an embodiment of this application.
[0112] Understandable. Figures 4a to 4b The interactive implementation process shown involves the above. Figure 3 The diagram illustrates the interactions between various software structures within the operating system. In other embodiments, the operating system of the electronic device includes components similar to those described above. Figure 3 When the operating system has different software architectures, Figures 4a to 4b The interactive implementation process shown can also involve the interaction between software structures with corresponding functions.
[0113] It should also be stated that the steps in the methods and processes in this application are numbered for ease of reference, not to limit the order of steps. If there is an order between the steps, the textual description shall prevail.
[0114] Specifically, such as Figure 4a As shown, the specific steps S401 to S413 of this interactive implementation process are as follows:
[0115] S401: Application layer 310 runs relevant applications, provides the interface of relevant applications for user operation, and generates application vertical synchronization signals.
[0116] For example, application layer 310 runs relevant applications and can provide the interface of these applications for user touch operations (i.e., user operation). Furthermore, the relevant applications in application layer 310 can also send a request to the compositing service 325 of framework layer 320 to generate an application VSYNC, requesting the compositing service 325 to capture the hardware VSYNC and generate the application VSYNC. As mentioned earlier, this application VSYNC can trigger the relevant applications in application layer 310, such as video applications or game applications. At this time, the relevant applications in application layer 310 obtain the generated application VSYNC, i.e., generate an application vertical synchronization signal, and can then continue to execute processes such as S402 described below.
[0117] It's understandable that the refresh rate of an application's VSYNC can be the same as the refresh rate of a hardware VSYNC, and there's a certain time delay offset between the two. Screens of electronic devices like mobile phones can generate hardware VSYNC to synchronize the frame rate of the graphics processing unit (GPU) processing images with the screen refresh rate, making the screen display smoother. In both high and low frame rate scenarios, the frequency of user operations and the speed of changes in the application's interface can affect the refresh rate of the application's VSYNC.
[0118] Specifically, in the above Figure 3 In the example operating system, the synthesis service 325 can capture hardware VSYNC and convert it into Vsync_app (i.e., the application VSYNC mentioned above) according to the request of the relevant application, and provide it to the relevant application in the application layer 310, such as a video application or a game application. (Refer to the above.) Figure 3 The application layer 310 can obtain touch events reported by the input subsystem 324 and control the rendering process of the touch-responsive interface (view) through the System UI. The System UI can then call the compositing service 325 to render the completed interface graphics data. The compositing service 325 can further call the system's hardware compositor 342 to composite the various display layers of the rendered interface, generating the touch-responsive interface. Simultaneously, the aforementioned hardware VSYNC can also trigger the display driver to send the composited interface to the display, which will not be elaborated upon here.
[0119] S402: Application layer 310 sends an application vertical synchronization signal to touch service 321.
[0120] For example, the application layer 310 can send the generated application VSYNC to the touch service 321 to invoke the touch service 321 to execute the following S403, triggering the operating system's daemon process 323 to report the touch coordinates. For details, please refer to the relevant steps described below, which will not be repeated here.
[0121] S403: Touch service 321 sends a command to daemon 323 to report touch coordinates.
[0122] For example, the aforementioned instruction to report touch coordinates can instruct the daemon process 323 to report touch coordinates. As mentioned earlier, the process of the daemon process 323 reporting touch coordinates may include obtaining the raw capacitance data collected by the touch panel, and reporting the touch event coordinates obtained based on the raw capacitance data to the input subsystem 324. The input subsystem 324 can then generate touch events based on the reported touch event coordinates and report them to the relevant applications in the application layer 310, etc., without limitation.
[0123] S404: Daemon process 323 sends a data acquisition request to touch HAL 341.
[0124] For example, in response to the received instruction to report the touch coordinates, the daemon process 323 sends a data acquisition request for the raw capacitance data to the touch HAL 341.
[0125] S405: The touch HAL 341 sends a data acquisition request to the touch driver 351.
[0126] For example, the above data acquisition instruction is a data acquisition request for the original capacitance value data. It can instruct the touch driver 351 to drive the touch panel to sample the original capacitance value signal, and then acquire the original capacitance value data, hereinafter referred to as the first capacitance value data.
[0127] S406: The touch driver 351 reports the first capacitance value data it has collected to the touch HAL 341. This first capacitance value data can be the initial raw capacitance value data collected.
[0128] S407: Touch HAL 341 reports the first capacitance value data to daemon process 323.
[0129] For example, after receiving the first capacitance value signal initially acquired by the touch panel and obtaining the first capacitance value data, the touch driver 351 can report the first capacitance value data to the daemon process 323 through the touch HAL 341. The touch driver 351 can first cache the data after obtaining it, and then report the cached data frame by frame according to the received data acquisition request. The reported first capacitance value data can be the most recent data at the time of acquisition, without any restrictions.
[0130] S408: Daemon process 323 deletes the first capacity value data.
[0131] For example, the number of original capacitance data provided by the multiple frames of original capacitance signals received by the daemon process 323 can be recorded as a first quantity, that is, the first quantity of first capacitance data, corresponding to a first frequency, which can correspond to the current touch sampling rate. Referring to the above... Figure 2b As shown, the aforementioned first capacitance data may be the raw capacitance data provided by the 15 frames of raw capacitance signals indicated by S1 to S15. As previously stated, the first quantity of raw capacitance data can be described as a first capacitance data set. Based on this, the aforementioned deletion process may include deleting a portion of the data within the first capacitance data set, for example, this deletion... Figure 2b The original capacitance data provided by the original capacitance signals indicated by S2, S4, S6, ..., S14 shown. After deletion processing, Figure 2b The first quantity 15 corresponding to the original capacitance data provided by the 15 frames of original capacitance signals indicated by S1 to S15 shown can be reduced to a second quantity 8. The second quantity of original capacitance data obtained after the above deletion process can be described in this embodiment as the aforementioned second capacitance data set.
[0132] In some embodiments, the data acquisition request may carry a processing instruction for the acquired raw capacitance data. This processing instruction may be, for example, a deletion instruction determined by the daemon process 323 based on the relationship between the screen refresh rate and the touch sampling rate. This processing instruction may instruct the processing of a first quantity within the first capacitance data set into a second quantity within the second capacitance data set. Correspondingly, when reporting cached data, the touch driver 351 may report the raw capacitance data acquired by the touch panel in an interval-dropped frame manner.
[0133] As an example, refer to the above. Figure 2b As shown, the method of dropping frames at intervals is as follows: during the reporting process from S1 to S8, the original tolerance data provided by S1 is reported and the original tolerance data provided by S2 is discarded; the original tolerance data provided by S3 is reported and the original tolerance data provided by S4 is discarded; the original tolerance data provided by S5 is reported and the original tolerance data provided by S6 is discarded; the original tolerance data provided by S7 is reported and the original tolerance data provided by S8 is discarded, and so on.
[0134] S409: Daemon process 323 preprocesses the obtained second capacity data.
[0135] For example, after deleting some of the original capacities, the daemon process 323 can execute relevant preprocessing algorithms to preprocess the remaining original capacities, i.e., the second capacities, which can also be described as the original capacities within the second capacities data set, such as data cleaning (handling missing values, outliers, and duplicate values) and data transformation (such as standardization, normalization, one-hot encoding, etc.).
[0136] This reduces the amount of data processed in the aforementioned preprocessing steps, as described above. Figure 2b The example of processing "raw capacity data" to "report point coordinates" shows that the above-mentioned deletion of raw capacity data can reduce the amount of data processing by 50% in some scenarios.
[0137] S410: Daemon process 323 sends preprocessed second capacitance data to touch coordinate algorithm 322.
[0138] For example, the daemon process 323 can send the original capacitance data in the preprocessed second capacitance data set, i.e., the second capacitance data, to the touch coordinate algorithm 322 module for processing. In some embodiments, the daemon process 323 can also call the touch coordinate algorithm 322 by means of algorithm call, and use the preprocessed second capacitance data as the input data of the algorithm for calculation and processing.
[0139] S411: Touch coordinate algorithm 322 sends the processed first touch event coordinates to daemon process 323.
[0140] For example, the touch coordinate algorithm 322 can perform feature extraction and coordinate transformation on the preprocessed second capacitance data provided by the daemon process 323 to obtain the reporting coordinates. Further, the touch coordinate algorithm 322 can further adjust or calibrate the obtained reporting coordinates to obtain touch event coordinates, denoted as the first touch event coordinates or first touch event coordinate data, thus forming a first coordinate data set.
[0141] In some embodiments, during the execution of the above S409, the daemon process 323 may also perform preprocessing and feature extraction on the original capacitance data in the second capacitance data set. Based on this, the original capacitance data received by the touch coordinate algorithm 322 may be the capacitance data after feature extraction. The touch coordinate algorithm 322 may further perform coordinate transformation and calibration on the capacitance data after feature extraction to obtain the touch event coordinates, which is not limited here.
[0142] In other embodiments, the touch coordinate algorithm 322 may also send the reported coordinates to the daemon process 323, which will then adjust or calibrate the reported coordinates and further process them into touch event coordinates. No limitation is imposed here.
[0143] S412: Daemon process 323 sends the first touch event coordinate data to touch HAL 341.
[0144] For example, the daemon process 323 can send the first touch event coordinate data processed by the touch coordinate algorithm 322 to the touch HAL 341, so as to report the first touch event coordinate data to the input subsystem 324 through the underlying driver (e.g., touch driver 351 and input driver 352).
[0145] S413: The touch HAL 341 sends the first touch event coordinate data to the touch driver 351.
[0146] like Figure 4b As shown, S414 to S421 of this interactive implementation process are specifically as follows:
[0147] S414: Touch driver 351 sends the first touch event coordinate data to input driver 352.
[0148] As mentioned above, after receiving the touch event coordinates, the touch HAL 341 can report them to the input subsystem 324 through the underlying driver (e.g., the touch driver 351 and input driver 352 mentioned above). In this embodiment, the touch event coordinates transmitted via S412 to S414, i.e., the first touch event coordinate data, are coordinate data calculated based on the original capacitance data in the second capacitance data set after deletion processing. The amount of data in the first coordinate data set formed by these coordinate data can correspond to the second quantity in the second capacitance data set, but is less than the first quantity in the first capacitance data set.
[0149] It should be noted that the aforementioned first coordinate data set and the following second coordinate data set are merely illustrative descriptions of the corresponding number of capacitance data, and cannot constitute a limitation on the data integration form of the first number of touch event coordinate data in the first coordinate data set and the second number of touch event coordinate data in the second coordinate data set.
[0150] S415: Input driver 352 sends the first touch event coordinate data to input subsystem 324.
[0151] For example, after receiving the first coordinate data set including touch event coordinates forwarded by the touch driver 351, the input driver 352 can report the touch event coordinates in the first coordinate data set to the input subsystem 324, that is, send the first coordinate data set to the input subsystem 324.
[0152] In other embodiments, the touch coordinate algorithm 322 may also send the obtained reporting coordinates to the daemon process 323, which then performs calibration processing on the reporting coordinates to obtain the touch event coordinates, and then executes the above-described S412 to S415 to send the first coordinate data set including the above-described touch event coordinates to the input subsystem 324 through the touch HAL 341, touch driver 351, and input driver 352. No limitation is imposed here.
[0153] S416: Input subsystem 324 performs interpolation on the first touch event coordinate data to obtain the second touch event coordinate data.
[0154] For example, the input subsystem 324 can perform interpolation operations on the smaller number of first touch event coordinates obtained by processing the original capacitance data (i.e., the second coordinate data) based on the second quantity, to obtain second touch event coordinate data with a larger data volume, thus forming a second coordinate data set. As an example, refer to the above... Figure 2b As shown, the above interpolation operation can be, for example, processing the original capacitance data of adjacent time points to obtain touch event coordinates, such as T1 and T3, T3 and T5, T5 and T7, T7 and T9, T9 and T11, T11 and T13, T13 and T15, etc., and using linear interpolation and other methods to calculate the interpolated coordinates located between or adjacent to the two, such as T2', T4', T6', T8', T10', T12', T14', etc.
[0155] As mentioned above, the input subsystem 324 may include an input event processing (unit), an input event distribution (unit), an input event publishing (unit), and an input event consumption (unit). The input event consumption (unit) may perform interpolation operations on the touch event coordinates in the received first coordinate data set to generate a new coordinate data set containing the interpolated coordinates, namely the second coordinate data set.
[0156] S417: Input subsystem 324 determines the touch position and generates a touch event based on the second touch event coordinate data.
[0157] For example, the touch event coordinates (i.e., the second touch event coordinate data) in the second coordinate data set include both the first touch event coordinates (i.e., the first touch event coordinate data) in the first coordinate data set and the interpolated coordinates obtained during the interpolation operation, such as those described above. Figure 2bExamples include T2', T4', T6', T8', T10', T12', and T14'. Based on the touch event coordinates in the second coordinate data set, the input subsystem 324 can add the relevant touch event coordinates to the event queue, determine the touch position, and generate a touch event. It can be understood that each touch event coordinate in the second coordinate data set can determine a corresponding touch position. To improve the accuracy of the determined touch position, a touch position can be precisely determined using two or more adjacent touch event coordinates, and then a corresponding touch event can be generated based on the determined touch position.
[0158] As mentioned earlier, after the input event consumption (unit) in the input subsystem 324 processes the first coordinate data set into a second coordinate data set through interpolation, it can add each touch event coordinate, including the interpolated coordinates, from the second coordinate data set to the event queue. The touch event coordinates in the event queue can then be resampled and combined in pairs (e.g., as described above). Figure 2b The T1 and T2', T3 and T4', T5 and T6', T7 and T8', T9 and T10', T11 and T12', T13 and T14' shown are used to determine the corresponding touch positions and generate the corresponding VSYNC for each of the above applications (e.g., the above). Figure 2b The V shown a1 To V a7 Touch events are displayed and can be read and consumed by the specified application process.
[0159] S418: Input subsystem 324 reports touch events to application layer 310.
[0160] For example, the input subsystem 324 can report the generated touch events to relevant applications, such as game applications, video applications, or other applications in application layer 10, without limitation.
[0161] S419: Application layer 310 responds to touch events and calls System UI to control the drawing of the touch response interface.
[0162] For example, the application in application layer 310 (e.g., video application, game application, etc.) can respond to received touch events, i.e., input events, and call System UI to control the UI thread to perform interface graphics drawing processing on the touch response interface, generating relevant data for each display layer of the touch response interface, hereinafter referred to as touch response interface related data. The touch response interface, as the name suggests, refers to the response interface to user touch operations on the interface of a related application, such as the one described above. Figure 1 The example shown is the constantly refreshing game interface 101, etc.
[0163] S420: The System UI call composition service in application layer 310 controls the rendering of the touch response interface data that has been drawn.
[0164] For example, after the System UI control completes the drawing process, it can call the compositing service 325 of the framework layer 320 to render the data related to the drawn touch response interface. The compositing service 325 can control the system's rendering thread to execute rendering tasks and process the drawn interface graphics and related data.
[0165] As mentioned above, the compositing service 325 can receive buffer data from multiple data sources to be displayed. The touch response interface data provided by the System UI of the application layer 310 initiating the rendering task can be sent to the compositing service 325 as buffer data. Then, the compositing service 325 can control the rendering thread to perform rendering processing on the received buffer data, and then execute the following S421 to perform compositing and display through the hardware compositor and display driver.
[0166] S421: The compositing service 325 calls the hardware compositing unit to compose the touch response interface and calls the display driver to send the composited interface to the display.
[0167] For example, refer to the above Figure 3 Upon receiving the touch response interface-related data, the compositing service 325 can invoke the hardware compositor 342 to composite the various display layers based on the rendered touch response interface-related data to generate the touch response interface. Furthermore, the hardware compositor 342 can invoke the display driver 353, responding to hardware VSYNC, to send the composited touch response interface-related data to the screen for display, thus completing the interface display process.
[0168] Based on the above-described interactive implementation process S401 to S421, the data processing method provided by this application can reduce the amount of computational processing on the collected raw capacitance data without changing the touch sampling rate of the screen configured by the electronic device. Furthermore, after obtaining the touch event coordinates, it can ensure that the amount of coordinate data used to determine the touch position is sufficient through interpolation or other similar processing methods that can increase the amount of coordinate data, thereby ensuring that the responsiveness experience is not reduced. In other words, it can save computing resources, reduce device power consumption, and ensure the responsiveness experience of the electronic device.
[0169] Figure 5 An embodiment of this application illustrates a schematic diagram of the implementation process of another data processing method.
[0170] Understandable. Figure 5The execution entity of the illustrated implementation process can be an electronic device such as a mobile phone 100, and this electronic device can have a screen. The touch panel of this screen can respond to control commands generated by the processor or controller of the electronic device and execute them. Figure 5 The implementation process shown is used to realize the data processing method provided in this application.
[0171] It is understandable that electronic devices, as the executing entities, can also be equipped with the aforementioned features. Figure 3 The example operating system, and thus the above-mentioned functions can be executed on that operating system. Figures 4a to 4b The interactive process shown will not be elaborated upon here.
[0172] Specifically, such as Figure 5 As shown, the implementation process may include:
[0173] S501: Display the first image data of the first application on the screen.
[0174] For example, the screen of an electronic device such as a mobile phone 100 can provide touch operation and display functions. The first image data of the first application displayed on the screen of the mobile phone 100 may include image data corresponding to game screens, non-game screens, video playback screens, or non-video playback screens. The first application can be an application with fast screen changes or high user operation frequency, such as a game application or a video application, or an application with slow screen changes and low user operation frequency, such as a browser application; no limitation is made here.
[0175] S502: Receives touch operations applied to the screen.
[0176] For example, the touch operations received by the mobile phone 100 on the screen may be touch operations such as clicking (including pressing and lifting) or swiping on the game screen, non-game screen, video playback screen or non-video playback screen.
[0177] S503: Obtain the first capacitance value data corresponding to the touch operation, and the first capacitance value data corresponds to the first frequency.
[0178] For example, the mobile phone 100 can obtain the first capacitance data corresponding to the touch operation through the first thread in the operating system. This first thread can be a thread used to report interrupts, i.e., an interrupt thread, such as the irq-thp main thread, or the irq-thp thread or irq-XXX thread, i.e., the interrupt touch panel thread.
[0179] It is understood that the screen of mobile phone 100 can collect raw capacitance data based on a higher touch sampling rate set according to the corresponding screen refresh rate, that is, obtain the above-mentioned first capacitance data. At this time, the first frequency at which the screen reports the first capacitance data can correspond to the touch sampling rate. The first frequency can be higher, and correspondingly, the number of first capacitance data collected and reported by the screen within a preset time is also larger, such as the first number in the embodiment of this application.
[0180] S504: Obtain the second capacitance data corresponding to the first capacitance data, the second capacitance data corresponding to the second frequency, and the second frequency being lower than the first frequency.
[0181] For example, the mobile phone 100 can obtain the second capacitance data corresponding to the first capacitance data through a second thread in the operating system. This process may include processing the first capacitance data, which has a higher frequency or a larger quantity, into the second capacitance data, which has a lower frequency or a smaller quantity.
[0182] Specifically, mobile phone 100 can acquire first capacitance data through a second thread at a first moment; acquire the interrupt reported by the first thread through a second thread at a second moment, and delete the first capacitance data acquired at the second moment based on the interrupt; and acquire the first capacitance data through a second thread at a third moment; wherein the first moment and the second moment are adjacent moments corresponding to the first frequency, and the first moment and the third moment are adjacent moments corresponding to the second frequency. That is, the second capacitance data can be obtained by deleting a portion of the acquired first capacitance data. The timing of this deletion process can correspond to the moment when the interrupt is reported, such as the second moment mentioned above. Specifically, among the first capacitance data reported from the first moment to the third moment, the first capacitance data reported at the second moment can be deleted, thus reducing the amount of data corresponding to the second capacitance data after the first capacitance data is processed.
[0183] In other embodiments, the mobile phone 100 can also acquire the first capacitance data through a second thread at a first moment; acquire the interrupt reported by the first thread through a second thread at a second moment, and not acquire the first capacitance data sent to the second thread at the second moment based on the interrupt; and acquire the first capacitance data through a second thread at a third moment; wherein the first moment and the second moment are adjacent moments corresponding to the first frequency, and the first moment and the third moment are adjacent moments corresponding to the second frequency. That is, the second capacitance data can also be obtained by performing frame skipping processing on a portion of the acquired first capacitance data. The timing of this frame skipping processing can correspond to the moment when the interrupt is reported, such as the second moment mentioned above. Specifically, in the first capacitance data reported from the first moment to the third moment, the second thread of the electronic device can skip the signal corresponding to the first capacitance data reported at the second moment (i.e., frame skipping), and only receive the capacitance signal corresponding to the first capacitance data reported at the first moment and the third moment. In this way, the amount of data corresponding to the first capacitance data after processing into second capacitance data can also be reduced.
[0184] S505: Obtain the reporting point coordinate data corresponding to the second capacitance data, which corresponds to the aforementioned second frequency.
[0185] For example, the mobile phone 100 can also obtain the reporting coordinate data corresponding to the second tolerance data through a second process. This second thread can be a thread used to report the reporting coordinate data, i.e., a reporting data reporting thread, such as the aptouch_daemon thread or the XXX_daemon thread.
[0186] It is understood that the mobile phone 100 can control the data volume of the first capacitance data during the reporting process or before proceeding to the next step after reporting, that is, process the first capacitance data into second capacitance data corresponding to the second frequency. The second capacitance data corresponds to a lower second frequency, and the number of second capacitance data reported or transmitted within a preset time is also smaller, such as the second number in the embodiment of this application. Correspondingly, the reporting point coordinate data obtained based on the above-mentioned second capacitance data processing can also correspond to the above-mentioned second frequency, and the number of reporting point data transmitted within the preset time can also be the second number.
[0187] S506: Obtain the first touch event coordinate data corresponding to the reported point coordinate data, which corresponds to the second frequency mentioned above.
[0188] For example, the mobile phone 100 can obtain the first touch event coordinate data corresponding to the reported coordinate data through a third thread. The third thread may include an input event processing thread, an input event distribution thread, and an input event publishing thread. These threads can obtain the first touch event coordinate data corresponding to the reported coordinate data in sequence.
[0189] At this point, the operating system of the electronic device can then process the reported point coordinate data, the first touch event coordinate data, etc., based on the second capacitance data processed above, thereby reducing the amount of data processing required for the original capacitance data, saving computing resources, and reducing device power consumption.
[0190] S507: Obtain the second touch event coordinate data corresponding to the first touch event coordinate data, wherein the second touch event coordinate data corresponds to the aforementioned first frequency.
[0191] For example, the mobile phone 100 can obtain the second touch event coordinate data corresponding to the first touch event coordinate data through a fourth thread. This fourth thread may include an input event consumption thread, used to generate touch events based on the second touch event coordinate data for consumption by a first application. As mentioned above, the first application may be, for example, the aforementioned video application, game application, or browser application, and is not limited thereto.
[0192] S508: Send the coordinate data of the second touch event to the first application.
[0193] For example, sending the second touch event coordinate data to the first application may include sending the second touch event coordinate data to a fifth thread, which is the main thread of the application process of the first application. For example, the fifth thread may be the android.Launcher main thread, or the main thread of other application processes, and there is no limitation here.
[0194] S509: Based on the second touch event coordinate data, display the second image data of the first application on the screen.
[0195] For example, after sending the second touch event coordinate data to the first application, the mobile phone 100 can also call the thread controlled by the system user interface (i.e., the UI thread) through the fifth thread in the operating system to draw the image data corresponding to the second touch event coordinates. Furthermore, the mobile phone 100 can also call the rendering thread controlled by the compositing service (SF) through the UI thread to render the image data corresponding to the drawn second touch event coordinates; and, through the rendering thread, call the hardware compositor (HWC) to composite the rendered image data corresponding to the second touch event coordinates to obtain the second image data of the first application; and through the hardware compositor, call the display driver to control the screen to display the second image data of the first application.
[0196] It is understood that the difference between the aforementioned second image data and the image data corresponding to the aforementioned second touch event coordinates lies in the fact that the former can be image data synthesized from various display layers and displayed on the screen, while the latter is image data corresponding to each display layer before rendering. In the embodiments of this application, the aforementioned second image data of the first application can correspond to the image data of the touch response interface of the aforementioned touch operation.
[0197] As mentioned above, electronic devices such as mobile phones 100 may not execute the data processing method provided in this application when detecting the aforementioned high frame rate scenarios, but may execute the data processing method provided in this application when detecting the aforementioned low frame rate scenarios, without any restrictions. In this way, the good experience of smooth screen display and responsiveness brought about by the pre-set ratio of screen refresh rate to touch sampling rate can be maintained in high frame rate scenarios, while the power consumption of electronic devices can be significantly reduced based on the data processing method provided in this application in low frame rate scenarios.
[0198] As an example, Figure 6 According to an embodiment of this application, a schematic diagram of the implementation process of another data processing method involving the identification of display scenes is shown.
[0199] Understandable. Figure 6 The execution entity of the illustrated implementation process can also be an electronic device such as a mobile phone 100. This electronic device can have a screen. The touch panel of the screen can respond to control commands generated by the processor or controller of the electronic device and execute... Figure 6 The implementation process shown is used to realize the data processing method provided in this application.
[0200] Specifically, such as Figure 6 As shown, the implementation process may include:
[0201] S601: Identify whether the display scene is a high frame rate scene.
[0202] If the recognition result is negative, then execute S602 to S609 as follows; wherein, the touch event coordinates received in S607 can be coordinates obtained based on the original capacitance data after deletion processing.
[0203] If the recognition result is yes, then the following steps S607 and S609 can be executed. The touch event coordinates received in S607 can be coordinates obtained by processing the raw capacitance data that has not been deleted.
[0204] For example, an electronic device, such as a mobile phone 100, can identify whether the current display scenario is a high frame rate scenario based on the currently displayed interface content of the relevant application for user operation and the application type of the relevant application. As mentioned earlier, scenarios with rapid screen changes or high user operation frequency require a higher screen refresh rate. A correspondingly higher touch sampling rate can ensure smooth screen display and high responsiveness. These scenarios can be called high frame rate scenarios, such as game scenarios and video playback scenarios. Slow screen changes and low user operation frequency are called low frame rate scenarios, such as display scenarios for non-game screens and non-video playback screens.
[0205] S602: Obtain the first screen refresh rate and the first touch sampling rate supported by the electronic device.
[0206] S603: Sample the original capacitance signal and collect the original capacitance data. The original capacitance data collected in S603 is all the capacitance data collected by the screen at the first touch sampling rate within the first time period. This original capacitance data can be further used to execute S604 below to form the first capacitance data set with the first quantity mentioned above.
[0207] S604: Obtain the first quantity of raw capacitance data. This first quantity of raw capacitance data is the capacitance data of the first capacitance data set that originally needed to be reported. For the specific execution process, please refer to the relevant descriptions in S404 to S407 above, which will not be repeated here.
[0208] S605: Based on the relationship between the first screen refresh rate and the first touch sampling rate, delete a first quantity of first capacitance data to obtain a second quantity of original capacitance data. The specific execution process can be found in the relevant description in S408 above, and will not be repeated here.
[0209] S606: Process the second quantity of raw capacitance data into touch event coordinates. The specific execution process can be found in the descriptions of S409 to S413 above, and will not be repeated here.
[0210] S607: Receive a second number of touch event coordinates as input. As mentioned earlier, this second number of touch event coordinates can be described as a first coordinate data set. The specific execution process can be found in the relevant descriptions in S414 to S415 above, and will not be repeated here.
[0211] S608: Perform interpolation on the received touch event coordinates to obtain a first number of touch event coordinates containing the interpolated coordinates. As mentioned earlier, this first number of touch event coordinates can be described as a second coordinate data set. The specific execution process can be found in the relevant description in S416 above, and will not be repeated here.
[0212] S609: Determine the touch position based on the touch event coordinates and generate a touch event for the application to draw, render, composite, and display the touch response interface. The specific execution process can be found in the relevant descriptions in S417 to S421 above, and will not be repeated here.
[0213] Figure 7 A schematic diagram of the hardware structure of an electronic device is shown according to an embodiment of this application.
[0214] It is understood that the electronic device can be the aforementioned mobile phone 100, or other electronic devices with a screen, such as tablet computers, laptops, smartwatches, etc., without any restrictions.
[0215] like Figure 7 As shown, the electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identity module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0216] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0217] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.
[0218] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0219] In this embodiment, the processor 110 of the electronic device 10 can perform the above-mentioned operations via the operation control signals generated by the controller. Figures 4a to 4b , Figure 5 or Figure 6 The process shown involves controlling the fetching and execution of relevant instructions to implement the data processing method provided in this application.
[0220] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the aforementioned memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0221] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a SIM card interface, and / or a universal serial bus (USB) interface, etc.
[0222] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the electronic device 10. In other embodiments of this application, the electronic device 10 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.
[0223] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the electronic device 10. While charging the battery 142, the charging management module 140 can also supply power to the electronic device via the power management module 141.
[0224] The wireless communication function of electronic device 10 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor, and baseband processor.
[0225] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0226] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 10. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
[0227] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 10, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc.
[0228] Electronic device 10 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0229] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Mini-LED, Micro-LED, Micro-OLED, quantum dot light-emitting diodes (QLED), etc. In some embodiments, electronic device 10 may include one or N displays 194, where N is a positive integer greater than 1.
[0230] In this embodiment of the application, the display screen 194 can be a screen, and the display screen 194 can also include a touch panel for collecting raw capacitance data caused by changes in the user's touch operation, and then applying it to the data processing method provided in this application to process it into relevant touch event coordinates, and generate corresponding touch events to trigger relevant applications to respond to the user's touch operation and display the relevant touch response interface, namely the first interface mentioned above.
[0231] Electronic device 10 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0232] The external storage interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external memory card.
[0233] Internal memory 121 can be used to store computer executable program code, including instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 10 (such as audio data, phonebook, etc.). In addition, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 10 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.
[0234] Electronic device 10 can implement audio functions such as music playback and recording through audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone jack 170D, and application processor.
[0235] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.
[0236] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 10 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, electronic device 10 detects the intensity of the touch operation based on pressure sensor 180A. Electronic device 10 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands.
[0237] Touch sensor 180K, also known as a "touch device," can be disposed on display screen 194. The touch sensor 180K and display screen 194 together form a touch screen, also known as a "touchscreen," and in this embodiment, a screen. Touch sensor 180K is used to detect touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be disposed on the surface of electronic device 10, in a different location than display screen 194.
[0238] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. The electronic device 10 can receive button input and generate key signal inputs related to user settings and function control of the electronic device 10.
[0239] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to different touch operations applied to different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations applied to different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
[0240] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.
[0241] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the electronic device 10. In some embodiments, the electronic device 10 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the electronic device 10 and cannot be separated from the electronic device 10.
[0242] The following example illustrates the workflow of the software and hardware of electronic device 10, using the capture of game scenes as an example.
[0243] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, timestamp of the touch operation, etc.). The raw input event is stored in the kernel layer. The framework layer 320 obtains the raw input event from the kernel layer 350 and identifies the control corresponding to the input event. Taking a touch click as an example, where the corresponding control is a control on the game interface of a game application, the game application calls the touch service 321 interface of the framework layer 320, triggering the system to process the collected raw capacitance data into touch event coordinates, then determine the touch position based on the touch event coordinates, generate a touch event, and execute the event response. Finally, the touch response interface corresponding to the touch event is displayed on the display screen 194.
[0244] This application also provides a computer program product for implementing the data processing methods provided in the above embodiments.
[0245] Various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or combinations of these implementation methods. Embodiments of this application can be implemented as computer program modules or module code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.
[0246] Computer program modules or module code can be applied to input instructions to perform the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.
[0247] Module code can be implemented using a high-level modular language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used to implement module code when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.
[0248] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, optical discs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other forms of propagated signals. Therefore, machine-readable media include any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.
[0249] In this specification, the reference to "an embodiment" or "an embodiment" means that a specific feature, structure, or characteristic described in connection with the embodiment is included in at least one exemplary implementation or technology disclosed according to an embodiment of this application. The appearance of the phrase "in an embodiment" in various places in the specification does not necessarily refer to the same embodiment.
[0250] The disclosure of embodiments of this application also relates to means for performing operations in text. This means may be specifically constructed for the claimed purpose or may include a general-purpose computer selectively activated or reconfigured by a computer program stored in a computer. Such a computer program may be stored on a computer-readable medium, such as, but not limited to, any type of disk, including floppy disks, optical disks, CD-ROMs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), EPROM, EEPROM, magnetic or optical cards, application-specific integrated circuits (ASICs), or any type of medium suitable for storing electronic instructions, and each may be coupled to a computer system bus. Furthermore, the computer mentioned in the specification may include a single processor or may employ an architecture involving multiple processors for increased computing power.
[0251] Furthermore, the language used in this specification has been primarily chosen for readability and instructional purposes and may not have been chosen to depict or limit the disclosed subject matter. Therefore, the embodiments disclosed herein are intended to illustrate, and not limit, the scope of the concepts discussed herein.
Claims
1. A data processing method, characterized by, Applied to an electronic device, the electronic device including a screen, the method includes: The first image data of the first application is displayed on the screen; Receive touch operations applied to the screen; Obtain the first capacitance value data corresponding to the touch operation, wherein the first capacitance value data corresponds to the first frequency; Obtain the second capacitance data corresponding to the first capacitance data, wherein the second capacitance data corresponds to a second frequency, and the second frequency is lower than the first frequency; Obtain the reporting point coordinate data corresponding to the second capacitance data, wherein the reporting point coordinate data corresponds to the second frequency; Obtain the first touch event coordinate data corresponding to the reported point coordinate data, wherein the first touch event coordinate data corresponds to the second frequency; Obtain the second touch event coordinate data corresponding to the first touch event coordinate data, wherein the second touch event coordinate data corresponds to the first frequency; The second touch event coordinate data is sent to the first application.
2. The method of claim 1, wherein, The electronic device includes a first thread; and... The step of obtaining the first capacitance value data corresponding to the touch operation includes: The first thread obtains the first capacitance data corresponding to the touch operation.
3. The method according to claim 2, characterized in that, The first thread is used to report interrupts.
4. The method according to claim 2 or 3, characterized in that, The electronic device includes a second thread, which is different from the first thread, and, The step of obtaining the second capacitance data corresponding to the first capacitance data includes: The second thread retrieves the second capacitance data corresponding to the first capacitance data.
5. The method according to claim 4, characterized in that, The step of obtaining the reporting point coordinate data corresponding to the second tolerance data includes: The second thread obtains the reporting point coordinate data corresponding to the second tolerance data.
6. The method according to claim 5, characterized in that, The second thread is used to report the coordinate data of the reporting point.
7. The method according to claim 6, characterized in that, The step of obtaining the second capacitance data corresponding to the first capacitance data includes: The first capacitance data is obtained through the second thread at the first moment; At a second time point, the interrupt reported by the first thread is obtained through the second thread, and the first capacity data obtained at the second time point is deleted based on the interrupt; and, The first capacity value data is obtained through the second thread at the third moment; wherein... The first time point and the second time point are adjacent times corresponding to the first frequency, and, The first time point and the third time point are adjacent times corresponding to the second frequency.
8. The method according to claim 6, characterized in that, The step of obtaining the second capacitance data corresponding to the first capacitance data includes: The first capacitance data is obtained through the second thread at the first moment; At a second time point, the interrupt reported by the first thread is obtained through the second thread, and based on the interrupt, the first tolerance data sent to the second thread at the second time point is not obtained; and, The first capacity value data is obtained through the second thread at the third moment; wherein... The first time point and the second time point are adjacent times corresponding to the first frequency, and, The first time point and the third time point are adjacent times corresponding to the second frequency.
9. The method according to any one of claims 4 to 8, characterized in that, The relationship between the first frequency and the second frequency includes: The first frequency is 60Hz, and the second frequency is 30Hz; The first frequency is 120Hz, and the second frequency is 60Hz; The first frequency is 180Hz, and the second frequency is 75Hz; The first frequency is 240Hz, and the second frequency is 120Hz; The first frequency is 320Hz, and the second frequency is 144Hz; The first frequency is 480Hz, and the second frequency is 165Hz or 240Hz.
10. The method according to claim 4, characterized in that, The electronic device includes a third thread, and, The step of obtaining the first touch event coordinate data corresponding to the reported point coordinate data includes: The third thread obtains the coordinate data of the first touch event corresponding to the reported coordinate data.
11. The method according to claim 10, characterized in that, The third thread includes an input event processing thread, an input event dispatching thread, and an input event publishing thread, and, The step of obtaining the first touch event coordinate data corresponding to the reported point coordinate data includes: The first touch event coordinate data corresponding to the reported coordinate data is obtained sequentially through the input event processing thread, the input event distribution thread, and the input event publishing thread.
12. The method according to claim 10, characterized in that, The electronic device includes a fourth thread, and, The step of obtaining the second touch event coordinate data corresponding to the first touch event coordinate data includes: The fourth thread obtains the second touch event coordinate data corresponding to the first touch event coordinate data.
13. The method according to claim 12, characterized in that, The fourth thread includes an input event consumption thread, which is used to generate touch events based on the second touch event coordinate data, and the touch events are used for consumption by the first application.
14. The method according to claim 13, characterized in that, The step of obtaining the second touch event coordinate data corresponding to the first touch event coordinate data includes: The fourth thread obtains the coordinate data of the first touch event, and... The fourth thread executes an interpolation algorithm to interpolate the coordinate data of the first touch event, thereby obtaining interpolated coordinate data. The fourth thread adds the first touch event coordinate data and the interpolated coordinate data to the event queue as the second touch event coordinate data.
15. The method according to claim 12, characterized in that, The electronic device includes a fifth thread, and, Sending the second touch event coordinate data to the first application includes: The second touch event coordinate data is sent to the fifth thread, wherein the fifth thread is the main thread of the application process of the first application.
16. The method according to claim 15, characterized in that, After sending the second touch event coordinate data to the first application, the method further includes: The fifth thread calls the system user interface thread to draw the image data corresponding to the coordinates of the second touch event.
17. The method according to claim 16, characterized in that, After sending the second touch event coordinate data to the first application, the method further includes: The system user interface thread calls the composition service thread to render the image data corresponding to the coordinates of the second touch event that has been drawn; and... The compositing service thread calls the hardware compositor to synthesize the image data corresponding to the coordinates of the second touch event that has been rendered, thereby obtaining the second image data of the first application. The hardware synthesizer invokes the display driver to control the screen to display the second image data of the first application.
18. An electronic device, characterized in that, include: One or more processors; One or more memories; the one or more memories storing one or more programs, which, when executed by the one or more processors, cause the electronic device to perform the data processing method of any one of claims 1 to 17.
19. A computer-readable medium, characterized in that, The readable medium stores instructions that, when executed on a computer, cause the computer to perform the data processing method according to any one of claims 1 to 17.
20. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the data processing method according to any one of claims 1 to 17.