Unified search word library updating method and device
By monitoring the word data changes in the target database, the word database update plug-in is used to automatically update the unified search word database, which solves the problems of low lexicon update efficiency and high operation and maintenance costs in cluster deployment, and realizes the timeliness of lexicon updates and the accuracy of search results.
Patent Information
- Application Number
- CN202110544316.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-05-19
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2041-05-19
AI Technical Summary
In the Elasticsearch environment deployed by cluster, the update of the unified search vocabulary requires restarting the server one by one, resulting in high operation and maintenance costs and low update efficiency when the cluster scale is expanded, affecting the timeliness of user query results.
Provide a unified search vocabulary update method. By monitoring the word data changes in the target database, the vocabulary update plug-in is used to automatically update the unified search vocabulary, avoiding the need to restart ES.
It improves the efficiency of unified search vocabulary updates, reduces operation and maintenance costs, ensures that vocabulary updates can timely affect user query results, and makes search results more accurate and accurate.
Smart Images

Figure CN113190569B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automatic programming, and in particular to a unified search word library updating method and device. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.
[0003] Elasticsearch (hereinafter referred to as ES) is a distributed, highly scalable, and highly real-time search and data analysis engine. It can easily enable the search, analysis, and exploration of large amounts of data. Unified Search uses the ik word segmenter plug-in of ElasticSearch to perform Chinese word segmentation and indexing. When defining an extended vocabulary, it is generally adopted to read the extended vocabulary file stored in the ES configuration directory. After the content of the extended vocabulary is changed, ES needs to be restarted to take effect; this vocabulary expansion method requires restarting the servers one by one when the cluster is deployed, which becomes particularly difficult when the number of clusters expands to a certain scale. Summary of the invention
[0004] The present invention provides a unified search word library update method and device, which can automatically realize the unified search word library update, reduce operation and maintenance costs, improve word library update efficiency, and further ensure that the word library update can timely affect user query results, making search results more accurate and precise.
[0005] In a first aspect, an embodiment of the present invention provides a unified search word library updating method, the method comprising:
[0006] The target database is monitored to obtain monitoring results; and according to the monitoring results, the unified search vocabulary is updated using a vocabulary update plug-in.
[0007] Furthermore, the word library update plug-in includes a first plug-in and a second plug-in; monitoring the target database, before obtaining the monitoring result, further includes:
[0008] The first category word information in the unified search word library is stored in the first plug-in, and the second category word information is stored in the second plug-in.
[0009] Furthermore, monitoring the target database includes: monitoring the changes of the first category word information and the second category word information in the target database to obtain monitoring results.
[0010] Furthermore, the first category word information includes first version number information, and the second category word information includes second version number information; monitoring the changes of the first category word information and the second category word information in the target database, and obtaining monitoring results, including:
[0011] If the first version number information changes, the monitoring result is determined to be that the first category word information is updated; if the second version number information changes, the monitoring result is determined to be that the second category word information is updated.
[0012] Further, according to the monitoring result, the unified search word library is updated by using a word library update plug-in, including:
[0013] If the monitoring result is that the first category word information is updated, the updated first category word information in the target database is added to the first plug-in; if the monitoring result is that the second category word information is updated, the updated second category word information in the target database is added to the second plug-in.
[0014] Furthermore, the first plug-in includes a word segmentation processing component and a storage component; adding the updated first-category word information in the target database to the first plug-in includes: using the word segmentation processing component to perform format conversion on the updated first-category word information to obtain a format conversion result; and sending the format conversion result to the storage component.
[0015] Furthermore, the second plug-in includes a first storage component and a second storage component; adding the updated second category word information in the target database to the second plug-in includes: storing a first group of word data in the second category word information to the first storage component; storing a second group of word data in the second category word information to the second storage component.
[0016] Furthermore, the first category word information includes synonym data; the second category word information includes user-defined word data and stop word data.
[0017] In a second aspect, an embodiment of the present invention further provides a unified search vocabulary updating device, which includes: a monitoring module, used to monitor a target database to obtain monitoring results; an updating module, used to update the unified search vocabulary using a vocabulary update plug-in according to the monitoring results.
[0018] Furthermore, the word library update plug-in includes a first plug-in and a second plug-in; the device also includes an initialization module, which is used to: store the first category word information in the unified search word library to the first plug-in, and store the second category word information to the second plug-in.
[0019] Furthermore, the monitoring module is specifically used to monitor changes in the first category word information and the second category word information in the target database to obtain monitoring results.
[0020] Furthermore, the first category word information includes first version number information, and the second category word information includes second version number information.
[0021] The monitoring module is specifically used to: if the first version number information changes, determine the monitoring result as an update of the first category word information; if the second version number information changes, determine the monitoring result as an update of the second category word information.
[0022] Furthermore, the update module includes a first update unit and a second update unit.
[0023] The first updating unit is used to add the updated first-category word information in the target database to the first plug-in if the monitoring result is that the first-category word information is updated; the second updating unit is used to add the updated second-category word information in the target database to the second plug-in if the monitoring result is that the second-category word information is updated.
[0024] Furthermore, the update module includes a first update unit and a second update unit.
[0025] The first updating unit is used to add the updated first-category word information in the target database to the first plug-in if the monitoring result is that the first-category word information is updated; the second updating unit is used to add the updated second-category word information in the target database to the second plug-in if the monitoring result is that the second-category word information is updated.
[0026] Furthermore, the second plug-in includes a first storage component and a second storage component; and the second update unit is specifically configured to:
[0027] The first group of word data in the second category of word information is stored in the first storage component; and the second group of word data in the second category of word information is stored in the second storage component.
[0028] Furthermore, the first category word information includes synonym data; the second category word information includes user-defined word data and stop word data.
[0029] In a third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned unified search vocabulary updating method when executing the computer program.
[0030] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned unified search vocabulary updating method.
[0031] The embodiment of the present invention brings the following beneficial effects: The embodiment of the present invention provides a unified search word library update method, the method comprising: monitoring a target database to obtain monitoring results; and updating the unified search word library using a word library update plug-in according to the monitoring results. The embodiment of the present invention monitors the target database to understand the word data changes of the target database and obtain the monitoring results. After that, the unified search word library is automatically updated based on the word data changes in the monitoring results using the word library update plug-in, thereby improving the efficiency of the unified search word library update. The word library update does not require restarting ES, reducing operation and maintenance costs, thereby ensuring that the word library update can timely affect the user query results, making the search results more accurate and precise.
[0032] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention are realized and obtained by the structures particularly pointed out in the description, claims and drawings.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0035] Figure 1 A flow chart of a unified search word library updating method provided by an embodiment of the present invention;
[0036] Figure 2 A schematic diagram of a first plug-in data processing flow provided by an embodiment of the present invention;
[0037] Figure 3 A schematic diagram of a second plug-in data processing flow provided by an embodiment of the present invention;
[0038] Figure 4 A structural block diagram of a unified search word library updating device provided by an embodiment of the present invention;
[0039] Figure 5 A structural block diagram of another unified search word library updating device provided by an embodiment of the present invention;
[0040] Figure 6 A structural block diagram of an update module provided in an embodiment of the present invention;
[0041] Figure 7 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] At present, with the increase in the number of website users, the vocabulary that users search for is also expanding, and new network words or new words that appear on the Internet or in life are also constantly updated. This determines that the ES vocabulary needs to be updated synchronously with business needs to ensure the accuracy of user search results. Under the original update strategy, the scale of cluster deployment is proportional to the complexity of update deployment. The manual operation and maintenance update method is inefficient and there is also the possibility of misoperation.
[0044] Elasticsearch comes with a synonym plug-in, but this plug-in can only use files or statically configure synonyms in the analyzer. If you need to add or modify them, you need to modify the configuration file and restart. If the vocabulary becomes larger and more in the future, or if you want operators to participate in the management of the vocabulary, this method is not friendly and efficient enough.
[0045] Based on this, an embodiment of the present invention provides a unified search vocabulary updating method and device, which can periodically pull vocabulary updates from a MySQL database, dynamically maintain the vocabulary and apply it to a production environment.
[0046] The method can automatically refresh at regular intervals, improve efficiency, reduce operation and maintenance costs, increase the source API (Application Programming Interface) for expanding the vocabulary, and open up the channel for the user end to influence the user end.
[0047] To facilitate understanding of this embodiment, a unified search word library updating method disclosed in an embodiment of the present invention is first introduced in detail.
[0048] First, the terminology involved is introduced.
[0049] Custom words: Due to the endless emergence of Internet words, the ElasticSearch-ik word segmenter sometimes cannot fully recognize Internet words, such as Honor of Kings, Treasure Boy, etc.; these words should be recognized as one word instead of being split into two, so it is necessary to add custom words to the vocabulary to solve the above problem.
[0050] Stop words: They appear very frequently in the text but have little impact on the information carried by the text, such as and, the, de, le, shi, etc. They are usually filtered out after word segmentation and will not be indexed.
[0051] Synonyms: Different words that express the same meaning, such as tomato and tomato, Nike and Nike, etc., are often used to expand the scope of the search.
[0052] The embodiment of the present invention provides a unified search word library update method, see Figure 1 The flowchart of a unified search word library updating method is shown, and the method comprises the following steps:
[0053] Step S102: monitor the target database and obtain the monitoring result.
[0054] In an embodiment of the present invention, the unified search word library is based on the ElasticSearch search analysis storage tool and uses the IK Chinese word segmentation plug-in.
[0055] The target database can be set according to actual needs, for example, it can be a mySQL traditional relational database. The target database is used to store word information obtained from various channels. The monitoring results include changes in word information in the target database, where the changes include word updates and word modifications, and the changes can be specific to the time and content of the update or modification.
[0056] It should be noted that the items and format information included in the monitoring result can be preset.
[0057] In an embodiment of the present invention, the unified search extended vocabulary is defined in the target database, and the management method is more convenient and simple. The extended vocabulary can be managed without systematic learning of ES knowledge. The API can also be exposed to expand the vocabulary through channels such as data analysis, which is more intelligent and has more diverse management methods.
[0058] Step S104: based on the monitoring result, the unified search word library is updated using the word library update plug-in.
[0059] In the embodiment of the present invention, the monitoring result includes a variety of different contents. When there is a change in word information in the monitoring result, the word library update plug-in can be used to obtain relevant data on the word information change in the target database to update the unified search word library.
[0060] It should be noted that the source of the vocabulary can be offline collection of the business in user usage scenarios, or a certain custom word list can be obtained through big data analysis. The size of the user base and the frequency of new words determine the update frequency of the vocabulary.
[0061] You can set a certain time interval or obtain the monitoring results at a certain time to achieve regular updates of the vocabulary. The update frequency can be freely controlled, and the update takes effect in time to affect the search results.
[0062] The embodiment of the present invention provides a unified search word library update method, the method comprising: monitoring a target database to obtain a monitoring result; and updating the unified search word library using a word library update plug-in according to the monitoring result. The embodiment of the present invention monitors the target database to understand the word data changes of the target database and obtain the monitoring result. After that, the unified search word library is automatically updated based on the word data changes in the monitoring result using the word library update plug-in, thereby improving the efficiency of the unified search word library update. The word library update does not require restarting ES, reducing the operation and maintenance cost, thereby ensuring that the update of the word library can timely affect the user query results, making the search results more accurate and precise.
[0063] Considering that the unified search word library may include different types of word information, the word library update plug-in includes a first plug-in and a second plug-in; before monitoring the target database and obtaining the monitoring result, the following operations may also be performed:
[0064] The first category word information in the unified search word library is stored in the first plug-in, and the second category word information is stored in the second plug-in.
[0065] In an embodiment of the present invention, word information may include first-category word information and second-category word information, and the first-category word information and the second-category word information include different features. Updating the first-category word information and the second-category word information separately may facilitate data processing and improve the updating efficiency of the unified search word library. Therefore, the first-category word information in the existing word information in the unified search word library may be stored in a first plug-in, and the second-category word information may be stored in a second plug-in to implement the initialization of the word information in the first plug-in and the second plug-in. Subsequently, by respectively updating the word information in the first plug-in and the second plug-in, the unified search word library may be updated.
[0066] In one embodiment, monitoring the target database may be performed according to the following steps:
[0067] Monitor the changes in the first category word information and the second category word information in the target database to obtain monitoring results.
[0068] In the embodiment of the present invention, the changes of the first category word information and the second category word information in the target database are monitored respectively, so the monitoring result includes the first category word information change result and the second category word information change result.
[0069] In order to improve the monitoring accuracy and efficiency of word information changes, in one embodiment, the first category word information includes first version number information, and the second category word information includes second version number information; monitoring the changes of the first category word information and the second category word information in the target database to obtain the monitoring results can be performed according to the following steps:
[0070] If the first version number information changes, the monitoring result is determined to be that the first category word information is updated; if the second version number information changes, the monitoring result is determined to be that the second category word information is updated.
[0071] In the embodiment of the present invention, each time there is a change in word information in the target database, there is a corresponding version number change.
[0072] For example, when the word information in the target database includes data A and B, the version number is version 1.0, and when the word information in the target database includes data A, B and C, the version number is version 2.0.
[0073] It should be noted that, in the embodiment of the present invention, the first version number information and the second version number information are respectively set for the first category word information and the second category word information in the target database to achieve simultaneous and separate monitoring.
[0074] In one embodiment, according to the monitoring result, the unified search word library is updated by using the word library update plug-in, which can be performed according to the following steps:
[0075] If the monitoring result is that the first category word information is updated, the updated first category word information in the target database is added to the first plug-in; if the monitoring result is that the second category word information is updated, the updated second category word information in the target database is added to the second plug-in.
[0076] In the embodiment of the present invention, the first plug-in is used to update the first category word information in the unified search word library, and the second plug-in is used to update the first category word information in the unified search word library.
[0077] It should be noted that the first plug-in can be optimized based on the dynamic-synonym plug-in, and the second plug-in can be optimized based on the analysis-ik plug-in.
[0078] In one embodiment, the first plug-in includes a word segmentation processing component and a storage component; adding the updated first-category word information in the target database to the first plug-in can be performed according to the following steps:
[0079] The updated first-category word information is format-converted by using the word segmentation processing component to obtain a format conversion result; and the format conversion result is sent to the storage component.
[0080] In an embodiment of the present invention, the first plug-in may include a word segmentation processing component and a storage component, wherein the word segmentation processing component may convert the format of the first category word information in the target database into a format consistent with the storage component, so as to load the data in the target database into the defined storage component.
[0081] It should be noted that, in an embodiment of the present invention, the word segmentation processing component may not send all updated first-category word information in the target database to the storage component. The word segmentation processing component may first filter the updated first-category word information to obtain the target updated first-category word information, and then perform format conversion on the target updated first-category word information, thereby improving data processing efficiency.
[0082] In one embodiment, the second plug-in includes a first storage component and a second storage component; adding the updated second-category word information in the target database to the second plug-in may be performed according to the following steps:
[0083] The first group of word data in the second category word information is stored in the first storage component; and the second group of word data in the second category word information is stored in the second storage component.
[0084] In the embodiment of the present invention, the second category word information may include a first group of word data and a second group of word data, and the first group of word data and the second group of word data have different feature information.
[0085] It should be noted that, in a specific implementation, the first group of word data and the second group of word data may be stored separately in the second plug-in.
[0086] In one embodiment, the first type of word information includes synonym data; the second type of word information includes user-defined word data and stop word data.
[0087] In the embodiment of the present invention, the hot update of the unified search vocabulary includes two parts: hot update of synonyms, hot update of user-defined words and hot update of stop words, which are respectively based on the optimization made by the dynamic-synonym plug-in and the analysis-ik plug-in.
[0088] See also Figure 2 The first plug-in data processing flow diagram shown in the figure can define SynonymTokenFilter as a word segmentation processor, that is, a word segmentation processing component, and can define SynonymMap as a custom first-category word information word library, that is, a storage component. The first plug-in is used to update synonyms.
[0089] Synonym hot update depends on the dynamic-synonym plug-in, which defines SynonymTokenFilter as a word segmentation processor and SynonymMap as a custom synonym library. After configuring the synonym segmenter and filter in the ES index, you can add synonym association results during the search process.
[0090] SynonymMap is read from the database by the listener as the content of the synonym database. The listener will monitor the version number of the synonym record in the database. If the version number changes, the new synonym record will be read from the database and loaded into the synonym database.
[0091] See also Figure 3 The second plug-in data processing flow diagram shown, the second type of word information includes custom word data and stop word data, wherein the custom word data can be the first group of word data, and the stop word data can be the second group of word data. The second plug-in is used to update the custom words and stop words.
[0092] The hot update of custom words and stop words depends on the analysis-ik plug-in, which defines the Dictionnary class as the vocabulary class, which contains the MainDict main vocabulary and the StopWords stop vocabulary. During the vocabulary initialization process, Java Database Connectivity (JDBC) is used to query the custom words and stop words in mySQL respectively, and then put them into the corresponding dictionary.
[0093] It should be noted that, in the embodiment of the present invention, a monitoring thread may be established to load user-defined words and stop words at regular intervals.
[0094] The present invention provides a unified search word library update method and device, in which the ES plug-in periodically reads custom words, stop words, and synonyms from a database and loads them into the corresponding ES word library, which can affect the user query results after being loaded into the word library. Applying this method, the unified search word library update can load new custom words, stop words, and synonyms by reading a relational database. The word library update does not require restarting ES, which reduces the operation of operation and maintenance personnel. The word library regularly reads the latest data from the mySQL database, which is convenient for business management and updating. It also opens up channels for subsequent AI (Artificial Intelligence) to perform big data analysis based on user search behavior and dynamically improve and update the word library, laying a foundation.
[0095] The present invention also provides a unified search word library update device, as described in the following embodiments. Since the principle of the device to solve the problem is similar to that of the unified search word library update method, the implementation of the device can refer to the implementation of the unified search word library update method, and the repeated parts will not be repeated.
[0096] See also Figure 4 The structural block diagram of a unified search word library updating device is shown, and the device may include:
[0097] The monitoring module 61 is used to monitor the target database and obtain the monitoring result; the updating module 62 is used to update the unified search word library by using the word library update plug-in according to the monitoring result.
[0098] In one embodiment, the word library update plug-in includes a first plug-in and a second plug-in; see Figure 5 Another structural block diagram of a unified search word library updating device is shown, the device also includes: an initialization module 63, which is used to: store the first category word information in the unified search word library to the first plug-in, and store the second category word information to the second plug-in.
[0099] In one embodiment, the monitoring module is specifically used to monitor the changes in the first category word information and the second category word information in the target database to obtain monitoring results.
[0100] In one embodiment, the first category word information includes first version number information, and the second category word information includes second version number information; the monitoring module is specifically used to: if the first version number information changes, then determine the monitoring result is that the first category word information is updated; if the second version number information changes, then determine the monitoring result is that the second category word information is updated.
[0101] In one embodiment, see Figure 6 The update module structural block diagram shown in the figure, the update module includes a first update unit 621 and a second update unit 622; the first update unit is used to add the updated first category word information in the target database to the first plug-in if the monitoring result is that the first category word information has been updated; the second update unit is used to add the updated second category word information in the target database to the second plug-in if the monitoring result is that the second category word information has been updated.
[0102] In one embodiment, the first plug-in includes a word segmentation processing component and a storage component; the first update unit is specifically used to: use the word segmentation processing component to perform format conversion on the updated first category word information to obtain a format conversion result; and send the format conversion result to the storage component.
[0103] In one embodiment, the second plug-in includes a first storage component and a second storage component; the second update unit is specifically used to: store the first group of word data in the second category word information to the first storage component; store the second group of word data in the second category word information to the second storage component.
[0104] In one embodiment, the first type of word information includes synonym data; the second type of word information includes user-defined word data and stop word data.
[0105] It should be noted here that the examples and application scenarios implemented by the modules in the above-mentioned unified search vocabulary updating device and the corresponding steps in the unified search vocabulary updating method are the same, but are not limited to the contents disclosed in the above-mentioned unified search vocabulary updating method embodiment.
[0106] It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0107] Based on the same inventive concept, an embodiment of the present invention further provides an electronic device embodiment for implementing all or part of the contents of the above-mentioned unified search word library update method. The electronic device specifically includes the following contents:
[0108] A processor, a memory, a communications interface, and a bus; wherein the processor, the memory, and the communications interface communicate with each other through the bus; the communications interface is used to realize information transmission between related devices; the electronic device can be a desktop computer, a tablet computer, a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the electronic device can be implemented with reference to the embodiment for realizing the above-mentioned unified search word library update method and the embodiment for realizing the above-mentioned unified search word library update device, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0109] Figure 7 FIG. 1 is a schematic diagram of a system structure of an electronic device provided in an embodiment of the present invention. Figure 7 As shown, the electronic device 70 may include a processor 701 and a memory 702; the memory 702 is coupled to the processor 701. It is worth noting that Figure 7 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0110] In one embodiment, the functions implemented by the unified search word library updating method may be integrated into the processor 701. The processor 701 may be configured to perform the following control:
[0111] Monitor the target database and obtain the monitoring results; based on the monitoring results, use the vocabulary update plug-in to update the unified search vocabulary.
[0112] From the above, it can be seen that the electronic device provided in the embodiment of the present invention monitors the target database, understands the changes in the word data of the target database, obtains the monitoring results, and then uses the vocabulary update plug-in to automatically update the unified search vocabulary based on the word data changes in the monitoring results, thereby improving the efficiency of the unified search vocabulary update. The vocabulary update does not require restarting ES, reducing operation and maintenance costs, thereby ensuring that the vocabulary update can timely affect the user query results, making the search results more accurate and precise.
[0113] In another embodiment, the unified search vocabulary updating device may be configured separately from the processor 701. For example, the unified search vocabulary updating device may be configured as a chip connected to the processor 701, and the functions of the unified search vocabulary updating method may be implemented under the control of the processor.
[0114] like Figure 7 As shown, the electronic device 70 may also include: a communication module 703, an input unit 704, an audio processing unit 705, a display 706, and a power supply 707. It is worth noting that the electronic device 70 does not necessarily have to include Figure 7 In addition, the electronic device 70 may also include Figure 7 For components not shown, reference may be made to the prior art.
[0115] like Figure 7 As shown, the processor 701 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The processor 701 receives inputs and controls the operations of various components of the electronic device 70 .
[0116] The memory 702 may be, for example, a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices, or one or more thereof. The above-mentioned information related to the failure may be stored, and a program for executing the related information may also be stored. The processor 701 may execute the program stored in the memory 702 to implement information storage or processing, etc.
[0117] The input unit 704 provides input to the processor 701. The input unit 704 is, for example, a key or a touch input device. The power supply 707 is used to provide power to the electronic device 70. The display 706 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0118] The memory 702 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that retains information even when power is off, can be selectively erased, and is provided with more data, an example of which is sometimes referred to as an EPROM, etc.
[0119] The memory 702 may also be some other type of device. The memory 702 includes a buffer memory 7021 (sometimes referred to as a buffer). The memory 702 may include an application / function storage unit 7022 for storing application programs and function programs or for executing the operation process of the electronic device 70 through the processor 701.
[0120] The memory 702 may also include a data storage unit 7023 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 7024 of the memory 702 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).
[0121] The communication module 703 is a transmitter / receiver that sends and receives signals via the antenna 708. The communication module (transmitter / receiver) 703 is coupled to the processor 701 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0122] Based on different communication technologies, multiple communication modules 703 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) 703 is also coupled to a speaker 709 and a microphone 710 via an audio processing unit 705 to provide an audio output via the speaker 709 and receive an audio input from the microphone 710, thereby realizing a common telecommunication function. The audio processing unit 705 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processing unit 705 is also coupled to the processor 701, so that recording can be performed on the local machine through the microphone 710, and the sound stored on the local machine can be played through the speaker 709.
[0123] In an embodiment of the present invention, a computer-readable storage medium is provided for implementing all the steps in the unified search vocabulary updating method in the above embodiment. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, all the steps in the unified search vocabulary updating method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0124] Monitor the target database and obtain the monitoring results; based on the monitoring results, use the vocabulary update plug-in to update the unified search vocabulary.
[0125] From the above, it can be seen that the computer-readable storage medium provided in the embodiment of the present invention monitors the target database, understands the changes in the word data of the target database, and obtains the monitoring results. After that, the word library update plug-in is used to automatically update the unified search word library based on the word data changes in the monitoring results, thereby improving the efficiency of the unified search word library update. The word library update does not require restarting ES, reducing operation and maintenance costs, thereby ensuring that the word library update can timely affect the user query results, making the search results more accurate and precise.
[0126] Although the present invention provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, in a parallel processor or multi-threaded processing environment).
[0127] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0128] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention.
[0129] It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0130] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0132] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0133] In this document, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. The orientation or position relationship indicated by the terms "upper", "lower", etc. is based on the orientation or position relationship shown in the accompanying drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0134] Unless otherwise expressly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other in the absence of conflict. The present invention is not limited to any single aspect, nor to any single embodiment, nor to any combination and / or permutation of these aspects and / or embodiments. Each aspect and / or embodiment of the present invention may be used alone or in combination with one or more other aspects and / or other embodiments.
[0135] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for hot updating of a unified search word library, characterized in that: include: Monitoring a target database to obtain monitoring results; the target database is used to store word information obtained from multiple channels; According to the monitoring result, the unified search word library is updated by using a word library update plug-in; wherein, the word library update plug-in is used to obtain relevant data on word information changes in the target database to update the unified search word library; the word library update plug-in includes a first plug-in and a second plug-in; the first plug-in is optimized based on the dynamic-synonym plug-in, and the second plug-in is optimized based on the analysis-ik plug-in; Wherein, before monitoring the target database and obtaining the monitoring result, the method further includes: storing the first category word information in the unified search word library into the first plug-in, and storing the second category word information into the second plug-in; the first category word information includes synonym data; the second category word information includes custom word data and stop word data; Wherein, according to the monitoring result, updating the unified search vocabulary by using the vocabulary update plug-in includes: If the monitoring result is that the first category word information is updated, then the updated first category word information in the target database is added to the first plug-in; If the monitoring result is that the second category word information is updated, then the updated second category word information in the target database is added to the second plug-in; The first plug-in includes a word segmentation processing component and a storage component; adding the updated first-category word information in the target database to the first plug-in includes: using the word segmentation processing component to perform format conversion on the updated first-category word information to obtain a format conversion result; and sending the format conversion result to the storage component; Among them, the second plug-in includes a first storage component and a second storage component; adding the second category word information updated in the target database to the second plug-in includes: storing the first group of word data in the second category word information to the first storage component; storing the second group of word data in the second category word information to the second storage component.
2. The method according to claim 1, characterized in that Monitor the target database, including: Monitor the changes in the first category word information and the second category word information in the target database to obtain monitoring results.
3. The method according to claim 2, characterized in that The first category word information includes first version number information, and the second category word information includes second version number information; Monitor the changes in the first category word information and the second category word information in the target database, and obtain monitoring results, including: If the first version number information is changed, determining that the monitoring result is that the first category word information is updated; If the second version number information is changed, it is determined that the monitoring result is that the second category word information is updated.
4. A hot update device for a unified search word library, characterized in that: include: A monitoring module, used to monitor a target database and obtain monitoring results; the target database is used to store word information obtained from multiple channels; An update module, used to update the unified search word library using a word library update plug-in according to the monitoring result; wherein the word library update plug-in is used to obtain relevant data on word information changes in the target database to update the unified search word library; the word library update plug-in includes a first plug-in and a second plug-in; the first plug-in is optimized based on the dynamic-synonym plug-in, and the second plug-in is optimized based on the analysis-ik plug-in; The device further includes an initialization module for: storing first-category word information in the unified search word library to the first plug-in, and storing second-category word information to the second plug-in; the first-category word information includes synonym data; the second-category word information includes user-defined word data and stop word data; The updating module comprises a first updating unit and a second updating unit; The first updating unit is configured to add the updated first-category word information in the target database to the first plug-in if the monitoring result indicates that the first-category word information is updated; The second updating unit is configured to add the updated second-category word information in the target database to the second plug-in if the monitoring result indicates that the second-category word information is updated; The first plug-in includes a word segmentation processing component and a storage component; the first updating unit is specifically used to: use the word segmentation processing component to perform format conversion on the updated first category word information to obtain a format conversion result; and send the format conversion result to the storage component; The second plug-in includes a first storage component and a second storage component; the second updating unit is specifically used to: store the first group of word data in the second category word information to the first storage component; store the second group of word data in the second category word information to the second storage component.
5. The device according to claim 4, characterized in that The monitoring module is specifically used for: Monitor the changes in the first category word information and the second category word information in the target database to obtain monitoring results.
6. The device according to claim 5, characterized in that The first category word information includes first version number information, and the second category word information includes second version number information; the monitoring module is specifically used to: If the first version number information is changed, determining that the monitoring result is that the first category word information is updated; If the second version number information is changed, it is determined that the monitoring result is that the second category word information is updated.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the hot update method of the unified search vocabulary library according to any one of claims 1 to 3 is implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for executing the hot update method of the unified search word library according to any one of claims 1 to 3.
Citation Information
Patent Citations
Automatically updated lexical analysis system
CN110866400A