CN115494967A - Character input method, device, storage medium and electronic equipment - Google Patents
Character input method, device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN115494967A CN115494967A CN202211059252.2A CN202211059252A CN115494967A CN 115494967 A CN115494967 A CN 115494967A CN 202211059252 A CN202211059252 A CN 202211059252A CN 115494967 A CN115494967 A CN 115494967A
- Authority
- CN
- China
- Prior art keywords
- character
- input
- keyboard
- input interface
- click operation
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 238000012015 optical character recognition Methods 0.000 claims description 22
- 230000001960 triggered effect Effects 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 11
- 238000004088 simulation Methods 0.000 claims description 4
- 230000004044 response Effects 0.000 claims description 3
- 238000012360 testing method Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 5
- 238000002372 labelling Methods 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 238000003062 neural network model Methods 0.000 description 3
- 238000012545 processing Methods 0.000 description 3
- 238000013459 approach Methods 0.000 description 2
- 238000001514 detection method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/02—Input arrangements using manually operated switches, e.g. using keyboards or dials
- G06F3/023—Arrangements for converting discrete items of information into a coded form, e.g. arrangements for interpreting keyboard generated codes as alphanumeric codes, operand codes or instruction codes
- G06F3/0233—Character input methods
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/451—Execution arrangements for user interfaces
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Input From Keyboards Or The Like (AREA)
Abstract
The disclosure relates to a character input method, a character input device, a storage medium and an electronic device, which are used for reducing the difficulty of manual operation during character input. The method comprises the following steps: acquiring a first character input interface; when it is determined that a character key corresponding to a character to be input does not exist in a first keyboard of the first character input interface, triggering a simulated click operation on a target switching key in the first keyboard to obtain a second character input interface; and triggering the simulated click operation of the character keys corresponding to the characters to be input in a second keyboard, wherein the second keyboard is a keyboard in the second character input interface.
Description
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a character input method, device, storage medium, and electronic device.
Background
In a mobile device, in some password input scenarios, a software developer generally uses a dedicated security keyboard, and must click characters on the security keyboard to enter the password. Because the safety keyboard makes safety restriction, the difficulty of inputting characters through the safety keyboard is increased.
Disclosure of Invention
The invention aims to provide a character input method, a character input device, a storage medium and electronic equipment so as to improve the accuracy of keyboard character recognition.
In order to achieve the above object, in a first aspect, the present disclosure provides a character input method, the method comprising:
acquiring a first character input interface;
when it is determined that a character key corresponding to a character to be input does not exist in a first keyboard of the first character input interface, triggering simulated click operation on a target switching key in the first keyboard to obtain a second character input interface;
and triggering the simulated click operation of the character keys corresponding to the characters to be input in a second keyboard, wherein the second keyboard is a keyboard in the second character input interface.
Optionally, the method further comprises:
and when the character keys corresponding to the characters to be input exist in the first keyboard, triggering the simulated click operation of the character keys corresponding to the characters to be input in the first keyboard.
Optionally, the method further comprises:
and determining a target switching key corresponding to the character to be input according to the type of the character to be input.
Optionally, the method further comprises:
acquiring keyboard state information corresponding to the first keyboard;
and determining whether a character key corresponding to the character to be input exists in the first keyboard or not according to the keyboard state information.
Optionally, the method further comprises:
identifying the first character input interface through a pre-trained neural network model to obtain position information of a switching key in the first keyboard; or alternatively
Performing key marking on a first keyboard in the first character input interface, and determining position information of a switching key in the first keyboard according to a key marking result;
the triggering of the simulated click operation on the target switching key in the first keyboard comprises:
and triggering the simulated click operation of the target switching key in the first keyboard according to the position information of the target switching key in the first keyboard.
Optionally, the method further comprises:
determining an image of an area where the second keyboard is located from the second character input interface;
carrying out optical character recognition on the image of the area where the second keyboard is located to obtain an optical character recognition result;
obtaining character keys of the second keyboard and position information corresponding to the character keys according to the optical character recognition result;
the triggering of the simulated click operation on the character key corresponding to the character to be input in the second keyboard comprises:
and triggering the simulated click operation of the character keys corresponding to the characters to be input in the second keyboard according to the position information of the character keys corresponding to the characters to be input in the second keyboard.
Optionally, the character to be input is a character to be currently input in a character string to be input, and after the simulated click operation on the character to be input is triggered, the method further includes:
replacing the character to be input by using the next character in the character string to be input, which is adjacent to the character to be input, to obtain a new character to be input, and returning to the executing step: and acquiring a first character input interface until the simulation click operation of the last character in the character string to be input is triggered.
Optionally, the obtaining the first character input interface includes:
and acquiring the first character input interface in response to the preset script being called.
Optionally, the method further comprises:
acquiring a character string to be input, wherein the character to be input is a character to be currently input in the character string to be input;
taking the character string to be input as parameter information of the preset script, and writing the character string to be input into the preset script;
and calling the preset script.
In a second aspect, the present disclosure provides a character input device, the device comprising:
the acquisition module is used for acquiring a first character input interface;
the first simulated click module is used for triggering simulated click operation on a target switching key in a first keyboard when the first keyboard of the first character input interface is determined to have no character key corresponding to a character to be input so as to obtain a second character input interface;
and the second simulated click module is used for triggering simulated click operation on a character key corresponding to the character to be input in a second keyboard, and the second keyboard is a keyboard in the second character input interface.
In a third aspect, the present disclosure provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of the method of any one of the first aspects.
In a fourth aspect, the present disclosure provides an electronic device comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of the method of any one of the first aspect.
Through the technical scheme, after the first character input interface is obtained, when it is determined that the character key corresponding to the character to be input does not exist in the first keyboard of the first character input interface, the simulated click operation of the target switching key in the first keyboard is triggered to obtain the second character input interface, and then the simulated click operation of the character key corresponding to the character to be input in the second keyboard can be triggered to complete the input of the character to be input. Because the judgment can be automatically carried out according to the currently displayed first character input interface and the character to be input, the manual operation difficulty in character input can be reduced, and the universality is high.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow chart illustrating a method of character input according to an exemplary embodiment of the present disclosure;
FIG. 2 is a schematic diagram illustrating a security keyboard according to an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating another method of character input according to an exemplary embodiment of the present disclosure;
FIG. 4 is a flow chart illustrating another method of character input according to an exemplary embodiment of the present disclosure;
FIG. 5 is a block diagram illustrating a character input device according to an exemplary embodiment of the present disclosure;
fig. 6 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
The following detailed description of specific embodiments of the present disclosure is provided in connection with the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present disclosure, are given by way of illustration and explanation only, not limitation.
In Android, IOS and other mobile devices, in order to ensure the security and privacy of user input content and prevent passwords from being stolen in scenarios such as password input, providers or software development operators of the mobile devices generally pop up dedicated customized security keyboards. Compared with a common input method soft keyboard, the safety keyboard can effectively shield information leakage possibly caused by a third-party input method, and meanwhile, when a mobile phone is connected with a computer, information input by a user can be checked through an adb shell command getEvent or a password is directly input into an input box through an adb input.
However, the applicant found in long-term studies that the safety of the input is guaranteed after the restrictions are made, but the execution of the automatic test is also influenced.
For example, in some related art approaches, when a character string QWErt123 is input in the face of inputting different types of characters through a security keyboard, for example, in a scenario of verifying a login password input in an automated testing process, a script instruction may be set, an upper case character input script instruction is first set to input QWE (assuming that an initial default state of the security keyboard is an upper case state of an alphabetic keyboard), then a script instruction to switch to a lower case state keyboard is set, the upper case state keyboard is switched to a lower case state keyboard, then a lower case character input script instruction is set to input rt, then a numeric keypad switching script instruction is set to switch to a numeric keypad, and then a numeric character input script instruction is set to input 123, so that input of content to be input is completed through the above script instructions.
It can be seen that, in the above process, when switching between different types of characters, a new script instruction needs to be used, the number of script instructions in the character input process is increased, and the keyboard switching logic may renew the script instruction corresponding to the switching keyboard according to the difference of the password types at each time, and the process needs to manually make a judgment in advance and write the corresponding script switching instruction, still taking the input character string QWErt123 as an example, after writing the script instruction for inputting the QWE characters, it is necessary to manually judge the characters located after the QWE in the test, and judge the characters as lower case letter input, at this time, the script instruction for switching the input of a capital letter keyboard into a lower case letter keyboard is edited, and so on, each time the character type changes, the manual judgment in advance is needed, and the corresponding script instruction is written. Because a large amount of script instructions need to be edited manually and correspondingly aiming at each test, the universality of character input is not realized, the difficulty of automatic test is increased, and the efficiency of automatic test is reduced.
In view of the above, the present disclosure provides a character input method, device, storage medium and electronic device to reduce difficulty in inputting characters.
It should be noted that, in the above example, the password input is completed through a script instruction in the automatic test process as an example for description, but the manner of the embodiment of the present disclosure may also be applied to other character input scenarios, for example, a password simulation click scenario.
It should be noted that, in the embodiment of the present disclosure, in addition to performing character input in the form of a script instruction, character input may be completed by a program statement having the same function.
It should be noted that, in the embodiment of the present disclosure, besides being applied to character input in a secure keyboard, the present disclosure may also be applied to character input in other soft keyboards.
Referring to fig. 1, fig. 1 is a flowchart illustrating a character input method according to an exemplary embodiment of the present disclosure. The method is applied to an electronic device, and as shown in fig. 1, the character input method comprises the following steps:
s110, acquiring a first character input interface.
The first character input interface may be understood as an interface currently input through a keyboard, and the interface may include a keyboard and an input box. Illustratively, as shown in FIG. 2, a schematic diagram of two first character input interfaces is shown.
Alternatively, the keyboard may be a normal soft keyboard, or the keyboard may be a secure keyboard. The security keypad can be understood as: for non-system keyboards customized for security, secure keyboard information is generally not available using third party tools.
In the embodiment of the disclosure, the electronic device may obtain a screen display image of a currently displayed character input interface, where an interface corresponding to the image is the first character input interface.
In some embodiments, the screen display image may be captured by the electronic device by screen capturing the screen.
And S120, when it is determined that the character keys corresponding to the characters to be input do not exist in the first keyboard of the first character input interface, triggering the simulated click operation of the target switching keys in the first keyboard to obtain a second character input interface.
The first character input interface may include one or more keyboards, and the first keyboard may be understood as a keyboard for inputting a character to be input in the first character input interface.
The character to be input can be understood as the currently input character, and can also be acquired by the electronic device. For example, when a string of passwords is input, if a first password needs to be input currently, the character corresponding to the first password is the character to be input, or after the first password is input, a second password needs to be input currently, and the character corresponding to the second password becomes the character to be input.
In the embodiment of the disclosure, after the first character input interface is acquired, whether a character key corresponding to a character to be input exists in a first keyboard of the first character input interface may be determined.
If the first keyboard of the first character input interface does not have the character keys corresponding to the characters to be input, the characters to be input cannot be input through the current character input interface, and therefore the first keyboard of the current first character interface needs to be switched to obtain a second character input interface, wherein the second character input interface has the character keys corresponding to the characters to be input, and further, the characters to be input can be input by triggering the character keys corresponding to the characters to be input subsequently.
It will be appreciated that the first keyboard has been switched, and therefore the first character input interface has changed, resulting in a second character input interface. The second character input interface can be understood as a character input interface obtained after the first character input interface is switched by the keyboard.
If the first keyboard of the first character input interface has the character keys corresponding to the characters to be input, the characters to be input can be directly input through the current character input interface, at the moment, the first keyboard of the current first character interface is not required to be switched, and therefore the simulated click operation of the character keys corresponding to the characters to be input can be directly triggered in the first keyboard.
Exemplarily, with reference to fig. 2, taking the first character input interface as the first interface in fig. 2 as an example, assuming that the character to be input is Q, after the electronic device obtains the first character input interface and the character to be input, it may be determined that a character key corresponding to the character Q to be input does not exist in the first keyboard of the first character input interface, at this time, the electronic device may trigger a simulated click operation on a target switch key (for example, an upward arrow symbol) in the first keyboard, so as to obtain a second character input interface (not shown in fig. 2), where the second character input interface includes the character key Q.
And S130, triggering the simulated click operation of the character keys corresponding to the characters to be input in the second keyboard, wherein the second keyboard is the keyboard in the second character input interface.
In the embodiment of the disclosure, after switching to the second character input interface including the second keyboard, the electronic device may trigger a simulated click operation on a character key corresponding to a character to be input in the second keyboard, so as to complete input of the character to be input.
By adopting the method, after the first character input interface is obtained, the simulated click operation on the target switching key in the first keyboard can be further triggered when the character key corresponding to the character to be input does not exist in the first keyboard of the first character input interface, so that the second character input interface is obtained, and then the simulated click operation on the character key corresponding to the character to be input in the second keyboard can be triggered, so that the character to be input is input. Compared with the manual judgment and editing of the corresponding switching script instruction, the method has the advantages that the judgment can be automatically carried out according to the currently displayed first character input interface and the character to be input, the manual operation difficulty is reduced, and the method disclosed by the embodiment of the invention can be suitable for the switching among any different types of characters, so that the method has strong universality. When the method is used for the automatic test, the difficulty of the automatic test can be reduced, and the efficiency of the automatic test can be improved.
In some embodiments, the target switching key may be a general switching key, and the general switching key may be configured to switch among a plurality of keyboards according to a preset switching sequence, so that one or more simulated click operations on the general target switching key may be triggered until a second character input interface is obtained in which a character key corresponding to a character to be input exists.
In other embodiments, considering that a plurality of switching keys may be included in the keyboard, the method of the embodiment of the present disclosure further includes the following steps:
and determining a target switching key corresponding to the character to be input according to the type of the character to be input.
The type of the character to be input may include capital letter, lowercase letter, number, and the like.
For example, with reference to fig. 2, assuming that the characters to be input are numbers, the first keyboard is a lower case keyboard in the first character input interface in fig. 2, and at this time, the target switching key may be the switching key "123". For another example, assuming that the character to be input is a capital letter, in this case, the target switching key may be a capital switching key in the first character input interface in fig. 2, that is, a key corresponding to an upward arrow in the first character input interface in fig. 2.
Optionally, a corresponding relationship between the character type and the switching key may be pre-established, so that after the type of the character to be input is determined, the target switching key corresponding to the character to be input may be determined according to the pre-established corresponding relationship, and then, after the simulated click operation on the target switching key is triggered, the second character input interface including the character key corresponding to the character to be input may be obtained.
In some embodiments, the method of the embodiment of the present disclosure may further include a step of determining whether a character key corresponding to a character to be input exists in the first keyboard, that is, the method of the embodiment of the present disclosure may further include the following steps:
acquiring keyboard state information corresponding to a first keyboard;
and determining whether the first keyboard has character keys corresponding to the characters to be input according to the keyboard state information.
The keyboard state information may include state information such as a keyboard type, a keyboard case state, and the like.
In the embodiment of the present disclosure, after the keyboard state information corresponding to the first keyboard is acquired, whether a character key corresponding to a character to be input exists in the first keyboard may be determined according to the prestored keyboard state information and an association relationship between character keys.
For example, assuming that the keyboard state information represents that the first keyboard is an alphabetic keyboard and is in a lower case letter input state currently, at this time, the character keys included in the first keyboard may be acquired according to the keyboard state information, so that the character keys included in the first keyboard are compared with the characters to be input, and it may be determined that the character keys corresponding to the characters to be input do not exist in the first keyboard.
Or, when the keyboard state information includes character keys included in the keyboard, the character keys included in the first keyboard may be directly compared with the character to be input, so as to determine whether the character keys corresponding to the character to be input exist in the first keyboard.
In the embodiment of the disclosure, since the electronic device performs simulated clicking, the position information of the key to be clicked can be acquired, and thus the electronic device can trigger simulated clicking operation on the key according to the position information of the key.
In the embodiment of the present disclosure, the simulated click operation on the switching key and the simulated click operation on the character key are included, and therefore, the position information of the switching key and the position information of the character key need to be acquired.
In some embodiments, the manner of acquiring the position information of the switching key and the position information of the character key may be different.
Optionally, the method of the embodiment of the present disclosure may include the following steps of obtaining position information of a switching key in the first keyboard:
identifying the first character input interface through a pre-trained neural network model to obtain position information of a switching key in a first keyboard; or carrying out key marking on the first keyboard in the first character input interface, and determining the position information of the switching key in the first keyboard according to the result of the key marking.
The switching key in the first keyboard comprises a target switching key, and in this case, triggering a simulated click operation on the target switching key in the first keyboard may include the steps of: and triggering the simulated click operation of the target switching key in the first keyboard according to the position information of the target switching key in the first keyboard.
In the embodiment of the disclosure, the image of the area where the first keyboard is located in the first character input interface may be segmented through a pre-trained edge contour detection model, that is, the image of the area where the first keyboard is located is segmented from the screen display image through the detected contour of the keyboard image. Then, the pre-trained object recognition model can be continuously utilized to perform object recognition on the image of the area where the first keyboard is located, so that the switching key and the corresponding position information are obtained through recognition.
In the embodiment of the present disclosure, the key labeling may be performed on the first keyboard in the first character input interface, and then the position information of the switching key in the first keyboard is determined according to the result of the key labeling. Optionally, the key labeling may be labeling the keyboard and each switching key in the keyboard.
In this embodiment, in the case that the switching key in the first keyboard includes the target switching key, the simulated click operation on the target switching key in the first keyboard may be triggered according to the position information of the target switching key in the first keyboard.
Optionally, the method of the embodiment of the present disclosure may include the following steps of obtaining character keys and position information corresponding to the character keys in the second keyboard:
determining an image of an area where a second keyboard is located from a second character input interface;
performing optical character recognition on the image of the area where the second keyboard is located to obtain an optical character recognition result;
and obtaining the character keys of the second keyboard and the position information corresponding to the character keys according to the optical character recognition result.
In this case, triggering a simulated click operation on a character key corresponding to a character to be input in the second keyboard may include the steps of: and triggering the simulated click operation of the character keys corresponding to the characters to be input in the second keyboard according to the position information of the character keys corresponding to the characters to be input in the second keyboard.
In the embodiment of the present disclosure, the image of the area where the keyboard is located in the second character input interface may also be segmented by an edge contour detection method, that is, the image of the area where the second keyboard is located is segmented from the screen display image by the detected contour of the keyboard image.
After the image of the area where the second keyboard is located is obtained, the image of the area where the second keyboard is located can be subjected to optical character recognition processing through an optical character recognition technology, and therefore an optical character recognition result corresponding to the image of the area where the second keyboard is located is obtained.
Then, the character keys of the second keyboard and the position information corresponding to the character keys can be obtained according to the optical character recognition result.
The character keys of the second keyboard and the position information corresponding to the character keys can be obtained according to the optical character recognition result.
In some cases, if the optical character recognition result is accurate, the characters and the corresponding position information included in the optical character recognition result may be directly used as the corresponding character keys and the position information corresponding to the character keys.
In other cases, considering that the keyboard image is more disturbed and mostly has a single character, all characters in the keyboard cannot be completely and accurately recognized, in some embodiments, after the optical character recognition result is obtained, the optical character recognition result may be corrected, so that the characters and the corresponding position information included in the corrected optical character recognition result are used as the corresponding character keys and the position information corresponding to the character keys.
Then, in the embodiment of the present disclosure, the simulated click operation on the character key corresponding to the character to be input in the second keyboard may be triggered according to the position information of the character key corresponding to the character to be input in the second keyboard.
In combination with the foregoing, in some cases, when it is determined that the character key corresponding to the character to be input exists in the first keyboard, the simulated click operation on the character key corresponding to the character to be input in the first keyboard may be triggered, and at this time, the simulated click operation on the character key corresponding to the character to be input in the first keyboard may be triggered according to the position information of the character key corresponding to the character to be input in the first keyboard. The method for obtaining the character keys and the position information corresponding to the character keys in the first keyboard may refer to the method for obtaining the character keys and the position information corresponding to the character keys in the second keyboard, which is not described herein again.
As can be seen from the foregoing, the character input method according to the embodiment of the present disclosure may be applied to a character string input scenario such as password input, in which case, the character to be input may be a character to be currently input in the character string to be input. Therefore, referring to fig. 3, fig. 3 is a flowchart illustrating a character input method according to another exemplary embodiment of the present disclosure. The method is applied to an electronic device, and as shown in fig. 3, the character input method includes:
s310, acquiring a first character input interface.
S320, judging whether a character key corresponding to the character to be input exists in the first keyboard of the first character input interface.
If it is determined that the first keyboard has a character key corresponding to the character to be input, step S331 is executed, otherwise step S332 is executed.
And S331, when it is determined that the character keys corresponding to the characters to be input exist in the first keyboard, triggering a simulated click operation on the character keys corresponding to the characters to be input in the first keyboard.
S332, when it is determined that the character key corresponding to the character to be input does not exist in the first keyboard of the first character input interface, triggering the simulated click operation of the target switching key in the first keyboard to obtain a second character input interface.
And S333, triggering the simulated click operation of the character keys corresponding to the characters to be input in the second keyboard, wherein the second keyboard is the keyboard in the second character input interface.
The detailed descriptions of the steps S310, S320, S331, S332, and S333 may refer to the foregoing embodiments, and are not repeated herein.
S340, replacing the character to be input by using the next character adjacent to the character to be input in the character string to be input to obtain a new character to be input, and returning to the execution step: and acquiring a first character input interface until triggering the simulated click operation of the last character in the character string to be input.
It can be understood that after the simulated click operation of the character key corresponding to the character to be input in the first keyboard or the second keyboard is triggered, the input of the current character to be input in the character string to be input can be completed, and if the current character to be input is not the last character in the character string to be input, it indicates that the character string to be input is not completely input and the input needs to be continued. In order to continue inputting, in the embodiment of the present disclosure, a loop process may be performed, that is, replacing the character to be input with a subsequent character adjacent to the character to be input in the character string to be input to obtain a new character to be input, and returning to the step of: and acquiring a first character input interface until triggering the simulated click operation of the last character in the character string to be input.
For example, following the foregoing example, in the scenario of verifying the entry of the login password in the automatic test process, the default keyboard used is the first keyboard in fig. 2, that is, the state information of the keyboard is an alphabetic keyboard, and the input password is a lower case letter input, and the input password is QWErt123, at this time, the character string QWErt123 is the character string to be input.
Starting from inputting a first character Q, the electronic device may determine the character Q as a character to be input, and then the pointing device may determine that a character key corresponding to the character Q to be input does not exist in a first keyboard of the first character input interface, and trigger a simulated click operation on a target switching key corresponding to an uppercase in the first keyboard, that is, trigger a simulated click operation of switching the uppercase key, and then the electronic device may obtain a second character input interface.
The electronic device may determine the character W as a new character to be input, where the first case is that the keyboard is an instant keyboard, that is, after the keyboard is switched to a capital letter state keyboard and one click is completed, the keyboard is restored to a default keyboard, in this case, the electronic device may re-acquire the currently displayed interface as the first character input interface, determine that the first keyboard that acquires the first character input interface does not have a character key corresponding to the character W to be input, and re-trigger the simulated click operation on the target switch key corresponding to the capital letter in the first keyboard, and then the electronic device may obtain the second character input interface again, and then the electronic device may further trigger the simulated click operation on the character key W in the second keyboard, thereby completing the input of the character W.
The second is that the keyboard is a persistent keyboard, that is, after the keyboard is switched to the capital letter state and one click is completed, if the switching key is not triggered again, the keyboard keeps the capital letter state keyboard, in this case, the electronic device can also acquire the currently displayed interface again as the first character input interface, and determine that the first keyboard acquiring the first character input interface has the character key corresponding to the character W to be input, and then, the electronic device can further trigger the simulated click operation on the character key W in the first keyboard, thereby completing the input of the character W.
It should be noted that the input methods of the other characters E, r, t, 1, 2, and 3 in the character string to be input are the same as above, and are not described herein again, and the complete input of the character string to be input QWErt123 can be completed until the last character 3 is determined as a new character to be input and the simulated click operation on the character 3 is triggered.
It can be seen from the above embodiments that, in the embodiments of the present disclosure, even when inputting a character string composed of a plurality of different types of characters, there is no need to manually edit the switching logic according to the actual character string configuration, so as to reduce the difficulty of inputting the character, and because the present disclosure can be applied to inputting a character string composed of different types of characters, the present disclosure also improves the universality of character inputting, and at the same time, can also achieve the effect of inputting a character string to be input as an overall parameter of a character input program, thereby further improving the character inputting efficiency. For example, the mode of the embodiment of the present disclosure may use QWErt123 as an integral parameter of a character input program, whereas in the related art, only the same type of character may be used as an integral parameter, for example, QWE is used as a parameter of an upper case character input program segment, rt is used as a parameter of a lower case character input program segment, and 123 is used as a parameter of a numeric character input program segment.
In addition, the character input method according to the embodiment of the present disclosure may be performed by means of a script, and therefore, in some embodiments, please refer to fig. 4, and fig. 4 is a flowchart illustrating a character input method according to another exemplary embodiment of the present disclosure. The method is applied to an electronic device, and as shown in fig. 4, the character input method includes:
s410, obtaining a character string to be input, wherein the character to be input is the current character to be input in the character string to be input.
In the embodiment of the disclosure, the electronic device may respond to a character string input instruction of a user to acquire a character string to be input.
And S420, writing the character string to be input into the preset script as the parameter information of the preset script.
In the embodiment of the present disclosure, after the character string to be input is obtained, the character string to be input may be written in the preset script as the parameter information of the preset script. Illustratively, the character string QWErt123 is written into the preset script as an integral parameter of the preset script. Therefore, when the subsequent electronic equipment calls the preset script, the input of the character string QWERrt 123 can be executed.
And S430, calling a preset script.
S440, responding to the preset script being called, and acquiring a first character input interface.
In the embodiment of the disclosure, the electronic device may be called in response to a preset script to acquire the first character input interface.
For example, in the login scenario automation test process, the preset script may be automatically invoked after the user name input script is executed and the simulated click on the password input box is triggered.
S450, judging whether a character key corresponding to the character to be input exists in the first keyboard of the first character input interface.
S461, when it is determined that the first keyboard has a character key corresponding to the character to be input, triggering a simulated click operation on the character key corresponding to the character to be input in the first keyboard.
And S462, when it is determined that the character key corresponding to the character to be input does not exist in the first keyboard of the first character input interface, triggering the simulated click operation of the target switching key in the first keyboard to obtain a second character input interface.
S463, triggering a simulated click operation on a character key corresponding to a character to be input in a second keyboard, where the second keyboard is a keyboard in a second character input interface.
S470, replacing the character to be input by using the next character adjacent to the character to be input in the character string to be input to obtain a new character to be input, and returning to the execution step: and acquiring a first character input interface until triggering the simulated click operation of the last character in the character string to be input.
The detailed descriptions of the steps S450, S461, S462, S463 and S470 can refer to the foregoing embodiments, and are not repeated herein.
It will also be appreciated that for simplicity of explanation, the above-described method embodiments are all presented as a series of acts or combination of acts, but those skilled in the art will recognize that the present disclosure is not limited by the order of acts or combination of acts described above. Further, those skilled in the art will also appreciate that the embodiments described above are preferred embodiments and that the steps involved are not necessarily required for the present disclosure.
Based on the same concept, the present disclosure also provides a character input device, which may become a part or all of an electronic device by means of software, hardware, or a combination of both. Referring to fig. 5, the character input apparatus 500 may include:
an obtaining module 510, configured to obtain a first character input interface;
the first simulated click module 520 is configured to, when it is determined that a character key corresponding to a character to be input does not exist in a first keyboard of the first character input interface, trigger a simulated click operation on a target switch key in the first keyboard to obtain a second character input interface;
a second simulated click module 530, configured to trigger a simulated click operation on a character key corresponding to the character to be input in a second keyboard, where the second keyboard is a keyboard in the second character input interface.
Optionally, the apparatus 500 further comprises:
and the third simulated click module is used for triggering the simulated click operation on the character key corresponding to the character to be input in the first keyboard when the character key corresponding to the character to be input exists in the first keyboard.
Optionally, the apparatus 500 further comprises:
and the target switching key determining module is used for determining a target switching key corresponding to the character to be input according to the type of the character to be input.
Optionally, the apparatus 500 further comprises:
the keyboard state information acquisition module is used for acquiring the keyboard state information corresponding to the first keyboard;
and the determining module is used for determining whether a character key corresponding to the character to be input exists in the first keyboard according to the keyboard state information.
Optionally, the apparatus 500 further comprises:
the first position information determining module is used for identifying the first character input interface through a pre-trained neural network model to obtain position information of a switching key in the first keyboard;
and the second position information determining module is used for carrying out key marking on the first keyboard in the first character input interface and determining the position information of the switching key in the first keyboard according to the result of the key marking.
In this case, the first simulated clicking module 520 is further configured to trigger a simulated clicking operation on the target switching key in the first keyboard according to the position information of the target switching key in the first keyboard.
Optionally, the apparatus 500 further comprises:
the third position information determining module is used for determining an image of the area where the second keyboard is located from the second character input interface; carrying out optical character recognition on the image of the area where the second keyboard is located to obtain an optical character recognition result; and obtaining the character keys of the second keyboard and the position information corresponding to the character keys according to the optical character recognition result.
In this case, the second simulated clicking module 530 is further configured to trigger a simulated clicking operation on a character key corresponding to the character to be input in the second keyboard according to the position information of the character key corresponding to the character to be input in the second keyboard.
Optionally, the character to be input is a current character to be input in the character string to be input, and the apparatus 500 further includes:
and the circulation module is used for replacing the character to be input by using the next character adjacent to the character to be input in the character string to be input to obtain a new character to be input, and returning to the execution step: and acquiring a first character input interface until the simulation click operation of the last character in the character string to be input is triggered.
Optionally, the obtaining module 510 includes:
and the obtaining submodule is used for responding to the preset script to be called and obtaining the first character input interface.
Optionally, the apparatus 500 further comprises:
the device comprises a to-be-input character string acquisition module, a to-be-input character string acquisition module and a to-be-input character string acquisition module, wherein the to-be-input character string is a character to be currently input in the to-be-input character string;
the writing module is used for writing the character string to be input into the preset script as the parameter information of the preset script;
and the calling module is used for calling the preset script.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Based on the same inventive concept, the present disclosure also provides an electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of any of the character input methods described above.
In a possible approach, a block diagram of the electronic device may be as shown in fig. 6. Referring to fig. 6, the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input/output (I/O) interface 604, and a communications component 605.
The processor 601 is configured to control the overall operation of the electronic device 600, so as to complete all or part of the steps in the above-mentioned character input method. The memory 602 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 602 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically Erasable Programmable Read-Only Memory (EEPROM), erasable Programmable Read-Only Memory (EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 603 may include a screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 602 or transmitted through the communication component 605. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 604 provides an interface between the processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or one or a combination thereof, which is not limited herein. The corresponding communication component 605 may therefore include: wi-Fi modules, bluetooth modules, NFC modules, and the like.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the character input method described above.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the character input method described above. For example, the computer readable storage medium may be the memory 602 described above including program instructions that are executable by the processor 601 of the electronic device 600 to perform the character input method described above.
In another exemplary embodiment, a computer program product is also provided, which comprises a computer program executable by a programmable apparatus, the computer program having code portions for performing the character input method described above when executed by the programmable apparatus.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure.
It should be noted that, in the above embodiments, the various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various possible combinations will not be further described in the present disclosure.
In addition, any combination of various embodiments of the present disclosure may be made, and the same should be considered as the disclosure of the present disclosure as long as it does not depart from the gist of the present disclosure.
Claims (10)
1. A character input method, comprising:
acquiring a first character input interface;
when it is determined that a character key corresponding to a character to be input does not exist in a first keyboard of the first character input interface, triggering simulated click operation on a target switching key in the first keyboard to obtain a second character input interface;
and triggering the simulated click operation of the character keys corresponding to the characters to be input in a second keyboard, wherein the second keyboard is a keyboard in the second character input interface.
2. The method of claim 1, further comprising:
and when the character keys corresponding to the characters to be input exist in the first keyboard, triggering the simulated click operation of the character keys corresponding to the characters to be input in the first keyboard.
3. The method of claim 1, further comprising:
and determining a target switching key corresponding to the character to be input according to the type of the character to be input.
4. The method of claim 1, further comprising:
acquiring keyboard state information corresponding to the first keyboard;
and determining whether a character key corresponding to the character to be input exists in the first keyboard or not according to the keyboard state information.
5. The method of claim 1, further comprising:
determining an image of an area where the second keyboard is located from the second character input interface;
carrying out optical character recognition on the image of the area where the second keyboard is located to obtain an optical character recognition result;
obtaining character keys of the second keyboard and position information corresponding to the character keys according to the optical character recognition result;
the triggering of the simulated click operation on the character key corresponding to the character to be input in the second keyboard comprises the following steps:
and triggering the simulated click operation of the character keys corresponding to the characters to be input in the second keyboard according to the position information of the character keys corresponding to the characters to be input in the second keyboard.
6. The method according to any one of claims 1 to 5, wherein the character to be input is a character currently to be input in a character string to be input, and after the triggering of the simulated click operation on the character to be input, the method further comprises:
replacing the character to be input by using the next character in the character string to be input, which is adjacent to the character to be input, to obtain a new character to be input, and returning to the executing step: and acquiring a first character input interface until the simulation click operation of the last character in the character string to be input is triggered.
7. The method of any of claims 1-5, wherein obtaining the first character input interface comprises:
acquiring a character string to be input, wherein the character to be input is a character to be currently input in the character string to be input;
taking the character string to be input as parameter information of the preset script, and writing the character string to be input into the preset script;
calling the preset script;
and acquiring the first character input interface in response to the preset script being called.
8. A character input apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring a first character input interface;
the first simulated click module is used for triggering simulated click operation on a target switching key in a first keyboard when the first keyboard of the first character input interface is determined to have no character key corresponding to a character to be input so as to obtain a second character input interface;
and the second simulated click module is used for triggering simulated click operation on a character key corresponding to the character to be input in a second keyboard, and the second keyboard is a keyboard in the second character input interface.
9. A non-transitory computer readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to carry out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211059252.2A CN115494967A (en) | 2022-08-31 | 2022-08-31 | Character input method, device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211059252.2A CN115494967A (en) | 2022-08-31 | 2022-08-31 | Character input method, device, storage medium and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115494967A true CN115494967A (en) | 2022-12-20 |
Family
ID=84468424
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211059252.2A Pending CN115494967A (en) | 2022-08-31 | 2022-08-31 | Character input method, device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115494967A (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106293124A (en) * | 2016-08-05 | 2017-01-04 | 努比亚技术有限公司 | Input method switching device, terminal and method |
CN107479822A (en) * | 2017-09-08 | 2017-12-15 | 维沃移动通信有限公司 | A kind of data inputting method and terminal |
CN108009057A (en) * | 2017-11-14 | 2018-05-08 | 东软集团股份有限公司 | For the test method of Password Input, device, storage medium and electronic equipment |
CN109033772A (en) * | 2018-08-09 | 2018-12-18 | 北京云测信息技术有限公司 | A kind of input method and device of verification information |
CN110795019A (en) * | 2019-10-23 | 2020-02-14 | 腾讯科技(深圳)有限公司 | Key identification method and device of soft keyboard and storage medium |
-
2022
- 2022-08-31 CN CN202211059252.2A patent/CN115494967A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106293124A (en) * | 2016-08-05 | 2017-01-04 | 努比亚技术有限公司 | Input method switching device, terminal and method |
CN107479822A (en) * | 2017-09-08 | 2017-12-15 | 维沃移动通信有限公司 | A kind of data inputting method and terminal |
CN108009057A (en) * | 2017-11-14 | 2018-05-08 | 东软集团股份有限公司 | For the test method of Password Input, device, storage medium and electronic equipment |
CN109033772A (en) * | 2018-08-09 | 2018-12-18 | 北京云测信息技术有限公司 | A kind of input method and device of verification information |
CN110795019A (en) * | 2019-10-23 | 2020-02-14 | 腾讯科技(深圳)有限公司 | Key identification method and device of soft keyboard and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20190227917A1 (en) | Adaptive system for mobile device testing | |
US10075430B2 (en) | Method and system for efficient password input | |
CN115982024A (en) | Test script generation method, test script generation device, storage medium, and program product | |
CN112597051A (en) | Method and device for obtaining test result, electronic equipment and storage medium | |
CN105809019A (en) | Method and device for Android terminal to start input method keyboard | |
CN107562500B (en) | Debugging device, method and equipment | |
CN113138888A (en) | Function detection method and device, electronic equipment and storage medium | |
CN108037912A (en) | Show the method, apparatus of page info | |
CN111026651B (en) | Test method, device, storage medium and electronic equipment | |
CN109753217B (en) | Dynamic keyboard operation method and device, storage medium and electronic equipment | |
CN109977692B (en) | Data processing method and device, storage medium and electronic equipment | |
CN108009057B (en) | Test method and device for password input, storage medium and electronic equipment | |
CN115494967A (en) | Character input method, device, storage medium and electronic equipment | |
CN109376085B (en) | Test case generation method and device and computer readable storage medium | |
CN111221723B (en) | Test record generation method and device, storage medium and electronic equipment | |
CN116302726A (en) | Test method and device of computing equipment, electronic equipment and storage medium | |
CN112383661B (en) | Mobile terminal automatic test method and device, electronic equipment and storage medium | |
CN115357829A (en) | Method and device for exposing and burying point of page control and storage medium | |
CN106533841A (en) | Method, apparatus and system for testing protocol consistency of user identification module cards | |
CN114564206A (en) | Data non-empty checking method, device, equipment and readable storage medium | |
CN114661606A (en) | Program debugging method and device, electronic equipment and storage medium | |
CN112214404A (en) | Mobile application testing method and device, storage medium and electronic equipment | |
CN113590107A (en) | Construction method of application program template, equipment and storage medium thereof | |
CN113849415A (en) | Control testing method and device, storage medium and electronic equipment | |
CN108132782B (en) | Automatic programming device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |