A method for running a program, a computing device, and a readable storage medium
By entering matching content in the input method and detecting the association relationship startup program, the problem of cumbersome operation of running programs in the existing technology is solved, and a fast and convenient program startup is achieved.
Patent Information
- Application Number
- CN202111608305.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-22
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2041-12-22
AI Technical Summary
In the prior art, when running a program, the user needs to return to the desktop to click the icon, which is cumbersome and inefficient.
By entering content matching the target program in the input box of the input method, using the pre-stored association relationship detection program, and displaying the startup description information in the input method display box, the program is started after monitoring and selection instructions.
It realizes that the program is started directly through the input method without returning to the desktop, improving user experience and operation efficiency.
Smart Images

Figure CN114415904B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular, to a method for running a program, a computing device, and a readable storage medium. Background Art
[0002] Currently, in a PC, when a certain program needs to be run, generally, the user needs to click on its icon located on the desktop to achieve this. Therefore, when the user wants to open another program in one program, he needs to return to the desktop from the current program and then click on its icon to achieve this. Obviously, this method has problems such as cumbersome operation and low efficiency.
[0003] For this reason, there is an urgent need for a new method for running a program to solve the above problems. Summary of the Invention
[0004] For this reason, the present invention provides a method for running a program, a computing device, and a readable storage medium, in an attempt to solve or at least alleviate the problems existing above.
[0005] According to one aspect of the present invention, there is provided a method for running a program, which is executed in a computing device. The computing device stores an association relationship between a program and its startup command. The method includes: obtaining the input content in the input box of the input method; based on the association relationship, detecting whether there is a program that matches the input content; if there is, then taking the matched program as the target program and at least displaying first description information for starting the target program in the display box of the input method; when a selection instruction for the first description information is detected, starting the target program.
[0006] Optionally, in the method for running a program according to the present invention, the step of detecting whether there is a program that matches the input content includes: detecting whether the input content contains a first identifier; if it contains, then detecting whether there is a program that matches the input content.
[0007] Optionally, in the method for running a program according to the present invention, the step of detecting whether there is a program that matches the input content includes: detecting whether the input content contains a second identifier; if it does not contain, then in the first mode, detecting whether there is a program that matches the input content; if it contains, then in the second mode, detecting whether there is a program that matches the input content.
[0008] Optionally, in the method for running a program according to the present invention, in the first mode, the step of detecting whether there is a program that matches the input content includes: obtaining candidate words generated based on the input content / the input content after removing the first identifier; detecting whether there is a program name in the association relationship that is exactly the same as the candidate words.
[0009] Optionally, in the method for running a program according to the present invention, it further includes: if there is no program name in the association relationship that is exactly the same as the candidate word, obtaining the matching degree between the candidate word and the names of each program in the association relationship; detecting whether there is a program with a matching degree exceeding a predetermined value.
[0010] Optionally, in the method for running a program according to the present invention, the step of starting the target program includes: determining a startup command corresponding to the target program based on the association relationship; calling the console to execute the startup command.
[0011] Optionally, in the method for running a program according to the present invention, in the second mode, the step of detecting whether there is a program matching the input content includes: removing the first identifier and / or the second identifier in the input content, and using the remaining content as the target startup command; based on the association relationship, detecting whether there is a program corresponding to the target startup command.
[0012] Optionally, in the method for running a program according to the present invention, the step of starting the target program includes: calling the console to execute the target startup command.
[0013] Optionally, in the method for running a program according to the present invention, it further includes: if there is no program corresponding to the target startup command, at least displaying second description information for executing the target startup command in the display box of the input method; and when a selection instruction for the second description information is detected, calling the console to execute the target startup command.
[0014] Optionally, in the method for running a program according to the present invention, the step of at least displaying first description information for starting the target program in the display box of the input method includes: if one target program is matched, displaying the first description information of the target program at the first position in the display box; if multiple target programs are matched, displaying the first description information of the target program with the highest matching degree at the first position in the display box.
[0015] According to another aspect of the present invention, there is provided a computing device, including: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be executed by at least one processor, and the program instructions include instructions for executing the method for running a program according to the present invention.
[0016] According to another aspect of the present invention, there is provided a readable storage medium storing program instructions, which when read and executed by a computing device, cause the computing device to execute the method for running a program according to the present invention.
[0017] According to the method for running a program of the present invention, first, the input content in the input box of the input method is obtained. Then, based on the stored association relationship, it is detected whether there is a program that matches the input content. If there is, the matched program is used as the target program, and at least the first description information for starting the target program is displayed in the display box of the input method. Next, when a selection instruction for the first description information is detected, the target program is started. It can be seen that the present invention can start a program through the input method to make the program run. In this way, when a user wants to run a program, he only needs to input the content that matches the program in the input box of the input method, which is convenient and fast, and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] To achieve the above and related purposes, certain illustrative aspects are described herein in connection with the following description and drawings, which indicate various ways in which the principles disclosed herein can be practiced, and all aspects and their equivalent aspects are intended to fall within the scope of the claimed subject matter. By reading the following detailed description in conjunction with the drawings, the above and other objects, features, and advantages of the present disclosure will become more apparent. Throughout the present disclosure, the same reference numerals generally refer to the same components or elements.
[0019] Figure 1 FIG. shows a block diagram of a computing device 100 according to an embodiment of the present invention;
[0020] Figure 2 FIG. shows a flowchart of a method 200 for running a program according to an embodiment of the present invention;
[0021] Figure 3 FIG. shows a schematic diagram of an input method interface in the prior art;
[0022] Figure 4 FIG. shows a schematic diagram of an input method interface in the first mode according to an embodiment of the present invention;
[0023] Figure 5 FIG. shows a schematic diagram of an input method interface in the second mode according to an embodiment of the present invention;
[0024] Figure 6 FIG. shows a schematic diagram of an input method interface in the first mode according to another embodiment of the present invention;
[0025] Figure 7 FIG. shows a schematic diagram of an input method interface in the first mode according to still another embodiment of the present invention;
[0026] Figure 8 FIG. shows a schematic diagram of an input method interface in the second mode according to still another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present disclosure can be more thoroughly understood and the scope of the present disclosure can be fully conveyed to those skilled in the art.
[0028] Figure 1 FIG. 4 shows a structural block diagram of a computing device 100 according to an embodiment of the present invention. It should be noted that Figure 1 the illustrated computing device 100 is only an example. In practice, the computing device for implementing the running method of the program of the present invention can be any model of device, and its hardware configuration can be the same as Figure 1 the illustrated computing device 100, or different from Figure 1 the illustrated computing device 100. In practice, the computing device for implementing the running method of the program of the present invention can add or delete hardware components of Figure 1 the illustrated computing device 100. The present invention does not limit the specific hardware configuration of the computing device.
[0029] As Figure 1 shown, in the basic configuration 102, the computing device 100 typically includes a system memory 106 and one or more processors 104. A memory bus 108 can be used for communication between the processor 104 and the system memory 106.
[0030] Depending on the desired configuration, the processor 104 can be any type of processing, including but not limited to: microprocessor (μP), microcontroller (μC), digital signal processor (DSP), or any combination thereof. The processor 104 can include one or more levels of cache such as a level 1 cache 110 and a level 2 cache 112, a processor core 114, and registers 116. An exemplary processor core 114 can include an arithmetic logic unit (ALU), a floating point unit (FPU), a digital signal processing core (DSP core), or any combination thereof. An exemplary memory controller 118 can be used with the processor 104, or in some implementations, the memory controller 118 can be an internal part of the processor 104.
[0031] Depending on the desired configuration, system memory 106 can be any type of memory, including but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. Physical memory in a computing device generally refers to volatile memory RAM, and data on a disk needs to be loaded into physical memory before it can be read by processor 104. System memory 106 can include an operating system 120, one or more applications 122, and program data 124. In some embodiments, application 122 can be arranged to execute instructions on one or more processors 104 using program data 124 on the operating system. The operating system 120 can be, for example, Linux, Windows, etc., which includes program instructions for handling basic system services and performing hardware-dependent tasks. Application 122 includes program instructions for implementing various user-desired functions. Application 122 can be, for example, a browser, instant messaging software, software development tools (such as integrated development environment IDE, compiler, etc.), but is not limited thereto. When application 122 is installed in computing device 100, a driver module can be added to operating system 120.
[0032] When computing device 100 starts running, processor 104 reads and executes the program instructions of operating system 120 from system memory 106. Application 122 runs on top of operating system 120 and uses the interfaces provided by operating system 120 and the underlying hardware to implement various user-desired functions. When the user starts application 122, application 122 is loaded into system memory 106, and processor 104 reads and executes the program instructions of application 122 from system memory 106.
[0033] Computing device 100 further includes a storage device 132. Storage device 132 includes a removable storage 136 and a non-removable storage 138. Both the removable storage 136 and the non-removable storage 138 are connected to a storage interface bus 134.
[0034] The computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output device 142, peripheral interface 144, and communication device 146) to the basic configuration 102 via the bus / interface controller 130. Example output devices 142 include a graphics processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more A / V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I / O ports 158. Example communication device 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via one or more communication ports 164 through a network communication link.
[0035] The network communication link may be an example of a communication medium. A communication medium generally may embody computer readable instructions, data structures, program modules in a modulated data signal such as a carrier wave or other transport mechanism and may include any information delivery medium. A “modulated data signal” may be a signal that has one or more of its data set or its changes set in a manner that encodes information in the signal. By way of non-limiting example, the communication medium may include wired media such as a wired network or a dedicated line network, as well as various wireless media such as sound, radio frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable medium as used herein may include both storage media and communication media.
[0036] In the computing device 100 according to the present invention, the application 122 includes instructions for executing the running method 200 of the program of the present invention, and the instructions may direct the processor 104 to execute the running method of the program of the present invention. Those skilled in the art can understand that in addition to the instructions for executing the running method 200 of the program, the application 122 may also include other applications 126 for implementing other functions.
[0037] Figure 2 A flowchart of the running method 200 of the program according to an embodiment of the present invention is shown. The method 200 is adapted to be executed in a computing device (e.g., Figure 1 the computing device 100 shown). The association relationship between the program and its startup command is stored in the computing device.
[0038] Among them, the association relationship between a program and its startup command refers to the correspondence between the name of the program and the startup command for starting the program corresponding to that name. Specifically, the association relationship between a program and its startup command can be stored in the form of key-value pairs. For example, the name of the program is used as the key, and the startup command is used as the value. Further, the Lua language can be used to store the association relationship between a program and its startup command in the form of key-value pairs. Of course, this is only an example. The present invention does not limit the specific storage method of the association relationship. In a specific embodiment, those skilled in the art can set it according to actual needs.
[0039] In addition, regarding the association relationship between a program and its startup command, according to an embodiment of the present invention, whenever the system starts (the input method will be automatically started when the system starts), the association relationship between the programs in the current system and their startup commands is obtained and stored in the computing device.
[0040] Among them, the program in the association relationship between a program and its startup command can be an executable program of an application. Further, the executable program of the application can be the executable program of the application that creates a desktop file. In this way, whenever the system starts, the association relationship between each application program in the current system language and its startup command can be obtained by reading all desktop files.
[0041] For example, taking the desktop file of the text editor application in the / usr / share / applications / directory with the system language being Simplified Chinese as an example. When the system starts, by reading Name[zh_CN]=Text Editor and Exec=deepin-editor%F in this desktop file, a corresponding relationship between the text editor and its startup command deepin-editor%F can be obtained (that is, the file editor corresponds to deepin-editor%F), and then it can be used as a set of data in the association relationship between a program and its startup command. It should be noted that the acquisition method of other data in the association relationship is similar to that of this set of data and will not be elaborated here.
[0042] Such as Figure 2As shown, the method 200 for running a program of the present invention starts from step S210. In step S210, the input content in the input box of the input method is obtained. An input method refers to a coding method used to input various symbols into a computer or other devices (such as mobile phones). Usually, we directly refer to the "input method software" as the "input method". For example, the "Sogou Pinyin Input Method Software" is referred to as the "Sogou Pinyin Input Method". An input method software generally comes with a certain coding method by default. For example, the pinyin coding in a Chinese input method, that is, the so-called pinyin input method. For some input method software, the name itself is the coding name of the input method, such as Wangma Wubi Input Method, Super Two-Pen Input Method, etc. The present invention does not limit the input method with which coding method is adopted.
[0043] Among them, the interface of the input method generally includes an input box and a display box. The input box is used to display the content directly corresponding to the user's input operation (generally called pre-editing), and the display box is used to display the candidate content matched according to the input content in the input box. For example, in the pinyin input method, the content of the pinyin input by the user is displayed in the input box, and the candidate words matched based on the pinyin content are displayed in the display box, such as Figure 3 . In addition, regarding the input content of the input method, it can be input in the way of a keyboard, or in the way of handwriting, and of course, it can also be input in other ways. The present invention does not limit the specific way to input content in the input box of the input method.
[0044] After obtaining the input content in the input box of the input method, step S220 is entered, and based on the association relationship, it is detected whether there is a program matching the input content. Specifically, it is detected whether there is a program name of a program or a startup command of a program in the stored association relationship that matches the input content in the input box.
[0045] According to another embodiment of the present invention, in order not to affect the normal use of the input method, a first identifier for enabling the function of starting a program by the input method can also be set. Only when the user inputs this identifier, the input method will start the function of starting a program.
[0046] Therefore, in this step, it can be first detected whether the input content contains the first identifier. If it does not contain the first identifier, the candidate content is normally matched for the input content, and the matched candidate content is displayed in the display box of the input method, such as Figure 3If the first identifier is included, it is determined that the user has enabled the input method startup program function, and then based on the stored association relationship, it is detected whether there is a program that matches the input content. Herein, the first identifier may be ";", "&", "*", etc. The present invention does not limit the specific character or character string used for the first identifier. Additionally, regarding the position of the first identifier, it may be set at the beginning position of the input content, or it may be set at other positions, and the present invention does not make specific limitations thereto.
[0047] According to another embodiment of the present invention, a second identifier for the input method startup program manner may also be set, which is used to indicate whether the user wants to start a program by using the program name or the startup command of the program in the input method. Herein, the second identifier may be "#", "@", or "cmd", etc. The present invention does not limit the specific character or character string used for the second identifier. Similarly, the present invention does not limit the position of the second identifier. For example, in the case where the first identifier for enabling the input method startup program function is not set, the second identifier may be set at the beginning position of the input content, and in the case where the first identifier for enabling the input method startup program function is set, the second identifier may be set after the first identifier. Of course, this is only an example, and those skilled in the art may make settings according to the actual situation in specific embodiments.
[0048] Therefore, in the step of detecting whether there is a program that matches the input content based on the association relationship, it may first be detected whether the input content includes the second identifier. If the second identifier is not included, it is determined that the user wants to start a program by using the program name, and then in the first mode, based on the stored association relationship, it is detected whether there is a program that matches the input content. If the second identifier is included in the input content, it is determined that the user wants to start a program by using the startup command of the program, and then in the second mode, it is detected whether there is a program that matches the input content.
[0049] When detecting whether there is a program that matches the input content based on the stored association relationship in the first mode, first, candidate words generated based on the input content / the input content after removing the first identifier are obtained. Specifically, in the case where the first identifier for enabling the input method startup program function is not set, candidate words generated based on all of the input content are obtained. In the case where the first identifier for enabling the input method startup program function is set, candidate words generated based on the input content after removing the first identifier are obtained. That is, the first identifier is only used to indicate the enabling of the input method startup program function and is not used to generate candidate words. For example, if the content input by the user is ";wenbenbianjiqi", the input method will only generate candidate words based on "wenbenbianjiqi" and will automatically filter out the first identifier ";".
[0050] Then, it is detected whether there is a program name in the stored association relationship that is exactly the same as the generated candidate word. Being exactly the same means that the candidate word is exactly the same as the program name, that is, the matching degree is 100%. For example, based on the content ";wenbenbianjiqi" input by the user, the generated candidate word is "text editor". If there is an application program name in the stored association relationship that is also "text editor", it is determined that the application program name is exactly the same as the generated candidate word, that is, there is a program name in the stored association relationship that is exactly the same as the generated candidate word. Otherwise, it is determined that there is no program name in the stored association relationship that is exactly the same as the generated candidate word.
[0051] Among them, if there is no program name in the stored association relationship that is exactly the same as the generated candidate word, the matching degree between the candidate word and the name of each program in the association relationship can be continuously obtained. The spatial similarity can express the semantic similarity. Therefore, the candidate word and the program name can be converted into two vectors in the vector space through the vector space model, and then the cosine distance between these two vectors is calculated to obtain the matching degree between the candidate word and the program name. Of course, this is only an example, and the matching degree can also be obtained by other methods, such as calculating the matching degree between the candidate word and the program name through the edit distance. The present invention does not limit the method for obtaining the matching degree between the candidate word and the program name. In a specific embodiment, those skilled in the art can set it according to actual needs.
[0052] After obtaining the matching degree between the candidate word and the name of each program in the association relationship, it is detected whether there is a program with a matching degree exceeding a predetermined value. That is, it is detected whether there are some program names whose matching degree with the candidate word exceeds the predetermined value. Among them, the size of the predetermined value can be 80%, of course, this is only an example. The present invention does not limit the size of the predetermined value. In a specific embodiment, those skilled in the art can set it according to actual needs.
[0053] When detecting whether there is a program that matches the input content based on the stored association relationship in the second mode, first, remove the first identifier and / or the second identifier in the input content, and use the remaining content as the target startup command. Specifically, for the case where the first identifier for enabling the input method startup program function is not set, the remaining input content after removing the second identifier is used as the target startup command. For the case where the first identifier for enabling the input method startup program function is set, the remaining input content after removing the first identifier and the second identifier is used as the target startup command. That is, the first identifier is only used to represent the function of enabling the input method startup program, and the second identifier is only used to represent the way of starting the input method startup program, and neither of them is a component of the startup command. For example, if the content entered by the user is ";cmddeepin-editor", the input method will only use "deepin-editor" as the target startup command, and it will automatically filter out the first identifier ";" and the second identifier "cmd".
[0054] Then, based on the association relationship, detect whether there is a program corresponding to the target startup command. Specifically, compare the target startup command with each command in the association relationship. When the target startup command is the same as a certain startup command in the association relationship, it is determined that there is a program corresponding to the target startup command. Specifically, the program corresponding to the startup command that is the same as the target startup command in the association relationship is the program corresponding to the target startup command, that is, the program that the user wants to run. For example, when the target startup command is "deepin-editor", if there is a set of data in the association relationship such as "Text Editor (name of the application) corresponds to deepin-editor (startup command)", it is determined that "Text Editor" is the program corresponding to the target startup command "deepin-editor", that is, there is a program corresponding to the target startup command in the stored association relationship. Otherwise, it is determined that there is no program corresponding to the target startup command in the stored association relationship.
[0055] So far, the detection of whether there is a program that matches the input content is completed. If there is a program that matches the input content, go to step S230, use the matched program as the target program, and at least display the first description information for starting the target program in the display box of the input method. Specifically:
[0056] In the first mode, when the name of a program in the stored association relationship is exactly the same as the generated candidate word, it is determined that there is a program that matches the input content, and the program whose name is exactly the same as the generated candidate word is used as the matched program, that is, the program whose name is exactly the same as the generated candidate word is used as the target program. For example, based on the content ";wenbenbianjiqi" input by the user, the generated candidate word is "text editor", and there is a program in the stored association relationship whose name is also "text editor", then it is determined that there is a program in the stored association relationship that matches the input content ";wenbenbianjiqi", and the application program text editor is used as the target program.
[0057] When the name of a program in the stored association relationship is not exactly the same as the generated candidate word, but there is a program whose name has a matching degree with the candidate word exceeding a predetermined value, it is also determined that there is a program that matches the input content. At this time, all programs whose names have a matching degree with the candidate word exceeding the predetermined value are used as the matched programs, that is, all programs whose names have a matching degree with the candidate word exceeding the predetermined value are used as the target programs. For example, based on the content ";wenben" input by the user, the generated candidate word is "text", and there is no program in the stored association relationship whose name is "text", but there are programs named "text editor" and "text viewer", and the matching degrees of these two names with the candidate word "text" both exceed the predetermined value, then it is determined that there is a program in the stored association relationship that matches the input content ";wenben", and the application programs text editor and text viewer are both used as the target programs.
[0058] In the second mode, when there is a program corresponding to the target start command in the stored association relationship, it is determined that there is a program that matches the input content, and the program corresponding to the target start command is used as the matched program, that is, the program corresponding to the target start command is used as the target program. For example, the content input by the user is ";cmddeepin-editor", and there is a set of data "text editor corresponds to deepin-editor" in the stored association relationship, then it is determined that there is a program that matches the input content ";cmddeepin-editor", and the application program text editor is used as the target program.
[0059] At this point, the target program is obtained, and then at least the first description information for starting the target program is displayed in the display box of the input method. Among them, if one target program is matched, the first description information for starting the target program is displayed in the first position of the display box.
[0060] Specifically, in the first mode, when it is detected that the name of a program in the association relationship is exactly the same as the candidate word, the first description information for starting the target program is displayed in the first position of the display box; when there is no program name in the association relationship that is exactly the same as the candidate word, but there is a program whose name has a matching degree exceeding a predetermined value with the candidate word, the first description information for starting the target program is also displayed in the first position of the display box. Similarly, in the second mode, when it is detected that there is a program corresponding to the start command of the target program in the association relationship, the first description information for starting the target program is displayed in the first position of the display box. Among them, the first description information can be "Start target program name" (such as Start Text Editor), or "Display the target program name in italics" (such as Text Editor), or highlight the target program name, etc. The specific representation form of the first description information is not limited by the present invention. In specific embodiments, those skilled in the art can set it according to actual needs.
[0061] In addition, the normal candidates matched based on the input content can be displayed in the second position of the display box of the input method. Among them, for the first mode, the candidate word that matches the input content is displayed in the second position of the display box of the input method. For example, when the content entered by the user in the input box is ";wenbenbianjiqi", and there is a program name in the stored association relationship that is exactly the same as the candidate word "Text Editor" generated based on ";wenbenbianjiqi", the first description information "Start Text Editor" for starting the text editor is displayed in the first position of the display box, and the candidate word "Text Editor" is displayed in the second position, as Figure 4 . For the second mode, the string entered by the user is displayed in the second position of the display box of the input method. For example, when the content entered by the user in the input box is ";cmddeepin-editor", and there is a set of data "Text Editor corresponds to deepin-editor" in the stored association relationship, the first description information "Text Editor" for starting the text editor is displayed in the first position of the display box, and the string "deepin-editor" is displayed in the second position, as Figure 5 . In addition, for the input of the second mode, it is preferably possible to input in the Chinese state. Of course, this is only an example, and the present invention does not make specific limitations on this.
[0062] The above has described the case of matching a target program. Next, the case of matching multiple targets will be described. When multiple target programs are matched, the first description information of the target program with the highest matching degree is displayed in the first position of the display box. Specifically, in the first mode, when there is no program name in the association relationship that is exactly the same as the candidate word, but there are multiple programs with a matching degree of the name exceeding a predetermined value with the candidate word, the first description information of the target program with the highest matching degree is displayed in the first position of the input box. For the first description information of other target programs, it can be sequentially displayed starting from the third position of the display box in descending order of the matching degree. For the second position of the display box, it can still be used to display the candidate words that match the input content. Among them, for the display positions between target programs with the same matching degree, they can be randomly set, and the present invention does not limit this. In addition, in the second mode, the present invention detects whether there is a program corresponding to the target start command in the stored association relationship, and if so, uses this program as the target program. Therefore, for the second mode, the situation of matching multiple target programs will not occur.
[0063] It should be noted that when the input content in the input box contains the first identifier, the candidate words generated by the present invention based on the remaining content after removing the first identifier and the second identifier are generally the names of application programs (as long as the content input by the user in the input box is correct). This is because after detecting that the user inputs the first identifier, it is determined that the user wants to start an application program through the input method. At this time, when generating candidate words based on the remaining content after removing the identifiers, candidate words will be generated based on a vocabulary that only includes the names of application programs. Of course, if the candidate word displayed in the second position of the display box is not the name of the application program that the user wants to run, the user can also switch the candidate words in the display box. After the candidate words are switched, based on the stored association relationship, it is re-detected whether there is a program that matches the switched candidate word and the subsequent steps such as displaying the first description information are continued according to the detection result (specifically, reference can be made to the description of the above relevant steps, which will not be elaborated here).
[0064] In addition, for the case where the first identifier for enabling the input method startup program function is not set, the present invention can display the first description information for starting the target program at the first position of the display box, and starting from the second position, display the candidates matching the input content in sequence as normal, where the target program refers to the program matching the currently selected candidate. For example, if the content entered by the user in the input box is "wenbenbianjiqi", the currently selected candidate is the candidate word "text editor" at the second position, and there is a program name in the stored association relationship that is exactly the same as the candidate word "text editor" generated based on "wenbenbianjiqi", then display the first description information "Start text editor" for starting the text editor at the first position of the display box, and starting from the second position, sequentially display the matched candidate words "text editor", "text editing", etc., as Figure 6 shown.
[0065] It should also be noted that the above setting of the content displayed at each position in the display box is only an example, which is for the convenience of users to quickly start the target program or input candidates. The present invention does not limit the content displayed at each position in the display box. In a specific embodiment, those skilled in the art can set it according to actual needs.
[0066] Thus, at least the first description information for starting the target program is displayed in the display box of the input method. Subsequently, step S240 is entered. When a selection instruction for the first description information is detected, the target program is started. The selection instruction is an instruction triggered by the user's selection of the content displayed in the display box. Among them, the user can select the first description information through hardware devices such as a mouse and a keyboard. Further, for a computing device with a touch function, the user can also select by clicking on the corresponding position. The present invention does not limit how the user selects the first description information. When a selection instruction for the first description information is detected, according to an embodiment of the present invention, the target program can be started in the following manner.
[0067] When a selection instruction for the first description information is detected in the first mode, first, based on the stored association relationship, determine the startup command corresponding to the target program. Then, call the console to execute the startup command, so that the target program can run.
[0068] Take an example, refer to Figure 4, the content displayed in the display box corresponds to an identifier one by one. "Launch Text Editor" corresponds to identifier 1, and "Text Editor" corresponds to identifier 2. When the user triggers the "1" key on the keyboard, the computing device first traverses each group of data in the stored association relationship. Then, based on the group of data "Text Editor corresponds to deepin-editor", it determines that the launch command corresponding to the text editor is "deepin-editor". Finally, it calls the console os.execute("") to execute "deepin-editor". Next, the application program, the text editor, will run. Additionally, when the user triggers the corresponding "2" key on the keyboard, the computing device will input the five characters "Text Editor" on the current interface.
[0069] And when a selection instruction for the first description information is detected in the second mode, the console will be directly called to execute the target launch command. As previously pointed out, it is because there is a program corresponding to the target launch command in the association relationship that the first description information for launching the target program is displayed in the display box of the input method. Therefore, calling the console to execute the target launch command can make the target program run.
[0070] Take an example, refer to Figure 5 , the content displayed in the display box corresponds to an identifier one by one. "Text Editor" corresponds to identifier 1, and "deepin-editor" corresponds to identifier 2. When the user triggers the "1" key on the keyboard, the computing device will call the console os.execute("") to execute "deepin-editor", and then the application program, the text editor, will run. And when the user triggers the corresponding "2" key on the keyboard, the computing device will input the string "deepin-editor" on the current interface.
[0071] Thus, it can be seen that the method for running the program of the present invention can directly open the application program through the input method, which is convenient and fast. Finally, it should also be noted that in the first mode, in the step of detecting whether there is a program matching the input content based on the association relationship, when there is neither a program name in the association relationship that is exactly the same as the candidate word nor a program whose name has a matching degree exceeding a predetermined value with the candidate word, it is determined that there is no program in the association relationship that matches the input content, and then only the candidate word matching the input content can be displayed in the display box of the input method, such as Figure 7 .
[0072] For the second mode, when detecting whether there is a program matching the input content based on the association relationship, if there is no program corresponding to the target startup command, it is also determined that there is no program matching the input content in the association relationship. However, at least the second description information for executing the target startup command can be displayed in the display box of the input method. The second description information for executing the target startup command can be "Execute the target startup command". Of course, other representation forms can also be adopted, and the present invention does not limit this. Further, when a selection instruction for the second description information is detected, the console is called to execute the target startup command. Obviously, in this way, operations such as restarting the system can also be directly implemented through the input method, further improving the user experience.
[0073] For example, if the content input by the user is "; cmdreboot" and there is no target startup command "reboot" in the stored association relationship, the second description information "Execute reboot" for executing the target startup command reboot is displayed in the first position of the display box, and "reboot" is displayed in the second position, as Figure 8 . After the user triggers the "1" key on the keyboard, the computing device will call the console os.execute("") to execute "reboot", and then the system will restart. It can be seen that the user can restart the system by entering "; cmdreboot" in the input box of the input method, which is convenient and fast. In addition, after the user triggers the corresponding "2" key on the keyboard, the computing device will input the string "reboot" on the current interface.
[0074] Among them, the program running method of the present invention can be implemented by adding a plugin module to the framework of the input method. As an example, when using the fcitx input method framework, the exemplary code for the program running method in the second mode is as follows:
[0075]
[0076]
[0077] According to the method for running a program of the present invention, first, the input content in the input box of the input method is obtained. Then, based on the stored association relationship, it is detected whether there is a program that matches the input content. If there is, the matched program is used as the target program, and at least the first description information for starting the target program is displayed in the display box of the input method. Next, when a selection instruction for the first description information is detected, the target program is started. It can be seen that the present invention can start a program through the input method to make the program run. In this way, when a user wants to run a program, the user only needs to input the content that matches the program in the input box of the input method, which is convenient and fast, and improves the user experience. Moreover, for operations such as restarting the system, the user can also achieve it by inputting the corresponding command in the input box of the input method, further improving the user experience.
[0078] The various technologies described herein can be implemented in combination with hardware or software, or a combination thereof. Thus, the method and device of the present invention, or certain aspects or portions of the method and device of the present invention, may take the form of program code (i.e., instructions) embedded in a tangible medium, such as a removable hard disk, a USB flash drive, a floppy disk, a CD-ROM, or any other machine-readable storage medium, where when the program is loaded into a machine such as a computer and executed by the machine, the machine becomes a device for practicing the present invention.
[0079] In the case where the program code is executed on a programmable computer, the computing device generally includes a processor, a processor-readable storage medium (including volatile and non-volatile memories and / or storage elements), at least one input device, and at least one output device. Among them, the memory is configured to store the program code; the processor is configured to execute the display method of the present invention according to the instructions in the program code stored in the memory.
[0080] By way of example and not limitation, the readable medium includes a readable storage medium and a communication medium. The readable storage medium stores information such as computer-readable instructions, data structures, program modules, or other data. The communication medium generally embodies computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and includes any information delivery medium. A combination of any of the above is also included within the scope of the readable medium.
[0081] In the specification provided herein, the algorithms and displays are not inherently related to any particular computer, virtual system, or other device. A variety of general-purpose systems may also be used in conjunction with the examples of the present invention. The structure required to construct such systems will be apparent from the above description. Additionally, the present invention is not directed to any particular programming language. It should be understood that the present invention described herein can be implemented using a variety of programming languages, and the description of a particular language above is for the purpose of disclosing the best mode of the present invention.
[0082] In the specification provided herein, numerous specific details are set forth. However, it can be understood that embodiments of the present invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0083] It should be understood that, for the purpose of streamlining this disclosure and aiding in the understanding of one or more of the various inventive aspects, in the foregoing description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together in a single embodiment, figure, or description thereof. However, the disclosed method should not be construed as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim.
[0084] Those skilled in the art should understand that the modules or units or components of the devices in the examples disclosed herein may be arranged in the devices as described in the embodiments, or alternatively may be located in one or more devices different from those in the examples. The modules in the foregoing examples may be combined into one module or further divided into multiple sub-modules.
[0085] Those skilled in the art can understand that the modules in the devices of the embodiments can be adaptively changed and disposed in one or more devices different from those of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component, and further can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose.
[0086] In addition, those skilled in the art will appreciate that, although some of the embodiments described herein include certain features included in other embodiments and not others, combinations of features of different embodiments are meant to be within the scope of the present invention and form different embodiments.
[0087] In addition, some of the embodiments are described herein as a method or a combination of method elements that can be implemented by a processor of a computer system or by other devices performing the functions. Accordingly, a processor having the necessary instructions for implementing the method or method elements forms a means for implementing the method or method elements. In addition, the elements described herein of the apparatus embodiments are examples of the following apparatus: the apparatus is for implementing the functions performed by the elements for the purpose of implementing the invention.
[0088] As used herein, unless otherwise specified, the use of ordinal numbers "first", "second", "third", etc. to describe ordinary objects merely indicates different instances of similar objects and is not intended to imply that the objects so described must have a given order in terms of time, space, ranking, or in any other manner.
[0089] Although the present invention has been described in terms of a limited number of embodiments, those skilled in the art within the present technical field will appreciate that other embodiments can be conceived within the scope of the present invention as thus described. In addition, it should be noted that the language used in this specification has been principally selected for readability and instructional purposes and not for the purpose of explaining or limiting the subject matter of the present invention. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. For the scope of the present invention, the disclosure of the present invention is illustrative, not restrictive, and the scope of the present invention is defined by the appended claims.
Claims
1. A method for running a program, which is suitable for execution in a computing device, wherein the association relationship between the program and its startup command is stored in the computing device, and the method includes: Obtain the input content in the input box of the input method; Detect whether the input content contains a first identifier for enabling the function of starting a program by the input method; If the first identifier is included, then detect whether the input content contains a second identifier indicating starting a program using the startup command; If the second identifier is not included, then based on the association relationship, in the first mode, detect whether there is a program that matches the input content, and if the second identifier is included, then based on the association relationship, in the second mode, detect whether there is a program that matches the input content; In the first mode, detecting whether there is a program that matches the input content includes: Obtain candidate words generated based on the input content after removing the first identifier, and detect whether there is a name of a program in the association relationship that is exactly the same as the candidate words; wherein, obtaining candidate words generated based on the input content after removing the first identifier includes: generating candidate words for the input content after removing the first identifier based on a vocabulary that only includes the names of application programs; In the second mode, detecting whether there is a program that matches the input content includes: Remove the first identifier and the second identifier in the input content, and use the remaining content as the target startup command, and based on the association relationship, detect whether there is a program corresponding to the target startup command; If there is a program that matches the input content, then use the matched program as the target program, and at least display first description information for starting the target program in the display box of the input method; When a selection instruction for the first description information is detected, start the target program; The method further includes: if there is no program corresponding to the target startup command, then at least display second description information for executing the target startup command in the display box of the input method, and when a selection instruction for the second description information is detected, call the console to execute the target startup command.
2. The method according to claim 1, further including: If there is no name of a program in the association relationship that is exactly the same as the candidate words, then obtain the matching degree between the candidate words and the names of each program in the association relationship; Detect whether there is a program whose matching degree exceeds a predetermined value.
3. The method according to claim 1 or 2, wherein The step of starting the target program includes: Based on the association relationship, determine the startup command corresponding to the target program; Call the console to execute this startup command.
4. The method according to claim 1, wherein The step of starting the target program includes: Call the console to execute the target startup command.
5. The method according to claim 1 or 2, wherein The step of at least displaying first description information for starting the target program in the display box of the input method includes: If one target program is matched, then display the first description information of this target program at the first position in the display box; If multiple target programs are matched, then display the first description information of the target program with the highest matching degree at the first position in the display box.
6. A computing device, including: At least one processor; And A memory stores program instructions, wherein the program instructions are configured to be executed by the at least one processor, and the program instructions include instructions for performing the method according to any one of claims 1-5.
7. A readable storage medium storing program instructions, which, when read and executed by a computing device, cause the computing device to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
Convenient information search method, system and an input method system
CN101231636A
Method for quick calling program instruction, system and an input method system
CN101286118A