A method and device for correcting keyword errors in a database
Through the keyword error correction prompt method of the database, the error correction prompt table is used to provide the most appropriate statement prompt according to the entered incorrect keywords, which solves the problem of spelling difficulties when entering errors in the database, and improves user experience and efficiency.
Patent Information
- Application Number
- CN202210011673.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-06
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-01-06
AI Technical Summary
Existing databases lack error correction prompts when entering statements, causing users to memorize and check spelling errors, which increases usage costs and time consumption, especially for users who are unfamiliar with databases.
Design a database keyword error correction prompt method. Through the keyword error correction prompt table, the most appropriate statement prompt is provided based on the keyword before the entered incorrect keyword. The user can set the matching accuracy. If the accuracy is exceeded, all will be displayed. Possible keywords, utilizing memory and processor to execute the method.
Quickly help users locate input errors, reduce the time to find spelling methods, reduce memory costs and correction time, provide completion prompts, and improve user experience.
Smart Images

Figure CN114397966B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of distributed databases, and specifically provides a method and a device for prompting keyword error correction of a database. Background Art
[0002] At present, when inputting some statements in the database, there is no function to assist users in correcting errors. Users are not only required to remember the spelling of all keywords, but also to check the specific errors themselves, which is not conducive to users quickly correcting their input errors. In addition, in addition to traditional SQL statements, the input statements also include many statements of each database, which also increase the difficulty of memorization and make spelling errors more likely. For users who are not familiar with databases, there may be some spelling errors of keywords every time, and if they need to check the user manual every time to correct the errors, it will increase the user's usage cost and waste a lot of time. Summary of the invention
[0003] The present invention aims at solving the above-mentioned deficiencies of the prior art and provides a highly practical database keyword error correction prompt method.
[0004] A further technical task of the present invention is to provide a keyword error correction prompt device for a database that is reasonably designed, safe and applicable.
[0005] The technical solution adopted by the present invention to solve the technical problem is:
[0006] A database keyword error correction prompt method uses a keyword error correction prompt table to find the most suitable keyword for a sentence based on the previous keyword of an input erroneous keyword and prompt it to a user. The user sets the maximum matching accuracy. If the matching keyword exceeds the maximum accuracy set by the user, all possible keywords are prompted to the user.
[0007] Furthermore, the keyword error correction prompt table stores the used keywords and the keywords that can be used after the keywords. The keywords are matched according to the prompt table. When the latter keyword is entered incorrectly, it is matched according to the former keyword to find the most appropriate sentence keyword.
[0008] Further, the following steps are included:
[0009] S1. Check the user's input sentence, and execute the error correction prompt process when a grammatical error is detected in the user's input;
[0010] S2, first determine whether there is a word before the user's wrong keyword;
[0011] S3: Whether the word is a keyword.
[0012] Further, in step S2, if there is a word, the error correction prompt table is traversed to find whether there is the word in the prompt table. If there is a word, step S3 is performed;
[0013] When the previous word of the wrong keyword cannot be found in the table, or there is no word before the wrong keyword, the wrong keyword is directly matched with all the keywords in the table.
[0014] Further, in step S3, if the word is a keyword, then the next possible keyword of the corresponding keyword in the table is found, and these keywords are matched with the wrong keyword input by the user. If the letters of the keyword in the table that differ from the wrong keyword input are less than the set precision, then these possible keywords are output;
[0015] If no matching keywords are found, all possible keywords will be output.
[0016] Furthermore, if keywords that meet the precision can be matched, then these keywords are output; if no match is found, then the process ends.
[0017] Furthermore, when the keywords are matched, the number of letters is first checked, then the number of letters of the two words being compared is compared, and finally the number of letters that are different is determined.
[0018] Furthermore, when checking the number of letters, keywords whose number of letters differs by more than the set precision do not meet the requirements and are excluded first;
[0019] When comparing the number of letters in two words, take the letters of the word with fewer letters from left to right in the word with more letters.
[0020] Then, the number of different letters in the corresponding positions of the two words is matched in turn, and the number of different letters plus the number of different letters is the final number of different letters.
[0021] Furthermore, among the different numbers of letters in the end, if the longer word does not meet the precision after traversing from left to right, then the keyword cannot be matched successfully;
[0022] If the accuracy requirement is met during the matching process, it means that the keyword is matched successfully and the matching can be stopped and the next keyword can be matched.
[0023] A keyword error correction prompt device for a database, comprising: at least one memory and at least one processor;
[0024] The at least one memory is used to store a machine-readable program;
[0025] The at least one processor is used to call the machine-readable program to execute a keyword error correction prompt method for a database.
[0026] Compared with the prior art, the keyword error correction prompt method and device of the present invention have the following outstanding beneficial effects:
[0027] The present invention can quickly help users locate the cause of input errors, without the need for users to search for related keyword spelling methods or search for user manuals, thus saving a lot of time for users.
[0028] It can also serve as a completion prompt to a certain extent, and can provide users with certain reference prompts when they forget how to use a certain keyword. Compared with traditional databases without error correction prompts, it reduces the user's memory cost and the time required for users to correct errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Attached Figure 1 It is a flow chart of a keyword error correction prompt method for a database;
[0031] Attached Figure 2 The invention is a keyword error correction prompt method for a database, in which a keyword error correction prompt expresses an intention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than 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.
[0033] A best embodiment is given below:
[0034] like Figure 1-2As shown, in this embodiment, a keyword error correction prompt method for a database uses a keyword error correction prompt table to find the most suitable sentence keyword based on the previous keyword of the input erroneous keyword and prompt it to the user. The user sets the maximum matching accuracy. If the matching keyword exceeds the maximum accuracy set by the user, all possible keywords are prompted to the user.
[0035] Among them, the keyword error correction prompt table stores all keywords and keywords that can be used after the keyword. The keywords can be matched according to the table. When the latter keyword is entered incorrectly, it can be matched according to the previous keyword to find the most suitable keyword for the sentence.
[0036] The steps are as follows:
[0037] S1. Check the user's input sentence, and execute the error correction prompt process when a grammatical error is detected in the user's input;
[0038] S2, first determine whether there is a word in front of the user's wrong keyword, if there is a word, traverse the error correction prompt table, and find whether there is the word in the prompt table. If there is a word, proceed to step S3;
[0039] When the previous word of the wrong keyword cannot be found in the table, or there is no word before the wrong keyword, the wrong keyword is directly matched with all the keywords in the table.
[0040] S3, whether the word is a keyword, then find the next possible keyword of the corresponding keyword in the prompt table, match these keywords with the wrong keyword input by the user, if the difference in letters between the keyword in the table and the wrong keyword input is less than the set precision, then output these possible keywords;
[0041] If no matching keywords are found, all possible keywords will be output.
[0042] If the keywords that meet the precision can be matched, then these keywords will be output. If they cannot be matched, then the process will end.
[0043] When matching keywords, first check the number of letters, then compare the number of letters in the two words being compared, and finally determine the number of letters that are different.
[0044] The specific steps are:
[0045] When checking the number of letters, keywords whose number of letters differs by more than the set precision do not meet the requirements and are excluded first;
[0046] When comparing the number of letters in two words, take the letters of the word with fewer letters from left to right in the word with more letters.
[0047] Then, the number of different letters in the corresponding positions of the two words is matched in turn, and the number of different letters plus the number of different letters is the final number of different letters.
[0048] In the final different number of letters, if the longer word does not meet the precision after traversing from left to right, then the keyword cannot be matched successfully;
[0049] If the accuracy requirement is met during the matching process, it means that the keyword is matched successfully and the matching can be stopped and the next keyword can be matched.
[0050] A keyword error correction prompt device for a database, comprising: at least one memory and at least one processor;
[0051] The at least one memory is used to store a machine-readable program;
[0052] The at least one processor is used to call the machine-readable program to execute a keyword error correction prompt method for a database.
[0053] The above-mentioned specific implementations are only specific cases of the present invention. The patent protection scope of the present invention includes but is not limited to the above-mentioned specific implementations. Any appropriate changes or substitutions made by a person of ordinary skill in the art to a keyword error correction prompt method and device for a database that conforms to the claims of the present invention shall fall within the patent protection scope of the present invention.
[0054] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A keyword error correction prompt method for a database, characterized in that: Through the keyword error correction prompt table, according to the previous keyword of the input incorrect keyword, the most suitable keyword of the sentence is found and prompted to the user. The user sets the maximum matching accuracy. If the matching keyword exceeds the maximum accuracy set by the user, all possible keywords are prompted to the user. The keyword error correction prompt table stores the used keywords and the keywords that can be used after the keywords. The keywords are matched according to the prompt table. When the latter keyword is input incorrectly, it is matched according to the former keyword to find the most suitable sentence keyword. The steps are as follows: S1. Check the user's input sentence, and execute the error correction prompt process when a grammatical error is detected in the user's input; S2, first determine whether there is a word before the user's wrong keyword; If there is a word, the error correction prompt table is traversed to find whether there is the word in the prompt table. If there is a word, step S3 is performed; When the previous word of the wrong keyword cannot be found in the prompt table, or there is no word before the wrong keyword, the wrong keyword is directly matched with all the keywords in the table; S3, whether the word is a keyword; If the word is a keyword, then find the next possible keyword of the corresponding keyword in the table, match these keywords with the wrong keyword entered by the user, and if the difference between the keywords in the table and the wrong keyword entered is less than the set precision, then output these possible keywords; If no keywords that meet the conditions are matched, then all possible keywords are output; If the keywords that meet the precision are matched, then these keywords are output; if they are not matched, then the process ends; When the keywords are matched, the number of letters is first checked, then the number of letters of the two words being compared is compared, and finally the number of letters that are different is determined; In the final different number of letters, if the longer word does not meet the precision after traversing from left to right, then the keyword cannot be matched successfully; If the accuracy requirement is met during the matching process, it means that the keyword is matched successfully and the matching can be stopped and the next keyword can be matched.
2. The method for correcting keywords in a database according to claim 1, characterized in that: When checking the number of letters, keywords whose number of letters differs by more than the set precision do not meet the requirements and are excluded first; When comparing the number of letters in two words, take the letters of the word with fewer letters from left to right in the word with more letters; Then, the number of different letters in the corresponding positions of the two words is matched in turn, and the number of different letters plus the number of different letters is the final number of different letters.
3. A keyword error correction prompt device for a database, characterized in that: include: at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 2.
Citation Information
Patent Citations
Statement error correction method and system
CN102831177A
Visiting method and device for relational database
CN103177016A
Online structured query language script processing method and apparatus
CN106919612A
Method for drop-down association of keyword with error-correction function
CN108062373A
Database execution error recovery method and device and database access method and device
CN111190768A
