An AI-based Automatic Keyboard Error Correction Method and System

Through the AI keyboard error correction technology with a dual-layer asynchronous collaborative architecture, the combination of local lightweight models and cloud-based large models is used to solve error correction problems in complex contexts, and the balance between real-time response and high accuracy is achieved, adapting to different users and device states, improving the fluency and error correction quality of keyboard input.

CN120215722BActive Publication Date: 2025-08-01渴创技术(深圳)有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510697959.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-28
Publication Date
2025-08-01
Estimated Expiration
2045-05-28

AI Technical Summary

Technical Problem

Existing keyboard input error correction technology performs poorly in complex contexts, unable to effectively handle social media abbreviations, professional terms and multilingual hybrid scenarios, and has the ability to compute, battery life and network conditions on resource-constrained devices that affect the performance of error correction system.

Method used

Using a dual-layer asynchronous collaboration architecture based on AI, combining local lightweight models and cloud-based large models, the input intention probability matrix is constructed by collecting contact pressure distribution, sliding trajectory and residence time, conducting preliminary correction and in-depth semantic analysis, and achieving a balance between real-time response and high accuracy through recursive knowledge distillation and personalized tuning of network optimization models.

Benefits of technology

While ensuring response speed, improving error correction quality, reducing user perception delay, adapting to different user input habits and device status, improving the system's adaptability to weak network environments and low-resource devices, and providing a smoother input experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120215722B_ABST
    Figure CN120215722B_ABST
Patent Text Reader

Abstract

This application relates to the field of keyboard error correction technology, and discloses an AI-based automatic keyboard error correction method and system. The method includes: collecting the contact pressure distribution, sliding trajectory, and dwell time of the user's keyboard input and constructing an input intention probability matrix; performing error detection and preliminary correction through a first local lightweight model to obtain a first correction result, which is transmitted to a cloud large model for in-depth semantic analysis to obtain a second correction result; performing recursive knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model; collecting the behavioral feedback data of the user's acceptance or rejection of the second correction result and dynamically adjusting the task allocation of the second local lightweight model and the cloud large model, and outputting a two-layer asynchronous collaborative error correction strategy, thereby improving the error correction quality while ensuring the response speed, effectively reducing the user's perceived latency, and providing a smoother input experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of keyboard error correction technology, and particularly to an AI-based automatic keyboard error correction method and system. Background Art

[0002] Traditional input error correction methods mainly rely on static dictionaries and simple rules, and cannot effectively handle errors in complex contexts, especially performing poorly in non-standard text environments such as social media abbreviations, technical terms, and multilingual mixed scenarios. Although existing cloud-based large model solutions have achieved breakthroughs in accuracy, they consume huge amounts of computing resources, resulting in significant response delays and seriously affecting the user experience; while lightweight local models can achieve fast responses, they have obvious deficiencies in complex semantic understanding and context-related error handling.

[0003] The current keyboard input error correction technology on the market lacks effective device adaptability and personalized adjustment capabilities, and cannot dynamically adjust error correction strategies according to different users' input habits and device states. Especially on resource-constrained mobile devices, factors such as computing power, battery life, and network conditions will significantly affect the performance and usability of the error correction system. Most solutions either rely entirely on cloud processing, resulting in unstable experiences during network fluctuations, or only rely on local simple models, resulting in insufficient error correction quality, and lack a collaborative architecture that combines the advantages of both. Summary of the Invention

[0004] This application provides an AI-based automatic keyboard error correction method and system, which improves the error correction quality while ensuring the response speed, thereby effectively reducing the user-perceived latency and providing a smoother input experience.

[0005] In the first aspect of this application, an AI-based automatic keyboard error correction method is provided. The AI-based automatic keyboard error correction method includes:

[0006] Collect the contact pressure distribution, sliding trajectory, and dwell time of the user's keyboard input and construct an input intention probability matrix;

[0007] Input the input intention probability matrix into the first local lightweight model for error detection and preliminary correction to obtain a first correction result;

[0008] Transmit the first correction result and the input intention probability matrix to the cloud large model for in-depth semantic analysis to obtain a second correction result;

[0009] Perform recursive knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model;

[0010] Collect the behavioral feedback data of the user's acceptance or rejection of the second correction result, and dynamically adjust the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and output a two-layer asynchronous collaborative error correction strategy.

[0011] Combined with the first aspect, in the first implementation manner of the first aspect of the present invention, the collecting the contact pressure distribution, sliding trajectory and residence time of the keyboard input by the user and constructing an input intention probability matrix includes:

[0012] Collect the key pressure data through the embedded sensor array in the user device to obtain the contact pressure distribution data;

[0013] Track the moving coordinates and corresponding timestamps of the user's finger on the touch screen to obtain the sliding trajectory data;

[0014] Record the contact start time and release time of the user's key press to obtain the key time series feature data;

[0015] Perform intention mapping calculation based on the contact pressure distribution data, the time series feature data and the sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input.

[0016] Combined with the first aspect, in the second implementation manner of the first aspect of the present invention, the performing intention mapping calculation based on the contact pressure distribution data, the time series feature data and the sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input includes:

[0017] Perform Gaussian distribution calculation on the contact pressure distribution data to obtain a key position heat map, where the central value of the heat map represents the key press intention intensity;

[0018] Calculate the user finger movement vector and speed characteristics according to the sliding trajectory data to obtain a direction offset matrix;

[0019] Calculate the time interval ratio between adjacent characters based on the key time series feature data to obtain a time correlation weight;

[0020] Perform Bayesian probability fusion on the key position heat map, the direction offset matrix and the time correlation weight to obtain an initial intention probability distribution;

[0021] Perform spatial correlation weighted adjustment on the initial intention probability distribution in combination with the standard keyboard layout geometric distance matrix to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input.

[0022] Combined with the first aspect, in the third implementation manner of the first aspect of the present invention, the step of inputting the input intention probability matrix into the first local lightweight model for error detection and preliminary correction to obtain a first correction result includes:

[0023] Mapping the input character sequence through the character-level embedding layer of the first local lightweight model to obtain a character vector sequence;

[0024] Inputting the character vector sequence into the lightweight mixture-of-experts layer of the first local lightweight model, and distributing the input to 4 expert sub-networks through a routing network for parallel feature extraction to obtain multi-perspective feature representations;

[0025] Applying a simplified sparse activation module to selectively activate the multi-perspective feature representations, and only retaining the key information pathways to obtain a sparse feature matrix;

[0026] Inputting the sparse feature matrix and the input intention probability matrix into a lightweight multi-level attention structure for cross-modal information fusion to obtain a fused semantic representation, where the lightweight multi-level attention structure includes 4 attention heads and 2 layers of Transformer structures;

[0027] Inputting the fused semantic representation into the error detection branch and the correction branch of the dual-branch prediction head in the first local lightweight model for parallel computing, and combining with a preset n-gram word frequency statistical table for probability weighting to obtain a first correction result.

[0028] Combined with the first aspect, in the fourth implementation manner of the first aspect of the present invention, the step of transmitting the first correction result and the input intention probability matrix to a cloud large model for in-depth semantic analysis to obtain a second correction result includes:

[0029] Transmitting the first correction result, the input character sequence, and the input intention probability matrix to a cloud server to obtain a cloud input data set;

[0030] Performing a merging process on the cloud input data set, the user's historical input sequence, and the application context information to obtain a target context data set;

[0031] Inputting the target context data set into a cloud large model adopting a mixture-of-experts architecture, a sparse activation mechanism, and a multi-level attention structure for processing to obtain in-depth semantic association data;

[0032] Performing conditional probability maximization calculation based on the in-depth semantic association data to generate an optimal corrected text sequence, and returning the optimal corrected text sequence as the second correction result to the user device side.

[0033] Combined with the first aspect, in the fifth implementation manner of the first aspect of the present invention, the recursive knowledge distillation of the first local lightweight model according to the second correction result to obtain a second local lightweight model includes:

[0034] Using a pseudo-label generator to pair the second correction result and the input character sequence to obtain a pseudo-label training sample pair;

[0035] Calculating correction consistency, prediction confidence, and uniqueness for the pseudo-label training sample pair through a quality evaluation function, and generating a sample quality score set based on the correction consistency, the prediction confidence, and the uniqueness;

[0036] Performing threshold screening on the pseudo-label training sample pair based on the sample quality score set, and adding the samples in the pseudo-label training sample pair with sample quality scores higher than a preset value to the recursive training cache to obtain a target distillation training set;

[0037] Inputting the target distillation training set into a dynamic weighted distillation module, and training the first local lightweight model using a combined distillation loss function to obtain a knowledge compression parameter set. The first local lightweight model includes a character-level embedding layer, a lightweight mixture of experts layer, a simplified sparse activation module, a lightweight multi-level attention structure, and a dual-branch prediction head;

[0038] Updating the parameters and optimizing the structure of the first local lightweight model according to the knowledge compression parameter set, and at the same time establishing a reverse knowledge flow channel to summarize new error patterns to the server to obtain a second local lightweight model.

[0039] Combined with the first aspect, in the sixth implementation manner of the first aspect of the present invention, collecting the behavioral feedback data of the user's acceptance or rejection of the second correction result, and dynamically adjusting the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and outputting a two-layer asynchronous collaborative error correction strategy, including:

[0040] Monitoring and collecting the user's selection operation of accepting or rejecting the correction suggestion, the corrected editing behavior, the response time, and the acceptance rate in the application scenario to obtain behavioral feedback data;

[0041] Performing Bayesian weight optimization calculation on the behavioral feedback data to obtain an error correction satisfaction score;

[0042] Constructing personalized tuning data including the user's common vocabulary, error type distribution, and scenario preferences based on the error correction satisfaction score;

[0043] Monitor and calculate the device processor load, memory occupancy, battery power, and network latency, and generate a task allocation plan in combination with the personalized tuning data;

[0044] Configure and adjust the computing tasks, data transmission frequency, and error handling logic between the second local lightweight model and the cloud large model according to the task allocation plan to obtain a two-layer asynchronous collaborative error correction strategy.

[0045] Combined with the first aspect, in the seventh implementation manner of the first aspect of the present invention, the configuring and adjusting the computing tasks, data transmission frequency, and error handling logic between the second local lightweight model and the cloud large model according to the task allocation plan to obtain a two-layer asynchronous collaborative error correction strategy includes:

[0046] Calculate the semantic complexity of the input character sequence in real time according to the task allocation plan, and use an adaptive threshold function to assign simple spelling errors to the second local lightweight model for processing, and assign semantic dependency errors to the cloud large model for processing to obtain a binary error type diversion mechanism;

[0047] Dynamically adjust the computing resource allocation of the second local lightweight model based on the binary error type diversion mechanism, reserve computing resources for keyboard input in high-frequency usage areas, and at the same time execute an upper limit control on the call frequency of the cloud large model to obtain a differential response scheduling strategy;

[0048] Perform N-gram analysis based on the user's historical input patterns, construct a keyboard input prediction tree, and trigger potential error correction calculations in advance according to the keyboard input prediction tree to obtain a pre-judgment error correction cache;

[0049] Based on the pre-judgment error correction cache and the differential response scheduling strategy, use the token bucket algorithm to control the smoothness of sending requests to the cloud large model, and implement network condition-aware request batch merging to obtain an anti-interference communication pipeline;

[0050] Combine the anti-interference communication pipeline with the input delay sensitivity function, obtain results from the second local lightweight model, and allow the results of the cloud large model to be asynchronously returned and replaced without perception to form a two-layer asynchronous collaborative error correction strategy.

[0051] The second aspect of the present application provides an AI-based keyboard error automatic correction system, and the AI-based keyboard error automatic correction system includes:

[0052] An acquisition module for acquiring the contact pressure distribution, sliding trajectory, and residence time of the user's keyboard input and constructing an input intention probability matrix;

[0053] A preliminary correction module for inputting the input intention probability matrix into a first local lightweight model for error detection and preliminary correction to obtain a first correction result;

[0054] A semantic analysis module for transmitting the first correction result and the input intention probability matrix to a cloud large model for in-depth semantic analysis to obtain a second correction result;

[0055] A knowledge distillation module for recursively distilling knowledge of the first local lightweight model according to the second correction result to obtain a second local lightweight model;

[0056] An output module for collecting behavioral feedback data on whether the user accepts or rejects the second correction result, and dynamically adjusting the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and outputting a double-layer asynchronous collaborative error correction strategy.

[0057] Compared with the prior art, the present application has the following beneficial effects: By establishing a double-layer asynchronous collaborative architecture of a lightweight local model and a cloud large model, a balance between real-time response and high accuracy is achieved. The local model is responsible for instant response, while the cloud large model asynchronously optimizes the result, thus improving the error correction quality while ensuring the response speed. The physical characteristics of the user's key presses are captured by using a contact dynamic feature perception network to construct an input intention probability matrix. Compared with the traditional method that only relies on static key position information, it can more accurately understand the user's real input intention, especially in the scenarios of fast typing and one-handed operation. Through a recursive knowledge distillation self-correction mechanism, the knowledge of the cloud large model is continuously compressed into the local lightweight model, enabling the local model to continuously self-optimize, reducing the dependence on a large amount of labeled data, and realizing the continuous improvement of the system performance over time. A personalized tuning network is established based on the collection of user feedback signals, and fine-grained adjustment is performed according to different users' input habits and application scenarios, improving the error correction acceptance rate and enhancing the user experience, especially in terms of specific domain technical terms and personal habitual expressions. The local lightweight model adopts a lightweight expert mixing layer, a sparse activation mechanism, and a multi-level attention structure, which improves the model expression ability while maintaining low computational complexity, and realizes efficient error recognition and correction. By constructing an anti-interference communication pipeline and a differential response scheduling strategy, the system can maintain stable operation under various network conditions and device states, and improve the adaptability of the system in weak network environments and low-resource devices. A keyboard input prediction tree is constructed based on the user's historical input patterns to trigger potential error correction calculations in advance, and combined with an oblivious replacement mechanism, effectively reducing the user's perceived latency and providing a smoother input experience. Description of the Drawings

[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0059] The structures, ratios, sizes, etc. shown in the accompanying drawings of this specification are only used to cooperate with the content disclosed in the specification for those who are familiar with this technology to understand and read, and are not used to limit the limiting conditions for the implementation of the present invention. Therefore, they do not have technical substantive significance. Any modification of the structure, change of the proportional relationship, or adjustment of the size, without affecting the effects that the present invention can produce and the purposes that can be achieved, should still fall within the scope that can be covered by the technical content disclosed in the present invention.

[0060] Figure 1 is a schematic flowchart of the AI-based automatic keyboard error correction method provided by an embodiment of the present invention;

[0061] Figure 2 is a schematic block diagram of the structure of the AI-based automatic keyboard error correction system provided by an embodiment of the present invention. Detailed implementation manners

[0062] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0063] The flowcharts shown in the accompanying drawings are only illustrative examples, and do not necessarily include all the contents and operations / steps, nor do they necessarily need to be executed in the described order. For example, some operations / steps can be decomposed, combined, or partially merged. Therefore, the actual execution order may be changed according to the actual situation.

[0064] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit this application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to include the plural forms.

[0065] It should be further understood that the term "and / or" used in this application specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations. Please refer to Figure 1, an embodiment of the AI-based automatic keyboard error correction method in the embodiments of the present application includes:

[0066] Step 100, collect the contact pressure distribution, sliding trajectory, and dwell time of the user's keyboard input, and construct an input intention probability matrix;

[0067] It can be understood that the execution subject of the present application can be an AI-based automatic keyboard error correction system, or a terminal or a server. Specifically, it is not limited here. The embodiments of the present application will be described by taking the server as the execution subject as an example.

[0068] Specifically, a high-precision input dynamic perception layer is constructed based on the embedded sensor array on the user device side. This perception layer real-time obtains the multi-modal physical information in each key operation of the user to reflect the actual input behavior of the user. At the moment when the user presses a certain key, the sensor array collects the pressure response information of the contact area on the surface of the key to form a two-dimensional pressure distribution matrix, which includes the maximum pressure value at the center point of the key, the pressure gradient information in the surrounding area, and the spatial position information corresponding to each pressure point, forming high-resolution contact pressure distribution data. At the same time, the trajectory generated when the user's finger moves on the surface of the touch screen is continuously tracked. This process generates a sliding trajectory data sequence by recording the coordinate positions and timestamp information of the finger at each time point. The timing behavior of each key operation is modeled, that is, the whole process from the finger first contacting the key surface to the final complete release is recorded, and time series feature data is established through continuous time sampling, including the contact start time, the pressure rising edge, the time when the maximum pressure appears, the pressure falling edge, and the final release time, to depict the persistence and rhythm of the input action. The contact pressure distribution data, time series feature data, and sliding trajectory data are jointly input into a specific contact dynamic feature perception network. This network adopts a multi-channel input structure, performs local convolution processing and global timing modeling on the spatial pressure map, sliding trajectory curve, and time series vector respectively, and performs multi-modal fusion in the intermediate layer. By introducing an attention mechanism, the response intensity of the intention area is enhanced, so as to realize the deep mapping of the user's input intention. The output of the network is a two-dimensional probability matrix, where each matrix element represents the conditional probability that the true intention of the user when pressing the character i is the character j, forming an input intention probability matrix.

[0069] Model the contact pressure distribution data with a Gaussian distribution. Taking the maximum pressure point of the button detected in the sensor array as the center, calculate the pressure attenuation degree in the horizontal and vertical directions, fit it into a two-dimensional Gaussian function, and form a key heat map. The Gaussian peak corresponding to the center of the image represents the intensity of the button press intention. The closer to the center, the clearer the intention; conversely, it represents an increased possibility of deviating from the target button. The edge area of the heat map captures non-centered pressing behaviors that may be caused by finger tilt, rotation, or accidental touch of the user. Calculate the motion vector sequence of the finger on the touch panel according to the sliding trajectory data, obtain the speed and direction changes through the coordinate difference between consecutive frames in time, and then construct a direction offset matrix. This matrix reflects the inertial offset pattern of the finger path before or during the click of the user, and can prompt the system whether there is a drag-type misoperation or a deviation trend of the target character. At the same time, based on the key time series feature data, extract the time interval between each consecutive input, calculate the relative time ratio of the target character and its surrounding characters on the time axis, and establish a time correlation weight to express the connection between the current input and adjacent inputs in terms of rhythm and continuity. This weight can reveal whether the user continuously clicks on misaligned characters or there is an incomplete input beat. Through the Bayesian probability fusion mechanism, jointly model the spatial concentration information reflected by the key heat map, the trajectory offset trend expressed by the direction offset matrix, and the input rhythm dependence characterized by the time correlation weight, construct the coupling relationship between the prior and the likelihood, and obtain the initial intention probability distribution of each character pair for the candidate characters. To improve the positioning accuracy of this distribution in the actual layout, introduce the geometric distance matrix in the standard keyboard layout as a spatial correction factor, and use the physical distance between each candidate character and the currently pressed character as a penalty factor to participate in the adjustment of the intention distribution. That is, if a certain candidate character occupies a high weight in the initial intention probability, but it is far from the current character in the layout, it will be weakened according to the distance weighting function, while adjacent characters will have their probabilities increased in the intention ambiguity scenario. This series of processes constructs an input intention probability matrix that conforms to the spatial layout logic, has the ability to perceive the trajectory movement trend, and integrates the time dynamic characteristics. Each element in the matrix represents the conditional probability that when the user presses a certain character, their true intention is another character.

[0070] Step 200: Input the input intention probability matrix into the first local lightweight model for error detection and preliminary correction to obtain the first correction result;

[0071] Specifically, the input character sequence is mapped through the character-level embedding layer of the first local lightweight model. A compact vectorization mechanism is adopted to map each input character through a 64-dimensional low-dimensional embedding space, generating a set of continuous character vector sequences. The character vector sequences are input into the lightweight mixture-of-experts layer of the first local lightweight model. In this layer, a routing network is configured, whose function is to dynamically allocate the input vectors according to the current context semantics, and route the data of different segments to 4 independent expert sub-networks respectively. Each sub-network has a convolution-attention hybrid coding module with different structures, so as to achieve multi-perspective parallel feature extraction while keeping the number of parameters below 2MB. Each sub-network forms a complement in capturing different levels of language features such as spelling patterns, syntactic structures and character position dependencies, and outputs a fused multi-perspective feature representation; In order to compress the computational amount and focus on the input signals with the most error-correction value, a simplified sparse activation module is introduced to perform feature selection on the above multi-perspective feature representation. The activation path is controlled by a gating unit, only the channels with high information density are activated, and redundant or ambiguous features are masked at the same time, forming a feature matrix with a sparse structure. The sparse feature matrix is fused with the input intent probability matrix, and cross-modal information interaction is realized through a lightweight multi-level attention structure. This attention structure is composed of a two-layer Transformer with 4 attention heads and has low-latency modeling ability. During the fusion process, the system extracts the coupling mapping between the dependencies between characters and the input intent offset signals respectively, and performs context weighting and reinforcement on each character, generating a comprehensive semantic expression representing the error-correction state of the current input in terms of structure, intent and context. The fused semantic representation is respectively input into the error detection branch and the correction branch of the dual-branch prediction head in the local model. Among them, the error detection branch uses the convolutional receptive field combined with the attention mechanism to predict the error probability of each character at each position, while the correction branch constructs a corresponding alternative probability distribution for each character, and calculates the optimal set of alternative characters through a classifier. During this process, the system calls the embedded n-gram word frequency statistical table to perform probability-weighted fusion at the language level on the candidate alternative results and the context lexical fluency, so as to improve the overall text semantic coherence and error-correction rationality, and finally output the first correction result.

[0072] Step 300: Transmit the first correction result and the input intent probability matrix to the cloud large model for in-depth semantic analysis to obtain the second correction result;

[0073] It should be noted that the first correction result, the input character sequence, and the input intention probability matrix are transmitted to the cloud server to obtain a cloud input dataset, which encapsulates the correction judgments made by the local model at the character level and the touch intention information shown by the user at the physical input layer, providing an initial state with both semantic and physical input characteristics for the cloud model. The cloud input dataset received in the cloud is merged with the historical input sequences synchronized on the user device side and the context data of the currently activated application, and a target context dataset with more context integrity is constructed. Among them, the historical input sequences reflect the user's long-term language usage habits, and the application context provides an information field for the current input semantic environment, such as the email body, search box, editor, etc. The system unifies and formats this information from different sources through context splicing, position encoding expansion, and context window scrolling mechanisms to ensure its semantic continuity and reasoning relevance. The target context dataset is input into a large language model deployed in the cloud. This large model is designed with a mixture of experts architecture, that is, each layer contains multiple structurally heterogeneous expert sub-modules. During the processing, through a sparse activation mechanism, only the part of the experts most suitable for the current input context is selected to participate in the calculation, so as to maintain the reasoning efficiency in the large-scale parameter space. At the same time, the model internally nests multi-level attention structures, and both high-order cross-segment attention heads and local subsequence attention modules are set in each Transformer layer, enabling the model to capture deep semantic associations across sentences, tasks, and even languages in long text sequences. In this process, the model performs semantic compression and vector mapping on the input data, and then constructs a high-dimensional relationship graph between characters, words, and between the input intention probability matrix and language expressions through an attention-weighted aggregation mechanism, thereby generating deep semantic association data with long-range dependence modeling ability and multi-modal context interaction ability. Based on the deep semantic association data, a conditional probability maximization operation is performed to construct an error correction output space, and under the premise of the target conditions, a greedy decoding and beam search strategy are adopted to generate an optimal corrected text sequence. This sequence literally corrects the misspelled words, missing words, and disordered words in the input, and optimizes semantic coherence, context consistency, and language style unity through a context integration mechanism to form a second correction result. The optimal corrected text sequence is encapsulated as a cloud response result and asynchronously returned to the user device.

[0074] Step 400: Recursively perform knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model;

[0075] Specifically, a pseudo-label generator is used to pair the second correction result with the input character sequence to form a pseudo-label training sample pair consisting of an input-output mapping relationship. Such sample pairs serve as the carrier for knowledge transfer between the teacher model and the student model, and are screened to ensure the effectiveness and stability of distillation training. The sample pairs are input into a quality assessment function, which quantitatively evaluates each pair of pseudo-label samples from three dimensions: one is correction consistency, that is, the degree of overlap between the second correction result and the local first correction result at the key character positions; the second is prediction confidence, which is statistically obtained from the maximum value of the softmax probability at the token level in the output of the cloud model; the third is the uniqueness index, which is used to determine whether the sample appears frequently in the historical training set to prevent overfitting of the training to repeated patterns. By weighted integration of these three indicators, a sample quality score is generated for each pair of samples, and a sample quality score set is constructed. Based on the score set, a pseudo-label sample screening operation is performed, and a dynamic threshold mechanism is set. The upper and lower limit ranges of the threshold are determined according to the current device resource status, training frequency, and historical model convergence speed. Only the pseudo-label samples with a sample quality score higher than the preset threshold are added to the local recursive training cache to form the target distillation training set for knowledge distillation. The target training set is input into the local dynamic weighted distillation module, which performs knowledge transfer training based on a combined loss function. It includes two main loss terms: one is the KL divergence term, which is used to measure the difference in the prediction distribution between the student model and the cloud large model; the second is the cross-entropy term, which is used to evaluate the hard alignment ability of the student model to the pseudo-labels. The weights of the two are adjusted by a time decay function, so as to achieve a progressive convergence mechanism from "imitating soft knowledge" to "matching explicit labels". During the actual distillation execution process, the system distributes the knowledge distillation process to all modules of the first local lightweight model based on the current model structure, including the character-level embedding layer, lightweight mixture-of-experts layer, simplified sparse activation module, lightweight multi-level attention structure, and dual-branch prediction head. The system fine-tunes the parameter subsets of each module to ensure the stability of the overall architecture, and gradually replaces the existing parameters to form a new knowledge compression parameter set. After training is completed, the model parameters are updated according to this parameter set, and in necessary cases, pruning, activation path reconfiguration, or channel reconstruction operations are performed on the sub-network structure of the mixture-of-experts layer, so as to achieve structural-level optimization and obtain the second local lightweight model. To achieve two-way knowledge flow and co-evolution of the model system, a reverse knowledge flow channel is established to upload the difficult-to-fit samples or new error patterns identified during the distillation training process to the cloud server. Such information is used to update the global error pattern database and the retraining data pool of the large model, so as to enhance the adaptability of the cloud model to dynamic language evolution.The entire knowledge distillation process relies on automatic triggering during device idle periods, has progressive, self-purifying, and resource-aware capabilities, can continuously compress and transfer language knowledge without affecting the user input experience, achieve the goal of the model continuously self-evolving over time of use, and ultimately enable the second local lightweight model to significantly improve accuracy and generalization ability while retaining real-time performance.

[0076] Step 500: Collect the behavioral feedback data of the user's acceptance or rejection of the second correction result, and dynamically adjust the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and output a two-layer asynchronous collaborative error correction strategy.

[0077] Specifically, continuously monitor key behavioral events generated during the interaction between the user and the error correction system on the device side, including explicit operation selections of whether the user accepts the error correction suggestions, such as clicking the "Accept" or "Withdraw" operations, the editing behavior of whether the user continues to modify the text after the correction suggestions, the response time from the suggestion pop-up to the final confirmation, and the error correction acceptance rate of the user in specific application scenarios, such as in the input method in chat, office, or search environments. By capturing and timestamping the behavioral characteristics of these dimensions, construct a behavior feedback dataset with timeliness and context relevance. Introduce a Bayesian optimization model to perform fusion calculations on these behavior feedbacks, establish an error correction satisfaction scoring function considering the influence weights between different feedback types, and derive the overall acceptance willingness of the user for the error correction suggestions in the current context through a dynamically updated prior model and posterior inference mechanism, and output a quantified satisfaction scoring result. Based on this scoring result, generate a personalized tuning dataset, which includes a common vocabulary vector table of the user during the long-term input process to reflect the user's preferred word usage habits, and also includes a statistical distribution matrix of its common error types to capture error-prone character pairs or grammar patterns during input, and at the same time record the tolerance threshold and acceptance intensity of the user for automatic error correction in different application scenarios to construct a personalized context tuning parameter set. On this basis, synchronously start the device status perception module to real-time monitor the processor load, memory occupancy, battery power level of the current device, and the latency and bandwidth of the current network connection, and combine and model them with the above personalized tuning data. Calculate the optimal error correction task allocation plan through a resource-intention coupling mapping function, which clearly specifies which types of error correction requests should be preferentially completed using the local model or the cloud model under the current device and network status, and set the call frequency, execution latency budget, and cache synchronization window size of each model. According to the task allocation plan, make runtime configuration adjustments to the second local lightweight model and the cloud large model respectively. For example, when the user's error correction satisfaction score is high and the device operation resources are sufficient, increase the proportion of local model usage and reduce the cloud dependence to save energy consumption; while in scenarios with ambiguous semantics or complex contexts, when the user's error correction acceptance rate is low, the system moderately increases the cloud inference frequency and dynamically pulls a larger window of the user's historical data to participate in in-depth semantic analysis. In a weak network environment, the system activates an asynchronous compensation mechanism, preferentially executes the local fast response strategy and temporarily caches the error correction results in the local prediction buffer, and then the cloud compensates for the unified results after the network is stable. Through the above mechanism, form a two-layer asynchronous collaborative error correction strategy that continuously adapts to changes in user habits.

[0078] Perform semantic complexity analysis on each input character sequence in real time according to the task assignment scheme. This process extracts the language structure features of the current input segment through nested context windows, constructs a semantic tensor representation by combining dependency grammar relations and part-of-speech tags, and further discriminates through an adaptive threshold function. Problems with clear spelling error features, low context coupling degrees, and those that can be directly solved by local character replacement are classified as simple errors and handed over to the second local lightweight model for processing. For problems with complex semantic dependencies such as semantic drift, long-distance dependencies, and disambiguated word selection, they are assigned to the cloud large model for processing, thus forming a binary error type diversion mechanism with clear task boundaries. After completing the error type diversion, based on this mechanism, adjust the computing resource usage strategy of the second local lightweight model. Prioritize the allocation of processor cycles, model weight caches, and memory access channels to the keyboard areas with higher current input frequencies, such as the main key area, the word start area, or the positions in continuous input concentration, to improve the response speed to high-frequency input patterns. At the same time, set a dynamic frequency upper limit for the invocation of the cloud large model, and control the remote inference frequency under the premise of meeting the latency tolerance, so as to avoid triggering frequent invocations under high load or weak network, resulting in device power consumption or response congestion, and form a differential response scheduling strategy. Construct an n-gram analysis structure based on the user's historical input patterns, extract common input prefix combinations, frequently misspelled spelling paths, and word order dependencies, and generate a dynamically extended keyboard input prediction tree on this basis. This prediction tree is not only used for language model completion but also for identifying future possible spelling or semantic error input trends. The system uses this prediction result to pre-invoke the second local lightweight model or cache the inference results of the cloud model in advance, forming a pre-judgment error correction cache mechanism to reduce the online computing burden. To achieve double-layer asynchronous cooperation, introduce the token bucket algorithm to smoothly schedule the cloud request traffic, adjust the token generation rate in combination with the input rhythm distribution and the network state prediction model, and dynamically determine the request batch processing and merging strategy according to the network conditions. Automatically aggregate multiple error correction requests in a weak network environment to reduce the communication load, and disperse requests in a high-bandwidth state to improve the response real-time performance, constituting an anti-interference communication pipeline with bandwidth adaptability and anti-jitter performance. Combine this anti-interference communication pipeline with the input delay sensitivity function. This function evaluates the timeliness requirements of the error correction task based on the current input type, application scenario, and user interaction rate. Under the premise of meeting the subjective smooth experience, preferentially obtain quick preliminary correction results from the second local lightweight model, and allow the cloud model to return more refined semantic error correction outputs asynchronously in the background, and perform seamless replacement on the local results after returning, ensuring that the user interface has no delayed jump and the input fluency is not affected, and construct a double-layer asynchronous cooperation error correction strategy with adaptive task routing, predictive response control, asynchronous communication, and semantic optimization capabilities.

[0079] In the embodiments of the present application, by establishing a two - layer asynchronous collaborative architecture of a lightweight local model and a cloud - based large model, a balance between real - time response and high accuracy is achieved. The local model is responsible for immediate response, while the cloud - based large model asynchronously optimizes the results, thereby improving the error - correction quality while ensuring the response speed. The contact dynamic feature perception network is used to capture the physical features of the user's key presses, and an input intention probability matrix is constructed. Compared with the traditional method that only relies on static key position information, it can more accurately understand the user's true input intention, especially in scenarios of fast typing and one - hand operation. Through the recursive knowledge distillation self - correction mechanism, the knowledge of the cloud - based large model is continuously compressed into the local lightweight model, enabling the local model to continuously self - optimize, reducing the dependence on a large amount of labeled data, and achieving continuous improvement of system performance over time. Based on the collection of user feedback signals, a personalized tuning network is established to perform fine - grained adjustment according to different users' input habits and application scenarios, improving the error - correction acceptance rate and enhancing the user experience, especially in terms of specific - field professional terms and personal idiomatic expressions. The local lightweight model adopts a lightweight mixture - of - experts layer, a sparse activation mechanism, and a multi - level attention structure, which improves the model's expressive ability while maintaining low computational complexity, and achieves efficient error recognition and correction. By constructing an anti - interference communication pipeline and a differential response scheduling strategy, the system can operate stably under various network conditions and device states, improving the system's adaptability in weak - network environments and low - resource devices. Based on the user's historical input patterns, a keyboard input prediction tree is constructed to trigger potential error - correction calculations in advance, combined with an oblivious replacement mechanism, effectively reducing the user - perceived latency and providing a smoother input experience.

[0080] In a specific embodiment, the process of executing step 100 may specifically include the following steps:

[0081] Collect key - press pressure data through the embedded sensor array in the user device to obtain contact pressure distribution data;

[0082] Track the movement coordinates and corresponding timestamps of the user's finger on the touch screen to obtain sliding trajectory data;

[0083] Record the contact start time and release time of the user's key presses to obtain key - press time - series feature data;

[0084] Perform intention mapping calculation based on the contact pressure distribution data, time - series feature data, and sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input.

[0085] Specifically, a multi-modal input behavior capture and modeling mechanism is constructed. This mechanism is supported by an embedded sensor array at the bottom layer, combines multi-channel data streams, and fuses information in three dimensions: time, space, and path, so as to fully restore the actual operation behavior of the user at the signal source. When the user performs keyboard input operations, a pressure-sensitive array sensor installed under the soft key surface or touch surface is used to collect the physical contact pressure changes between the fingertip and the key surface in real time with a millisecond-level sampling period. Each key press corresponds to a two-dimensional pressure response image, which numerically reflects the unit pressure value distribution at different spatial position points. Due to the certain oblique entry angle and local eccentricity of the fingertip pressing, the pressure map presents an asymmetric Gaussian shape, where the pressure peak in the central area represents the point with the largest actual force, and the gradient structure formed by its decreasing towards the periphery reflects the inclination trend and micro-movement trajectory of the finger. At the same time, the sliding trajectory of the finger on the touch area is continuously tracked, relying on a high-resolution capacitive touch positioning module, which detects the continuous movement of the center of gravity of the finger charge distribution through matrix-distributed induction units, so as to obtain a set of coordinate points at multiple consecutive time stamps. Each element in this sequence contains both spatial position and time information, and can effectively describe the sliding path and rhythm of the user before, during, or after triggering a key. By calculating the velocity and acceleration of the first derivative and second derivative of this sequence, features such as the movement direction of the finger, trajectory turning points, sliding amplitude, and input inertia trend are restored, providing key decision-making basis in scenarios of fuzzy input, accidental touch, or non-vertical operation. While collecting pressure and trajectory information, the time dynamic characteristics of the key press process are synchronously recorded. An event-driven mechanism is used to record three critical moments of each key press operation: the starting moment of key press trigger (contact start time), the moment of the maximum pressure peak during continuous contact, and the release time when the fingertip leaves the key surface, constructing a time sequence composed of time nodes. This sequence is further expanded into multiple time intervals, and these time parameters are used to describe the input rhythm, reaction duration, and pressing habit, and are jointly modeled with data in other dimensions to analyze whether there are behavior deviations such as rapid tapping, hesitant input, or rhythm drift of the user.The contact pressure distribution data, sliding trajectory data, and key press time series feature data are uniformly input into a specially constructed intention mapping network (TDF-Net). This network adopts a three-stage structure design. In the first stage, a multi-channel convolutional network is used to extract features from the pressure image and the sliding trajectory image. The extracted local image features can be represented as a multi-dimensional vector tensor, retaining spatial position and gradient change information. In the second stage, bidirectional LSTM units are introduced to process time series data, including the pressure change rate between time points, the dynamic trend of the sliding trajectory, and the fingertip separation and combination frequency, etc., and bidirectional modeling is used to ensure that historical and future information can participate in the reasoning when determining the intention. In the third stage, all the aforementioned features are sent to the intention mapping layer for vector fusion and probability transformation, and finally a two-dimensional intention mapping matrix is output. This matrix performs probability distribution constraints on each row through the softmax normalization method to ensure that each input has a complete candidate character intention map. To improve the adaptability and generalization ability of this mapping process, a self-supervised learning mechanism is used to train the intention mapping model, where historical input behaviors and user manual modification results are used as pseudo-label signals to guide the parameter update of the intention discrimination model, enabling the system to self-optimize the recognition logic during continuous use. This intention probability matrix can reflect the ideal character intention under the standard input state and can provide highly robust intention correction support in the face of input noise, accidental touch disturbances, or complex input habits, serving as an important input basis for the subsequent error detection and character correction modules.

[0086] In a specific embodiment, the process of performing step of intention mapping calculation based on the contact pressure distribution data, time series feature data, and sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the actually intended input characters may specifically include the following steps:

[0087] Perform Gaussian distribution calculation on the contact pressure distribution data to obtain a key position heat map, where the central value of the heat map represents the key press intention intensity;

[0088] Calculate the user's finger movement vector and speed characteristics according to the sliding trajectory data to obtain a direction offset matrix;

[0089] Calculate the time interval ratio between adjacent characters based on the key press time series feature data to obtain a time correlation weight;

[0090] Perform Bayesian probability fusion on the key position heat map, direction offset matrix, and time correlation weight to obtain an initial intention probability distribution;

[0091] Combine the standard keyboard layout geometric distance matrix to perform spatial correlation weighted adjustment on the initial intention probability distribution to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the actually intended input characters.

[0092] Specifically, for each keyboard pressing event, based on the two-dimensional contact pressure distribution data collected by the embedded pressure sensor array, an original pressure map is constructed. With the key contact center as the reference point, the pressure values recorded by the sensing units at each position in the horizontal and vertical directions are organized into a density matrix. To enhance the structural interpretability and central directivity of the matrix, a two-dimensional Gaussian kernel function is constructed with the peak point of the contact pressure as the Gaussian center, and the entire pressure map is fitted to obtain a key position heat map with physical significance. The center value of the heat map represents the intensity of the key pressing intention, that is, the intensity of the user's concentrated input willingness at this key position, while the attenuation amplitude in its peripheral area reflects the degree of contact blur and the stability of finger touch. At the same time, the sliding trajectory data of the user's finger is obtained from the touch coordinate recording module, and a two-dimensional motion path is constructed through the position information sequence under continuous time stamps. Further, first-order difference and velocity vector calculations are performed on it to obtain a feature matrix reflecting the motion direction and trajectory amplitude. A vector is constructed for the position difference between every two consecutive moments, and the velocity modulus value and direction angle per unit time are calculated to form a direction offset matrix. This matrix is used to represent the path offset trend from the starting contact to the target key. The system identifies whether there are behaviors such as trajectory corners, inertial sliding, or direction drift to adjacent keys through this matrix, which is particularly common in rapid tapping, multi-finger typing, or diagonal input. Analyze the key pressing time series feature data, that is, the contact start time, release time, and duration of each pressing action. By normalizing the time difference between different character input events, the time interval ratio between adjacent character pairs is calculated, and then a time correlation weight matrix is constructed. This weight is used to measure whether there are rhythmic mistakes during the user's rapid typing, such as key position offset and finger lifting delay caused by too fast input speed, and at the same time, to identify situations such as thinking interruption caused by short pauses. The key position heat map, direction offset matrix, and time correlation weight matrix are jointly processed, and a Bayesian probability fusion mechanism is used to integrate the information in the three dimensions into a unified initial intention probability distribution. In the Bayesian framework, for each candidate character j given the pressing character i, its posterior probability P(j|i) as the user's true intention is represented as the product combination and normalization of multiple conditional factors, that is, the system constructs a prior probability model and uses the pressure distribution, motion direction, and time dependence as conditional evidence for reasoning, so as to generate a normalized initial probability distribution among all possible characters. This distribution captures the physical manifestations and temporal dynamics of the user's input behavior and establishes an intention transfer relationship between characters in a statistical sense, so that even under interference conditions such as accidental touch, fuzzy contact, or rapid input, the system can still identify the user's true target character with high confidence. The standard keyboard layout geometric distance matrix is introduced to perform spatial correlation weighting adjustment on the initial probability distribution.The geometric distance matrix defines the Euclidean distance between every two characters on the keyboard. Each probability in the initial intention distribution is weighted according to the distance function. That is, for characters with a relatively short distance, their final probability remains the same or moderately increases, while for candidate characters with a long distance, their probability is compressed to an extremely low level to conform to the physical accessibility of user operations. This spatial weighting mechanism makes the intention probability matrix reasonable not only in the dynamic dimension of the input behavior but also constrained in the spatial structure, preventing the non-physical diffusion of incorrect intentions. By jointly modeling the concentration of the pressure distribution, the trend of the sliding trajectory, the continuity of the time rhythm, and the constraint of the geometric structure, an input intention probability matrix is generated.

[0093] In a specific embodiment, the process of executing step 200 may specifically include the following steps:

[0094] The input character sequence is mapped through the character-level embedding layer of the first local lightweight model to obtain a character vector sequence;

[0095] The character vector sequence is input into the lightweight mixture-of-experts layer of the first local lightweight model, and the input is distributed to 4 expert sub-networks through the routing network for parallel feature extraction to obtain a multi-perspective feature representation;

[0096] The simplified sparse activation module is applied to selectively activate the features of the multi-perspective feature representation, and only the key information channels are retained to obtain a sparse feature matrix;

[0097] The sparse feature matrix and the input intention probability matrix are input into the lightweight multi-level attention structure for cross-modal information fusion to obtain a fused semantic representation. The lightweight multi-level attention structure includes 4 attention heads and 2 layers of Transformer structures;

[0098] The fused semantic representation is input into the error detection branch and the correction branch of the dual-branch prediction head in the first local lightweight model for parallel computing, and probability weighting is combined with the preset n-gram word frequency statistical table to obtain a first correction result.

[0099] Specifically, the input character sequence is mapped through the character-level embedding layer of the first local lightweight model. This embedding layer is equivalent to a compact semantic representation module, which maps each discrete character into a set of dense vector representations of a fixed dimension according to its language features such as number, part of speech, usage frequency, and context performance. These vectors record the abstract positions of the characters in the language space and possess a certain degree of semantic similarity, enabling characters with similar usages or similar structures to be relatively close in the vector space, providing a basic condition for subsequent structure perception. The character vector sequence is input into the lightweight mixture-of-experts layer in the local model. Under the condition of limited computing resources, this module introduces an expert selection mechanism to assign different types of feature extraction tasks to different sub-networks to simulate the "call-on-demand" computing method. Among them, the routing network, as the discrimination center, will assign activation probabilities to each character position according to the context state and semantic deviation features of the current input sequence, and divide these positions into 4 expert sub-networks. Each sub-network is designed as a feature processing unit with different structures. For example, some sub-networks are good at identifying local spelling patterns, some are good at judging language rhythm characteristics, and some are good at handling context connection relationships. The multi-path parallel processing method not only improves the depth of semantic extraction but also enhances the model's ability to model diverse error patterns. The results respectively output by the four expert sub-networks are concatenated and merged into a multi-perspective feature representation. The simplified sparse activation module is applied to selectively activate the features of the multi-perspective feature representation to ensure that the system only retains the activation paths with higher information density and greater semantic value, thereby saving unnecessary computational overhead and enhancing the controllability of the prediction results. The sparse activation mechanism scores the activation values of each channel through a simplified gating structure and a dynamic channel scoring strategy, and only selects a part of the channels with the highest scores to output for the next-stage processing, while the remaining low-weight channels are suppressed or masked to obtain a sparse feature matrix. The sparse feature matrix is fused with the input intention probability matrix generated by the input behavior dynamic modeling module (such as TDF-Net). The input intention probability matrix is an offset intention estimate derived from the physical behavior expressions (including contact pressure, time distribution, sliding trajectory, etc.) during the user input process, providing another interpretation angle in the character sequence dimension, that is, the probability mapping relationship between the currently pressed character and the possible true intention character. In order to effectively couple the semantic features and intention features, a lightweight multi-level attention structure is introduced. The structure contains two Transformer encoding layers, and four attention heads are set in each layer, enabling it to construct multi-dimensional information association relationships between the sparse features and the intention matrix. This structure concatenates the character features and the intention distribution as the composite input, and uses the multi-head attention mechanism to respectively learn the context dependencies between characters, the coupling relationship between characters and intentions, the upstream and downstream trends between intentions, and the importance of the semantic-behavior coupling path.The attention layer strengthens the joint expression of key positions layer by layer by comparing the activation value distribution, path attention maps, and dynamic weight backpropagation, and ensures gradient smoothness and model stability through residual connections and normalization layers in the Transformer structure, and finally outputs a fused semantic representation. The fused semantic representation is input into the error detection branch and correction branch of the dual-branch prediction head in the first local lightweight model for parallel computing. Among them, the error detection branch uses a small convolutional module combined with a position attention mechanism to output the error probability for each character in the sequence bit by bit, and marks the positions higher than the set threshold as high-risk areas; while the correction branch constructs the probability distribution of alternative characters based on the semantic fusion representation and outputs a sorted result from all possible candidates. At this stage, to prevent the system from making judgments solely based on model training experience, a preset n-gram word frequency statistics table is introduced. This table records the probability relationships of common character combinations in the language. After the model makes a correction suggestion, the word frequency statistics results are called to probabilistically weight and correct the prediction results, making the correction suggestions not only reasonable and smooth, but also in line with common language usage habits and context fluency. Word frequency statistics provides a prior enhancement at the language layer, enabling the local model to have higher language understanding and generation capabilities. Through the above steps, the first correction result is generated.

[0100] In a specific embodiment, the process of executing step 300 may specifically include the following steps:

[0101] Transmit the first correction result, the input character sequence, and the input intention probability matrix to the cloud server to obtain a cloud input data set;

[0102] Merge and process the cloud input data set with the user's historical input sequence and application context information to obtain a target context data set;

[0103] Input the target context data set into a cloud large model with a mixture of experts architecture, sparse activation mechanism, and multi-level attention structure for processing to obtain deep semantic association data;

[0104] Perform conditional probability maximization calculation based on the deep semantic association data to generate an optimal corrected text sequence, and return the optimal corrected text sequence as the second correction result to the user device.

[0105] Specifically, the first correction result is packaged together with the original input character sequence it is based on, and the corresponding input intention probability matrix is attached to form a basic data unit. To ensure transmission efficiency and data structure consistency, a unified data format encapsulation mechanism is adopted in the packaging stage. At the same time, differential compression and redundancy elimination algorithms are used to compress duplicate information, ensuring that a relatively low data volume can still be maintained under mobile network conditions, and it is sent to the cloud server through an encrypted channel to construct a cloud input dataset. The cloud input dataset is merged with the user's historical input sequence and application context information to construct a target context dataset. The user's historical input sequence is periodically uploaded to the cloud cache service by the local model in the idle state. Its content covers phrases with high recent usage frequency by the user, habitual word order structures, pragmatic features, and personalized misspelling correction records. These historical information play a role in context supplementation and semantic inertia guidance in the current input analysis; while the application context information comes from the specific usage scenario where the input occurs. Different language style weights and error correction tolerance parameters are defined according to each application type, so as to ensure targeted reasoning strategies in terms of language expression style, error correction strictness, and semantic coherence. After the above information integration is completed, a high-dimensional and multi-level target context dataset covering user behavior, language habits, scenario background, and input content is constructed. To effectively process inputs with complex structures and rich information dimensions, the large model deployed in the cloud adopts a mixture of experts architecture, which integrates multiple sub-models with different structures. Each sub-model is called an "expert" and is responsible for modeling specific types of language phenomena. For example, some experts are good at dealing with grammar logical structures, some other experts pay more attention to word order combinations or sentence pattern transformations, and there are also some experts focusing on spelling changes or style features. After receiving the target context dataset, the model activates the sparse activation mechanism. According to the semantic distribution, context features, and target offset direction of the current input, the most suitable part is selected from all experts for activation and participation in the calculation, thus significantly reducing the redundant calculation cost and avoiding invalid parameter calls. After sparse activation, the multi-level attention structure inside the model starts to run, and complex dependencies between each character, word, phrase, and even context paragraph in the input are captured through layer-by-layer attention weighting mechanisms. During this process, the model identifies whether there are problems such as context incoherence, unreasonable grammar structures, and semantic shifts in the input character sequence, and makes semantic alignment adjustments to potential contradictions between the first correction result and the input intention, thereby constructing deep semantic association data with strong semantic consistency and tight context coupling in the high-dimensional representation space. Based on the semantic association data, a conditional probability maximization inference task is performed. The model re-scores each character in each position, generates a set of candidate words according to the current semantic environment and language rules, and sequentially selects the path with the highest probability at each step to generate the final text sequence.To improve the overall naturalness and context consistency of the text, a beam search algorithm is introduced to optimize the path, avoiding the cascading deviation caused by local optimality. At the same time, the language model is combined to globally evaluate the syntactic smoothness of the whole sentence, generating the optimal corrected text sequence. The optimal corrected text sequence is packaged as the second correction result and returned to the client, and confidence information and local character replacement identifiers are attached during the return process to guide whether the local model performs display updates, annotation prompts, or imperceptible replacements.

[0106] In a specific embodiment, the process of executing step 400 may specifically include the following steps:

[0107] Use the pseudo-label generator to pair the second correction result and the input character sequence to obtain pseudo-label training sample pairs;

[0108] Calculate the correction consistency, prediction confidence, and uniqueness of the pseudo-label training sample pairs through the quality evaluation function, and generate a sample quality score set based on the correction consistency, prediction confidence, and uniqueness;

[0109] Perform threshold screening on the pseudo-label training sample pairs based on the sample quality score set, and add the samples in the pseudo-label training sample pairs with sample quality scores higher than the preset value to the recursive training cache to obtain the target distillation training set;

[0110] Input the target distillation training set into the dynamic weighted distillation module, and apply the combined distillation loss function to train the first local lightweight model to obtain a knowledge compression parameter set. The first local lightweight model includes a character-level embedding layer, a lightweight mixture of experts layer, a simplified sparse activation module, a lightweight multi-level attention structure, and a dual-branch prediction head;

[0111] Update the parameters and optimize the structure of the first local lightweight model according to the knowledge compression parameter set, and at the same time establish a reverse knowledge flow channel to summarize the new error patterns to the server to obtain the second local lightweight model.

[0112] Specifically, a pseudo-label generator is used to pair the second correction result and the input character sequence, and construct a training sample pair. This pairing process ensures that each original input sequence forms a pair of positive and negative sample mappings with its corresponding high-confidence cloud output, and serves as pseudo-supervisory training data in future distillation learning, becoming a reference for the local model to imitate the cloud decision-making mechanism. In order to prevent low-quality pseudo-labels from interfering with local model learning, the quality assessment module is started after the sample pairs are generated, and multi-dimensional quality analysis and evaluation is performed on each set of samples. The degree of difference between the second cloud-based correction result and the first local correction result is evaluated using the correction consistency index. This index is used to determine whether the two maintain a high degree of consistency or disagreement in terms of character position, correction path, and result text, and a consistency weight is assigned accordingly. The prediction confidence of each pseudo-label sample is then calculated. This confidence comes from the character probability distribution density or language model score output by the cloud model in the process of generating the correction result, and is a key parameter for measuring the stability and credibility of the result. Then, a uniqueness indicator is introduced to compare the sample with historical training data to see if similar structures or overlapping content have appeared before, and to determine whether it has novelty, generalization value, and model challenge, thereby evaluating its training value. The scores of the above three dimensions are integrated to construct a sample quality score set. Each pseudo-label sample pair is assigned a composite score that reflects its training reference value. A dynamically updated threshold is set to screen high-quality pseudo-label training samples. Only sample pairs with scores above the threshold are retained and placed in the recursive training cache to construct a target distillation training set for local distillation optimization. This training set has strong consistency, structural innovation, and high confidence. The sample screening mechanism effectively avoids the risk of training contamination caused by incorrect reasoning, boundary interference, or data anomalies, ensuring the stability and improvement of subsequent local model distillation training. The target distillation training set is input into the dynamic weighted distillation module of the local model, which is the execution unit for compressing and migrating cloud knowledge to the local model. During the distillation process, a combined distillation loss mechanism is introduced. This mechanism simultaneously considers the soft loss of the local model in aligning its predicted distribution with the cloud, and the hard loss of its alignment with the pseudo-label output. The soft loss reflects the local model's ability to mimic the cloud's predicted probability distribution for each candidate character, while the hard loss reflects its ability to consistently output the resulting pseudo-label text. The weighting of these two losses is automatically adjusted using a time-dependent function. Before the model converges, distribution alignment training is emphasized to improve stability. After the model is gradually fitted, the pseudo-label alignment weight is increased to improve accuracy and generalization. This dynamic weighting mechanism ensures that the model has different training objectives at different stages, maximizing the training value of each batch of data.Meanwhile, the training scope of the local model is not limited to the output layer, but covers all its key structural units, including the character-level embedding layer, lightweight mixture of experts layer, simplified sparse activation module, lightweight multi-level attention structure, and dual-branch prediction head. The parameters of each layer participate in the training process through the backpropagation mechanism and continuously optimize their parameter states under the drive of the combined loss function. During the training process, the system monitors the parameter convergence speed and gradient change trend of each module, dynamically freezes the converged paths to avoid redundant calculations. At the same time, after the model weights are updated, the structure configuration is fine-tuned according to the convergence effect, such as pruning low-contribution expert sub-networks, reconstructing the sparse activation gating order, or merging attention paths, to optimize the model structure without increasing the parameter scale, forming a second local lightweight model with stable structure, fast response, and enhanced performance. To further improve the co-evolution mechanism of the system, a reverse knowledge flow channel is constructed during the distillation training. High-value new error samples, new input patterns, or rare misspelled word structures identified during the distillation process are uploaded anonymously to the server, where they are aggregated and analyzed by the server for large model incremental training patch updates. This mechanism ensures that while the local model is continuously optimized, it also indirectly promotes the enrichment of the cloud model's corpus and the improvement of error correction accuracy, thus forming a positive feedback closed loop of end-cloud collaborative knowledge circulation and enhancing the response ability and long-term evolution potential of the entire error correction system to new language changes, rare usages, and user-specific input habits. Through the above steps, the iterative evolution process of the first local lightweight model to the second local lightweight model is completed.

[0113] In a specific embodiment, the process of executing step 500 may specifically include the following steps:

[0114] Monitor and collect the user's selection operation of accepting or rejecting correction suggestions, the corrected editing behavior, response time, and acceptance rate in the application scenario to obtain behavior feedback data;

[0115] Perform Bayesian weight optimization calculation on the behavior feedback data to obtain an error correction satisfaction score;

[0116] Construct personalized tuning parameter data including the user's commonly used vocabulary, error type distribution, and scenario preferences based on the error correction satisfaction score;

[0117] Monitor and calculate the device processor load, memory occupancy, battery power, and network latency, and generate a task allocation plan in combination with the personalized tuning parameter data;

[0118] Adjust the configuration of the second local lightweight model and the cloud large model according to the task allocation plan to obtain a two-layer asynchronous collaborative error correction strategy.

[0119] Specifically, each time the user receives a correction suggestion, the behavior feedback collection module is activated to monitor their subsequent operations in real time. Four types of key feedback signals are recorded during this process: First, whether the user accepts or rejects the correction suggestion provided by the system. If the user clicks "Accept" or actively retains the system suggestion, it is recorded as positive feedback; if the user clicks "Cancel" or continues to modify it to other characters, it is recorded as negative feedback. Second, whether the user continues to edit the text after accepting or rejecting the correction. The system determines whether the correction suggestion fully meets the user's expression needs based on whether the editing action covers the corrected area. Third, the system records the response time experienced by the user from the pop-up of the correction suggestion to the final confirmation, and infers the user's confidence in the corrected content by analyzing the length of this time. Fourth, the system calculates the acceptance rate of correction suggestions in the same type of scenario based on the current application scenario, such as chatting, note-taking, email, web input, etc., to reflect the user's tolerance and dependence on system intervention in different usage contexts. After the above feedback data collection is completed, it is input into the Bayesian weight optimization model for multi-dimensional weight normalization and satisfaction inference processing. The role of the Bayesian optimization model at this stage is to weight and fuse different types of feedback signals to construct a comprehensive error correction satisfaction scoring model. Different signals are scored by setting feedback priorities. For example, the acceptance or rejection operation has the highest weight, followed by the editing behavior, then the response time, and the scenario acceptance rate provides a long-term trend reference. Inside the model, the marginal probability of each type of signal is continuously updated according to the prior distribution of historical feedback, and the weighting strategy is dynamically updated based on the posterior inference of the new input data, outputting an error correction satisfaction score between 0 and 1. This score is used to quantify the effectiveness of the current model output in the user's subjective perception. Based on the error correction satisfaction score, a personalized parameter adjustment data model is constructed. This model consists of three parts: a set of user's frequently used words. By analyzing the words, phrases, and proper nouns with higher frequencies in the historical input records and error correction feedback, a user preference word vector is constructed to influence future word frequency weighting and candidate priority ranking; a user-specific error type distribution matrix. This matrix is based on the frequency statistics of error types that appear in the user's error correction history, such as spelling errors, semantic errors, word order misalignments, format errors, etc., to form a preferred error correction pattern. This information can be used to predict high-risk input structures in advance; a preference vector of the user's acceptance of correction suggestions in different application scenarios. This vector records whether the user tends to accept system modifications or retain the original expression in a specific scenario, such as being inclined to retain internet slang in social applications and being inclined to correct formal grammar in document writing. The combination of the three constitutes a user-specific error correction behavior portrait. Activate the device resource monitoring module to perform real-time sampling of the current processor load, memory occupancy, battery power, and network latency.Represent various resource metrics in the form of a state vector, and jointly model them with the aforementioned personalized tuning data to establish a task allocation function under multi-objective constraints. Considering multiple objectives such as performance bottlenecks, power consumption control, and user experience, generate an adaptive error correction task allocation scheme under different conditions. For example, when the processor occupancy is low and the battery is fully charged, the system performs more character-level error correction inference tasks on the local model; when the network condition is good but the local resources are tight, the system preferentially sends complex semantic judgment tasks to the cloud for processing; in a weak network environment but the user is in a high-response scenario (such as real-time conference chat), the system starts a conservative strategy, performs high-confidence fast error correction locally, and the cloud asynchronously compensates for semantic optimization to ensure double guarantees of real-time and language accuracy. Configure and adjust the second local lightweight model and the cloud large model according to the task allocation scheme to construct a two-layer asynchronous collaborative error correction strategy. Under this strategy, limit or expand the processing scope, execution frequency, and memory scheduling of the local model, and adapt to the current device state through dynamic channel control and quantization precision switching within the model structure; at the same time, adjust the call rhythm, request content compression ratio, and batch processing merge window of the cloud large model to ensure the optimal balance between the latency and semantic value of the cloud return result. In the execution of the overall strategy, introduce an asynchronous coordination mechanism based on timestamps, so that the preliminary error correction results of the local model are immediately displayed without affecting the input fluency, while the final optimized results returned by the cloud are replaced in the background to ensure that users always experience a continuous and high-quality input process, realizing end-cloud collaborative dynamic evolution and resource optimization response driven by user feedback.

[0120] In a specific embodiment, the process of obtaining the two-layer asynchronous collaborative error correction strategy by performing configuration and adjustment on the second local lightweight model and the cloud large model according to the task allocation scheme may specifically include the following steps:

[0121] Calculate the semantic complexity of the input character sequence in real time according to the task allocation scheme, and allocate simple spelling errors to the second local lightweight model for processing and semantic dependency errors to the cloud large model for processing through an adaptive threshold function to obtain a binary error type diversion mechanism;

[0122] Dynamically adjust the computing resource allocation of the second local lightweight model based on the binary error type diversion mechanism, reserve computing resources for keyboard input in high-frequency usage areas, and at the same time perform upper limit control on the call frequency of the cloud large model to obtain a differential response scheduling strategy;

[0123] Perform N-gram analysis based on the user's historical input pattern, construct a keyboard input prediction tree, and trigger potential error correction calculations in advance according to the keyboard input prediction tree to obtain a pre-judged error correction cache;

[0124] Based on the pre-judgment error correction cache and the differential response scheduling strategy, the token bucket algorithm is used to control the smoothness of sending requests to the cloud large model, and network condition-aware request batch merging is implemented to obtain an anti-interference communication pipeline;

[0125] The anti-interference communication pipeline is combined with the input delay sensitivity function to obtain results from the second local lightweight model, while allowing the results of the cloud large model to be returned asynchronously and replaced imperceptibly, forming a two-layer asynchronous collaborative error correction strategy.

[0126] Specifically, a lightweight semantic analysis engine is used to perform dynamic semantic complexity modeling on the current input character sequence. This model constructs a dynamic semantic complexity score by analyzing the part-of-speech distribution, syntactic structure, context dependency degree, and phrase-level collocation rules in the current input, combined with the lexical cohesion degree, semantic ambiguity, and ambiguity intensity between characters. On this basis, an adjustable adaptive threshold function is introduced. This function automatically adjusts the discrimination threshold according to multiple variables such as device load, user feedback score, input scenario type, and historical semantic error rate, and accordingly classifies input errors into two categories: If the current input is judged to have obvious character offset, spelling similarity error, or simple errors at the independent word level, the system will assign it to the second local lightweight model for processing; conversely, if the input involves context dependency, structural nesting, semantic ambiguity, or multi-sentence spanning features, the error will be marked as a semantic complex error and sent to the cloud large model for processing, forming a "spelling-semantic" binary error type shunt mechanism. Based on the above shunt judgment results, the computing resource allocation strategy of the second local lightweight model is dynamically optimized and adjusted. To ensure the keyboard input response speed in high-frequency usage areas, a heat map is constructed according to the user's keyboard operation behavior trajectory, and combined with the user input frequency, key position hit rate, and accidental touch record, local priority scheduling is performed on the local model memory cache and computing core, and additional model computing paths and parameter spaces are reserved for the commonly used key area and high-risk character area, so as to achieve fast response and instant correction. For the cloud model, to prevent bandwidth congestion and soaring latency caused by large-scale complex error upload requests, a cloud call frequency upper limit control strategy is introduced. The call frequency upper limit is set according to factors such as real-time network bandwidth, historical average response time, server processing load, and user-acceptable waiting duration, to avoid affecting the overall error correction fluency of the system due to frequent triggering of semantic requests, thus constituting a differential response scheduling strategy for end-cloud division of labor. After completing the basic shunt and resource allocation, an active prediction ability is constructed to improve the overall response preemption and error correction predictability. N-gram analysis is performed based on the user's historical input records to construct a user-specific keyboard input prediction tree. This prediction tree uses characters, phrases, and semantic segments as nodes, and time sequence, input habits, and language transition probabilities as edge weights, and is used to deduce the character sequence that the user may input next and its corresponding potential error patterns. The system pre-expands the high-probability paths through this prediction tree, activates the inference logic of the local lightweight model in advance, pre-generates an error correction candidate list for some high-risk character segments, forms a predicted error correction cache, and outputs error correction suggestions without delay when the user's real input matches the predicted path, thus greatly shortening the response time and reducing the backend inference pressure. To effectively coordinate the data interaction and request control between the local and the cloud, a cloud request scheduling module based on the token bucket algorithm is introduced. This module smoothly controls the speed of sending error correction requests to the cloud by generating a fixed number of tokens per unit time, avoiding cloud response blocking caused by high-concurrency requests in a short period of time.Meanwhile, this scheduling mechanism is linked with the network condition awareness module. When the network latency increases or the link jitter is severe, it automatically reduces the token generation rate and enables the request batch processing and merging strategy, merging multiple adjacent or related error correction requests into a single request packet for transmission, so as to maximize the bandwidth utilization and minimize the network overhead. This anti-interference communication pipeline mechanism not only optimizes the bandwidth pressure of the request path but also enhances the stable response ability in complex scenarios, and is applicable to the collaborative error correction system operation under mobile scenarios, weak network environments, or conditions where multiple users use simultaneously. With the coordinated cooperation of all the above components, the anti-interference communication pipeline is linked and integrated with the input delay sensitivity function, which calculates the tolerance range of each input action for response delay based on dimensions such as input type, usage scenario, user input speed, and task importance. When it is detected that the input is a high-real-time scenario such as an online conversation, real-time note, or quick question-and-answer system, the system forces the local model result to be the preferred output path, and asynchronously processes the cloud result. After the cloud result is returned, it automatically compares the accuracy of the local result and replaces the displayed content imperceptibly when necessary to ensure the continuity of the user experience and the instantaneity of the response. While in low-interaction-density or static task scenarios such as document writing, report writing, or email reply, it allows moderate waiting for the cloud semantic result before outputting the final error correction text, thus implementing the response quality priority strategy.

[0127] The above describes the AI-based keyboard error automatic correction method in the embodiments of the present application. Next, the AI-based keyboard error automatic correction system in the embodiments of the present application will be described. Please refer to Figure 2 , an embodiment of the AI-based keyboard error automatic correction system in the embodiments of the present application includes:

[0128] An acquisition module 11, configured to acquire the contact pressure distribution, sliding trajectory, and residence time of the user's keyboard input and construct an input intention probability matrix;

[0129] A preliminary correction module 12, configured to input the input intention probability matrix into a first local lightweight model for error detection and preliminary correction to obtain a first correction result;

[0130] A semantic analysis module 13, configured to transmit the first correction result and the input intention probability matrix to a cloud large model for in-depth semantic analysis to obtain a second correction result;

[0131] A knowledge distillation module 14, configured to perform recursive knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model;

[0132] An output module 15, configured to acquire the behavioral feedback data of the user's acceptance or rejection of the second correction result, and dynamically adjust the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and output a two-layer asynchronous collaborative error correction strategy.

[0133] Through the collaborative cooperation of the above-mentioned various components, by establishing a two-layer asynchronous collaborative architecture of a lightweight local model and a large cloud model, a balance between real-time response and high accuracy is achieved. The local model is responsible for immediate response, while the large cloud model asynchronously optimizes the results, thus improving the error correction quality while ensuring the response speed. The physical characteristics of the user's keystrokes are captured by the contact dynamic feature perception network, and an input intention probability matrix is constructed. Compared with the traditional method that only relies on static key position information, it can more accurately understand the user's true input intention, especially in the scenarios of fast typing and one-handed operation. Through the recursive knowledge distillation self-correction mechanism, the knowledge of the large cloud model is continuously compressed into the local lightweight model, enabling the local model to continuously self-optimize, reducing the dependence on a large amount of labeled data, and achieving continuous improvement of system performance over time. Based on the collection of user feedback signals, a personalized tuning network is established to perform fine-grained adjustment according to different users' input habits and application scenarios, improving the error correction acceptance rate and enhancing the user experience, especially in terms of specific domain technical terms and personal habitual expressions. The local lightweight model adopts a lightweight expert mixture layer, a sparse activation mechanism, and a multi-level attention structure, which improves the model's expressive ability while maintaining low computational complexity, and achieves efficient error recognition and correction. By constructing an anti-interference communication pipeline and a differential response scheduling strategy, the system can operate stably under various network conditions and device states, improving the adaptability of the system in weak network environments and low-resource devices. Based on the user's historical input patterns, a keyboard input prediction tree is constructed to trigger potential error correction calculations in advance, combined with an oblivious replacement mechanism, effectively reducing the user's perceived latency and providing a smoother input experience.

[0134] Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the above-described systems, systems, and units can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.

[0135] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing an electronic device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0136] As described above, the above embodiments are only used to illustrate the technical solutions of this application, rather than to limit it; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of this application.

Claims

1. An AI-based automatic keyboard error correction method, characterized in that, Including: Collecting the contact pressure distribution, sliding trajectory, and dwell time of the user's keyboard input and constructing an input intention probability matrix; Inputting the input intention probability matrix into a first local lightweight model for error detection and preliminary correction to obtain a first correction result; Transmitting the first correction result and the input intention probability matrix to a cloud large model for in-depth semantic analysis to obtain a second correction result; Performing recursive knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model; Collecting the behavioral feedback data of the user's acceptance or rejection of the second correction result, and dynamically adjusting the task allocation of the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and outputting a two-layer asynchronous collaborative error correction strategy.

2. The AI-based automatic keyboard error correction method according to claim 1, wherein The collecting the contact pressure distribution, sliding trajectory, and dwell time of the user's keyboard input and constructing an input intention probability matrix includes: Collecting key pressure data through an embedded sensor array in the user device to obtain contact pressure distribution data; Tracking the movement coordinates and corresponding timestamps of the user's finger on the touch screen to obtain sliding trajectory data; Recording the contact start time and release time of the user's key press to obtain key time series feature data; Performing intention mapping calculation based on the contact pressure distribution data, the time series feature data, and the sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input.

3. The AI-based automatic keyboard error correction method according to claim 2, wherein The performing intention mapping calculation based on the contact pressure distribution data, the time series feature data, and the sliding trajectory data to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input includes: Performing Gaussian distribution calculation on the contact pressure distribution data to obtain a key position heat map, where the central value of the heat map represents the key press intention intensity; Calculating the user finger movement vector and speed characteristics according to the sliding trajectory data to obtain a direction offset matrix; Calculating the time interval ratio between adjacent characters based on the key time series feature data to obtain a time correlation weight; Performing Bayesian probability fusion on the key position heat map, the direction offset matrix, and the time correlation weight to obtain an initial intention probability distribution; Performing spatial correlation weighting adjustment on the initial intention probability distribution in combination with the standard keyboard layout geometric distance matrix to obtain an input intention probability matrix representing the correspondence between the characters pressed by the user and the characters actually intended to be input.

4. The AI-based automatic keyboard error correction method according to claim 1, wherein The inputting the input intention probability matrix into a first local lightweight model for error detection and preliminary correction to obtain a first correction result includes: Performing mapping processing on the input character sequence through the character-level embedding layer of the first local lightweight model to obtain a character vector sequence; Inputting the character vector sequence into the lightweight expert mixture layer of the first local lightweight model, and distributing the input to 4 expert sub-networks through a routing network for parallel feature extraction to obtain a multi-perspective feature representation; Selectively activate the features of the multi-view feature representation using a simplified sparse activation module, only retaining the key information pathways to obtain a sparse feature matrix; Input the sparse feature matrix and the input intention probability matrix into a lightweight multi-level attention structure for cross-modal information fusion to obtain a fused semantic representation. The lightweight multi-level attention structure includes 4 attention heads and 2 layers of Transformer structures; Input the fused semantic representation into the error detection branch and the correction branch of the dual-branch prediction head in the first local lightweight model for parallel computing, and perform probability weighting in combination with a preset n-gram word frequency statistical table to obtain a first correction result.

5. The AI-based automatic keyboard error correction method according to claim 4, wherein Transmitting the first correction result and the input intention probability matrix to a cloud large model for in-depth semantic analysis to obtain a second correction result, including: Transmitting the first correction result, the input character sequence, and the input intention probability matrix to a cloud server to obtain a cloud input data set; Perform a merging process on the cloud input data set, the user's historical input sequence, and the application context information to obtain a target context data set; Input the target context data set into a cloud large model that adopts a mixture of experts architecture, a sparse activation mechanism, and a multi-level attention structure for processing to obtain in-depth semantic association data; Perform conditional probability maximization calculation based on the in-depth semantic association data to generate an optimal corrected text sequence, and return the optimal corrected text sequence as the second correction result to the user device.

6. The AI-based automatic keyboard error correction method according to claim 1, wherein, Recursively perform knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model, including: Use a pseudo-label generator to pair the second correction result and the input character sequence to obtain a pseudo-label training sample pair; Calculate the correction consistency, prediction confidence, and uniqueness of the pseudo-label training sample pair through a quality evaluation function, and generate a sample quality score set based on the correction consistency, the prediction confidence, and the uniqueness; Perform threshold screening on the pseudo-label training sample pair based on the sample quality score set, and add the samples in the pseudo-label training sample pair with a sample quality score higher than a preset value to the recursive training cache to obtain a target distillation training set; Input the target distillation training set into a dynamic weighted distillation module, and use a combined distillation loss function to train the first local lightweight model to obtain a knowledge compression parameter set. The first local lightweight model includes a character-level embedding layer, a lightweight mixture of experts layer, a simplified sparse activation module, a lightweight multi-level attention structure, and a dual-branch prediction head; Update the parameters and optimize the structure of the first local lightweight model according to the knowledge compression parameter set, and at the same time establish a reverse knowledge flow channel to summarize new error patterns to the server to obtain a second local lightweight model.

7. The AI-based automatic keyboard error correction method according to claim 1, characterized in that, The collecting of user behavioral feedback data on acceptance or rejection of the second correction result, and dynamically adjusting task allocation between the second local lightweight model and the cloud-based large model based on the behavioral feedback data of acceptance or rejection, and outputting a two-layer asynchronous collaborative error correction strategy, include: Monitor and collect the user's selection actions of accepting or rejecting correction suggestions, editing behavior after correction, response time, and acceptance rate in application scenarios to obtain behavioral feedback data; Performing Bayesian weight optimization calculation on the behavioral feedback data to obtain an error correction satisfaction score; Building personalized parameter adjustment data including user's commonly used vocabulary, error type distribution and scenario preferences based on the error correction satisfaction score; Monitor and calculate the device processor load, memory usage, battery power, and network latency, and generate a task allocation plan based on the personalized parameter adjustment data; The second local lightweight model and the cloud-based large model are configured and adjusted according to the task allocation scheme to obtain a two-layer asynchronous collaborative error correction strategy.

8. The AI-based automatic keyboard error correction method according to claim 7, characterized in that, The configuration adjustment of the second local lightweight model and the cloud large model according to the task allocation scheme to obtain a two-layer asynchronous collaborative error correction strategy includes: The semantic complexity of the input character sequence is calculated in real time according to the task allocation scheme, and simple spelling errors are assigned to the second local lightweight model for processing through an adaptive threshold function, while semantic dependency errors are assigned to the cloud-based large model for processing, thereby obtaining a binary error type diversion mechanism; Dynamically adjust the computing resource allocation of the second local lightweight model based on the binary error type diversion mechanism, reserve computing resources for keyboard input in high-frequency use areas, and implement an upper limit control on the call frequency of the cloud-based large model to obtain a differentiated response scheduling strategy; Perform N-gram grammar analysis based on the user's historical input pattern, build a keyboard input prediction tree, and trigger potential error correction calculation in advance based on the keyboard input prediction tree to obtain a pre-judgment error correction cache; Based on the prejudgment error correction cache and the differentiated response scheduling strategy, a token bucket algorithm is used to control the smoothness of sending requests to the cloud-based large model, and network condition-aware request batch merging is implemented to obtain an interference-resistant communication pipeline; The anti-interference communication pipeline is combined with the input delay sensitivity function to obtain results from the second local lightweight model, while allowing the cloud-based large model results to be returned asynchronously without perceptible replacement, forming a two-layer asynchronous collaborative error correction strategy.

9. An AI-based automatic keyboard error correction system, characterized in that, Used to execute the AI-based automatic keyboard error correction method according to any one of claims 1 to 8, the AI-based automatic keyboard error correction system comprising: The acquisition module is used to collect the contact pressure distribution, sliding trajectory and dwell time of the user's keyboard input and construct the input intention probability matrix; a preliminary correction module, configured to input the input intention probability matrix into a first local lightweight model for error detection and preliminary correction to obtain a first correction result; A semantic analysis module, configured to transmit the first correction result and the input intent probability matrix to a cloud-based large model for deep semantic analysis to obtain a second correction result; A knowledge distillation module, configured to perform recursive knowledge distillation on the first local lightweight model according to the second correction result to obtain a second local lightweight model; An output module, configured to collect behavioral feedback data on the acceptance or rejection of the second correction result by a user, and dynamically adjust task allocation for the second local lightweight model and the cloud large model based on the acceptance or rejection behavioral feedback data, and output a two-layer asynchronous collaborative error correction strategy.

Citation Information

Patent Citations

  • Input error correcting method, input error correcting device, automatic error correcting method, automatic error correcting device and mobile terminal

    CN103425412A

  • Interaction system and method for AI intelligent mouse

    CN117784959A