Searching method and electronic equipment
By constructing indexing information files in electronic devices, local search is realized without pulling up the application process, solving the problem of long search time and high power consumption in existing technology, and improved search efficiency.
Patent Information
- Application Number
- CN202411228745.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-12
- Publication Date
- 2025-01-21
AI Technical Summary
When conducting local searches, existing electronic devices need to pull up the process of each application, resulting in increased search time and increased power consumption.
By constructing indexing information files in electronic devices, you do n’t need to pull up the application process when you conduct local search, and search directly in the index information file to obtain the search results.
Save the search time, reduce the power consumption in search, and improve the search efficiency.
Smart Images

Figure CN119336778A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a search method and an electronic device. Background Art
[0002] After the electronic device starts the application, the data generated in the application can be recorded in the searchable content of the application. The electronic device can pull up each application through the local search function, so that each application searches in its corresponding searchable content to obtain search results.
[0003] The local search function provided by electronic devices is an intelligent service. Through the local search function, electronic devices can search based on the query content entered by the user and obtain search results corresponding to the query content. Then, some or all search results are displayed. When electronic devices search based on the query content to obtain search results, there are usually three basic steps. These three basic steps include query understanding, query recall, and sorting.
[0004] Among them, query understanding refers to analyzing and understanding the query content based on the semantics of the query content and other information, and further obtaining the understanding result corresponding to the query content (also known as the query understanding result), which can reflect the user's intention. Retrieval recall is to search in the searchable content based on the understanding result, and find the content related to the query content as the search result. Sorting refers to sorting the search results according to criteria such as relevance or importance, so that the search results are arranged in descending order of relevance, so that search results with higher relevance can be displayed. Summary of the invention
[0005] The present application provides a search method and an electronic device. The electronic device constructs an index information file. When performing a local search, the electronic device does not need to pull up the processes in each application. Instead, the electronic device searches the index information file based on the query content through the search application to obtain search results. This can save search time and reduce power consumption during the search.
[0006] In a first aspect, the present application provides a search method, the method comprising: an electronic device records first content generated by a first application into an index information file, the index information file including an index value for describing the first content; the index information file also includes an index value for describing second content generated by a second application; the electronic device detects a search operation in a search application, the electronic device searches in the index information file to obtain search results; the electronic device displays based on the search results, the search results including part or all of the index value describing the first content.
[0007] In the above embodiment, the first content generated by the first application can be the dynamic searchable content (including the business data and dynamic function data generated by the first application) involved in the application during operation in the following description. An example of the first application can be the "settings" application, "notes" application, etc., which are exemplified in the description. The electronic device can record the first content generated by the first application during operation into the index information file. Among them, the recording method is to generate an index value based on the first content, and the index value can be used to describe the first content. Similarly, for other applications different from the first application (such as the second application), the electronic device can also record the second content generated by the second application (including the business data and dynamic searchable content generated by the second application) into the index information file. The recording method here is to generate an index value based on the second content. For the process of generating the index value, refer to the content in the following embodiment, which will not be repeated here. Subsequently, the electronic device does not need to pull up the first application, that is, it can search for the first content in the first application based on the index information file, and display part or all of the index values describing the first content. When searching, it is a unified search performed in the index information file, and does not involve the content search of each application (including the first application), which can save search time and reduce power consumption in the search.
[0008] In combination with the first aspect, in some embodiments, when the electronic device searches in the index information file, the first application is not running.
[0009] In combination with the first aspect, in some embodiments, after the first application generates the first content, a new field is added to the index information file, and the index value corresponding to the new field is obtained according to the index construction method preset by the first application, and the index value corresponding to the new field is included in the index value describing the first content.
[0010] In the above embodiment, the newly added field may be a custom field involved in the embodiment. The index construction method corresponding to the newly added field is defined by the first application. In this way, the field types in the index information file can be enriched, so that richer content can be returned when searching based on the index information file, and a more comprehensive search can be achieved.
[0011] In combination with the first aspect, in some embodiments, before adding a new field to the index information file, the method further includes: the electronic device adds the index construction method specified by the first application to the index template.
[0012] In the above embodiment, at least one field and the index construction method corresponding to each field may be recorded in the index template. The at least one field includes a system field and a newly added field. Among them, the index construction method corresponding to the system field is pre-set in the index template, and the index construction method corresponding to the newly added field is added by the electronic device based on the application (e.g., the first application) in the electronic device during use, so that the index template can be enriched.
[0013] In combination with the first aspect, in some embodiments, the method also includes: the electronic device adds the matching method and the retrieval and understanding method corresponding to the newly added field to the index template, and the retrieval and understanding method corresponding to the newly added field is used to specify the method for retrieving and understanding the query content to obtain an understanding result; the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the understanding result.
[0014] In combination with the first aspect, in some embodiments, the electronic device records the first content generated by the first application into an index information file, specifically including: the electronic device records the index value describing the first content into a first sub-file of the index information file based on a first file path; the first file path carries the name of the index information file and the name of the first sub-file.
[0015] In the above embodiment, the index information file can be divided into sub-files according to the vertical domain. For example, the index value established by the first content generated by the first application can be regarded as the vertical domain corresponding to the first application, and therefore can be recorded in the index information sub-file (first sub-file) corresponding to the first application. In this way, it is convenient to classify and manage the content in the index information file.
[0016] In combination with the first aspect, in some embodiments, the first subfile also includes a first document established by the electronic device based on the first content; the first document includes fields in the first content and field values corresponding to the fields; and the first document is associated with the index value of the field value in the first document.
[0017] In combination with the first aspect, in some embodiments, the index template includes, in addition to the first sub-file, a second sub-file, and the second sub-file is used to record an index value describing the second content generated by the second application, or is also used to record a second document established by the electronic device based on the second content; the second document includes fields in the second content and field values corresponding to the fields; the second document is associated with the index value of the field value in the second document.
[0018] In conjunction with the first aspect, in some embodiments, the electronic device searches in the index information file, specifically including:
[0019] The electronic device performs search and understanding processing on the query content based on the search and understanding method corresponding to the non-empty field, and obtains the understanding result corresponding to the non-empty field; the non-empty field is a field with an index value in the index information file; the query content is the content acquired by the electronic device after detecting the search operation in the search application; the electronic device determines the index value that successfully matches the understanding result corresponding to the non-empty field in the index value corresponding to the non-empty field according to the matching method corresponding to the non-empty field based on the understanding result corresponding to the non-empty field; the index value corresponding to the non-empty field is the index value obtained in the index information file based on the index construction method corresponding to the non-empty field; the electronic device determines the document associated with the successfully matched index value as the search result.
[0020] In the above embodiment, the non-empty field may be a searchable field mentioned in the specification. The non-empty field may be understood as M1 searchable fields mentioned in the specification, where M1 is an integer greater than or equal to 1.
[0021] In combination with the first aspect, in some embodiments, before the electronic device performs retrieval and understanding processing on the query content based on the retrieval and understanding method corresponding to the non-empty field, the method also includes: the electronic device obtains the sub-file allowed to be accessed by the search application from the index information file based on the file path of the sub-file allowed to be accessed by the search application in the index information file; the sub-file allowed to be accessed by the search application includes the first sub-file or the second sub-file; the electronic device determines the field with an index value in the sub-file allowed to be accessed by the search application as the non-empty field.
[0022] In the above embodiment, the electronic device can configure the sub-files in the index information file that the search application is allowed to access. Different search applications are allowed to access different sub-files. The electronic device can search based on the sub-files that the search application is allowed to access.
[0023] In combination with the first aspect, in some embodiments, when the sub-file allowed to be accessed by the search application is configured to use an error correction result, the method further includes: the electronic device performs error correction processing on the query content to obtain an error correction result; and the electronic device determines, based on the error correction result, an index value that successfully matches the error correction result from the index value recorded in the sub-file allowed to be accessed by the search application.
[0024] In the above embodiment, the error correction result can be understood as the content obtained after the query content is corrected. Different sub-files can be configured whether to use the error correction result. Whether the different vertical domains involved in the description can use the error correction result is to describe whether the sub-files corresponding to different vertical domains use the error correction result.
[0025] In combination with the first aspect, in some embodiments, after the electronic device determines the document associated with the successfully matched index value as a search result, the method also includes: the electronic device aggregates the search results determined in the same sub-file allowed to be accessed by the search application into a group, and displays the search results in a display box.
[0026] In combination with the first aspect, in some embodiments, the method also includes: when the first application is running, an operation of inputting query content in the first application is detected; when the query content includes L query terms, the first application defines a retrieval understanding method and a matching method when searching based on the query content; L is an integer greater than or equal to 2; there is a space between two adjacent query terms among the L query terms when they are input; the first application calls a search service application to query the index information file for content related to the query content in the first application through the query content, the retrieval understanding method and the matching method when searching based on the query content.
[0027] In the above embodiment, the first application may also be understood as the application with an in-application search function mentioned in the specification (application 4).
[0028] In combination with the first aspect, in some embodiments, the first application calls a search service application to query the index information file for content related to the query content in the first application through the query content, the retrieval understanding method and the matching method when searching based on the query content, specifically including: the search service performs retrieval and understanding processing on the query content according to the retrieval understanding method when searching the query content to obtain an understanding result of the query content; the search service application queries the first subfile in the index information file for content related to the query content based on the understanding result of the query content and according to the matching method when searching the query content; the first subfile includes an index value for describing the first content.
[0029] In a second aspect, the present application provides a search method, which includes: an electronic device runs a first application; the electronic device records first content generated by the first application into an index information file, and compared with before the recording, a new field is added to the index information file, and the index value corresponding to the new field is obtained according to the index construction method specified by the first application, and the index value corresponding to the new field is used to describe the first content; the electronic device detects a search operation in the search application, the electronic device searches in the index information file, and displays based on the search results, and the search results include part or all of the field values describing the first content, and the part or all of the field values are included in the index value corresponding to the new field.
[0030] In the above embodiment, the first content generated by the first application can be the dynamic searchable content (including the business data and dynamic function data generated by the first application) involved in the application during operation in the following description. An example of the first application can be the "settings" application, "notes" application, etc. illustrated in the description. The electronic device can record the first content generated by the first application during operation into the index information file. Among them, the recording method is to generate an index value based on the first content, and the index value can be used to describe the first content. Similarly, for other applications different from the first application (such as the second application), the electronic device can also record the second content generated by the second application (including the business data and dynamic searchable content generated by the second application) into the index information file. The recording method here is to generate an index value based on the second content. For the process of generating the index value, please refer to the content in the following embodiment, which will not be repeated here. Subsequently, the electronic device does not need to pull up the first application, that is, it can search for the first content in the first application based on the index information file, and display part or all of the index values describing the first content. When searching, it is a unified search performed in the index information file, and does not involve the content search of each application (including the first application), which can save search time and reduce power consumption in the search. The newly added field can be a custom field involved in the embodiment. The index construction method corresponding to the newly added field is defined by the first application. In this way, the field types in the index information file can be enriched, so that richer content can be returned when searching based on the index information file, and a more comprehensive search can be achieved.
[0031] In combination with the second aspect, in some embodiments, when the electronic device searches in the index information file, the first application is not running.
[0032] In combination with the second aspect, in some embodiments, before adding a new field to the index information file, the method further includes: the electronic device adds the index construction method specified by the first application to the index template.
[0033] In the above embodiment, at least one field and the index construction method corresponding to each field may be recorded in the index template. The at least one field includes a system field and a newly added field. Among them, the index construction method corresponding to the system field is pre-set in the index template, and the index construction method corresponding to the newly added field is added by the electronic device based on the application (e.g., the first application) in the electronic device during use, so that the index template can be enriched.
[0034] In combination with the second aspect, in some embodiments, the method also includes: the electronic device adds the matching method corresponding to the newly added field to the index template, and the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the query content, and the query content is the content obtained when a search operation is detected in the search application.
[0035] In combination with the second aspect, in some embodiments, the method also includes: the electronic device adds the matching method and the retrieval and understanding method corresponding to the newly added field to the index template, and the retrieval and understanding method corresponding to the newly added field is used to specify the method for retrieving and understanding the query content to obtain an understanding result; the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the understanding result.
[0036] In combination with the second aspect, in some embodiments, the electronic device records the first content generated by the first application into an index information file, specifically including: the first application sends the first content to a search service application by calling a first interface; the search service application records the first content into the index information file.
[0037] In combination with the second aspect, in some embodiments, the electronic device records the first content generated by the first application into an index information file, specifically including: the first application records the first content into a database corresponding to the first application; the search service application obtains the first content from the database; the search service application records the first content into the index information file.
[0038] In combination with the second aspect, in some embodiments, the search service application records the first content into the index information file, specifically including: the search service application establishes index values for the field values corresponding to the fields in the first content based on the index construction methods corresponding to the fields in the first content, and obtains the indexes of the field values; the index value of a field value includes the field value itself, or also includes an extended value of the field value; the fields include the newly added field, and the index construction methods corresponding to different fields in the fields are different; the search service application records the index values of the field values into the index information file, and the field corresponding to the index value corresponding to the field value in the index information file is the same as the field corresponding to the field value in the first content.
[0039] In combination with the second aspect, in some embodiments, the index construction method corresponding to the newly added field is recorded in the index sub-template of the first application in the index template; the index construction method corresponding to the system field is also recorded in the index sub-template of the first application; the index construction method corresponding to the system field is also recorded in the index sub-template of the second application in the index template, and the fields included in the index sub-template of the second application and the index construction method corresponding to the field are the system fields and the index construction method corresponding to the system fields.
[0040] In combination with the second aspect, in some embodiments, the search service application records the index value of each field value in an index information file, specifically including: the search service application records the index value of each field value in the first sub-file of the index information file based on the file path; the file path carries the name of the index information file and the name of the first sub-file, and the first sub-file is used to record the index value established based on the content generated by the first application.
[0041] In combination with the second aspect, in some embodiments, the first sub-file also includes a document created by the electronic device based on the first content; the document includes fields in the first content and field values corresponding to the fields; and the document is associated with the index value of the field value in the document.
[0042] In combination with the second aspect, in some embodiments, the index template includes, in addition to the first sub-file, a second sub-file, and the second sub-file is used to record an index value established based on content generated by other applications, or to record an index value established based on the first application and the second content in the other application; the second content is the content that the first application and the other application have before they are opened for the first time after installation.
[0043] In the above embodiment, the second content may be static functional data provided by the application.
[0044] In conjunction with the second aspect, in some embodiments, the electronic device searches in the index information file, specifically including:
[0045] The electronic device performs search and understanding processing on the query content based on the search and understanding method corresponding to the non-empty field, and obtains the understanding result corresponding to the non-empty field; the non-empty field is a field with an index value in the index information file; the query content is the content acquired by the electronic device after detecting the search operation in the search application; the electronic device determines the index value that successfully matches the understanding result corresponding to the non-empty field in the index value corresponding to the non-empty field according to the matching method corresponding to the non-empty field based on the understanding result corresponding to the non-empty field; the index value corresponding to the non-empty field is the index value obtained in the index information file based on the index construction method corresponding to the non-empty field; the electronic device determines the document associated with the successfully matched index value as the search result.
[0046] In combination with the second aspect, in some embodiments, before the electronic device performs retrieval and understanding processing on the query content based on the retrieval and understanding method corresponding to the non-empty field, the method also includes: the electronic device obtains the sub-file allowed to be accessed by the search application from the index information file based on the file path of the sub-file allowed to be accessed by the search application in the index information file; the sub-file allowed to be accessed by the search application includes the first sub-file or the second sub-file; the electronic device determines the field with an index value in the sub-file allowed to be accessed by the search application as the non-empty field.
[0047] In combination with the second aspect, in some embodiments, when the sub-file allowed to be accessed by the search application is configured to use an error correction result, the method also includes: the electronic device performs error correction processing on the query content to obtain an error correction result; and the electronic device determines, based on the error correction result, an index value that successfully matches the error correction result from the index value recorded in the sub-file allowed to be accessed by the search application.
[0048] In combination with the second aspect, in some embodiments, after the electronic device determines the document associated with the successfully matched index value as a search result, the method also includes: the electronic device aggregates the search results determined in the same sub-file allowed to be accessed by the search application into a group, and displays the search results in a display box.
[0049] In combination with the second aspect, in some embodiments, when the search application is the first application, the sub-file accessed by the search application is the first sub-file.
[0050] In a third aspect, the present application provides a search method, the method comprising: an electronic device installs a first application; the installation package of the first application includes field information, and the field information is used to describe a first function of the first application; in response to the completion of the installation of the first application, the index information file of the electronic device includes a first index value describing the first function, and the first index value is related to the field information, and the index information file also includes a second index value describing the second function of the second application; in response to a first operation on the search application, the electronic device displays search results, and the search results include part or all of the index values related to the first function in the index information file, wherein the first application is not in a running state.
[0051] In the above embodiment, the first function of the first application can be a static function involved in the following description. The field information can be recorded in the search configuration file in the installation package of the first application. The first operation can be understood as a search operation for the search application when the first application is not running. An example of the first application can be the "settings" application, "notes" application, etc. illustrated in the description. The electronic device can record the first function of the first application in the index information file. Among them, the recording method is to generate an index value (first index value) based on the field information in the installation package of the first application, and the first index value can be used to describe the first function. Similarly, for other applications different from the first application (such as the second application), the electronic device can also record the static function (second function) of the second application in the index information file. The recording method here is to generate an index value (second index value) based on the field information in the installation package of the second application. For the process of generating the index value, refer to the content of the following embodiment, which will not be repeated here. Subsequently, the electronic device does not need to pull up the first application, that is, it can search for the first function in the first application based on the index information file, and display part or all of the index values related to the description of the first function. During the search, a unified search is performed in the index information file, and the content search of each application (including the first application) is not involved, which can save search time and reduce power consumption during the search.
[0052] In combination with the third aspect, in some embodiments, the method also includes: in response to a second operation on the search application, the electronic device displays search results, the search results including part or all of the index values related to the first function in the index information file, wherein the first application is in a running state.
[0053] In the above embodiment, the second operation can be understood as a search operation for the search application when the first application is running. The process in which the electronic device performs a search operation in the search application to obtain search results and displays them based on the search results has nothing to do with whether the first application is running because the first application does not need to be involved.
[0054] In combination with the third aspect, in some embodiments, the first index value includes an index value corresponding to a field value in the field information, and an index value corresponding to a field value includes the field value itself, or also includes an extended value of the field value.
[0055] In conjunction with the third aspect, in some embodiments, the method further includes:
[0056] The electronic device records the first index value and the second index value into a first sub-file of the index information file based on a first file path, wherein the first file path carries the name of the index information file and the name of the first sub-file.
[0057] In the above embodiment, the index information file can be divided into sub-files according to the vertical domain. For example, the first index value and the second index value, which are index values established based on the static functional data of the application, can be considered to correspond to the "application function" vertical domain, so the first index value and the second index value can be recorded in the index information sub-file (first sub-file) corresponding to the "application function" vertical domain. In this way, it is convenient to classify and manage the content in the index information file.
[0058] In combination with the third aspect, in some embodiments, the first sub-file also includes a first document established by the electronic device based on the field information, the first document includes a field in the field information that describes a first function and a field value corresponding to the field, and the first document is associated with the first index value.
[0059] In combination with the third aspect, in some embodiments, the method further includes: after the electronic device runs the first application to generate the first content, the index information file also includes a third index value describing the first content.
[0060] In the above embodiment, the first content generated by the first application can be the dynamic searchable content involved in the application during operation in the following specification (including business data and dynamic function data generated by the first application). The electronic device can record the first content generated by the first application during operation into the index information file. The recording method is to generate an index value (third index value) based on the first content, and the third index value can be used to describe the first content.
[0061] In combination with the third aspect, in some embodiments, after the first application generates the first content, a new field is added to the index information file, and the index value corresponding to the new field is obtained according to the index construction method preset by the first application, and the index value corresponding to the new field is included in the third index value.
[0062] In the above embodiment, the newly added field may be a custom field involved in the embodiment. The index construction method corresponding to the newly added field is defined by the first application. In this way, the field types in the index information file can be enriched, so that richer content can be returned when searching based on the index information file, and a more comprehensive search can be achieved.
[0063] In combination with the third aspect, in some embodiments, the electronic device also includes an index template, which includes at least one field and an index construction method corresponding to each of the at least one field, and the index construction method corresponding to a field is used to establish an index value for the field value corresponding to the field.
[0064] In the above embodiment, the index template may record at least one field and the index construction method corresponding to each field. The at least one field includes a system field. The index construction method corresponding to the system field is pre-set in the index template.
[0065] In combination with the third aspect, in some embodiments, the method further includes: the electronic device adds the index building method preset by the first application to the index template.
[0066] In the above embodiment, in addition to recording the system fields and the index construction methods corresponding to the system fields, the index template also includes newly added fields and the index construction methods corresponding to the newly added fields. The index construction methods corresponding to the newly added fields are newly added by the electronic device based on the application (e.g., the first application) in the electronic device during use, which can enrich the index template.
[0067] In combination with the third aspect, in some embodiments, the method also includes: the electronic device adds the matching method corresponding to the newly added field to the index template, and the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the query content, and the query content is the content obtained when the first operation is detected in the search application.
[0068] In combination with the third aspect, in some embodiments, the method also includes: the electronic device adds the matching method and the retrieval and understanding method corresponding to the newly added field to the index template, the retrieval and understanding method corresponding to the newly added field is used to specify the method for retrieving and understanding the query content to obtain an understanding result; the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the understanding result; the query content is the content obtained when the first operation is detected in the search application.
[0069] In combination with the third aspect, in some embodiments, the method also includes: the electronic device records the third index value into a second sub-file of the index information file based on a second file path, and the second file path carries the name of the index information file and the name of the second sub-file.
[0070] In the above embodiment, the second subfile may be an index information subfile corresponding to the vertical domain of the first application. For example, when the first application is a "notes" application, the second file may be an index information subfile corresponding to the "notes" application. The second subfile is used to record the content generated by the "notes" application.
[0071] In combination with the third aspect, in some embodiments, the second sub-file also includes a second document established by the electronic device based on the first content; the second document includes fields in the first content and field values corresponding to the fields; and the second document is associated with the third index value.
[0072] In combination with the third aspect, in some embodiments, the index information file includes, in addition to the second sub-files, a third sub-file for recording a fourth index value; wherein the fourth index value is used to describe the content generated after the second application is run.
[0073] In combination with the third aspect, in some embodiments, the method further includes: the first application sends the first content to the search service application by calling the first interface; and the search service application records the first content into the index information file.
[0074] In the above embodiment, in the above embodiment, the first interface may be the index building interface involved in the specification.
[0075] In combination with the third aspect, in some embodiments, after the first application generates the first content, the method also includes: the first application records the first content in a database corresponding to the first application; the search service application obtains the first content from the database; and the search service application records the first content in the index information file.
[0076] In the above embodiment, if the first application is not configured with the first interface, the search service application can use database plug-in to obtain the first content from the database corresponding to the first application, and then record the first content in the index information file.
[0077] In combination with the third aspect, in some embodiments, the search service application records the first content into the index information file, specifically including: the search service application establishes an index value for the field value corresponding to the field in the first content based on the index construction method corresponding to the field in the first content, to obtain the third index value; wherein the field in the first content includes the newly added field, and there are different index construction methods corresponding to different fields in the first content; the search service application records the third index value into the index information file.
[0078] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to execute a method implemented in at least one of the first aspect, the second aspect, or the third aspect.
[0079] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute a method implemented in at least one of the first aspect, the second aspect, or the third aspect.
[0080] In the sixth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions to enable the electronic device to execute a method implemented in at least one of the first aspect, the second aspect or the third aspect.
[0081] In a seventh aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on an electronic device, enables the electronic device to execute a method implemented in at least one of the first aspect, the second aspect, or the third aspect.
[0082] It is understandable that the electronic device provided in the fourth aspect, the computer storage medium provided in the fifth aspect, the chip system provided in the sixth aspect, and the computer program product provided in the seventh aspect are all used to execute the method provided in the embodiment of the present application. Therefore, other beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] Figure 1 A schematic diagram showing searching for searchable content in each application is shown;
[0084] Figure 2 The process of searching the application's searchable content based on the provider class to obtain search results is shown;
[0085] Figure 3A-3C A schematic diagram showing an electronic device obtaining a static function and recording static function data into index information;
[0086] Figure 3D-Figure 3F Another schematic diagram showing an electronic device obtaining a static function and recording static function data into index information;
[0087] Figure 4A-4B A schematic diagram showing an electronic device generating a dynamic function based on an application and recording dynamic function data corresponding to the dynamic function into index information;
[0088] Figure 5A-5D A schematic diagram showing an electronic device generating business data based on an application and recording the business data into index information;
[0089] Fig. 6A as well as Figure 6B A schematic diagram showing an electronic device implementing a local search function based on index information;
[0090] Figure 7A-7E An exemplary user interface for an electronic device to display search results according to vertical domains is shown;
[0091] Figure 8 An exemplary manner in which an electronic device generates an index based on static searchable content and dynamic searchable content is shown;
[0092] Fig. 9 An exemplary software structure framework involved in generating index information and searching based on the index information is shown;
[0093] Fig.10 An exemplary software structure framework and processing flow for establishing and recording an index by searching a configuration file are shown;
[0094] Fig.11 An exemplary interaction process between internal modules when creating and recording indexes and documents through search configuration files is shown;
[0095] Fig.12 An exemplary software structure framework and processing flow for establishing and recording indexes through a configuration interface are shown;
[0096] Fig.13 It shows an exemplary interaction process between internal modules when configuring the interface to establish and record indexes and documents;
[0097] Fig.14 An exemplary software structure framework and processing flow for establishing and recording indexes through database plug-in are shown;
[0098] Fig.15It shows an exemplary interaction process between internal modules when database instrumentation establishes and records indexes and documents;
[0099] Fig.16 An exemplary software structure framework and processing flow for implementing search through index information are shown;
[0100] Fig.17 An exemplary interaction process between internal modules when searching is performed through index information is shown;
[0101] Fig.18 A schematic diagram showing the input of query content for searching;
[0102] Fig.19 A schematic diagram showing a search including L query terms in the query content;
[0103] Fig. 20 An exemplary flow chart showing an electronic device obtaining an index information file and searching based on the index information file is shown;
[0104] Fig.21 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0105] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to and includes any or all possible combinations of one or more listed items.
[0106] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0107] In one solution, the electronic device records the data of the application in units of applications. After the electronic device opens the application, the data generated by the application can be recorded in the searchable content corresponding to the application. The searchable content can be stored in the application. For example, if the electronic device creates a new note in the "Notes" application, the data corresponding to the note can be recorded in the "Notes" application. Subsequently, the electronic device can pull up each application to search for the data recorded by each application.
[0108] Figure 1 A schematic diagram is shown when searching for searchable content in each application.
[0109] like Figure 1 As shown, first, the electronic device turns on the search function and obtains the input query content. Then, the electronic device pulls up the process in each application to search. The search involves multiple applications as a multi-threaded search. During the search process, each application independently searches for content related to the query content in the recorded searchable content through its own process. Among them, the searchable content recorded by the application includes data generated by the application. The search results when the application searches are obtained based on the content related to the query content. For example, the applications whose processes are pulled up may include applications such as "Notes" and "Address Book". Among them, the "Notes" application and the "Address Book" application can respectively search for content related to the query content in the searchable content recorded by each application, and return the search results respectively. The electronic device waits for each application to return the search results. After obtaining the search results returned by each application, the electronic device displays based on the search results.
[0110] The search function may be integrated into a search application, and the display form of the search application in the electronic device includes but is not limited to an input box or an icon, etc. The application whose process is pulled up may be referred to as a searched application.
[0111] In some possible cases, the electronic device can use the provider class corresponding to each application to pull up the process of each application for search. The provider class is provided by the application developer, and the provider class can be recorded in the search service tool when the application is installed. The search service tool can be called by the search application to perform search-related operations so that the electronic device can complete the search. Figure 2 A detailed description is given of how an electronic device searches for data recorded in an application based on a provider class to obtain and display search results.
[0112] Figure 2 The process of obtaining search results by searching the searchable content of an application based on the provider class is shown.
[0113] like Figure 2 As shown, the process of how the electronic device searches for the content recorded in the application based on the provider class to obtain and display the search results can refer to the following description of steps S1 to S8.
[0114] S1. The search application obtains the input query content.
[0115] The search application can provide users with multiple ways to input query content, including but not limited to voice input or keyboard input.
[0116] S2. Search applications and obtain the provider class corresponding to each application through the search service tool.
[0117] The provider class corresponding to each application may include the provider class corresponding to the searched application A and the provider class corresponding to the searched application B. An example of the searched application A may be the aforementioned "notes" application. An example of the searched application B may be the aforementioned "contact book" application.
[0118] Subsequently, the search service tool pulls up the processes in each application through the provider class corresponding to each application. Each application searches for content related to the query content in the searchable content recorded by each application based on its corresponding process, obtains the search results, and returns the search results to the search service tool. In the following, the process is described by taking the searched application A and the searched application B as examples.
[0119] The process in which the searched application A obtains the search results and returns the search results to the search service tool may refer to the following description of steps S3a-S5a.
[0120] S3a. The search service tool starts the process of the application A being searched through the provider class corresponding to the application A being searched.
[0121] S4a. The searched application A searches in application A based on the query content and obtains search result A.
[0122] S5a. The searched application A returns the search result A to the search service tool.
[0123] The process of the searched application B obtaining the search results and returning the search results to the search service tool can refer to the following description of steps S3b-S5b.
[0124] S3b. The search service tool starts the process of the application B being searched through the provider class corresponding to the application B being searched.
[0125] S4b. Search in application B based on the query content to obtain search result B.
[0126] S5b. The searched application B returns the search result B to the search service tool.
[0127] S6. The search service tool determines search results whose relevance meets the requirements based on the search results.
[0128] In some possible cases, the search results that meet the relevance requirement may include the first Q search results that are most relevant to the query content among the search results, where Q is an integer greater than or equal to 1.
[0129] The search service tool waits for each application to return the search results. After the search service tool obtains the search results returned by each application, the search service tool determines the search results whose relevance meets the requirements based on each search result.
[0130] S7. The search service tool returns search results that meet the relevance requirements to the search application.
[0131] S8. The search application displays search results that meet the requirements for relevance.
[0132] It can be seen that an electronic device needs to launch multiple application processes to complete a search. If an electronic device runs many processes, it will have the problem of high power consumption. In addition, when searching, the electronic device needs to wait until each application returns the search results obtained by each search before it can determine the search results that meet the requirements based on the search results, which leads to a long delay.
[0133] In view of the high power consumption and high latency problems caused by the need to pull up each application during the aforementioned search, a search method is proposed. The electronic device can record the searchable content corresponding to each application in the index information in accordance with the index template. The index information can be stored in the index information file. Later, after detecting the input query content, the electronic device does not need to pull up the process in each application, but obtains the index information in the index information file, and then searches in the index information based on the query content to obtain the search results. The search results can cover the application content that matches the query content in each application. For example, the electronic device generates a contact information (for example, lily, 122XXX1) in the "Contact Book" application. An email is generated in the "Mailbox" application, and the email content also includes the contact information. The electronic device can record the contact information and the email content in the index information in accordance with the index template. Later, when the query content (for example, lily, 122XXX1) is detected, the contact information and emails including "lily, 122XXX1" can also be found in the index information without pulling up the "Contact" application and the "Mailbox" application. It should be understood here that the way in which an electronic device represents a searchable content can be realized through fields and field values corresponding to each field. Fields can be used to describe the properties of different parts in the searchable content. Fields can include titles, descriptions, time, etc. Field values can be used to describe the specific values of different parts in the searchable content. One function of the index template is to provide certain rules so that the electronic device can index the field values based on the fields corresponding to each field value in the searchable content, and obtain the index corresponding to each field value in the searchable content. The index corresponding to each field value in the searchable content can also represent the searchable content. An index corresponding to a field value can be used to represent the field value. The index corresponding to a field value can include the field value itself, or it can also include other extended values derived from the field value that can represent the field value (such as extended values such as the segmentation of the field value). The role of the index information is to centralize the indexes corresponding to each searchable content to facilitate the use of the index (for example, searching based on the index). Among them, the index corresponding to a searchable content is the index corresponding to each field value in the searchable content.
[0134] In some possible cases, the index corresponding to a field value may also be referred to as the index value corresponding to the field value, or the index value of the field value.
[0135] In some possible cases, the format of the file storing the index template and the index information may be in lucene format.
[0136] The index template and index information are described in detail below.
[0137] The index template defines the rules for creating and using indexes, and may include at least one field and the attributes corresponding to each field.
[0138] Table 1 shows an exemplary index template.
[0139] Table 1
[0140]
[0141] As described in Table 1, the fields in the index template may include title, description, phone number, etc. The attributes corresponding to the index may include index construction method, matching method, and query understanding method, etc.
[0142] The index template is described in detail below in conjunction with Table 1.
[0143] The fields in the index template specify the fields and field values in the searchable content that can be used to generate an index. For example, an electronic device generates a contact information through the "Address Book" application. The contact information may include a "Title" field and a field value corresponding to the "Title" field (for example, "Maintenance Phone"), and may also include a "Phone Number" field and a field value corresponding to the "Phone Number" field (for example, "152XXX"), etc. In the case where the "Title" field and the "Phone Number" field are included in the index template, the electronic device can establish an index based on the field value corresponding to the "Title" field and the field value corresponding to the "Phone Number" field in the contact information. Among them, the detailed description of establishing the index can refer to the following description of the attributes corresponding to each field.
[0144] The attributes corresponding to each field in the index template may include the index construction method corresponding to each field and the matching method corresponding to each field. One field corresponds to one index construction method and one matching method.
[0145] Among them, the index construction method corresponding to a field is used to indicate: how to establish the index corresponding to the field value through the field value corresponding to the field. The index corresponding to the field value can be used to represent the field value. For other descriptions about the index, please refer to the aforementioned content and will not be repeated here. The index construction method for a field may include taking the field value. Among them, the method of taking the field value can be the default and will not be emphasized below. In addition to taking the field value, the index construction method corresponding to a field may also include but is not limited to one or more of the following construction forms.
[0146] Index building form 1: preprocessing.
[0147] The preprocessing in the index building method can be used to preprocess the field value to obtain a preprocessing result that is more in line with the specifications of this article. The preprocessing in the index building method includes one or more of unifying the case of the field value, converting the full-width characters in the field value to half-width characters, deleting the space symbols in the field value, and converting the traditional characters in the field value to simplified characters.
[0148] Index construction form 2: word segmentation.
[0149] The word segmentation in the index construction method means: using word segmentation technology to divide the field value into R words. R can be an integer greater than or equal to 1. For example, the field value "maintenance phone number" is segmented, and the segmentation result can include 2 words, namely "maintenance" and "phone number".
[0150] Index construction form 3: word segmentation pinyin.
[0151] The word segmentation pinyin in the index construction method refers to: generating the pinyin of each word segmentation corresponding to the field value. For example, for the field value "maintenance phone", when the word segmentation results are "maintenance" and "phone", the corresponding word segmentation pinyin results are "weixiu" and "dianhua".
[0152] Index building form 4: initial pinyin. The initial pinyin result includes the first pinyin letter of each character in the field value.
[0153] It should be understood that the aforementioned preprocessing results, word segmentation results, word segmentation pinyin results and initial pinyin results can all be referred to as extended values. In addition to the aforementioned index construction forms, an index construction method can also include other index construction forms, which are not limited in the present application embodiment.
[0154] Here, we take the example of building an index for a field value corresponding to the "Title" field based on the index building method corresponding to the "Title" field as an example for an exemplary description. For example, the index building method corresponding to the "Title" field is: "get field value + preprocessing + word segmentation + word segmentation pinyin + initial pinyin". A field value corresponding to the "Title" field is "Maintenance Phone" in the aforementioned contact information. Then the index built for the field value of "Maintenance Phone" based on the index building method corresponding to the "Title" field is: "Maintenance Phone (field value) + Maintenance Phone (preprocessing result) + Maintenance, Phone (word segmentation result) + weixiu, dianhua (word segmentation pinyin result) + wxdh (initial pinyin result)".
[0155] It should be understood here that the index construction methods for different fields can be the same or different. The corresponding index construction method can be set according to the meaning of each field. As shown in Table 1, the index construction method corresponding to the "Title" field can be: "Get field value + preprocessing + word segmentation + word segmentation pinyin + first letter pinyin". The index construction method corresponding to the "Description" field can be: "Get field value + preprocessing + word segmentation + word segmentation pinyin". The index construction method corresponding to the "Phone Number" field can be: Get field value. Among them, the "Title" field can usually be the application name, application function name, contact name, file (notes or emails, etc.) name, etc. The "Description" field can usually be the body of the file, a description of the application name, function name, etc.
[0156] The matching method corresponding to a field can be used to indicate how to determine the field value or extended value (such as the extended value of the field value such as the word segmentation) that successfully matches the query content when the query content is matched with the index corresponding to the field.
[0157] The matching method corresponding to a field may include but is not limited to one or more of the following matching forms.
[0158] Matching form 1: word segmentation and matching.
[0159] Word segmentation and matching means: using the word segmentation results of the query content to match the index corresponding to the field to determine the successfully matched index (field value or extended value), and the condition for a field value or extended value to successfully match the query content is: all the word segmentation results of the query content appear in the field value or extended value. Here, the query content is "maintenance phone" as an example. When the word segmentation results of the query content are: "maintenance" and "phone", the successfully matched field value or extended value must contain both the words "maintenance" and "phone".
[0160] Matching form 2: word segmentation or matching.
[0161] Word segmentation or matching means: using the word segmentation result of the query content to match the index corresponding to the field to determine the successfully matched index (field value or extended value), and the condition for a field value or extended value to successfully match the query content is: at least one word segmentation result of the query content appears in the field value or extended value. Here, the query content is "maintenance phone" as an example. When the word segmentation results of the query content are: "maintenance" and "phone", the successfully matched field value or extended value must include at least one of the two word segmentation results "maintenance" and "phone".
[0162] Matching mode 3: prefix matching.
[0163] Prefix matching means: using the query content or the understanding result that can represent the query content to match the index corresponding to the field to determine the successfully matched index (including field value or extended value), and the condition for a field value or extended value to successfully match the query content is: the field value or extended value includes the query content. Here, the query content is "maintenance phone" for example. The successfully matched field value or extended value must at least include the query content "maintenance phone".
[0164] Among them, the understanding result representing the query content may include but is not limited to one or more of the following contents: corrected content obtained after correcting the query content, content obtained after preprocessing the query content (preprocessed query content, referred to as preprocessed content for short).
[0165] Matching mode 4: Exact match.
[0166] Complete match means: using the query content or the understanding result that can represent the query content to match the index corresponding to the field to determine the successfully matched index (field value or extended value), and the condition for a field value or extended value to successfully match the query content is: the field value or extended value is the same as the query content. Here, the query content is "maintenance phone" for example. The successfully matched field value or extended value is the same as the query content "maintenance phone".
[0167] In addition to the aforementioned matching forms, other matching forms may also be included, and the embodiments of the present application are no longer limited to this. For example, synonym and matching, synonym or matching, etc. may also be included. Among them, the synonyms may be obtained by taking the synonyms of each word segmentation result based on the query content. Among them, the descriptions of synonym and matching and synonym or matching are similar to those of word segmentation and matching and word segmentation or matching. You can refer to the aforementioned related descriptions and replace the word segmentation with a synonym.
[0168] It should be understood that the matching methods of different fields can be the same or different. As shown in Table 1, the matching method corresponding to the "Title" field can be: "word segmentation and match, prefix match". The matching method corresponding to the "Description" field can be: "word segmentation or match, prefix match". The matching method corresponding to the "Phone Number" field can be: full match.
[0169] In some possible cases, the attributes corresponding to each field in the index template may also include the query understanding method corresponding to each field. One field corresponds to one query understanding method.
[0170] The query understanding method corresponding to a field is used to indicate how to understand the query content before matching the query content with the index corresponding to the field to obtain the understanding result corresponding to the query content. The understanding result can represent the query content.
[0171] In some possible cases, the electronic device may match the index corresponding to the field based on the understanding result and the query content according to the matching method corresponding to the field to determine the successfully matched field value or extended value.
[0172] In some other possible cases, the electronic device may use the understanding result to represent the query content and perform matching with the index corresponding to the field according to the matching method corresponding to the field to determine the successfully matched field value or extended value.
[0173] The query understanding method corresponding to a field may include but is not limited to one or more of the following understanding forms.
[0174] Understanding Form 1: Preprocessing.
[0175] The preprocessing in the query understanding method refers to: preprocessing the query content to obtain the preprocessed query content (referred to as preprocessed content for short).
[0176] Understanding form 2: participle.
[0177] The word segmentation in the query understanding method means: performing word segmentation based on the preprocessed content to obtain the word segmentation results corresponding to the query content.
[0178] Understanding form 3: Find synonyms.
[0179] The synonym extraction in the query understanding method means: extracting synonyms based on the word segmentation results to obtain the synonyms corresponding to each word segmentation result of the query content.
[0180] In addition to the aforementioned understanding forms, other understanding forms may also be included, which are not limited in the embodiments of the present application. For example, query error correction processing may also be included, that is, error correction processing is performed on the query content to obtain the corrected content.
[0181] It should be understood here that, generally speaking, the query understanding method corresponding to a field and the matching method corresponding to the field are interrelated. All the matching types existing in a matching method can be configured with corresponding understanding forms in the query understanding method. For example, when the matching form in the matching method includes word segmentation matching (including word segmentation and matching, word segmentation or matching), the query understanding method can include word segmentation. When the matching form in the matching method includes prefix matching or complete matching, the query understanding method can include one or more of preprocessing and error correction.
[0182] Therefore, it can be understood that, in some possible cases, the index template may not include the query understanding method corresponding to each field, but when obtaining the matching method corresponding to each field, the query content is understood based on the matching method.
[0183] In other possible cases, the query understanding method and matching method corresponding to the field can be defined separately, so that the query understanding method and matching method corresponding to each field can be included in the index template. In this way, it is easy to manage and use the attributes corresponding to each field.
[0184] It should be understood that the matching methods of different fields can be the same or different. As shown in Table 1, the query understanding method corresponding to the "title" field can be: "preprocessing + word segmentation + synonyms". The query understanding method corresponding to the "description" field can be: "preprocessing + word segmentation + synonyms". The query understanding method corresponding to the "phone number" field can be: preprocessing.
[0185] The index information may include the index corresponding to each field value. In some possible cases, the index information may include, in addition to the index corresponding to each field, document information of the document to which each field value belongs.
[0186] For the description of the index corresponding to each field, please refer to the above content and will not be repeated here.
[0187] The document information is described in detail below.
[0188] The document information records the documents to which each field belongs. One searchable content can correspond to at least one document. A document can include fields from the same searchable content and field values corresponding to each field. The indexes corresponding to each field value in a document (including each field value and its extended value) are associated with the document. When the search result is a document, when the electronic device determines a field value or extended value that successfully matches the query content, it can be mapped to the document associated with the field value or extended value and the document can be recalled.
[0189] In some possible cases, the manner in which a document is associated with an index corresponding to each field value in the document (including each field value and its extended value) includes: setting the same identification number for the document, each field value in the document, and the extended value of each field value, so that the electronic device can find the document with the same identification number through the identification number of the field value or the extended value.
[0190] During use, electronic devices can generate a large amount of searchable content through various applications, and generate corresponding indexes for the large amount of searchable content according to the index template and record them in the index information. Therefore, a large number of indexes can be saved in the indexable information. In order to facilitate the management and search of the index, in some possible cases, the electronic device can divide the index information according to the vertical domain to obtain K index information slices. One index information slice corresponds to one vertical domain. It can also be understood that one searchable content can correspond to one vertical domain. When recording the index corresponding to the searchable content, the index corresponding to the searchable content can be recorded in the index information slice corresponding to the vertical domain (corresponding to the searchable content).
[0191] Among them, the vertical domain can be used to describe the type of searchable content. It can also be understood that a vertical domain corresponding to a searchable content can be used to indicate the application from which the searchable content comes, or which index information segment to record. The number of vertical domains and the way of dividing the vertical domains can be determined according to actual usage and should not constitute a limitation on the embodiments of the present application.
[0192] In some possible cases, when recording index information into an index information file. If there are L1 vertical domains, the index information file can include L1 index information sub-files, and one index information sub-file can be regarded as an index information fragment. One index information sub-file corresponds to one vertical domain. The vertical domain corresponding to an index information sub-file can be represented by the name of the index information sub-file. The vertical domain corresponding to an index information sub-file indicates the type of searchable content recorded by the index information sub-file, that is, the index in the index information sub-file is an index established based on the searchable content. Each index information sub-file has a file path, and the file path corresponding to each index information sub-file can be used to find the index information sub-file. The file path of each index information sub-file can include the name of the index information file and the name of the index information sub-file.
[0193] In some possible cases, the electronic device can correspond the content generated by each application after it is opened to a vertical domain, that is, the electronic device can establish an index information subfile for each application, and the content generated by each application after it is opened can be recorded in the index information subfile corresponding to each application. It can be understood here that each application has a corresponding index information subfile. For example, for the "Notes" application, when the content generated in the "Notes" application is regarded as a vertical domain (such as the "Notes" vertical domain), the electronic device can record the content generated in the "Notes" (such as notes) into the index information subfile corresponding to the "Notes" application. The name of the index information subfile corresponding to the "Notes" application can indicate the vertical domain corresponding to the index information subfile. In this way, the name of the index information subfile corresponding to the "Notes" application can be used to determine that the index recorded in the index information subfile is established based on the content generated in the "Notes" application (including the dynamic functions and business data involved below).
[0194] The electronic device may also correspond the content (e.g., static function data) of each application after installation and before the first opening to at least one vertical domain. For example, a static function may be corresponded to a vertical domain, and the electronic device may create an index information subfile for the static function, and record the static function data in the index information subfile corresponding to the static function.
[0195] Based on the above content, it can be known that even if the searchable content comes from different applications, the electronic device can use the same method to index the same fields in the different searchable content and record them uniformly in the index information. This facilitates the storage and management of searchable content. At the same time, for the attributes of a field (such as index construction method, matching method, or query understanding method, etc.), the electronic device can also change the index template to facilitate the management of the attributes of different fields.
[0196] In some possible cases, the searchable content that the electronic device can record in the index information includes: the content that the application already has after the electronic device downloads the application and before the application is started for the first time (also called static searchable content), and the content generated by the electronic device during the use of the application when the application is turned on (also called dynamic searchable content).
[0197] The static searchable content of the application may include static functional data of the application.
[0198] The static function data of the application includes: fields describing the static functions in the application and the field values corresponding to the fields. The fields describing the static functions may include a "title" field (indicating the static function name), an "icon" field (indicating the icon address of the static function), a "jump link" field (used to open the page corresponding to the static function), etc. The icon address can be used to find the icon.
[0199] Among them, the static function of the application is the function that the application has after installation and before the first opening. The static function is an inherent function in the application and will not change due to different pages on which the application is opened.
[0200] For example, the "New Note" function and sharing function in the "Notes" application can be called static functions. The fields that describe the "New Note" function and the field values corresponding to each field, the fields that describe the "Share" function and the field values corresponding to each field, and the fields and field values corresponding to other static functional data (in the "Notes" application) can be regarded as the static functional data of the "Notes" application. For another example, the playback history viewing function in the "Video" application are called static functions. The fields that describe the playback history viewing function and the field values corresponding to each field can be regarded as the content in the static functional data of the "Video" application. The following Figure 3A-3C An exemplary static function is shown, and an example diagram of an electronic device recording static function data into index information is shown. For the description of static function data, please refer to the following Figure 3A-3C , I will not go into details here.
[0201] The dynamic searchable content of the application may include dynamic function data of the application or business data of the application.
[0202] The dynamic function data of the application includes the fields describing the dynamic functions of the application and the field values corresponding to the fields. In some possible cases, the dynamic function data may also include the vertical field corresponding to the dynamic function. The fields describing the dynamic function may include a "title" field (indicating the name of the dynamic function), an "icon" field (indicating the address of the dynamic function icon), etc.
[0203] The dynamic function of an application is a function generated during the use of the application after the application is opened. The dynamic function is generated when the application opens a page. The dynamic function and the static function mentioned above are both functions of the application, but the dynamic function is different from the static function mentioned above. The static function is a function that exists in the application after the application is installed and before it is opened for the first time. However, the dynamic function is a function that is generated after the application is opened.
[0204] For example, when an electronic device opens the "New Note" function of the "Note" application to create a new note, the functions included in the page involved in creating a new note (such as the "Save" function, the "Recall" function, etc.) can be called dynamic functions. For another example, when an electronic device opens the playback page of the "Video" application, the functions included in the playback page (such as the "Pause" function, etc.) can be called dynamic functions. Figure 4A as well as Figure 4B An exemplary dynamic function is shown, and an example diagram of an electronic device recording dynamic function data into index information is shown. For the description of dynamic function data, please refer to the following Figure 4A as well as Figure 4B , I will not go into details here.
[0205] The business data of an application refers to data generated based on the functions of the application (including static functions and dynamic functions). The business data may include fields describing the business data and field values corresponding to each field. In some possible cases, the business data may also include a vertical domain corresponding to the business data.
[0206] For example, a note generated based on the "New Note" function of the "Note" application can be regarded as the business data of the "Note" application. Figure 5A-5D An exemplary business data is shown, and an example diagram of an electronic device recording business data into index information is shown. For the description of business data, please refer to the following Figure 5A-5D , I will not go into details here.
[0207] It should be understood that the dynamic searchable content and static searchable content of the electronic device may include other content in addition to the aforementioned content, and the embodiments of the present application do not limit this. For example, static searchable content may also include static data. Among them, static data refers to the data that the electronic device already has after downloading the application and before starting the application for the first time.
[0208] Figure 3A-3C A schematic diagram showing an electronic device obtaining a static function and recording the static function data into index information is shown.
[0209] In some possible cases, the electronic device may obtain static function data of the installed application when installing the application. Then, the electronic device may record the static function data in the index information.
[0210] The following description takes an example where a “video” application is installed in an electronic device and static function data corresponding to a static function of the “video” application is recorded in index information.
[0211] like Figure 3AAs shown, user interface 31 is an exemplary user interface (page) involved when the electronic device installs the "video" application. User interface 32 is an exemplary user interface involved after the electronic device completes the installation of the "video" application. During the process of installing the "video" application in the electronic device, the electronic device can obtain the static function data corresponding to the "video" application. Then, after the "video" application is installed, the electronic device can record the static function data corresponding to the "video" application into the index information.
[0212] Figure 3B (1) shows some static functions in the "Video" application. Figure 3B As shown in (1), in the user interface 33, the static functions of the "video" application may include a "home page" function, a "historical playback" function, a "personal center" function, and may also include a "live broadcast" function, a "recommendation" function, etc.
[0213] Here, we take the static function data of the "Video" application, which includes the field values describing static functions such as the "Home" function, "History Playback" function, and "Personal Center" function, as well as the field values corresponding to each field, as an example to describe in detail the contents of the static function data.
[0214] like Figure 3B As shown in (2), it is an exemplary static function data of the "Video" application. It includes the fields describing the "Home" function and the field values corresponding to each field, the fields describing the "History Play" function and the field values corresponding to each field, and the fields describing the "Personal Center" function and the field values corresponding to each field. Among them, the fields describing each static function in the "Video" application may include but are not limited to: "Title" field (indicating the static function name), "Description" field (indicating the function of the static function), "Icon" field (indicating the icon address of the static function), "Jump Link" field (used to open the page corresponding to the static function) and other fields.
[0215] It should be noted here that Figure 3B The icon address A1 mentioned in the figure can be the icon address corresponding to the "Home" function, and the icon address corresponding to the "Home" function can be used to find the icon of the "Home" function based on the address. The icon address A2 and the icon address A3 can be used to find the icon of the "Play History" function and the icon of the "Personal Center" function respectively.
[0216] In some other possible cases, the icon address corresponding to a static function may not be the address of the icon of the static function, but may also be the address of the icon of the application where the static function is located, so as to find the icon of the application where the static function is located.
[0217] When the "video" application is installed, the electronic device can record the static function data of the "video" application into the index information according to the index template. Figure 3C Description.
[0218] Figure 3C In the description, an example is given in which an electronic device generates an index for the field value corresponding to the "title" field of each static function according to an index template and records the index in the index information. The process of recording the field values corresponding to other fields in the index information can refer to the process of recording the field values corresponding to other fields in the index information. Figure 3C The description is not repeated here.
[0219] like Figure 3C As shown, the index template records each field and the attributes corresponding to each field. For the relevant description of the index template, please refer to the above content, which will not be repeated here.
[0220] Taking the "Title" field as an example, the index construction method corresponding to the "Title" field is: "Get field value + preprocessing + word segmentation + word segmentation pinyin + initial pinyin". When the electronic device creates an index based on the field value of each "Title" field in the static functional data, the index needs to include the field value, the preprocessing result of the field value, the word segmentation result of the field value, the pinyin result of the field value, and the initial pinyin result of the field value. Figure 3C As shown, the electronic device can also record the field values and extended values corresponding to each "title" field in the static function data in a unified manner to the position corresponding to the index of the "title" field. Here, the vertical domain corresponding to the static function data is the "application function" vertical domain (vertical domain A) as an example for exemplary display.
[0221] In some possible cases, the electronic device may also generate documents corresponding to each static function (including document 01, document 02, document 03), one document corresponding to each static function. The document corresponding to a static function records the fields and field values describing the static function in the static function data. The document corresponding to a static function may be associated with the field values describing the static function and the extended values of the field values.
[0222] When the index information is recorded in the index information file, and the index information file is divided into different index information sub-files according to the vertical domain, the electronic device can record the index and document established based on the static function data of the "video" application in the index information sub-file corresponding to the "application function" vertical domain. For example, the index recorded in the index information sub-file corresponding to the "application function" vertical domain can be as follows: Figure 3C The index information corresponding to the "Application Function" vertical field shown.
[0223] Subsequently, the electronic device may also record the indexes and documents established based on the static functional data of other applications into the index information sub-file corresponding to the “application function” vertical domain.
[0224] Figure 3D-Figure 3F Another schematic diagram showing an electronic device obtaining a static function and recording the static function data into index information.
[0225] The following is an example of installing a "Notes" application on an electronic device and recording the static function data corresponding to the static function of the "You Ji" application into the index information sub-file corresponding to the "Application Function" vertical domain.
[0226] like Figure 3D As shown, user interface 34 is an exemplary user interface involved when the electronic device installs the "Note" application. User interface 35 is an exemplary user interface involved after the electronic device completes the installation of the "Note" application. During the process of installing the "Note" application on the electronic device, the electronic device can obtain static function data corresponding to the "Note" application. Then, after the "Note" application is installed, the electronic device can record the static function data corresponding to the "Note" application into the index information.
[0227] Figure 3E (1) shows some static functions in the "Notes" application. Figure 3E As shown in (1), in the user interface 36, the static functions of the "Notes" application may include a "New Note" function, a "New To-Do" function, etc.
[0228] like Figure 3E As shown in (2), it is an exemplary static function data of the "Note" application. It includes the fields describing the "New Note" function and the field values corresponding to each field, and the fields describing the "New Half-Time" function and the field values corresponding to each field. Among them, the fields describing each static function in the "Note" application may include but are not limited to: "Title" field (indicating the static function name), "Description" field (indicating the function of the static function), "Icon" field (indicating the icon address of the static function), "Jump Link" field (used to open the page corresponding to the static function) and other fields.
[0229] For the meaning of each field and field value, please refer to the above Figure 3B The description of (2) will not be repeated here.
[0230] When the "Notes" application is installed, the electronic device can index the static functional data of the "Notes" application according to the index template, and record the created index in the index information subfile corresponding to the "Application Function" vertical domain.
[0231] like Figure 3F As shown in Figure 1, a schematic diagram of the index information corresponding to the "application function" vertical domain is shown. Figure 3C In the index information corresponding to the "Application Function" vertical domain, new indexes and documents based on static function data of the "Notes" application have been added.
[0232] When the index information is recorded in an index information file and the index information file is divided into different index information sub-files according to vertical domains, the electronic device can record the index and documents established based on the static functional data of the "Note" application in the index information sub-file corresponding to the "Application Function" vertical domain.
[0233] Figure 4A-4B A schematic diagram showing an electronic device generating a dynamic function based on an application and recording dynamic function data corresponding to the dynamic function into index information is shown.
[0234] In some possible cases, after the electronic device starts the application, the application may generate a dynamic function. The electronic device may obtain dynamic function data corresponding to the dynamic function based on the page information. Then, the electronic device may record the dynamic function data in the index information.
[0235] Take opening the "Settings" application, generating a dynamic function based on the Bluetooth setting item of the "Settings" application, and recording the dynamic function data corresponding to the dynamic function into the index information as an example for explanation.
[0236] like Figure 4A As shown, user interface 41 is a setting interface corresponding to the Bluetooth setting item in the "Settings" application. In response to the operation of the Bluetooth function activation control 411, the electronic device can activate the Bluetooth function. And a user interface 42 is displayed, which shows that after the Bluetooth function is activated, the electronic device establishes a Bluetooth-based communication connection with other devices, and the name of the other device is: "My Phone". Here, the establishment of a Bluetooth-based communication connection between the electronic device and other devices (such as a device named "My Phone") can be regarded as a dynamic function of the electronic device. The dynamic function data corresponding to the dynamic function may include fields such as a "title" field (indicating the content of the dynamic function), a "description" field (indicating the role of the dynamic function, the scope of application, etc.), and an "icon" field (indicating the icon address of the dynamic function).
[0237] The description of dynamic function data can also refer to the description of static function data, except that the field describing a dynamic function may be different from the field describing a static function. The method of generating an index based on the field value corresponding to each field and recording the index in the index information and establishing a document may be the same.
[0238] The electronic device can record the dynamic function data corresponding to the dynamic function in the user interface 41 into the index information according to the index template. The obtained index information can refer to the following Figure 4B As shown. The index template used can refer to the above Figure 3C The index template shown in .
[0239] like Figure 4B As shown, the vertical domain corresponding to the dynamic function data corresponding to the dynamic function generated by the "Settings" application is the "Settings" vertical domain (vertical domain B), and the "Title" field in the dynamic function data is the name of the other device ("My Phone"), and the "Description" field is "Bluetooth" (indicating a Bluetooth connection) as an example for exemplary display. For the "Title" field, the electronic device can uniformly record the field values and extended values corresponding to the "Title" field in the dynamic function data into the index information segment corresponding to the "Settings" application "vertical domain".
[0240] In some possible cases, the electronic device can also generate Figure 4A The document corresponding to the dynamic function (including document 11) is one document corresponding to one dynamic function. In some possible cases, the document corresponding to one dynamic function records the fields and field values in the dynamic function data that describe the dynamic function. The document corresponding to one dynamic function can be associated with the field value that describes the dynamic function and the extended value of the field value.
[0241] Figure 5A-5D A schematic diagram showing an electronic device generating business data based on an application and recording the business data into index information is shown.
[0242] In some possible cases, the electronic device may generate service data during the use of the application, and then record the service data in the index information.
[0243] The following describes the process by taking the business data of notes generated by an electronic device based on the "Notes" application as an example.
[0244] like Figure 5AAs shown, user interface 51 is an exemplary note management page in the "Notes" application. The user interface 51 shows that the electronic device has generated a note (recorded as Note 1) based on the "Notes" application. Note 1 can be regarded as a business data generated by the "Notes" application. The fields describing Note 1 may include: "Title" field (indicating the title of the note), "Description" field (indicating the body of the note), and "Time" field (indicating the creation time of the note) and other fields. Among them, the field value corresponding to the "Title" field can be: "Summary of Last Year's Work", the field value corresponding to the "Description" field can be: "Last Year's Work Situation XX...", and the field value corresponding to the "Time" field can be: "2022 / 12 / 308:00".
[0245] The electronic device can record the note 1 generated by the "note" application into the index information according to the index template. The obtained index information can refer to the following Figure 5B shown.
[0246] Figure 5B In the description, an example is given in which the electronic device generates an index for the field value corresponding to the "title" field of Note 1 according to the index template and records the index into the index information. The process of recording the field values corresponding to other fields into the index information can refer to the process of recording the field values corresponding to other fields into the index information. Figure 5B The description is not repeated here.
[0247] like Figure 5B As shown in the figure, the index template records each field and its corresponding attributes. For a description of the index template, please refer to Figure 3C The description of index templates in is not repeated here.
[0248] like Figure 5B As shown, the electronic device can uniformly record the field value and extended value corresponding to the "Title" field in Note 1 to the position corresponding to the index of the "Title" field. Here, the vertical domain corresponding to the note is taken as the "Note" vertical domain (vertical domain C) as an example for exemplary display. Among them, the field value and extended value corresponding to the "Title" field are obtained based on the index template.
[0249] In some possible cases, the electronic device may also generate a document (document 21) corresponding to note 1, one note corresponding to one document. Document 21 records the fields and field values in note 1 that describe note 1. Document 21 may be associated with the field values describing note 1 and the extended values of the field values.
[0250] Subsequently, the electronic device can also record other newly created notes through the "Notes" application into the index information segment corresponding to the "Notes" vertical domain. For more information about this process, please refer to the following Figure 5C as well as Figure 5D Description.
[0251] like Figure 5C As shown, user interface 52 and user interface 53 are exemplary user interfaces involved when an electronic device creates a new note through the "Notes" application. The user interface 52 shows that the electronic device has generated another note (recorded as Note 2) based on the "Notes" application. Note 2 can be regarded as a business data generated by the "Notes" application. The fields describing Note 2 may include: "Title" field (indicating the title of the note), "Description" field (indicating the body of the note), and "Time" field (indicating the creation time of the note) and other fields. Among them, the field value corresponding to the "Title" field can be: "This year's work plan", the field value corresponding to the "Description" field can be: "XX is expected this year", and the field value corresponding to the "Time" field can be: "2023 / 1 / 1 8:00".
[0252] The electronic device can record the note 2 generated by the "note" application into the index information according to the index template. The obtained index information can refer to the following Figure 5D shown.
[0253] Figure 5D In the description, an example is given in which the electronic device generates an index for the field value corresponding to the "title" field of Note 2 according to the index template and records the index in the index information. The process of recording the field values corresponding to other fields of Note 2 in the index information can refer to the process of recording the field values corresponding to the "title" field of Note 2 in the index information. Figure 5D The description is not repeated here.
[0254] like Figure 5D As shown in the figure, the index template records each field and its corresponding attributes. For a description of the index template, please refer to Figure 3C The description of index templates in is not repeated here.
[0255] like Figure 5D As shown, the electronic device can uniformly record the field value and extended value corresponding to the "Title" field in Note 2 to the position corresponding to the index of the "Title" field. Here, the vertical domain corresponding to the note is taken as the "Note" vertical domain (vertical domain C) as an example for exemplary display. Among them, the field value and extended value corresponding to the "Title" field are obtained based on the index template.
[0256] In some possible cases, the electronic device may also generate a document (document 22) corresponding to note 2, one note corresponding to one document. Document 22 records the fields and field values in note 2 that describe note 2. Document 22 may be associated with the field values describing note 2 and the extended values of the field values.
[0257] It should be understood here that the indexes in the index information corresponding to different vertical domains can come from the same application. For example, the index information segment corresponding to the "application function" vertical domain may include the indexes corresponding to the various functional data provided by the "notes" application for the electronic device. The index information segment corresponding to the "notes" vertical domain may include the indexes corresponding to the notes generated by the "notes" application.
[0258] It should also be understood that the index information corresponding to different vertical domains may include the same fields (common fields). Figure 3C as well as Figure 5B It can be seen that the "Application Function" vertical domain and the "Note" vertical domain can include common fields such as the "Title" field and the "Description" field.
[0259] The electronic device can implement a local search function based on the aforementioned index information.
[0260] Fig. 6A as well as Figure 6B A schematic diagram showing an electronic device implementing a local search function based on index information is shown.
[0261] like Fig. 6A As shown, the electronic device starts the search application and obtains the input query content. Then, the electronic device performs a search based on the index information. The search process is completed by searching in the index information based on the query content, and it is a single-threaded search. When searching, the electronic device can also search according to the vertical domain based on the index information, and realize simultaneous search in multiple vertical domains to obtain search results, and the search results can cover the application content that matches the query content in each vertical domain. For example, the electronic device can search in the index information segment corresponding to the "application function" vertical domain based on the query content to obtain the content that matches the query content in the "application function" vertical domain. At the same time, the electronic device can also search in the index information segment corresponding to the "notes" vertical domain based on the query content to obtain the content that matches the query content in the "notes" vertical domain.
[0262] In some possible cases, when the search result is a document, the electronic device matches the query content with the index in the index information slice corresponding to each vertical domain to determine the successfully matched field value and extension value, and can return the document (matching document) associated with the successfully matched field value and extension value. Then, the matching documents are aggregated according to the vertical domain, and the documents recorded in the index information slice corresponding to the same vertical domain are aggregated into a group to obtain the matching documents (search results) corresponding to each vertical domain. After performing a correlation analysis on the matching documents corresponding to each vertical domain, the matching documents (search results) corresponding to each vertical domain whose correlation meets the requirements are determined.
[0263] Subsequently, the search results corresponding to each vertical domain that meet the relevance requirements are displayed. Figure 6BAs shown, when displaying, the field values corresponding to some or all of the fields in the search results that meet the requirements for the same vertical domain's correlation can be displayed in a display box. The display box can also include the vertical domain name. Generally speaking, the field value (icon) corresponding to the "icon" field in a search result and the field values corresponding to other fields in the search result present a front-to-back relationship when displayed in the display box, rather than a top-to-bottom relationship. In this way, the application or service from which the field values corresponding to other fields come can be highlighted based on the icon.
[0264] Figure 7A-7E An exemplary user interface for an electronic device to display search results by vertical domain is shown.
[0265] like Fig. 7A An exemplary diagram of the process of enabling the local search function provided by the search application for an electronic device. Fig. 7A As shown in (1), the user interface 70 is a desktop of the electronic device. The user interface 70 includes a page indicator 701. The page indicator 701 includes at least one circular icon and one other shape icon. Each circular icon corresponds to a desktop. The other icon may indicate a negative one screen page. When the electronic device displays the user interface 70, the circular icon (circular icon 1) closest to the other shape icons in the page indicator 701 is selected to indicate that the currently displayed user interface 70 is the first desktop.
[0266] In response to an operation on the user interface 70, such as a sliding operation in a direction from other shape icons to the circle icon 1, the electronic device activates a local search function provided by the search application.
[0267] like Fig. 7A As shown in (2), the user interface 71 is an exemplary interface of an electronic device including a local search function. The user interface 71 includes a search box 711. The search box 711 also displays a prompt message to prompt the user to enter a query content in the search box 711. For example, the prompt message may be: "Search for applications and services".
[0268] The electronic device can receive the query content input by the user based on the search box 711, and then perform a search based on the query content.
[0269] like Figure 7B As shown in (1), the search box 711 displayed in the user interface 72 includes the input query content 721a: "note plan". In response to the operation of the search control, the electronic device can search in the index information based on the query content 721a to obtain the search results of the query content 721a ("note plan").
[0270] Reviewing the above Figure 5A , Figure 5C And for Figure 5A , Figure 5C The search results of the query content 721a ("note plan") can include the document corresponding to the "New Note" function in the "Application Function" vertical domain, and the document corresponding to the note "This Year's Work Plan" in the "Note" application.
[0271] like Figure 7B As shown in (2), user interface 73 is an exemplary user interface involved in displaying search results according to vertical domains. Display box 731 may include field values corresponding to some fields of each matching document in the "application function" vertical domain, such as field values corresponding to some fields in the document corresponding to the "new note" function. Display box 732 may include field values corresponding to some fields of each matching document in the "note" vertical domain, such as field values corresponding to some fields in the document corresponding to the note "this year's work plan".
[0272] For details about the electronic device implementing the local search function based on the aforementioned index information, please refer to the following Fig.17 The description of steps S101 to S111 will not be repeated here.
[0273] In some possible cases, when the business data, dynamic function data and static function data of each application are recorded in the index information, it is possible to search the business data, dynamic function data and static function data of each application based on the index information when each application is closed based on the query content.
[0274] Figure 7C An exemplary user interface involved in searching for business data of an application by an electronic device is shown.
[0275] For example, if the “Notes” application is not turned on in the electronic device, the notes in the “Notes” application can also be searched in the index information.
[0276] like Figure 7C As shown, user interface 74 is an exemplary user interface for searching the index information based on query content 741a ("this year's work plan") to obtain search results and display the search results. The user interface 74 may include a display box 741, which includes field values corresponding to some fields of the matching document in the "notes" vertical domain. For example, the matching document may be the document corresponding to the note "this year's work plan".
[0277] For more information about creating documents and indexes corresponding to each note in the Notes application, please refer to the previous Figure 5A-5D The description is not repeated here.
[0278] Fig.7D An exemplary user interface involved in an electronic device searching for dynamic functions of an application is shown.
[0279] For example, if the "Settings" application is not turned on in the electronic device, the dynamic functions in the "Settings" application can also be searched in the index information.
[0280] like Fig.7D As shown, user interface 75 shows an exemplary user interface for searching the index information based on query content 751a ("my phone") to obtain search results and displaying the search results. The user interface 75 may include a display box 751, which includes field values corresponding to some fields of each matching document in the "settings" vertical domain. For example, the matching document may include a document corresponding to a dynamic function that a communication connection based on Bluetooth is established between an electronic device and another device (for example, a device named "my phone").
[0281] For more information about establishing documents and indexes corresponding to each dynamic function in the Settings app, please refer to the previous Figure 4A-4B The description is not repeated here.
[0282] Fig. 7E An exemplary user interface involved in an electronic device searching for static functions of an application is shown.
[0283] For example, if the "Notes" application is not turned on in the electronic device, the static functions in the "Notes" application can also be searched in the index information.
[0284] like Fig. 7EAs shown, user interface 76 shows an exemplary user interface when searching for search results in index information based on query content 761a ("New To Do") and displaying the search results. The user interface 76 may include a display box 761, which includes field values corresponding to some fields of the matching document in the "Note" vertical domain or content determined based on the field value. For example, the matching document may be a document corresponding to the static function "New To Do", and the electronic device may display the name, description, icon, and other contents of the "New To Do" function based on the document corresponding to the "New To Do" function. Among them, the icon of the "New To Do" function is determined based on the icon address (field value of the "Icon" field) corresponding to the "New To Do" function in the document corresponding to the "New To Do" function. The electronic device can find the icon corresponding to the "New To Do" function based on the icon address corresponding to the "New To Do" function for display. Here, the icon corresponding to the "New To Do" function may be the icon of the "New To Do" function. In some possible cases, it may also be the icon of the application where the "New To Do" function is located.
[0285] For more information about establishing documents and indexes corresponding to each static function in the "Notes" application, please refer to the previous Figure 3D-Figure 3F The description is not repeated here.
[0286] In some possible cases, the electronic device can integrate the aforementioned methods of building an index based on an index template, recording the index to index information, and the instructions involved in searching using the index information into a search service application, and other applications can call the search service application to build and store the index, and use the index information for searching.
[0287] The electronic device may obtain static searchable content and dynamic searchable content from the application in different ways, and then generate corresponding indexes for the static searchable content and dynamic searchable content through the search service application, and record the indexes in the index information.
[0288] Figure 8 An exemplary manner in which an electronic device generates an index based on static searchable content and dynamic searchable content is shown.
[0289] For the static searchable content of an application, it should be a property of the application. After the electronic device downloads and installs the application, if the version number of the application does not change, the static searchable content will not change. Figure 8 As shown in (1), during the installation of the application, the static searchable content (such as static functional data, static data, etc.) of the application can be obtained by searching the configuration file, and then an index is built based on the static searchable content, and the index is recorded in the index information.
[0290] The following takes the static searchable content as static functional data as an example to describe in detail the process of obtaining the static searchable content of an application by searching a configuration file.
[0291] During the development of an application, static functional data can be written as extended field information into the search configuration file of the application. The search configuration file is a file in XML format provided by the application. Before the extended field information is written into the search configuration file, the search configuration file defines the search configuration information required for the application to support search in the system. For example, the search configuration file is configured with search configuration information for the application to be searched, so that the application can be returned by entering the application name in the search box provided by the local search service (such as returning the application icon or the application name indicating the application). In some possible cases, the search configuration information for the application to be searched includes setting the android:includeInGlobalSearch item to true. During the installation of the application, the electronic device can obtain the search configuration file and then further obtain the search configuration information therein to enable the application to be searched through the local search service.
[0292] After writing the extended field information into the search configuration file, after obtaining the configuration file information (including the extended field information) in the application installation package, the electronic device can further read the extended field information in the search configuration file. And record the field information in the search information corresponding to the application. Later, after the installation is completed, the electronic device can send a broadcast of the completion of the application installation to trigger the electronic device to obtain the field information in the search information. Since the field information represents static functional data, at this point, it can be considered that the electronic device has obtained the static functional data from the application installation package.
[0293] Then, the electronic device establishes an index corresponding to the static function data based on the field information through the search service application, and records the index in the index information. For example, the electronic device can record the index corresponding to the static function data in the index information segment corresponding to the "application function" vertical domain.
[0294] In some possible cases, when establishing the index corresponding to the static function data, a document corresponding to the static function data can also be established. And the index and the document are recorded in the index information. For example, the electronic device can record the index and the document corresponding to the static function data in the index information segment corresponding to the "application function" vertical domain.
[0295] For detailed information about how to create indexes and documents using search configuration files, see Fig.11 The description of steps S10 to S22 will not be repeated here.
[0296] Dynamic searchable content of an application is generated in the application after the electronic device opens the application. Since the application is in the open state when the dynamic searchable content is generated, Figure 8 As shown in (1), by configuring the index building interface in the application, the application can transmit the fields and field values in the dynamic searchable content (such as dynamic function data, business data, etc.) to the search service application through the configuration interface. The search service application can establish an index corresponding to the dynamic searchable content and record the index in the index information. For example, when the dynamic searchable content is dynamic function data, the electronic device can record the index corresponding to the dynamic function data in the index information segment corresponding to the "application function" vertical domain.
[0297] In some possible cases, when establishing the index corresponding to the dynamic function data, a document corresponding to the dynamic function data may also be established. The index and document are recorded in the index information. For example, when the dynamic searchable content is dynamic function data, the electronic device may record the index and document corresponding to the dynamic function data in the index information segment corresponding to the "application function" vertical domain.
[0298] In some possible cases, the field recorded in the initial index template is a system field, and the index template also records the corresponding attributes of the system field. However, in addition to system fields, the dynamic searchable content generated by the application can also include other fields (custom fields), which do not have corresponding attributes in the index template. Therefore, the application needs to define attributes for it. The function of defining attributes for custom fields can be implemented by configuring the field definition interface in the application.
[0299] In some possible cases, custom fields may also be called new fields.
[0300] For detailed information about how to create indexes and documents through the configuration interface, please refer to Fig.13 The description of steps S30 to S35 will not be repeated here.
[0301] In some possible cases, for applications that are not configured with an index building interface, the electronic device may also provide other methods to obtain the dynamic searchable content of the application for transmission to the search service application. Figure 8 As shown in (2), the electronic device provides a method of obtaining dynamic searchable content of the application through database plug-in, and then transmits it to the search service application to establish an index corresponding to the dynamic searchable content, and records the index in the index information.
[0302] The database refers to the database corresponding to the application. After the electronic device generates dynamic searchable content through the application, the dynamic searchable content will be written into the database corresponding to the application. The database plug-in method can be used to monitor the changes sent by the database and determine the location where the dynamic searchable content is written into the database. The location written into the database can be used by the electronic device to obtain the dynamic searchable content from the database through the location.
[0303] For example, the electronic device can set a database plug-in method for the "SMS" application. When a new SMS is created in the "SMS" application and the new SMS is recorded in the database corresponding to the "SMS" application, the electronic device can monitor the database corresponding to the "SMS" application to send changes and determine the location where the new SMS is written into the database. The electronic device can obtain the new SMS from the database corresponding to the "SMS" application through the location. Then it is transmitted to the search service application to establish an index corresponding to the new SMS, and the index is recorded in the index information.
[0304] For detailed information about how to create indexes and documents through database instrumentation, please refer to Fig.15 The description of steps S40 to S46 will not be repeated here.
[0305] The following describes an exemplary software structure framework involved in generating index information and searching based on the index information.
[0306] Fig. 9 An exemplary software structure framework involved in generating index information and searching based on the index information is shown.
[0307] like Fig. 9 As shown, the layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer, the application framework layer, the runtime (Runtime) and the system library (not shown), and the kernel layer (not shown).
[0308] The application layer can include a series of application packages.
[0309] like Fig. 9 As shown, the application package may include applications such as "honor search" application, "settings" application, "system manager" application, "notes" application, etc. (also referred to as applications).
[0310] The "honor search" application can be used to provide local search functions. The "honor search" application can be used to receive query content input by the user and call the search service application based on the query content to complete the search.
[0311] It should be understood that other applications that can implement in-application search can also call the "search service" application to implement search.
[0312] Some applications in the application layer may include search configuration files and manifest files, or index building interfaces. Applications that include index building interfaces may also include field customization interfaces. For example, the "System Manager" application may include search configuration files and manifest files. The "Notes" application may include field customization interfaces and index building interfaces.
[0313] The manifest file in the application can be used to declare the information of the files included in the application (file name and path, etc.). Based on the manifest file, other files in the application can be read. For example, the manifest file can record the name and path of the search configuration file, and other modules can obtain the search configuration file through the manifest file.
[0314] The search configuration file in the application configures the search configuration information by which the application can be searched.
[0315] The search configuration file can also be used to record the extended field information in the application (representing the static searchable content of the application) when the index is established through the search configuration file. For the extended field information and the relevant content of the search configuration file, please refer to the description in the above content. No further details will be given here.
[0316] The index building interface can be used to support the application to transmit each field and each field value in the dynamic searchable content (such as dynamic function data, business data, etc.) to the search service application when building an index through the configuration interface.
[0317] The field definition interface can be used to define properties for custom fields of dynamically searchable content when indexing through the configuration interface.
[0318] In some possible cases, the field definition interface can also be used to record the attributes corresponding to each custom field into the index template.
[0319] The application package may also include a search service application.
[0320] The search service application may include functional modules and data involved in building and recording indexes and searching using index information.
[0321] Among them, the data used for index construction and recording may include index templates and index information files. The index template can be used to generate an index, and the index information file can be used to store index information. In some possible cases, the index information in the index information file can be divided according to vertical domains to obtain index information fragments corresponding to each vertical domain. For example, a vertical domain may include one or more vertical domains such as the "application function" vertical domain, the "contact" vertical domain, the "gallery" vertical domain, and the "note" vertical domain, which is not limited to this in the embodiments of the present application. Among them, the detailed description of the index template and the index information can refer to the aforementioned introduction to the index template, which will not be repeated here.
[0322] Functional modules for index construction and recording may include event triggers, search information acquisition modules, index management modules, and index management modules.
[0323] The event trigger may be used to receive a broadcast of the completion of application installation when the index is established through the search configuration file, and trigger the execution of the search information acquisition module after receiving the broadcast of the completion of application installation.
[0324] The search information acquisition module can be used to acquire the search information corresponding to the installed application (recording the extended field information in the application) when establishing an index through the search configuration file, and then send the search information to the index management module.
[0325] In some possible cases, the index building module and the index storage module may be included in the index management module.
[0326] The index building module may be used to obtain fields and field values from a file containing the fields and field values and to build an index corresponding to the field values based on an index template.
[0327] The index building module can call the following index storage module to store the index.
[0328] The index storage module can be used to record the index into the index information.
[0329] The application layer may include an application manager, a resource acquisition module, an extended field storage module, a search manager, a database manager, and an index building notification module.
[0330] Among them, the application management module can be used to manage the installation and uninstallation of applications.
[0331] The application management module can also call the resource acquisition module to acquire application resources during the application installation process, for example, to acquire resources such as the application's search configuration file.
[0332] The resource acquisition module can be used to obtain the search configuration file of the application during the application installation process and read the extension field therein.
[0333] The extended field storage module can be used to be called by the resource acquisition module to record the extended field information into the search information.
[0334] The search manager can be used to obtain search information after being called by the search information acquisition module, and then send the search information to the search information acquisition module.
[0335] The database manager can be used to monitor whether the database corresponding to the application is modified when the index is established by database plug-in. When it is detected that the database has written dynamic searchable content, the identifier of the application's write location in the database is sent to the index building notification module. Each row of data in the database has a unique identifier, and the identifier of the write location is the identifier of the write row.
[0336] The index building notification module can be used to obtain dynamic searchable content from the database corresponding to the application based on the identifier after receiving the identifier of the location where the application writes in the database. Then, the fields and field values in the searchable content are obtained to obtain a field list, and the field list is sent to the index building module to build the index.
[0337] like Fig. 9 As shown, here we take the example of storing the index template and index information separately in the search service application. The index template and index information have different functions and usage scenarios: the purpose of the index template is to define the rules for generating index information, and the purpose of the index information is to record the index for easy search. Separate storage facilitates the management and use of index templates and index information.
[0338] Fig.10 An exemplary software structure framework and processing flow for establishing and recording an index by searching a configuration file are shown.
[0339] The process of the electronic device establishing an index corresponding to the static searchable content by searching the configuration file and recording the index can refer to Fig.10 Description of steps 1 to 8 in .
[0340] Fig.10 In step 1, after the electronic device downloads application 1, the application manager can be responsible for installing the application 1. Fig.10 Step 1 Fig.10 The circle mark in ①.
[0341] Fig.10 In step 2, during the process of installing the application, the application manager notifies the resource acquisition module to acquire the search configuration file in the installation package of application 1. Fig.10 Step 2 is Fig.10 The circle mark in ②.
[0342] Fig.10 In step 3, the resource manager obtains the extended field information in the search configuration file (of application 1) and records the field information into the searchable information. Fig.10 Step 3 in Fig.10 The circle mark in ③.
[0343] Fig.10 In step 4, after the application manager completes the installation of application 1, it sends a broadcast indicating that the installation of application 1 is complete. Fig.10 Step 4 Fig.10 The circle mark in ④.
[0344] Fig.10 In step 5, after the event triggers the receiving of the installation completion broadcast, the search information acquisition module is triggered to execute. Fig.10 Step 5 is Fig.10 The circle mark in ⑤.
[0345] Fig.10 In step 6, after the search information acquisition module is triggered to execute, the search manager is called to acquire the search information and read the field information corresponding to application 1 in the search information. Fig.10 Step 6 Fig.10 The circle mark in ⑥.
[0346] Fig.10 In step 7, the search information acquisition module sends the field information corresponding to application 1 to the index management module. Fig.10 Step 7 Fig.10 The circle mark in ⑦.
[0347] Fig.10 In step 8, the index management module obtains the field information corresponding to application 1 in the searchable information, builds and stores an index based on the field information, and the index includes the index corresponding to each static function data in application 1. Fig.10 Step 8 Fig.10 The circle mark ⑧ in the figure.
[0348] What should be understood here is that Fig.10 In step 8, in some possible cases, the index management module may create a document corresponding to each static function data in addition to creating an index corresponding to each static function data, and record the index and document in the index information.
[0349] The following is combined with the above Fig. 9 as well as Fig.10The software structure diagram involved describes in detail the interaction process between internal modules when the electronic device establishes and records indexes and documents by searching configuration files.
[0350] Fig.11 An exemplary interaction process between internal modules when creating and recording indexes and documents through a search configuration file is shown.
[0351] The process of the electronic device establishing an index corresponding to the static searchable content by searching the configuration file and recording the index can refer to Fig.11 Description of steps S10 to S22 in .
[0352] S10. The application manager installs application 1 based on the installation package of application 1.
[0353] Application 1 is an application that writes static searchable content as extended field information into the search configuration file of application 1 during the development process. For example, "Contacts" application, "Information" application, "Video" application, "Settings" application, etc., which are not limited in the embodiments of the present application.
[0354] It should be understood that the static searchable content may include static functional data or other static data, etc. This embodiment of the present application does not limit this. For the description of the search configuration file, static functional data, etc., please refer to the aforementioned related content, which will not be repeated here.
[0355] The following description is made by taking the static searchable content of application 1 as the static function data of application 1 as an example. The static function data of application 1 may include fields describing each static function in application 1 and field values corresponding to each field. The fields and field values describing different static functions in application 1 may be recorded as a set of data in the extended field information.
[0356] S11. The application manager calls the resource acquisition module to acquire the search configuration file in the installation package based on the manifest file in the installation package.
[0357] The manifest file in step S11 is the manifest file corresponding to application 1.
[0358] The search configuration file defines the search configuration information required by application 1 when supporting search in the system. The search configuration file may also include field information describing static functions in application 1.
[0359] The manifest file corresponding to the application 1 can be used to declare information (file name and path, etc.) of the files included in the application 1. Other files in the application can be read based on the manifest file. For example, the manifest file can record information such as the name and path of the search configuration file.
[0360] The resource acquisition module can determine the path of the search configuration file through the manifest file corresponding to application 1. Then, based on the path of the search configuration file, the search configuration file corresponding to application 1 is acquired from the installation package of application 1.
[0361] S12. The resource acquisition module reads the extended field information in the search configuration file.
[0362] The field information shown in step S12 is the field information of application 1. For example, in the case where application 1 is a "video" application, the field information (representing static function data) recorded in the search configuration file of application 1 can refer to the aforementioned Figure 3B Description.
[0363] In some possible cases, the extended field information in the search configuration file includes the fields and field values of each static function. The resource acquisition module is configured with the ability to read field information, and can find the field information of application 1 from the search configuration file of application 1 and read the field information of application 1.
[0364] S13. The resource acquisition module records the field information into the search information.
[0365] The field information involved in step S13 is the field information of application 1.
[0366] The search information can be used to record the field information of each application in the electronic device. Different field information corresponds to one application.
[0367] The resource acquisition module records the field information in the search information, and the field information corresponds to application 1. For example, the resource acquisition module may use the unique identifier of application 1 to correspond to the field information of application 1.
[0368] It should be understood here that the aforementioned steps S10 to S13 are executed during the installation of application 1. In some possible cases, the resource acquisition module may call the searchableinfo class to execute steps S11 to S13. When executing step S13, the resource acquisition module may record the field information of application 1 into the search information of the searchableinfo class, and the search information may include at least one object for recording application data. For example, it may include an msearchableinfo() object, and the field information of application 1 may be recorded in the msearchableinfo() object.
[0369] After the application 1 is installed, the following steps S14 to S22 may be performed.
[0370] S14. The application manager sends a broadcast indicating that the installation of application 1 is complete.
[0371] The broadcast of the installation completion of the application 1 carries the identifier of the application 1.
[0372] S15. The event trigger receives the broadcast.
[0373] After the event trigger receives the broadcast of installation completion, the following step S16 may be executed to trigger the search information acquisition module to execute.
[0374] S16. The event trigger triggers the execution of the search information acquisition module.
[0375] The event trigger sends a notification of the completion of the installation of application 1 to the search information acquisition module to trigger the execution of the search information acquisition module. The notification carries the identifier of application 1 so that the search information acquisition module determines that the installed application is application 1.
[0376] S17. The search information acquisition module calls the search manager to acquire search information.
[0377] After the search information acquisition module is triggered to execute, the search information acquisition module may call the search manager to acquire the search information.
[0378] S18. The search manager obtains search information.
[0379] The search manager is located at the application framework layer, and is used to manage and obtain search information in the electronic device.
[0380] S19. The search manager sends the search information to the search information acquisition module.
[0381] After the search manager obtains the search information, it may send the search information to a search information obtaining module in the search service application.
[0382] S20. The search information acquisition module reads the field information corresponding to application 1 in the search information.
[0383] The search information acquisition module reads the field information corresponding to the application 1 from the search information based on the identifier corresponding to the application 1.
[0384] S21. The search information acquisition module sends the field information corresponding to application 1 to the index management module.
[0385] S22. The index management module builds indexes and documents based on the field information corresponding to application 1, obtains index set 1 and document set 1, determines that index set 1 and document set 1 correspond to vertical domain 1, and records index set 1 and document set 1 in the index information file according to vertical domain 1.
[0386] The corresponding field information in application 1 is Figure 3BWhen the field information of the "video" application is shown, the index set 1 and document set 1 obtained by the index management module based on the field information corresponding to the application 1 can refer to the aforementioned Figure 3C .
[0387] The index construction module in the index management module can construct indexes and documents based on the field information corresponding to application 1, obtain index set 1 and document set 1, and determine that index set 1 and document set 1 correspond to vertical domain 1. The process can refer to the following content. Here, vertical domain 1 can be represented as the name of the index information subfile that records the index constructed based on static functional data.
[0388] Here, the field information corresponding to application 1 including fields and field values describing each static function (of application 1) is taken as an example for explanation.
[0389] The index set 1 includes indexes corresponding to each static function (of application 1). The index corresponding to a static function includes indexes corresponding to each field value describing the static function in the field information (of application 1). The index corresponding to a field value includes the field value itself and the extended value of the field value.
[0390] The document set 1 includes all documents corresponding to each static function. One document corresponds to one static function. The static function corresponding to one document refers to the static function described by each field and each field value in the document.
[0391] The index building module generates indexes corresponding to each static function according to the index template based on the fields and field values corresponding to each static function in the field information (corresponding to application 1), and generates documents based on the fields and field values corresponding to each static function to obtain documents corresponding to each static function. The fields and field values corresponding to a static function refer to the fields and field values that describe a static function.
[0392] The index building module may associate an index corresponding to a static function with a document corresponding to the static function. The association may include: setting the same identification number for the document corresponding to the static function, each field value in the index corresponding to the static function, and the extended value of each field value, so that the electronic device can find the document with the same identification number through the identification number of the field value or the extended value.
[0393] For example, the field information includes the fields and field values corresponding to the static function 1, and the index construction module generates the index and document corresponding to the static function 1, including: generating the index corresponding to each field value according to the index template based on each field and each field value corresponding to the static function 1, and obtaining the index corresponding to the static function 1. And, generating the document corresponding to the static function 1 based on each field and each field value describing the static function 1. The document corresponding to the static function 1 includes each field and each field value describing the static function 1, and the document corresponding to the static function 1 is associated with the index corresponding to each field value describing the static function 1.
[0394] The field value corresponding to the static function 1 includes the field value 1, and the index construction module generates the index corresponding to the field value 1 according to the index template, including: obtaining the index construction method of the field corresponding to the field value 1 from the index template (recorded as index construction method 1), and generating the index corresponding to the field value 1 based on the field value 1 according to the index construction method 1. The index corresponding to the field value 1 includes the field value 1 itself and the extended value of the field value 1.
[0395] Among them, the content about the index template and the index construction method corresponding to the field can be referred to the description of the aforementioned related content, which will not be repeated here.
[0396] It should be understood that the field types in a document are unique. For example, a document only includes one "title" field and one "description" field.
[0397] The index management module records the vertical domains corresponding to different types of searchable content. When it is determined that the searchable content to be indexed is field information, the index management module can determine that index set 1 and document set 1 correspond to vertical domain 1. For example, vertical domain 1 can be the "application function" vertical domain.
[0398] The index storage module in the index management module can record the index set 1 and the document set 1 into the index information file according to the vertical domain 1. The process can refer to the following content.
[0399] The index storage module can record the index set 1 and the document set 1 into the index information segment corresponding to the vertical domain 1 in the index information file. In some possible cases, when the vertical domain 1 is the name of the index information subfile (static function subfile) that records the index constructed based on the static function data, the index storage module finds the static function subfile based on the file path 1, and records the index set 1 and the document set 1 into the static function subfile. The file path 1 includes the name of the static function subfile. The static function subfile can be regarded as the index information segment corresponding to the vertical domain 1. The file path 1 can be regarded as the path corresponding to the static function subfile. The file path 1 can be used to find the static function subfile.
[0400] In some possible cases, in step S22, recording index set 1 and document set 1 into the index information file according to vertical domain 1 is optional. The index information file may not be divided according to vertical domains. The index storage module may record index set 1 and document set 1 into the index information file.
[0401] It should be noted here that the fields in the search configuration file of application 1 and the field values corresponding to the fields describe the searchable content that application 1 has after installation and before the first launch. For example, it can be the functions that application 1 has after installation and before the first launch. The functions described by the fields in the search configuration file can be called static functions.
[0402] It should be understood that step S22 is described by creating an index and a document at the same time. Step S22 is optional. During the search process, when a field value or an extended value that successfully matches the query content is determined, step S22 can be executed when the document associated with the field value or the extended value is recalled.
[0403] In some other possible cases, when a field value or an extended value that successfully matches the query content is determined, and other content (such as field values) is recalled, step S22 may not be performed, and the following steps may be performed.
[0404] The index management module constructs an index based on the field information corresponding to application 1, obtains index set 1, determines that index set 1 corresponds to vertical domain 1, and records index set 1 in the index information file according to vertical domain 1. For the description of constructing index set 1 and recording it in the index information file, please refer to the description of the relevant content in the aforementioned step S22, which will not be repeated here.
[0405] It should also be understood that the above steps S14 to S22 are performed after the application is installed. In actual applications, step S14 may not be performed, and a broadcast to start the installation of application 1 may be performed instead. In this way, steps S15 to S20 may be performed during the installation process of application 1.
[0406] The purpose of recording the index and document corresponding to application 1 in the index information file after application 1 is completed is to prevent the situation where application 1 is suspended and deleted after installation begins but before installation is completed, and the index and document corresponding to application 1 are recorded in the index information file, but application 1 is not installed in the electronic device, which will cause the problem that the function of application 1 can be searched but cannot be executed.
[0407] Fig.12 An exemplary software structure framework and processing flow for establishing and recording an index through a configuration interface are shown.
[0408] The process of the electronic device establishing an index corresponding to the dynamic searchable content through the configuration interface and recording the index can refer to Fig.12 Description of steps 1 to 5 in .
[0409] Fig.12 In step 1, application 2 generates searchable content 1. Among them, Fig.12 Step 1 Fig.12 The circle mark in ①.
[0410] Fig.12 In step 2, define properties for the custom fields in the searchable content 1 through the field definition interface. Fig.12 Step 2 is Fig.12 The circle mark in ②.
[0411] Fig.12 In step 3, the index building interface generates a field list 1 based on each field in the searchable content 1 and the field value corresponding to each field. Fig.12 Step 3 in Fig.12 The circle mark in ③.
[0412] Fig.12 In step 4, the index building module builds an index (an index corresponding to searchable content 1) based on the field list 1. Fig.12 Step 4 Fig.12 The circle mark in ④.
[0413] Fig.12 In step 5, the index storage module will build the execution index storage and record it in the index information file. Fig.12 Step 5 is Fig.12 The circle mark in ⑤.
[0414] What should be understood here is that Fig.12 In step 4, in some possible cases, the index building module may build a document corresponding to the searchable content 1 in addition to building an index corresponding to the searchable content 1, and record the index and the document in the index information.
[0415] The following is combined with the above Fig. 9 as well as Fig.12 The software structure diagram involved describes in detail the interaction process between internal modules when the electronic device establishes and records indexes and documents through the configuration interface.
[0416] Fig.13 An exemplary interaction process between internal modules when the configuration interface establishes and records indexes and documents is shown.
[0417] The process of the electronic device establishing an index corresponding to the dynamic searchable content through the configuration interface and recording the index can refer to Fig.13 Description of steps S30-S35 in .
[0418] S30. The data acquisition module of application 2 acquires searchable content 1. The searchable content 1 is dynamic searchable content generated during the opening of application 2. For example, it can be business data generated by application 2, or it can be dynamic function data generated by application 2.
[0419] In response to an input operation in application 2, the data acquisition module of application 2 can obtain searchable content 1 based on the input content. The input operation can be an operation of creating new content. For example, in the case where application 2 is the aforementioned "note" application, in response to the user's operation of creating a new note, the data acquisition module of the "note" application can obtain searchable content 1 based on the newly created note, and the searchable content 1 can include field values in the newly created note and fields corresponding to the field values.
[0420] S31. The field definition interface of application 2 defines the corresponding attributes for the custom fields in searchable content 1.
[0421] This step S31 is optional.
[0422] In some possible cases, the field definition interface can define the corresponding properties for each custom field. For example, define the matching method and index building method corresponding to each custom field. It can also define the query understanding method corresponding to each custom field.
[0423] In some possible cases, the field definition interface includes an IndexForm class, and the field definition interface can call the IndexForm class to define corresponding properties for each custom field.
[0424] The field definition interface can also record each custom field and the attributes corresponding to each custom field in the index template.
[0425] In some possible implementations, each custom field can be identified by a unique identifier corresponding to each custom field, so that two identical custom fields do not appear in the index template. A unique identifier corresponding to a custom field can be used to indicate the custom field. Generally speaking, the unique identifier corresponding to the custom field can also include an identifier of application 2.
[0426] In some possible cases, step S31 may not be performed. For a custom field, it may not be recorded in the field list 1.
[0427] It should be understood here that when recording the field value corresponding to the custom field in the content generated by application 2 into the index information file, the custom field can be added to the index information file, and the index corresponding to the custom field can be added. Before the newly added field is added to the index information file, the attributes corresponding to the custom field defined by application 2 include but are not limited to one or more of the index construction method, matching method, and query understanding method corresponding to the custom field. Among them, the index corresponding to the custom field added in the index information file is an index built based on the field value corresponding to the custom field.
[0428] In some possible cases, application 2 may add the index building method corresponding to the custom field specified by application 2 to the index template.
[0429] In some possible cases, application 2 can specify the index construction method and matching method of the custom field, and add the index construction method and matching method corresponding to the custom field to the index template. Among them, the matching method corresponding to the custom field is used to specify the method when the index value corresponding to the custom field is matched with the query content. In the case that the custom field does not have a query understanding method set, when matching the query content based on the index value corresponding to the custom field, the query content may not be searched and understood. The query content is matched with the index value corresponding to the custom field to obtain the search result.
[0430] In other possible cases, application 2 can specify the index construction method, matching method and query understanding method of the custom field, and add the index construction method, matching method and query understanding method corresponding to the custom field to the index template. Among them, the search and understanding method corresponding to the custom field is used to specify the method of searching and understanding the query content to obtain the understanding result; the matching method corresponding to the custom field is used to specify the method of matching the index value corresponding to the custom field with the understanding result.
[0431] S32. The index building interface of application 2 obtains field list 1 based on searchable content 1. Field list 1 includes each field in searchable content 1 and the field value corresponding to each field.
[0432] The field list 1 is the field list corresponding to application 2.
[0433] The index building interface can convert the data format of each field in the searchable content 1 and the field value corresponding to each field to obtain a field list 1. The data structure of the field list 1 is a data structure that can be parsed by the index building module.
[0434] S33. The index building interface of application 2 sends field list 1 to the index building module of the search service application.
[0435] S34. The index construction module constructs indexes and documents based on field list 1 and index template to obtain index set 2 and document set 2, which correspond to vertical domain 2.
[0436] The index construction module can determine that vertical domain 2 is the vertical domain corresponding to application 2 based on field list 1 being the field list corresponding to application 2. The vertical domain corresponding to application 2 can be represented as the name of the index information sub-file corresponding to application 2.
[0437] In the case where the searchable content 1 is dynamic functional data, the index set 2 and the document set 2 obtained by the index management module based on the field list 1 can refer to the aforementioned Figure 4B .
[0438] In the case where the searchable content 1 is a newly created note, the index set 2 and the document set 2 obtained by the index management module based on the field list 1 can refer to the aforementioned Figure 5D .
[0439] The index building module can build indexes and documents based on field list 1, obtain index set 2 and document set 2, and determine that index set 2 and document set 2 correspond to vertical domain 2. The process can refer to the following content.
[0440] The index set 2 includes indexes corresponding to the field values in the field list 1. The index corresponding to a field value includes the field value itself and an extended value of the field value.
[0441] The document set 2 includes all documents corresponding to the searchable content 1. When the searchable content 1 is dynamic function data, one document corresponds to one dynamic function. The dynamic function corresponding to one document refers to the dynamic function described by each field and each field value in the document. When the searchable content 1 is business data, one searchable content corresponds to one document content. In this case, the document may include each field in the field list 1 and the field value corresponding to each field.
[0442] The index building module can associate each document in the document set 2 with the index corresponding to each field value in each document. The manner of associating a document in the document set 2 with the index corresponding to each field value in the document can include: setting the same identification number for the document, each field value in the document, and the extended value of each field value, so that the electronic device can find the document with the same identification number through the identification number of the field value or the extended value.
[0443] Among them, for the index construction method corresponding to the field and the content of the index template, please refer to the description of the aforementioned related content, which will not be repeated here.
[0444] S35. The index construction module notifies the index storage module to record index set 2 and document set 2 into the index information file according to vertical domain 2.
[0445] The index storage module may record the index set 2 and the document set 2 into the index information file according to the vertical domain 2. The process may refer to the following content.
[0446] The index storage module can record the index set 2 and document set 2 into the index information slice corresponding to vertical domain 2 in the index information file. The process includes: when vertical domain 2 is the name of the index information subfile corresponding to application 2, the index storage module finds the index information subfile corresponding to application 2 based on file path 2, and records the index set 2 and document set 2 into the index information subfile corresponding to application 2. The file path 2 includes the name of the index information subfile corresponding to application 2. Here, the index information subfile corresponding to application 2 can be regarded as the index information slice corresponding to vertical domain 2. The file path 2 can be regarded as the path corresponding to the index information subfile corresponding to application 2. File path 2 can be used to find the index information subfile corresponding to application 2.
[0447] In some possible cases, in step S35, recording index set 2 and document set 2 into the index information file according to vertical domain 2 is optional. The index information file may not be divided according to vertical domains. The index storage module may record index set 2 and document set 2 into the index information file.
[0448] In some possible cases, the index template not only includes the attributes corresponding to the system fields, but also the attributes corresponding to the custom fields. The attributes corresponding to the custom fields can come from different applications, and here it is for the convenience of distinguishing different custom fields. The index template can be divided into index sub-templates corresponding to different applications. The index sub-template corresponding to each application can include system fields and the attributes corresponding to the system fields. For applications with custom fields, the corresponding index sub-template can also include the custom fields customized by the application and the attributes corresponding to the custom fields. In this way, in step S31, application 2 can add the custom fields defined by application 2 and the attributes corresponding to the custom fields to the index sub-template corresponding to application 2 in the index template.
[0449] Fig.14 An exemplary software structure framework and processing flow for establishing and recording indexes through database instrumentation are shown.
[0450] The process of the electronic device establishing an index corresponding to the dynamic searchable content through database plug-in and recording the index can refer to Fig.14 Description of steps 1 to 5 in .
[0451] Fig.14 In step 1, application 3 generates searchable content 2 and writes searchable content 2 into the database. Fig.14 Step 1 Fig.14 The circle mark in ①.
[0452] Fig.14 In step 2, the database manager detects that the database has been modified and determines the identifier of the write location. Fig.14 Step 2 is Fig.14 The circle mark in ②.
[0453] Fig.14 In step 3, the index building notification module obtains searchable content 2 from the database based on the identifier of the write location, and generates a field list 2 based on the searchable content 2. Fig.14 Step 3 in Fig.14 The circle mark in ③.
[0454] Fig.14 In step 4, the index building module builds an index (an index corresponding to the searchable content 2) based on the field list 2. Fig.14 Step 4 Fig.14 The circle mark in ④.
[0455] Fig.14 In step 5, the index storage module will build the execution index storage and record it in the index information file. Fig.14 Step 5 is Fig.14 The circle mark in ⑤.
[0456] What should be understood here is that Fig.14 In step 4, in some possible cases, the index building module may build a document corresponding to the searchable content 2 in addition to building an index corresponding to the searchable content 2, and record the index and the document in the index information.
[0457] The following is combined with the above Fig. 9 as well as Fig.14 The software structure diagram involved describes in detail the interaction process between internal modules when the electronic device establishes and records indexes and documents through database plug-in.
[0458] Fig.15 The exemplary interaction process between internal modules when database plug-in establishes and records indexes and documents is shown.
[0459] The process of the electronic device establishing an index corresponding to the dynamic searchable content through database plug-in and recording the index can refer to Fig.15 Description of steps S40-S46 in .
[0460] S40 . Application 3 generates searchable content 2 , and stores the searchable content 2 in the database corresponding to application 1 .
[0461] In some possible cases, the searchable content 2 may be dynamic searchable content generated during the process of opening the application 3. For example, it may be business data generated based on the application 3.
[0462] In response to an input operation in application 3, application 3 may obtain searchable content 2 based on the input content. The input operation may be an operation of creating new content. For example, in the case where application 3 is the aforementioned "SMS" application, in response to a user's operation of creating a new SMS, the "SMS" application may obtain searchable content 2 based on the newly created SMS, and the searchable content 2 may include field values in the newly created SMS and fields corresponding to the field values.
[0463] S41. The database manager detects that the database has been modified, and sends an identifier corresponding to the location where application 1 writes in the database to the index building notification module.
[0464] S42. The index building notification module calls the provider class of application 3 to obtain the searchable content 2 recorded in the write position based on the identifier in the database corresponding to application 1.
[0465] S43. The index building notification module transforms the data structure of the searchable content 2 to obtain a field list 2, which includes each field in the searchable content 2 and the field value corresponding to each field.
[0466] The fields in the searchable content 2 included in the field list 2 refer to system fields in the searchable content 2 .
[0467] The index construction module determines that vertical domain 3 is the vertical domain corresponding to application 3, which can be represented by the name of the index information subfile corresponding to application 3. The index constructed by the content generated in application 3 (such as dynamic function data or business data) is recorded in the index information subfile corresponding to application 3.
[0468] S44. The index building notification module sends the field list 2 to the index building module.
[0469] S45. The index construction module constructs indexes and documents based on field list 2 and index template to obtain index set 3 and document set 3, which correspond to vertical domain 3.
[0470] The index building module can build indexes and documents based on field list 2, obtain index set 3 and document set 3, and determine that index set 3 and document set 3 correspond to vertical domain 3. The process can refer to the following content.
[0471] The index set 3 includes the index corresponding to each field value in the field list 2. The index corresponding to a field value includes the field value itself and the extended value of the field value.
[0472] The document set 3 includes all documents corresponding to the searchable content 2. When the searchable content 2 is dynamic function data, one document corresponds to one dynamic function. The dynamic function corresponding to one document refers to the dynamic function described by each field and each field value in the document. When the searchable content 2 is business data, one searchable content corresponds to one document content. In this case, the document may include each field in the field list 2 and the field value corresponding to each field.
[0473] The index building module can associate each document in the document set 3 with the index corresponding to each field value in each document. The manner of associating a document in the document set 3 with the index corresponding to each field value in the document may include: setting the same identification number for the document, each field value in the document, and the extended value of each field value, so that the electronic device can find the document with the same identification number through the identification number of the field value or the extended value.
[0474] Among them, for the index construction method corresponding to the field and the content of the index template, please refer to the description of the aforementioned related content, which will not be repeated here.
[0475] S46. The index construction module calls the index storage module to record the index set 3 and the document set 3 into the index information file according to the vertical domain 3.
[0476] The index storage module may record the index set 3 and the document set 3 into the index information file according to the vertical domain 3. The process may refer to the following content.
[0477] The index storage module can record the index set 3 and the document set 3 into the index information slice corresponding to the vertical domain 3 in the index information file. The process includes: when the vertical domain 3 is the name of the index information subfile corresponding to the application 3, the index storage module finds the index information subfile corresponding to the application 3 based on the file path 3, and records the index set 3 and the document set 3 into the index information subfile corresponding to the application 3. The file path 3 includes the name of the index information subfile corresponding to the application 3. Here, the index information subfile corresponding to the application 3 can be regarded as the index information slice corresponding to the vertical domain 3. The file path 3 can be regarded as the path corresponding to the index information subfile corresponding to the application 3. The file path 3 can be used to find the index information subfile corresponding to the application 3.
[0478] In some possible cases, in step S46, recording the index set 3 and the document set 3 into the index information file according to the vertical domain 3 is optional. The index information file may not be divided according to the vertical domain. The index storage module may record the index set 3 and the document set 3 into the index information file.
[0479] Fig.16 An exemplary software structure framework and processing flow for implementing search through index information are shown.
[0480] The process of electronic devices implementing search through index information can be referred to in Fig.16 Description of steps 1 to 6 in .
[0481] Fig.16 In step 1, a search application (such as the "Honor Search" application) is used to obtain the query content. Fig.16 Step 1 Fig.16 The circle mark in ①.
[0482] Fig.16 In step 2, the query error correction module corrects the query content. Fig.16 Step 2 is Fig.16 The circle mark in ②.
[0483] Fig.16 In step 3, the search adaptation module determines query information (query information corresponding to the query content) based on the query content and searches in the index information file to determine the search results. Fig.16 Step 3 in Fig.16 The circle mark in ③.
[0484] Fig.16 In step 4, the search module searches based on the query information corresponding to the query content to obtain search results. Fig.16 Step 4 Fig.16 The circle mark in ④.
[0485] Fig.16 In step 5, the search response module returns the search results to the search application (eg, the "Honor Search" application). In some possible cases, the search response module returns search results that meet the relevance requirements. Fig.16 Step 5 is Fig.16 The circle mark in ⑤.
[0486] Fig.16 In step 6, the search application (such as the "Honor Search" application) displays the search results. Fig.16 Step 6 Fig.16 The circle mark in ⑥.
[0487] The following is combined with the above Fig. 9 as well as Fig.16 The software structure diagram involved describes in detail the interaction process between internal modules when the electronic device searches through index information.
[0488] Fig.17 An exemplary interaction process between internal modules when searching through index information is shown.
[0489] Fig.18 A schematic diagram is shown when query content is input for searching.
[0490] The process of electronic devices implementing search through index information can be referred to in Fig.17 Description of steps S101 to S111 in .
[0491] S101. The search application obtains input query content.
[0492] The search application may be a global search application provided by the electronic device, or a local search application. A global search application is a search application whose corresponding searchable vertical domain is the entire vertical domain. A local search application is a search application whose corresponding searchable vertical domain is part of the vertical domain.
[0493] Among them, the searchable vertical domains corresponding to the search application include the vertical domains that the query content needs to match. For example, when the search application is a global search application, the query content can be matched with the indexes in the index information slices corresponding to all vertical domains. When the searchable vertical domains corresponding to the search application include the "application function" vertical domain, the query content can be matched with the indexes in the index information slices corresponding to all "application function" vertical domains.
[0494] In some possible cases, the search application may provide a search box through which the search application may receive input query content.
[0495] The search application can provide users with multiple ways to input query content, including but not limited to voice input or keyboard input.
[0496] In response to the operation of inputting query content in the search application, the search application can obtain the input query content and call the search service application to perform the search operation. For relevant contents of this process, please refer to the following description of steps S102 to S110.
[0497] S102. The search application sends the query content to the search service application search adaptation module.
[0498] In some possible cases, the search application may send the query content to the search adaptation module of the search service application, so that the search adaptation module can determine the query information corresponding to the query content based on the N1 searchable vertical domains corresponding to the search application. For the description of this process, please refer to the description of step S105 below, which will not be repeated here.
[0499] In some possible cases, the search application may send the query content to the query error correction module of the search service application in addition to sending the query content to the search adaptation module, so that the query error correction module can correct the query content. For a description of this process, please refer to the description of step S103 below, which will not be repeated here.
[0500] S103. The query error correction module performs error correction processing based on the query content to obtain corrected content.
[0501] This step S103 is optional.
[0502] The query error correction module performs error correction processing on the query content to determine the wrong characters therein, and corrects the wrong characters to obtain the corrected content. In this way, even if the input query content contains wrong characters, such as misspelled characters, the electronic device can correct these errors.
[0503] In some possible cases, before correcting the query content, the query error correction module may preprocess the query content to obtain preprocessed query content, and then perform error correction based on the preprocessed query content to obtain corrected content.
[0504] The purpose of preprocessing the query content is to obtain query content that is more in line with the specifications of this article. Preprocessing the query content includes unifying the upper and lower case of the query content, converting full-width characters in the query content to half-width characters, deleting space symbols in the query content, and converting traditional characters in the query content to simplified characters.
[0505] S104. The query error correction module sends the corrected content to the search adaptation module.
[0506] When the aforementioned step S103 is executed, the query error correction module may execute step S104.
[0507] If the aforementioned step S103 is not executed, the step S104 is also not executed.
[0508] S105. The search adaptation module determines the query information corresponding to the query content based on the N1 searchable vertical domains corresponding to the search application. The query information includes at least M1 searchable fields and their corresponding query understanding methods and matching methods.
[0509] The N1 searchable vertical domains can be represented as the names of N1 index information fragments. When the index information is recorded in the index information file, one index information fragment can be regarded as an index information sub-file, and the N1 searchable vertical domains can be represented as the names of N1 index information sub-files.
[0510] The search adaptation module first finds N1 index information fragments based on the file paths corresponding to the N1 index information fragments. The file paths corresponding to different index information fragments include the names of the index information fragments. In the case where the index information fragments are index information subfiles, the search adaptation module finds the index information subfiles based on the file paths corresponding to the index information subfiles.
[0511] In the case where the index information file includes multiple index information sub-files, the N1 searchable vertical domains corresponding to the search application actually define the index information sub-files in the index information file that are allowed to be accessed by the search application. In the case where the search application is a global search application, all index information sub-files in the index information file are allowed to be accessed by the search application. In the case where the search application is a local search application, some index information sub-files in the index information file are allowed to be accessed by the search application.
[0512] The search adaptation module determines the searchable fields in the index information fragments corresponding to the N1 searchable vertical domains based on the N1 searchable vertical domains corresponding to the search application. Here, the searchable fields in the index information fragments corresponding to the N1 searchable vertical domains are M1 in total as an example. Wherein, N1 and M1 are both positive integers greater than or equal to 1.
[0513] Among them, the searchable fields in the index information fragment corresponding to a searchable vertical domain include fields whose corresponding index is not empty. If the index corresponding to a field is not empty, the field value and extended value corresponding to the field are recorded in the index information.
[0514] The search adaptation module obtains the query understanding method and matching method corresponding to the M1 searchable fields from the index template as query information corresponding to the query content.
[0515] In some possible cases, the query information corresponding to the query content may include query error correction values corresponding to N1 searchable vertical domains in addition to the query understanding methods and matching methods corresponding to M1 searchable fields. One searchable vertical domain corresponds to one query error correction value. The query error correction value corresponding to a searchable vertical domain is used to indicate whether the searchable vertical domain uses error-corrected content. If a searchable vertical domain uses error-corrected content, it means that when matching in the index information segment corresponding to the searchable vertical domain based on the query content, the error-corrected content will be used to match the index in the index information segment.
[0516] In some possible implementations, a query error correction value corresponding to a vertical domain may be recorded in an electronic device as an attribute corresponding to the vertical domain.
[0517] S106. The search adaptation module notifies the search module to perform query understanding processing on the query content based on the query understanding methods corresponding to the M1 searchable fields, and obtains understanding results corresponding to the M1 searchable fields.
[0518] Each of the M1 searchable fields corresponds to a query understanding method. For the query understanding method corresponding to the field, please refer to the description of the above-mentioned related content, which will not be repeated here.
[0519] The search module can perform query understanding processing on the query content in the query understanding mode corresponding to the M1 searchable fields, and obtain the understanding results corresponding to the M1 searchable fields. Subsequently, matching can be performed in the indexes corresponding to the different fields based on the understanding results corresponding to the different fields. For the relevant description of the corresponding matching process, please refer to the description of step S107 below, which will not be repeated here.
[0520] like Fig.18As shown, here, step S106 is explained by taking the query content of "note plan" and M1 searchable fields including the "title" field and the "description" field as an example. Among them, the query understanding method corresponding to the "title" field (query understanding method 1) can be: "preprocessing + word segmentation + synonym extraction". The query understanding method corresponding to the "description" field (query understanding method 2) can be: "preprocessing + word segmentation + synonym extraction". The search module performs query understanding processing on the query content based on query understanding method 1, and obtains the understanding result corresponding to the "title" field (understanding result 1). The search module performs query understanding processing on the query content based on query understanding method 2, and obtains the understanding result corresponding to the "description" field (understanding result 2). Among them, the understanding result 1 and the understanding result 2 are the preprocessing result (note plan), the word segmentation result (note plan) and the synonym extraction result (note arrangement).
[0521] S107. The search module searches in N1 index information slices based on the corrected content, the understanding results corresponding to the M1 searchable fields, and the matching method, and determines the documents in each index information slice that successfully match the query content. Different index information slices correspond to different searchable vertical domains in the N1 searchable vertical domains.
[0522] The search module searches in N1 index information slices based on the corrected content, the understanding results corresponding to the M1 searchable fields, and the matching method, and determines the documents in each index information slice that successfully match the query content. The process includes: for each index information slice in each index information slice. The search module matches the understanding results corresponding to each field based on the index corresponding to each field in the index information slice, determines the field value or extended value in the index corresponding to each field in the index information slice that successfully matches the understanding results corresponding to each field, and returns the document associated with the successfully matched field value or extended value. When matching the index corresponding to each field in the index corresponding to each field with the understanding result corresponding to the field, it is performed in accordance with the matching method corresponding to the field. For the matching method and the content of matching according to the matching method, please refer to the description of the aforementioned related content, which will not be repeated here.
[0523] In addition, when the search module matches the understanding results corresponding to each field based on the index corresponding to each field in an index information fragment, the search module can also determine the query correction value corresponding to the index information fragment to further determine whether the index information fragment uses the corrected result. When the index information fragment uses the corrected result, the search module can also match the corrected result based on the index corresponding to each field in the index information fragment, determine the field value or extended value in the index corresponding to each field in the index information fragment that successfully matches the corrected result, and return the document associated with the successfully matched field value or extended value.
[0524] The following is based on Fig.18 Step S107 is exemplarily described.
[0525] like Fig.18 As shown, here, the query content is "note plan", the content after error correction is "note plan", N1 searchable vertical domains include "application function" vertical domain and "note" vertical domain, M1 searchable fields include "title" field and "description" field. Here, the N1 index information fragments include the index information fragment corresponding to the "application function" vertical domain (index information fragment 1) and the index information fragment corresponding to the "note" vertical domain (the information fragment 2).
[0526] For index information fragment 1, the search module can match the index corresponding to the "Title" field in index information fragment 1 with the understanding result (understanding result 1) corresponding to the "Title" field according to matching method 1 (corresponding to the "Title" field), determine the field value or extended value in the index corresponding to the "Title" field that successfully matches the understanding result corresponding to the "Title" field, and return the document associated with the successfully matched field value or extended value (corresponding to the "Application Function" vertical domain). The search module can also match the index corresponding to the "Description" field in index information fragment 1 with the understanding result (understanding result 2) corresponding to the "Description" field according to matching method 2 (corresponding to the "Description" field), determine the field value or extended value in the index corresponding to the "Description" field that successfully matches the understanding result corresponding to the "Description" field, and return the document associated with the successfully matched field value or extended value (corresponding to the "Application Function" vertical domain).
[0527] The search module can also determine that the "application function" vertical domain can use the corrected content. Then, based on the corrected content, it can also match the index corresponding to the "title" field and the index corresponding to the "description" field in index information fragment 1, and return the document associated with the successfully matched field value or extended value (corresponding to the "application function" vertical domain).
[0528] For index information fragment 2, the search module can match the index corresponding to the "Title" field in index information fragment 2 with the understanding result (understanding result 1) corresponding to the "Title" field according to matching method 1 (corresponding to the "Title" field), determine the field value or extended value in the index corresponding to the "Title" field that successfully matches the understanding result corresponding to the "Title" field, and return the document associated with the successfully matched field value or extended value (corresponding to the "Notes" vertical domain). The search module can also match the index corresponding to the "Description" field in index information fragment 2 with the understanding result (understanding result 2) corresponding to the "Description" field according to matching method 2 (corresponding to the "Description" field), determine the field value or extended value in the index corresponding to the "Description" field that successfully matches the understanding result corresponding to the "Description" field, and return the document associated with the successfully matched field value or extended value (corresponding to the "Notes" vertical domain).
[0529] The search module can also determine that the "notes" vertical domain does not use the corrected content. Then, the corrected content will not be matched with the index corresponding to the "title" field and the index corresponding to the "description" field in index information fragment 2 respectively.
[0530] It should be understood here that the understanding result corresponding to a searchable field is searched in N1 index information slices according to the matching method corresponding to the searchable field, and the documents that successfully match the query content in each index information slice are determined. It can be understood as: the understanding result corresponding to a searchable field is searched in N1 index information slices according to the matching method corresponding to the searchable field, and the documents associated with the index value (including field value and extended value) that successfully matches the understanding result corresponding to a searchable field in each index information slice are determined. Because the understanding result corresponding to a searchable field can be used to represent the query content, the document that successfully matches the understanding result corresponding to a searchable field is also the document that successfully matches the query content.
[0531] S108. The search module uses the successfully matched documents in each index information segment as the search result, aggregates each search result according to the vertical domain, and obtains search results corresponding to N2 searchable vertical domains.
[0532] Each search result corresponds to the vertical domain to which its associated field value or extended value belongs.
[0533] The search module can aggregate the search results corresponding to the same vertical domain into a group, and obtain search results corresponding to N2 searchable vertical domains.
[0534] S109. The search module notifies the search response module to perform correlation analysis on the search results corresponding to the N2 searchable vertical domains and the query content respectively, and determines the search results whose correlation meets the requirements among the N2 searchable vertical domains.
[0535] In some possible cases, the search results that meet the relevance requirements in a searchable vertical domain may include the top E search results that are most relevant to the query content among the search results in the searchable vertical domain, where E is an integer greater than or equal to 1.
[0536] In some possible implementations, among the search results of a searchable vertical domain, the search result with the most successful index matches corresponding to the searchable vertical domain is the search result with the highest relevance to the query content among the search results of the searchable vertical domain. Among them, a search result successfully matches the index corresponding to the searchable vertical domain once, including: when matching the query content with the index corresponding to each field in the searchable vertical domain, the search result is returned based on the successfully matched field value or index value.
[0537] S110. The search response module returns the search results whose relevance meets the requirements in the N2 searchable vertical domains to the search application.
[0538] S111. The search application displays search results that meet the relevance requirements based on the N2 searchable vertical domains.
[0539] An example of displaying search results that meet the requirements in the N2 searchable vertical domains can refer to the aforementioned Figure 7B The user interface 73 shown and the Figure 7B Related description.
[0540] The search application can display the field values corresponding to some or all of the fields in each search result from the same vertical domain in N2 searchable vertical domains whose relevance meets the requirements in a display box. The display box can also include the vertical domain name. Generally speaking, the field value (icon) corresponding to the "icon" field in a search result and the field values corresponding to other fields in the search result present a front-to-back relationship when displayed in the display box, rather than a top-to-bottom relationship. In this way, the application or service from which the field values corresponding to other fields come can be highlighted based on the icon.
[0541] It should be understood here that the aforementioned search service application can be called by an application with an in-application search function in addition to being called by a global search application and a local search application for search. For example, applications such as the "Gallery" application and the "Notes" application can be applications with an in-application search function. The application with an in-application search function can obtain the query content and call the search service application to search in the target index information segment based on the query content. After obtaining the search results, the search service application can return the search results with the required relevance to the application with an in-application search function. Then, the application with an in-application search function can be displayed based on the query results. The target index information segment can be the index information segment corresponding to the application with an in-application search function, and the index of the target index information segment is constructed based on the content (such as dynamic function data and business data) generated by the application with an in-application search function. The target index information segment can be an index information subfile that the application with an in-application search function allows to access. The index information subfile that the application with an in-application search function allows to access records the content (such as dynamic function data and business data) generated by the application with an in-application search function.
[0542] In the following, for the convenience of description, the application with the in-application search function is referred to as application 4. When application 4 calls the search service application to search, the application 4 is actually also a search application.
[0543] In some possible cases, the process of application 4 calling the search service application to perform a search can refer to the relevant description of the aforementioned steps S101-S111, which will not be repeated here. The difference is that the searchable vertical domain corresponding to application 4 is the content generated after application 4 is turned on. For example, in the case where application 4 is a "notes" application, the searchable vertical domain corresponding to application 4 is the "notes" vertical domain. At this time, application 4 can obtain the index information sub-file corresponding to application 4 from the index information file to perform a search. The index information sub-file corresponding to application 4 is used to record the content generated after application 4 is turned on (such as dynamic function data and business data).
[0544] In some other possible cases, for the case where the query content includes L query terms, the process of application 4 calling the search service application to perform the search may be different from the aforementioned steps S101-S111. Instead, the following method is adopted: application 4 can customize one or more of the retrieval understanding methods or matching methods when searching based on the query content. Then the query content, the retrieval understanding method and the matching method when searching the query content are transmitted to the search service application. Then the search service application can query the content related to the query content in application 4 in the search information subfile corresponding to application 4 through the query content, the retrieval understanding method and the matching method when searching based on the query content. For example, the matching method can be defined as searching based on L query terms separately, that is, the L query terms are independent of each other. In this way, a search can return search results corresponding to multiple L query terms. The L can be an integer greater than or equal to 2.
[0545] The query content includes L query terms, which can be understood as: there is a space or other special symbol between two adjacent query terms in the L query terms when they are input. It can also be understood as: there is a time difference greater than a preset time between two adjacent query terms in the L query terms when they are input.
[0546] Fig.19 A schematic diagram is shown when a search is performed when the query content includes L query terms.
[0547] In some possible cases, the process of searching for L query terms in the query content can refer to the following Fig.19 Description of steps S201-S208.
[0548] S201. Application 4 obtains input query content, the query content includes L query terms, and there is a space between two adjacent query terms in the L query terms when they are input.
[0549] It should be understood that step S201 is described by taking the case where two adjacent query terms among the L query terms have spaces when they are input as an example. In practice, there may be other situations. For details, please refer to the above content and will not be described again here.
[0550] In response to an operation of inputting L query terms in the application 4 , the application 4 obtains the L query terms as query contents.
[0551] S202. Application 4 defines the query understanding method and matching method when searching the query content.
[0552] Application 4 can define the query understanding method and matching method when searching the query content by calling the custom search interface.
[0553] S203. Application 4 sends the query content, the query understanding method and the matching method when searching the query content to the search service application.
[0554] S204. The search service application determines the index information sub-file in the index information file that the application 4 is allowed to access.
[0555] The index information subfile that application 4 is allowed to access records the content (such as dynamic function data or business data) generated after application 4 is turned on. For example, when application 4 is a "Gallery" application, the searchable vertical domain corresponding to application 4 is the "Gallery" vertical domain. At this time, application 4 can obtain the index information subfile corresponding to application 4 from the index information file to perform a search. At this time, the index information subfile corresponding to application 4 can be used to record the images and image information generated after application 4 is turned on.
[0556] S205. The search service application performs query understanding on the query content based on the query understanding method when searching the query content, and obtains the understanding result of the query content.
[0557] The relevant content of step S205 is similar to the process of establishing the understanding results corresponding to the searchable fields in step S106. You can refer to the process of establishing the understanding results corresponding to the searchable fields in step S106, which will not be repeated here.
[0558] S206. Based on the understanding result of the query content, the search service application searches for content related to the query content in the index information subfiles that the application 4 is allowed to access as search results according to the matching method when searching the query content.
[0559] The search service application searches for documents associated with index values (including field values or extended values) that successfully match the understanding results of the query content in the index information subfiles that the application 4 allows access to as search results based on the understanding results of the query content according to the matching method when searching the query content.
[0560] S207. The search service application returns search results that meet the relevance requirements to application 4.
[0561] S208. Application 4 displays search results that meet the requirements based on sex.
[0562] It should be noted that the application 1 and the application 2 mentioned above may be the same application. The application 1 and the application 3 may also be the same application. The application 4 may be any application among the application 1 to the application 3 mentioned above, or may be other applications.
[0563] It should also be noted that the index template mentioned in the above content is not necessary. The electronic device can create an index information file in the same manner as the attributes corresponding to each field, so as to achieve the purpose of searching the content of the application without launching the application.
[0564] Fig. 20 An exemplary flow chart of an electronic device obtaining an index information file and performing a search based on the index information file is shown.
[0565] Regarding the process of the electronic device obtaining the index information file and searching based on the index information file to obtain the search results, reference may be made to the following description of steps S301 to S303.
[0566] S301. An electronic device installs a first application, and an installation package of the first application includes field information, where the field information is used to describe a first function of the first application.
[0567] The first application may be the aforementioned application 1. For example, it may be a "note" application, a "video" application, and the like.
[0568] The first function may be a function that the first application can provide after installation, and the first function is available before the first application is started for the first time, and is not generated during the running of the application. The first function may also be understood as a static function that the first application can provide.
[0569] The field information of the first application can be recorded in the search configuration file in the installation package. For the description of the field information and the search configuration file, reference can be made to the description of the relevant content in the content, which will not be repeated here.
[0570] In the case where the first application is a "note" application, an exemplary display of the field information can refer to the aforementioned Figure 3E The content shown in (2)
[0571] S302. In response to the first application being installed, the index information file of the electronic device includes a first index value describing the first function.
[0572] The first index value is an index value established by the electronic device based on the field information.
[0573] In response to the first application being installed, the electronic device creates an index value based on the field information to obtain a first index value. The process of the electronic device creating an index value based on the field information can refer to the above description of steps S16 to S22, which will not be repeated here.
[0574] In some possible cases, in addition to establishing the first index value based on the field information, a first document may also be established based on the field information, the first document may include a field describing a first function in the field information and a field value corresponding to the field, and the first document is associated with the first index value. The process of generating the first document may refer to the aforementioned description of step S22 and related contents, which will not be repeated here.
[0575] The manner of determining that the installation of the first application is complete includes, but is not limited to: the electronic device initiates a broadcast of the installation completion of the first application, or the electronic device includes an icon of the first application.
[0576] S303. In response to the first operation on the search application, the electronic device displays search results, which include part or all of the index values related to the first function in the index information file.
[0577] The first operation may be the aforementioned operation of inputting a query content in a search box of a search application. The electronic device may search in an index information file based on the query content, determine an index value related to the query content, and return a document corresponding to the index value as a search result. For example, the search result may include part or all of the index values related to the first function, and the part or all of the index values are recorded in the document associated with the part or all of the index values.
[0578] As mentioned above Fig. 7E As shown, the first function may be a "New To-Do" function in a "Notes" application. When a query ("New To-Do") is entered in a search application, the electronic device may display the search results to obtain a user interface 76. The user interface 76 may include partial index values describing the "New To-Do" function, such as the field value of "New To-Do".
[0579] In some possible cases, during the execution of step S303, the first application may be in a running state or in a non-running state, which is not limited in the embodiment of the present application.
[0580] In some possible cases, in addition to the first index value established based on the field information, the index information file may also include a second index value established based on the field information of the second application. The second index value may be used to describe the second function of the second application. The second function of the second application is a function that the second application can provide after installation. The second function is available before the second application is started for the first time and is not generated during the operation of the application. It can also be understood that the second function can be a static function that can be provided for the second application.
[0581] In some possible cases, in addition to the first index value and the second index value mentioned above, the index information file may also include an index value (third index value) obtained based on the first content generated by the first application after installation. The first content may include business data and dynamic function data generated by the first application, which is not limited in the embodiments of the present application. In the case where the first content includes a newly added field (custom field), the electronic device may also use the index construction method corresponding to the newly added field set by the first application to establish an index value for the field value corresponding to the newly added field. For the process of establishing the third index value based on the first content, please refer to the aforementioned description of steps S30-S35. You may also refer to the aforementioned description of steps S40-S46. This embodiment of the present application will not be repeated.
[0582] In combination with the foregoing, it should be understood that, in some possible cases, when the third index value is obtained based on the first content, a second document can also be obtained based on the first content, and the second document includes fields in the first content and field values corresponding to the fields. The second document is associated with the third index value. For the relevant content of establishing the second document, reference can be made to the foregoing description of step S35 or step S46, which will not be repeated here.
[0583] When the index information file is divided into at least one sub-file according to the vertical domain, and each sub-file corresponds to a file path, the electronic device can record the first index value and the second index value into the first sub-file in the index information file based on the first file path. The first sub-file can be the static function sub-file mentioned above.
[0584] It should be understood that, in addition to recording the first index value, the first subfile may also record the first document mentioned above, and may also record a document obtained based on the field information in the second application.
[0585] In addition to the first subfile, the index information file may also include a second subfile, and the second subfile may be used to record the third index value, or the second subfile may also be used to record the third index value and the second document.
[0586] It should be understood that the index value (fourth index value) established by the content generated by the second application can be recorded in the index information subfile (third subfile) corresponding to the second application.
[0587] The following is an introduction to an exemplary electronic device provided in an embodiment of the present application.
[0588] Fig.21 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0589] The following is a detailed description of the embodiment using an electronic device as an example. It should be understood that the electronic device may have more than Fig.21 More or fewer components may be shown, two or more components may be combined, or there may be a different configuration of components. Fig.21 The various components shown in the EMBODIMENTS 2000 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application specific integrated circuits.
[0590] The electronic device may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194 and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0591] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0592] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0593] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0594] The processor 110 may also be provided with a memory for storing instructions and data.
[0595] In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, and the like.
[0596] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0597] The charging management module 140 is used to receive charging input from a charger.
[0598] The power management module 141 is used to connect the battery 142 , the charging management module 140 and the processor 110 .
[0599] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0600] In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include the global system for mobile communications (GSM), general packet radio service (GPRS), etc.
[0601] The electronic device realizes the display function through a GPU, a display screen 194, and an application processor.
[0602] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel.
[0603] The electronic device can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.
[0604] The electronic device can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0605] The touch sensor 180K is also called a “touch panel.” The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen.”
[0606] The buttons 190 include a power button, a volume button, etc. The buttons 190 may be mechanical buttons.
[0607] Motor 191 can generate vibration prompts.
[0608] Indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, messages, missed calls, notifications, etc.
[0609] The SIM card interface 195 is used to connect a SIM card.
[0610] In the embodiment of the present application, the processor 110 can call the computer instructions stored in the internal memory 121 to enable the terminal to execute the search method in the embodiment of the present application.
[0611] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, 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 application.
[0612] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.
[0613] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using 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 application 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 devices. 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 by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. 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 contains one or more available media integration. 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), etc.
[0614] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A search method, characterized in that: The method comprises: The electronic device generates first content in a first application; The electronic device detects a first search operation in the search application; In response to the first search operation, the electronic device performs a search to obtain a first search result; when the search is performed, the first application is not running; The electronic device displays the first search result in the search application, where the first search result indicates the first content.
2. The method according to claim 1, characterized in that The method further comprises: In response to an operation on the first search result, the electronic device runs the first application and displays the first content in the first application.
3. The method according to claim 1 or 2, characterized in that: After the electronic device generates the first content in the first application, the method further includes: The electronic device records the first content into an index information file, wherein the index information file includes a first index value for describing the first content; the index information file also includes an index value for describing a second content generated by a second application; The electronic device searches to obtain a first search result, specifically including: The electronic device searches the index information file to obtain a first search result, where the first search result includes part or all of the first index value.
4. The method according to claim 3, characterized in that The method further comprises: The electronic device installs a first application; the first application has a first function; In response to the first application being installed, a second index value for describing the first function is added to the index information file of the electronic device; In response to a second search operation on the search application, the electronic device displays a second search result, wherein the second search result includes part or all of the second index value, wherein the first application is not in operation.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The electronic device records the first index value into the first sub-file of the index information file based on the first file path; describes that the first file path carries the name of the index information file and the name of the first sub-file; and the first sub-file also includes an index value describing the second function of the second application.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The electronic device records the second index value into a second subfile of the index information file based on a second file path, where the second file path carries the name of the index information file and the name of the second subfile.
7. The method according to claim 6, characterized in that In addition to the first subfile and the second subfile, the index template also includes a third subfile, where the third subfile is used to record an index value describing the second content generated in the second application.
8. The method according to claim 7, characterized in that The search function within the first application allows access to the first sub-file and the second sub-file, but does not allow access to the third sub-file; the search function within the second application allows access to the first sub-file and the third sub-file, but does not allow access to the second sub-file; the global search function in the electronic device allows access to the first sub-file, the second sub-file, and the third sub-file.
9. The method according to any one of claims 1 to 8, characterized in that After the first content is generated in the first application, a new field is added to the index information file, and the index value corresponding to the new field is obtained according to the index construction method preset by the first application, and the index value corresponding to the new field is included in the first index value.
10. The method according to claim 9, characterized in that Before adding a new field to the index information file, the method further includes: The electronic device adds the index building method specified by the first application to the index template.
11. The method according to claim 10, characterized in that The method further comprises: The electronic device adds the matching method and the retrieval and understanding method corresponding to the newly added field to the index template. The retrieval and understanding method corresponding to the newly added field is used to specify the method for retrieving and understanding the query content to obtain the understanding result; the matching method corresponding to the newly added field is used to specify the method for matching the index value corresponding to the newly added field with the understanding result.
12. The method according to claim 3 or 4, characterized in that: Recording the first content into the index information file specifically includes: Sending the first content to a search service application by calling a first interface through the first application; The first content is recorded in the index information file through the search service application.
13. The method according to claim 3 or 4, characterized in that: Recording the first content into the index information file specifically includes: Recording the first content into a database corresponding to the first application through the first application; Acquire the first content from the database by using a search service application; The first content is recorded in the index information file through the search service application.
14. An electronic device, characterized in that: include: One or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the electronic device to perform the method as described in any one of claims 1 to 13.
15. A chip system, the chip system is applied to electronic equipment, characterized in that: The chip system includes one or more processors, and the processor is used to call computer instructions so that the electronic device executes the method as described in any one of claims 1 to 13.
16. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device is caused to execute the method as claimed in any one of claims 1 to 13.
17. A computer program product comprising instructions, characterized in that When the computer program product is executed on an electronic device, the electronic device is caused to execute the method according to any one of claims 1 to 13.