Touch screen data resampling method and apparatus, electronic device, and storage medium
By performing scene recognition and resampling time difference adjustment in electronic devices, the problem that touch screen resampling methods cannot meet the needs of different scenarios is solved, and differentiated improvements in touch response speed and swiping effect are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-10-08
- Publication Date
- 2026-07-14
AI Technical Summary
In existing technologies, the resampling methods of touch screens cannot meet the differentiated needs of touch response speed and swiping effect in different scenarios, resulting in poor response performance.
By performing scene recognition on electronic devices, the target resampling time difference is determined, and the sampling time point is determined based on this time difference and the time point after the screen refresh event. The touch screen data is then resampled to obtain supplementary data.
It meets the differentiated requirements for touch response speed and swiping effect in different scenarios, and improves the touch response effect.
Smart Images

Figure CN119781629B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of touch screen technology, and in particular to a touch screen data resampling method, apparatus, electronic device, and storage medium. Background Technology
[0002] Many electronic devices now use touchscreens. The touchscreen reports touch data to the electronic device's system at a certain reporting rate, and the system responds to user touch operations based on this data. To supplement the reported touch data and increase the accuracy and smoothness of touch events, the electronic device's system typically resamples and recalculates the acquired touch data at regular intervals. Resampling algorithms refer to using known touch data to derive more or more accurate touch data through specific calculation methods.
[0003] Traditional methods typically use a fixed time point before the screen refresh time as the sampling time point for resampling calculations. However, this resampling method cannot meet the differentiated requirements for touch response speed and swiping effects in different scenarios, resulting in poor touch response performance. Summary of the Invention
[0004] This application provides a touchscreen data resampling method, apparatus, electronic device, computer-readable storage medium, and computer program product, which can improve the touch response effect.
[0005] Firstly, this application provides a touchscreen data resampling method. The method includes:
[0006] Perform scene recognition on electronic devices to obtain scene recognition results;
[0007] Based on the scene recognition results, the corresponding target resampling time difference is determined; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0008] After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event;
[0009] Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data.
[0010] Secondly, this application also provides a touchscreen data resampling device. The device includes:
[0011] The scene recognition module is used to perform scene recognition on electronic devices and obtain scene recognition results;
[0012] The time difference determination module is used to determine the corresponding target resampling time difference based on the scene recognition result; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0013] The sampling time determination module is used to determine the sampling time point based on the target resampling time difference and the time point of the screen refresh event after each screen refresh event is detected.
[0014] The resampling module is used to resample the target touchscreen data reported before the screen refresh event based on the sampling time point to obtain supplementary touchscreen data.
[0015] Thirdly, this application also provides an electronic device. The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:
[0016] Perform scene recognition on electronic devices to obtain scene recognition results;
[0017] Based on the scene recognition results, the corresponding target resampling time difference is determined; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0018] After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event;
[0019] Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data.
[0020] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0021] Perform scene recognition on electronic devices to obtain scene recognition results;
[0022] Based on the scene recognition results, the corresponding target resampling time difference is determined; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0023] After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event;
[0024] Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data.
[0025] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0026] Perform scene recognition on electronic devices to obtain scene recognition results;
[0027] Based on the scene recognition results, the corresponding target resampling time difference is determined; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0028] After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event;
[0029] Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data.
[0030] The aforementioned touchscreen data resampling method, apparatus, electronic device, computer-readable storage medium, and computer program product perform scene recognition on the electronic device to obtain scene recognition results. Based on the scene recognition results, a corresponding target resampling time difference is determined. The target resampling time difference can be flexibly adjusted according to the scene recognition results. After each screen refresh event is detected, a sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event. Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data. Since the target resampling time difference is adjusted for different scene recognition results, resampling can be performed according to different sampling time points in different scenarios. Therefore, different touch response speeds and sliding effects are achieved in different scenarios, which can meet the differentiated needs of touch response speeds and sliding effects in different scenarios and improve the touch response effect. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a diagram illustrating the application environment of a touchscreen data resampling method in one embodiment.
[0033] Figure 2 This is a flowchart of a touchscreen data resampling method in one embodiment;
[0034] Figure 3 This is a schematic diagram illustrating the determination of sampling time points in one embodiment;
[0035] Figure 4 This is a schematic diagram of the resampling process based on the application identification results in one embodiment;
[0036] Figure 5 This is a schematic diagram of the coordinate axis settings in one embodiment;
[0037] Figure 6 This is a schematic diagram of acceleration data in portrait mode in one embodiment;
[0038] Figure 7 This is a schematic diagram of acceleration data in landscape mode in one embodiment;
[0039] Figure 8 This is a schematic diagram of the resampling process based on the landscape / portrait screen recognition results in one embodiment;
[0040] Figure 9 This is a structural block diagram of a touchscreen data resampling device in one embodiment;
[0041] Figure 10 This is a schematic diagram of the internal structure of an electronic device in one embodiment. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0043] The touchscreen data resampling method provided in this application embodiment can be applied to, for example... Figure 1The application environment is shown. Electronic device 102 includes touchscreen system 1022 and electronic device system 1024. Touchscreen system 1022 and electronic device system 1024 can communicate with each other. Touchscreen system 1022 can trigger an interrupt signal via the INT pin, and electronic device system 1024 can respond to the interrupt signal to obtain touchscreen data from touchscreen system 1022. Electronic device system 1024 can also configure touchscreen system 1022 via I2C or SPI interfaces. Touchscreen system 1022 can have its own memory and processor. Electronic device system 1024 can perform scene recognition on the electronic device, obtain scene recognition results, determine the corresponding target resampling time difference based on the scene recognition results, and after each screen refresh event is detected, determine the sampling time point based on the target resampling time difference and the time point of the screen refresh event. Based on the sampling time point, the target touchscreen data reported by touchscreen system 1022 before the screen refresh event is resampled to obtain supplementary touchscreen data. Electronic device 102 may be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices with touchscreens. IoT devices may include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices may include smartwatches, smart bracelets, head-mounted devices, etc.
[0044] In one embodiment, such as Figure 2 As shown, a touchscreen data resampling method is provided, which is applied to... Figure 1 Taking electronic device system 1024 as an example, the following steps are included:
[0045] Step 202: Perform scene recognition on the electronic device to obtain the scene recognition result.
[0046] Scene recognition, in particular, is the process of identifying the operating scene of an electronic device. For example, scene recognition can identify the application running in the foreground of the electronic device or the screen orientation of the device.
[0047] Step 204: Based on the scene recognition results, determine the corresponding target resampling time difference; the target resampling time difference is the time difference between the sampling time point before the screen refresh event time point and the screen refresh event time point.
[0048] Screen refresh events are events in which electronic devices periodically refresh their screens according to a screen refresh cycle (i.e., Vsync cycle, vertical synchronization cycle). The time point of a screen refresh event is the specific point in time when the electronic device refreshes its screen. The sampling time point is used to determine the method of resampling touchscreen data. Resampling methods include interpolation and extrapolation.
[0049] In some embodiments, pre-set resampling time differences can be configured for different scenarios. The electronic device system can determine the corresponding target pre-set resampling time difference based on the scenario corresponding to the scene recognition result.
[0050] In some embodiments, the electronic device system can identify the target application launched in the foreground of the electronic device, obtain the application identification result, and then determine the corresponding target resampling time difference based on the application identification result.
[0051] In some embodiments, a preset resampling time difference can be set for different applications. For example, as shown in the table below, preset resampling time differences are set for the two different applications "Settings" and "Games". The "Settings" application uses a first preset resampling time difference of 5ms, and the "Games" application uses a second preset resampling time difference of 2ms.
[0052] application Preset resampling time difference time set up First preset resampling time difference 5ms game Second preset resampling time difference 2ms
[0053] In some embodiments, the application identification result may be the application name or application identifier of the target application. The electronic device system can determine the corresponding target resampling time difference from a preset resampling time difference set for each application based on the application name or application identifier of the target application.
[0054] In other embodiments, at least one preset application set can be set in advance, and a corresponding preset resampling time difference can be set for each preset application set.
[0055] In some embodiments, when there is only one preset application set, the application identification result can be whether the target application exists in the preset application set. If yes, the electronic device system can determine the first preset resampling time difference corresponding to the preset application set as the target resampling time difference; if no, the second preset resampling time difference can be determined as the target resampling time difference.
[0056] In some embodiments, when there are multiple preset application sets, the application identification result can be the target preset application set in which the target application exists, and the electronic device system can determine the preset resampling time difference corresponding to the target preset application set as the target resampling time difference.
[0057] In some embodiments, the electronic device system can identify the orientation of the screen (portrait or landscape) of the electronic device, obtain the orientation recognition result, and determine the corresponding target resampling time difference based on the orientation recognition result.
[0058] Step 206: After each screen refresh event is detected, determine the sampling time point based on the target resampling time difference and the time point of the screen refresh event.
[0059] In some embodiments, after determining the target resampling time difference, the electronic device system can issue a time difference adjustment instruction to the resampling service. The resampling service can respond to the time difference adjustment instruction by switching to the indicated target resampling time difference and performing step 206 and subsequent steps based on the target resampling time difference.
[0060] In some embodiments, the electronic device system can subtract the target resampling time difference from the time of each screen refresh event after it is detected to obtain the sampling time point.
[0061] For example: Assuming a screen refresh rate of 60Hz, meaning the screen refreshes 60 times per second, approximately once every 16ms, then the time points 16ms, 32ms, and 48ms are the screen refresh events. Assuming a target resampling time difference of 5ms, the sampling time point determined for the screen refresh event at 16ms is the time point corresponding to 11ms, the sampling time point for the screen refresh event at 32ms is the time point corresponding to 27ms, and the sampling time point for the screen refresh event at 48ms is the time point corresponding to 43ms. For example... Figure 3 As shown, when the target resampling time difference is 5ms, the sampling time point (i.e., the time point corresponding to the dashed line) is 5ms before the time point of the screen refresh event; when the target resampling time difference is 2ms, the sampling time point is 2ms before the time point of the screen refresh event.
[0062] Step 208: Based on the sampling time point, resample the target touchscreen data reported before the screen refresh event to obtain supplementary touchscreen data.
[0063] In some embodiments, the target touchscreen data may be the two most recently reported touchscreen data prior to the screen refresh event.
[0064] In some embodiments, the electronic device system can determine the resampling method based on the chronological relationship between the sampling time point and the target touchscreen event time point, and resample the target touchscreen data reported before the screen refresh event according to the determined resampling method to obtain supplementary touchscreen data. The target touch event is the event corresponding to the most recently reported touchscreen data before the screen refresh event.
[0065] In the aforementioned touchscreen data resampling method, scene recognition is performed on the electronic device to obtain scene recognition results. Based on the scene recognition results, the corresponding target resampling time difference is determined. The target resampling time difference can be flexibly adjusted according to the scene recognition results. After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event. Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data. Since the target resampling time difference is adjusted for different scene recognition results, resampling can be performed according to different sampling time points in different scenarios. Therefore, different touch response speeds and sliding effects are achieved in different scenarios, which can meet the differentiated needs of touch response speeds and sliding effects in different scenarios and improve the touch response effect.
[0066] In some embodiments, scene recognition is performed on the electronic device to obtain scene recognition results, including: identifying the target application launched in the foreground of the electronic device to obtain application recognition results; determining the corresponding target resampling time difference based on the scene recognition results, including: determining the corresponding target resampling time difference based on the application recognition results; the response speed required by the target application is negatively correlated with the target resampling time difference.
[0067] In some embodiments, the electronic device system can use a default preset resampling time difference as the target resampling time difference when no foreground application exists. When a foreground application exists, the electronic device system can identify the foreground application, obtain the application identification result, and proceed with subsequent steps.
[0068] It's understandable that there's a negative correlation between the response speed required by the target application and the target resampling time difference. This means that the faster the response speed required by the target application, the smaller the target resampling time difference; conversely, the slower the response speed required, the larger the target resampling time difference. For example, a "game" application needs a faster response speed, so a smaller target resampling time difference can be set for it, resulting in a more timely touch response. A "settings" application doesn't need a very fast response speed, so a larger target resampling time difference can be set for it. While the response isn't as immediate, the uniformity of the touchscreen data's coordinate intervals is better, avoiding the problem of swiping jitter.
[0069] The corresponding preset resampling time difference can be set in advance according to the response speed requirements of different applications.
[0070] In the above embodiments, the target application launched in the foreground of the electronic device is identified to obtain the application identification result. Based on the application identification result, the corresponding target resampling time difference is determined. The response speed required by the target application is negatively correlated with the target resampling time difference. Thus, different target resampling time differences can be flexibly adopted for applications with different response speed requirements, thereby improving the response effect to touch.
[0071] In some embodiments, identifying a target application launched in the foreground of an electronic device and obtaining an application identification result includes: comparing the target application launched in the foreground of the electronic device with a preset application in a preset application set to obtain an application identification result; and determining a corresponding target resampling time difference based on the application identification result, including: if the application identification result indicates that the target application exists in the preset application set, then using a first preset resampling time difference as the target resampling time difference, and using a second preset resampling time difference as the target resampling time difference after the target application exits the foreground.
[0072] In some embodiments, exiting the foreground can be switching to background operation or exiting the application.
[0073] In some embodiments, the electronic device system can compare the target application launched in the foreground of the electronic device with a preset application in a preset application set to obtain an application identification result as to whether the target application exists in the preset application set.
[0074] In some embodiments, if the application identification result indicates that the target application does not exist in the preset application set, the electronic device system may use the second preset resampling time difference as the target resampling time difference. In some embodiments, the second preset resampling time difference may be the same as or different from the default preset resampling time difference. In some embodiments, if the application identification result indicates that the target application does not exist in the preset application set, the electronic device system may not issue a time difference adjustment instruction to maintain the default preset resampling time difference.
[0075] In some embodiments, the first preset resampling time difference may be less than the second preset resampling time difference. For example, the second preset resampling time difference is 5ms, and the first preset resampling time difference is 2ms.
[0076] In the above embodiments, the target application launched in the foreground of the electronic device is compared with the preset applications in the preset application set. If the application identification result is that the target application exists in the preset application set, the first preset resampling time difference is used as the target resampling time difference. After the target application exits the foreground, the second preset resampling time difference is used as the target resampling time difference. This allows for the setting of a corresponding first preset resampling time difference specifically for the preset applications in the preset application set, improving the response effect and making the setting relatively convenient.
[0077] like Figure 4 The diagram shown is a schematic representation of the overall process of the touchscreen data resampling method based on application recognition results in the above embodiments, including the following steps:
[0078] Step 402: Store a mapping table of preset application sets and the first / second preset resampling time difference.
[0079] Step 404: Query the preset application set based on the target application launched in the foreground.
[0080] Step 406: Determine whether the target application launched in the foreground is within the preset application set. If yes, proceed to steps 408 and 410; otherwise, proceed to step 412. After completing step 410 or step 412, proceed to step 414 and subsequent steps.
[0081] Step 408: If it exists in the preset application set, then issue a time difference adjustment instruction to use the first preset resampling time difference as the target resampling time difference.
[0082] Step 410: If exiting the foreground, issue a time difference adjustment command to use the second preset resampling time difference as the target resampling time difference.
[0083] Step 412: If the application does not exist in the preset application set, the time difference adjustment instruction will not be issued.
[0084] Step 414: Switch to the corresponding target resampling time difference.
[0085] Step 416: Obtain the touch screen data reported by the touch screen, and listen for screen refresh events. After the screen refresh event is triggered, resample to obtain supplementary touch screen data.
[0086] Step 418: Respond based on the resampled touchscreen data.
[0087] In some embodiments, scene recognition is performed on the electronic device to obtain scene recognition results, including: recognizing the screen orientation of the electronic device to obtain screen orientation recognition results; and determining the corresponding target resampling time difference based on the scene recognition results, including: determining the corresponding target resampling time difference based on the screen orientation recognition results.
[0088] The screen orientation refers to the orientation of the electronic device during use. The screen orientation can be either landscape or portrait.
[0089] In some embodiments, a preset resampling time difference can be pre-set for different screen orientations (portrait and landscape). The electronic device system can use the preset resampling time difference corresponding to the screen orientation of the electronic device as the target resampling time difference based on the screen orientation recognition result.
[0090] In the above embodiments, different target resampling time differences are used for different screen orientations (horizontal and vertical), which can meet the differentiated requirements for touch response speed and swiping effect under different screen orientations, and improve the touch response effect.
[0091] In some embodiments, determining the corresponding target resampling time difference based on the screen orientation recognition result includes: if the screen orientation recognition result is a landscape orientation, then the third preset resampling time difference is used as the target resampling time difference; if the screen orientation recognition result is a portrait orientation, then the fourth preset resampling time difference is used as the target resampling time difference; wherein the third preset resampling time difference is less than the fourth preset resampling time difference.
[0092] In some embodiments, the third preset resampling time difference may be the same as or different from the first preset resampling time difference, and there is no limitation.
[0093] In some embodiments, the fourth preset resampling time difference may be the same as or different from the second preset resampling time difference, without limitation.
[0094] In the above embodiments, the target resampling time difference is set smaller in landscape mode than in portrait mode, which results in a faster response speed in landscape mode and has a better effect on some games and other applications used in landscape mode.
[0095] In some embodiments, identifying the screen orientation of the electronic device and obtaining the screen orientation recognition result includes: acquiring acceleration data of the electronic device; and determining the screen orientation recognition result of the electronic device based on the acceleration data.
[0096] In some embodiments, the electronic device system may periodically acquire acceleration data from the electronic device's accelerometer.
[0097] In some embodiments, the electronic device system may default to portrait orientation upon power-on, and then determine whether the screen orientation of the electronic device needs to be switched based on acceleration data. If so, it may switch to the orientation opposite to the current screen orientation.
[0098] In some embodiments, the electronic device system can determine target acceleration data of the electronic device in the target detection direction, and determine whether the screen orientation of the electronic device has switched based on the target acceleration data. Here, the target detection direction is the direction opposite to the screen orientation of the electronic device.
[0099] In the above embodiments, the horizontal and vertical screen recognition results of the electronic device are determined based on acceleration data, which can efficiently and accurately determine the horizontal and vertical screen orientation of the electronic device.
[0100] In some embodiments, determining the screen orientation recognition result of the electronic device based on acceleration data includes: determining the target acceleration data of the electronic device in the target detection direction; the target detection direction is the direction opposite to the screen orientation of the electronic device; if the target acceleration data falls within a preset acceleration range and the duration within the preset acceleration range is greater than or equal to a preset duration threshold, then the screen orientation of the electronic device is determined to be switched to the target detection direction.
[0101] like Figure 5 As shown, a coordinate system can be established using the electronic device as a reference. For example, the direction parallel to the horizontal side of the electronic device can be set as the x-axis, the direction parallel to the vertical side of the electronic device as the y-axis, and the direction perpendicular to the screen of the electronic device as the z-axis. The electronic device system can determine whether to switch between portrait and landscape orientations based on the target acceleration data along the coordinate axes corresponding to the target detection direction. For example, when the electronic device is in portrait orientation, the system can determine whether to switch to landscape orientation based on the acceleration data along the x-axis; when the electronic device is in landscape orientation, the system can determine whether to switch to portrait orientation based on the acceleration data along the y-axis.
[0102] It is understandable that, due to gravity, the acceleration data of an electronic device in the direction perpendicular to the ground includes the value of gravitational acceleration g. Therefore, the orientation of the electronic device's screen can be identified by determining whether its acceleration data in a certain direction falls within a preset acceleration range. For example... Figure 6 As shown, the acceleration data along the y-axis is 9.38537, which is close to the value of gravitational acceleration. Therefore, it can be determined that the direction corresponding to the y-axis is the orientation of the electronic device, that is, the electronic device is in portrait orientation. Figure 7 As shown, the acceleration data in the x-axis direction is -10.217751, which is close to the value of gravitational acceleration. Therefore, it can be determined that the direction corresponding to the x-axis is the direction of the electronic device, that is, the electronic device is in the landscape orientation.
[0103] In some embodiments, the preset acceleration range can be a preset range around the magnitude of gravitational acceleration. For example, the preset acceleration range can be [-9.8, -8] and [8, 9.8].
[0104] In some embodiments, if the duration for which the target acceleration data falls within a preset acceleration range is less than a preset duration threshold, the screen orientation will not be switched.
[0105] In some embodiments, the electronic device system may use a timer to determine the duration for which the target acceleration data falls within a preset acceleration range.
[0106] In some embodiments, if the target acceleration data does not fall within the preset acceleration range, the screen orientation will not be switched.
[0107] In the above embodiments, if the target acceleration data falls within a preset acceleration range and the duration within the preset acceleration range is greater than or equal to a preset duration threshold, the screen orientation of the electronic device is determined to be switched to the target detection direction, thereby accurately determining the screen orientation.
[0108] like Figure 8 The diagram shown is a schematic representation of the overall process for resampling touchscreen data based on the screen orientation recognition results in the above embodiments, including the following steps:
[0109] Step 802: Periodically acquire acceleration data from the accelerometer.
[0110] Step 804: Determine the screen orientation of the electronic device based on the current acceleration data.
[0111] Step 806: If the screen is in landscape mode, a time difference adjustment command is issued to use the third preset resampling time difference as the target resampling time difference.
[0112] Step 808: If the screen is in portrait mode, a time difference adjustment command is issued to use the fourth preset resampling time difference as the target resampling time difference.
[0113] Step 810: Switch to the corresponding target resampling time difference.
[0114] Step 812: Obtain the touch screen data reported by the touch screen, and listen for screen refresh events. After the screen refresh event is triggered, resample to obtain supplementary touch screen data.
[0115] Step 814: Respond based on the resampled touchscreen data.
[0116] In some embodiments, based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data, including: comparing the chronological relationship between the sampling time point and the time point of the target touchscreen event; the target touch event is the event for which the latest reported touchscreen data was submitted before the screen refresh event; if the sampling time point is before the time point of the target touchscreen event, the target touchscreen data reported before the screen refresh event is interpolated to obtain supplementary touchscreen data; if the sampling time point is after the time point of the target touchscreen event, the target touchscreen data reported before the screen refresh event is extrapolated to obtain supplementary touchscreen data.
[0117] Interpolation determines supplementary touchscreen data within the time interval between two target touchscreen data sets. Extrapolation determines supplementary touchscreen data outside the time interval between two target touchscreen data sets.
[0118] In some embodiments, the target touch event is an event of the most recently reported touchscreen data prior to the screen refresh event.
[0119] In the above embodiments, the interpolation or extrapolation is determined by comparing the chronological relationship between the sampling time point and the time point of the target touchscreen event. This allows for the accurate determination of whether to interpolate or extrapolate the target touchscreen data based on the sampling time point flexibly determined in different scenarios.
[0120] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0121] Based on the same inventive concept, this application also provides a touchscreen data resampling device for implementing the touchscreen data resampling method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more touchscreen data resampling device embodiments provided below can be found in the limitations of the touchscreen data resampling method described above, and will not be repeated here.
[0122] In some embodiments, such as Figure 9 As shown, a touchscreen data resampling device 900 is provided, including: a scene recognition module 902, a time difference determination module 904, a sampling time determination module 906, and a resampling module 908, wherein:
[0123] The scene recognition module 902 is used to perform scene recognition on electronic devices and obtain scene recognition results.
[0124] The time difference determination module 904 is used to determine the corresponding target resampling time difference based on the scene recognition result; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event.
[0125] The sampling time determination module 906 is used to determine the sampling time point based on the target resampling time difference and the time point of the screen refresh event after each screen refresh event is detected.
[0126] The resampling module 908 is used to resample the target touchscreen data reported before the screen refresh event based on the sampling time point to obtain supplementary touchscreen data.
[0127] In some embodiments, the scene recognition module 902 is further configured to recognize the target application launched in the foreground of the electronic device and obtain the application recognition result. The time difference determination module 904 is further configured to determine the corresponding target resampling time difference based on the application recognition result; the response speed required by the target application is negatively correlated with the target resampling time difference.
[0128] In some embodiments, the scene recognition module 902 is further configured to compare the target application launched in the foreground of the electronic device with a preset application in a preset application set to obtain an application recognition result. The time difference determination module 904 is further configured to, if the application recognition result indicates that the target application exists in the preset application set, use the first preset resampling time difference as the target resampling time difference, and after the target application exits the foreground, use the second preset resampling time difference as the target resampling time difference.
[0129] In some embodiments, the scene recognition module 902 is further configured to recognize the screen orientation of the electronic device and obtain a screen orientation recognition result. The time difference determination module 904 is further configured to determine the corresponding target resampling time difference based on the screen orientation recognition result.
[0130] In some embodiments, the time difference determination module 904 is further configured to, if the screen orientation recognition result is horizontal, use the third preset resampling time difference as the target resampling time difference; if the screen orientation recognition result is vertical, use the fourth preset resampling time difference as the target resampling time difference; wherein the third preset resampling time difference is less than the fourth preset resampling time difference.
[0131] In some embodiments, the scene recognition module 902 is further configured to acquire acceleration data of the electronic device; and determine the screen orientation recognition result of the electronic device based on the acceleration data.
[0132] In some embodiments, the scene recognition module 902 is further configured to determine the target acceleration data of the electronic device in the target detection direction; the target detection direction is the direction opposite to the horizontal or vertical screen orientation of the electronic device; if the target acceleration data falls within a preset acceleration range and the duration within the preset acceleration range is greater than or equal to a preset duration threshold, then the horizontal or vertical screen orientation of the electronic device is determined to be switched to the target detection direction.
[0133] In some embodiments, the resampling module 908 is further configured to compare the chronological relationship between the sampling time point and the time point of the target touch event; the target touch event is the latest event to report touch data before the screen refresh event; if the sampling time point is before the time point of the target touch event, the target touch data reported before the screen refresh event is interpolated to obtain supplementary touch data; if the sampling time point is after the time point of the target touch event, the target touch data reported before the screen refresh event is extrapolated to obtain supplementary touch data.
[0134] The aforementioned touchscreen data resampling device performs scene recognition on the electronic device, obtains scene recognition results, and determines the corresponding target resampling time difference based on the scene recognition results. It can flexibly adjust the target resampling time difference according to the scene recognition results. After each screen refresh event is detected, it determines the sampling time point based on the target resampling time difference and the time point of the screen refresh event. Based on the sampling time point, it resamples the target touchscreen data reported before the screen refresh event to obtain supplementary touchscreen data. Because the target resampling time difference is adjusted for different scene recognition results, it can resample according to different sampling time points in different scenarios. Therefore, it achieves different touch response speeds and sliding effects in different scenarios, meeting the differentiated needs for touch response speeds and sliding effects in different scenarios and improving the touch response effect.
[0135] Each module in the aforementioned touchscreen data resampling device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each module.
[0136] In one embodiment, an electronic device is provided, the internal structure of which can be shown as follows: Figure 10As shown, this electronic device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a touchscreen data resampling method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the electronic device can be a touch layer or touchpad covering the display screen, or it can be an external keyboard, touchpad, or mouse, etc.
[0137] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0138] This application also provides a computer-readable storage medium. One or more non-volatile computer-readable storage media containing computer-executable instructions, which, when executed by one or more processors, cause the processors to perform the steps of a touchscreen data resampling method.
[0139] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform a touchscreen data resampling method.
[0140] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0142] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A touchscreen data resampling method, characterized in that, include: Perform scene recognition on electronic devices to obtain scene recognition results; Based on the scene recognition results, determine the corresponding target resampling time difference; The target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event; corresponding preset resampling time differences are set in advance for different scenarios; After each screen refresh event is detected, the sampling time point is determined based on the target resampling time difference and the time point of the screen refresh event; Based on the sampling time point, the target touchscreen data reported before the screen refresh event is resampled to obtain supplementary touchscreen data.
2. The method according to claim 1, characterized in that, The process of performing scene recognition on electronic devices to obtain scene recognition results includes: The target application launched in the foreground of the electronic device is identified, and the application identification result is obtained; The step of determining the corresponding target resampling time difference based on the scene recognition result includes: Based on the application identification results, the corresponding target resampling time difference is determined; the response speed required by the target application is negatively correlated with the target resampling time difference.
3. The method according to claim 2, characterized in that, The process of identifying the target application launched in the foreground of the electronic device and obtaining the application identification result includes: The target application launched in the foreground of the electronic device is compared with a preset application in a preset application set to obtain the application identification result; The step of determining the corresponding target resampling time difference based on the application identification result includes: If the application identification result indicates that the target application exists in the preset application set, then the first preset resampling time difference is used as the target resampling time difference, and after the target application exits the foreground, the second preset resampling time difference is used as the target resampling time difference.
4. The method according to claim 1, characterized in that, The process of performing scene recognition on electronic devices to obtain scene recognition results includes: Identify the screen orientation of the electronic device to obtain the screen orientation recognition result; The step of determining the corresponding target resampling time difference based on the scene recognition result includes: Based on the horizontal and vertical screen recognition results, the corresponding target resampling time difference is determined.
5. The method according to claim 4, characterized in that, The step of determining the corresponding target resampling time difference based on the landscape / portrait screen recognition results includes: If the screen orientation recognition result is a landscape orientation, then the third preset resampling time difference is used as the target resampling time difference; If the screen orientation recognition result is a portrait orientation, then the fourth preset resampling time difference is used as the target resampling time difference; Wherein, the third preset resampling time difference is less than the fourth preset resampling time difference.
6. The method according to claim 4, characterized in that, The process of identifying the screen orientation of the electronic device and obtaining the screen orientation recognition result includes: Acquire the acceleration data of the electronic device; Based on the acceleration data, the screen orientation recognition result of the electronic device is determined.
7. The method according to claim 6, characterized in that, Determining the screen orientation recognition result of the electronic device based on the acceleration data includes: Determine the target acceleration data of the electronic device in the target detection direction; the target detection direction is the direction opposite to the horizontal or vertical screen orientation of the electronic device. If the target acceleration data falls within a preset acceleration range and the duration within the preset acceleration range is greater than or equal to a preset duration threshold, then the screen orientation of the electronic device is determined to be switched to the target detection orientation.
8. The method according to any one of claims 1 to 7, characterized in that, The step of resampling the target touchscreen data reported before the screen refresh event based on the sampling time point to obtain supplementary touchscreen data includes: Compare the chronological relationship between the sampling time point and the time point of the target touch event; the target touch event is the event that most recently reported touch screen data before the screen refresh event; If the sampling time point is before the time point of the target touchscreen event, then the target touchscreen data reported before the screen refresh event is interpolated to obtain supplementary touchscreen data; If the sampling time point is after the time point of the target touchscreen event, the target touchscreen data reported before the screen refresh event is extrapolated to obtain supplementary touchscreen data.
9. A touchscreen data resampling device, characterized in that, include: The scene recognition module is used to perform scene recognition on electronic devices and obtain scene recognition results; The time difference determination module is used to determine the corresponding target resampling time difference based on the scene recognition result; the target resampling time difference is the time difference between the sampling time point before the time point of the screen refresh event and the time point of the screen refresh event; and corresponding preset resampling time differences are set in advance for different scenarios. The sampling time determination module is used to determine the sampling time point based on the target resampling time difference and the time point of the screen refresh event after each screen refresh event is detected. The resampling module is used to resample the target touchscreen data reported before the screen refresh event based on the sampling time point to obtain supplementary touchscreen data.
10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the computer program is executed by the processor, the processor performs the steps of the touchscreen data resampling method as described in any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Touch event processing method and device, mobile terminal and storage medium
CN114341784A
Touch method and device, electronic equipment and storage medium
CN115904127A