Data updating method and device, electronic equipment and storage medium
By matching and updating the target knowledge data preset databases during the use of the large language model, the impact of data update on knowledge in other fields is solved, and efficient and accurate data updates are achieved.
Patent Information
- Application Number
- CN202311110520.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-02-28
AI Technical Summary
During the use of large language models, how to update data to avoid affecting knowledge in other fields while ensuring the accuracy and efficiency of data updates.
By matching the target query data in the preset database, we judge whether the target knowledge data needs to be updated, and when it is necessary to update, we freeze other data to update the database based on the preset update database.
It realizes the update of data during the use of large language models without affecting knowledge in other fields, reduces the update cost, and improves the accuracy and efficiency of data updates.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a data updating method and device, an electronic device and a storage medium. Background Art
[0002] With the advent of ChatGpt, Large Language Model (LLM) has demonstrated powerful capabilities in many scenarios and tasks, such as factual answers, small talk, intelligent customer service, text generation, etc. However, the complete training of a large language model requires a lot of time and computing power, as well as huge energy consumption.
[0003] Faced with the huge computing power overhead of large language models, the rapid update and iteration of large language models is one of the current challenges. On the one hand, during the training process of large language models, erroneous knowledge will be learned by the large language model, which will cause unexpected cascading problems; on the other hand, knowledge is effective and will be updated and changed over time. In the face of the above problems, they are often solved by fine-tuning and modifying the erroneous knowledge data during the use of large language models.
[0004] However, the fine-tuning methods in related technologies will modify data with similar sentence structures based on the fine-tuning data, or cannot modify data with similar semantics but different sentence structures in a timely manner. When updating knowledge, it will affect the existing knowledge in other fields. Therefore, how to complete the data update of the large language model during its use and ensure that the knowledge in other fields is not affected is a problem that needs to be solved urgently. Summary of the invention
[0005] The present disclosure provides a method and device for data updating, an electronic device and a storage medium, the main purpose of which is to complete the data update of a large language model during the use of the large language model and ensure that knowledge in other fields is not affected.
[0006] According to a first aspect of the present disclosure, a method for updating data is provided, comprising:
[0007] Matching the target query data in a preset database to obtain target knowledge data corresponding to the target query data;
[0008] Determining whether the target knowledge data needs to be updated;
[0009] When it is determined that the target knowledge data needs to be updated, other data in the preset database is frozen, and the target knowledge data in the preset database is updated based on the preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
[0010] Optionally, the updating of the target knowledge data based on a preset update database includes:
[0011] Matching the target query data and the target knowledge data in the preset update database to obtain the target knowledge data for update;
[0012] The target knowledge data is overwritten and updated using the update target knowledge data.
[0013] Optionally, the method for constructing the preset update database includes:
[0014] Acquire new knowledge data from a new knowledge base through a preset search interface, wherein the new knowledge base is a database used to acquire the new knowledge data; and / or,
[0015] Calling a preset editing method to customize and edit the new knowledge data;
[0016] The preset update database is constructed by using the new knowledge data.
[0017] Optionally, the determining whether the target knowledge data needs to be updated includes:
[0018] Calling a preset similarity algorithm to calculate a similarity score of the target knowledge data;
[0019] If the similarity score is greater than or equal to a preset threshold, it is determined that the target knowledge data does not need to be updated;
[0020] If the similarity score is less than the preset threshold, it is determined that the target knowledge data needs to be updated.
[0021] Optionally, before freezing other knowledge data in the preset database and updating the target knowledge data in the preset database based on a preset update database, the method includes:
[0022] When it is determined that the target knowledge data does not need to be updated, the target knowledge data is used as the first query result.
[0023] Optionally, after freezing other knowledge data in the preset database and updating the target knowledge data in the preset database based on a preset update database, the method further includes:
[0024] The updated target knowledge data is acquired, and the updated target knowledge data is used as the second query result.
[0025] Optionally, the method comprises:
[0026] Calculating the confidence of the first query result or the second query result by using a preset confidence algorithm;
[0027] If the confidence level is greater than a preset confidence threshold, outputting the first query result or the second query result as output information;
[0028] If the confidence level is less than or equal to a preset confidence threshold, the corresponding output information is matched from preset template data according to the target query data and outputted, and the preset template data is custom-edited information reply data.
[0029] According to a second aspect of the present disclosure, a data updating device is provided, comprising:
[0030] A matching unit, used to match the target query data in a preset database to obtain target knowledge data corresponding to the target query data;
[0031] A judging unit, used to judge whether the target knowledge data needs to be updated;
[0032] An updating unit is used to freeze other data in the preset database when it is determined that the target knowledge data needs to be updated, and update the target knowledge data in the preset database based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
[0033] Optionally, the updating unit includes:
[0034] A matching module, used for matching the target query data and the target knowledge data in the preset update database to obtain the target knowledge data for update;
[0035] An updating module is used to use the updating target knowledge data to overwrite and update the target knowledge data.
[0036] Optionally, the device further comprises:
[0037] a first acquisition unit, configured to acquire new knowledge data from a new knowledge base through a preset search interface, wherein the new knowledge base is a database for acquiring the new knowledge data; and / or
[0038] Calling a preset editing method to customize and edit the new knowledge data;
[0039] A construction unit is used to construct the preset update database through the new knowledge data.
[0040] Optionally, the judging unit includes:
[0041] A calculation module, used for calling a preset similarity algorithm to calculate a similarity score of the target knowledge data;
[0042] A determination module, configured to determine that the target knowledge data does not need to be updated when the similarity score is greater than or equal to a preset threshold;
[0043] The determination module is further configured to determine that the target knowledge data needs to be updated when the similarity score is less than the preset threshold.
[0044] Optionally, the device further comprises:
[0045] The determination unit is used to use the target knowledge data as the first query result when it is determined that the target knowledge data does not need to be updated.
[0046] Optionally, the device further comprises:
[0047] The second acquisition unit is used to acquire the updated target knowledge data and use the updated target knowledge data as the second query result.
[0048] Optionally, the device further comprises:
[0049] A calculation unit, configured to calculate the confidence of the first query result or the second query result by using a preset confidence algorithm;
[0050] an output unit, configured to output the first query result or the second query result as output information when the confidence level is greater than a preset confidence threshold;
[0051] The output unit is also used to, when the confidence is less than or equal to a preset confidence threshold, match corresponding output information from preset template data according to the target query data and output it, wherein the preset template data is custom-edited information reply data.
[0052] According to a third aspect of the present disclosure, there is provided an electronic device, including:
[0053] at least one processor; and
[0054] a memory communicatively connected to the at least one processor; wherein,
[0055] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect.
[0056] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the first aspect.
[0057] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the first aspect above.
[0058] The data updating method and device, electronic device and storage medium provided by the present disclosure match the target query data in a preset database to obtain the target knowledge data corresponding to the target query data; determine whether the target knowledge data needs to be updated; if it is determined that the target knowledge data needs to be updated, freeze the other data in the preset database, and update the target knowledge data in the preset database based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating. Compared with the related art, the embodiment of the present disclosure updates the target knowledge by matching the target query data in a preset database and freezing the other data in the preset database, so that the data update of the large language model can be completed during the use of the large language model, and the knowledge in other fields can be ensured not to be affected.
[0059] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0061] Figure 1 A flowchart of a data updating method provided by an embodiment of the present disclosure;
[0062] Figure 2 A schematic diagram of the structure of a data updating device provided by an embodiment of the present disclosure;
[0063] Figure 3 A schematic diagram of the structure of another data updating device provided by an embodiment of the present disclosure;
[0064] Figure 4 A schematic block diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0065] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0066] The following describes the data updating method and apparatus, electronic device, and storage medium according to the embodiments of the present disclosure with reference to the accompanying drawings.
[0067] Figure 1 A flowchart of a data updating method provided in an embodiment of the present disclosure is provided.
[0068] like Figure 1 As shown, the method comprises the following steps:
[0069] Step 101, matching target query data in a preset database to obtain target knowledge data corresponding to the target query data.
[0070] The embodiments of the present disclosure can be applied to fine-tuning and modifying the data of a large language model, or fine-tuning and modifying the data in a database, wherein the modified data includes but is not limited to: model parameters, database data, etc. Specifically, the embodiments of the present disclosure do not limit the scope of application and the content of the modification.
[0071] In the disclosed embodiment, the target query data is a query sentence or query vocabulary input by user-defined input, for example: what year is it now, what is the content of Journey to the West, etc., and the corresponding target knowledge data is the data of the corresponding answer query sentence or query vocabulary, for example: if the target query data is what year is it now, then the corresponding target knowledge data is 2023 AD; if the target query data is what is the content of Journey to the West, then the corresponding target knowledge data will display the entire content of Journey to the West. Specifically, the disclosed embodiment is not limited.
[0072] Step 102: determine whether the target knowledge data needs to be updated.
[0073] In the disclosed embodiment, since the target knowledge data is time-sensitive and / or contains data errors, it is necessary to judge the target knowledge data. If the target knowledge data is expired data or erroneous data, it is determined that the target knowledge data needs to be updated. If the target knowledge data is valid and / or contains no erroneous data, it is determined that the target knowledge data does not need to be updated.
[0074] For ease of understanding, an example is provided for illustration. Regarding the timeliness of the target knowledge data, for example: if the target query data is what year in the AD it is now, and the corresponding target knowledge data is 2022 AD, it is determined that the target knowledge data needs to be updated; if the target query data is what year in the AD it is now, and the corresponding target knowledge data is 2023 AD, it is determined that the target knowledge data does not need to be updated. Regarding the existence of data errors in the target knowledge data, for example: if the target query data is what the content of Journey to the West is, and the corresponding target knowledge data shows that the content of Water Margin or the content of Journey to the West is incorrect, it is determined that the target knowledge data needs to be updated; if the target query data is what the content of Journey to the West is, and the corresponding target knowledge data shows the content of Journey to the West and the content is correct, it is determined that the target knowledge data does not need to be updated.
[0075] Step 103, when it is determined that the target knowledge data needs to be updated, other data in the preset database is frozen, and the target knowledge data in the preset database is updated based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
[0076] In the embodiment of the present disclosure, the preset update database contains knowledge data that is more effective and / or has less erroneous data compared to the target knowledge data, the preset database contains the target knowledge data, the preset update database and the preset database include but are not limited to: model parameters, knowledge data, etc. Specifically, the embodiment of the present disclosure does not limit the contents of the preset update database and the preset database.
[0077] Among them, freezing other data in the preset database can ensure that only the target knowledge data is updated, and the update will not affect other data. After the target knowledge data is updated, the same target knowledge data can be correctly output for target query data with similar semantics but different sentence structures, and only the updated target knowledge data is output, that is, the update of the target knowledge data is an overwriting update.
[0078] The data updating method provided by the present disclosure matches the target query data in a preset database to obtain the target knowledge data corresponding to the target query data; determines whether the target knowledge data needs to be updated; if it is determined that the target knowledge data needs to be updated, freezes the other data in the preset database, and updates the target knowledge data in the preset database based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating. Compared with the related art, the embodiment of the present disclosure updates the target knowledge by matching the target query data in a preset database and freezing the other data in the preset database, so that the data update of the large language model can be completed during the use of the large language model, and the knowledge in other fields can be ensured not to be affected.
[0079] In one implementable manner of the disclosed embodiment, as a refinement of the above step 103, when the target knowledge data is updated based on a preset update database, it is necessary to match in the preset update database to obtain the target knowledge data for updating, so as to complete the update of the target knowledge data and ensure the accuracy of the target knowledge data update. Therefore, in order to complete the update of the target knowledge data and ensure the accuracy of the target knowledge data update, it can be implemented in but not limited to the following manner: matching the target query data and the target knowledge data in the preset update database to obtain the target knowledge data for updating; and using the target knowledge data for updating to overwrite and update the target knowledge data.
[0080] Related to the above-mentioned embodiment, the preset update database needs to be constructed in advance to ensure that the corresponding target knowledge data for updating can be matched. Regarding the construction of the preset update database, the following methods may also be used but are not limited to: obtaining new knowledge data from a new knowledge base according to a preset search interface; and / or calling a preset editing method to customize the new knowledge data, where the new knowledge base is a database used to obtain the new knowledge data; and constructing the preset update database through the new knowledge data.
[0081] In the embodiment of the present disclosure, the preset search interface is a search interface in a custom-selected search engine, for example: a search interface of search engines such as Bing search and Baidu search, and the new knowledge base is a type of database used to obtain various knowledge and / or various data, for example: Wikipedia, Baidu Encyclopedia and other databases. Specifically, the embodiment of the present disclosure does not limit the preset search interface and the preset new knowledge base.
[0082] The new knowledge data is target knowledge data with valid and / or error-free data, and the new knowledge data contains the target knowledge data for update. The preset editing method is a custom-selected editing mode, and the editing mode includes but is not limited to: manual editing, machine automatic generation, etc. When editing new knowledge data, one semantics can have multiple editing templates, that is, the semantics corresponding to different sentence patterns may be the same, for example: 0 cannot be a divisor and the divisor cannot be 0, etc. Specifically, the embodiments of the present disclosure are not limited.
[0083] It should be noted here that the acquisition of the new knowledge data requires collecting the data that needs to be updated from the new knowledge base, as well as the customized editing of related diverse Prompt (PRedictive OPTimization with Machine Learning) inputs. Different prompts can help large language models to better generalize statements, while ensuring that knowledge that does not need to be updated is maintained at a stable result and is not affected. The new knowledge data must have clear requirements and the support of the new knowledge base. The new knowledge data includes but is not limited to: knowledge data, model parameters, diverse Prompt inputs, etc., that is, the new knowledge data is mainly diverse data constructed by splicing similar queries (Query Understanding) with different prompt templates.
[0084] In one implementable manner of the disclosed embodiment, as a refinement of the above step 102, it is necessary to timely and accurately determine whether the target knowledge data needs to be updated, so as to timely update expired data or erroneous data and improve the accuracy of the large language model. Therefore, in order to accurately judge the target knowledge data, it can be implemented by but not limited to the following methods: calling a preset similarity algorithm to calculate the similarity score of the target knowledge data; if the similarity score is greater than or equal to a preset threshold, it is determined that the target knowledge data does not need to be updated; if the similarity score is less than the preset threshold, it is determined that the target knowledge data needs to be updated.
[0085] In the embodiment of the present disclosure, the preset similarity algorithm is a custom selected calculation method, which includes but is not limited to: index library (key-value) matching method. At the same time, regarding the index library (key-value) matching method, the embodiment of the present disclosure provides an example for illustration: the target query data and the target knowledge data are matched in the index library (key-value). If more data that is semantically consistent with the target knowledge data is matched, the higher the similarity score is, and the less semantically consistent data is, the lower the similarity score is.
[0086] Among them, the preset similarity algorithm can be obtained from the judgment model in the relevant technology, and the judgment model is obtained by training the target query data and the target knowledge data. Specifically, the selection of the preset similarity algorithm can be determined according to actual conditions, and the embodiments of the present disclosure are not limited.
[0087] Referring to the above embodiments, there are two situations for the judgment results of the target knowledge data, situation one: the target knowledge data needs to be updated, situation two: the target knowledge data does not need to be updated. If situation two occurs, it is necessary to perform operations on the target knowledge data when no update is required, and determine the answer result corresponding to the target query data. Therefore, after situation two occurs, the following method can also be used but is not limited to: when it is determined that the target knowledge data does not need to be updated, the target knowledge data is used as the first query result.
[0088] Regarding situation one, after the target knowledge data is updated, it is also necessary to obtain query results as the answer results corresponding to the target query data. Therefore, after the target knowledge data is updated, the following method can also be used but is not limited to: obtain the updated target knowledge data, and use the updated target knowledge data as the second query result.
[0089] In one implementable manner of the embodiment of the present disclosure, after obtaining the query result corresponding to the target query data, it is necessary to calculate the confidence of the query result to ensure that the query result is credible. Therefore, in order to improve the accuracy of the large language model, the following method may also be used but is not limited to: calculating the confidence of the first query result or the second query result through a preset confidence algorithm; if the confidence is greater than a preset confidence threshold, outputting the first query result or the second query result as output information; if the confidence is less than or equal to the preset confidence threshold, matching the corresponding output information from the preset template data according to the target query data for output, and the preset template data is custom-edited information reply data.
[0090] In the embodiment of the present disclosure, the preset confidence algorithm is a calculation method of custom selection, such as: n-gram algorithm, etc., wherein the n-gram algorithm can be obtained in the n-gram model in the related art, and at the same time, regarding the n-gram algorithm, the embodiment of the present disclosure provides an example for illustration: in the n-gram algorithm, the confidence of a sentence is decomposed into the product of the conditional probabilities of each word. Specifically, the n-gram algorithm assumes that the probability of a word appearing is only related to the n-1 words before it, and has nothing to do with other words. The specific formula is: P(w1,w2,w3,...,wn)=P(w1)*P(w2|w1)*P(w3|w1,w2)*...*P(wn|wn-1,...,w2,w1) wherein P(w1,w2,w3,...,wn) is the confidence, P(w1) represents the probability of the first word appearing, P(w2|w1) represents the probability of w2 appearing when w1 appears, and so on.
[0091] The preset confidence threshold is a threshold that is user-defined, such as 30%, 35%, etc. Specifically, the embodiments of the present disclosure do not limit the preset confidence algorithm and the preset confidence threshold.
[0092] Among them, the preset template data is custom-edited information reply data, for example: Sorry, your question cannot be answered for the time being; Sorry, my brain capacity is not enough to answer your question, etc. Specifically, regarding the editing of the preset template data, the disclosed embodiment does not limit it.
[0093] In summary, the embodiments of the present disclosure can achieve the following effects:
[0094] 1. The disclosed embodiment updates the knowledge data that needs to be modified in the large language model, and effectively ensures the reliability of the unmodified knowledge data part of the model and the consistency of the knowledge update without retraining the model. The knowledge data update does not affect the existing knowledge data in other fields. After the similar knowledge data is replaced, the large language model can correctly output the same knowledge data, thereby reducing the cost of updating the large language model. Small version updates are iterated in small steps through the knowledge data update method.
[0095] 2. The disclosed embodiment updates the target knowledge by matching the target query data in a preset database and freezing other data in the preset database. The data update of the large language model can be completed during the use of the large language model, and knowledge in other fields can be ensured not to be affected.
[0096] Corresponding to the above data updating method, the present invention also provides a data updating device. Since the device embodiment of the present invention corresponds to the above method embodiment, the details not disclosed in the device embodiment can be referred to the above method embodiment, and will not be described in detail in the present invention.
[0097] Figure 2 A schematic diagram of a data updating device provided in an embodiment of the present disclosure is shown in FIG. Figure 2 As shown, including:
[0098] A matching unit 21 is used to match the target query data in a preset database to obtain target knowledge data corresponding to the target query data;
[0099] A judging unit 22, used to judge whether the target knowledge data needs to be updated;
[0100] The updating unit 23 is used to freeze other data in the preset database when it is determined that the target knowledge data needs to be updated, and update the target knowledge data in the preset database based on the preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
[0101] The data updating device provided by the present disclosure matches the target query data in a preset database to obtain the target knowledge data corresponding to the target query data; determines whether the target knowledge data needs to be updated; and if it is determined that the target knowledge data needs to be updated, freezes other data in the preset database, and updates the target knowledge data in the preset database based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating. Compared with the related art, the embodiment of the present disclosure updates the target knowledge by matching the target query data in a preset database and freezing other data in the preset database, so that the data update of the large language model can be completed during the use of the large language model, and the knowledge in other fields can be ensured not to be affected.
[0102] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the updating unit 23 includes:
[0103] A matching module 231 is used to match the target query data and the target knowledge data in the preset update database to obtain the target knowledge data for update;
[0104] The updating module 232 is used to use the updating target knowledge data to overwrite and update the target knowledge data.
[0105] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the device also includes:
[0106] A first acquisition unit 24 is used to acquire new knowledge data from a new knowledge base through a preset search interface, wherein the new knowledge base is a database used to acquire the new knowledge data; and / or,
[0107] Calling a preset editing method to customize and edit the new knowledge data;
[0108] The construction unit 25 is used to construct the preset update database through the new knowledge data.
[0109] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the judging unit 22 includes:
[0110] A calculation module 221 is used to call a preset similarity algorithm to calculate a similarity score of the target knowledge data;
[0111] A determination module 222, configured to determine that the target knowledge data does not need to be updated when the similarity score is greater than or equal to a preset threshold;
[0112] The determination module 222 is further configured to determine that the target knowledge data needs to be updated when the similarity score is less than the preset threshold.
[0113] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the device also includes:
[0114] The determination unit 26 is configured to use the target knowledge data as the first query result when it is determined that the target knowledge data does not need to be updated.
[0115] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the device also includes:
[0116] The second acquisition unit 27 is used to acquire the updated target knowledge data and use the updated target knowledge data as the second query result.
[0117] Furthermore, in a possible implementation of the embodiment of the present disclosure, as Figure 3 As shown, the device also includes:
[0118] A calculation unit 28, configured to calculate the confidence of the first query result or the second query result by using a preset confidence algorithm;
[0119] an output unit 29, configured to output the first query result or the second query result as output information when the confidence level is greater than a preset confidence threshold;
[0120] The output unit 29 is also used to, when the confidence is less than or equal to a preset confidence threshold, match the corresponding output information from the preset template data according to the target query data and output it, wherein the preset template data is custom-edited information reply data.
[0121] It should be noted that the above explanation of the method embodiment is also applicable to the device of the embodiment of the present disclosure, and the principle is the same, which is no longer limited in the embodiment of the present disclosure.
[0122] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0123] Figure 4 A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0124] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 402 or a computer program loaded from a storage unit 408 to a RAM (Random Access Memory) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O (Input / Output) interface 405 is also connected to the bus 404.
[0125] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0126] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as a method for updating data. For example, in some embodiments, the method for updating data may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via the ROM 402 and / or the communication unit 409. When the computer program is loaded into the RAM 403 and executed by the computing unit 401, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to execute the aforementioned data updating method in any other appropriate manner (for example, by means of firmware).
[0127] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0128] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0129] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a RAM, a ROM, an EPROM (Electrically Programmable Read-Only-Memory) or a flash memory, an optical fiber, a CD-ROM (Compact Dis sc Read-Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0130] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0131] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
[0132] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0133] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.
[0134] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0135] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for updating data, characterized in that: include: Matching the target query data in a preset database to obtain target knowledge data corresponding to the target query data; Determining whether the target knowledge data needs to be updated; When it is determined that the target knowledge data needs to be updated, other data in the preset database is frozen, and the target knowledge data in the preset database is updated based on the preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
2. The method according to claim 1, characterized in that: The updating of the target knowledge data in the preset database based on the preset update database comprises: Matching the target query data and the target knowledge data in the preset update database to obtain the target knowledge data for update; The target knowledge data is overwritten and updated using the update target knowledge data.
3. The method according to claim 1, characterized in that The method for constructing the preset update database includes: Acquire new knowledge data from a new knowledge base through a preset search interface, wherein the new knowledge base is a database used to acquire the new knowledge data; and / or, Calling a preset editing method to customize and edit the new knowledge data; The preset update database is constructed by using the new knowledge data.
4. The method according to claim 1, characterized in that The determining whether the target knowledge data needs to be updated includes: Calling a preset similarity algorithm to calculate a similarity score of the target knowledge data; If the similarity score is greater than or equal to a preset threshold, it is determined that the target knowledge data does not need to be updated; If the similarity score is less than the preset threshold, it is determined that the target knowledge data needs to be updated.
5. The method according to claim 1, characterized in that Before freezing other knowledge data in the preset database and updating the target knowledge data in the preset database based on a preset update database, the method includes: When it is determined that the target knowledge data does not need to be updated, the target knowledge data is used as the first query result.
6. The method according to claim 5, characterized in that After freezing other knowledge data in the preset database and updating the target knowledge data in the preset database based on a preset update database, the method includes: The updated target knowledge data is acquired, and the updated target knowledge data is used as the second query result.
7. The method according to claim 6, characterized in that The method comprises: Calculating the confidence of the first query result or the second query result by using a preset confidence algorithm; If the confidence level is greater than a preset confidence threshold, outputting the first query result or the second query result as output information; If the confidence level is less than or equal to a preset confidence threshold, the corresponding output information is matched from preset template data according to the target query data and outputted, and the preset template data is custom-edited information reply data.
8. A data updating device, characterized in that: include: A matching unit, used to match the target query data in a preset database to obtain target knowledge data corresponding to the target query data; A judging unit, used to judge whether the target knowledge data needs to be updated; An updating unit is used to freeze other data in the preset database when it is determined that the target knowledge data needs to be updated, and update the target knowledge data in the preset database based on a preset update database, wherein the other data is all data in the preset database except the target knowledge data, and the preset update database is a database storing the target knowledge data for updating.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.