Application program control method and device, electronic equipment and storage medium
By converting voice data into text and querying target program instructions, the command line interface is used to control applications on computer devices, solving the problem of complexity of application control on computer devices, and achieving convenient and intelligent application control.
Patent Information
- Application Number
- CN202410523286.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-28
- Publication Date
- 2024-12-13
AI Technical Summary
The prior art cannot meet users' needs for convenient control of applications on computer devices, especially after the number of applications increases, traditional mouse or keyboard control methods are complex and inconvenient.
By obtaining voice data, converting it into text data, and querying the corresponding target program instructions, the command line program interface is used to execute target program instructions to control the application, and the function of voice control application is realized.
Users can control applications on computer devices through voice, simplifying the operation process and making application control more convenient and intelligent.
Smart Images

Figure CN119127302A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of Internet technology, and in particular to an application control method, device, electronic device and storage medium. Background Art
[0002] With the rapid development of technologies such as artificial intelligence and the Internet of Things, more and more smart applications are entering people's lives. Users can control applications based on their own needs, such as opening a browser to search, opening instant messaging software to communicate, and so on.
[0003] Currently, when users control applications on computer devices, they usually need to find the applications first and then use a mouse or keyboard to control the applications. However, as the number of applications on computer devices increases, the above application control methods become more and more complicated and cannot meet the user's demand for convenient application control. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an application control method, device, electronic device and storage medium to achieve convenient control of applications. The specific technical solution is as follows:
[0005] In a first aspect of the present invention, an application control method is provided, which is applied to a computer device. The method comprises:
[0006] Acquire voice data to be processed, and convert the voice data to be processed into text data to be processed;
[0007] Query whether there is a target program instruction corresponding to the text data to be processed;
[0008] When the target program instruction exists, the command line program interface is called to execute the target program instruction, so as to control the application program corresponding to the target program instruction according to the target program instruction.
[0009] Optionally, the querying whether there is a target program instruction corresponding to the text data to be processed includes: reading preset mapping information between text data and program instructions; and querying from the mapping information whether there is a target program instruction corresponding to the text data to be processed.
[0010] Optionally, the program instructions are created in the following manner: creating a new program instruction file corresponding to the program instruction in a set directory, and adding execution permissions to the program instruction file, wherein the execution permissions are used to set the program instruction file as an executable file; adding environment variables corresponding to the program instructions in a configuration file, wherein the environment variables include the directory and the program instructions; and performing an effectiveness operation on the environment variables to complete the creation of the program instructions.
[0011] Optionally, calling a command line program interface to execute the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction includes: calling a command line program interface to execute the target program instruction, searching for environment variables corresponding to the target program instruction, searching for a program instruction file corresponding to the target program instruction through the environment variables corresponding to the target program instruction, and executing control content in the program instruction file corresponding to the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction.
[0012] Optionally, the type of the program instruction includes at least one of the following: opening an application, closing an application, and switching applications.
[0013] Optionally, before acquiring the voice data to be processed, the method further includes: acquiring recommended text data, recommending the recommended text data to the user, and using the recommended text data as reference data when the user sends the voice data to be processed.
[0014] Optionally, before acquiring the voice data to be processed, the method further includes: starting the application control function after receiving a control function start instruction.
[0015] In a second aspect of the present invention, there is also provided an application control device, which is applied to a computer device, and the device comprises:
[0016] An acquisition module, used for acquiring voice data to be processed and converting the voice data to be processed into text data to be processed;
[0017] A query module, used for querying whether there is a target program instruction corresponding to the text data to be processed;
[0018] The control module is used to call the command line program interface to execute the target program instruction when the target program instruction exists, so as to control the application program corresponding to the target program instruction according to the target program instruction.
[0019] Optionally, the query module includes: an information reading unit, used to read preset mapping information between text data and program instructions; and an instruction query unit, used to query from the mapping information whether there is a target program instruction corresponding to the text data to be processed.
[0020] Optionally, the program instructions are created in the following manner: creating a new program instruction file corresponding to the program instruction in a set directory, and adding execution permissions to the program instruction file, wherein the execution permissions are used to set the program instruction file as an executable file; adding environment variables corresponding to the program instructions in a configuration file, wherein the environment variables include the directory and the program instructions; and performing an effectiveness operation on the environment variables to complete the creation of the program instructions.
[0021] Optionally, the control module is specifically used to call a command line program interface to execute the target program instruction, search for environment variables corresponding to the target program instruction, search for a program instruction file corresponding to the target program instruction through the environment variables corresponding to the target program instruction, and execute the control content in the program instruction file corresponding to the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction.
[0022] Optionally, the type of the program instruction includes at least one of the following: opening an application, closing an application, and switching applications.
[0023] Optionally, the device further comprises: a recommendation module, configured to obtain recommended text data before the acquisition module obtains the voice data to be processed, and recommend the recommended text data to the user, wherein the recommended text data serves as reference data for the user when sending the voice data to be processed.
[0024] Optionally, the device further comprises: a starting module, configured to start the application control function after receiving a control function starting instruction before the acquisition module acquires the voice data to be processed.
[0025] In another aspect of the implementation of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; the memory is used to store computer programs; and the processor is used to implement any of the above-mentioned application control methods when executing the program stored in the memory.
[0026] In another aspect of the present invention, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed, the computer implements any of the above-mentioned application control methods.
[0027] In another aspect of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to implement any of the above-mentioned application control methods.
[0028] The application control method, device, electronic device and storage medium provided in the embodiment of the present invention are applied to computer equipment, by obtaining voice data to be processed, and converting the voice data to be processed into text data to be processed, querying whether there is a target program instruction corresponding to the text data to be processed, and when the target program instruction exists, calling the command line program interface to execute the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction. It can be seen that in the embodiment of the present invention, the method of controlling the application through the voice assistant function on a mobile terminal such as a mobile phone is referenced, but because the computer device does not have a voice assistant function, the application cannot be controlled on the computer device according to the voice control method of the mobile terminal, so that the characteristics of the computer device are further considered, and the principle of being able to control the application through the command line program on the computer device is utilized, and a method of controlling the application through voice control combined with the command line program that can be applied to the computer device is designed, and the corresponding target program instruction can be matched by analyzing the voice data sent by the user, and then the target program instruction is executed with the help of the command line program interface, so as to achieve the purpose of controlling the application, so that the user only needs to send a voice to realize the control of the application on the computer device, making the application control method on the computer device more convenient and more intelligent. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art are briefly introduced below.
[0030] Figure 1 The figure is a flowchart of a method for controlling an application program in an embodiment of the present invention.
[0031] Figure 2 The figure is a flowchart of another application control method in an embodiment of the present invention.
[0032] Figure 3 4 is a structural block diagram of an application control device in an embodiment of the present invention.
[0033] Figure 4 FIG. 4 is a structural block diagram of another application control device in an embodiment of the present invention.
[0034] Figure 5 The figure is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] The technical solutions in the embodiments of the present invention will be described below in conjunction with the accompanying drawings in the embodiments of the present invention.
[0036] The application control method in the embodiment of the present invention can be applied to a computer device, and is mainly used to control the application installed on the computer device. The computer device may include but is not limited to: a laptop computer, a desktop computer, etc. The application may be various software installed on the computer device, such as a browser, an instant messaging software, a music player, a video player, an image processing software, etc.
[0037] Normally, mobile terminals such as mobile phones have a voice assistant function, and the voice assistant function can be used to control applications on mobile terminals. However, computer devices do not have a voice assistant function, so it is impossible to control applications on computer devices using the voice control method of mobile terminals. Therefore, the embodiments of the present invention further consider the characteristics of computer devices, utilize the principle that command line programs can be used to control applications on computer devices, and design a method that can be applied to computer devices to control applications through voice control combined with command line programs. Since it is impossible to control applications through command line programs on mobile terminals, the method of the embodiments of the present invention is not suitable for implementation on mobile terminals.
[0038] Figure 1 The figure is a flowchart of a method for controlling an application program in an embodiment of the present invention.
[0039] like Figure 1 As shown, the application control method may include the following steps:
[0040] Step 101: Acquire speech data to be processed, and convert the speech data to be processed into text data to be processed.
[0041] The computer device may have a built-in voice input device (such as a microphone) or an external voice input device, and the voice input device is used to collect the voice uttered by the user. The computer device obtains the voice data to be processed from the voice input device and converts the voice data to be processed into text data to be processed.
[0042] In the embodiment of the present invention, any speech recognition technology can be used to convert the speech data to be processed into text data to be processed. Speech recognition technology is a technology for converting speech into text. Its goal is to enable a computer to recognize continuous speech spoken by different people and realize speech-to-text conversion.
[0043] Exemplarily, a neural network model, HMM (Hidden Markov Model), DTM (Dynamic Time Warping) algorithm, VQ (Vector Quantization) algorithm, etc. can be used to perform speech recognition on the speech data to be processed so as to convert the speech data to be processed into text data to be processed.
[0044] For example, if a neural network model is used for speech recognition, the speech data to be processed is used as the input of the neural network model, and the speech data to be processed is analyzed and processed inside the neural network model (such as feature extraction, pattern matching, etc.), and finally the neural network model will output the text data to be processed converted from the speech data to be processed. For the specific process of speech recognition, those skilled in the art can process it according to the actual situation, and this embodiment will not be discussed in detail here.
[0045] Step 102: Check whether there is a target program instruction corresponding to the text data to be processed.
[0046] In the embodiment of the present invention, mapping information between text data and program instructions may be created in advance.
[0047] The text data corresponds to the text data to be processed obtained by converting the voice data to be processed. In practical applications, any form of text data can be set according to actual needs, and this embodiment does not limit this. For example, for the control operation of opening a browser to use Baidu search, the corresponding text data can be set to "open Baidu" or the like; for the control operation of opening QQ, the corresponding text data can be set to "open QQ" or the like; for the control operation of closing WeChat, the corresponding text data can be set to "close WeChat" or the like; for the control operation of switching to the browser, the corresponding text data can be set to "switch to the browser" or the like; and so on.
[0048] Program instructions are used to control applications. Exemplarily, the types of program instructions may include, but are not limited to, at least one of the following: opening an application, closing an application, switching applications, and the like. In practical applications, any form of program instructions may be set according to actual needs, and this embodiment does not limit this. For example, for the control operation of opening a browser and using Baidu search, the corresponding program instruction may be set to "BD" or the like; for the control operation of opening QQ, the corresponding program instruction may be set to "QQ" or the like; for the control operation of closing WeChat, the corresponding program instruction may be set to "WX" or the like; for the control operation of switching to a browser, the corresponding text data may be set to "LLQ" or the like; and so on.
[0049] In an optional implementation, the program instructions can be created in the following manner: create a new program instruction file corresponding to the program instruction in a set directory, and add execution permissions to the program instruction file; add environment variables corresponding to the program instructions in a configuration file, the environment variables including the directory and the program instructions; execute an effectiveness operation on the environment variables to complete the creation of the program instructions.
[0050] In the embodiment of the present invention, for the above-mentioned program instructions, it is also necessary to create a program instruction file corresponding to the program instruction. The name of the program instruction file is the program instruction. The program instruction file contains the specific control content that the program instruction needs to execute. When executing the program instruction, it is essentially to execute the control content contained in the program instruction file corresponding to the program instruction, so as to perform control operations on the corresponding application according to the control content. For the above-mentioned setting directory, it can be any applicable directory, and this embodiment does not limit this.
[0051] In an embodiment of the present invention, the reason for adding execution permissions to the program instruction file is that the program instruction file is executable only after the execution permissions are added to the program instruction file, that is, the execution permissions are used to set the program instruction file as an executable file, and then the program instruction file can be called and executed by subsequent command line program interface calls, otherwise the program instruction file cannot be executed.
[0052] Exemplarily, a preset add execute permission command can be used to add execute permission to the program instruction file. In actual applications, the format of the add execute permission command may be different for different operating systems. Specifically, an applicable add execute permission command can be selected according to actual conditions to add execute permission to the program instruction file, and this embodiment does not limit this. For example, for a Linux system, the format of the add execute permission command can be "chmod a+x filename", where "filename" corresponds to the program instruction in the embodiment of the present invention.
[0053] Environment variables refer to some parameters used to specify the operating environment of the operating system in the operating system, such as the location of temporary folders, the location of system folders, etc., that is, the directory paths where some instructions are stored are stored in the environment variables. In the embodiment of the present invention, the reason for adding the environment variables corresponding to the program instructions in the configuration file is that the directory paths corresponding to the program instructions are stored in the environment variables. Therefore, the directory where the program instructions are located and the program instructions are added to the environment variables, and the program instructions can be found through the environment variables.
[0054] Exemplarily, a preset command for adding environment variables may be used to add environment variables corresponding to the program instructions in a configuration file.
[0055] In actual applications, for different operating systems, the format of the command to add environment variables may be different. Specifically, according to the actual situation, an applicable command to add environment variables may be selected to add the environment variables corresponding to the program instructions in the configuration file. This embodiment does not limit this. For example, for a Linux system, the format of the command to add environment variables may be "export PATH=$PATH:path", where "path" corresponds to the directory plus program instruction in the embodiment of the present invention.
[0056] In practical applications, the above configuration file may be a configuration file for storing environment variables in the system, etc. For different operating systems, the configuration file may be different, and may be processed according to actual conditions, which is not limited in this embodiment. For example, for a Linux system, the configuration file may be a "~ / .bash_profile" file.
[0057] In the embodiment of the present invention, the reason for performing the validation operation on the environment variable is that the environment variable is valid only after the validation operation is performed on the environment variable, and then the program instruction file can be found by the subsequent command line program interface based on the environment variable.
[0058] Exemplarily, a preset environment variable validation command may be used to execute validation operations on the environment variables. In actual applications, the format of the environment variable validation command may be different for different operating systems. Specifically, an applicable environment variable validation command may be selected according to actual conditions to execute validation operations on the environment variables. This embodiment does not limit this. For example, for a Linux system, the format of the environment variable validation command may be "source ~ / .bash_profile".
[0059] The following examples illustrate this.
[0060] For example, in Linux, to realize the control operation of automatically using Baidu to search for specified keywords after opening the browser, the corresponding program instruction creation process is as follows:
[0061] (1) Create a new file baidu (corresponding to the above program instruction file) corresponding to the program instruction baidu in directory A (corresponding to the above setting directory). After adding execution permission to the file baidu using the command "chmod+x baidu", edit the control content of the file baidu as follows:
[0062] url=https: / / www.baidu.com / s?wd=$1 ($1 is the keyword variable)
[0063] open$url
[0064] (2) Edit the ~ / .bash_profile file (corresponding to the above configuration file) and add a line export PATH=$PATH:{directory A} / baidu to add the environment variable corresponding to the program instruction baidu in the ~ / .bash_profile file.
[0065] (3) Use source ~ / .bash_profile to execute the effective operation on the environment variables and complete the creation of the program instruction baidu.
[0066] After the text data and program instructions are created in the manner of the above embodiment, mapping information of the text data and the program instructions is created. In the embodiment of the present invention, the mapping information can be in any applicable form, and this embodiment does not limit this. For example, the mapping information of the text data and the program instructions can be created in the form of key-value, where the text data is used as the key and the program instructions are used as the value, and so on.
[0067] Correspondingly, the process of querying whether there is a target program instruction corresponding to the text data to be processed includes: reading preset mapping information of text data and program instructions; and querying from the mapping information whether there is a target program instruction corresponding to the text data to be processed.
[0068] Specifically, the text data to be processed is matched with the text data in the above mapping information. If there is text data matching the text data to be processed, it is determined that there is a target program instruction corresponding to the text data to be processed, and the program instruction corresponding to the text data matching the text data to be processed is obtained, and the obtained program instruction is used as the target program instruction corresponding to the text data to be processed; if there is no text data matching the text data to be processed, it is determined that there is no target program instruction corresponding to the text data to be processed.
[0069] Step 103: When the target program instruction exists, call a command line program interface to execute the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction.
[0070] The command line is a service program running on a computer device that provides functions such as parsing commands and executing commands. It exists in the form of an interactive interface on the computer device. When the relevant instructions are entered in the command line window, the command line program can execute the instructions. For example, in the Linux system, the command line can be a shell command line, etc.
[0071] In an embodiment of the present invention, after the existence of a target program instruction corresponding to the text data to be processed is found, the target program instruction can be executed by calling a command line program interface, such as a command line API (Application Program Interface), so as to control the application corresponding to the target program instruction according to the target program instruction. For example, corresponding to the above example, for the program instruction "BD", by calling the command line program interface to execute the program instruction "BD", the control operation of opening the browser to use Baidu search can be realized; for the program instruction "QQ", by calling the command line program interface to execute the program instruction "QQ", the control operation of opening QQ can be realized; for the program instruction "WX", by calling the command line program interface to execute the program instruction "WX", the control operation of closing WeChat can be realized; for the program instruction "LLQ", by calling the command line program interface to execute the program instruction "LLQ", the control operation of switching to the browser can be realized; and so on.
[0072] Exemplarily, the process of calling a command line program interface to execute the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction may include: calling a command line program interface to execute the target program instruction, searching for the environment variables corresponding to the target program instruction, searching for the program instruction file corresponding to the target program instruction through the environment variables corresponding to the target program instruction, and executing the control content in the program instruction file corresponding to the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction.
[0073] For example, corresponding to the above-mentioned example of realizing the control operation of automatically using Baidu to search for specified keywords after opening the browser under the Linux system, the text data to be processed obtained by converting the voice data to be processed is "Open Baidu to search xxx (xxx is the keyword)", and the target program instruction corresponding to the text data to be processed "Open Baidu to search xxx (xxx is the keyword)" is obtained through query as "baidu". By calling the command line program interface to execute "baidu{xxx}", the file baidu can be found through the environment variable corresponding to the program instruction "baidu", and then the control content of the file baidu is executed based on the keyword "xxx", thereby realizing the control operation of automatically using Baidu to search for the keyword "xxx" after opening the browser.
[0074] In an embodiment of the present invention, after it is found that there is no target program instruction corresponding to the text data to be processed, prompt information can be displayed to the user, where the prompt information is used to prompt that there is no corresponding target program instruction, and so on.
[0075] In the embodiment of the present invention, by analyzing the voice data sent by the user, the corresponding target program instructions can be matched, and then the target program instructions are executed with the help of the command line program interface, so as to achieve the purpose of controlling the application. Therefore, the user only needs to make a voice to control the application on the computer device, making the application control method on the computer device more convenient and smarter.
[0076] Figure 2 The figure is a flowchart of another application control method in an embodiment of the present invention.
[0077] like Figure 2 As shown, the application control method may include the following steps:
[0078] Step 201, after receiving a control function start instruction, start the application control function.
[0079] In an embodiment of the present invention, a function startup mode can be added. After the application control function is started, subsequent steps are executed. Before the application control function is started, subsequent steps will not be executed temporarily, thereby avoiding unnecessary operations such as voice data collection and saving resources.
[0080] In the embodiment of the present invention, the control function start instruction can be triggered by the relevant operation of the user. After receiving the control function start instruction, the computer device starts the application control function and starts to obtain the voice data to be processed.
[0081] Exemplarily, a user can trigger a control function start instruction by issuing a wake-up voice. In this way, after the computer device obtains the wake-up voice data issued by the user, it converts the wake-up voice data into wake-up text data, and matches the wake-up text data with the preset control function start instruction. If the match is successful, it is determined that the control function start instruction has been received.
[0082] Step 202: Obtain recommended text data, and recommend the recommended text data to the user.
[0083] In an embodiment of the present invention, a recommendation function can be added, and a computer device obtains recommended text data and recommends the recommended text data to a user. The recommended text data serves as reference data for the user when sending the voice data to be processed. Therefore, the user can send voice data with reference to the recommended text data, thereby enabling the user to perform operations more conveniently.
[0084] Exemplarily, the user's historical control information can be counted in advance, and the historical control information can include but is not limited to historical text data and historical program instructions corresponding to the historical text data. Then, the usage frequency of each historical text data and the historical program instructions corresponding to the historical text data is counted, and the multiple historical text data with the highest usage frequency are selected as recommended text data.
[0085] Step 203: Acquire the voice data to be processed, and convert the voice data to be processed into text data to be processed.
[0086] Step 204: Check whether there is a target program instruction corresponding to the text data to be processed.
[0087] Step 205: When the target program instruction exists, call a command line program interface to execute the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction.
[0088] Steps 203 to 205 in this embodiment are the same as steps 101 to 103 in the above embodiment. For the specific process, please refer to the relevant description of the above embodiment, and this embodiment will not be discussed in detail here.
[0089] Figure 3 4 is a structural block diagram of an application control device in an embodiment of the present invention. Figure 3 The application control device shown is applied in a computer device.
[0090] like Figure 3 As shown, the application control device may include the following modules:
[0091] The acquisition module 301 is used to acquire the voice data to be processed and convert the voice data to be processed into text data to be processed.
[0092] The query module 302 is used to query whether there is a target program instruction corresponding to the text data to be processed.
[0093] The control module 303 is used to call the command line program interface to execute the target program instruction when the target program instruction exists, so as to control the application program corresponding to the target program instruction according to the target program instruction.
[0094] Figure 4 FIG. 4 is a structural block diagram of another application control device in an embodiment of the present invention. Figure 4 The application control device shown is applied in a computer device.
[0095] like Figure 4 As shown, the application control device may include the following modules:
[0096] The acquisition module 401 is used to acquire the voice data to be processed and convert the voice data to be processed into text data to be processed.
[0097] The query module 402 is used to query whether there is a target program instruction corresponding to the text data to be processed.
[0098] The control module 403 is used to call the command line program interface to execute the target program instruction when the target program instruction exists, so as to control the application program corresponding to the target program instruction according to the target program instruction.
[0099] The recommendation module 404 is used to obtain recommended text data before the acquisition module 401 obtains the voice data to be processed, and recommend the recommended text data to the user. The recommended text data serves as reference data when the user sends the voice data to be processed.
[0100] The starting module 405 is used to start the application control function after receiving a control function starting instruction before the obtaining module 401 obtains the voice data to be processed.
[0101] Optionally, the query module 402 includes: an information reading unit, used to read preset mapping information between text data and program instructions; and an instruction query unit, used to query from the mapping information whether there is a target program instruction corresponding to the text data to be processed.
[0102] Optionally, the program instructions are created in the following manner: creating a new program instruction file corresponding to the program instruction in a set directory, and adding execution permissions to the program instruction file, wherein the execution permissions are used to set the program instruction file as an executable file; adding environment variables corresponding to the program instructions in a configuration file, wherein the environment variables include the directory and the program instructions; and performing an effectiveness operation on the environment variables to complete the creation of the program instructions.
[0103] Optionally, the control module 403 is specifically used to call the command line program interface to execute the target program instruction, search for the environment variables corresponding to the target program instruction, search for the program instruction file corresponding to the target program instruction through the environment variables corresponding to the target program instruction, and execute the control content in the program instruction file corresponding to the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction.
[0104] Optionally, the type of the program instruction includes at least one of the following: opening an application, closing an application, and switching applications.
[0105] In the embodiment of the present invention, by analyzing the voice data sent by the user, the corresponding target program instructions can be matched, and then the target program instructions are executed with the help of the command line program interface, so as to achieve the purpose of controlling the application. Therefore, the user only needs to make a voice to control the application on the computer device, making the application control method on the computer device more convenient and smarter.
[0106] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 , and the memory 503 communicate with each other via the communication bus 504 .
[0107] Memory 503, used for storing computer programs;
[0108] The processor 501 is used to execute the program stored in the memory 503, and implements the following steps:
[0109] Acquire voice data to be processed, and convert the voice data to be processed into text data to be processed;
[0110] Query whether there is a target program instruction corresponding to the text data to be processed;
[0111] When the target program instruction exists, the command line program interface is called to execute the target program instruction, so as to control the application program corresponding to the target program instruction according to the target program instruction.
[0112] Optionally, the querying whether there is a target program instruction corresponding to the text data to be processed includes: reading preset mapping information between text data and program instructions; and querying from the mapping information whether there is a target program instruction corresponding to the text data to be processed.
[0113] Optionally, the program instructions are created in the following manner: creating a new program instruction file corresponding to the program instruction in a set directory, and adding execution permissions to the program instruction file, wherein the execution permissions are used to set the program instruction file as an executable file; adding environment variables corresponding to the program instructions in a configuration file, wherein the environment variables include the directory and the program instructions; and performing an effectiveness operation on the environment variables to complete the creation of the program instructions.
[0114] Optionally, calling a command line program interface to execute the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction includes: calling a command line program interface to execute the target program instruction, searching for environment variables corresponding to the target program instruction, searching for a program instruction file corresponding to the target program instruction through the environment variables corresponding to the target program instruction, and executing control content in the program instruction file corresponding to the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction.
[0115] Optionally, the type of the program instruction includes at least one of the following: opening an application, closing an application, and switching applications.
[0116] Optionally, before acquiring the voice data to be processed, the method further includes: acquiring recommended text data, recommending the recommended text data to the user, and using the recommended text data as reference data when the user sends the voice data to be processed.
[0117] Optionally, before acquiring the voice data to be processed, the method further includes: starting the application control function after receiving a control function start instruction.
[0118] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0119] The communication interface is used for communication between the above electronic device and other devices.
[0120] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0121] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0122] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the computer-readable storage medium is executed on a computer, the computer implements the application control method described in any one of the above embodiments.
[0123] In another embodiment of the present invention, a computer program product including instructions is provided, which, when executed on a computer, enables the computer to implement the application control method described in any one of the above embodiments.
[0124] It should be noted that all actions of acquiring signals, information or data in the present invention are performed in compliance with the corresponding data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0125] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0126] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0127] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0128] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. An application control method, characterized in that: Applied to a computer device, the method comprises: Acquire voice data to be processed, and convert the voice data to be processed into text data to be processed; Query whether there is a target program instruction corresponding to the text data to be processed; When the target program instruction exists, the command line program interface is called to execute the target program instruction, so as to control the application program corresponding to the target program instruction according to the target program instruction.
2. The method according to claim 1, characterized in that The querying whether there is a target program instruction corresponding to the text data to be processed includes: Reading the mapping information between preset text data and program instructions; The mapping information is queried to determine whether there is a target program instruction corresponding to the text data to be processed.
3. The method according to claim 2, characterized in that The program instructions are created in the following way: Create a new program instruction file corresponding to the program instruction in the set directory, and add execution permission to the program instruction file, wherein the execution permission is used to set the program instruction file as an executable file; Adding an environment variable corresponding to the program instruction in a configuration file, wherein the environment variable includes the directory and the program instruction; A validation operation is performed on the environment variable to complete the creation of the program instruction.
4. The method according to claim 3, characterized in that Calling a command line program interface to execute the target program instruction so as to control the application corresponding to the target program instruction according to the target program instruction includes: Call the command line program interface to execute the target program instruction, search for the environment variable corresponding to the target program instruction, search for the program instruction file corresponding to the target program instruction through the environment variable corresponding to the target program instruction, and execute the control content in the program instruction file corresponding to the target program instruction, so as to control the application corresponding to the target program instruction according to the target program instruction.
5. The method according to claim 2, characterized in that: The type of the program instruction includes at least one of the following: opening an application, closing an application, and switching an application.
6. The method according to claim 1, characterized in that Before obtaining the voice data to be processed, it also includes: The recommended text data is obtained and recommended to the user, and the recommended text data is used as reference data when the user sends the voice data to be processed.
7. The method according to claim 1, characterized in that Before obtaining the voice data to be processed, it also includes: After receiving the control function start instruction, the application control function is started.
8. An application control device, characterized in that: Applied to computer equipment, the device comprises: An acquisition module, used for acquiring voice data to be processed and converting the voice data to be processed into text data to be processed; A query module, used for querying whether there is a target program instruction corresponding to the text data to be processed; The control module is used to call the command line program interface to execute the target program instruction when the target program instruction exists, so as to control the application program corresponding to the target program instruction according to the target program instruction.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing the method according to any one of claims 1 to 7 when executing a program stored in a memory.
10. A computer-readable storage 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.
