Input method, device and device for input
By processing input information in an independent process, the problems of waste of input method application resources and cross-platform consistency are solved, and the optimization of system resources and consistency of business logic are achieved.
Patent Information
- Application Number
- CN202010072562.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-01-21
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2040-01-21
AI Technical Summary
The existing input method applications are embedded in the processes of each host program in the form of a dynamic link library, resulting in wasted system resources, and the business logic of input methods for different operating systems is different, making it difficult to achieve cross-platform consistency.
By processing input information in an independent process of the input method application, avoiding the input method application in the form of a dynamic link library in the process of the host program, and using independent processes to combine business logic to realize cross-platform input method application and sharing Resources and features.
It reduces the system resource overhead in the input process, and ensures the consistency of the business logic of the input method application of different platforms, realizing cross-platform input method application.
Smart Images

Figure CN113220134B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to an input method, device, and a device for input. Background Art
[0002] With the development of computer technology, the types of operating systems are gradually increasing. In various operating systems, input method applications usually need to be installed to facilitate users to input information.
[0003] Existing input method applications applicable to some operating systems (such as Windows operating system, Linux operating system, etc.) are usually embedded in the process of the host program in the form of DLL (Dynamic Link Library). Since there are many host programs for input method applications, each process of the host program using the input method application occupies a part of system resources, resulting in a waste of system resources. In addition, due to the differences in operating systems, existing input method applications are independently designed for different operating systems, resulting in differences in the business logic (such as the logic for processing input information) of input method applications on different platforms. Summary of the invention
[0004] The embodiments of the present application provide an input method, a device, and a device for input, which reduce the system resource overhead during the input process and at the same time ensure the consistency of the business logic of input method applications applicable to different platforms.
[0005] In a first aspect, an embodiment of the present application provides an input method, which includes: during the input process, receiving input information through a host program of an input method application, the host program being a program that uses the input method application; transmitting the input information to an independent process of the input method application; processing the input information through the independent process to obtain a processing result.
[0006] In the second aspect, an embodiment of the present application provides an input device, which includes: a receiving unit, configured to receive input information through a host program of an input method application during an input process, the host program being a program that uses the input method application; a first transmission unit, configured to transmit the input information to an independent process of the input method application; and a processing unit, configured to process the input information through an independent process to obtain a processing result.
[0007] In a third aspect, an embodiment of the present application provides a device for input, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations: during the input process, receiving input information through a host program of an input method application, where the host program is a program that uses the input method application; transmitting the input information to an independent process of the input method application; and processing the input information through the independent process to obtain a processing result.
[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect above.
[0009] The input method, device and device for input provided by the embodiment of the present application, during the input process, first receive input information through the host program of the input method application, and then transmit the input information to the independent process of the input method application; finally, the input information is processed by the independent process of the input method application to obtain the processing result. On the one hand, since the processing of the input information is completed by the independent process of the input method application, there is no need to embed the input method application in the process of each host program in the form of a dynamic link library, which can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process. On the other hand, the independent process of the input method can be used in conjunction with the input method application whose business logic crosses the platform. The business logic is processed by the independent process of the input method application, so that different operating systems share the resources and functions in the independent process, ensuring the consistency of the business logic of the input method application applicable to different platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0011] Figure 1 is a flow chart of an embodiment of an input method according to the present application;
[0012] Figure 2 is a flow chart of another embodiment of the input method according to the present application;
[0013] Figure 3 is an exemplary system architecture diagram to which embodiments of the present application may be applied;
[0014] Figure 4 is a schematic structural diagram of an embodiment of an input device according to the present application;
[0015] Figure 5is a schematic structural diagram of a device for input according to the present application;
[0016] Figure 6 It is a schematic diagram of the structure of the server in some embodiments of the present application. DETAILED DESCRIPTION
[0017] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0018] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0019] Please refer to Figure 1 , which shows a process 100 of an embodiment of the input method according to the present application. The above input method can be run on various electronic devices, including but not limited to: servers, smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, car computers, desktop computers, set-top boxes, smart TVs, wearable devices, etc.
[0020] The above-mentioned electronic device can be installed with various client applications, such as input method applications, text editing applications, instant messaging applications, etc. The input method application mentioned in the embodiment of the present application can support multiple input methods. Among them, the input method can be a coding method used to input various symbols into electronic devices such as computers and mobile phones, and the user can use the input method application to conveniently input the required characters or strings into the electronic device. It should be noted that in the embodiment of the present application, in addition to supporting common Chinese input methods (such as pinyin input method, Wubi input method, Zhuyin input method, voice input method, handwriting input method, etc.), the input method can also support input methods of other languages (such as Japanese Hiragana input method, Korean input method, etc.), and no limitation is made on the input method and the language type of the input method.
[0021] The input method in this embodiment may include the following steps:
[0022] Step 101: During the input process, input information is received by a host program of the input method application.
[0023] In this embodiment, the program using the input method application is the host program, that is, the application program where the input focus is located. The input method application is the host program of the host program. The host program can be used in a computer environment to provide a software environment for the host program to survive, that is, the host environment.
[0024] As an example, when a user edits text through a text editing program (such as Word, Excel, etc.), the text editing program needs to use an input method application. At this time, the text editing program is the host program of the input method application.
[0025] As another example, when a user exchanges text messages with a peer user through an instant messaging application, the instant messaging application usually needs to use an input method application to provide the user with an information input function. In this case, the instant messaging application is the host program of the input method application.
[0026] In this embodiment, the execution subject may receive input information through the host program of the input method application during the character input process of the user. The input information may refer to key information triggered by the user. When the user triggers multiple keys continuously, each triggered key corresponds to a key information for representing the key, and the input information may include key information corresponding to each key triggered by the user in sequence.
[0027] In practice, the host program can receive input information based on the input method framework provided by the operating system. As an example, a host program running on a Windows operating system can receive input information through the TSF (Text Service Framework) provided by the Windows operating system. A host program running on a Linux operating system can receive input information through the Fcitx framework provided by the Linux operating system. A host program running on an Android operating system can receive input information through the IMF (Input Method Frameworks) provided by the Android operating system.
[0028] The host program can also dynamically load the DLL (Dynamic Link Library) provided by the host program to dynamically load external functions. Dynamic link library is a way to implement the concept of shared function library. Dynamic linking provides a way for a process to call functions that are not part of its executable code. The executable code of the function is located in a DLL file, which contains one or more functions that have been compiled, linked and stored separately from the process that uses them.
[0029] Step 102: Transmit the input information to an independent process of the input method application.
[0030] In this embodiment, the execution subject may create an independent process for the input method application. The independent process may be used to implement the business logic of the input method application, such as key conversion, user interface (UI) display, etc. The user interface may refer to the user interface of the input method application, that is, the user interface in the independent process.
[0031] In this embodiment, the input information can be transmitted to the independent process of the input method application. Here, for different operating systems, different methods can be used to transmit the input information to the independent process of the input method application.
[0032] As an example, for Windows operating system or Linux operating system, input information can be transmitted to the independent process of input method application through IPC (Inter-Process Communication). Among them, IPC method can realize the propagation or exchange of information between different processes. Here, IPC method can include pipelines, message queues, semaphores, shared storage, etc. For Android operating system, input information can be transmitted to the independent process of input method application through native dynamic link library.
[0033] In practice, the MVC (Model View Controller) architecture can be used in an independent process to handle key logic and respond to UI interactions to ensure that a copy of the input method's vocabulary data and UI resources are shared globally.
[0034] In the prior art, host programs running in some operating systems (such as Windows operating system, Linux operating system, etc.) usually embed input method applications as dynamic link libraries into the process of the host program, so as to use the functions of the input method application to implement content input. However, since there are many host programs for input method applications, this method causes each process of the host program using the input method to occupy a part of system resources, resulting in a waste of system resources.
[0035] In an embodiment of the present application, the processing of input information is completed by an independent process of the input method application. Since there is no need to embed the input method application in the form of a dynamic link library in the process of each host program, it can be ensured that there is only one copy of the resources related to the business logic of the input method application globally, thereby reducing the system resource overhead during the input process.
[0036] In some optional implementations of this embodiment, the execution subject may transmit the input information to the independent process of the input method application through the following steps:
[0037] The first step is to build an input method application proxy module in the host program of the input method application.
[0038] The input method application proxy module can be used to provide an interactive function between the independent process of the input method application and the host program. The input method application proxy module can include code data for providing the interactive function.
[0039] As an example, the input method application proxy module can be embedded into the process of the host program as a dynamic link library. By loading the dynamic link library, the process of the host program can have the ability to interact with the independent process of the input method application.
[0040] The second step is to transmit the input information to the above independent process through the input method application proxy module.
[0041] Here, when the host program runs on different operating systems, the input method application proxy module can transmit the input information to the above-mentioned independent process in different ways.
[0042] As an example, when the host program runs on a first operating system, the input information may be transmitted to the independent process through inter-process communication, wherein the first operating system includes at least one of the following: Windows operating system, Linux operating system.
[0043] When the host program runs on a second operating system, the input information can be transmitted to the independent process through a native dynamic link library of the second operating system, wherein the second operating system includes an Android operating system.
[0044] By building an input method application proxy module in the host program, the host program can be enabled to interact with the independent process of the input method application. At the same time, the business logic of the input method is executed by the independent process of the input method application, and only the input method application proxy module is embedded in the process of the host program. Compared with the previous method of embedding the input method application as a link library into the host program, it can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0045] In addition, the interaction process between processes is usually different for different operating systems. For example, Windows operating system and Linux operating system embed input method applications into the host program as dynamic link libraries; input method applications in Android operating system run in an independent form. However, the different operation modes have nothing to do with the business logic of the input method application, that is, the business logic of input method applications running on different operating systems is the same. Therefore, leaving the business logic to the independent process of the input method application to execute helps to build an input method application with cross-platform business logic.
[0046] The above-mentioned cross-platform input method application may include two parts of code data. They are first code data that is independent of the operating system and related to the business logic of the target application to be generated, and code data that is related to the operating system and is independent of the above-mentioned business logic. Among them, the first code data can be executed by an independent process of the input method application. The second code data can be code data in the input method application proxy module. The second code data can be set differently according to different operating systems. Therefore, by integrating the first code data with the second code data corresponding to different operating systems, a set of business logic codes can be reused on different platforms to obtain a cross-platform input method application. Therefore, handing over the business logic to the independent process of the input method application for execution helps to build an input method application with cross-platform business logic. The independent process of the input method can be used with the input method application with cross-platform business logic, and the business logic is processed by the independent process of the input method application, so that different operating systems share the resources and functions in the independent process, and the consistency of the business logic of the input method application suitable for different platforms is guaranteed.
[0047] Step 103, processing the input information through an independent process to obtain a processing result.
[0048] In this embodiment, the execution subject may process the input information through an independent process to obtain a processing result. The processing may include key conversion of the input information and displaying the key conversion result in a user interface.
[0049] As an example, if the user triggers the "z" key on the keyboard and the current input mode is the pinyin keyboard input mode, the independent process can perform key conversion processing to obtain that the user has input the character "z". Then, the operation of displaying the input character "z" in the user interface of the input method can be executed.
[0050] As another example, if the user triggers the voice input button, the independent process can perform an operation of displaying the voice input interface. Then, the voice information input by the user can be received and converted into an input string. Finally, the operation of displaying the input string in the user interface of the input method can be performed.
[0051] As another example, if the "d", "a", "y", and "u" keys on the keyboard are triggered in sequence, and the current input mode is the pinyin keyboard input mode, then after key conversion, it can be determined that the user has input the input string "dayu". At this time, an operation of displaying the input string in the user interface of the input method can be performed.
[0052] In some optional implementations of this embodiment, the following steps may be performed through the above independent process:
[0053] The first step is to determine the current input mode.
[0054] In practice, the input mode may include but is not limited to a handwriting keyboard input mode, a voice keyboard input mode, a pinyin keyboard input mode, a Wubi keyboard input mode, and the like.
[0055] The second step is to convert the above input information into input string according to the determined input mode.
[0056] For example, if the current input mode is the handwriting keyboard input mode, the input information may include the user's touch track information. By parsing the touch track information, it can be converted into an input string that the user wants to input.
[0057] The third step is to query the candidate items corresponding to the above input string.
[0058] The fourth step is to display the candidate items in the user interface of the independent process. Here, the user interface of the independent process is the display interface of the input method application.
[0059] As a result, the specific business logic and business functions of the input method application can be executed by the independent process of the input method application. In this process, there is no need to embed the input method application in the form of a dynamic link library in the process of each host program, which can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0060] The method provided by the above-mentioned embodiment of the present application, during the input process, first receives input information through the host program of the input method application, and then transmits the input information to the independent process of the input method application; finally, the above-mentioned input information is processed by the independent process of the input method application to obtain a processing result. Since the processing of the input information is completed by the independent process of the input method application, there is no need to embed the input method application in the process of each host program in the form of a dynamic link library, which can ensure that there is only one copy of the resources related to the business logic of the input method application globally, reducing the system resource overhead during the input process. In addition, the independent process of the input method can be used in conjunction with the input method application whose business logic crosses the platform. The business logic is processed by the independent process of the input method application, so that different operating systems share the resources and functions in the independent process, ensuring the consistency of the business logic of the input method application applicable to different platforms.
[0061] Further references Figure 2 , which shows a process 200 of another embodiment of an input method. The process 200 of the input method includes the following steps:
[0062] Step 201: During the input process, input information is received through a host program of the input method application.
[0063] In this embodiment, step 201 can be seen in Figure 1 The step 101 of the corresponding embodiment will not be described in detail here.
[0064] Step 202: Transmit the input information to the independent process of the input method application.
[0065] In this embodiment, the execution subject can create an independent process for the input method application, and can use different methods to transmit the input information to the independent process of the input method application for different operating systems. For example, for Windows operating system or Linux operating system, the input information can be transmitted to the independent process of the input method application through IPC. For Android operating system, the input information can be transmitted to the independent process of the input method application through the native dynamic link library of the Android operating system.
[0066] In some optional implementations of this embodiment, the execution subject may first construct an input method application proxy module in the host program of the input method application. The input method application proxy module may be used to provide an interactive function between the independent process of the input method application and the host program. Then, the input information may be transmitted to the independent process through the input method application proxy module.
[0067] Here, when the above-mentioned host program runs on different operating systems, the input method application proxy module can transmit the above-mentioned input information to the above-mentioned independent process in different ways. As an example, when the above-mentioned host program runs on a first operating system, the above-mentioned input information can be transmitted to the above-mentioned independent process through inter-process communication. Among them, the above-mentioned first operating system may include at least one of the following: Windows operating system, Linux operating system. When the above-mentioned host program runs on a second operating system, the above-mentioned input information is transmitted to the above-mentioned independent process through the native dynamic link library of the above-mentioned second operating system. Among them, the above-mentioned second operating system may include an Android operating system.
[0068] By constructing an input method application proxy module, the host program can be loaded with the ability to interact with the independent process of the input method application, and the interaction between the host program and the independent process of the input method application can be realized. At the same time, the business logic of the input method is executed by the independent process of the input method application, and only the input method application proxy module is embedded in the process of the host program. Compared with the previous method of embedding the input method application as a link library into the host program, it can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0069] In addition, the interaction process between processes is usually different for different operating systems. For example, Windows operating system and Linux operating system embed input method applications into the host program as dynamic link libraries; input method applications in Android operating system run in an independent form. However, the different operation modes have nothing to do with the business logic of the input method application, that is, the business logic of input method applications running on different operating systems is the same. Therefore, leaving the business logic to the independent process of the input method application to execute helps to build an input method application with cross-platform business logic.
[0070] The above-mentioned cross-platform input method application may include two parts of code data. They are first code data that is independent of the operating system and related to the business logic of the target application to be generated, and code data that is related to the operating system and is independent of the above-mentioned business logic. Among them, the first code data can be executed by an independent process of the input method application. The second code data can be code data in the input method application proxy module. The second code data can be set differently according to different operating systems. Therefore, by integrating the first code data with the second code data corresponding to different operating systems, a set of business logic codes can be reused on different platforms to obtain a cross-platform input method application. Therefore, handing over the business logic to the independent process of the input method application for execution helps to build an input method application with cross-platform business logic. The independent process of the input method can be used with the input method application with cross-platform business logic, and the business logic is processed by the independent process of the input method application, so that different operating systems share the resources and functions in the independent process, and the consistency of the business logic of the input method application suitable for different platforms is guaranteed.
[0071] In this embodiment, step 202 can be seen in Figure 1 The step 102 of the corresponding embodiment will not be described in detail here.
[0072] Step 203, processing the input information through an independent process to obtain a processing result.
[0073] In this embodiment, the execution subject may process the input information through an independent process to obtain a processing result. The processing may include key conversion of the input information and displaying the key conversion result in a user interface.
[0074] As an example, the execution subject may first determine the current input mode, which may include but is not limited to a handwriting keyboard input mode, a voice keyboard input mode, a pinyin keyboard input mode, a Wubi keyboard input mode, and the like.
[0075] Then, according to the determined input mode, the input information is converted into a key to generate an input string. For example, if the current input mode is a handwriting keyboard input mode, the input information may include the user's touch track information. By parsing the touch track information, it can be converted into the input string that the user wants to input.
[0076] Afterwards, query the candidate items corresponding to the above input string.
[0077] Finally, the candidate items are displayed in the user interface of the independent process. Here, the user interface of the independent process is the display interface of the input method application.
[0078] As a result, the specific business logic and business functions of the input method application can be executed by the independent process of the input method application. In this process, there is no need to embed the input method application in the form of a dynamic link library in the process of each host program, which can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0079] In this embodiment, step 203 can be seen in Figure 1 The step 103 of the corresponding embodiment will not be described in detail here.
[0080] Step 204: upon receiving the screen display instruction, the character string to be displayed on the screen is transmitted to the host program.
[0081] In this embodiment, the execution subject may transmit the character string to be put on the screen to the host program upon receiving the on-screen instruction. Here, the on-screen instruction may be triggered by the user. The user may trigger the on-screen instruction for a candidate item by clicking on the candidate item in the user interface of the input method application.
[0082] Here, the way of transmitting the character string to the host program is similar to the way of transmitting the input information to the independent process in step 202. Different ways may be used for different operating systems to transmit the input information to the independent process of the input method application.
[0083] For example, for Windows operating system or Linux operating system, the character string to be displayed on the screen can be transmitted to the host program through IPC mode. For Android operating system, the character string to be displayed on the screen can be transmitted to the host program through JNI (Java Native Interface).
[0084] In some optional implementations of this embodiment, if the host program has an input method application proxy module pre-built in the execution subject, the execution subject can transmit the character string to be displayed on the screen to the host program through the input method application proxy module pre-built in the host program. The input method application proxy module is used to provide an interactive function between the independent process of the input method application and the host program.
[0085] In the above implementation, optionally, the following steps may be performed by an input method application proxy module pre-built in the above host program:
[0086] The first step is to receive the character string to be displayed on the screen sent by the independent process.
[0087] Here, the independent process processes the input information, and the processing result obtained may include multiple candidate items, and the multiple candidate items may be presented in the user interface of the input method. The character string to be displayed on the screen may be any candidate item selected by the user in the user interface of the input method.
[0088] Here, when the host program is running on different operating systems, the input method application proxy module may transmit the character string to be displayed on the screen to the host program in different ways.
[0089] As an example, when the host program runs on a first operating system, the character string to be displayed on the screen sent by the independent process is received through an inter-process communication method, wherein the first operating system includes at least one of the following: a Windows operating system and a Linux operating system;
[0090] As another example, when the host program runs on a second operating system, the character string to be displayed on the screen sent by the independent process is received through JNI, wherein the second operating system includes an Android operating system.
[0091] The second step is to determine the encapsulation format supported by the host program, and encapsulate the above-mentioned character string to be displayed on the screen according to the above-mentioned encapsulation format to obtain the encapsulation result.
[0092] Here, the encapsulation format supported by the host program may be a format that is recognizable and parseable by the host program. Different host programs may support different encapsulation formats.
[0093] The third step is to pass the encapsulation result to the host program.
[0094] Thus, the host program can interact with the independent process of the input method application through the input method application proxy module pre-built in the host program. At the same time, the business logic of the input method is executed by the independent process of the input method application, and only the input method application proxy module is embedded in the process of the host program. Compared with the previous method of embedding the input method application as a link library into the host program, it can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0095] Step 205: display the character string to be displayed on the screen in the user interface of the host program through the host program.
[0096] In this embodiment, the execution subject can perform the display operation of the on-screen string through the process of the host program. For example, the host program is a word document editing program. At this time, after obtaining the string to be displayed on the screen, the word document editing program can present the string to be displayed on the screen in the currently edited word document to realize the display of the string to be displayed on the screen.
[0097] Please continue to see Figure 3 , Figure 3 An exemplary system architecture diagram is shown in which the embodiments of the present application can be applied. Figure 3 As shown, the system architecture may include an independent process of the input method application, an intermediate layer, an input framework, an operating system, and a host program (maintaining a host process). Among them, the independent process contains the business logic of the input method, such as key logic, UI interaction logic, etc. The input framework may include a TSF framework, a Fcitx framework, and an IMF framework. The operating system may include a Windows operating system, a Linux operating system, and an Android operating system.
[0098] The middle layer can provide the interaction function between the independent process and the host program. Specifically, for the Windows operating system, the middle layer can provide an IPC communication module, which can run in the host program and is responsible for forwarding the input information received by the TSF framework from the host program to the independent process of the input method application, and forwarding the string to be displayed on the screen obtained by the independent process from the independent process to the host program. For the Linux operating system, the middle layer can provide an IPC communication module, which can run in the Fcitx APP, which is mainly responsible for forwarding the input information received by the Fcitx framework from the host program to the independent process of the input method application, and forwarding the string to be displayed on the screen obtained by the independent process from the independent process to the host program. For the Android operating system, the middle layer can pass the input information received by the IMF framework to the independent process through native, and return the information to be displayed on the screen to the input framework through the JNI mechanism, and then return it to the host program.
[0099] In practice, the input method application proxy module and the independent process can follow the C / S (Client / Server) architecture. In this case, the input method application proxy module can be regarded as the client (Client), and the input method application can be regarded as the server (Server).
[0100] from Figure 2 It can be seen that Figure 1 Compared with the corresponding embodiment, the process 200 of the input method in this embodiment involves the steps of transferring the character string to be displayed on the screen determined by the independent process of the input method application to the host program, and the host program displays it on the screen. Since the processing of input information is completed by the independent process of the input method application, and since there is no need to embed the input method application in the process of each host program in the form of a dynamic link library, it can be ensured that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process.
[0101] Further references Figure 4As an implementation of the methods shown in the above figures, the present application provides an embodiment of an input device, and the device embodiment is Figure 1 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0102] like Figure 4 As shown, the input device 400 described in this embodiment includes: a receiving unit 401, which is configured to receive input information through a host program of an input method application during an input process, and the above-mentioned host program is a program that uses the above-mentioned input method application; a first transmission unit 402, which is configured to transmit the above-mentioned input information to an independent process of the above-mentioned input method application; and a processing unit 403, which is configured to process the above-mentioned input information through the above-mentioned independent process to obtain a processing result.
[0103] In some optional implementations of this embodiment, the above-mentioned device also includes: a second transmission unit, configured to transmit the character string to be displayed on the screen to the above-mentioned host program when receiving the screen display instruction; and a display unit, configured to display the above-mentioned character string to be displayed on the screen in the user interface of the above-mentioned host program through the above-mentioned host program.
[0104] In some optional implementations of this embodiment, the above-mentioned first transmission unit 402 is further configured to: construct an input method application proxy module in the host program of the input method application, and the above-mentioned input method application proxy module is used to provide the interactive function between the independent process of the input method application and the above-mentioned host program; through the above-mentioned input method application proxy module, the above-mentioned input information is transmitted to the above-mentioned independent process.
[0105] In some optional implementations of this embodiment, the first transmission unit 402 is further configured to: perform the following steps through the input method application proxy module: when the host program runs on the first operating system, transmit the input information to the independent process through an inter-process communication method;
[0106] When the host program runs on the second operating system, the input information is transmitted to the independent process through the native dynamic link library of the second operating system.
[0107] In some optional implementations of this embodiment, the processing unit 403 is further configured to: execute the following steps through the independent process: determine the current input mode; convert the input information by key according to the input mode to generate an input string; query the candidate items corresponding to the input string; and display the candidate items in the user interface of the independent process.
[0108] In some optional implementations of this embodiment, the above-mentioned second transmission unit is further configured to: transmit the character string to be displayed on the screen to the above-mentioned host program through an input method application proxy module pre-built in the above-mentioned host program, and the above-mentioned input method application proxy module is used to provide an independent process of the input method application and the interactive function of the above-mentioned host program.
[0109] In some optional implementations of the present embodiment, the second transmission unit is further configured to: execute the following steps through an input method application proxy module pre-built in the host program: receive the character string to be displayed on the screen sent by the independent process; determine the encapsulation format supported by the host program, and encapsulate the character string to be displayed on the screen according to the encapsulation format to obtain a encapsulation result; pass the encapsulation result to the host program; wherein, the receiving of the character string to be displayed on the screen sent by the independent process includes: when the host program runs on the first operating system, receiving the character string to be displayed on the screen sent by the independent process through inter-process communication; when the host program runs on the second operating system, receiving the character string to be displayed on the screen sent by the independent process through a Java local interface.
[0110] In some optional implementations of this embodiment, the first operating system includes at least one of the following: a Windows operating system, a Linux operating system; and the second operating system includes an Android operating system.
[0111] The device provided by the above-mentioned embodiment of the present application, during the input process, first receives input information through the host program of the input method application, and then transmits the input information to the independent process of the input method application; finally, the above-mentioned input information is processed by the independent process of the input method application to obtain a processing result. Since the processing of the input information is completed by the independent process of the input method application, there is no need to embed the input method application in the process of each host program in the form of a dynamic link library, which can ensure that there is only one global copy of the resources related to the business logic of the input method application, reducing the system resource overhead during the input process. In addition, the independent process of the input method can be used in conjunction with the input method application whose business logic crosses the platform. The business logic is processed by the independent process of the input method application, so that different operating systems share the resources and functions in the independent process, ensuring the consistency of the business logic of the input method application applicable to different platforms.
[0112] Figure 5 1 is a block diagram of a device 500 for configuring an interface according to an exemplary embodiment, and the device 500 may be a smart terminal or a server. For example, the device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0113] Reference Figure 5 , the device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .
[0114] The processing component 502 generally controls the overall operation of the device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.
[0115] The memory 504 is configured to store various types of data to support operations on the device 500. Examples of such data include instructions for any application or method operating on the device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a 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.
[0116] The power supply component 506 provides power to the various components of the device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 500.
[0117] The multimedia component 508 includes a screen that provides an output interface between the above-mentioned device 500 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The above-mentioned touch sensor can not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the above-mentioned touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have a focal length and optical zoom capability.
[0118] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the device 500 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.
[0119] I / O interface 512 provides an interface between processing component 502 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0120] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 can detect the open / closed state of the device 500, the relative positioning of the components, such as the display and keypad of the device 500, the sensor assembly 514 can also detect the position change of the device 500 or a component of the device 500, the presence or absence of user contact with the device 500, the orientation or acceleration / deceleration of the device 500 and the temperature change of the device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0121] The communication component 516 is configured to facilitate wired or wireless communication between the device 500 and other devices. The device 500 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0122] In an exemplary embodiment, the apparatus 500 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 to perform the above methods.
[0123] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by the processor 520 of the device 500 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0124] Figure 6 6 is a schematic diagram of the structure of the server in some embodiments of the present application. The server 600 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 622 (for example, one or more processors) and a memory 632, and one or more storage media 630 (for example, one or more mass storage devices) storing application programs 642 or data 644. Among them, the memory 632 and the storage medium 630 can be short-term storage or permanent storage. The program stored in the storage medium 630 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 622 can be configured to communicate with the storage medium 630 and execute a series of instruction operations in the storage medium 630 on the server 600.
[0125] The server 600 may also include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input and output interfaces 658, one or more keyboards 656, and / or one or more operating systems 641, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0126] A non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of a device (smart terminal or server), the device is able to execute an interface configuration method. The method includes: during the input process, receiving input information through a host program of an input method application, wherein the host program is a program that uses the input method application; transmitting the input information to an independent process of the input method application; and processing the input information through the independent process to obtain a processing result.
[0127] Optionally, the above-mentioned device is configured to execute the above-mentioned one or more programs by one or more processors, including instructions for performing the following operations: when receiving the screen display instruction, transmitting the character string to be displayed on the screen to the host program; through the host program, displaying the character string to be displayed on the screen in the user interface of the host program.
[0128] Optionally, transmitting the input information to the independent process of the input method application includes: constructing an input method application proxy module in the host program of the input method application, wherein the input method application proxy module is used to provide an interactive function between the independent process of the input method application and the host program; transmitting the input information to the independent process through the input method application proxy module.
[0129] Optionally, transmitting the input information to the independent process through the input method application proxy module includes: performing the following steps through the input method application proxy module: when the host program runs on a first operating system, transmitting the input information to the independent process through inter-process communication; when the host program runs on a second operating system, transmitting the input information to the independent process through a native dynamic link library of the second operating system.
[0130] Optionally, the input information is processed by the independent process to obtain a processing result, including: executing the following steps by the independent process: determining a current input mode; performing key conversion on the input information according to the input mode to generate an input string; querying candidate items corresponding to the input string; and displaying the candidate items in the user interface of the independent process.
[0131] Optionally, transmitting the character string to be displayed on the screen to the host program includes: transmitting the character string to be displayed on the screen to the host program through an input method application proxy module pre-built in the host program, and the input method application proxy module is used to provide an independent process of the input method application with an interactive function with the host program.
[0132] Optionally, the transmitting of the character string to be displayed on the screen to the host program through an input method application proxy module pre-constructed in the host program includes: executing the following steps through the input method application proxy module pre-constructed in the host program: receiving the character string to be displayed on the screen sent by the independent process; determining the encapsulation format supported by the host program, and encapsulating the character string to be displayed on the screen according to the encapsulation format to obtain a encapsulation result; passing the encapsulation result to the host program; wherein, the receiving of the character string to be displayed on the screen sent by the independent process includes: when the host program runs on a first operating system, receiving the character string to be displayed on the screen sent by the independent process through an inter-process communication method; when the host program runs on a second operating system, receiving the character string to be displayed on the screen sent by the independent process through a Java local interface.
[0133] Optionally, the first operating system includes at least one of the following: Windows operating system, Linux operating system; the second operating system includes Android operating system.
[0134] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0135] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0136] The above is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
[0137] The above is a detailed introduction to an input method, a device and a device for input provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for a person skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. An input method, characterized in that: The method comprises: During the input process, input information is received through a host program of an input method application, the host program is a program using the input method application, the input method application includes first code data that is independent of the operating system and related to the business logic of the target application to be generated, and second code data that is related to the operating system and independent of the business logic, the first code data is executed by an independent process of the input method application, and the second code data is code data in an input method application proxy module that is set differently according to different operating systems; In the host program of the input method application, construct the input method application proxy module, the input method application proxy module is used to provide an interactive function between the independent process of the input method application and the host program, and transmit the input information to the independent process of the input method application; The input information is processed by the independent process to obtain a processing result.
2. The method according to claim 1, characterized in that After obtaining the processing result, the method further includes: When receiving the screen display instruction, the character string to be displayed on the screen is transmitted to the host program; The character string to be displayed on the screen is displayed in the user interface of the host program through the host program.
3. The method according to claim 1, characterized in that The independent process of transmitting the input information to the input method application includes: The input information is transmitted to the independent process through the input method application agent module.
4. The method according to claim 3, characterized in that: The step of transmitting the input information to the independent process through the input method application proxy module includes: The input method application proxy module performs the following steps: When the host program is running on the first operating system, transmitting the input information to the independent process through inter-process communication; When the host program runs on a second operating system, the input information is transmitted to the independent process through a native dynamic link library of the second operating system.
5. The method according to claim 1, characterized in that The step of processing the input information by the independent process to obtain a processing result includes: The following steps are performed by the independent process: Determine the current input mode; According to the input mode, the input information is converted into a key to generate an input string; Query candidate items corresponding to the input string; The candidate items are presented in a user interface of the independent process.
6. The method according to claim 2, characterized in that The step of transmitting the character string to be displayed on the screen to the host program includes: The character string to be displayed on the screen is transmitted to the host program through an input method application proxy module pre-built in the host program, wherein the input method application proxy module is used to provide an interactive function between an independent process of the input method application and the host program; The method of transmitting the character string to be displayed on the screen to the host program through the input method application proxy module pre-built in the host program includes: The following steps are performed by using the input method application proxy module pre-built in the host program: Receiving the character string to be displayed on the screen sent by the independent process; Determine the encapsulation format supported by the host program, and encapsulate the character string to be displayed on the screen according to the encapsulation format to obtain an encapsulation result; Passing the encapsulation result to the host program; The receiving of the character string to be displayed on the screen sent by the independent process includes: When the host program is running on the first operating system, receiving the character string to be displayed on the screen sent by the independent process through an inter-process communication method; When the host program runs on the second operating system, the character string to be displayed on the screen sent by the independent process is received through the Java local interface.
7. The method according to claim 4 or 6, characterized in that: The first operating system includes at least one of the following: Windows operating system, Linux operating system; the second operating system includes Android operating system.
8. An input device, characterized in that: The device comprises: a receiving unit configured to receive input information through a host program of an input method application during an input process, wherein the host program is a program using the input method application, wherein the input method application includes first code data that is independent of an operating system and is related to a business logic of a target application to be generated, and second code data that is related to the operating system and is independent of the business logic, wherein the first code data is executed by an independent process of the input method application, and the second code data is code data in an input method application proxy module that is set differently according to different operating systems; A first transmission unit is configured to construct the input method application proxy module in the host program of the input method application, wherein the input method application proxy module is used to provide an interactive function between the independent process of the input method application and the host program, and transmit the input information to the independent process of the input method application; The processing unit is configured to process the input information through the independent process to obtain a processing result.
9. The device according to claim 8, characterized in that The device also includes: The second transmission unit is configured to transmit the character string to be displayed on the screen to the host program upon receiving the display instruction; The display unit is configured to display the character string to be displayed on the screen in the user interface of the host program through the host program.
10. The device according to claim 8, characterized in that The first transmission unit is further configured to: The input information is transmitted to the independent process through the input method application agent module.
11. The device according to claim 10, characterized in that The first transmission unit is further configured to: The input method application proxy module performs the following steps: When the host program is running on the first operating system, transmitting the input information to the independent process through inter-process communication; When the host program runs on a second operating system, the input information is transmitted to the independent process through a native dynamic link library of the second operating system.
12. The device according to claim 8, characterized in that The processing unit is further configured to: The following steps are performed by the independent process: Determine the current input mode; According to the input mode, the input information is converted into a key to generate an input string; Query candidate items corresponding to the input string; The candidate items are presented in a user interface of the independent process.
13. The device according to claim 9, characterized in that The second transmission unit is further configured to: The character string to be displayed on the screen is transmitted to the host program through an input method application proxy module pre-built in the host program, wherein the input method application proxy module is used to provide an interactive function between an independent process of the input method application and the host program; The method of transmitting the character string to be displayed on the screen to the host program through the input method application proxy module pre-built in the host program includes: The following steps are performed by using the input method application proxy module pre-built in the host program: Receiving the character string to be displayed on the screen sent by the independent process; Determine the encapsulation format supported by the host program, and encapsulate the character string to be displayed on the screen according to the encapsulation format to obtain an encapsulation result; Passing the encapsulation result to the host program; The receiving of the character string to be displayed on the screen sent by the independent process includes: When the host program is running on the first operating system, receiving the character string to be displayed on the screen sent by the independent process through an inter-process communication method; When the host program runs on the second operating system, the character string to be displayed on the screen sent by the independent process is received through the Java local interface.
14. The device according to claim 11 or 13, characterized in that The first operating system includes at least one of the following: Windows operating system, Linux operating system; the second operating system includes Android operating system.
15. A device for input, characterized in that The invention comprises a memory and one or more programs, wherein the one or more programs are stored in the memory, and when the programs are executed by one or more processors, the steps of any method described in claims 1-7 are implemented.
16. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
