Input method, related device, electronic equipment and storage medium
By obtaining the second character sequence and associated visual pattern in the mapping rules, selecting the target rule and replacing the cursor display, the problem of feedback and personalization needs in input methods is solved, realizing dynamic cursor feedback and personalized display during the input process.
Patent Information
- Application Number
- CN202511765531.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-01-23
AI Technical Summary
Existing input methods cannot simultaneously meet the needs for feedback and personalization during the input process.
By obtaining the second character sequence and associated visual pattern in the mapping rule, the target rule is selected based on the character sequence matching result, and the cursor display is dynamically replaced during the input process to achieve dynamic visual feedback of the cursor.
It simultaneously satisfies the user's needs for feedback and personalization during the input process. By dynamically matching cursor patterns, it meets the user's personalized needs while providing feedback during the input process.
Smart Images

Figure CN121387119A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of terminal interaction, and in particular to an input method and related device, electronic equipment and storage medium. BACKGROUND
[0002] With the popularization of intelligent terminal input scenarios, the frequency of users completing information input in different scenarios (such as chatting, office work, search, etc.) through input boxes is increasing, and the demand for feedback and personalization in the input process is also increasingly strong.
[0003] At present, although most of the existing input methods can meet the user's personalization demand by supporting skin replacement, they cannot meet the feedback demand in the input process. Therefore, how to meet the feedback and personalization demand in the input process simultaneously has become a problem to be solved. SUMMARY
[0004] The technical problem solved by the present application is to provide an input method and related device, electronic equipment and storage medium, which can meet the feedback and personalization demand in the input process simultaneously.
[0005] To solve the above technical problem, the first aspect of the present application provides an input method, comprising: in response to a first character sequence of word selection on screen in an input process, obtaining a plurality of mapping rules; wherein the mapping rule comprises a second character sequence and a visual pattern associated with the second character sequence; selecting a target rule from the plurality of mapping rules based on the matching results between the first character sequence and the second character sequence in each mapping rule; and replacing and displaying the current cursor based on the visual pattern in the target rule.
[0006] To solve the above technical problem, the second aspect of the present application provides an input device, comprising: a rule obtaining module, a rule selecting module and a replacement display module, the rule obtaining module is used to obtain a plurality of mapping rules in response to a first character sequence of word selection on screen in an input process; wherein the mapping rule comprises a second character sequence and a visual pattern associated with the second character sequence; the rule selecting module is used to select a target rule from the plurality of mapping rules based on the matching results between the first character sequence and the second character sequence in each mapping rule; and the replacement display module is used to replace and display the current cursor based on the visual pattern in the target rule.
[0007] To solve the above technical problem, the third aspect of the present application provides an electronic equipment, at least comprising a storage and a processor coupled with each other, the storage at least stores program instructions, and the processor is used to execute the program instructions to realize the input method in the first aspect.
[0008] To solve the above technical problems, the fourth aspect of the present application provides a computer readable storage medium, which stores program instructions capable of being run by a processor, and the program instructions are used to implement the input method of the first aspect.
[0009] The above scheme, in response to the first character sequence selected on the screen during input, obtains a plurality of mapping rules, and the mapping rules include the second character sequence and the visual pattern associated with the second character sequence, so as to select the target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule, and then display the current cursor based on the visual pattern in the target rule. On the one hand, the first character sequence selected on the screen is matched with the second character sequence in each mapping rule to select the target rule, and then the current cursor is displayed based on the visual pattern in the target rule, so that the cursor pattern can be dynamically matched with the character sequence selected on the screen during input to realize the dynamic visualization of the cursor feedback of the input content, which helps to meet the feedback demand during input. On the other hand, the cursor pattern is dynamically matched with the character sequence selected on the screen, rather than a fixed style of cursor pattern, which can meet the individualization demand during input to a certain extent. Therefore, the feedback and individualization demands during input can be met at the same time. BRIEF DESCRIPTION OF DRAWINGS
[0010] Figure 1 is a flowchart of an embodiment of the input method of the present application; Figure 2 is a block diagram of an embodiment of the input device of the present application; Figure 3 is a block diagram of an embodiment of the electronic device of the present application; Figure 4 is a block diagram of an embodiment of the computer readable storage medium of the present application. DETAILED DESCRIPTION
[0011] The scheme of the embodiments of the present application will be described in detail below in combination with the drawings of the specification.
[0012] In the following description, specific details such as specific system structures, interfaces, techniques, etc. are presented in order to thoroughly understand the present application, but are not intended to limit the present application.
[0013] The terms "system" and "network" are often used interchangeably herein. The term "and / or", merely describes an associated relationship between associated objects, which means that there can be three relationships, for example, A and / or B, which means that A exists alone, A and B exist together, and B exists alone. In addition, the segment " / " herein generally means that the associated objects before and after are an "or" relationship. In addition, "multiple" herein means two or more than two.
[0014] Please refer to Figure 1 , Figure 1 is a flowchart of an embodiment of the method. It should be noted that the flow steps in the embodiments of the present disclosure can be executed by an electronic device with computing capability or related equipment including the above-mentioned electronic device, such as a smart phone, a tablet computer, a microcomputer, etc., which can include but is not limited to, and the specific type of device is not limited herein. Specifically, the embodiments of the present disclosure can include the following steps: Step S11: In response to the first character sequence selected by the user and input on the screen, a plurality of mapping rules are obtained.
[0015] In one implementation scenario, the user operation can be monitored in real time through the input event listening interface of the input method service, and the character sequence selected by the user and input on the screen can be captured as the first character sequence in the character input completion callback. It should be noted that before the selection operation is performed, the character sequence to be input is usually still regarded as not having completed character input, for example, the character sequence to be input is still in the relevant area of the input method service interface, such as the selection area, the clipboard area, etc., and after the selection operation is performed, the character sequence to be input is usually "jumped" from the relevant area of the input method service interface to the text area, such as the chat input box under the chat scene, the document editing area under the document editing scene, etc., at this time, the character sequence to be input can be regarded as having completed character input, i.e., the input on the screen.
[0016] In one implementation scenario, the first character sequence can be input by any one of text input, voice input, and copy-paste. As one possible example, the character sequence can be manually input through the keyboard of the input method service. As another possible example, the character sequence can be copied and pasted from the clipboard. As yet another possible example, the character sequence can be obtained through voice-to-character conversion. It should be noted that the above examples are only a few possible examples of inputting character sequences in actual applications, and other possible ways are not limited herein and will not be listed one by one.
[0017] In an implementation scenario, the first character sequence can include, but is not limited to, a word, an emoji, a special character, and the like, and the specific type of each character in the first character sequence is not limited herein. As one possible example, the first character sequence can only include a word (e.g., the first character sequence "good night"). As another possible example, the first character sequence can only include an emoji (e.g., an emoji, a color character, and the like). As yet another possible example, the first character sequence can only include a special character (e.g., @, #, and the like). In addition, the first character sequence can include two or more types of characters, such as the first character sequence including a word and an emoji, or the first character sequence including a word and a special character, or the first character sequence including an emoji and a special character, or the first character sequence including a word, an emoji, and a special character.
[0018] In an implementation scenario, as one possible example, whenever the first character sequence selected and inputted by the user is captured, the steps of obtaining a plurality of mapping rules and the subsequent sequence matching and the like can be performed. Alternatively, as another possible example, a preset time period (e.g., 500 milliseconds) of debounce processing can be performed through a debounce mechanism, that is, when the first character sequence selected and inputted by the user is detected, the steps of obtaining a plurality of mapping rules and the subsequent sequence matching and the like can not be immediately performed, but it is determined whether a new user operation can be listened to through the event listening interface of the input method service within the preset time period. If yes, the character sequence selected and inputted by the user can be captured in the character input completion callback after waiting for the preset time period, so as to update the first character sequence, otherwise, the steps of obtaining a plurality of mapping rules and the subsequent sequence matching and the like can be performed after waiting for the preset time period. Through the above-mentioned manner, the performance problem caused by frequent triggering can be avoided as much as possible through the debounce mechanism.
[0019] In an implementation scenario, the first character sequence can be encapsulated as a keyword event object. For example, in the case that the steps of obtaining a plurality of mapping rules and the subsequent sequence matching and the like are performed as soon as the first character sequence selected and inputted by the user is captured, the first character sequence can be directly encapsulated as a keyword event object. Alternatively, for example, in the case that the preset time period of debounce processing is performed through the debounce mechanism, the captured first character sequence can be encapsulated as a keyword event object after the debounce delay ends. It should be noted that the keyword event object can include the first character sequence and its timestamp information (e.g., the time information of the first character sequence selected and inputted by the user).
[0020] In one implementation scenario, after obtaining the first character sequence and before performing subsequent sequence matching, preprocessing operations can be performed on the first character sequence. These preprocessing operations may include, but are not limited to, filtering invalid input and standardization. The specific content of these preprocessing operations is not limited here. For example, taking filtering invalid input as an example, the first character sequence can be validated, such as removing meaningless content like single spaces, garbled characters, and empty characters, while retaining complete character combinations entered or pasted consecutively to satisfy the normal sentence meaning. Alternatively, taking standardization as an example, the first character sequence can be uniformly converted into a parsable format, such as automatically removing leading and trailing spaces and standardizing capitalization, to ensure consistency in subsequent feature parsing. It should be noted that after performing preprocessing operations on the first character sequence, the preprocessed first character sequence can be passed to subsequent sequence matching.
[0021] In this embodiment of the disclosure, the mapping rule may include a second character sequence and a visual pattern associated with the second character sequence. As one possible example, the mapping rule may include one second character sequence and a visual pattern associated with this second character sequence. For example, the mapping rule may include a second character sequence "Goodnight" and a visual pattern "Lights off animation" associated with this second character sequence. As another possible example, the mapping rule may also include multiple (e.g., two or more) second character sequences and visual patterns simultaneously associated with these second character sequences. For example, the mapping rule may include the second character sequences "Goodnight," "Goodnight," and the visual pattern "Lights off animation" associated with these second character sequences. That is, the mapping rule may include at least one second character sequence and a visual pattern simultaneously associated with at least one second character sequence. Of course, the above examples are merely a few possible examples of mapping rules in practical applications, and will not be listed in detail here.
[0022] In an implementation scenario, several mapping rule packages may contain first-type mapping rules and second-type mapping rules. The first-type mapping rules can be pre-configured, while the second-type mapping rules can be customized by the user.
[0023] In a specific implementation scenario, the second character sequence in the first type of mapping rule can include, but is not limited to, key input words based on the user's daily habits, such as common phrases like "happy," "eat," and "goodnight." Of course, the above examples are merely a few possible instances of the second character sequence in the first type of mapping rule; the specific content of the second character sequence in the first type of mapping rule is not limited here, nor will it be listed in detail.
[0024] In one specific implementation scenario, the second character sequence in the second type of mapping rule can include, but is not limited to, a user-defined special input word, such as a personal nickname, a pet name, a work code, a commonly used instruction, etc. Of course, the above examples are only a few possible examples of the second character sequence in the second type of mapping rule, and the specific content of the second character sequence in the second type of mapping rule is not limited herein, and will not be listed one by one.
[0025] In one implementation scenario, a pattern library can be pre-configured to support a user to upload or select a cursor pattern matching the feature from a system template library, so as to configure the aforementioned second type of mapping rule. For example, a user can upload a "turn off the light animation" to be associated with the second character sequence "good night", thereby forming the second type of mapping rule. It should be noted that the pattern type can include a static pattern, for example, can include but is not limited to a PNG format, a JPG format, etc. Pattern, such as a smiley face pattern corresponding to "happy"; the pattern type can also include a dynamic pattern, for example, can include but is not limited to a GIF format, an APNG format, a WEBP format, etc. Pattern, such as a "good night" corresponding to the turn off the light animation. On this basis, the second type of mapping rule can be formed based on the semantic features of the second character sequence and the cursor pattern. In addition, for the cursor pattern in the pattern library, preview operation and replacement operation can also be supported.
[0026] Step S12: Selecting a target rule from the mapping rules based on the matching results between the first character sequence and the second character sequence in each mapping rule.
[0027] In one implementation scenario, as one possible implementation, for each mapping rule, a matching result indicating whether the first character sequence hits the mapping rule can be obtained based on semantic matching between the first character sequence and each second character sequence in the mapping rule. It should be noted that as long as there is a matching degree between the semantic matching between the second character sequence and the first character sequence in the mapping rule that meets the related conditions about the matching threshold (for example, the matching degree is not lower than the matching threshold, the matching degree is higher than the matching threshold, etc.), it can be considered that the matching result includes that the first character sequence hits the mapping rule, otherwise, if there is no matching degree between the semantic matching between the second character sequence and the first character sequence in the mapping rule that meets the related conditions about the matching threshold (for example, the matching degree is not lower than the matching threshold, the matching degree is higher than the matching threshold, etc.), it can be considered that the matching result includes that the first character sequence does not hit the mapping rule. In addition, the sequence matching in the embodiments of the present disclosure can be implemented by a rule matching engine (for example, a related algorithm program, a neural network model, etc.). On this basis, if the matching result corresponding to the mapping rule includes that the first character sequence hits the mapping rule, the mapping rule can be selected as a candidate rule, otherwise, the mapping rule can not be selected as a candidate rule, and then the candidate rule with the highest matching degree can be selected as the target rule.
[0028] In another implementation scenario, unlike the foregoing implementation, as another possible implementation, the mapping rule can also be configured with a matching mode and a priority, and then whether to select the mapping rule as a candidate rule can be determined based on the matching result between the first character sequence and the second character sequence in the mapping rule. It should be noted that the matching result can be obtained by matching according to the matching mode configured by the mapping rule, that is, at this time, the sequence matching is no longer uniformly matched according to the uniform matching mode, but needs to be matched according to the matching mode configured by the mapping rule. Exemplarily, the matching mode can include but is not limited to: exact matching, fuzzy matching, regular matching, etc., which can be referred to the related description below, and will not be described here. On this basis, the candidate rule can be selected as the target rule based on the priority of each candidate rule. The above-mentioned manner determines whether to select the mapping rule as a candidate rule based on the matching result between the first character sequence and the second character sequence in the mapping rule, and the matching result is obtained by matching according to the matching mode configured by the mapping rule, and then the candidate rule is selected as the target rule based on the priority of each candidate rule, which can flexibly match the mapping rule as needed, and is helpful to realize the high customization of rule matching.
[0029] In a specific implementation scenario, the mapping rule can be defined according to the rule in the resource package configuration list, for example, each mapping rule can include a trigger, the trigger specifies the type as a keyword trigger, the event type can be configured according to the input scenario (for example, in a chat scenario, the event type can be configured as a text sending event), and the trigger parameters can include the second character sequence and its associated visual pattern, the matching mode, and the priority. Of course, the above example is only a configuration method of the event type in the chat scenario, and in actual application, it can also be applied to a document editing scenario (for example, WPS document editing), a message browsing scenario (for example, a browser), etc., which can capture the first character sequence through the input listening mechanism and realize real-time replacement of the current cursor through sequence matching, etc. Other possible application scenarios are not limited here, and will not be exemplified one by one.
[0030] In a specific implementation scenario, the exact match can require the character sequence to be exactly the same (i.e., the first character sequence and the second character sequence are required to be exactly the same), the fuzzy match can be a case-insensitive inclusion judgment (for example, as long as the first character sequence contains the second character sequence, and the case is not required to be exactly the same), and the regular match can be a pattern matching through the use of a regular expression. Of course, the above examples are only a few possible matching modes in actual application, and other possible matching modes are not limited here, and will not be exemplified one by one.
[0031] In a specific implementation scenario, the priority value range can be exemplarily configured as 1 to 100 (for example, the larger the value, the higher the priority, and vice versa, the smaller the value, the lower the priority). In the input process, the mapping rule with high priority can be preferentially guaranteed, for example, in the case of multiple mapping rules being hit at the same time, the mapping rule with the highest priority can be taken as the target rule.
[0032] In a specific implementation scenario, as mentioned above, several mapping rules can include first-type mapping rules and second-type mapping rules. First-type mapping rules can be considered basic mappings, where default rules can be defined in the resource package configuration. These rules match default patterns based on input word characteristics (e.g., the first character sequence "Goodnight" can correspond to the visual pattern "Lights off animation"). First-type mapping rules can include triggers (e.g., the aforementioned specified type "keyword trigger," event type "text sending event," the second character sequence "Goodnight" and its associated visual pattern "Lights off animation," as well as matching modes "exact match," priority "90," etc.). Similarly, second-type mapping rules can be considered custom mappings, allowing users to configure exclusive patterns for specific input words (e.g., "Sweetie" corresponds to "user-defined object kissing animation"). Custom mappings can be configured by adding new mapping rules. Second-type mapping rules can also include triggers (e.g., the aforementioned specified type "keyword trigger," event type "text sending event," the second character sequence "Sweetie" and its associated visual pattern "user-defined object kissing animation," as well as matching modes "exact match," priority "100," etc.). It should be noted that the examples above are merely a few possible examples of the specific contents of the first and second type of mapping rules in practical applications. Other possible scenarios are not limited here, nor will they be listed one by one. Furthermore, to facilitate editing mapping rules, a visual configuration interface can be provided, supporting viewing / changing input word features (i.e., the second character sequence), editing mapping relationships (i.e., associating the second character sequence with the visual pattern), real-time preview of pattern effects, etc. For example, the above configuration can be implemented by modifying the resource package configuration file, supporting dynamic loading and updating.
[0033] In a specific implementation scenario, for each mapping rule, the first character sequence can be matched with the second character sequence in the mapping rule according to the matching mode configured in the mapping rule. If, when performing sequence matching according to the matching mode configured in the mapping rule, there is a second character sequence in the mapping rule that can successfully match the first character sequence (e.g., in the case of exact matching mode, there is a second character sequence in the mapping rule that is exactly the same as the first character sequence), then this mapping rule can be selected as a candidate rule. Conversely, if, when performing sequence matching according to the matching mode configured in the mapping rule, there is no second character sequence in the mapping rule that can successfully match the first character sequence, then this mapping rule can not be selected as a candidate rule.
[0034] In a specific implementation scenario, after selecting the candidate rules, the target rule can be chosen based on the priority of each candidate rule. For example, the candidate rule with the highest priority can be selected as the target rule.
[0035] In yet another implementation scenario, as another possible implementation, the mapping rule can also be configured with a matching pattern, a priority, and a trigger condition. After determining whether to select the mapping rule as a candidate rule based on the matching result between the first character sequence and the second character sequence in the mapping rule according to the matching pattern configured in the mapping rule, it can be further determined whether to keep or discard the candidate rule based on whether the current state satisfies the trigger condition of the candidate rule, and finally for each of the candidate rules that are kept, the candidate rule with the highest priority can be selected as the target rule. In this way, after determining whether to select the mapping rule as a candidate rule based on the matching result between the first character sequence and the second character sequence in the mapping rule, the candidate rule can be first determined whether to keep or discard based on whether the current state satisfies the trigger condition of the candidate rule, and then for each of the candidate rules that are kept, the candidate rule with the highest priority can be selected as the target rule, which can flexibly match the mapping rule as needed and help to achieve highly customized rule matching.
[0036] In a specific implementation scenario, the trigger condition is characterized by an additional condition that needs to be further satisfied in addition to the sequence matching condition with the second character sequence in the mapping rule. For example, the aforementioned mapping rule containing the second character sequence “good night” and the visual pattern “lamp-off animation” associated therewith can also be configured with a trigger condition “current time is between 8 p.m. and 12 a.m.”. Of course, the above example is only one possible example of the trigger condition, and other cases of the trigger condition are not limited herein and are not exemplified one by one.
[0037] In a specific implementation scenario, the candidate rule can be kept if the current state satisfies the trigger condition of the candidate rule, and vice versa. In order to facilitate understanding, the aforementioned mapping rule containing the second character sequence “good night” and the visual pattern “lamp-off animation” associated therewith is still taken as an example. After selecting this mapping rule as a candidate rule through the aforementioned sequence matching, it can be further detected whether the current state satisfies the trigger condition “current time is between 8 p.m. and 12 a.m.” of this candidate condition. If the trigger condition “current time is between 8 p.m. and 12 a.m.” is satisfied, this candidate rule can be kept, and vice versa, if the trigger condition “current time is between 8 p.m. and 12 a.m.” is not satisfied, this candidate rule can be discarded.
[0038] In a specific implementation scenario, for each of the candidate conditions that are kept, the candidate condition with the highest priority can be selected as the target rule.
[0039] It should be noted that the above examples are only several possible examples of selecting a target rule from a plurality of mapping rules through sequence matching in actual applications, and other possible implementation manners are not limited herein, and will not be exemplified one by one. In addition, the mapping rule can also be configured with an action parameter. In the embodiment of the present disclosure, since it is necessary to realize the replacement display of the current cursor based on the visual pattern, the action parameter can be set as playing a multimedia resource.
[0040] Step S13: Replacing the display of the current cursor based on the visual pattern in the target rule.
[0041] In one implementation scenario, as a possible implementation manner, after the target rule is selected, the display of the current cursor can be replaced based on the visual pattern in the target rule.
[0042] In a specific implementation scenario, when the current cursor is replaced by the visual pattern in the target rule, the height of the visual pattern in the target rule can be adjusted to be the same as the height of the current cursor, the width of the visual pattern in the target rule can be scaled proportionally, and the visual pattern in the target rule can be aligned with the center of the current cursor. As a possible example, in actual replacement display, the display position of the visual pattern in the target rule is updated in real time by specifically receiving a cursor position update event through a cursor position listening interface, so that the center point of the visual pattern in the target rule is aligned with the center point of the current cursor, the height of the visual pattern in the target rule is set to be the same as the height of the current cursor, the width of the visual pattern in the target rule is set to be scaled proportionally with the height, and then the visual pattern in the target rule can be completely synchronized with the cursor movement (i.e., when the cursor moves in the input box, the visual pattern in the target rule is updated in real time with the position, without delay or offset). Of course, the above example is only one possible example of realizing the replacement display in actual applications, and other possible ways of realizing the replacement display are not limited herein, and will not be exemplified one by one.
[0043] In a specific implementation scenario, the mapping rule can also be configured with display parameters of the visual pattern, which can include but are not limited to: animation resource identifier, loop playing flag, interruption flag, playing duration, delay time, etc., without limitation on the specific content of the display parameters. As a possible example, in the case where the visual pattern in the target rule is a static pattern, the static pattern can be directly set to replace the current cursor, and the display duration of the static pattern can be controlled according to the display parameters configured in the target rule. As another possible example, in the case where the visual pattern in the target rule is a dynamic pattern, an animation resource (such as WEBP format, etc.) can be loaded to replace and display the current cursor, and the loop mode (such as infinite loop, single play, etc.), display duration (such as 3 seconds, etc.), and whether to delay playing of the dynamic pattern can be controlled according to the display parameters configured in the target rule. Of course, the above examples are only two possible playing modes when a static pattern and a dynamic pattern are respectively taken as examples in actual application, without limitation on other possible modes, which will not be exemplified one by one.
[0044] In another implementation scenario, different from the foregoing implementation manner, as another possible implementation manner, after the target rule is selected, it can also be detected whether the current cursor is a native cursor. In response to the current cursor being a native cursor, the current cursor can be replaced and displayed as the visual pattern in the target rule. In response to the current cursor not being a native cursor but being a visual pattern in any mapping rule, whether the current cursor is replaced and displayed as the visual pattern in the target rule can be determined based on the priority of the mapping rule from which the current cursor is derived and the priority of the target rule. It should be noted that in the case where the current cursor is replaced and displayed as the visual pattern in the target rule, the visual pattern in the target rule can serve as a new current cursor. In addition, the specific manner of realizing replacement and display can be referred to the foregoing related description, which will not be repeated here. The above-mentioned manner can ensure as much as possible that the cursor pattern with high priority is not interrupted by the cursor pattern with low priority, by detecting whether the current cursor is a native cursor, and respectively adopting different strategies of direct replacement and display and determining whether to replace and display according to the priority in different cases where the current cursor is a native cursor and is not a native cursor.
[0045] In a specific implementation scenario, the native cursor refers to a cursor pattern configured by default by an input method service or an operating system. For example, in a related operating system, the native cursor can be a cursor pattern like "|"; or, for another example, in a related input method service, the native cursor can be a cursor pattern like "I". Of course, the above examples are only a few possible examples of the native cursor, and the specific form of the native cursor is not limited herein, nor are they enumerated one by one. For example, in the Android system, the cursor replacement can be implemented through TextView, and in the iOS system, the cursor replacement can be implemented through the custom cursor view of iOSUITextField without relying on the root or jailbreak permission.
[0046] In a specific implementation scenario, in the case where the current cursor is not the native cursor but a visual pattern in any mapping rule, the mapping rule from which the current cursor originates, i.e., the mapping rule that triggers the display replacement when the visual pattern becomes the "current cursor", is the current cursor.
[0047] In a specific implementation scenario, in the case where the current cursor is not the native cursor but a visual pattern in any mapping rule, in response to the priority of the mapping rule from which the current cursor originates being higher than the priority of the target rule, the current cursor can be maintained, and in response to the priority of the mapping rule from which the current cursor originates not being higher than the priority of the target rule, the current cursor can be replaced and displayed as the visual pattern in the target rule.
[0048] In an implementation scenario, in order to improve the loading speed of the replacement display, it can be detected whether the cache data of the visual pattern in the target rule is found in the cache space, in response to the cache data of the visual pattern in the target rule not being found in the cache space, the visual pattern in the target rule in the original resource package can be loaded to replace and display the current cursor, and the cache data of the visual pattern in the target rule can be cached in the cache space, and in response to the cache data of the visual pattern in the target rule being found in the cache space, the current cursor can be replaced and displayed based on the cache data of the visual pattern in the target rule in the cache space, and the use mark of the cache data of the visual pattern in the target rule in the cache space can be updated. It should be noted that each cache data in the cache space is determined whether to be eliminated based on the respective use mark. The above-mentioned manner determines whether to realize the replacement display by loading the corresponding cache data or directly loading the visual pattern for replacement display by detecting whether the cache data of the visual pattern in the target rule is found in the cache space, which can improve the loading speed of the replacement display as much as possible.
[0049] In one specific implementation scenario, the cache space can adopt a hierarchical preloading strategy. Specifically, high-priority visual patterns (e.g., priority 70-100) can be preloaded first, medium-priority visual patterns (e.g., priority 50-69) can be preloaded second, and low-priority visual patterns (e.g., 1-49) can be preloaded last, in the above priority order until the cache space is full. Illustratively, with a total cache space of 50MB, the preloading can stop when the cache space is full, according to the hierarchical preloading strategy described above.
[0050] In one specific implementation scenario, when the cached data of the visual pattern in the target rule is found in the cache space, the resource management module of the input method service can obtain the cached data of the visual pattern in the target rule from the cache space, to replace the current cursor based on the cached data. It should be noted that the resource management module of the input method service can support decompression of resource packages (e.g., in ZIP format), parsing of configuration files, loading and cache management of resource files.
[0051] In one specific implementation scenario, as described above, when the cached data of the visual pattern in the target rule is not found in the cache space, the visual pattern in the target rule can be cached in the cache space, and a usage marker can be automatically assigned to the visual pattern when it is stored in the cache space. It should be noted that the usage marker can include the usage time of each instance of the cached data. In addition, as described above, when the cached data of the visual pattern in the target rule is found in the cache space, the usage marker of the cached data of the visual pattern in the target rule in the cache space can be updated, i.e., the usage marker can be further updated with the usage time of the current instance. On this basis, when it is necessary to clean up the cached data in the cache space (e.g., the cache space is full), the usage times of the cached data in a period of time from the preset time length from the current time can be counted according to the usage markers of the cached data, and the cached data can be sorted in order from low to high according to the usage times. Finally, the cached data in the front preset sequence (e.g., the top 10, the top 5%) can be cleaned up to clean up the cached data that has been relatively less used recently.
[0052] The above scheme, in response to the first character sequence selected and on-screen in the input process, obtains a plurality of mapping rules, and the mapping rules include the second character sequence and the visual pattern associated with the second character sequence, thereby selecting the target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule, and then displaying the current cursor based on the visual pattern in the target rule. On the one hand, the first character sequence selected and on-screen is matched with the second character sequence in each mapping rule to select the target rule, and then the current cursor is displayed based on the visual pattern in the target rule, so that the cursor pattern can be dynamically matched with the character sequence selected and on-screen in the input process to realize the dynamic visualization of the "input content-cursor feedback" of the cursor, which helps to meet the feedback demand in the input process. On the other hand, the cursor pattern is dynamically matched with the character sequence selected and on-screen, rather than a fixed style of cursor pattern, which can meet the individualization demand in the input process to some extent. Therefore, the feedback and individualization demands in the input process can be met at the same time.
[0053] Please refer to Figure 2 , Figure 2 is a frame schematic diagram of an embodiment of the input device. The input device 20 includes a rule obtaining module 21, a rule selecting module 22 and a replacement display module 23. The rule obtaining module 21 is configured to obtain a plurality of mapping rules in response to the first character sequence selected and on-screen in the input process. The mapping rules include the second character sequence and the visual pattern associated with the second character sequence. The rule selecting module 22 is configured to select the target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule. The replacement display module 23 is configured to display the current cursor based on the visual pattern in the target rule.
[0054] The above scheme, the input device 20 obtains a plurality of mapping rules in response to the first character sequence of the selected word on the screen during input, and the mapping rules include the second character sequence and the visual pattern associated with the second character sequence, so as to select a target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule, and then display the current cursor based on the visual pattern in the target rule. On the one hand, the first character sequence of the selected word on the screen is matched with the second character sequence in each mapping rule to select the target rule, and then the current cursor is displayed based on the visual pattern in the target rule. Therefore, the cursor pattern can be dynamically matched with the character sequence of the selected word on the screen during input to realize the dynamic visualization of the "input content-cursor feedback" cursor, which helps to meet the feedback demand during input. On the other hand, the cursor pattern is dynamically matched with the character sequence of the selected word on the screen, rather than a fixed style of cursor pattern, which can meet the individualization demand during input to some extent. Therefore, the feedback and individualization demands during input can be met at the same time.
[0055] In some disclosed embodiments, the mapping rule is configured with a matching mode and a priority, the rule selection module 22 includes a selection determination submodule for determining whether to select the mapping rule as a candidate rule based on the matching result between the first character sequence and the second character sequence in the mapping rule; wherein the matching result is obtained by matching according to the matching mode configured by the mapping rule; and the rule selection module 22 includes a target selection submodule for selecting the candidate rule as the target rule based on the priority of each candidate rule.
[0056] In some disclosed embodiments, the mapping rule is further configured with a trigger condition, the rule selection module 22 includes a retention and elimination submodule for selecting to retain or eliminate the candidate rule based on whether the current state meets the trigger condition of the candidate rule; and the target selection submodule is specifically configured to, for each candidate rule that is retained, select the candidate rule as the target rule based on the priority of each candidate rule.
[0057] In some disclosed embodiments, the mapping rule is configured with a priority, the replacement display module 23 includes a cursor detection submodule for detecting whether the current cursor is the original cursor; the replacement display module 23 includes a direct replacement submodule for, in response to the current cursor being the original cursor, replacing and displaying the current cursor as the visual pattern in the target rule; the replacement display module 23 includes a replacement determination submodule for, in response to the current cursor not being the original cursor but being the visual pattern in any mapping rule, determining whether to replace and display the current cursor as the visual pattern in the target rule based on the priority of the mapping rule from which the current cursor originates and the priority of the target rule; wherein in the case that the current cursor is replaced and displayed as the visual pattern in the target rule, the visual pattern in the target rule serves as a new current cursor.
[0058] In some disclosed embodiments, the replacement determining submodule comprises a first response unit configured to maintain the current cursor in response to the priority of the mapping rule from which the current cursor originates being higher than the priority of the target rule; the replacement determining submodule comprises a second response unit configured to replace the current cursor with the visual pattern in the target rule in response to the priority of the mapping rule from which the current cursor originates not being higher than the priority of the target rule.
[0059] In some disclosed embodiments, the replacement displaying module 23 comprises a cache lookup submodule configured to detect whether the cache data of the visual pattern in the target rule is found in the cache space; the replacement displaying module 23 comprises a pattern loading submodule configured to load the visual pattern in the target rule based on the visual pattern in the target rule in the original resource package in response to the cache data of the visual pattern in the target rule not being found in the cache space, to replace the current cursor and cache the visual pattern in the target rule in the cache space; the replacement displaying module 23 comprises a cache loading submodule configured to replace the current cursor based on the cache data of the visual pattern in the target rule in the cache space in response to the cache data of the visual pattern in the target rule being found in the cache space, and update the usage mark of the cache data of the visual pattern in the target rule in the cache space; wherein each cache data in the cache space is determined to be eliminated based on the respective usage mark.
[0060] In some disclosed embodiments, the first character sequence comprises at least one of a character, an emoticon, and a special character; and / or, the first character sequence is inputted in any one of a character input, a voice input, and copy-paste; and / or, the mapping rule is configured with a matching mode, the matching mode being any one of an exact match, a fuzzy match, and a regular match; and / or, the mapping rule comprises at least one second character sequence and a visual pattern associated with the at least one second character sequence; and / or, the mapping rules comprise a first type of mapping rule and a second type of mapping rule, the first type of mapping rule being pre-configured, and the second type of mapping rule being configured by a user; and / or, when the visual pattern in the target rule is displayed to replace the current cursor, the height of the visual pattern in the target rule is adjusted to be the same as the height of the current cursor, the width of the visual pattern in the target rule is proportionally scaled, and the visual pattern in the target rule is aligned with the center of the current cursor; and / or, the mapping rule is further configured with display parameters of the visual pattern, the display parameters comprising at least one of an animation resource identifier, a loop playing flag, an interruption flag, a playing duration, and a delay time.
[0061] Please refer to Figure 3 , Figure 3is a frame schematic diagram of an embodiment of the electronic device. The electronic device 30 at least includes a memory 31 and a processor 32 coupled with each other. The memory 31 at least stores program instructions. The processor 32 is configured to execute the program instructions to implement the steps in any of the above input method embodiments. Details can be referred to the above disclosed embodiments, which will not be repeated here. As a possible example, the electronic device 30 can further include, but is not limited to, a display screen (not shown) coupled with the processor 32, and the like. Other components that the electronic device 30 can include are not limited here and will not be exemplified one by one.
[0062] Specifically, the processor 32 is configured to control itself and the memory 31 to implement the steps in any of the above input method embodiments. The processor 32 can also be referred to as a CPU (Central Processing Unit). The processor 32 can be an integrated circuit chip with processing capability. The processor 32 can also be a general purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general purpose processor can be a microprocessor or the processor can also be any conventional processor. In addition, the processor 32 can be implemented by an integrated circuit chip.
[0063] The above scheme, the electronic device 30 acquires a plurality of mapping rules in response to the first character sequence selected and input on the screen, and the mapping rules include the second character sequence and the visual pattern associated with the second character sequence, thereby selecting a target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule, and then displaying the current cursor based on the visual pattern in the target rule. On the one hand, the first character sequence selected and input on the screen is matched with the second character sequence in each mapping rule to select a target rule, and then the current cursor is displayed based on the visual pattern in the target rule. Therefore, the cursor pattern can be dynamically matched with the character sequence selected and input on the screen during the input process to realize the dynamic visualization of the cursor feedback of the input content, which helps to meet the feedback requirement during the input process. On the other hand, the cursor pattern is dynamically matched with the character sequence selected and input on the screen, rather than a fixed style of cursor pattern, which can meet the individualization requirement during the input process to some extent. Therefore, the feedback and individualization requirements during the input process can be met simultaneously.
[0064] Please refer toFigure 4 , Figure 4 is a framework schematic diagram of an embodiment of the computer readable storage medium of the present application. The computer readable storage medium 40 stores program instructions 41 capable of being executed by the processor, and the program instructions 41 are used to implement the steps in any of the above input method embodiments.
[0065] In the above scheme, the computer readable storage medium 40 acquires a plurality of mapping rules in response to the first character sequence on the screen during the input process, and the mapping rules include the second character sequence and the visual pattern associated with the second character sequence, so as to select a target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule, and then display the current cursor based on the visual pattern in the target rule. On the one hand, since the first character sequence on the screen during the input process is matched with the second character sequence in each mapping rule to select the target rule, and then the current cursor is displayed based on the visual pattern in the target rule, the cursor pattern can be dynamically matched with the character sequence on the screen during the input process to realize the dynamic visualization of the cursor feedback of the input content, which helps to meet the feedback requirement during the input process. On the other hand, since the cursor pattern is dynamically matched with the character sequence on the screen, rather than a fixed style of cursor pattern, the individualization requirement during the input process can be met to some extent. Therefore, the feedback and individualization requirements during the input process can be met at the same time.
[0066] In some embodiments, the device provided by the embodiments of the present disclosure has functions or includes modules that can be used to execute the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, they will not be repeated here.
[0067] The above description of each embodiment tends to emphasize the differences between the embodiments, and the same or similar parts can be mutually referred to. For brevity, they will not be repeated here.
[0068] In several embodiments provided in the present application, it should be understood that the disclosed method and device can be implemented by other means. For example, the above-described device implementation is only schematic, and the division of the modules or units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0069] The units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the present embodiment scheme.
[0070] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0071] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical scheme of the present application or the part that contributes to the prior art or the whole or part of the technical scheme can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0072] If the technical scheme of the present application involves personal information, the product applying the technical scheme of the present application has been explicitly informed of the personal information processing rules before processing the personal information, and has obtained the personal independent consent. If the technical scheme of the present application involves sensitive personal information, the product applying the technical scheme of the present application has obtained the personal independent consent before processing the sensitive personal information, and at the same time meets the requirement of "explicit consent". For example, at the personal information collection device such as a camera, a clear and prominent sign is set to inform that the personal information collection range has been entered and the personal information will be collected. If the person voluntarily enters the collection range, it is considered to agree to collect the personal information. Or, on the device for processing personal information, through the pop-up information or by uploading the personal information by the person himself, the personal authorization is obtained under the condition that the obvious sign / information informs the personal information processing rules. The personal information processing rules can include personal information processor, personal information processing purpose, processing method, and personal information type, etc.
Claims
1. An input method, characterized by, The method comprises: in response to a first character sequence inputted on a screen, obtaining a plurality of mapping rules, wherein each mapping rule comprises a second character sequence and a visual pattern associated with the second character sequence; selecting a target rule from the plurality of mapping rules based on a matching result between the first character sequence and the second character sequence in each mapping rule; displaying a current cursor based on the visual pattern in the target rule.
2. The method of claim 1, wherein, The mapping rule is configured with a matching mode and a priority, and the selecting the target rule from the plurality of mapping rules based on the matching result between the first character sequence and the second character sequence in each mapping rule comprises: determining whether to select each mapping rule as a candidate rule based on a matching result between the first character sequence and the second character sequence in the mapping rule, wherein the matching result is obtained by matching according to the matching mode configured in the mapping rule; selecting the candidate rule as the target rule based on the priority of each candidate rule.
3. The method of claim 2, wherein, The mapping rule is further configured with a trigger condition, and the method further comprises: selecting to keep or discard the candidate rule based on whether a current state meets the trigger condition of the candidate rule, after the determining whether to select the mapping rule as the candidate rule based on the matching result between the first character sequence and the second character sequence in the mapping rule, and before the selecting the candidate rule as the target rule based on the priority of each candidate rule. The selecting the candidate rule as the target rule based on the priority of each candidate rule comprises: for each kept candidate rule, selecting the candidate rule as the target rule based on the priority of each candidate rule.
4. The method of claim 1, wherein, The mapping rule is configured with a priority, and the displaying the current cursor based on the visual pattern in the target rule comprises: detecting whether the current cursor is a native cursor; in response to the current cursor being the native cursor, displaying the current cursor as the visual pattern in the target rule; in response to the current cursor not being the native cursor but being the visual pattern in any mapping rule, determining whether to display the current cursor as the visual pattern in the target rule based on a priority of the mapping rule from which the current cursor originates and a priority of the target rule; wherein, in a case that the current cursor is displayed as the visual pattern in the target rule, the visual pattern in the target rule serves as a new current cursor.
5. The method of claim 4, wherein, The determining whether to display the current cursor as the visual pattern in the target rule based on the priority of the mapping rule from which the current cursor originates and the priority of the target rule comprises: in response to the priority of the mapping rule from which the current cursor originates being higher than the priority of the target rule, keeping the current cursor. In response to the priority of the current cursor derived from the mapping rule being not higher than the priority of the target rule, the current cursor is replaced and displayed as the visual pattern in the target rule.
6. The method of claim 1, wherein, The replacing and displaying of the current cursor based on the visual pattern in the target rule comprises: detecting whether the cache data of the visual pattern in the target rule is found in the cache space; in response to the cache data of the visual pattern in the target rule not being found in the cache space, loading the visual pattern in the target rule based on the original resource package to replace and display the current cursor, and caching the visual pattern in the target rule to the cache space; in response to the cache data of the visual pattern in the target rule being found in the cache space, directly replacing and displaying the current cursor based on the cache data of the visual pattern in the target rule in the cache space, and updating the use mark of the cache data of the visual pattern in the target rule in the cache space; wherein each of the cache data in the cache space is determined whether to be eliminated based on the respective use mark.
7. The method according to any one of claims 1 to 6, characterized in that, The first character sequence comprises at least one of a word, an emoticon, and a special character; and / or, the first character sequence is input by any one of word input, voice input, and copy-paste; and / or, the mapping rule is configured with a matching mode, which is any one of exact matching, fuzzy matching, and regular matching; and / or, the mapping rule comprises at least one second character sequence and a visual pattern associated with the at least one second character sequence; and / or, the mapping rules comprise a first type of mapping rule and a second type of mapping rule, the first type of mapping rule is pre-configured, and the second type of mapping rule is configured by a user; and / or, when the visual pattern in the target rule is used to replace and display the current cursor, the height of the visual pattern in the target rule is adjusted to be the same as the height of the current cursor, the width of the visual pattern in the target rule is proportionally scaled, and the visual pattern in the target rule is aligned with the center of the current cursor; and / or, the mapping rule is further configured with display parameters of the visual pattern, the display parameters comprising at least one of an animation resource identifier, a loop playing flag, an interruption flag, a playing time length, and a delay time.
8. An input device, characterized by comprise: a rule acquisition module configured to acquire a plurality of mapping rules in response to a first character sequence selected and input on a screen; wherein the mapping rule comprises a second character sequence and a visual pattern associated with the second character sequence; a rule selection module configured to select a target rule from the plurality of mapping rules based on matching results between the first character sequence and the second character sequence in each of the mapping rules; a replacing and displaying module configured to replace and display a current cursor based on the visual pattern in the target rule.
9. An electronic device, comprising: at least comprising a memory and a processor coupled to each other, the memory storing at least program instructions, and the processor being configured to execute the program instructions to implement the input method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The program instructions capable of being run by the processor are stored, and the program instructions are configured to implement the input method according to any one of claims 1 to 7.