Touch operation execution method and device, equipment, storage medium and program product
By predicting the user's touch operations and preparing resources in advance, the problem of touch operations delay in the prior art is solved, and the response efficiency and user experience are improved.
Patent Information
- Application Number
- CN202510109154.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-13
AI Technical Summary
The prior art only starts processing after the user performs a touch operation, resulting in delays, reducing the response efficiency of the touch operation and affecting the user experience.
Predict the next possible touch operations by obtaining touch data, including touch position, touch force and touch time, and inputting it into a pre-trained neural network model. The target touch operation is determined from the pending touch operation and performed when an intent for the target touch operation is received.
It significantly reduces operation delay, improves the response efficiency of touch operations, and provides a touch experience that is more in line with user needs.
Smart Images

Figure CN119987638A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, computer equipment, storage medium and program product for executing touch operations. Background Art
[0002] With the rapid development of mobile Internet technology, touch screens have become the main interactive mode for mobile devices such as smartphones and tablets. Touch operation has greatly improved the user experience due to its intuitiveness and convenience.
[0003] Currently, mobile applications and applications generally respond to user touch operations immediately. When the user actually performs a touch operation, such as clicking a button, the operation is processed. This processing method is simple and direct, and strictly follows the user's explicit instructions. In addition, the touch operation is processed according to the current page state or user location to ensure that the operation is consistent with the current context.
[0004] However, since the processing can only start after the user performs a touch operation, this causes a certain delay, thereby reducing the response efficiency of the touch operation and further affecting the user experience.
[0005] Therefore, how to improve the response efficiency of touch operations becomes a problem that needs to be solved. Summary of the invention
[0006] In view of this, the present invention provides a method, apparatus, computer device, storage medium and program product for executing a touch operation.
[0007] In a first aspect, the present invention provides a method for executing a touch operation, the method comprising: acquiring touch data; wherein the touch data comprises: touch position, touch force and touch time; inputting the touch data into a pre-trained neural network model to determine at least one pending touch operation corresponding to the touch data; determining a target touch operation from the pending touch operations; wherein the target touch operation is used to indicate a touch operation that needs to be executed in the future; and when an intention for a target touch operation is received, executing the target touch operation.
[0008] The method for executing touch operations provided in this embodiment can predict at least one possible next touch operation through touch position, touch force and touch time, combined with a pre-trained neural network model. Then, the target touch operation is determined from the touch operations, and the target touch operation is used to indicate the touch operation to be performed in the future. Then, when the intention for the target touch operation is received, the target touch operation is performed. That is, preparations can be started before the user actually performs the touch operation, such as loading necessary resources, adjusting the interface layout, etc., which significantly reduces the operation delay and improves the response efficiency of the touch operation.
[0009] In a possible implementation, a target configuration file of the touch operation to be processed and a criticality of the touch operation to be processed are obtained; a target priority corresponding to the touch operation to be processed is determined based on the target configuration file and the criticality; and the touch operation to be processed with the highest target priority is used as the target touch operation.
[0010] The touch operation execution method provided in this embodiment introduces a target configuration file, which may contain information such as the user's historical operation habits and preference settings, so that it is possible to more accurately predict the operations that the user may perform in the future, thereby providing a touch experience that better meets the user's needs.
[0011] At the same time, the target profile reflects the user's reliance on or preference for a certain operation, so it is reasonable to prioritize high-frequency operations. This approach simplifies the decision-making process while ensuring the effectiveness and accuracy of the decision. In addition, by giving priority to high-priority touch operations, resources can be allocated more efficiently. For example, for operations that require loading large amounts of data or performing complex calculations, they can be prepared in advance to ensure a quick response when the user actually performs the operation. This resource optimization strategy helps improve overall performance and user experience.
[0012] In one possible implementation, a target priority corresponding to a touch operation to be processed is determined based on a target configuration file and a criticality, including: obtaining an initial priority corresponding to the touch operation to be processed; determining a first operation type of the touch operation to be processed according to the target configuration file; determining a second operation type of the touch operation to be processed according to the criticality of the touch operation to be processed; and adjusting the initial priority based on the first operation type and the second operation type to determine the target priority.
[0013] The method for executing touch operations provided in this embodiment comprehensively considers the criticality and target configuration file, and evaluates the priority of the touch operations to be processed from two dimensions. The target configuration file reflects the degree of commonness of a certain operation by the user, while the criticality represents the importance of the touch operation to be processed. By combining the two, the user's operation needs and preferences can be more comprehensively understood, thereby more accurately determining the priority of the touch operation.
[0014] In one possible implementation, when an intention for a target touch operation is received, before executing the touch operation, the method also includes: obtaining multiple system load rates within a target time period; determining a load rate average based on the multiple system load rates within the target time period; determining a target event corresponding to the system load rate based on the load rate average; and adjusting the touch sampling rate of the target touch operation for which the target intention is collected based on the target event.
[0015] The touch operation execution method provided in this embodiment can more accurately understand the current load status by obtaining multiple system load rates within the target time period and calculating the average, and make adaptive adjustments accordingly to ensure stable performance and user experience under different load conditions.
[0016] In addition, under high load conditions, more computing resources and memory are required to process touch operations. At this time, by reducing the touch sampling rate, unnecessary resource consumption can be reduced to ensure the smooth execution of key tasks. Under low load conditions, the touch sampling rate can be increased to provide a smoother and more accurate touch experience.
[0017] In one possible implementation, the touch sampling rate of the target touch operation for collecting the target intention is adjusted according to the target event, including: if the target event is a first event, stop adjusting the touch sampling rate of the target touch operation for collecting the target intention; if the target event is a second event, reduce the touch sampling rate of the target touch operation for collecting the target intention; wherein the load rate indicated by the second event is higher than the load rate indicated by the first event.
[0018] The method for executing touch operations provided in this embodiment can implement more accurate load management by distinguishing between the first event and the second event and adjusting the touch sampling rate according to the different load rate levels indicated by them, so that appropriate measures (such as reducing the touch sampling rate) can be taken to reduce the burden under high load conditions, and when the load is relatively low, the normal touch sampling rate is maintained or restored to provide a stable user experience.
[0019] In a possible implementation, acquiring touch data includes: acquiring a specific view corresponding to a listening event; wherein the specific view indicates an area where a triggering operation is performed; and acquiring trigger data for the specific view in response to a listening event being triggered.
[0020] The method for executing touch operations provided in this embodiment can accurately locate the area that triggers the operation by obtaining the specific view corresponding to the listening event. This is crucial for understanding user intentions and responding to user operations. The specific view represents a specific element or area in the user interface. By identifying this element or area, the system can more accurately determine the operation that the user wants to perform.
[0021] In a second aspect, the present invention provides a device for executing a touch operation, the device comprising: a touch data acquisition module, used to acquire touch data; wherein the touch data comprises: touch position, touch force and touch time; a first determination module, used to input the touch data into a pre-trained neural network model, and determine at least one pending touch operation corresponding to the touch data; a second determination module, used to determine a target touch operation from the pending touch operations; wherein the target touch operation is used to indicate a touch operation that needs to be executed in the future; and an execution module, used to execute the touch operation when an intention for a target touch operation is received.
[0022] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the touch operation execution method of the above-mentioned first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0023] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for executing the touch operation of the first aspect or any corresponding embodiment thereof.
[0024] In a fifth aspect, the present invention provides a computer program product, including computer instructions, where the computer instructions are used to enable a computer to execute the method for executing the touch operation of the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 is a schematic flow chart of a method for executing a touch operation according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of a method for executing a touch operation according to an embodiment of the present invention;
[0028] Figure 3 is a structural block diagram of a device for executing touch operation according to an embodiment of the present invention;
[0029] Figure 4 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] Based on relevant technologies, mobile applications currently generally adopt the method of responding to user touch operations immediately. When the user actually performs a touch operation, such as clicking a button, the operation will be processed. This processing method is simple and direct, and strictly follows the user's explicit instructions. In addition, the touch operation will be processed according to the current page state or user location to ensure the consistency of the operation with the current context.
[0032] However, since the processing can only start after the user performs a touch operation, this causes a certain delay, thereby reducing the response efficiency of the touch operation and further affecting the user experience.
[0033] Based on this, the present invention provides a method for executing a touch operation, which can predict at least one possible next touch operation through the touch position, touch force and touch time, combined with a pre-trained neural network model. Then, a target touch operation is determined from the touch operation, and the target touch operation is used to indicate the touch operation that needs to be performed in the future. Then, when the intention for the target touch operation is received, the target touch operation is performed. That is, preparations can be started before the user actually performs the touch operation, such as loading necessary resources, adjusting the interface layout, etc., which significantly reduces the operation delay and improves the response efficiency of the touch operation.
[0034] According to an embodiment of the present invention, an embodiment of a method for executing a touch operation is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] In this embodiment, a method for executing a touch operation is provided, which can be used in a mobile terminal, such as a mobile phone, a tablet computer, etc. Figure 1 is a flow chart of a method for executing a touch operation according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0036] Step S101, acquiring touch data; wherein the touch data includes: touch position, touch force and touch time.
[0037] The touch data may be data generated by a user touching the screen, wherein the touch data includes: touch position, touch strength and touch time.
[0038] During the specific implementation process, if the terminal is an Android system, the configuration for obtaining touch data can be: create a new Android project in AndroidStudio, select the appropriate interface API level, define a view for listening to touch events in the project directory, and set touch event listening for a specific view in the Activity. Specifically, the touch position, touch force and touch time can be determined by the following mathematical function formula.
[0039] F(x, y, t, p) = {ACTION_DOWN: process press event, ACTION_MOVE: process move event, ACTION_UP: process lift event}. F represents the touch event processing function; x represents the horizontal coordinate of the touch point; y represents the vertical coordinate of the touch point; t represents the time of the touch event; p represents the touch force; this formula can represent that according to different touch event types (ACTION_DOWN, ACTION_MOVE, ACTION_UP), the coordinates (x, y), time (t) and force (p) of the touch point are processed accordingly to determine the touch position, touch force and touch time.
[0040] After acquiring the touch data, the touch signal of the collected touch data can be preprocessed, mainly including denoising, filtering and feature extraction. Denoising and filtering can eliminate interference components in the signal and improve signal quality. Feature extraction reduces the dimension of the touch signal and extracts key features to provide data support for subsequent touch response prediction.
[0041] As an example, denoising is the first step in preprocessing, which aims to remove random noise from the signal. The specific steps are as follows: Identify the noise type: determine whether the noise is Gaussian noise, salt and pepper noise, or other types;
[0042] Apply filters: For Gaussian noise, you can use a mean filter or a median filter. For salt and pepper noise, a median filter usually works better. Nonlinear processing: Use wavelet transform to remove noise. The purpose of filtering is to retain useful signals and remove or reduce interference components.
[0043] Specific steps: Choose the appropriate filter: Low-pass filter: remove high-frequency noise and retain low-frequency useful signals; High-pass filter: remove low-frequency interference and DC offset; Band-pass filter: only allow signals within a specific frequency range to pass;
[0044] Design filter parameters: Design the filter cutoff frequency, order, etc. according to the signal characteristics and requirements, and then apply the finite impulse response digital filter. Feature extraction is to convert the original signal into useful information for subsequent processing and analysis. The specific steps are as follows:
[0045] Determine the feature type: time domain features: mean, variance, root mean square value; frequency domain features: spectrum peak, spectrum energy; time-frequency features: short-time Fourier transform, wavelet transform; feature calculation: use signal processing algorithms to calculate the above features, and normalize the features to eliminate dimensionality effects; feature selection: use principal component analysis (PCA) method to select the most representative and discriminative features.
[0046] Step S102: input the touch data into a pre-trained neural network model to determine at least one touch operation to be processed corresponding to the touch data.
[0047] The pre-trained neural network model may be a support vector machine (SVM), and the touch data may be input into the pre-trained neural network model to output one or more touch operations to be processed. The touch operations to be processed may be predicted operations that the user wants to perform next, such as clicking position A, clicking position B, etc., which are not specifically limited here.
[0048] In one possible implementation, a pre-trained neural network model can be constructed through the following process.
[0049] Forward Propagation Algorithm:
[0050] f(x)=σ(Wx+b); where f(x) is the output of the neuron, σ is the activation function, W is the weight matrix, b is the bias term, and x is the input.
[0051] Back Propagation Algorithm:
[0052] Where E is the loss function and net is the weighted input of the neuron.
[0053] Sigmoid function:
[0054] ReLU function: ReLU(x)=max(0,x).
[0055] Mean Squared Error (MSE): Among them, y i is the true value, is the predicted value.
[0056] Stochastic Gradient Descent (SGD):
[0057] Among them, α is the learning rate, is the gradient of the loss function with respect to the weights.
[0058] In a possible implementation, a support vector machine is used to predict the touch response according to the preprocessed touch signal features, and a machine learning algorithm support vector machine (SVM) is used to predict the touch signal, which is divided into the following steps:
[0059] The processed data is divided into training set and test set, usually in a ratio of 70%-30% or 80%-20%. The grid search method is used to optimize the SVM parameters and the training set data is used to train the SVM model. Cross-validation is used during the training process to evaluate the generalization ability of the model. Accuracy, recall rate, F1 score and other indicators are used to evaluate the performance of the model.
[0060] Among them, data preprocessing (standardization):
[0061] Among them, X is the original feature data, μ is the mean of the feature, and σ is the standard deviation of the feature.
[0062] Dataset division:
[0063] X train ,X test ,y train ,y test =
[0064] train test split(X scaled ,y,test size=0.2,random state=42); where X train : stroke
[0065] The separated training data set data; X test : The divided test data set data; y train : The label of the divided training data set; y TesT : The label of the divided test data set; train_test_split: the function used to divide the data; X scaled : standardized data after preprocessing; test size: the ratio of the number of test set samples to the number of original samples; random state: random number seed, different random number seeds will produce different division results.
[0066] SVM model training (using grid search and cross validation):
[0067] grid=GridSearchCV(SVC(),param grid,refit=True,verbose=2,cv=5); where GridSearchCV: grid search initialization function; grid: function return value receiving variable; SVC(): select the classifier to be used; param grid : The value of the parameter to be optimized, the value is a dictionary or a list; refit: after the search for parameters is completed, the entire data set is processed again with the optimal parameter results; verbose: log level; cv: cross-validation method, specify the number of cross-validation folds.
[0068] grid.fit(X train ,y train ); grid.fit means running a grid search; X train : divided training data set data; y train : Labels of the divided training data set.
[0069] Optimal parameter selection:
[0070] best_params=grid.best-params; where best_params: a variable used to store the best parameters; grid.best-params: the best parameters fed back after the grid search.
[0071] Model evaluation (classification report):
[0072] predictions = grid.predict(X test ); predictions: variables used to store evaluation results; grid.predict(): use the specified data set for evaluation; X test : The divided test data set data.
[0073] classification_report(y test , predictions); where classification_report: function to generate text report; y test : The label of the divided test data set; predictions: variables used to store the evaluation results.
[0074] These steps can be summarized as a mathematical function that represents the entire machine learning process:
[0075] ML-Pipeline(X,y)=(classification_report(y test ,predictions),bestparams)
[0076] in:
[0077] predictions=
[0078] GridSearchCV.fit_predict(train-test_split(StandardScaler.fit_transform(X),y)); ML-Pipeline(X,y): represents the entire machine learning process; classification_report: function to generate a text report; y test : The label of the divided test data set; predictions: variables used to store evaluation results; best_params: variables used to store the best parameters;
[0079] GridSearchCV.fit_predict: used to train the model and return the cluster label for each sample;
[0080] train_test_split: Function for data partitioning; StandardScaler.fit_transform:
[0081] Performs data normalization and partial training work functions.
[0082] Step S103, determining a target touch operation from the touch operations to be processed; wherein the target touch operation is used to indicate a touch operation to be executed in the future.
[0083] If multiple touch operations to be processed are determined, it is necessary to determine a target touch operation from the multiple touch operations to be processed, and the target touch operation is used to indicate a touch operation that needs to be executed in the future.
[0084] As an example, the number of target touch operations may be one or more, wherein the target touch operation may be determined according to the priority of the multiple touch operations to be processed, that is, the touch operation to be processed with a high priority is the target touch operation.
[0085] Among them, the to-be-processed touch operations ranked in the top three in priority may be taken as the target touch operations, and the to-be-processed touch operation ranked in the first (highest) priority may also be taken as the target touch operation, and so on.
[0086] Step S104: when an intention for a target touch operation is received, executing the target touch operation.
[0087] From the above, we can see that the target touch operation is an operation that is about to occur in the future, that is, the user's future movements are predicted, but the target touch operation has not occurred yet, that is, the resources for the target touch operation can be loaded in advance, and then when the terminal device receives the intention for the target touch operation, the target touch operation is executed, that is, in the area where it is predicted that the user may slide or click, rendering processing is performed in advance, and the predicted operation is slightly executed, but it is not actually triggered until it is confirmed that the user's intention is for the target touch operation, and then the target touch operation is executed.
[0088] The method for executing touch operations provided in this embodiment can predict at least one possible next touch operation through touch position, touch force and touch time, combined with a pre-trained neural network model. Then, the target touch operation is determined from the touch operations, and the target touch operation is used to indicate the touch operation to be performed in the future. Then, when the intention for the target touch operation is received, the target touch operation is performed. That is, preparations can be started before the user actually performs the touch operation, such as loading necessary resources, adjusting the interface layout, etc., which significantly reduces the operation delay and improves the response efficiency of the touch operation.
[0089] In a possible implementation, the above step S103 includes:
[0090] Step a1, obtaining a target configuration file of the touch operation to be processed and the criticality of the touch operation to be processed.
[0091] The target profile may include a frequently used list and an infrequently used list, wherein the target profile may be determined by the user's operation frequency. The operation frequency may represent the number of operations within a certain period of time. For example, click position A 10 times within 20 seconds. The criticality of the touch operation to be processed may represent the importance of the touch operation to be processed.
[0092] Step a2: determining the target priority corresponding to the touch operation to be processed based on the target configuration file and the criticality.
[0093] The target configuration file and the criticality both have corresponding correlation coefficients. The corresponding correlation coefficients are determined by the target configuration file and the criticality, and then the target priority corresponding to each touch operation to be processed is determined.
[0094] Specifically, the above step a2 may include:
[0095] Step a21, obtaining the initial priority corresponding to the touch operation to be processed.
[0096] The initial priority may be a priority set by humans, wherein the initial priority may be N1 or N2, etc., which is not specifically limited here.
[0097] Step a22: determining a first operation type of the touch operation to be processed according to the target configuration file.
[0098] The target configuration file may be configured with common operations and uncommon operations, and correspondingly, the first operation type may be a common operation type and an uncommon operation type. After determining a pending operation, it may be determined as a common operation type or an uncommon operation type according to the type of the pending operation.
[0099] Step a23: determining a second operation type of the touch operation to be processed according to the criticality of the touch operation to be processed.
[0100] The criticality of the touch operation to be processed can characterize the importance of the touch operation to be processed. Among them, the criticality of the touch operation to be processed may already exist after the prediction of the neural network model, or may be set manually, or may be configured through the terminal device, etc., which is not specifically limited here. The second operation type may be a type of importance. That is, when the criticality is greater than the preset threshold, it is an emergency event, and if the criticality is not greater than the preset threshold, it is a non-emergency event. Among them, the preset threshold can be set manually, and the preset threshold may be M1, or M2, etc., which is not specifically limited here.
[0101] Step a24, adjusting the initial priority based on the first operation type and the second operation type to determine the target priority.
[0102] After determining the first operation type and the second operation type, an adjustment coefficient of the priority may be determined according to the first operation type and the second operation type, and then the initial priority may be adjusted according to the adjustment coefficient to determine the target priority.
[0103] As an example, the target priority can be determined by the following formula:
[0104] P = P0 + [10 × I (S = 'critical_operation') + 5 × I (E∈F)]; where P0 = get_default_priority (touch_event), i.e., the default priority of the touch event; S = current_scene, criticality U = user_profile; user profile; E = touch_event, touch event; F = frequent_action; a list of frequently used operations in the user profile.
[0105] I is an indicator function, which returns 1 or 0 depending on whether the condition is met. Specifically: I(S='critical_operation') returns 1 if the current scene is critical_operation, otherwise returns 0; I(E∈F) returns 1 if the touch event E is in the common operation list F, otherwise returns 0. Through the above steps, the priority of touch events can be dynamically adjusted effectively, thereby optimizing the user experience.
[0106] Step a3: taking the to-be-processed touch operation with the highest target priority as the target touch operation.
[0107] In this embodiment, the to-be-processed touch operation with the highest target priority may be used as the target touch operation.
[0108] As an example, the priority of touch events is dynamically adjusted according to user operation habits and scenarios to ensure that key operations are responded to first. The specific steps for priority adjustment are as follows: collect user operation data through the user interface, including clicks, slides, long presses and other behaviors, and analyze the context in which user operations occur, such as application status, network conditions, etc.; count the frequency of user operations and identify common operations and uncommon operations; define the priority of different operations based on the importance and urgency of the operations; formulate priority rules for touch events for different scenarios, design algorithms, and dynamically adjust the priority of touch events according to the current scenario and user behavior model.
[0109] The touch operation execution method provided in this embodiment introduces a target configuration file, which may contain information such as the user's historical operation habits and preference settings, so that it is possible to more accurately predict the operations that the user may perform in the future, thereby providing a touch experience that better meets the user's needs.
[0110] At the same time, the target profile reflects the user's reliance on or preference for a certain operation, so it is reasonable to prioritize high-frequency operations. This approach simplifies the decision-making process while ensuring the effectiveness and accuracy of the decision. In addition, by giving priority to high-priority touch operations, resources can be allocated more efficiently. For example, for operations that require loading large amounts of data or performing complex calculations, they can be prepared in advance to ensure a quick response when the user actually performs the operation. This resource optimization strategy helps improve overall performance and user experience.
[0111] In addition, the priority of the touch operations to be processed is evaluated from two dimensions by taking into account the criticality and target profile. The target profile reflects the degree of commonness of a certain operation by the user, while the criticality represents the importance of the touch operation to be processed. By combining the two, a more comprehensive understanding of the user's operation needs and preferences can be achieved, thereby more accurately determining the priority of touch operations.
[0112] In a possible implementation, before the above step S104, the above method further includes:
[0113] Step b1, obtaining multiple system load rates within a target time period.
[0114] The target time period may represent the time period from when the user touches the screen to when the next touch operation by the user is predicted. When the user touches the screen, the system load rate may be determined.
[0115] Step b2: determining a load rate average according to multiple system load rates within the target time period.
[0116] After determining a plurality of system load rates, the system load rates may be averaged to obtain a load rate mean.
[0117] Step b3: determining the target event corresponding to the system load rate according to the load rate mean.
[0118] The target event may represent a high load rate event or a low load rate event. The target event corresponding to the system load rate is determined according to the load rate mean. For example, when the load rate mean is high, the target event corresponding to the system load rate is determined to be a high load rate event.
[0119] As an example, when the system load is high, the touch sampling rate is reduced, the touch event processing time is reduced, and the touch sampling rate is dynamically adjusted. The specific implementation steps are as follows: Monitor the system load: Use the API provided by the operating system, that is, the / proc / loadavg file in the Android system to obtain the system load, set a scheduled task (for example, using cronjob or system timer), and periodically check the system load; Define the load entropy value: Define the high load threshold based on the system performance test results, and the threshold should be configurable to facilitate adjustment according to different devices and scenarios; Write a touch sampling rate adjustment script: Write a script, which is specifically expressed as follows:
[0120] Where: L represents the average load of the system within 1 minute (SYSTEM_LOAD).
[0121] T represents the system load threshold (LOAD_THRESHOLD).
[0122] S represents the current touch sampling rate (TOUCH_SAMPLING_RATE).
[0123] S low Indicates the touch sampling rate under low load (LOW_SAMPLING_RATE).
[0124] S high Indicates the touch sampling rate under high load (HIGH_SAMPLING_RATE).
[0125] f(L,S) is a function that determines the touch sampling rate S according to the value of the system load L. If the system load is greater than the threshold T, the low sampling rate S is set. low ; Otherwise, set the high sampling rate S high .
[0126] Through the above steps and mathematical formulas, when it is detected that the system load exceeds the threshold, the system interface is called to reduce the touch sampling rate. When the system load is lower than the threshold, the touch sampling rate is restored. Test and verify: run the script under different load conditions to verify whether the touch sampling rate is adjusted as expected, monitor system performance indicators, and ensure the effectiveness of the optimization strategy.
[0127] Step b4: adjusting the touch sampling rate of the target touch operation for collecting the target intention according to the target event.
[0128] After determining the target event, if the target event is a high load rate event and the intention of the target touch operation is received, the touch sampling rate can be reduced to reduce the touch event processing time.
[0129] Specifically, the above step b4 includes:
[0130] Step b41: if the target event is the first event, stop adjusting the touch sampling rate of the target touch operation for which the target intention is collected.
[0131] The first event may be a low load rate event. In this embodiment, if the system is at a low load rate, it will not affect the system, and there is no need to adjust the touch sampling rate of the target touch operation for collecting the target intent.
[0132] Step b42: if the target event is the second event, reducing the touch sampling rate of the target touch operation for which the target is intended to be collected; wherein the load rate indicated by the second event is higher than the load rate indicated by the first event.
[0133] The second event may be a high load rate event. In this embodiment, if it is a high load rate event, the touch sampling rate of the target touch operation for which the target intention is collected may be reduced; wherein the load rate indicated by the second event is higher than the load rate indicated by the first event.
[0134] The touch operation execution method provided in this embodiment can more accurately understand the current load status by obtaining multiple system load rates within the target time period and calculating the average, and make adaptive adjustments accordingly to ensure stable performance and user experience under different load conditions.
[0135] In addition, under high load conditions, more computing resources and memory are required to process touch operations. At this time, by reducing the touch sampling rate, unnecessary resource consumption can be reduced to ensure the smooth execution of key tasks. Under low load conditions, the touch sampling rate can be increased to provide a smoother and more accurate touch experience.
[0136] In addition, by distinguishing between the first event and the second event and adjusting the touch sampling rate according to the different load rate levels indicated by them, more precise load management can be implemented, so that appropriate measures (such as reducing the touch sampling rate) can be taken to reduce the burden under high load conditions, and when the load is relatively low, the normal touch sampling rate is maintained or restored to provide a stable user experience.
[0137] In a possible implementation, the above step S101 includes:
[0138] Step c1, obtaining a specific view corresponding to the listening event; wherein the specific view indicates an area where a triggering operation is performed.
[0139] The specific view indicates the area where the triggering operation is performed. Among them, there may be multiple touchable areas in a terminal interface. The specific view may represent a touchable area in the terminal interface, or multiple touchable areas, etc. Among them, the specific view may be set autonomously by humans, or may be determined by other means, which is not specifically limited here.
[0140] Step c2: in response to the monitoring event being triggered, obtaining trigger data for a specific view.
[0141] During the specific implementation process, if the terminal is an Android system, the configuration for obtaining touch data can be: create a new Android project in AndroidStudio, select the appropriate interface API level, define a view for listening to touch events in the project directory, and set touch event listening for a specific view in the Activity. Specifically, the touch position, touch force and touch time can be determined by the following mathematical function formula.
[0142] The method for executing touch operations provided in this embodiment can accurately locate the area that triggers the operation by obtaining the specific view corresponding to the listening event. This is crucial for understanding user intentions and responding to user operations. The specific view represents a specific element or area in the user interface. By identifying this element or area, the system can more accurately determine the operation that the user wants to perform.
[0143] Please refer to Figure 2 , Figure 2 is a schematic diagram of a method for executing a touch operation provided according to an embodiment of the present invention.
[0144] Step 1: Obtain user touch operation data in real time by monitoring hardware touch events. Step 2: Preprocess the collected touch signals, mainly including denoising, filtering and feature extraction. Denoising and filtering can eliminate interference components in the signal and improve signal quality. Feature extraction is to reduce the dimension of the touch signal and extract key features to provide data support for subsequent touch response prediction. Step 3: According to the preprocessed touch signal characteristics, support vector machine is used to predict the touch response. Step 4: According to the touch response prediction results, a touch optimization strategy is formulated. Step 5: Apply the formulated touch optimization strategy to the Android system to adjust the touch response behavior in real time.
[0145] Specifically, touch operation data includes touch position, touch force, and touch time. The basic steps to implement touch signal collection include: create a new Android project in AndroidStudio, select the appropriate API level, define your layout file in the project directory, which includes the view for which you want to monitor touch events, and set touch event monitoring for specific views in your Activity. Through the above steps, you can implement real-time monitoring of user touch behavior and collection of touch signals in Android applications.
[0146] Denoising is the first step in preprocessing, and its purpose is to eliminate random noise in the signal. The specific steps are: identifying the noise type, applying filters and nonlinear processing. The purpose of filtering is to retain useful signals and remove or reduce interference components. The specific steps are: selecting appropriate filters, designing filter parameters and applying digital filters. Feature extraction is to convert the original signal into useful information for subsequent processing and analysis. The specific steps are: determining feature types, feature calculations and feature selection.
[0147] The touch signal is predicted using the machine learning algorithm support vector machine (SVM), which is divided into the following steps: the processed data is divided into a training set and a test set, usually in a ratio of 70%-30% or 80%-20%, the parameters of the SVM are optimized using the grid search method, the SVM model is trained using the training set data, cross-validation is used during the training process to evaluate the generalization ability of the model, accuracy, recall rate, F1 score and other indicators are used to evaluate the performance of the model, the trained model is used to predict the test set, and the prediction results of the touch response time and response accuracy are obtained, the prediction results are compared with the actual results, and the prediction accuracy of the model is analyzed.
[0148] Touch optimization strategies include priority adjustment: dynamically adjusting the priority of touch events based on user operating habits and scenarios to ensure priority response to key operations, predictive touch response: predicting the user's next operation based on user operating habits and performing touch response in advance, and dynamic adjustment of touch sampling rate: when the system load is high, reducing the touch sampling rate to reduce touch event processing time.
[0149] The specific implementation steps for dynamically adjusting the touch sampling rate are as follows: Monitor the system load: Use the API provided by the operating system, that is, the / proc / loadavg file in the Android system to obtain the system load, set a scheduled task (for example, using cronjob or system timer), and periodically check the system load; Define the load entropy value: Define the high load threshold based on the system performance test results, and the threshold should be configurable to facilitate adjustment according to different devices and scenarios; Write a touch sampling rate adjustment script: Write a script, when it is detected that the system load exceeds the threshold, call the system interface to reduce the touch sampling rate, when the system load is lower than the threshold, restore the touch sampling rate; Test and verify: Run the script under different load conditions to verify whether the touch sampling rate is adjusted as expected, monitor system performance indicators, and ensure the effectiveness of the optimization strategy.
[0150] The specific implementation steps of predictive touch response are as follows: Analyze user behavior data through neural network algorithms, identify operation patterns, count the frequency of user operations, determine which operations are more likely to be repeated, build a prediction model, and use the collected data to train the model so that it can predict future operations based on historical behaviors. For predicted operations, it can load the resources that may be needed in advance to reduce response time. In areas where it is predicted that the user may slide or click, render in advance, and perform the predicted operation lightly, but do not actually trigger it until the user's intention is confirmed.
[0151] The specific implementation steps of priority adjustment are as follows: collecting user operation data through the user interface, including clicks, slides, long presses and other behaviors, analyzing the context in which user operations occur, application status, network conditions, etc.; counting the frequency of user operations, identifying common operations and uncommon operations; defining the priority of different operations based on the importance and urgency of the operations; formulating priority rules for touch events for different scenarios, designing algorithms, and dynamically adjusting the priority of touch events based on the current scenario and user behavior model. Through the above steps, the dynamic adjustment of the priority of touch events can be effectively achieved, thereby optimizing the user experience.
[0152] The touch operation execution method provided in this embodiment dynamically adjusts the priority of touch events according to user operation habits and scenarios, ensuring that key operations can be responded to first, thereby improving the user's operation fluency and satisfaction, and by predicting the touch response through a support vector machine (SVM), resources can be prepared in advance, the response time of touch events can be reduced, and the reaction speed of the system can be improved. In addition, the user behavior data is analyzed using a neural network algorithm to predict the user's next operation and perform touch response in advance, further improving the interactivity and intelligence of the system. In addition, by monitoring the system load and dynamically adjusting the touch sampling rate, the system performance and touch response requirements are effectively balanced, ensuring the stability and responsiveness of the system under high load conditions. Finally, through predictive touch response and dynamic touch sampling rate adjustment, system resources are reasonably allocated, unnecessary resource waste is avoided, and the resource utilization of the system is improved.
[0153] In this embodiment, a device for executing touch operation is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0154] This embodiment provides a touch operation execution device, such as Figure 3 As shown, it includes: a touch data acquisition module 301, used to acquire touch data; wherein the touch data includes: touch position, touch force and touch time; a first determination module 302, used to input the touch data into a pre-trained neural network model, and determine at least one pending touch operation corresponding to the touch data; a second determination module 303, used to determine a target touch operation from the pending touch operations; wherein the target touch operation is used to indicate a touch operation that needs to be performed in the future; an execution module 304, used to execute the target touch operation when an intention for a target touch operation is received.
[0155] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0156] The touch operation execution device in this embodiment is presented in the form of a functional unit, where the functional unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0157] The embodiment of the present invention also provides a computer device having the above Figure 3 The device for executing the touch operation is shown.
[0158] See also Figure 4 , Figure 4 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 4 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or multiple processors). Figure 4 A processor 10 is taken as an example.
[0159] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0160] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0161] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store applications required for operation or at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0162] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0163] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0164] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0165] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0166] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for performing a touch operation, characterized in that: The method comprises: Acquire touch data; wherein the touch data includes: touch position, touch force and touch time; Inputting the touch data into a pre-trained neural network model to determine at least one touch operation to be processed corresponding to the touch data; Determining a target touch operation from the touch operations to be processed; wherein the target touch operation is used to indicate a touch operation to be performed in the future; When an intention for the target touch operation is received, the target touch operation is performed.
2. The method for executing touch operation according to claim 1, characterized in that: The determining a target touch operation from the touch operations to be processed includes: Obtaining a target configuration file of the touch operation to be processed and a criticality of the touch operation to be processed; Determining a target priority corresponding to the touch operation to be processed based on the target configuration file and the criticality; The to-be-processed touch operation with the highest target priority is taken as the target touch operation.
3. The method for executing touch operation according to claim 2, characterized in that: The determining the target priority corresponding to the to-be-processed touch operation based on the target configuration file and the criticality includes: Get the initial priority of the touch operation to be processed; Determining a first operation type of the touch operation to be processed according to the target configuration file; Determining a second operation type of the touch operation to be processed according to the criticality of the touch operation to be processed; The initial priority is adjusted based on the first operation type and the second operation type to determine a target priority.
4. The method for executing touch operation according to claim 1, characterized in that: When an intention for the target touch operation is received, before executing the target touch operation, the method further includes: Obtain multiple system load rates within a target time period; Determining a load rate average according to multiple system load rates within the target time period; Determining a target event corresponding to the system load rate according to the load rate mean; According to the target event, a touch sampling rate of a target touch operation for collecting the target intention is adjusted.
5. The method for executing touch operation according to claim 4, characterized in that: The step of adjusting the touch sampling rate of the target touch operation for collecting the target intention according to the target event includes: If the target event is the first event, stop adjusting the touch sampling rate of the target touch operation for collecting the target intention; If the target event is a second event, reducing the touch sampling rate of the target touch operation for which the target is intended to be collected; wherein the load rate indicated by the second event is higher than the load rate indicated by the first event.
6. The method for performing touch operation according to claim 1, characterized in that: The acquiring of touch data includes: Obtaining a specific view corresponding to the listening event; wherein the specific view indicates an area where a triggering operation is performed; In response to the monitoring event being triggered, trigger data for the specific view is obtained.
7. A touch operation execution device, characterized in that: The device comprises: A touch data acquisition module, used to acquire touch data; wherein the touch data includes: touch position, touch force and touch time; A first determination module, configured to input the touch data into a pre-trained neural network model to determine at least one touch operation to be processed corresponding to the touch data; A second determination module, configured to determine a target touch operation from the touch operations to be processed; wherein the target touch operation is used to indicate a touch operation to be performed in the future; The execution module is used to execute the target touch operation when receiving the intention for the target touch operation.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the touch operation execution method according to any one of claims 1 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for executing a touch operation according to any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to enable a computer to execute the method for executing the touch operation according to any one of claims 1 to 6.