Typing competition method and system based on real-time capability modeling and dynamic text generation

By collecting and analyzing user keystroke data in real time, a dynamic ability model is built to achieve accurate opponent matching and personalized text generation. This solves the problems of personalized training and dynamic adaptability in existing typing competition systems, and improves the pertinence and fun of skills training.

CN122332957APending Publication Date: 2026-07-03HANGZHOU XIAOMA EDUCATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610498945.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-15
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing typing competition systems have limitations in terms of personalized training and dynamic adaptability. They cannot reflect fluctuations in user status in real time, resulting in matching results that deviate from the actual ability level. The training content is out of touch with user needs, and there is a lack of real-time perception of the training process, making it difficult to continuously improve skills.

Method used

By collecting users' real-time keystroke data, calculating real-time ability vectors, matching opponents and generating text based on ability vectors, dynamically adjusting the difficulty, realizing a closed-loop feedback mechanism, generating personalized competitive text, and adjusting the difficulty level in real time.

Benefits of technology

It enables personalized training and continuous improvement of typing skills, enhances the immersive experience and training efficiency of the user, breaks through the static and isolated nature of traditional typing practice, and provides a technological paradigm for personalized learning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122332957A_ABST
    Figure CN122332957A_ABST
Patent Text Reader

Abstract

This application relates to a typing competition method and system based on real-time ability modeling and dynamic text generation. The method includes: collecting user keystroke flow data in real time, calculating and weighting core and auxiliary ability indicators to generate a real-time ability vector; matching opponents based on vector similarity calculation and dynamic threshold; determining the basic text difficulty level based on both parties' abilities, and extracting the intersection of both parties' weak character sets as a common weak character set; generating original text based on this difficulty level, and replacing characters in non-critical semantic positions with common weak characters to form competition-specific text; synchronously transmitting the text to both parties' clients, dynamically adjusting the text difficulty by monitoring the input flow and exchanging cursor and error data in real time; after the competition, calculating a comprehensive score based on logs, generating a longitudinal report, and merging error character distribution data into the historical dataset to update the user's weak character set. This application improves the user's typing competition experience and training efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to a typing competition method and system based on real-time capability modeling and dynamic text generation. Background Technology

[0002] With the deep integration of computers and mobile devices in education and training, typing skills have become one of the fundamental skills of the digital age, leading to the rapid development of various typing training tools. Early standalone training software helped users familiarize themselves with the keyboard layout and improve typing speed by providing fixed text libraries and repetitive practice modes. Subsequent online competitive platforms introduced real-time multiplayer battle mechanisms, enhancing the fun of training through ranking competition and social interaction. These systems typically rely on users' historical data (such as average typing speed and cumulative accuracy) to match opponents and use preset static text libraries as competition content, effectively improving the participation and sustainability of typing training for a certain period.

[0003] However, existing typing competition systems have significant limitations in achieving personalized training and dynamic adaptability. On the one hand, static matching mechanisms based on historical data struggle to reflect real-time fluctuations in a user's performance, leading to matching results that often deviate from their actual skill level. Mismatches between beginners and advanced users are frequent, making it difficult for both sides to receive effective training stimulation. On the other hand, fixed text libraries cannot dynamically adjust content focus based on a user's current skill weaknesses, resulting in training content that is disconnected from individual needs and makes it difficult to specifically strengthen weak areas. Furthermore, the system lacks real-time perception of performance changes during training, failing to dynamically adjust task difficulty when it detects user difficulties or insufficient challenge, causing training results to stagnate at a fixed level. These limitations make existing typing training tools unable to meet users' genuine needs for continuous skill improvement and unable to maintain a good user experience in the long run. Summary of the Invention

[0004] To address the aforementioned technical issues, this application provides a typing competition method based on real-time capability modeling and dynamic text generation.

[0005] Firstly, this application provides a typing competition method based on real-time capability modeling and dynamic text generation, employing the following technical solution:

[0006] Collect real-time keystroke stream data from users, including key value sequences, timestamp sequences, and correctness indicator sequences;

[0007] The core capability indicators and auxiliary capability indicators are calculated based on the real-time keystroke stream data, and then weighted and fused according to preset weights to generate a real-time capability vector for the user.

[0008] The real-time capability vector of the initiating user is compared with the real-time capability vectors of each user in the online user pool to calculate a comprehensive similarity. When the comprehensive similarity value exceeds the dynamic matching threshold, the identifier of the matched opponent user is output.

[0009] Based on a preset difficulty mapping table, the basic difficulty level of the text is determined according to the real-time capability vectors of the initiating user and the opponent user, and the intersection of the weak character sets of the initiating user and the opponent user is extracted as the common weak character set.

[0010] Based on the aforementioned basic text difficulty level, original text material is generated, and characters in non-critical semantic positions in the original text material are replaced with characters from the common weak character set to generate competition-specific text;

[0011] The competition-specific text is synchronously transmitted to the client of the initiating user and the client of the opposing user. The input streams of both sides are monitored and the cursor position and error mark data are exchanged in real time. The text difficulty level of the initiating user or the opposing user is dynamically adjusted based on the continuous error rate or accuracy rate changes.

[0012] The comprehensive score is calculated based on the competition logs and a longitudinal comparison report is generated. The error character type distribution data in this competition is merged into the user's historical dataset, and the user's weak character set definition is updated.

[0013] By adopting the above technical solutions, a complete typing competition ecosystem has been constructed, breaking through the static and isolated nature of traditional typing practice and realizing a paradigm shift from fixed training to intelligent adaptation. Real-time ability vectors accurately capture user state fluctuations, ensuring fair matching and content relevance; dynamic text generation and difficulty adjustment ensure that training content evolves in sync with user abilities; and a closed-loop feedback mechanism transforms discrete competition activities into a coherent growth trajectory. This technical solution improves typing skills while enhancing user immersion and training efficiency, providing a technological paradigm for personalized learning in the online education field.

[0014] Secondly, this application provides a typing competition system based on real-time capability modeling and dynamic text generation, employing the following technical solution:

[0015] The real-time keystroke stream acquisition module is used to collect the user's real-time keystroke stream data, including key value sequence, timestamp sequence, and correctness identifier sequence;

[0016] The capability vector modeling module is used to calculate core capability indicators and auxiliary capability indicators based on the real-time keystroke stream data, and to perform weighted fusion according to preset weights to generate a real-time capability vector for the user.

[0017] The opponent matching module is used to calculate the comprehensive similarity between the real-time capability vector of the initiating user and the real-time capability vectors of each user in the online user pool. When the comprehensive similarity value exceeds the dynamic matching threshold, the matching opponent user identifier is output.

[0018] The public weak character set generation module is used to determine the basic difficulty level of the text based on the real-time capability vectors of the initiating user and the opponent user, based on a preset difficulty mapping table, and to extract the intersection of the weak character sets of the initiating user and the opponent user as the public weak character set.

[0019] The competitive text generation module is used to generate original text material based on the basic difficulty level of the text, and replace characters in non-critical semantic positions in the original text material with characters from the common weak character set to generate competitive text.

[0020] The real-time interaction module is used to synchronously transmit the competition-specific text to the initiating user client and the opponent's user client, monitor the input streams of both sides and exchange cursor positions and error marker data in real time;

[0021] The text difficulty dynamic adjustment module is used to dynamically adjust the text difficulty level of the initiating user or the opponent user based on continuous changes in error rate or accuracy.

[0022] The data fusion and update module is used to calculate the comprehensive score based on the competition log and generate a longitudinal comparison report. It merges the error character type distribution data in this competition into the user's historical dataset and updates the user's weak character set definition.

[0023] Thirdly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0024] A computer-readable storage medium storing a computer program that can be loaded by a processor and executed as in any of the methods in the first aspect.

[0025] In summary, this application includes at least one of the following beneficial technical effects: by collecting and analyzing user keystroke data in real time, a dynamic ability model is constructed and accurate opponent matching is achieved. Simultaneously, personalized competitive text is generated based on the weaknesses of both sides, and the difficulty is adaptively adjusted during the competition. This effectively breaks through the static nature of traditional typing practice, transforming a single competition into a continuous personalized training cycle, improving the relevance, interest, and long-term effectiveness of skill training, and providing a feasible technical paradigm for adaptive learning systems in the field of online education. Attached Figure Description

[0026] Figure 1 This is a first flowchart illustrating a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0027] Figure 2 This is a second flowchart illustrating a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0028] Figure 3 This is a schematic diagram of the third process of a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0029] Figure 4 This is a schematic diagram of the fourth process of a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0030] Figure 5 This is a schematic diagram of the fifth process of a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0031] Figure 6 This is a schematic diagram of the sixth process of a typing competition method based on real-time capability modeling and dynamic text generation, which is one embodiment of this application.

[0032] Figure 7 This is a schematic diagram of the seventh process of a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application.

[0033] Figure 8 This is a schematic diagram of the eighth process of a typing competition method based on real-time capability modeling and dynamic text generation, according to one embodiment of this application. Detailed Implementation

[0034] To make the purpose, technical solution, and advantages of this application clearer, the following description is provided in conjunction with the appendix. Figures 1-8 The present application will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the application.

[0035] This application discloses a typing competition method based on real-time capability modeling and dynamic text generation.

[0036] Reference Figure 1 Typing competition methods based on real-time capability modeling and dynamic text generation specifically include:

[0037] Step S101: Collect the user's real-time keystroke stream data, including key value sequence, timestamp sequence, and correctness identifier sequence;

[0038] The key-value sequence records the character encoding actually entered by the user, the timestamp sequence marks the input time of each character with millisecond precision, and the correctness indicator sequence generates a Boolean value sequence (true for correct, false for incorrect) by comparing the user input with the expected character. These three types of data together constitute a complete keystroke event stream, which can reconstruct the temporal characteristics and error patterns of the typing process.

[0039] This step departs from the limitations of traditional typing practice that relies on historical statistical data, instead capturing the user's current state changes through real-time streaming data acquisition. For example, when a user types "apple", the key value sequence is ['a', 'p', 'p', 'l', 'e'], the timestamp sequence records the input time of each character, and the correctness indicator sequence reflects whether it was mistakenly typed as "appke" (where 'e' is incorrect). This acquisition method can not only calculate macro-level indicators such as speed and accuracy, but also reveal the stability of the user's typing feel by analyzing keystroke interval fluctuations (such as timestamp difference sequences), or locate common error types (such as specific key binding confusion) through the distribution of error indicators.

[0040] Step S102: Calculate core capability indicators and auxiliary capability indicators based on real-time keystroke stream data, and perform weighted fusion according to preset weights to generate a real-time capability vector for the user.

[0041] Among them, core competency indicators (such as real-time typing speed and accuracy) directly reflect the user's basic skill level, while auxiliary competency indicators (such as fatigue coefficient and error type distribution vector) capture state fluctuations and potential weaknesses.

[0042] In this embodiment, the weighted fusion step can balance the stability and dynamism of the capability by using preset weights (e.g., 70% for core indicators and 30% for auxiliary indicators). For example, the real-time speed indicator is calculated based on the number of valid characters within a sliding time window (e.g., the most recent 20 seconds), avoiding the lag caused by historical data; the error type distribution vector is attributed to specific patterns (e.g., accidental touches of adjacent keys or confusion of pinyin) through classification algorithms (e.g., based on key distance or character similarity), thereby transforming discrete errors into a quantifiable probability distribution.

[0043] Understandably, the generation of real-time capability vectors essentially constructs a dynamic "digital twin" of user capabilities, with each dimension representing one aspect of the capability. The weight configuration ensures that core capabilities dominate (e.g., speed weight 40%), while allowing auxiliary indicators (e.g., fatigue coefficient calculated based on continuous input duration) to fine-tune state fluctuations.

[0044] Step S103: Perform a comprehensive similarity calculation between the real-time capability vector of the initiating user and the real-time capability vectors of each user in the online user pool. When the comprehensive similarity value exceeds the dynamic matching threshold, output the identifier of the matched opponent user.

[0045] Specifically, the comprehensive similarity calculation adopts a multi-dimensional weighted algorithm (such as combining cosine similarity, speed-accuracy difference penalty and weak character set overlap), which is essentially comparing the comprehensive similarity of two vectors in terms of direction, numerical difference and specific dimension overlap.

[0046] The dynamic matching threshold (e.g., an initial value of 0.85) is set to strike a balance between matching accuracy and waiting time: when the threshold is high, the system strives for a high degree of matching, but this may prolong the waiting time; therefore, a dynamic adjustment mechanism is introduced (e.g., the threshold is reduced in increments of 0.05 after a timeout) to gradually expand the matching range and avoid indefinite waiting. For example, if user A's vector shows high speed and high accuracy but weak numeric input, the system will prioritize matching user B, who has similar speed but also weak numeric input, rather than user C, whose overall ability is significantly different.

[0047] Understandably, upgrading the matching criteria from static historical data to dynamic real-time status, and quantifying fairness through algorithms (such as ensuring that both sides train on their common weaknesses by ensuring the overlap of weak character sets) can enhance the training value and engagement of the PK (player versus player) competition.

[0048] Step S104: Based on the preset difficulty mapping table, determine the basic difficulty level of the text according to the real-time ability vectors of the initiating user and the opponent user, and extract the intersection of the weak character sets of the initiating user and the opponent user as the common weak character set.

[0049] The preset difficulty mapping table maps key indicators in the ability vector (such as median speed and minimum accuracy) to discrete difficulty levels (such as levels 1-10). The principle is to establish an empirical correlation between indicator values ​​and text complexity (e.g., low speed and low accuracy correspond to low difficulty).

[0050] The extraction of the common weak character set employs set theory, taking the intersection of the weak character sets of both users to ensure that the text content simultaneously covers the practice needs of both. For example, if user A's weak character is numbers and user B's weak character is uppercase letters, the common set may be empty, in which case the system can fall back to the individual weak character sets; however, if there is an intersection (such as both users being weak in the symbol "@"), the intersection characters are used first. This step transforms text generation from a fixed, one-size-fits-all approach to a dynamic decision based on the capabilities of both users, ensuring that the text difficulty matches the users' current abilities and that the content focuses on common weaknesses, thus achieving precise training.

[0051] Step S105: Generate original text material based on the basic difficulty level of the text, and replace characters in non-critical semantic positions in the original text material with characters from the common weak character set to generate competition-specific text;

[0052] Among these methods, natural language processing technology is used to personalize basic text materials into training materials that target common weak character sets.

[0053] Specifically, the original text material is retrieved from the corpus according to its difficulty level (e.g., low difficulty corresponds to short sentences, high difficulty corresponds to long and complex sentences), while character replacement at non-critical semantic locations (e.g., modifiers, repetitive expression areas) ensures that weak characters are selectively inserted while maintaining semantic coherence. For example, replacing the modifier "very" in the sentence "Today's weather is very good" with the common weak character "%" (assuming both parties are not proficient in symbol input) generates "Today's weather % good" without destroying the core semantics. This approach avoids mechanically piling up weak characters (e.g., directly generating "123@#" practice text), but instead embeds character training into the natural language environment, enhancing the training's enjoyment while ensuring the effectiveness of language learning. The key to this step is balancing the naturalness of the text with the training objective, which can be achieved by accurately locating replaceable positions using NLP algorithms (e.g., dependency parsing) to avoid altering key semantic units (e.g., subjects or verbs).

[0054] Step S106: The competition-specific text is synchronously transmitted to the client of the initiating user and the client of the opposing user. The input streams of both sides are monitored and the cursor position and error mark data are exchanged in real time. The text difficulty level of the initiating user or the opposing user is dynamically adjusted based on the continuous error rate or accuracy rate changes.

[0055] Real-time data synchronization (such as exchanging cursor positions and error markers between the two players) relies on low-latency communication protocols (such as WebSocket) to keep the interfaces of both players consistent and to provide an input source for difficulty adjustments.

[0056] In this embodiment, the logic of dynamic difficulty adjustment is based on the "zone of proximal development" theory in behavioral psychology: when the system detects a sudden increase in the consecutive error rate (e.g., three consecutive errors), it determines that the user is on the verge of frustration and triggers a downgrade operation (e.g., simplifying sentence structure); conversely, when both parties' accuracy rates remain high (e.g., above 95%), it indicates insufficient challenge and triggers an upgrade operation (e.g., adding more complex sentence structures). For example, if user A frequently misclicks number keys during a competition, the system may temporarily replace the numbers in their text with word descriptions (e.g., changing "100" to "one hundred"). This adaptive mechanism ensures that training is always at the edge of the user's ability, avoiding both boredom and excessive frustration, thereby maximizing learning efficiency.

[0057] Step S107: Calculate the comprehensive score based on the competition log and generate a longitudinal comparison report. Merge the error character type distribution data in this competition into the user's historical dataset and update the user's weak character set definition.

[0058] Specifically, the comprehensive score integrates multi-dimensional data (such as speed, accuracy, and difficulty level) to avoid the bias of a single indicator and highlight overall performance (e.g., high speed but low accuracy results in a lower score). The longitudinal comparison report reveals the long-term trajectory of progress by comparing the current data with historical records (e.g., plotting speed trend graphs).

[0059] Furthermore, merging the error character type distribution data is used to update the definition of weak character sets (e.g., the frequently misused character "z" is weighted and added to the historical dataset). For example, if the user's error rate in symbol input decreases significantly this time, the system may reduce the weak weight of that character set; conversely, it may strengthen its proportion in new text. This step transforms a single PK (primary key comparison) into a continuous learning cycle, iteratively optimizing the user ability model through a data-driven approach, enabling the training system to have self-evolution capabilities.

[0060] The above implementation constructs a complete typing competition ecosystem, breaking through the static and isolated nature of traditional typing practice and realizing a paradigm shift from fixed training to intelligent adaptation. By accurately capturing user state fluctuations through real-time ability vectors, it ensures the fairness of matching and the relevance of content; through dynamic text generation and difficulty adjustment, it ensures that training content always evolves in sync with user abilities; and the closed-loop feedback mechanism transforms discrete PK activities into a coherent growth trajectory. This technical solution improves typing skills while enhancing the immersive experience and training efficiency of the user, providing a technological paradigm for personalized learning in the online education field.

[0061] Reference Figure 2 As one implementation of step S102, the step of calculating core capability indicators and auxiliary capability indicators based on real-time keystroke stream data, and then weighting and fusing them according to preset weights to generate a user's real-time capability vector includes:

[0062] Step S201: Analyze the key value sequence, timestamp sequence, and correctness identifier sequence in the real-time keystroke stream data to extract the valid character input range;

[0063] Specifically, the key-value sequence, timestamp sequence, and correctness identifier sequence constitute a three-dimensional data stream, where the interval distribution of the timestamp sequence is the key basis for identifying valid input intervals. When the interval between consecutive keystrokes exceeds a preset threshold (e.g., 2 seconds), the system determines that the user has entered an intermittent state and automatically segments the data before and after it. The principle of this design is to eliminate the interference of non-typing behaviors (such as pauses in thinking or temporary interruptions) on ability assessment, ensuring that subsequent indicator calculations are based only on continuous and stable input behaviors. For example, if a user pauses to reply to a message and then continues typing, the system will automatically identify and exclude the pause interval through the timestamp difference, retaining only the data from the active input period. By extracting valid character input intervals, a dynamic data cleaning mechanism is constructed, laying the foundation for subsequent accurate modeling.

[0064] Step S202: Based on the number of characters and time interval in the effective character input range, calculate a set of core capability indicators that include at least real-time typing speed and real-time accuracy.

[0065] Specifically, the real-time typing speed value is calculated based on the number of correct characters within the most recent consecutive time period (e.g., 20 seconds), using characters per minute (CPM) as the standardized unit of measurement. The principle behind this is to ensure the sensitivity of the indicator to the current state by limiting the time window, avoiding the dilution of real-time performance by historical data. The real-time accuracy value is calculated using the percentage of correct characters within a fixed-length character window (e.g., the most recent 50 characters). This design can quickly capture accuracy fluctuations while preventing indicator jumps caused by accidental errors within extremely short windows. Combining these two values ​​for capability assessment, the speed value reflects operational efficiency, and the accuracy value reflects operational quality. This dual-window mechanism balances the real-time nature and stability of the indicators, preventing distortion due to instantaneous fluctuations while promptly reflecting changes in state.

[0066] Step S203: Analyze the relationship categories between error characters and corresponding target characters in the correctness identifier sequence, and generate an error type distribution vector;

[0067] In some embodiments, the relationship categories include at least one of the following: Key adjacency relationship: The Manhattan distance between the erroneous character and the target character in the standard keyboard layout is ≤1; Pinyin same relationship: The full Pinyin spelling of the erroneous character and the target character is the same; Character shape similarity relationship: The structural similarity between the erroneous character and the target character in the GB2312 character shape library is >80%.

[0068] In this process, by establishing a mapping relationship between erroneous characters and target characters, the system uses multi-dimensional classifiers (such as key distance algorithm, pinyin encoding comparator, and character shape feature extractor) to perform attribution analysis on errors.

[0069] Specifically, key adjacency relationships are calculated based on the Manhattan distance of the keyboard layout's topology to identify accidental touches caused by physical operational deviations; pinyin similarity relationships utilize Chinese pinyin encoding rules to capture input method association errors; and character shape similarity relationships are discovered through character structure feature extraction to identify errors caused by visual confusion. This classification principle enables the system to distinguish the intrinsic causes of errors, rather than simply counting the number of errors. The generated error type distribution vector is essentially a probability density function of error patterns, providing data support for subsequent targeted training.

[0070] Step S204: Calculate the cumulative value of continuous input duration and convert it into fatigue coefficient;

[0071] The cumulative duration of continuous input is mapped to a fatigue coefficient using a non-linear function (such as square root transformation). This design principle is based on the fact that short-term continuous input has little impact on ability, while prolonged operation produces an exponentially increasing fatigue effect. For example, the first 5 minutes of input may only produce linear fatigue accumulation, but fatigue levels accelerate after 10 minutes. The conversion function is designed to consider the decay curve of user attention, ensuring that the fatigue coefficient accurately reflects the user's transition from focused to fatigued states. The importance of this metric lies in introducing a time-dimensional correction to ability assessment, preventing the system from misjudging the user's true ability level during periods of fatigue.

[0072] Step S205: Call the preset weight configuration parameters to perform weighted calculations on the core capability indicator set, error type distribution vector, and fatigue coefficient;

[0073] The core capability indicators (numerical), error type distribution vector (vector), and fatigue coefficient (scalar) are organized using specific data structures (such as JSON objects or feature tensors). The principle behind this approach is to preserve the original data characteristics of each indicator while establishing correlations. This integration is not a simple numerical superposition, but rather the construction of a structured set with semantic hierarchies: speed / accuracy as the foundational layer, error distribution as the diagnostic layer, and fatigue coefficient as the state layer.

[0074] The preset weight configuration parameters are essentially a priority mapping of various capability dimensions under different scenarios. For example, speed might be given higher weight in speed competition mode, while accuracy might be given higher weight in precision training mode. The weighted calculation uses a combination of feature scaling and linear weighting, first normalizing each indicator to the same dimension, and then fusing them according to the weight coefficients. This design principle allows the system to dynamically adjust the evaluation strategy according to the actual application scenario, rather than using a fixed evaluation standard.

[0075] In some embodiments, the preset weight configuration parameter defines the total weight of the core capability indicator set as 70%, and the total weight of the error type distribution vector and fatigue coefficient as 30%.

[0076] Step S206: Output the weighted calculation result as the user's real-time capability vector.

[0077] The final output is a multi-dimensional real-time user capability vector, where each dimension represents a specific aspect of capability, and the dimensions maintain a reasonable balance of contribution through weight configuration. The real-time nature of this vector is reflected in the fact that its data sources are all the latest behavioral data within a sliding window, and its multi-dimensionality is reflected in the comprehensive characterization of speed, accuracy, error patterns, and fatigue state.

[0078] The above implementation establishes a complete transformation chain from raw keystroke behavior to structured ability vectors, enabling multi-dimensional dynamic quantification of users' typing abilities. It transforms the subjective and ambiguous concept of ability strength into an objective and calculable feature vector, encompassing not only traditional speed and accuracy indicators but also innovatively introducing error pattern analysis and fatigue perception, upgrading ability assessment from a single-result evaluation to a dynamic diagnosis throughout the entire process.

[0079] Reference Figure 3 As one implementation of step S103, the step of calculating the comprehensive similarity between the initiating user's real-time capability vector and the real-time capability vectors of each user in the online user pool, and outputting the identifier of the matched adversary user when the comprehensive similarity value exceeds the dynamic matching threshold, includes:

[0080] Step S301: Retrieve the real-time capability vector and current status identifier of each user to be matched in the online user pool. The status identifier includes idle status or matching status.

[0081] In this embodiment, the online user pool is essentially an in-memory hash table or distributed database, where each user entry is associated with its real-time capability vector and state identifier. The real-time capability vector is a multi-dimensional feature array generated by continuously monitoring user keystroke behavior, containing numerical indicators such as speed, accuracy, and error pattern distribution, thus comprehensively reflecting the user's instantaneous capability status. The state identifier is defined using an enumeration type, such as "idle state" indicating that the user is currently accepting matching requests, and "matching state" indicating that the user has entered the matching process or is interacting. This state machine design avoids resource conflicts.

[0082] Furthermore, retrieval operations can be performed periodically using database query languages ​​(such as SQL) or real-time stream processing technologies (such as Apache Kafka) to ensure that the retrieved data has millisecond-level timeliness. For example, when a user initiates a match, the system filters out non-idle users and only performs subsequent calculations on available users. This mechanism significantly improves matching efficiency and reduces system load.

[0083] Step S302: Perform multi-dimensional similarity matching between the real-time capability vector of the initiating user and the real-time capability vector of each user to be matched, and generate the corresponding comprehensive similarity value.

[0084] The multi-dimensional similarity calculation is not a simple Euclidean distance comparison, but rather integrates evaluations of three orthogonal dimensions: the cosine similarity component measures the directional consistency of the capability vectors, reflecting the similarity of the user's capability structure, and can be calculated based on the real-time capability vectors of the initiating user and the user to be matched; the difference penalty component is generated based on the absolute difference between the real-time typing speed and the absolute difference between the real-time accuracy of the two parties, and evaluates the numerical similarity of key indicators (such as speed and accuracy) through absolute difference calculation; the feature overlap component can be determined by the intersection ratio of the weak character sets of the two parties, and the Jaccard similarity coefficient of the weak character sets of the two parties is calculated based on set theory.

[0085] In some embodiments, the specific formula for calculating the comprehensive similarity value is: Comprehensive similarity value = α × cosine similarity component + β × difference penalty component + γ × feature overlap component. Wherein α, β, and γ are preset weight coefficients, and satisfy α + β + γ = 1.

[0086] Specifically, this multi-dimensional evaluation mechanism ensures that the matching results consider both the similarity of overall capabilities and the complementarity of specific weaknesses. During the calculation process, the system normalizes the results of each dimension to eliminate differences in units, and then performs linear weighting using preset weight coefficients to finally generate a comprehensive similarity value between 0 and 1. For example, even if two users have a small difference in overall speed, if their error patterns highly overlap, the feature overlap component will improve the final score, making the matching more focused on training targeting.

[0087] Step S303: Filter out the set of users to be matched whose comprehensive similarity value exceeds the preset initial matching threshold;

[0088] The preset initial matching threshold (e.g., 0.85) is a critical value calibrated through extensive experiments, representing the system's minimum standard for fair competition. The screening process uses comparator circuits or software conditional judgment to perform binary classification on the comprehensive similarity value of each user to be matched. Users exceeding the threshold are added to the candidate set, while the rest are temporarily excluded.

[0089] This step ensures high initial matching standards (avoiding significant skill disparities) while allowing for subsequent dynamic adjustments. The threshold selection considers the principle of normal distribution; assuming user abilities follow a Gaussian distribution, a higher threshold can cover the top 15% of high-quality matches in the overall pool. The system also records the false positive and false negative rates during the screening process, providing data support for threshold optimization.

[0090] Step S304: When there is a candidate user in the set of users to be matched whose status identifier is idle, output the identifier of the opponent user who was successfully matched.

[0091] Although highly similar users have been selected, their status may have been modified by other threads after being retrieved, so secondary status verification is required.

[0092] In this embodiment, the system can employ database transaction isolation levels (such as repeatable read) or distributed locks (such as Redis locks) to ensure the atomicity of state checks: the matching commit operation is only performed if the candidate user's state identifier is still "idle" at the moment of verification. Upon successful matching, the system immediately updates both parties' states to "matching" and returns the opponent user's unique identifier (such as a UUID). This design prevents conflicts from the same user being matched multiple times, for example, by ensuring mutual exclusion of state changes through a Compare-and-Swap (CAS) algorithm. After outputting the identifier, the system triggers a callback function in the event-driven architecture to initiate the subsequent competition process.

[0093] Step S305: If the opponent user identifier that is matched is not output within the predetermined time period, the preset initial matching threshold is gradually reduced and the multi-dimensional similarity matching process is repeated until the matching result is output or the minimum matching threshold is reached.

[0094] In some embodiments, the predetermined duration is configured to be 15 seconds, and the gradient value of the initial matching threshold is gradually reduced by 0.05 each time, with the lowest matching threshold being 0.75.

[0095] Specifically, the preset timeout (e.g., 15 seconds) is set based on research data on user patience thresholds; failure to match within the timeout period indicates that the initial parameters are too stringent. The system uses a gradient descent algorithm to gradually reduce the matching threshold (e.g., by 0.05 each time). This discretized adjustment method avoids matching quality fluctuations caused by sudden parameter changes. During each iteration of rematching, the system records the correlation data between threshold changes and matching success rates, forming an exploration-exploitation balance in reinforcement learning. The minimum matching threshold (e.g., 0.75) serves as a lower limit to prevent excessive degradation in matching quality. For example, during the early morning hours when there are few users, the system reduces the threshold from 0.85 to 0.78 through multiple iterations, eventually achieving a successful match, thus ensuring basic fairness while avoiding indefinite waiting.

[0096] The above implementation achieves intelligent and optimized opponent matching in the typing competition system. The matching process is upgraded from simple keyword retrieval to multi-criteria decision-making based on real-time capability vectors. This not only ensures fairness and targeted matching through cosine similarity and feature overlap, but also improves system response speed and robustness through state machine management and threshold adaptive mechanisms. It automatically balances quality and efficiency based on real-time load and user distribution, providing users with a continuously optimized competitive experience, while also providing key technical support for the stable operation of large-scale online typing training platforms.

[0097] Reference Figure 4 As one implementation of step S104, the steps of determining the basic text difficulty level based on the real-time ability vectors of the initiating user and the opponent user according to a preset difficulty mapping table, and extracting the intersection of the weak character sets of the initiating user and the opponent user as the common weak character set include:

[0098] Step S401: Analyze the real-time capability vectors of the initiating user and the opponent user, and extract the typing speed value and accuracy value contained in the real-time capability vectors respectively.

[0099] The real-time capability vector serves as a digital representation of a user's typing ability, storing multi-dimensional indicators using key-value pairs or array structures. The parsing process uses pointer operations or data deserialization techniques to precisely locate the storage positions of typing speed and accuracy values ​​within the vector. Typing speed is typically measured in characters per minute (CPM), reflecting the user's output efficiency per unit of time; accuracy is expressed as a percentage to represent input quality.

[0100] In this embodiment, speed and accuracy are two orthogonal dimensions of typing ability and need to be evaluated independently to avoid mutual interference. For example, when the system analyzes user A's speed value as 300 CPM and accuracy as 95%, and user B's speed value as 280 CPM and accuracy as 98%, these raw data will provide a benchmark for subsequent difficulty calculations.

[0101] Step S402: Call the preset difficulty mapping table, input the median typing speed value and the minimum accuracy value of the initiating user and the opponent user into the mapping relationship, and output the basic difficulty level of the text.

[0102] The preset difficulty mapping table is essentially a classifier trained on large-scale data. Its design principle is based on the "zone of proximal development" theory in educational psychology, which states that the optimal training difficulty should be slightly higher than the user's current level. Using the median of speed values ​​instead of the average can effectively eliminate noise interference caused by temporary fluctuations; selecting the minimum accuracy value reflects the conservative principle, ensuring that the text difficulty is appropriate for the weaker user's level.

[0103] Specifically, the preset difficulty mapping table typically employs a two-dimensional matrix structure. Row indices correspond to speed levels (e.g., low speed <200 CPM, medium speed 200-400 CPM, high speed >400 CPM), column indices correspond to accuracy levels (e.g., low accuracy <90%, medium accuracy 90%-95%, high accuracy >95%), and matrix elements store preset difficulty levels (1-10). This mapping mechanism enables the system to convert continuous ability values ​​into discrete difficulty labels, providing clear guidance for content generation.

[0104] Step S403: Extract the first weak character set from the real-time capability vector of the initiating user, and extract the second weak character set from the real-time capability vector of the adversary user;

[0105] The weak character set is not simply a list of characters with high error rates, but a feature set dynamically maintained through machine learning algorithms.

[0106] In this embodiment, the extraction logic is based on error pattern clustering analysis: the system records the context (such as preceding characters, keystroke force), error type (such as adjacent keys, character confusion), and frequency of occurrence for each erroneous character. When the error rate of a specific character exceeds a threshold (such as 20%) or its error frequency ranks high, it is included in the weak character set. For example, user A may have a significantly higher error rate when inputting edge keys such as "p" and "q" due to insufficient strength in their little finger; these characters will be automatically marked as personal weaknesses by the system.

[0107] Step S404: Calculate the intersection of the first weak character set and the second weak character set to generate a common weak character set;

[0108] The common weak character set is generated by calculating the intersection of two users' weak character sets, reflecting a teaching strategy of "prioritizing training on common weaknesses." Algorithmically, a hash table fast lookup technique is used, storing all elements of the larger character set in hash buckets, and then traversing the smaller character set for existence checks. When common weak characters are found (e.g., both users have difficulty with numeric input), the system prioritizes including these characters in the training content. This design, focusing on common weaknesses, ensures that PvP training not only improves individual skills but also generates a synergistic effect; competition between users on the same difficulty level further motivates training.

[0109] In addition, when the common weak character set is empty, the system default weak character set can be used as a substitute, such as the high-frequency error-prone character library, as a degradation scheme to ensure the universal applicability of the training content.

[0110] Step S405: Verify the constraint condition of the proportion of common weak character set in the final competition-specific text. The constraint condition requires that the proportion of common weak characters is not less than a preset proportion threshold.

[0111] Specifically, the percentage constraint (e.g., no less than 30%) is based on empirical educational research: when the proportion of the target training elements in the teaching materials reaches a certain percentage, the learning effect will significantly improve. The verification algorithm uses a combination of character statistics and percentage calculation: first, it estimates the total number of characters in the generated text, then calculates the minimum share that common weak characters may occupy. If this value is lower than a preset threshold, a content adjustment mechanism is triggered. For example, when the system detects that common weak characters can only cover 20% of the text, it will automatically increase the distribution density of these characters or select text materials containing more target characters.

[0112] In the above implementation, intelligent adaptation and accurate generation of typing training texts are achieved, upgrading the traditional fixed text library into a dynamic generation system based on two-sided capability features. It not only ensures a scientific match between text complexity and user level through a difficulty mapping table, but also achieves personalized focus of training content by using weak character set operations, so that each PK training can simultaneously meet the two key requirements of appropriate difficulty and targeted content.

[0113] Reference Figure 5 As one implementation of step S105, the steps of generating original text material based on the basic text difficulty level and replacing characters in non-critical semantic positions in the original text material with characters from a common weak character set to generate competition-specific text include:

[0114] Step S501: Based on the basic difficulty level of the text and the preset topic tags, retrieve matching candidate original text materials from the corpus database;

[0115] Specifically, the system employs multi-dimensional indexing technology to transform the basic difficulty level of text into database query conditions. The difficulty level is quantified and mapped using linguistic features such as vocabulary complexity, sentence length distribution, and grammatical structure. Preset topic tags are constructed based on user profile data or explicit selection, forming semantic constraints for topic filters. The corpus database uses an inverted index structure, enabling the system to quickly retrieve text sets that simultaneously meet the requirements of difficulty level and topic relevance. For example, when the system identifies that both users prefer science and technology content and the difficulty level is 5, it will automatically filter out medium-difficulty science and technology articles containing appropriate technical terminology but with clear sentence structure.

[0116] Step S502: Perform semantic weight analysis on the candidate original text materials to identify character sequences at semantic core positions and character sequences at replaceable non-key semantic positions;

[0117] Among them, the system adopts a dependency syntactic analysis algorithm to construct the syntactic tree structure of the text, identify character sequences that play core semantic roles such as subject, predicate, and object, and these sequences constitute the skeletal information of the text. Any modification may damage the original semantics. At the same time, through词性标注与TF-IDF算法 (lexical tagging and TF-IDF algorithm) to identify modifying components (such as adjectives and adverbs) and redundant expressions (such as synonymous repetitions), and mark them as replaceable areas. For example, in the sentence "This very complex technical problem needs to be thoroughly solved", "technical problem needs to be solved" is identified as the core semantic sequence, while "very complex" and "thoroughly" are marked as non-critical positions. This hierarchical analysis mechanism ensures that subsequent character replacement operations will not distort the core meaning of the text and maintain the comprehensibility of the language material.

[0118] Step S503, in the character sequences at non-critical semantic positions, perform a directional character replacement operation according to the character distribution characteristics of the common weak character set to generate a primary adapted text;

[0119] Specifically, the system first conducts frequency statistics and weight assignment on the common weak character set, and high-frequency weak characters obtain a higher replacement priority. The replacement algorithm can adopt a context-aware mechanism to ensure that the new characters are compatible with the original text in terms of grammar and semantics: for example, replace "fast" in "run fast" with the weak character "迅" to generate "run swiftly" instead of the awkward "迅奔跑". For multi-character weak sets, the system adopts a round-robin scheduling algorithm to ensure the uniformity of character distribution and prevent over-concentration of specific characters. The essence of this directional replacement is to maximize the exposure frequency of weak characters while maintaining the naturalness of the text, making the training material both linguistically authentic and targeted.

[0120] Step S504, according to the real-time typing speed benchmark values of the initiating user and the opponent user and the set competitive duration, calculate the target text length and perform length calibration on the primary adapted text;

[0121] Among them, the calculation of the target text length comprehensively considers the real-time typing speed benchmark values of both users (take the lower value or median to avoid ability imbalance), the preset competitive duration, and the experience coefficient k. The length calibrator then adopts text compression and expansion techniques: when the original text is too long, it is streamlined by deleting redundant modifiers and merging synonymous expressions; when the text is too short, supplementary content with coherent semantics is extracted from the homologous corpus.

[0122] In addition, special attention should be paid to the integrity of the paragraph structure during the calibration process to avoid truncating in the middle of a sentence. For example, for a 3-minute PK between users with a typing speed of 300 CPM each, the system will generate a text of about 800 characters (300 characters / minute × 3 minutes × 0.9 buffer coefficient), and adjust the original text to this length range through intelligent deletion and addition.

[0123] Step S505: Perform a complexity adjustment operation on the length-calibrated text to make the sentence structure meet the basic difficulty level requirements of the text, and output the competition-specific text.

[0124] In this embodiment, the system establishes a mapping rule between sentence complexity and difficulty level: low-level texts prioritize simple subject-verb-object sentences, with an average sentence length controlled within 15 characters; high-level texts appropriately increase nested clauses, passive voice, and rhetorical devices. The complexity adjuster employs a syntax analysis-reconstruction pipeline to split long and complex sentences (e.g., converting conditional clauses into independent sentences) or merge simple sentences (e.g., connecting multiple short sentences with conjunctions). Throughout the adjustment process, the system maintains consistency in tense and voice of the original text to avoid grammatical errors. This hierarchical adjustment ensures that the final generated text accurately matches the user's processing ability, creating an appropriate cognitive challenge.

[0125] The above implementation achieves intelligent adaptation and dynamic optimization of competitive text, transforming the traditional static text supply into a dynamic generation mode based on user ability models. This not only ensures the relevance of training content through semantic weight analysis and targeted replacement, but also achieves precise matching of text difficulty to user skill level through length calibration and complexity adjustment. This generation mechanism ensures that each PK training session obtains unique and highly personalized training materials, avoiding training fatigue caused by a fixed text library and maximizing the efficiency of each training session through scientific content design. Ultimately, it constructs an adaptive text generation system capable of autonomously evolving training content.

[0126] Reference Figure 6 As one implementation of step S106, the step of monitoring the input streams of both sides and exchanging cursor positions and error marker data in real time, and dynamically adjusting the text difficulty level of the initiating user or the opponent user based on continuous error rate or accuracy changes, includes:

[0127] Step S601: Real-time acquisition of input stream data from both sides' clients, including cursor position sequence, error mark sequence, and character input timestamp sequence; wherein, the two sides include the initiating user and the opponent user;

[0128] Specifically, input stream data acquisition is essentially a holographic record of a user's typing behavior. The cursor position sequence tracks the user's navigation path within the text in coordinate form; the error marker sequence generates a binary identifier stream by comparing the actual input with the expected characters; and the character input timestamp sequence records the temporal characteristics of each keystroke event with millisecond precision. These three types of data collectively constitute the raw material for behavioral analysis, thus transforming abstract typing performance into a quantifiable spatiotemporal data combination.

[0129] In some embodiments, the data acquisition process employs an event listening mechanism to capture keyboard events and user interface interaction events at the operating system level, ensuring data integrity and real-time performance. For example, if a user mistakenly types "technoligy" instead of "technology," the system records the cursor's movement trajectory between each character, the error mark of the 8th character "i," and the precise input time of each letter. This comprehensive data acquisition provides rich contextual information for subsequent analysis.

[0130] Step S602: Monitor the input stream data and periodically exchange the cursor position sequence and error mark sequence with the clients of both sides in real time through the server;

[0131] In this embodiment, a persistent connection is established between the clients and server of both sides using a low-latency communication protocol (such as WebSocket), avoiding the handshake overhead of each HTTP request. The periodic exchange mechanism can discretize the continuous data stream into state snapshots within a time window using a time-slice round-robin algorithm, controlling network bandwidth usage while ensuring data timeliness.

[0132] The innovation of this step lies in creating a mirrored battle environment. Even though the two sides are physically different, through millisecond-level data synchronization, the game progress, error messages, and opponent status displayed on each side's interface remain highly consistent, thus ensuring the fairness of the competition. For example, synchronizing the cursor position every 2 seconds allows both sides to see in real time which word the opponent is typing, creating a truly interactive competitive experience.

[0133] Step S603: Based on the real-time synchronously exchanged cursor position sequence and error mark sequence, calculate the continuous error rate of both sides within the preset time window, and monitor the accuracy change value at the same time.

[0134] The accuracy change value is the difference between the current accuracy and the initial competitive baseline accuracy.

[0135] Specifically, the consecutive error rate is calculated using the sliding window statistical principle, detecting the frequency of consecutive errors within a preset time window (e.g., 10 seconds). The accuracy change value is calculated by the difference between the current accuracy and the initial competitive baseline accuracy, establishing a dynamic reference system that can eliminate differences in the user's basic skill level and focus on capturing state fluctuations during the competition.

[0136] In this embodiment, the monitoring algorithm employs an incremental calculation method. Each time new data arrives, only the affected calculation items are updated, rather than a full recalculation. This optimization ensures the system maintains real-time responsiveness even in resource-constrained environments. For example, the system continuously tracks the user's error patterns over the past 10 seconds. When three consecutive keystroke errors are detected, an anomaly is immediately marked, and the current accuracy is compared to the level at the start of the match to form a comprehensive evaluation.

[0137] Step S604: When it is detected that the continuous error rate of either user in the battle exceeds the preset downgrade threshold, or the accuracy change value meets the preset upgrade conditions, a text difficulty adjustment instruction is generated for the user.

[0138] In this embodiment, the decision engine employs a multi-factor weighted evaluation. For example, when the continuous error rate exceeds a threshold (e.g., 3 times / 10 seconds), it indicates that the user may be experiencing cognitive impairment and requires immediate intervention. Conversely, when the accuracy change value consistently exceeds the baseline and the duration exceeds a preset stability threshold, the current challenge is deemed insufficient, and the difficulty should be increased. The instruction generation module can adopt an event-driven architecture, immediately generating user-specific adjustment instructions once the conditions are met, ensuring a targeted response.

[0139] Step S605: Based on the text difficulty adjustment instruction, dynamically modify the text difficulty level of the corresponding user, and transmit the updated text content or difficulty level instruction to the corresponding client.

[0140] The dynamic modification employs a differential update strategy, adjusting only the text that needs changing rather than replacing it globally, minimizing distraction for the user. The difficulty level modifier has a built-in library of adjustment strategies, such as character simplification and enhanced hints for downgrading, and sentence complexity and distractor insertion for upgrading.

[0141] In this embodiment of the application, when a downgrade instruction is generated, complex characters in the text are replaced with simplified characters or visual cues are added; when an upgrade instruction is generated, simple sentences in the text are merged into compound sentences or high-frequency error characters are inserted.

[0142] It should be noted that the above adjustment process is transparent to the user. For example, a user may suddenly find that unfamiliar words have been replaced with simpler synonyms during input, but the overall text structure and progress remain unchanged. This design reflects the core concept of adaptive teaching, which is to continuously optimize the suitability of learning materials without the learner's awareness.

[0143] The above implementation achieves intelligent adaptive adjustment of difficulty during typing competitions, transforming static text presentation into a demand-responsive mode based on real-time performance. Through low-latency data synchronization and a dual-threshold decision-making mechanism, the system can sensitively perceive fluctuations in the user's state and provide just the right difficulty intervention at the most appropriate time. This dynamic adjustment not only ensures the fairness and challenge of the competition but also maximizes the effect of a single training session by accurately matching the user's "zone of proximal development," ultimately constructing an intelligent training environment that can evolve together with the user.

[0144] Reference Figure 7 As a further implementation of the typing competition method, in step S106, while dynamically adjusting the text difficulty level of the initiating user or the opponent user based on continuous error rate or accuracy rate changes, the method also includes:

[0145] Step S701: Analyze the semantic structure of the competition-specific text and obtain the semantic weight value and contextual relevance of each character;

[0146] Specifically, the semantic weight values ​​are calculated based on the grammatical function and information carrying capacity of words in a sentence. Dependency parsing algorithms can be used to identify the syntactic role of each character (such as core components like subject, predicate, and object) and assign weight values ​​according to their semantic contribution. For example, content words (such as nouns and verbs) have a weight value close to 1.0 because they carry key semantic information; modifying components (such as adjectives and adverbs) have a weight value of approximately 0.6.

[0147] Functional words (such as prepositions and auxiliary words) have a weight of only about 0.2. Contextual relevance can be calculated using word vector models (such as Word2Vec) to determine the semantic similarity between the target character and adjacent characters in the context. Specifically, a sliding window mechanism can be used to capture the co-occurrence probability of N characters before and after the target character, and the strength of the association can be quantified by the mean cosine similarity.

[0148] The above steps essentially construct a cognitive load distribution map of the text, providing a structured data foundation for subsequent error analysis. High-weight regions correspond to key information nodes that require concentrated cognitive resource processing.

[0149] Step S702: Calculate the semantic association strength coefficient of the user's erroneous character based on the semantic weight value and contextual relevance of each character;

[0150] The semantic association strength coefficient is obtained by dividing the sum of the absolute values ​​of the semantic weight differences between the erroneous character and its adjacent erroneous characters by the total number of paragraphs in the text.

[0151] Specifically, the semantic association strength coefficient can employ a difference accumulation algorithm. First, all erroneous characters in the text are located, and adjacent erroneous pairs within a specific character range (e.g., 5 characters) are selected. Then, the absolute value of the semantic weight difference for each pair of erroneous characters is calculated, and these differences are summed and divided by the total number of paragraphs in the text. For example, when errors are concentrated on high-weight words in the same paragraph, the sum of weight differences is large, but the number of paragraphs is small, leading to a significantly higher probability coefficient, reflecting the clustering of errors in the semantic core area. Conversely, if errors are scattered across low-weight words in different paragraphs, the coefficient value is lower. The essence of this semantic association strength coefficient is to quantify the degree of semantic consistency in error occurrence. A high coefficient value indicates that users make continuous mistakes due to semantic comprehension difficulties, while a low coefficient value suggests random errors at the operational level.

[0152] Step S703: When the semantic association strength coefficient is greater than the preset association threshold, a cognitive stress reduction instruction containing a stress reduction level value is generated.

[0153] Among them, the stress reduction level value is positively correlated with the semantic association strength coefficient;

[0154] Specifically, when the semantic association strength coefficient exceeds a preset association threshold (e.g., 0.08), the system triggers a cognitive overload judgment algorithm. The stress reduction level value is generated using a linear mapping model: the level value L is proportional to the portion of the coefficient that exceeds the threshold, for example, L = K × (semantic association strength coefficient - preset association threshold), where K is a calibration constant.

[0155] Understandably, this positive correlation ensures that the intensity of intervention is precisely matched with the severity of cognitive load. For example, when the coefficient is 0.12, L=0.4 indicates that a moderate-intensity intervention is needed, while when the coefficient is 0.15, L=0.7 indicates that a strong intervention is needed.

[0156] Step S704, in response to the cognitive stress reduction instruction, insert a visual interval identifier into the competition-specific text;

[0157] The insertion position is a non-critical position whose corresponding semantic weight value is lower than a preset threshold.

[0158] Specifically, the system first filters non-critical positions based on semantic weight thresholds (e.g., 0.3). These positions typically correspond to modifiers, parenthetical phrases, and other areas that do not affect the core semantics. The selection of visual spacing identifiers follows a gradient principle: when the low-pressure level value L < 0.3, Unicode fine spaces (U+2006) are inserted for fine-tuning; when 0.3 ≤ L < 0.6, segmentation hyphens (e.g., "---") are added for explicit grouping; when L ≥ 0.6, paragraph indentation combined with blank lines is used for strong segmentation.

[0159] Furthermore, the insertion operation employs a syntax tree traversal algorithm to ensure intervention at grammatical boundaries such as after adverbial clauses and before coordinating conjunctions, while maintaining the integrity of the sentence structure. This precise positioning avoids the fragmentation of core semantic units (such as subject-predicate structures) and effectively reduces working memory load by increasing the visual distance between information chunks.

[0160] Step S705: Monitor the new error distribution of the user after inserting the visual interval identifier. When the dispersion index of the new error character exceeds the preset dispersion threshold, remove the corresponding visual interval identifier.

[0161] Among them, the monitoring of new error distribution adopts a time window sliding mechanism to track the location of errors after the identifier is inserted in real time.

[0162] In this embodiment of the application, the dispersion index can be expressed by the information entropy formula. Calculate, where p(x) i The entropy value represents the probability distribution of errors in the i-th text region. A high entropy value (e.g., >2.0) reflects a uniform distribution of errors, indicating that cognitive load has been balanced through intervention; a low entropy value (e.g., <1.0) suggests that errors are still clustered in specific regions. When the entropy value exceeds a preset discrete threshold (e.g., 1.8), the system determines that the visual interval has completed its moderating effect and then triggers the identifier removal procedure. This closed-loop control mechanism ensures the timeliness of intervention measures and avoids unnecessary attentional distraction caused by excessive visualization.

[0163] Step S706: The location information of the removed visual interval identifier and the corresponding stress reduction level value are recorded in the cognitive policy library of the user's historical dataset.

[0164] Specifically, the system encodes the location information of the removed visual interval identifiers into relative offsets, and stores them together with the corresponding stress reduction level values ​​in the cognitive policy library of the user's historical dataset. The storage structure can adopt a multi-level index design, using text hash values ​​as keys to associate stress reduction levels and location sequences.

[0165] Understandably, when the system generates competitive texts with similar semantic structures, it can prioritize historically validated strategies through fuzzy matching algorithms. This mechanism essentially builds a personalized cognitive adaptation model, continuously accumulating user load response data in different semantic scenarios to optimize the accuracy of intervention.

[0166] The above implementation achieves intelligent allocation of cognitive resources during typing training, elevating traditional error statistics to semantic-level cognitive diagnosis. It not only accurately identifies overload phenomena through semantic association strength coefficients but also achieves non-invasive intervention using gradient visual intervals, finally forming a closed-loop optimization through information entropy monitoring. This mechanism enables the system to perceive the user's deep cognitive state, effectively reducing semantic processing pressure while ensuring training continuity. It is particularly suitable for high-risk scenarios such as long texts and complex sentence structures, improving the user's concentration and input accuracy during intensive typing training.

[0167] Reference Figure 8 As one implementation of step S107, the steps of calculating a comprehensive score based on the competition log and generating a longitudinal comparison report, merging the error character type distribution data from this competition into the user's historical dataset, and updating the user's weak character set definition include:

[0168] Step S801: Extract the final speed value, final accuracy value, average difficulty coefficient of the competition text, and competition duration of the initiating user and the opponent user based on the competition log;

[0169] Specifically, the competition log stores all key events from the start to the end of the PK in a time-series format, including the input status of each character, difficulty adjustment records, and real-time speed fluctuation curves. The extraction engine uses specific field positioning technology to accurately capture the final speed value (the stable speed in a specific time window before the end of the PK), the final accuracy value (the percentage of globally correct characters), the average difficulty coefficient of the competition text (calculated based on the difficulty level adjusted dynamically each time), and the competition duration (the time difference from text distribution to completion of input) from massive log data.

[0170] It should be noted that this multi-parameter acquisition mechanism ensures the comprehensiveness of the evaluation. For example, the system will exclude abnormal fluctuations in the last few seconds and take the final stable speed as a representative indicator to avoid the influence of accidental factors on the evaluation results.

[0171] Step S802: Based on the preset scoring weight relationship, input the final speed value, final accuracy value, average difficulty coefficient and competition time into the comprehensive scoring calculation model, and output the comprehensive competition score of the two users in the competition.

[0172] Specifically, the preset scoring weight relationship is a configurable assessment strategy, the design of which can refer to the multi-dimensional comprehensive evaluation theory in educational measurement. The comprehensive scoring calculation model can adopt a non-linear fusion algorithm, in which the final speed value and accuracy value constitute the basic performance score, the average difficulty coefficient serves as a gain factor (high-difficulty texts receive a coefficient bonus), and the competition time is adjusted in the time dimension through a time coefficient (encouraging stable performance rather than simply pursuing speed).

[0173] During the model calculation process, each indicator is first normalized to eliminate differences in dimensions, and then linearly or geometrically weighted according to the weights. The essence of this scoring mechanism is to construct a fair benchmark for measuring value, making the results of competitions with different difficulties and durations comparable.

[0174] In some embodiments, the overall competitive score is calculated as follows: (final speed value × final accuracy value) × average difficulty coefficient × duration coefficient, where the duration coefficient increases linearly with the duration of the competition.

[0175] Step S803: Retrieve the user's historical competition records from the user's historical database, compare the current comprehensive competition score with the highest historical score and the average historical score over time, and generate ability change trend data;

[0176] The system retrieves time-sorted competition records from the historical database using the user's unique identifier, and extracts the highest historical rating (representing peak ability) and the average historical rating (reflecting stable level).

[0177] In this embodiment, the time-series comparison algorithm may employ differential calculation and trend fitting techniques. For example, it may determine whether a personal record has been broken by calculating the percentage difference between the current score and the historical high, or by analyzing the slope of recent score changes through linear regression. The generation of ability change trend data includes not only simple numerical comparisons but may also include statistical significance tests to ensure the reliability of trend judgments. This longitudinal analysis enables the system to distinguish between accidental performance and genuine progress, providing users with a time-deep ability diagnosis.

[0178] Step S804: parse the error marker sequence in the competition log, classify and statistically analyze it according to the mapping relationship between error characters and target characters, and generate error character type distribution data for this competition;

[0179] In this embodiment of the application, the parsing process adopts a multi-layer classifier architecture. First, an error type classification system is established based on the mapping relationship between the error character and the target character, such as key adjacency error (the distance between the error character and the target character in the keyboard layout is ≤1 unit), pinyin similarity error (the first letter or full pinyin of the error character and the target character are the same), and character shape confusion error (the difference in Unicode encoding between the error character and the target character is within a preset threshold).

[0180] Furthermore, the statistics module employs a sliding window counting algorithm to calculate the frequency, relative frequency, and distribution characteristics of each error type, while also recording the context in which errors occur (e.g., errors concentrated in specific paragraphs of the text). The output of the error character type distribution data is not a simple frequency table, but rather structured data with weights and correlations. For example, the system labels error types that are more likely to occur under high-speed input conditions, providing direction for subsequent targeted training.

[0181] Step S805: Perform feature fusion between the error character type distribution data and the error distribution records in the user's historical dataset, and recalculate the weak character weight value based on the preset update rule;

[0182] Among them, the feature fusion algorithm can use time series analysis technology to perform correlation analysis and difference detection between the error distribution data of this competition and the long-term patterns in historical datasets.

[0183] In this embodiment, the weight update rule is typically based on Bayesian inference or an exponential smoothing model. For example, new weight value = λ × historical weight value + (1-λ) × current error frequency, where λ is a decay coefficient that controls the strength of historical data retention. This mechanism ensures that the weights of weak characters do not fluctuate excessively due to a single performance, while also reflecting the user's latest capability changes in a timely manner.

[0184] In addition, the system can also use anomaly detection algorithms to identify characters whose input capabilities suddenly deteriorate and adjust the training focus in a timely manner.

[0185] Step S806: Based on the recalculated weak character weight values, adjust the definition of the weak character set in the user capability vector and update it to the user capability database.

[0186] Specifically, based on the recalculated weak character weight values, the character set definition in the user capability vector is modified by adding, deleting, and updating characters: when the weight of a character exceeds a threshold, it is automatically added to the weak character set; when the weight remains below the threshold, it is removed. Update operations employ a database transaction mechanism to ensure data consistency and integrity, while also recording version information for easy tracking of change history.

[0187] The above implementation transforms isolated, single-event competitions into a crucial component of a continuous learning cycle. It not only helps users fully understand their progress through multi-dimensional comprehensive scoring and longitudinal trend analysis, but also enables the system to dynamically adapt to changes in user capabilities through refined error analysis and novel feature fusion algorithms. This post-competition processing mechanism recalibrates the training plan based on the latest performance after each competition, ensuring that the next challenge more accurately matches the user's current true level. Ultimately, this constructs a typing training ecosystem that grows alongside the user and becomes increasingly intelligent with use.

[0188] This application also discloses a typing competition system based on real-time capability modeling and dynamic text generation.

[0189] A typing competition system based on real-time capability modeling and dynamic text generation specifically includes:

[0190] The real-time keystroke stream acquisition module is used to collect the user's real-time keystroke stream data, including key value sequence, timestamp sequence, and correctness identifier sequence;

[0191] The capability vector modeling module is used to calculate core capability indicators and auxiliary capability indicators based on real-time keystroke stream data, and to perform weighted fusion according to preset weights to generate a real-time capability vector for the user.

[0192] The opponent matching module is used to calculate the comprehensive similarity between the real-time capability vector of the initiating user and the real-time capability vectors of each user in the online user pool. When the comprehensive similarity value exceeds the dynamic matching threshold, the matching opponent user identifier is output.

[0193] The public weak character set generation module is used to determine the basic difficulty level of the text based on the real-time capability vectors of the initiating user and the opponent user, based on a preset difficulty mapping table, and to extract the intersection of the weak character sets of the initiating user and the opponent user as the public weak character set.

[0194] The competitive text generation module is used to generate original text materials based on the basic difficulty level of the text, and replace characters in non-critical semantic positions in the original text materials with characters from a common weak character set to generate competitive text.

[0195] The real-time interaction module is used to synchronously transmit the competition-specific text to the client of the initiating user and the client of the opposing user, monitor the input stream of both sides and exchange cursor position and error mark data in real time;

[0196] The text difficulty dynamic adjustment module is used to dynamically adjust the text difficulty level of the initiating user or the opponent user based on continuous changes in error rate or accuracy.

[0197] The data fusion and update module is used to calculate the comprehensive score based on the competition log and generate a longitudinal comparison report. It merges the error character type distribution data in this competition into the user's historical dataset and updates the user's weak character set definition.

[0198] The typing competition system based on real-time capability modeling and dynamic text generation in this application embodiment can implement any of the above methods, and the specific working process of each module in the system can refer to the corresponding process in the above method embodiments.

[0199] In the several embodiments provided in this application, it should be understood that the provided methods and systems can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for example, the division of a certain module is merely a logical functional division, and in actual implementation there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.

[0200] This application also discloses a computer-readable storage medium.

[0201] A computer-readable storage medium storing a computer program that can be loaded by a processor and executed as any of the typing competition methods based on real-time capability modeling and dynamic text generation described above.

[0202] The computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device; the program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0203] The above are all preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any feature disclosed in this specification (including the abstract and drawings) may be replaced by other equivalent or similar features unless specifically stated otherwise. That is, unless specifically stated otherwise, each feature is only one example of a series of equivalent or similar features.

Claims

1. A typing competition method based on real-time capability modeling and dynamic text generation, characterized in that, The method includes: Collect real-time keystroke stream data from users, including key value sequences, timestamp sequences, and correctness indicator sequences; The core capability indicators and auxiliary capability indicators are calculated based on the real-time keystroke stream data, and then weighted and fused according to preset weights to generate a real-time capability vector for the user. The real-time capability vector of the initiating user is compared with the real-time capability vectors of each user in the online user pool to calculate a comprehensive similarity. When the comprehensive similarity value exceeds the dynamic matching threshold, the identifier of the matched opponent user is output. Based on a preset difficulty mapping table, the basic difficulty level of the text is determined according to the real-time capability vectors of the initiating user and the opponent user, and the intersection of the weak character sets of the initiating user and the opponent user is extracted as the common weak character set. Based on the aforementioned basic text difficulty level, original text material is generated, and characters in non-critical semantic positions in the original text material are replaced with characters from the common weak character set to generate competition-specific text; The competition-specific text is synchronously transmitted to the client of the initiating user and the client of the opposing user. The input streams of both sides are monitored and the cursor position and error mark data are exchanged in real time. The text difficulty level of the initiating user or the opposing user is dynamically adjusted based on the continuous error rate or accuracy rate changes. The comprehensive score is calculated based on the competition logs and a longitudinal comparison report is generated. The error character type distribution data in this competition is merged into the user's historical dataset, and the user's weak character set definition is updated.

2. The real-time capability modeling and dynamic text generation based typing competition method according to claim 1, wherein, The steps for calculating core capability indicators and auxiliary capability indicators based on the real-time keystroke stream data, and then weighting and fusing them according to preset weights to generate a user's real-time capability vector include: Analyze the key value sequence, timestamp sequence, and correctness identifier sequence in the real-time keystroke stream data to extract the valid character input range; Based on the number of characters and time interval of the effective character input range, calculate a set of core capability indicators that include at least real-time typing speed and real-time accuracy. Analyze the relationship categories between erroneous characters and their corresponding target characters in the correctness identifier sequence, and generate an error type distribution vector; Calculate the cumulative value of continuous input duration and convert it into a fatigue coefficient; The preset weight configuration parameters are invoked to perform a weighted calculation on the set of core capability indicators, the error type distribution vector, and the fatigue coefficient; The weighted result is output as the user's real-time capability vector.

3. The real-time capability modeling and dynamic text generation based typing competition method according to claim 2, wherein, The steps for calculating the comprehensive similarity between the initiating user's real-time capability vector and the real-time capability vectors of each user in the online user pool, and outputting the matched adversary user identifier when the comprehensive similarity value exceeds the dynamic matching threshold, include: Retrieve the real-time capability vector and current status identifier of each user to be matched in the online user pool, wherein the status identifier includes an idle state or a matching state; The real-time capability vector of the initiating user is matched with the real-time capability vector of each user to be matched in a multi-dimensional similarity analysis to generate a corresponding comprehensive similarity value. Filter out the set of users to be matched whose overall similarity value exceeds the preset initial matching threshold; When there is a candidate user in the set of users to be matched whose status identifier is idle, output the identifier of the opponent user who was successfully matched. If no matching opponent user identifier is output within the predetermined time period, the preset initial matching threshold is gradually reduced and the multi-dimensional similarity matching process is repeated until a matching result is output or the minimum matching threshold is reached.

4. The typing competition method based on real-time capability modeling and dynamic text generation according to claim 1, characterized in that, Based on a preset difficulty mapping table, the steps of determining the basic text difficulty level according to the real-time ability vectors of the initiating user and the opponent user, and extracting the intersection of the weak character sets of the initiating user and the opponent user as the common weak character set include: Analyze the real-time capability vectors of the initiating user and the opponent user, and extract the typing speed value and accuracy value contained in the real-time capability vectors respectively; Call the preset difficulty mapping table, input the median typing speed value and the minimum accuracy value of the initiating user and the opponent user into the mapping relationship, and output the basic difficulty level of the text; Extract the first weak character set from the real-time capability vector of the initiating user, and extract the second weak character set from the real-time capability vector of the opponent user; Calculate the intersection of the first weak character set and the second weak character set to generate a common weak character set; Verify the constraint condition of the proportion of the common weak character set in the final competition-specific text, the constraint condition requiring that the proportion of the common weak characters is not less than a preset proportion threshold.

5. The typing competition method based on real-time capability modeling and dynamic text generation according to claim 4, characterized in that, The steps of generating original text material based on the aforementioned basic text difficulty level, and replacing characters in non-critical semantic positions in the original text material with characters from the aforementioned common weak character set, to generate competition-specific text include: Based on the basic difficulty level of the text and the preset topic tags, retrieve matching candidate original text materials from the corpus database; Semantic weight analysis is performed on the candidate original text materials to identify character sequences at semantic core positions and character sequences at replaceable non-key semantic positions; In the non-critical semantic position character sequence, based on the character distribution characteristics of the common weak character set, a targeted character replacement operation is performed to generate primary adapted text; Based on the real-time typing speed benchmarks of the initiating user and the opponent user, as well as the competition duration settings, the target text length is calculated and the length of the primary adaptation text is calibrated. Perform a complexity adjustment operation on the length-calibrated text to make the sentence structure meet the basic difficulty level requirements of the text, and output the competition-specific text.

6. The typing competition method based on real-time capability modeling and dynamic text generation according to claim 1, characterized in that, The steps involved in monitoring the input streams of both sides and exchanging cursor positions and error marker data in real time, and dynamically adjusting the text difficulty level of the initiating or opposing user based on continuous changes in error rate or accuracy, include: The system collects input stream data from both sides' clients in real time, including cursor position sequences, error marker sequences, and character input timestamp sequences; the two sides include the initiating user and the opposing user. The input stream data is monitored, and the server periodically and synchronously exchanges the cursor position sequence and error mark sequence with the clients of both sides in real time. Based on the real-time synchronously exchanged cursor position sequence and error mark sequence, the continuous error rate of both sides in the battle within a preset time window is calculated, while the accuracy change value is monitored. When the consecutive error rate of either user in the battle exceeds the preset downgrade threshold, or when the accuracy change value meets the preset upgrade conditions, a text difficulty adjustment instruction is generated for the user. Based on the text difficulty adjustment instruction, the text difficulty level of the corresponding user is dynamically modified, and the updated text content or difficulty level instruction is transmitted to the corresponding client.

7. The typing competition method based on real-time capability modeling and dynamic text generation according to claim 6, characterized in that, In addition to dynamically adjusting the text difficulty level of the initiating user or the opposing user based on continuous error rate or accuracy changes, the method also includes: The semantic structure of the competition-specific text is analyzed to obtain the semantic weight value and contextual relevance of each character; Calculate the semantic association strength coefficient of the user's erroneous character based on the semantic weight value and contextual relevance of each character; When the semantic association strength coefficient is greater than a preset association threshold, a cognitive stress reduction instruction containing a stress reduction level value is generated; In response to the cognitive decompression instruction, a visual interval identifier is inserted into the competition-specific text; Monitor the distribution of new errors made by the user after the visual interval identifier is inserted, and remove the corresponding visual interval identifier when the dispersion index of the new error character exceeds a preset dispersion threshold. The location information of the visual interval identifiers to be removed and their corresponding stress reduction level values ​​are recorded in the cognitive policy library of the user's historical dataset.

8. The typing competition method based on real-time capability modeling and dynamic text generation according to any one of claims 1 to 7, characterized in that, The steps for calculating a comprehensive score based on the competition logs and generating a longitudinal comparison report, merging the error character type distribution data from this competition into the user's historical dataset, and updating the user's weak character set definition include: Based on the competition logs, the final speed value, final accuracy value, average difficulty coefficient of the competition text, and competition duration of the initiating user and the opponent user are extracted; Based on the preset scoring weight relationship, the final speed value, final accuracy value, average difficulty coefficient and competition time are input into the comprehensive scoring calculation model, and the comprehensive competition score of the two users is output. Retrieve the historical competition records of the initiating user from the user history database, compare the current comprehensive competition score with the highest historical score and the average historical score in a time series, and generate ability change trend data. The error marker sequences in the competition log are analyzed, and the error characters are classified and statistically analyzed according to the mapping relationship between the error characters and the target characters to generate error character type distribution data for this competition. The error character type distribution data is fused with the error distribution records in the user's historical dataset, and the weak character weight value is recalculated based on the preset update rule. Based on the recalculated weak character weight values, adjust the definition of the weak character set in the user capability vector and update it to the user capability database.

9. A typing competition system based on real-time capability modeling and dynamic text generation, characterized in that, The system includes: The real-time keystroke stream acquisition module is used to collect the user's real-time keystroke stream data, including key value sequence, timestamp sequence, and correctness identifier sequence; The capability vector modeling module is used to calculate core capability indicators and auxiliary capability indicators based on the real-time keystroke stream data, and to perform weighted fusion according to preset weights to generate a real-time capability vector for the user. The opponent matching module is used to calculate the comprehensive similarity between the real-time capability vector of the initiating user and the real-time capability vectors of each user in the online user pool. When the comprehensive similarity value exceeds the dynamic matching threshold, the matching opponent user identifier is output. The public weak character set generation module is used to determine the basic difficulty level of the text based on the real-time capability vectors of the initiating user and the opponent user, based on a preset difficulty mapping table, and to extract the intersection of the weak character sets of the initiating user and the opponent user as the public weak character set. The competitive text generation module is used to generate original text material based on the basic difficulty level of the text, and replace characters in non-critical semantic positions in the original text material with characters from the common weak character set to generate competitive text. The real-time interaction module is used to synchronously transmit the competition-specific text to the initiating user client and the opponent's user client, monitor the input streams of both sides and exchange cursor positions and error marker data in real time; The text difficulty dynamic adjustment module is used to dynamically adjust the text difficulty level of the initiating user or the opponent user based on continuous changes in error rate or accuracy. The data fusion and update module is used to calculate the comprehensive score based on the competition log and generate a longitudinal comparison report. It merges the error character type distribution data in this competition into the user's historical dataset and updates the user's weak character set definition.

10. A computer-readable storage medium, characterized in that: The computer program is stored that can be loaded by a processor and executed as described in any one of claims 1 to 8.