Fuzzy matching string search method and system for nuclear fuel data for nuclear power generation
The method addresses the challenge of managing nuclear fuel data by employing string preprocessing, edit distance calculations, and advanced algorithms for matching, resulting in improved search efficiency and accuracy, and reduced repetitive searches through caching.
Patent Information
- Application Number
- JP2024134658
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-20
- Filing Date
- 2024-08-09
- Publication Date
- 2025-04-03
- Estimated Expiration
- 2044-08-09
AI Technical Summary
Managing nuclear fuel data for nuclear power generation involves a large amount of character-based data with varying encoding formats, requiring efficient strategies for data traceability, search, and reading to ensure accuracy and speed.
The method involves splitting and preprocessing target strings, integrating language libraries, calculating edit distances using character distance algorithms, and using the Aho-Corasick algorithm for Chinese string matching, along with caching frequently searched patterns to improve search efficiency and accuracy.
This approach enhances search efficiency by reducing inaccurate matches through pre-filtering and improves accuracy by verifying the degree of matching, while caching frequently searched patterns minimizes repetitive search efforts.
Smart Images

Figure 2025048748000001_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the management of nuclear fuel data for nuclear power generation, and to a method for comparing and searching strings in the field of computer software. [Background technology]
[0002] Nuclear power plants are powered by nuclear fuel in a nuclear reactor and use a stable cooling medium (e.g., helium or water) in the reactor core to absorb the thermal energy released by the fission of the nuclear fuel, then transfer the heat through a steam generator to a secondary loop to produce steam (or directly to a steam turbine), which drives a generator to produce electricity.
[0003] The nuclear fuel stored in the reactor to realize the nuclear reaction must be periodically replaced with new nuclear fuel assemblies, and the spent nuclear fuel degraded by nuclear fission must be removed. Considering the importance of nuclear fuel assemblies in nuclear power plants, the entire process of loading and unloading nuclear fuel from the reactor must be precisely managed, and clear and complete traceability of the entire process from the transportation of nuclear fuel to loading, replacement, and decommissioning must be ensured.
[0004] Specific records of the loading and unloading of nuclear fuel in a pressurized water reactor include important data such as the unique code of the new fuel assembly, the time the data was recorded, the person responsible for handling the nuclear fuel, and the location of the nuclear fuel storage space.
[0005] The full-cycle management of the nuclear fuel loading process will inevitably result in the formation of a huge amount of data information, which includes a variety of character carriers and data encoding formats, such as English and Chinese. In order to ensure the traceability, search and high-speed operation of data, it is necessary to specially develop a set of effective data reading strategies and methods, thereby ensuring the accuracy of the process of reading, entering and transmitting character string information. Summary of the Invention
[0006] The present invention has been proposed in consideration of the above-mentioned problems. By splitting and preprocessing the target string and integrating the corresponding language library, it is possible to quickly find relevant information during a search and improve search efficiency. In addition, by calculating the edit distance using a character distance algorithm, it is possible to perform preliminary filtering of search results and reduce inaccurate matching results. At the same time, by using the Aho-Corasick algorithm to search Chinese strings and verify the matching degree, it is possible to further improve the search accuracy. In addition, by caching frequently searched pattern strings, the cached results can be directly used in the next search, thereby reducing the time and effort required for repeated searches.
[0007] Thus, a method for fuzzy match string searching of nuclear power fuel data is provided.
[0008] In order to solve the above technical problems, the present invention provides the following technical solution, which is a fuzzy matching string search method for nuclear fuel data for nuclear power generation, comprising: The method includes splitting and preprocessing the target string, integrating the corresponding language library, calculating the edit distance using a character distance algorithm, performing preliminary filtering, searching the Chinese string and verifying the matching degree using the Eiho-Korasik method, and caching the frequently searched pattern strings after searching.
[0009] In a preferred embodiment of the fuzzy matching string search method for nuclear fuel data for nuclear power generation described in the present invention, the above pre-processing includes splitting the target string, removing stop words, stemming and lemmatization, counting the number of times each word appears in the target string, calculating word weights, and storing the pre-processing results.
[0010] In a preferred embodiment of the fuzzy matching string search method for nuclear fuel data for nuclear power generation described in the present invention, the above edit distance calculation uses a dynamic programming algorithm to define a two-dimensional array D with n+1 rows and m+1 columns; Initialize TIFF2025048748000002.tif8170 as 0, TIFF2025048748000003.tif8170 is the insert operation for i, TIFF2025048748000004.tif8170 is the deletion operation of j, according to the following formula Recursively calculate TIFF2025048748000005.tif8170, TIFF2025048748000006.tif19170
[0011] where S is a target string of length n, T is a pattern string of length m, TIFF2025048748000007.tif8170 is the edit distance between the first i characters of S and the first j characters of T, TIFF2025048748000008.tif12170 is an insertion of one character into S, TIFF2025048748000009.tif8170 is an insertion of one character into T, TIFF2025048748000010.tif8170 is the replacement and matching string.
[0012] In a preferred embodiment of the fuzzy matching string search method for nuclear fuel data for nuclear power generation described in the present invention, in the above preliminary filtering, the smaller the edit distance between S and T, the more likely it is that the fuzzy matching string search method for nuclear fuel data for nuclear power generation described in the present invention will be. TIFF2025048748000011.tif11170 represents the larger size, and the similarity function is called to find the difference between the two words. Calculate TIFF2025048748000012.tif11170, The smaller TIFF2025048748000013.tif15170TIFF2025048748000014.tif8170, TIFF2025048748000015.tif7170 becomes large, and you set the filtering threshold X, TIFF2025048748000016.tif7170 Matching is successful, preliminary filtering is done, and you set 20 characters or less as the condition for preliminary filtering, if the length exceeds 20 characters, it will be directly filtered without further matching, and the next matching will be done conversely.
[0013] TIFF2025048748000017.tif7170If the match fails, then search for other pattern strings to determine whether the match is successful; if the match with other strings is successful, then perform preliminary filtering; if the match with other strings still fails, mark this target string as "not matched" and store it in the corresponding database, waiting for other strings to match; here, TIFF2025048748000018.tif7170 is the length of the target string 1 and 2, TIFF2025048748000019.tif8170 is the edit distance, which represents the minimum number of edits between S and T.
[0014] As a preferred embodiment of the method for searching fuzzy matching strings for nuclear fuel data for nuclear power generation described in the present invention, in searching for the above Chinese strings, an AC automaton is constructed using the build method, then a pattern string is added to the AC automaton using the add_pattern method, and matching is performed on the text string according to the search method to search for the pattern strings, the specific process is as follows: all pattern strings are built into a Trie tree, and an edge pointing to a failure node is added to node x; if matching fails, transition is made from the edge to the failure node to continue matching; if node x does not contain an edge pointing to the failure node, the failure node of node x is set as the root node; if the parent node of node x also does not contain an edge pointing to the failure node, then search for the failure node of the parent node upwards until an edge pointing to the failure node is found.
[0015] Add pattern strings one by one to the AC automaton, each pattern string corresponds to one rule, and each rule contains a prefix code and a suffix code that respectively indicate the prefix and suffix of the pattern string. From the root node, match characters according to the order of characters in the target string. If there is a character that matches the prefix code of rule n, add the suffix code of rule n to the matching result list, and the backward shift of the matching position is equal to the length of the prefix code of rule n. Transition to the next node according to the state transition graph of the current node. Then, continue to match the next character until the end of the string is reached. Splice all the suffix codes in the matching result list to obtain the final matching result. If the matching with one or more pattern strings in the target string is successful, return the matching result, or return a matching failure.
[0016] In a preferred embodiment of the method for searching fuzzy matching strings for nuclear fuel data for nuclear power generation described in the present invention, the verification of the degree of matching is performed by using a hash algorithm of the strings to verify the matching of a plurality of pattern strings; TIFF2025048748000020.tif13170, where s is the input string, a, b, c, d, e are the hash coefficients, TIFF2025048748000021.tif7170 are each character in the string.
[0017] If the target string matches one pattern string, no hash verification of the string is performed and the matching result is returned; if the target string matches multiple pattern strings, whether to match is determined based on the hash value; if the hash values are the same, the string matching result is retained; if the hash values are different, the two strings are necessarily different and the matching fails, so the matching of this pattern string is deleted and the pattern strings are matched more accurately.
[0018] As a preferred embodiment of the fuzzy matching string search method for nuclear fuel data for nuclear power generation described in the present invention, in the process of caching the above-mentioned frequently searched pattern string, the cache strategy uses an LRU algorithm; before starting to process the user query, the cache is empty; when the user inputs a query keyword, the query keyword is fuzzy matched with the relevant data of the nuclear fuel data for nuclear power generation, and the frequently searched pattern string is pre-stored in the cache; after the matched data is added to the cache, it is checked whether the cache is full; if the cache is not full, it continues to process the next user query; if the cache is full, it is necessary to perform a cache update operation; when updating the cache, the least accessed data is deleted, and the most accessed data is added to the end of the cache; if the user query is matched with the cached data, the relevant data is directly obtained from the cache without re-querying the database; the clean-up threshold is 10 days; if data n exists in the cache for more than 10 days and has not been accessed, it is deleted from the cache; TIFF2025048748000022.tif8170Here, A represents the number of accesses, L represents the cache size, and if A>L, the minimum number of accesses of A is deleted.
[0019] Another object of the present invention is to provide a system for a fuzzy matching string search method for nuclear power plant nuclear fuel data, which provides an efficient, accurate, highly adaptable and flexible solution for fuzzy matching string search for nuclear power plant nuclear fuel data, and has important practical significance for the management and use of nuclear power plant nuclear fuel data.
[0020] The present invention relates to a fuzzy matching string search system for nuclear fuel data for nuclear power generation, the system including a division and preprocessing module, a fuzzy matching module, a string search module and a cache module.
[0021] The segmentation and preprocessing module splits the input text into individual words and phrases.
[0022] The fuzzy matching module uses a character distance algorithm to calculate the edit distance between the subject string and the pattern string to determine the similarity.
[0023] The character string search module searches the results of the fuzzy matching for a character string that matches the keyword entered by the user.
[0024] The cache module pre-stores frequently searched pattern strings in a cache to avoid repeated calculations.
[0025] A computer system comprising a memory in which a computer program is stored and a processor, the computer system being characterized in that, when the processor executes the computer program, the computer system realizes steps of a method for searching a fuzzy matching string in nuclear fuel data for nuclear power generation.
[0026] A computer-readable recording medium having a computer program stored thereon, the computer program being characterized in that, when executed by a processor, the computer program implements steps of a method for fuzzy match string searching of nuclear fuel data for nuclear power generation.
[0027] The beneficial effects of the present invention are as follows: quickly find relevant information during a search; reduce ineffective searches and further improve search efficiency by performing preliminary filtering and accurate searching; improve search accuracy by accurately matching target strings and reducing the possibility of mismatching; reduce the time and effort required for repeated searches by caching frequently searched pattern strings; and adapt to various scenarios and needs, such as more accurate matching and searching for misspellings, synonyms, and near-synonymous words. [Brief description of the drawings]
[0028] In order to more clearly describe the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings used in the description of the embodiments. It should be understood that the drawings in the following description are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative efforts. [Figure 1] FIG. 2 is a flow diagram of a fuzzy match string search method for nuclear fuel data for nuclear power generation provided by an embodiment of the present invention. [Diagram 2] FIG. 2 is a workflow diagram of a fuzzy matching string search system for nuclear fuel data for nuclear power generation provided by one embodiment of the present invention. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0029] In order to make the above objects, features and advantages of the present invention clearer and easier to understand, the following describes in detail specific embodiments of the present invention in conjunction with the accompanying drawings of the specification, but it is clear that the described embodiments are only a part of the embodiments of the present invention, and are not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without requiring creative efforts shall be within the protection scope of the present invention.
[0030] In order to facilitate a thorough understanding of the present invention, numerous specific details are set forth below; however, the present invention may be embodied in other ways than those described herein, and similar extensions may be made by those skilled in the art without departing from the spirit of the present invention, and therefore the present invention is not limited by the specific examples disclosed below.
[0031] Additionally, as used herein, "one embodiment" or "embodiment" refers to a particular feature, structure, or characteristic that may be included in at least one embodiment of the present invention. The appearances of the phrase "in one embodiment" in different places in this specification are not all referring to the same embodiment, nor are they mutually exclusive embodiments separate or alternative to other embodiments.
[0032] The present invention will be described in detail with schematic diagrams, and in describing the embodiments of the present invention in detail, in order to facilitate the description, the cross-sectional diagrams showing the structure of the device are partially enlarged and not according to the normal scale, and the schematic diagrams are merely illustrative and do not limit the scope of protection of the present invention, and should include the three-dimensional spatial dimensions of length, width and depth during actual production.
[0033] Also, in the description of the present invention, as explained, terms such as "upper, lower, inner, outer" indicate orientations or positional relationships based on those shown in the accompanying drawings and are intended only to facilitate and simplify the description of the present invention, and do not dictate or imply that the referenced devices or elements have a particular orientation and must be constructed and operated in a particular orientation, and therefore should not be understood as a limitation of the present invention. Furthermore, the terms "first, second or third" are for descriptive purposes only and should not be understood as dictating or implying relative importance.
[0034] In the present invention, the terms "attach, connect, and couple" should be understood in a broad sense unless otherwise specified or limited, and may be fixedly connected, detachably connected, or integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected via an intermediate medium, or internally communicated between the two members. Those skilled in the art can understand the specific meaning of the above terms in the present application according to the actual situation.
[0035] Example 1 Referring to FIG. 1, a first embodiment of the present invention provides a fuzzy matching string search method for nuclear fuel data for nuclear power generation, which includes the following steps S1 to S3.
[0036] S1: Split and preprocess the target string, and integrate the corresponding language library.
[0037] Additionally, preprocessing includes splitting the subject string, removing stop words, stemming and lemantization, counting the number of times each word appears in the subject string, calculating word weights, and storing the preprocessing results.
[0038] As explained, splitting refers to breaking up consecutive characters into individual words. In Chinese, forward maximum matching is used, while in other languages, such as English, methods such as stemming and lemantization are used. For forward maximum matching, the string is scanned from left to right to find the word with the longest consecutive characters, then scanned from right to left to find the word with the longest consecutive characters, and so on until the entire string has been scanned.
[0039] For other languages, such as English, stemming and lemantization methods can be used to reduce the impact of word variants on search by unifying words to their root forms: stemming is the reduction of a word to its essential, indivisible parts, e.g., dog is extracted as dog and happy is extracted as happ; lemantization is the reduction of a word to its root form, e.g., happ to happy and happies to happy.
[0040] Stop words are words that appear frequently in text but do not affect the meaning of the text, such as "no", "to", and "ni". Removing stop words can reduce the complexity of searches.
[0041] By counting the number of times each word appears in the subject string, it becomes easier to weight the word according to its importance during a search.
[0042] Based on the word frequency statistics, calculate the weight of each word. The weight can be calculated using the TF-IDF algorithm, and the calculation formula is: TIFF2025048748000023.tif6170, where TF is word frequency and IDF is inverse document frequency.
[0043] Regarding storage of preprocessing results, the preprocessed target string including the segmentation results, word frequency statistics, weights, etc. is stored and can be used directly during search, eliminating the need to perform preprocessing every time a search is performed, improving search efficiency.
[0044] S2: Calculate the edit distance using the character distance algorithm and perform preliminary filtering.
[0045] Furthermore, suppose the target string is "book" and the pattern string is "back", the edit distance between the two is 2. To convert "book" to "back", two edit operations are required, replacing o with a" and k with c", respectively. Using a character distance algorithm, the edit distance between the target string and the pattern string (i.e., how many edit operations are required at least to convert the target string into the pattern string) is calculated and the similarity between the two is determined. A threshold can be set, and if the similarity exceeds the threshold, the match is considered successful.
[0046] As will be explained, the calculation of edit distance uses a dynamic programming algorithm to define a two-dimensional array D with n+1 rows and m+1 columns: Initialize TIFF2025048748000024.tif8170 as 0, TIFF2025048748000025.tif8170 is the insert operation for i, TIFF2025048748000026.tif8170 is the deletion operation of j, according to the following formula Calculate TIFF2025048748000027.tif8170 recursively, TIFF2025048748000028.tif24170
[0047] where S is a target string of length n, T is a pattern string of length m, TIFF2025048748000029.tif8170 is the edit distance between the first i characters of S and the first j characters of T, TIFF2025048748000030.tif8170 is an insertion of one character into S, TIFF2025048748000031.tif8170 is an insertion of one character into T, TIFF2025048748000032.tif8170 is the replacement and matching character.
[0048] As will be explained further, in the preliminary filtering, the smaller the edit distance, the more likely it is that S and T TIFF2025048748000033.tif11170 represents the larger size, and the similarity function is called to find the distance between the two words. Calculate TIFF2025048748000034.tif11170, The smaller TIFF2025048748000035.tif15170TIFF2025048748000036.tif8170, TIFF2025048748000037.tif7170 becomes large, and you set the filtering threshold X, TIFF2025048748000038.tif7170 Matching is successful, preliminary filtering is done, and you set 20 characters or less as the condition for preliminary filtering, if the length exceeds 20 characters, it will be directly filtered without further matching, and the next matching will be done conversely.
[0049] TIFF2025048748000039.tif7170If the match fails, then search for other pattern strings to determine whether the match is successful; if the match with other strings is successful, then perform preliminary filtering; if the match with other strings still fails, mark this target string as "not matched" and store it in the corresponding database, waiting for other strings to match; here, TIFF2025048748000040.tif7170 is the length of the target string 1 and 2, TIFF2025048748000041.tif8170 is the edit distance, which represents the minimum number of edits between S and T.
[0050] As will be further explained, the algorithm includes two functions.
[0051] The edit_distance function is used to calculate the edit distance between two words. This function uses a dynamic programming algorithm to record the edit distance between two words through a two-dimensional array, and finally returns the bottom-right element of the two-dimensional array.
[0052] The similarity function is used to calculate the similarity between two words. This function first calculates the edit distance between two words by calling the edit_distance function, then divides the edit distance by the maximum of the two word lengths to get the similarity value, and finally returns 1 minus the similarity value.
[0053] S3: Search and verify Chinese strings using the Eiho-Korasik method, and cache frequently searched pattern strings after searching.
[0054] Furthermore, by controlling the above threshold, we first realize similarity filtering, and then use AC algorithm to realize Chinese string search. The basic idea is to construct all pattern strings as AC automata and then match them on the text string. The time complexity of the algorithm is O(n+k), where n is the length of the target string and k is the sum of the lengths of all pattern strings.
[0055] For searching Chinese strings, it is inefficient to use traditional string matching algorithms due to the large character set of Chinese. On the other hand, the Aho-Korasik method can quickly search multiple pattern strings in text, so it is widely used for matching and splitting Chinese strings.
[0056] As described, in searching for a Chinese string, build an AC automaton using the build method, then add a pattern string to the AC automaton using the add_pattern method, and search for the pattern string by matching with the text string according to the search method. The specific process is as follows: build all pattern strings into a Trie tree, add an edge pointing to a failure node for node x, if the matching fails, transition from the edge to the failure node and continue matching; if node x does not contain an edge pointing to the failure node, set the failure node of node x as the root node; if the parent node of node x also does not contain an edge pointing to the failure node, continue to search for the failure node of the parent node upwards until an edge pointing to the failure node is found.
[0057] Add pattern strings one by one to the AC automaton, each pattern string corresponds to one rule, and each rule contains a prefix code and a suffix code that respectively indicate the prefix and suffix of the pattern string. From the root node, match characters according to the order of characters in the target string. If there is a character that matches the prefix code of rule n, add the suffix code of rule n to the matching result list, and the backward shift of the matching position is equal to the length of the prefix code of rule n. Transition to the next node according to the state transition graph of the current node. Then, continue to match the next character until the end of the string is reached. Splice all the suffix codes in the matching result list to obtain the final matching result. If the matching with one or more pattern strings in the target string is successful, return the matching result, or return a matching failure.
[0058] As described above, a string hashing algorithm is used to verify a match of multiple pattern strings; TIFF2025048748000042.tif13170, where s is the input string, a, b, c, d, e are the hash coefficients, TIFF2025048748000043.tif7170 are each character in the string.
[0059] If the target string matches one pattern string, no hash verification of the string is performed and the matching result is returned; if the target string matches multiple pattern strings, whether to match is determined based on the hash value; if the hash values are the same, the string matching result is retained; if the hash values are different, the two strings are necessarily different and the matching fails, so the matching of this pattern string is deleted and the pattern strings are matched more accurately.
[0060] As will be further explained, the caching strategy uses an LRU algorithm, and before starting to process a user query, the cache is empty; when a user inputs a query keyword, the query keyword is fuzzy matched with relevant data of the nuclear fuel data for nuclear power generation, and frequently searched pattern strings are pre-stored in the cache; the matched data is added to the cache, and then it is checked whether the cache is full; if the cache is not full, the next user query is processed next; if the cache is full, a cache update operation needs to be performed; when updating the cache, the least accessed data is deleted and the most accessed data is added to the end of the cache; if the user query is matched with the cached data, the relevant data is directly retrieved from the cache without querying the database again; the cleanup threshold is 10 days; if data n exists in the cache for more than 10 days and has not been accessed, it is deleted from the cache; TIFF2025048748000044.tif8170Here, A represents the number of accesses, L represents the cache size, and if A>L, the minimum number of accesses of A is deleted.
[0061] As will be further explained, to support multiple languages, corresponding language libraries need to be integrated into the program so that the character sets and encoding schemes of various languages can be correctly handled during the matching process. Furthermore, based on the user's geographic location and language preferences, the corresponding language libraries can be dynamically loaded to provide more accurate search results.
[0062] Example 2 Referring to FIG. 1, an embodiment of the present invention provides a method for fuzzy matching string search of nuclear fuel data for nuclear power generation, and experimental scientific demonstration has been carried out to verify the beneficial effects of the present invention.
[0063] Calculations were carried out according to the contents of Example 1.
[0064] In the first part of the fuzzy matching, a two-dimensional array dp is initialized to store temporary data required during the calculation. The size of the array is (m+1) x (n+1). dp=[[0]*(n+1) for_in range(m+1)].
[0065] Initialize the first row and column of the array, so that dp[i][0] represents the number of operations required to convert the empty string to the word word1, i.e., i; similarly, dp[0][j] represents the number of operations required to convert the empty string to the word word2, i.e., j; for i in range(1,m+1):dp[i][0]=i.
[0066] for j in range(1,n+1):dp[0][j]=j.
[0067] Traverse the array and for each element dp[i][j], if the i-1th and j-1th characters of the two words are the same, then dp[i][j] is equal to dp[i-1][j-1], meaning the current characters are the same and no operation is required. Otherwise, dp[i][j] is the number of operations needed to transform the previous word into the current position (dp[i-1][j]), plus the number of operations needed to transform the next word into the current position (dp[i][j-1]), plus the number of operations needed to transform the current character (1), and take the minimum of the three.
[0068] dp[i][j]=min(dp[i-1][j],dp[i][j-1],dp[i-1][j-1])+1 return dp[m][n].
[0069] Below is a code example that tests the similarity calculation using English.
[0070] word1="book" word2="back" sim = similarity (word1, word2) print(sim)#0.5 This code outputs 0.5, meaning that the word similarity between book and back is 50%.
[0071] The second part is the search part of the AC automaton, and below is a code example of testing the AC automaton with Chinese characters.
[0072] Ac=AC() ac.add_pattern(China) ac.add_pattern(Chinese) ac.add_pattern(Huaxia) ac.build() text=The People's Republic of China is a great country matches=ac.search(text) for start,end in matches: print(“Match found:,text[start:end+1]) This code outputs Match found:China and Match found:Zhonghua, indicating that it found the pattern strings China and Zhonghua in the text string “The People’s Republic of China is a great country”.
[0073] It should be noted that the above-mentioned embodiments are merely for illustrating the technical solutions of the present invention, and are not intended to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art may make modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and such modifications or substitutions should be included in the scope of the claims of the present invention.
[0074] Example 3 The third embodiment of the present invention differs from the previous two embodiments in the following respects.
[0075] The functions can be implemented in the form of a software functional unit and stored in a computer-readable storage medium when sold or used as a standalone product. Based on this understanding, the part of the technical solution of the present invention that essentially contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes a number of instructions for causing a computer equipment (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a removable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0076] The logic and / or steps illustrated in the flowcharts or described elsewhere herein may be viewed, for example, as a sequential listing of executable instructions that implement logical functions, and may in particular be embodied on any computer-readable medium for use by or in connection with an instruction execution system, device or appliance (e.g., a computer-based system, a system including a processor, or other system that obtains and executes instructions from another instruction execution system, device or appliance). As used herein, "computer-readable medium" refers to any device that can store, preserve, communicate, transmit or transmit a program for use by or with an instruction execution system, device or appliance.
[0077] More specific examples (non-exhaustive list) of computer readable media include an electrical connection having one or more wires (electronic device), a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read only memory (ROM), an erasable read only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read only memory (CDROM). The computer readable medium may also be paper or other suitable medium on which the program may be printed. For example, the program may be obtained electronically and stored in computer memory by optically scanning the paper or other medium and then editing, decoding, or otherwise processing as necessary.
[0078] As will be understood, each part of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiment, multiple steps or methods may be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, when implemented by hardware, as in other embodiments, it can be implemented by any one or a combination of the following technologies known in the art: discrete logic circuits having logic gate circuits for implementing logic functions on data signals, special purpose integrated circuits having suitable combinational logic gate circuits, programmable gate arrays (PGAs), field programmable gate arrays (FPGAs), etc.
[0079] Example 4 Referring to FIG. 2, a fourth embodiment of the present invention provides a fuzzy matching string search system for nuclear fuel data for nuclear power generation, which includes a division and pre-processing module, a fuzzy matching module, a string search module and a cache module.
[0080] The segmentation and preprocessing module splits the input text into individual words and phrases.
[0081] The fuzzy matching module uses a character distance algorithm to calculate the edit distance between the subject string and the pattern string to determine the similarity.
[0082] The string search module searches the results of the fuzzy matching for a string that matches the keyword entered by the user.
[0083] The cache module pre-stores frequently searched pattern strings in a cache to avoid repeated calculations.
[0084] It should be noted that the above-mentioned embodiments are merely for illustrating the technical solutions of the present invention, and are not intended to limit the same. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art may make modifications or equivalent substitutions to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and such modifications or substitutions should be included in the scope of the claims of the present invention.
Claims
1. Split and preprocess the target string, and integrate the corresponding language library. Calculating edit distance using a character distance algorithm and performing preliminary filtering; A fuzzy matching string search method for nuclear fuel data for nuclear power generation, comprising: searching for Chinese strings and verifying the matching degree by using the Aho-Korasik method; and caching frequently searched pattern strings after the search.
2. The method for searching fuzzy matching strings for nuclear fuel data for nuclear power generation according to claim 1, characterized in that the pre-processing includes splitting the target string, removing stop words, stemming and lemantization, counting the number of times each word appears in the target string, calculating word weights, and storing the pre-processing results.
3. In the calculation of the edit distance, a dynamic programming algorithm is used to define a two-dimensional array D having n+1 rows and m+1 columns; is initialized to 0, is the insertion operation of i, is the deletion operation of j, according to the following formula: Calculate recursively, Here, S is a target string of length n, T is a pattern string of length m, is the edit distance between the first i characters of S and the first j characters of T, inserts one character into S, is the insertion of one character into T, 3. The method for searching for a fuzzy matching string of nuclear fuel data for nuclear power generation according to claim 2, wherein is a replacement and matching character.
4. In the preliminary filtering, the smaller the edit distance between S and T, the The similarity function is called to calculate the distance between two words. Calculate The smaller is, becomes large, and we set the filtering threshold X, If the matching is successful, preliminary filtering is performed, and the preliminary filtering condition is set to 20 characters or less. If the length exceeds 20 characters, it is directly filtered without further matching, and the next matching is performed on the contrary. If the match fails, then search for other pattern strings to determine whether the match is successful; if the match with other strings is successful, then perform preliminary filtering; if the match with other strings still fails, mark this target string as "not matched" and store it in the corresponding database, waiting for other strings to match, where are the lengths of the target strings 1 and 2, 4. The method for searching a fuzzy matching string for nuclear fuel data for nuclear power generation according to claim 3, wherein: S is an edit distance, and represents the minimum number of edits between S and T.
5. In searching for the Chinese string, the build method is used to build an AC automaton, and then the add_pattern method is used to add a pattern string to the AC automaton, and the search method is used to search for the pattern string by matching the text string. The specific process is as follows: Build all pattern strings in a Trie tree, add an edge pointing to the failure node for node x, and if matching fails, transition from the edge to the failure node and continue matching; if node x does not contain an edge pointing to the failure node, set the failure node of node x as the root node; if the parent node of node x also does not contain an edge pointing to the failure node, continue searching upward for failure nodes of parent nodes until an edge pointing to the failure node is found; 5. The method for searching fuzzy matching strings of nuclear fuel data for nuclear power generation according to claim 4, characterized in that: pattern strings are added to the AC automaton one by one, each pattern string corresponds to one rule, and each rule includes a prefix code and a suffix code indicating a prefix and a suffix of the pattern string, respectively; starting from the root node, characters are matched according to the order of characters in the target string; if there is a character matching with the prefix code of rule n, the suffix code of rule n is added to the matching result list, and the backward shift of the matching position is equal to the length of the prefix code of rule n; transition is made to the next node according to the state transition graph of the current node; then, matching of the next character is continued until the end of the string is reached; and all the suffix codes in the matching result list are spliced together to obtain a final matching result; if the matching with one or more pattern strings in the target string is successful, the matching result is returned; otherwise, a matching failure is returned.
6. In the verification of the degree of matching, a hash algorithm of a character string is used to verify the matching of a plurality of pattern character strings; Here, s is the input string, a, b, c, d, and e are hash coefficients, are the characters in the string, 6. The method for searching for a fuzzy matching string in nuclear fuel data for nuclear power generation according to claim 5, characterized in that if the target string matches one pattern string, no hash verification of the string is performed and the matching result is returned; if the target string matches multiple pattern strings, it is determined whether to match based on the hash values; if the hash values are the same, the string matching result is retained; if the hash values are different, the two strings are necessarily different and the matching fails, so the matching of this pattern string is deleted and the pattern strings are matched more accurately.
7. In the process of caching the frequently searched pattern strings mentioned above, the caching strategy uses the LRU algorithm, Before starting to process a user query, the cache is empty; when a user inputs a query keyword, the query keyword is fuzzy matched with relevant data of the nuclear fuel data for nuclear power generation, and frequently searched pattern strings are pre-stored in the cache; the matched data is added to the cache, and then it is checked whether the cache is full; if the cache is not full, the next user query is processed; if the cache is full, a cache update operation needs to be performed; when updating the cache, the least accessed data is deleted, and the most accessed data is added to the end of the cache; if the user query is matched with the cached data, the relevant data is directly obtained from the cache without querying the database again; the cleanup threshold is 10 days; if data n exists in the cache for more than 10 days and has not been accessed, it is deleted from the cache; 7. The method for searching for a fuzzy matching string of nuclear fuel data for nuclear power generation according to claim 6, wherein A represents the number of accesses, L represents the cache size, and if A>L, the minimum number of accesses of A is deleted.
8. It includes a division and preprocessing module, a fuzzy matching module, a string search module and a cache module. The segmentation and preprocessing module segments the input text into individual words and phrases; The fuzzy matching module uses a character distance algorithm to calculate an edit distance between the subject string and the pattern string to determine a similarity; The character string search module searches for a character string matching the keyword input by the user from the result of the fuzzy matching; The system using the fuzzy matching string search method for nuclear fuel data for nuclear power generation according to claim 7, wherein the cache module pre-stores frequently searched pattern strings in a cache to avoid repeated calculations.
9. A computer installation comprising a memory in which a computer program is stored and a processor, characterized in that said computer installation implements the steps of the method according to claim 7 when said processor executes said computer program.
10. A computer-readable recording medium having a computer program stored thereon, the computer program implementing the steps of the method of claim 7 when executed by a processor.
Citation Information
Patent Citations
Power plant document management device
JP1994325148A
Data processing device and data processing method
JP2015079380A
Collation processing system, method, and program
JP2016192202A
Fuzzy string alignment
US11615243B1
Layered memory architecture for deterministic finite automaton based string matching useful in network intrusion detection and prevention systems and apparatuses
US20060101195A1
Cited By
Heterogeneous data caching method oriented to multi-modal real-time search
CN120687494A
Intelligent substation virtual terminal automatic connection method and system based on SCHO-GO algorithm
CN120850494A
Configuration human-computer interface real-time data updating method and device
CN120929660A