Device function searching method and handheld electronic device
Generating semantic feature vectors through natural language models solves the problem that users find it difficult to accurately search for the functions of electronic devices, and achieves a more convenient and flexible functional search experience.
Patent Information
- Application Number
- CN202311521806.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-15
- Publication Date
- 2025-05-27
AI Technical Summary
When existing electronic devices search for internal functions, they need to accurately enter keywords, and different manufacturers have inconsistent naming of functions, making it difficult for users to find the required functions.
The natural language model is used to generate the semantic feature vectors of the search statement, and compare them with the semantic feature vectors of each function, and determine the search results based on the semantic similarity.
Even if the user does not accurately enter the function name, he can still find functions that meet expectations, significantly improving the convenience and flexibility of function search.
Smart Images

Figure CN120045687A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an electronic device and a device function search method. Background Art
[0002] With the progress of technology, some current electronic devices have a function search function, enabling users to search for required functions by entering keywords. However, when a user wants to search for internal functions of an electronic device, the user needs to accurately enter relevant keywords to find the required function. Since the user may not be familiar with the exact name of the function, the user often needs to spend time trying to enter multiple keywords before finding the required function, or even may encounter the problem of not being able to find the required function. In addition, different device manufacturers have different naming methods for similar functions, which causes users to have to try multiple different keywords to possibly find the required function. Summary of the Invention
[0003] The present disclosure provides a device function search method applicable to an electronic device having multiple functions. The method includes the following steps. Obtain a search statement via an input device. Generate a first semantic feature vector of the search statement by using a natural language model. Determine the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function. Determine a search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function, and the search result includes at least one of multiple functions.
[0004] The present disclosure provides an electronic device, which includes an input device, a storage device, and a processor. The storage device is coupled to the input device and the storage device and records a plurality of instructions. The processor is configured to execute the foregoing instructions to perform the following operations. Obtain a search statement via an input device. Generate a first semantic feature vector of the search statement by using a natural language model. Determine the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function. Determine a search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function, and the search result includes at least one of multiple functions.
[0005] Based on the above, in the embodiments of the present disclosure, a first semantic feature vector of a search statement can be generated using a natural language model, and the first semantic feature vector of the search statement can be compared with second semantic feature vectors corresponding to respective functions to obtain semantic similarity. Thus, the search result of the search statement can be determined according to the semantic similarity, and at least one of multiple functions can be provided as the search result of the search statement. Based on this, even if the user does not accurately input a function name for searching, the required function that meets the user's expectations can still be searched, thereby greatly improving the convenience and flexibility of function search. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] Figure 1 is a block diagram of an electronic device according to an embodiment of the present case;
[0007] Figure 2 is a flowchart of a device function search method according to an embodiment of the present case;
[0008] Figure 3 is a schematic diagram of a device function search method according to an embodiment of the present case;
[0009] Figure 4 is a flowchart of a device function search method according to an embodiment of the present case;
[0010] Figure 5 is a flowchart of determining a search result according to an embodiment of the present case;
[0011] Figure 6 is a flowchart of determining a search result according to an embodiment of the present case.
[0012] DESCRIPTION OF REFERENCE NUMERALS
[0013] 100: Electronic device;
[0014] 110: Input device;
[0015] 120: Storage device;
[0016] 130: Display;
[0017] 140: Processor;
[0018] QS1: Search statement;
[0019] M1: Natural language model;
[0020] 31, 32: Semantic analysis operations;
[0021] SF1: First semantic feature vector;
[0022] SF2: Second semantic feature vector;
[0023] db1: Functional database;
[0024] db2: Feature vector database;
[0025] S1: Functional description;
[0026] SR1: Search result;
[0027] S210~S240, S410~S490, S481~S485: Steps. Detailed implementation
[0028] Reference will now be made in detail to exemplary embodiments of the present invention, examples of which are illustrated in the accompanying drawings. Wherever possible, the same reference numerals are used in the drawings and the description to refer to the same or like parts.
[0029] Please refer to Figure 1 , in the embodiment of this case, the electronic device 100 may include an input device 110, a storage device 120, a display 130, and a processor 140. The electronic device 100 may be a smart phone, a notebook computer, a tablet computer, a desktop computer, or a smart wearable device, etc., and this case does not limit this.
[0030] The input device 110 is used to receive user input, such as a touch input device, a keyboard, or a microphone, etc., and this case does not limit this. In the embodiment of this case, the input device 110 can be used to receive the search statement input by the user.
[0031] The storage device 120 is used to store data and software modules (such as operating systems, application programs, drivers) and other data for the processor 140 to access, and it can be, for example, any type of fixed or removable random access memory (RAM), read-only memory (ROM), flash memory, hard disk, or a combination thereof.
[0032] The display 130 is, for example, a liquid crystal display (LCD), a light-emitting diode (LED) display, an organic light-emitting diode (OLED) display, or other types of displays, and this case does not limit this. In the embodiment of this case, the display 130 can display a user operation interface for receiving a search statement and can also display search results.
[0033] The processor 140 is coupled to the input device 110, the storage device 120, and the display 130. The processor 140 is, for example, a central processing unit (CPU), an application processor (AP), or other programmable general-purpose or special-purpose microprocessors, digital signal processors (DSPs), image signal processors (ISPs), graphics processing units (GPUs), or other similar devices, integrated circuits, and combinations thereof. The processor 140 can access and execute software modules recorded in the storage device 120 to implement the device function search method in the embodiments of the present invention. The above software modules can be broadly interpreted to mean instructions, instruction sets, codes, program codes, programs, applications, software suites, threads, procedures, functions, etc., regardless of whether they are referred to as software, firmware, middleware, microcode, hardware description language, or others.
[0034] In the embodiments of this case, the electronic device 100 can have multiple functions. For example, these functions can include call setting functions, network setting functions, display setting functions, application functions, battery setting functions, privacy setting functions, camera setting functions, or other various functions that can be set or operated by the user. The aspects of the functions in this case are not limited, and all functions that the electronic device 100 can provide to the user are within the scope of this case. When the user inputs a search statement, the electronic device 100 can provide search results including one or more recommended functions, so that the user does not need to spend time repeatedly browsing through layers of operation interfaces to search for the functions needed by the user.
[0035] Please also refer to Figure 1 and Figure 2 , the method of this embodiment is applicable to the above-mentioned electronic device 100. The following will describe the detailed steps of the device function search method of this embodiment in conjunction with the various components of the electronic device 100. To clearly illustrate the possible implementation manners of this case, the following will be supplemented with Figure 3 for illustration. Please also refer to Figure 3 .
[0036] In step S210, the processor 140 obtains a search statement QS1 via the input device 110. For example, the user can use the input device 110 to input the search statement QS1 in the input field of the user operation interface displayed on the display 130. Alternatively, the user can speak the search statement QS1, and the processor 140 can receive voice input through the input device 110. The search statement QS1 can include one word or multiple words, and this case is not limited thereto.
[0037] In step S220, the processor 140 generates a first semantic feature vector SF1 of the search statement QS1 by using the natural language model M1. Specifically, in the semantic analysis operation 32, the processor 140 can input the search statement QS1 into the natural language model M1, so that the natural language model M1 outputs the first semantic feature vector SF1 of the search statement QS1.
[0038] In some embodiments, the natural language model M1 may include a BERT (Bidirectional Encoder Representations from Transformers) model, but is not limited thereto. The natural language model M1 is generated by pre-training using a large number of texts in various languages. The machine learning method of the natural language model M1 can be self-supervised fill-in-the-blank learning, that is, using a masked language model (MLM) for model training, so that the natural language model M1 can learn to understand the semantics of the input text. The trained natural language model M1 can output the semantic feature vector of the input text (i.e., the search statement QS1) in the multi-dimensional feature space according to the input text, and the model parameters of the trained natural language model M1 can be recorded in the storage device 120. In some embodiments, the processor 140 can also use relevant texts about multiple functions of the electronic device 100 to fine-tune the natural language model M1.
[0039] In some embodiments, the processor 140 may establish an initial natural language model, where multiple weight parameters of this initial natural language model are floating-point numbers. Then, the processor 140 quantizes the multiple weight parameters of the initial natural language model into corresponding integers to obtain the natural language model M1. The initial natural language model may be a pre-trained natural language model or a fine-tuned natural language model, and the present case does not limit this. For example, the processor 140 may convert each weight parameter originally in floating-point form into an integer by performing a rounding operation or a truncation operation on each weight parameter in the initial natural language model, so as to obtain the natural language model M with all weight parameters being integers. The above rounding operation may include rounding or unconditional rounding, etc. In other words, the weight parameters of the initial natural language model can be respectively mapped to corresponding integers within a certain range. In this way, the storage space, execution memory space, and model processing time of the natural language model M1 can be reduced.
[0040] In step S230, the processor 140 determines the semantic similarity between the first semantic feature vector SF1 of the search statement QS1 and at least one second semantic feature vector SF2 of each function. Specifically, each function of the electronic device 100 is also associated with one or more second semantic feature vectors SF2. In some embodiments, the processor 140 may calculate the semantic similarity between the first semantic feature vector SF1 of the search statement QS1 and each second semantic feature vector SF2 of each function. For example, the processor 140 may calculate the cosine similarity, Euclidean Distance, or Manhattan Distance between the first semantic feature vector SF1 and the second semantic feature vector SF2 to generate the semantic similarity between the two semantic feature vectors.
[0041] It should be particularly noted that the second semantic feature vector SF2 of each function can also be generated by the natural language model M1. As Figure 3As shown, the function database db1 may record one or more function descriptions S1 for each function. The function description S1 is, for example, a function name or a function feature string. In the semantic analysis operation 31, the processor 140 may input each function description S1 of each function into the natural language model M1, so that the natural language model M1 outputs the second semantic feature vector SF2 of each function description S1 of each function. Then, one or more second semantic feature vectors SF2 of each function may be recorded in the feature vector database db2. It can be seen from this that when a certain function records N function descriptions S1 related to multiple functions in the function database db1, the feature vector database db2 records N second semantic feature vectors SF2 corresponding to the N function descriptions S1 respectively. Where N is an integer greater than 0.
[0042] In step S240, the processor 140 determines the search result SR1 corresponding to the search statement QS1 according to the semantic similarity between the first semantic feature vector SF1 of the search statement QS1 and at least one second semantic feature vector SF2 of each function. This search result SR1 includes at least one of multiple functions. Specifically, according to the semantic similarity between the first semantic feature vector SF1 and each second semantic feature vector SF2 of each function, the processor 140 can identify some second semantic feature vectors SF2 in the feature vector database db2 that are semantically closer to the first semantic feature vector SF1. For example, the processor 140 can filter out the recommended functions as the search result SR1 through the screening of a preset threshold or the sorting of semantic similarity.
[0043] It is worth mentioning that the function description S1 in the function database db1 can be defined flexibly. The function description S1 in the function database db1 can include not only the function name but also the function feature string that is close to the public's cognition and habitual language. Therefore, by using the natural language model M1, even if the user does not input a search statement QS1 that is exactly the same as the function name or keyword, the processor 140 can still search for the function that meets the user's needs according to the semantics of the search statement QS1. In this way, by using the natural language model M1, without setting a large number of keywords for each function, the processor 140 can still understand the semantics of the search statement QS1 and provide the search result SR1 that meets the user's needs accordingly.
[0044] Please also refer to Figure 1 and Figure 4 , the method of this embodiment is applicable to the above-mentioned electronic device 100. The following will describe the detailed steps of the device function search method of this embodiment in conjunction with the various components of the electronic device 100.
[0045] In step S410, the processor 140 uses a natural language model to generate at least one second semantic feature vector for each function according to at least one function description of each function. The function description may include a function name and a function feature string. The function feature string is a string different from the function name and used to describe the function content. The processor 140 may generate a corresponding one or more second semantic feature vectors for one or more function descriptions of each function. The function feature string of a certain function may also include one or more keywords about the function.
[0046] In some embodiments, the multiple functions of the electronic device 100 may include a first function. The processor 140 may input the first function name of the first function into the natural language model to generate one of the at least one second semantic feature vector of the first function. The processor 140 may input the function feature string of the first function into the natural language model to generate the other of the at least one second semantic feature vector of the first function. For example, Table 1 is a feature list of the second semantic feature vectors of multiple functions.
[0047] As shown in Table 1, "Function A" may correspond to the second semantic feature vectors V1 to V3 based on "Function Name A1", "Function Feature String S1", and "Function Feature String S2". Similarly, "Function B" may correspond to the second semantic feature vectors V4 to V6 based on "Function Name B1", "Function Feature String S3", and "Function Feature String S4".
[0048] Table 1
[0049]
[0050] It should be added that in some embodiments, the function feature string of the first function is in the first language, and the search statement is in the first language or the second language, and the first language is different from the second language. Further, the processor 140 may generate a second semantic feature vector according to the first function name and function feature string in the first language. However, the search statement may be in the first language or the second language different from the first language. For example, the second semantic feature vector of the first function may be generated according to the function description in English, but the first semantic feature vector may be generated according to the search statement in Chinese.
[0051] In some embodiments, the processor 140 may first translate the search statement into a first language and then generate a second semantic feature vector based on the search statement in the first language. Alternatively, in other embodiments, the processor 140 may directly generate a second semantic feature vector based on the search statement in the second language. That is, even if the language of the search statement is different from the function name or function feature string for generating the second semantic feature vector, based on the multi-language understanding ability of the natural language model, the processor 140 can still generate a search result that conforms to the semantics of the search statement.
[0052] In some embodiments, the processor 140 may also input the second function name of the first function into the natural language model to generate another one of at least one second semantic feature vector of the first function. The above first function name is in the first language, and the above second function name is in the second language. For example, Table 2 is a feature list of the second semantic feature vectors of multiple functions. Among them, "Function Name A1" and "Function Name B1" may be in English, while "Function Name A2" and "Function Name B2" may be languages other than English, such as Chinese or Japanese, etc.
[0053] As shown in Table 2, "Function A" can be corresponding to the second semantic feature vector V7 based on "Function Name A2". Similarly, "Function B" can be corresponding to the second semantic feature vector V8 based on "Function Name B2". That is, a certain function can generate multiple second semantic features according to function names in different languages.
[0054] Table 2
[0055]
[0056] In step S420, the processor 140 records at least one second semantic feature vector of each function into a database (such as Figure 3 the feature vector database db2 shown). In step S430, the processor 140 obtains a search statement via the input device 110. The above steps have been described in the foregoing embodiments and will not be elaborated here.
[0057] In step S440, the processor 140 determines whether the search statement is in the first language. If the determination in step S440 is negative, in step S450, the processor 140 translates the search statement from the second language into the first language. For example, the processor 140 can translate the search statement from the second language into the first language through an offline translation function. After that, the processor 140 can generate a first semantic feature vector according to the search statement translated into the first language. For some specific languages, the implementation of this translation step can improve the search success rate.
[0058] In step S460, the processor 140 generates a first semantic feature vector of the search statement using a natural language model. It can be known that the processor 140 can generate a first semantic feature vector according to the search statement in the first language. In step S470, the processor 140 determines the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function.
[0059] In step S480, the processor 140 determines the search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each function.
[0060] Please refer to Figure 5 , in some embodiments, step S480 can be implemented as steps S481 to S483. In step S481, the processor 140 determines whether the semantic similarity between the first semantic feature vector and at least one second semantic feature vector of the first function is greater than a preset threshold. The above default threshold can be configured according to actual needs, and this case does not limit it. For example, taking Table 2 as an example, the processor 140 can respectively determine whether the semantic similarity between the first semantic feature vector and the second semantic feature vectors V1 to V8 is greater than the preset threshold.
[0061] If step S481 determines yes, continue with step S482. In step S482, when the semantic similarity between the first semantic feature vector and at least one second semantic feature vector of the first function is greater than the preset threshold, the processor 140 determines the search result including the first function. That is to say, when the semantic similarity between the second semantic feature vector of a certain function and the first semantic feature vector is greater than the preset threshold, the processor 140 can regard this function as a recommended function and include it in the search result.
[0062] Otherwise, if step S481 determines no, continue with step S483. In step S483, when the semantic similarity between the first semantic feature vector and at least one second semantic feature vector of the first function is not greater than the preset threshold, the processor 140 determines the search result that does not include the first function. That is to say, when the semantic similarity between the second semantic feature vector of a certain function and the first semantic feature vector is less than the preset threshold, the processor 140 can exclude this function as a recommended function and not include it in the search result.
[0063] Please refer to Figure 6, in some embodiments, step S480 can be implemented as steps S484 to S485. In step S484, the processor 140 sorts the semantic similarity degrees corresponding to each second semantic feature vector to obtain the similarity ranking of each function. In other words, the processor 140 can sort the semantic similarity degrees corresponding to all the second semantic feature vectors in the feature vector database from high to low. According to the above sorting result of the second semantic feature vectors, the processor 140 can obtain the similarity ranking of each function. For example, the similarity ranking of each function can be the sorting order of each second semantic feature vector. Or, in some embodiments, the processor 140 can determine the similarity ranking of a certain function according to the multiple sorting orders corresponding to the multiple second semantic feature vectors of the function. For example, the processor 140 can calculate the similarity scores of each function according to the multiple sorting orders of the multiple second semantic feature vectors of each function, and determine the similarity ranking of each function according to the similarity scores of each function.
[0064] In step S485, the processor 140 determines at least one first function in the search results from multiple functions according to the similarity ranking of each function. For example, the processor 140 can determine to use the X first functions with the top X similarity rankings as the search results.
[0065] Finally, in step S490, the processor 140 provides the search results through the display 130. For example, the search results can be a function list, and the display 130 can display a function list including one or more recommended functions that match the search statement. In this way, the user can find the required function from the function list provided by the display 130. For example, Table 3 is the search result displayed by the display 130.
[0066] Table 3
[0067]
[0068] In summary, in the embodiments of the present invention, the search results of the search statement can be determined according to the semantic similarity degree of the semantic feature vectors, and at least one of multiple functions is provided as the search results of the search statement. Based on this, even if the user does not accurately input the function name for searching, the recommended functions that meet the user's expectations can still be searched, thus greatly improving the convenience and flexibility of function searching. In addition, since the natural language semantic model can learn the semantic relationships between different languages, accurate search results can be obtained by defining a small number of function descriptions in one language. It can be seen that there is no need to set different keywords for different languages to achieve keyword optimization in other languages and reduce the amount of data in the database.
[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for searching device functions, applicable to an electronic device with multiple functions, characterized in that, the method includes: obtaining a search statement via an input device; using a natural language model to generate a first semantic feature vector of the search statement; determining the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each of the multiple functions; and determining a search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and the at least one second semantic feature vector of each of the multiple functions, wherein the search result includes at least one of the multiple functions.
2. The method for searching device functions according to claim 1, characterized in that, the method further includes: using the natural language model to generate the at least one second semantic feature vector of each of the multiple functions according to at least one function description of each of the multiple functions; and recording the at least one second semantic feature vector of each of the multiple functions into a database.
3. The method for searching device functions according to claim 2, characterized in that, the multiple functions include a first function, and the step of using the natural language model to generate the at least one second semantic feature vector of each of the multiple functions according to at least one function description of each of the multiple functions includes: inputting a first function name of the first function into the natural language model to generate one of the at least one second semantic feature vector of the first function; and inputting a function feature string of the first function into the natural language model to generate another of the at least one second semantic feature vector of the first function.
4. The method for searching device functions according to claim 3, characterized in that, the function feature string of the first function is a first language, and the search statement is the first language or a second language, and the first language is different from the second language.
5. The method for searching device functions according to claim 3, characterized in that, the step of using the natural language model to generate the at least one second semantic feature vector of each of the multiple functions according to at least one function description of each of the multiple functions includes: inputting a second function name of the first function into the natural language model to generate another one of the at least one second semantic feature vector of the first function, wherein the first function name is in the first language and the second function name is in the second language.
6. The method for searching device functions according to claim 5, characterized in that, the multiple functions include a first function, and the step of determining the search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and the at least one second semantic feature vector of each of the multiple functions includes: when the semantic similarity between the first semantic feature vector and the at least one second semantic feature vector of the first function is greater than a preset threshold, determining the search result including the first function; and When the semantic similarity between the first semantic feature vector and at least one second semantic feature vector of the first function is not greater than a preset threshold, it is determined that the search result does not include the first function.
7. The device function search method according to claim 5, wherein, the step of determining the search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each of the plurality of functions includes: sorting the semantic similarities corresponding to the at least one second semantic feature vector to obtain a similarity ranking of each of the plurality of functions; and determining at least one first function in the search result from the plurality of functions according to the similarity ranking of each of the plurality of functions.
8. The device function search method according to claim 1, wherein, the method further includes: establishing an initial natural language model, wherein a plurality of weight parameters of the initial natural language model are floating-point numbers; and quantizing the plurality of weight parameters of the initial natural language model into corresponding integers to obtain the natural language model.
9. The device function search method according to claim 1, wherein, before the step of generating the first semantic feature vector of the search statement by using the natural language model, the method further includes: translating the search statement from a second language to a first language.
10. An electronic device, wherein, comprising: an input device; a storage device for recording a plurality of instructions; a processor coupled to the input device and the storage device, configured to execute the plurality of instructions and configured to: obtain a search statement via the input device; generate a first semantic feature vector of the search statement by using a natural language model; determine the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each of the plurality of functions; and determine a search result corresponding to the search statement according to the semantic similarity between the first semantic feature vector of the search statement and at least one second semantic feature vector of each of the plurality of functions, wherein the search result includes at least one of the plurality of functions.