Secure text input method and device, electronic equipment and storage medium

By setting up a preset API service in the first system of the terminal, data transmission between the target input box of the first system and the input method of the second system is realized, an input interface that meets the requirements of the target input box is generated and the target text is sent, which solves the problem of user incompatibility caused by different system input methods and provides a secure text input solution.

CN121579239APending Publication Date: 2026-02-27PRANUS BEIJING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511775412.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-27

AI Technical Summary

Technical Problem

When two systems are installed on the same terminal, the input method styles and input habits of the different systems are different, resulting in a poor user experience.

Method used

By setting up a preset API service in the first system, data transmission between the target input box of the first system and the input method of the second system is realized, allowing the input method of the second system to generate an input interface that meets the requirements of the target input box and send the target text entered by the user to the target input box of the first system.

Benefits of technology

It eliminates the need for users to manually switch input methods, enabling text input through the input method of the second system within the first system's applications. This solves the problem of user incompatibility caused by different operating habits of different input methods, and supports encryption to ensure information security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579239A_ABST
    Figure CN121579239A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a secure text input method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: calling a preset API service to obtain a displayable character format of a target input box; sending the character format to a first input method program of a second system to enable the first input method program to generate an input interface based on the character format; displaying a target text represented by the first character on an input interface; and sending the target text to a preset API service, and calling the preset API service to display the target text in the target input box. According to the method, data transmission between the target input box in the first system and the input method in the second system is carried out through the preset API service, so that a user can carry out text input through the input method of the second system when needing to carry out text input on the target input box of the application program of the first system, the user does not need to switch the input method, and the user experience is improved. And the problem of user inadaptation caused by different operation habits of different input methods is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a secure text input method, apparatus, electronic device, and storage medium. Background Technology

[0002] Applications are an essential part of a terminal. However, some applications are selective in terms of system compatibility, meaning they can only run on specific systems. If only one system is installed on the terminal, then some applications cannot be used. Therefore, many users are accustomed to installing two systems on one terminal.

[0003] For two systems installed on the same terminal, the other system can be run simultaneously by creating an isolated environment in one of the running systems, thus avoiding system switching. In this way, each system can only use the input method installed on its own system. However, the style framework and input habits of the input methods of different systems are different, which may cause confusion for the user experience. Summary of the Invention

[0004] The purpose of this application is to at least solve one of the aforementioned technical defects. The technical solution provided by the embodiments of this application is as follows: In a first aspect, embodiments of this application provide a secure text input method applied to a terminal, wherein the terminal simultaneously runs a first system and a second system, the first system running in an isolated environment created by the second system, the method comprising: In response to a trigger operation on the target input box in the first interface, a preset API service is called to obtain the character format that the target input box can display. The first interface is the interface displayed by the application installed on the first system. The character format is sent to the first input method program of the second system so that the first input method program generates and displays an input interface based on the character format. The input interface includes multiple first characters that conform to the character format. In response to a selection operation on at least one first character in the input interface, the target text represented by the first character is displayed in the input interface; Send the target text to the preset API service, and call the preset API service to display the target text in the target input box.

[0005] Secondly, embodiments of this application provide a secure text input device, including: The format acquisition module is used to respond to the trigger operation of the target input box in the first interface, call the preset API service to obtain the character format that the target input box can display, and the first interface is the interface displayed by the application installed on the first system; The input interface display module is used to send the character format to the first input method program of the second system, so that the first input method program can generate and display the input interface based on the character format. The input interface includes multiple first characters that conform to the character format. A character selection module is used to display the target text represented by the first character on the input interface in response to a selection operation for at least one first character in the input interface. The target text display module is used to send the target text to a preset API service and call the preset API service to display the target text in the target input box.

[0006] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory; The processor executes a computer program to implement the method provided in the first aspect embodiment or any alternative embodiment of the first aspect.

[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method provided in the first aspect embodiment or any optional embodiment of the first aspect.

[0008] The beneficial effects of the technical solutions provided in this application are: First, in this embodiment of the application, when a user triggers a target input box on a certain interface of an application running in the first system in the isolated environment, the character format required by the target input box of the first system can be sent to the input method program of the second system running in the foreground of the current terminal through the API service. After receiving the character format, the input method program of the second system can generate a relevant input interface, which can ensure that the characters entered by the input method of the second system meet the requirements of the target input box.

[0009] Secondly, in the solution of this application embodiment, the input method of the second system can send the target text that the user wants to input to the target input box of the application in the first system through the API service, so that the target input box can display the target text, that is, the purpose of inputting text into the target input box through the input method of the second system is achieved.

[0010] The solution provided in this application embodiment sets a preset API service in the first system, and then uses the preset API service to transmit data between the target input box in the first system and the input method in the second system. This allows users to input text in the target input box of the application in the first system as well as through the input method in the second system. The above method does not require users to switch input methods, thus avoiding the problem of user incompatibility caused by different operating habits of different input methods. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below.

[0012] Figure 1 A flowchart illustrating a secure text input method provided in an embodiment of this application; Figure 2 This is a schematic diagram of the overall structure and flow of a secure text input method in one example of an embodiment of this application; Figure 3 A structural block diagram of a secure text input device provided in this application embodiment; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The embodiments of this application are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions of the embodiments of this application.

[0014] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this application mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element establish a connection relationship through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” can be implemented as “A,” or as “B,” or as “A and B.”

[0015] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0016] The technical solutions of this application and their effects are described below through several exemplary embodiments. It should be noted that the following embodiments can be referenced, borrowed from, or combined with each other. Identical terms, similar features, and similar implementation steps in different embodiments will not be repeated.

[0017] Figure 1 This application provides a flowchart illustrating a secure text input method according to an embodiment. The execution subject of this method can be a terminal (e.g., a computer, mobile phone, etc.) or an intelligent agent, such as... Figure 1 As shown, the method may include: Step S101: In response to the trigger operation on the target input box in the first interface, the preset API service is called to obtain the character format that the target input box can display. The first interface is the interface displayed by the application installed on the first system.

[0018] In the embodiments of this application, the first system can be a system that is "abnormally" running on the terminal. Generally, a terminal can install multiple systems, but only one system can run normally in the foreground at any given time. To run multiple systems simultaneously, the usual approach is to create an isolated environment (such as a virtual machine) for one system running normally in the foreground, and then run another system in this isolated environment. The first system in the embodiments of this application is the system running in the isolated environment. The first interface can be the interface displayed on the terminal screen when browsing an application. In the embodiments of this application, the "interface" can be composed of multiple views, and a view is the basic building block of the interface. It occupies a rectangular area on the screen and is responsible for drawing and event handling. It can be understood as the "atoms" of the interface world. Everything seen on the screen, from a button and a piece of text to a complex layout, is ultimately composed of views. The target input box can be the "view" part where the user needs to input, such as a search box. The character format can be the text content that can be entered specified by the target input box. For example, some input boxes can allow any character, while some input boxes can only allow letters and numbers, etc. Triggering an action can also be called "gaining focus". Gaining focus refers to the state in which a view is currently marked by the system as ready to receive user input, such as the user's "click" operation on a view on the terminal display screen.

[0019] Specifically, when a user runs an application of the first system on a terminal, the terminal will display multiple first interfaces of the application in real time. Some of the first interfaces provide target input boxes for the user to input (such as search boxes, account information input boxes, etc.). When the user enters text into a target input box, he / she can click on the target input box on the terminal's display screen. At this time, the system responds to the operation and calls the preset API (Application Programming Interface) service set in the first system. The preset API service will obtain the character format allowed to be entered in the target input box.

[0020] Step S102: The character format is sent to the first input method program of the second system so that the first input method program generates and displays an input interface based on the character format. The input interface includes multiple first characters that conform to the character format.

[0021] In the embodiments of this application, the second system can be a system running in the foreground of a terminal, which can create an isolated environment to run the first system simultaneously. The first input method program can be the input method used by the second system, and the embodiments of this application also include a second input method for the first system. The two input methods are adapted to their respective systems. Generally, each system can only use its own input method. The input interface can be an interface where the user selects the text content to be entered. The first character can be an element used to constitute the text displayed in the target input box. For example, when Chinese characters or English words need to be entered in the target input box, the first character can be an English letter, and when a string of numbers needs to be entered in the target input box, the first character can be the numbers 0-9.

[0022] Specifically, after obtaining the character format allowed in the target input box, the character format can be sent to the first input method program of the second system. At this time, the second input method of the first system itself no longer responds. The first input method of the second system generates and displays the corresponding input interface according to the character format. Since the input interface includes multiple selectable first characters, the user can click on the corresponding first character in the input interface to select the text content they want to input, and thus obtain the text content they want to input.

[0023] Step S103: In response to a selection operation for at least one first character in the input interface, display the target text represented by the first character in the input interface.

[0024] In the embodiments of this application, the target text is generally the text content that the user wants to input. However, in some cases, it may be a partial modification of the text content that the user wants to input, which will be further explained in subsequent embodiments.

[0025] Specifically, when the user selects the first character in the input interface, the input interface can generate a corresponding target text. For example, when the user selects the English letter characters "y" and "i", the Chinese character "一" (i.e., the target text) can be generated on the input interface.

[0026] Step S104: Send the target text to a preset API service, and call the preset API service to display the target text in the target input box.

[0027] Specifically, after determining the target text, the target text can be sent to a preset API service, and then the preset API service can display the target text in the target input box of the second system.

[0028] For the solution provided by the embodiment of the present application, first, when it is detected that the user triggers an operation on the target input box of a certain interface of an application in the first system running in an isolated environment, the character format required by the target input box of the first system can be sent to the input method program of the second system running foreground on the current terminal through an API service. After receiving the character format, the input method program of the second system can generate a relevant input interface, which can ensure that the characters input by the input method of the second system meet the requirements of the target input box.

[0029] Secondly, in the solution of the embodiment of the present application, the input method of the second system can send the target text that the user wants to input to the target input box of the application in the first system through the API service, so that the target input box can display the target text, that is, the purpose of inputting text into the target input box through the input method of the second system is realized.

[0030] For the solution provided by the embodiment of the present application, by setting a preset API service in the first system, and then performing data transmission between the target input box in the first system and the input method of the second system through the preset API service, when the user needs to input text into the target input box of the application in the first system, the user can also input text through the input method of the second system. The above method does not require the user to switch the input method, avoiding the problem that the user is not adapted due to different operation habits of different input methods.

[0031] Based on the above embodiments, as an optional embodiment, after calling the preset API service to obtain the character format that can be displayed by the target input box and sending the character format to the first input method program of the second system, it further specifically includes: Call the preset API service to obtain the interface attributes of the first interface; The interface attributes are sent to the first input method program so that the first input method program can determine the encryption level of the first interface based on the interface attributes, and encrypt the target text based on the encryption level before displaying the target text.

[0032] In the embodiments of this application, the interface attributes may include relevant information about the application to which the first interface belongs, such as the application's package name, version number, signature information, whether it is in the system's whitelist, etc. They may also include relevant attributes set by the first interface itself, such as whether a separate encryption level is set for the first interface, etc. This embodiment of the application does not limit these attributes. The encryption level can be used to characterize the privacy level of the first interface. In the scheme of this embodiment, the higher the encryption level, the higher the privacy level of the first interface, and the more content needs to be encrypted.

[0033] Specifically, after calling the preset API service to obtain the character format of the target input box, it is necessary to obtain the interface attributes of the first interface to determine whether the interface needs to process some text containing privacy information. After obtaining the interface attributes, these attributes can be sent to the first input method program. The first input method program will determine the encryption level of the first interface based on the interface attributes. When the user selects the target text, the target text can be encrypted according to the encryption level, and then the encrypted target text will be displayed in the target input box. This ensures that some privacy-related content will not be obtained by third parties, further guaranteeing information security.

[0034] Optionally, an "encryption level threshold" can also be set in this embodiment. The purpose of setting the threshold is to encrypt the target text of the target input box of the first interface that is higher than the threshold, and not encrypt the target text of the target input box of the first interface that is not higher than the threshold, so as to make the encryption process more flexible.

[0035] Based on the above embodiments, as an optional embodiment, the first input method program encrypts the target text based on the encryption level in the following manner: The first input method program obtains the corresponding encryption method based on the encryption level of the first interface and determines the characters to be encrypted in the target text; The character to be encrypted is encrypted using an encryption method, and then the character to be encrypted is replaced with the encrypted character.

[0036] In the embodiments of this application, the encryption method may be to encrypt using an encryption algorithm (such as DES (Data Encryption Standard, a symmetric encryption algorithm)); or it may be to convert a portion of the second character in the target text (i.e., the characters in the target text, for example, when the target text is "first", the second character may be "the" and "one"). The conversion method may be to replace it with other characters or to delete it directly, etc., which is not limited in the embodiments of this application; or it may be to change the target text into an abbreviation (for example, to abbreviate "Application" to "APP"), etc.

[0037] Specifically, after the first input method program obtains the encryption level of the first interface, it needs to determine the corresponding encryption method based on the encryption level. Generally speaking, the higher the encryption level, the more complex the encryption process. It also determines the characters to be encrypted in the target text. Understandably, the higher the encryption level, the more characters need to be replaced. After determining the characters to be encrypted, this part of the characters can be encrypted using the determined encryption method. Then, the encrypted characters replace the original corresponding characters for display in the target input box.

[0038] Based on the above embodiments, as an optional embodiment, the encryption level of the first interface is obtained by calling a preset API service, specifically including: If the first encryption level for the first interface is obtained, then the encryption level of the first interface is determined to be the first encryption level. If the second encryption level for the application is obtained but the first encryption level is not obtained, then the encryption level of the first interface is determined to be the second encryption level. If the first and second encryption levels are not obtained, the encryption level of the first interface is determined to be the third encryption level for the second system.

[0039] Specifically, in this embodiment, users can set the required encryption level for each interface, application, and system according to their own needs. Different types of objects have a certain priority relationship when determining the encryption level of the interface. Specifically, the encryption level set by the interface itself > the encryption level of the application to which the interface belongs > the encryption level of the system to which the application belongs. That is, when the first interface itself has a first encryption level, since the encryption level set by the interface itself has the highest priority, the first encryption level can be directly used as the encryption level of the first interface. When the first interface itself does not have a first encryption level, it will first check whether the application to which it belongs has a second encryption level. If the application to which it belongs has a second encryption level, then the second encryption level of the application will be used as the encryption level of the first interface. When the first interface itself does not have a first encryption level and the application to which it belongs does not have a second encryption level, then the third encryption level of the first system to which the application belongs will be directly determined as the encryption level of the first interface.

[0040] Optionally, in this application embodiment, the encryption level can be set directly, or it can be obtained by comprehensively evaluating certain other settings after presetting them. For example, it can detect whether there are sensitive characters in the application package name, whether the application is in the whitelist, whether the version number of the application or the first system is the latest, etc. This application embodiment does not limit this.

[0041] Based on the above embodiments, as an optional embodiment, sending the character format to the first input method program of the second system specifically includes: The character format is sent to the first input method program through the first channel using the domain socket mechanism; Sending the target text to the API default service includes: The target text is sent to the API default service via the second channel using the domain socket mechanism; Both the first and second channels are created when a trigger operation targeting the target input box is first detected.

[0042] In the embodiments of this application, both the first and second channels can be implemented using the Unix Domain Socket mechanism, a mechanism for inter-process communication on the same terminal. Its key difference from network sockets is that it does not go through a network protocol stack, but instead exchanges data directly within the kernel via the file system or an abstract namespace. This makes it highly efficient, with lower latency and less overhead.

[0043] For example, in the Android system (i.e., the first system in this application), Domain Socket is widely used within the system, such as for communication between the application and system services (e.g., Zygote, a service name).

[0044] The core advantages of Domain Socket in Android include, but are not limited to, the following: 1. High performance: It avoids the overhead of network protocol stack such as packing, unpacking, and verification, resulting in faster data transmission speed.

[0045] 2. Low latency: The shorter the communication path, the lower the latency.

[0046] 3. Security: Access can be easily controlled using file system permissions (e.g., specifying that only a certain user or group can access the socket file). This is especially important in Android's SELinux (an operating environment) environment.

[0047] 4. No network permission required: Inter-process communication does not require requesting INTERNET (network) permission.

[0048] Specifically, in this embodiment, the transmission and communication between the preset API service and the first input method is achieved through a first channel and a second channel. The first channel is specifically responsible for the preset API service sending interface-related information such as the character format and interface attributes of the first interface to the first input method program, while the second channel is specifically responsible for the first input method program sending the target text to be displayed to the preset API service. The two channels are usually established when an operation on any input box is first triggered in the first interface. After establishment, if the user continues to interact in the first interface, the two channels will remain established so that they can respond to the target text selected by the user more quickly in the future.

[0049] Optionally, in this embodiment of the application, when establishing the first channel and the second channel, as an alternative, only one total channel containing the functions of the two channels can be established. However, compared to this separate approach, establishing two channels can separate data that controls "character format and encryption level information" which is more focused on functional settings from data that controls "target text" which is more focused on actual content. This facilitates subsequent detection and analysis of terminal functions and can also avoid potential blocking when there is a lot of data.

[0050] Based on the above embodiments, as an optional embodiment, the method further includes: When a trigger operation is detected that jumps from the first interface to the second interface, the first channel and the second channel are destroyed.

[0051] Specifically, when a trigger operation for jumping from the first interface to the second interface is detected, it can be considered that the user temporarily does not need to input text in the target input box on the first interface. Therefore, in order to save resources, the first channel and the second channel created on the first interface can be destroyed. When the user jumps back to the first interface again and triggers an operation on the target input box on the first interface later, the first channel and the second channel can be re-created.

[0052] Based on the above various embodiments, as an optional embodiment, displaying the target text represented by the first character on the input interface specifically includes: Constructing and displaying at least one candidate text based on the selected first character; wherein, the at least one candidate text includes the target text; In response to a selection operation on any one of the at least one candidate texts, determining the selected text as the target text and displaying it on the input interface.

[0053] In the embodiments of the present application, the candidate text can be multiple texts that may meet the user's input requirements and are composed of the selected first character. For example, when the first characters selected by the user are "y" and "u", the multiple candidate texts that appear on the input interface can be Chinese characters corresponding to the pinyin "yu" (such as "与", "于", "域"...), and the target text that the user actually needs to input is one of these candidate texts. After displaying multiple candidate texts, the user can click on one of the texts to be input on the input interface, and then that text will be determined as the target text.

[0054] Next, in conjunction with Figure 2 a brief introduction to the overall process of the secure text input method provided by the embodiments of the present application will be given, as Figure 2 shown: First, both the first system and the second system have been started and run on the same terminal, and the first system runs in an isolated environment created by the second system. At this time, the user is running an application installed in the first system, and a certain first interface (there can be multiple first interfaces, specifically, it can be jumped from one first interface to the first interface according to the user's operation) during the operation of the application will be displayed on the display screen of the terminal, and there is one or more target input boxes in the first interface for the user to input corresponding text.

[0055] When a user clicks the target input box, the pre-established API service in the first system will listen for the click and establish a first channel and a second channel with the first input method in the second system. The first channel is used by the first input method to transmit the target text to be displayed in the target input box (usually, this target text is the user's original text, but in cases where encryption is required, it may be the result of converting the original text). The second channel is used by the pre-established API service to send the character format set in the current target input box (some target input boxes can accept any character, including text, letters, symbols, etc., while others can only accept letters or numbers, etc.) to the first input method so that the first input method can display the corresponding input interface for the user to input, which includes multiple first characters that conform to the character format.

[0056] Next, the user can select any number of first characters in the input interface to input the target text. Each time the user selects a certain number of first characters, at least one corresponding candidate text will be displayed on the sub-interface (for example, if the user inputs multiple letters, the corresponding pinyin characters will be displayed). Then, the user selects the target text from the candidate text. At this point, the first input method determines the encryption level corresponding to the interface and then determines whether the target text needs to be encrypted and the specific encryption method based on the encryption level. If no encryption is required, the target text is directly displayed in the target input box; if encryption is required, the target text is encrypted using the determined encryption method before the encrypted text is displayed. Through this method, text input using the first input method can be achieved in the target input box of the first system application.

[0057] Figure 3 A structural block diagram of a secure text input device provided in this application embodiment is shown below. Figure 3 As shown, the secure text input device 300 may include: a format acquisition module 301, an input interface display module 302, a character selection module 303, and a target text display module 304, wherein, The format acquisition module 301 is used to respond to the trigger operation of the target input box in the first interface, call the preset API service to obtain the character format that the target input box can display, and the first interface is the interface displayed by the application installed on the first system; The input interface display module 302 is used to send the character format to the first input method program of the second system, so that the first input method program generates and displays the input interface based on the character format. The input interface includes multiple first characters that conform to the character format. The character selection module 303 is used to display the target text represented by the first character on the input interface in response to a selection operation for at least one first character in the input interface; The target text display module 304 is used to send the target text to a preset API service and call the preset API service to display the target text in the target input box.

[0058] The solution provided in this application embodiment is as follows: First, when a user triggers an operation on a target input box of an application in a first system running in an isolated environment, the character format required by the target input box of the first system can be sent to the input method program of the second system running in the foreground of the current terminal through an API service. After receiving the character format, the input method program of the second system can generate a relevant input interface, which can ensure that the characters entered by the input method of the second system meet the requirements of the target input box.

[0059] Secondly, in the solution of this application embodiment, the input method of the second system can send the target text that the user wants to input to the target input box of the application in the first system through the API service, so that the target input box can display the target text, that is, the purpose of inputting text into the target input box through the input method of the second system is achieved.

[0060] The solution provided in this application embodiment sets a preset API service in the first system, and then uses the preset API service to transmit data between the target input box in the first system and the input method in the second system. This allows users to input text in the target input box of the application in the first system as well as through the input method in the second system. The above method does not require users to switch input methods, thus avoiding the problem of user incompatibility caused by different operating habits of different input methods.

[0061] Based on the above embodiments, as an optional embodiment, the device further includes an encryption level determination module, specifically used for: Call the preset API service to obtain the interface attributes of the first interface; The interface attributes are sent to the first input method program so that the first input method program can determine the encryption level of the first interface based on the interface attributes, and encrypt the target text based on the encryption level before displaying the target text.

[0062] Based on the above embodiments, as an optional embodiment, the device further includes a text encryption module, specifically used for: The first input method program obtains the corresponding encryption method based on the encryption level of the first interface and determines the characters to be encrypted in the target text; The character to be encrypted is encrypted using an encryption method, and then the character to be encrypted is replaced with the encrypted character.

[0063] Based on the above embodiments, as an optional embodiment, the encryption level determination module is further configured to: If the first encryption level for the first interface is obtained, then the encryption level of the first interface is determined to be the first encryption level. If the second encryption level for the application is obtained but the first encryption level is not obtained, then the encryption level of the first interface is determined to be the second encryption level. If the first and second encryption levels are not obtained, the encryption level of the first interface is determined to be the third encryption level for the second system.

[0064] Based on the above embodiments, as an optional embodiment, the input interface display module is further used for: The character format is sent to the first input method program through the first channel using the domain socket mechanism; The target text display module is further used for: The target text is sent to the API default service via the second channel using the domain socket mechanism; Both the first and second channels are created when a trigger operation targeting the target input box is first detected.

[0065] Based on the above embodiments, as an optional embodiment, the device further includes a channel destruction module, specifically used for: When a trigger operation is detected that jumps from the first interface to the second interface, the first channel and the second channel are destroyed.

[0066] Based on the above embodiments, as an optional embodiment, the target text display module is further used for: Construct and display at least one candidate text based on the selected first character; wherein the at least one candidate text includes the target text; In response to a selection operation for any one of the candidate texts, the selected text is identified as the target text and displayed in the input interface.

[0067] The following is for reference. Figure 4 It illustrates an electronic device suitable for implementing embodiments of this application (e.g., performing...). Figure 1The diagram shows the structure of the terminal device or server 400 of the method shown. The electronic devices in the embodiments of this application may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable devices, etc., as well as fixed terminals such as digital TVs, desktop computers, etc. Figure 4 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0068] The electronic device includes a memory and a processor. The memory stores a program for executing the methods described in the above-described method embodiments; the processor is configured to execute the program stored in the memory. The processor may be referred to as processing device 401 as described below, and the memory may include at least one of read-only memory (ROM) 402, random access memory (RAM) 403, and storage device 408 as described below, as follows: like Figure 4 As shown, electronic device 400 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 401, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 402 or a program loaded from storage device 408 into random access memory (RAM) 403. RAM 403 also stores various programs and data required for the operation of electronic device 400. Processing device 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.

[0069] Typically, the following devices can be connected to I / O interface 405: input devices 406 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 407 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 408 including, for example, magnetic tapes, hard disks, etc.; and communication devices 409. Communication device 409 allows electronic device 400 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 4 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.

[0070] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 409, or installed from storage device 408, or installed from ROM 402. When the computer program is executed by processing device 401, it performs the functions defined in the methods of embodiments of this application.

[0071] It should be noted that the computer-readable storage medium described above in this application can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0072] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0073] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0074] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: In response to a trigger operation on a target input box in the first interface, a preset API service is invoked to obtain the character format that the target input box can display. The first interface is the interface displayed by an application installed on the first system. The character format is sent to a first input method program in the second system so that the first input method program generates and displays an input interface based on the character format. The input interface includes multiple first characters that conform to the character format. In response to a selection operation on at least one first character in the input interface, the target text represented by the first character is displayed in the input interface. The target text is sent to a preset API service, and the preset API service is invoked to display the target text in the target input box.

[0075] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0076] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0077] The modules or units described in the embodiments of this application can be implemented in software or hardware. The names of modules or units do not necessarily limit the specific unit; for example, a first constraint acquisition module can also be described as a "module for acquiring the first constraint".

[0078] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0079] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0080] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0081] The above description is only a partial embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A secure text input method, characterized in that, Applied to a terminal, wherein the terminal simultaneously runs a first system and a second system, the first system running in an isolated environment created by the second system, the method includes: In response to a trigger operation on a target input box in the first interface, a preset API service is invoked to obtain the character format that the target input box can display. The first interface is the interface displayed by an application installed on the first system. The character format is sent to the first input method program of the second system, so that the first input method program generates and displays an input interface based on the character format, the input interface including a plurality of first characters conforming to the character format; In response to a selection operation for at least one first character in the input interface, the target text represented by the first character is displayed in the input interface; The target text is sent to the preset API service, and the preset API service is invoked to display the target text in the target input box.

2. The method according to claim 1, characterized in that, After calling a preset API service to obtain the character format that the target input box can display, and sending the character format to the first input method program of the second system, the method further includes: Call the preset API service to obtain the interface attributes of the first interface; The interface attributes are sent to the first input method program so that the first input method program determines the encryption level of the first interface based on the interface attributes, and encrypts the target text based on the encryption level before displaying the target text.

3. The method according to claim 2, characterized in that, The first input method program encrypts the target text based on the encryption level in the following way: The first input method program obtains the corresponding encryption method based on the encryption level of the first interface and determines the characters to be encrypted in the target text; The character to be encrypted is encrypted using the encryption method described above, and then the character to be encrypted is replaced with the encrypted character.

4. The method according to claim 3, characterized in that, The step of calling the preset API service to obtain the encryption level of the first interface includes: If the first encryption level for the first interface is obtained, then the encryption level of the first interface is determined to be the first encryption level. If a second encryption level for the application is obtained but the first encryption level is not obtained, then the encryption level of the first interface is determined to be the second encryption level. If the first encryption level and the second encryption level are not obtained, then the encryption level of the first interface is determined to be the third encryption level for the second system.

5. The method according to claim 1, wherein sending the character format to the first input method program of the second system comprises: The character format is sent to the first input method program via the first channel using a domain socket mechanism; Sending the target text to the API preset service includes: The target text is sent to the API preset service via the second channel using a domain socket mechanism; Both the first channel and the second channel are created when a trigger operation targeting the target input box is first detected.

6. The method according to claim 5, characterized in that, The method further includes: When a trigger operation is detected that jumps from the first interface to the second interface, the first channel and the second channel are destroyed.

7. The method according to claim 1, characterized in that, The step of displaying the target text represented by the first character on the input interface includes: At least one candidate text is constructed and displayed based on a selected first character; wherein the at least one candidate text includes the target text; In response to a selection operation for any one of the at least one candidate texts, the selected text is determined as the target text and displayed in the input interface.

8. A secure text input device, characterized in that, include: The format acquisition module is used to respond to a trigger operation on the target input box in the first interface by calling a preset API service to obtain the character format that the target input box can display. The first interface is the interface displayed by the application installed on the first system. An input interface display module is used to send the character format to the first input method program of the second system, so that the first input method program generates and displays an input interface based on the character format, wherein the input interface includes a plurality of first characters conforming to the character format; A character selection module is configured to, in response to a selection operation for at least one first character in the input interface, display the target text represented by the first character in the input interface; The target text display module is used to send the target text to the preset API service and call the preset API service to display the target text in the target input box.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method of any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-7.