Distributed database recommendation algorithm implementation method based on web3.0

By adopting the recommendation algorithm based on web3.0 in distributed databases, the problem of slow matching speed and insufficient fuzzy search support in the search process is solved, and more efficient and accurate search results are achieved, and dynamic node management is supported. .

CN119474199AInactive Publication Date: 2025-02-18HANGZHOU SHUDAO TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411426832.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2025-02-18
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the search process, existing distributed databases have problems such as slow matching speed, insufficient support for fuzzy search, insufficient attention to correlation, and errors in recommendation results. At the same time, phantom reading and dirty reading are prone to occur in high concurrency, and node drops Lines can cause search errors.

Method used

Using web3.0-based distributed database recommendation algorithm, we can improve search speed and accuracy by generating cache tables, encoding keywords, calculating matching values, establishing priority queues, supporting dynamic keyword additions, and establishing long connections. Nodes are added and deleted dynamically.

Benefits of technology

It improves the speed and accuracy of keyword search, supports dynamic addition of keywords, ensures the availability of the database, and realizes the method of obtaining the list of keyword-corresponding files online on multiple servers at the same time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure QLYQS_1
    Figure QLYQS_1
Patent Text Reader

Abstract

The invention provides a web3.0-based distributed database recommendation algorithm implementation method, provides a keyword encoding method, and improves the speed of a recommendation algorithm in a manner of combining a Chinese dictionary with a Hash table. The method for calculating the matching degree between the keyword and the search term is provided, and after the matching degree is calculated, a file corresponding to the keyword with the highest matching degree is recommended to a user; a multi-search-term matching method is provided, and a file corresponding to a keyword with the highest matching degree is recommended to a user by calculating the comprehensive matching degree among multiple search terms; the invention provides a data searching method of a node database, which supports dynamic addition and deletion of nodes. According to the keyword searching method, dynamic keyword adding is supported in the searching process, and when the keywords are dynamically added, the keywords can be dynamically matched with the added keywords; according to the method, the keywords are quickly matched in the form of the data table, so that the search speed of the keywords is increased; according to the method, dynamic login and logout of the target database are supported, and the availability of the database is ensured; the invention provides a method for simultaneously acquiring a file list corresponding to a keyword online by a plurality of servers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of infrastructure and IT support technology, and in particular to a method for implementing a distributed database recommendation algorithm based on web3.0. Background Art

[0002] The existing distributed database records all keywords in the database. When the user enters a search term, the current technical solution includes: comparing the search term with the keywords in the database. If they match, the information corresponding to the keyword is sent to the user; the word frequency between the search term and the keyword is counted, and the information corresponding to the keyword with the largest word frequency match is sent to the user. In a distributed database, a search term will be searched on multiple servers. There are two ways. One is the parallel method, which searches for a keyword on multiple servers at the same time and then returns all the results. This method will increase the access pressure of each server; the other is the keyword segmentation method, which classifies the keywords on different servers. When the user enters the search term, the search term is sent to a specific server for search. This method can reduce the access pressure of the server.

[0003] When the database is matched, searching by matching keywords requires that each character of the keyword matches before the result can be returned, so the fuzzy search function is not supported enough; when searching by word frequency, insufficient attention is paid to the correlation between characters, which will affect the search results. All of these will lead to errors in the recommendation results. At the same time, if a large number of search requests are made when searching through traditional database methods, there will be problems with the matching speed, especially when searching for keywords while updating keywords. At the same time, there will be phantom reads and dirty reads between keyword updates and searches.

[0004] All nodes of the current benchmark distributed database need to be online all the time. If the database node is offline, problems such as inability to search or search errors will occur. Summary of the invention

[0005] All nodes of the distributed database targeted by the present invention need to be online all the time. If a database node is offline, problems such as inability to search or search errors will occur.

[0006] In order to solve the above technical problems, the distributed database recommendation algorithm implementation method based on web3.0 provided by the present invention comprises the following steps: S1. The user sends the cache table generated by the local database to the local server, and the local server saves the cache table. The contents included in the cache table are: local computer ID, file name, and file keyword vector; S2. The local server will generate three tables: (1) Table of Chinese characters corresponding to keywords (2) Correspondence table between keywords and file names (3) A table of correspondence between file names and local computer IDs; S3. When logging in or out of the local database, the computer login status will be recorded in the computer ID list; S4. When the user submits a search term, the Chinese character corresponding keyword table is searched, the keyword code is used as the dictionary key, the matching value between the keyword and the search term is calculated, and the priority queue is called to sort the keywords to find the keywords with the highest to lowest matching degree; S5. The file name corresponding to the keyword and the computer ID of the online computer are returned to the search user software. After the user software receives the file name and computer ID, the content is displayed to the user, and the credit value corresponding to the computer ID is also returned; S6. When the terminal user selects a connection to download, the server will establish a tunnel between the terminal user and the terminal database after receiving the download request, so that both terminals can complete the data transmission. After the terminal user completes the data download, the data download completion status is fed back to the server, and the server saves the data in the server database; S7. When multiple keywords appear, the distance between each input word and the keyword is calculated, and all distances are accumulated. When there are too few keywords, the file result with the longest distance between the current keyword and the search word is randomly added to the terminal application to prompt the user whether such search results are needed; S8. When the terminal database goes online or offline, the login status of the terminal database needs to be recorded on the local server; S9. When the terminal database needs to go offline, the terminal database needs to send a message to the server. After receiving the message, the server will no longer add the terminal database to the online database list. Only when all currently downloading tasks are completed can the terminal database completely exit offline; S10. When the terminal database goes offline unexpectedly, the server will receive the event and send it to the terminal user. After receiving the message, the terminal user terminates the download and selects another computer ID to download. If it goes offline unexpectedly, the credit value corresponding to the computer ID will be reduced; S11. When searching is required on multiple servers, a long connection is established between the servers. When the terminal user sends the search term to the local server, the local server sends the search term to other connected servers and obtains the search term result and returns it to the search user software. When the user software needs to download files across servers, it is necessary to first establish a connection with the corresponding server, and then establish a tunnel between the terminal and the terminal database to download the file.

[0007] As a further solution of the present invention, in S1, the user generates a local computer ID through a random program and confirms the uniqueness of the local computer ID with the server.

[0008] As a further solution of the present invention, in S2, when corresponding to a keyword, the keyword needs to be encoded first, and the encoding starts from 1 to a maximum value, and the position of the word in the keyword needs to be indicated.

[0009] As a further solution of the present invention, in S4, the matching value calculation formula is: .

[0010] As a further solution of the present invention, in S11, the search term results include: server IP, file name and computer ID of the online computer.

[0011] Compared with the related art, the distributed database recommendation algorithm implementation method based on web3.0 provided by the present invention has the following beneficial effects: 1. A keyword encoding method is proposed, which improves the speed of the recommendation algorithm by combining the Chinese dictionary with the hash table.

[0012] 2. A method for calculating the matching degree between keywords and search terms is proposed. After calculating the matching degree, the file corresponding to the keyword with the highest matching degree is recommended to the user.

[0013] 3. A method for matching multiple search terms is proposed. By calculating the comprehensive matching degree between multiple search terms, the files corresponding to the keywords with the highest matching degree are recommended to users.

[0014] 4. A data search method for node database is proposed, which supports dynamic addition and deletion of nodes. DETAILED DESCRIPTION

[0015] A method for implementing a distributed database recommendation algorithm based on web3.0 includes the following steps: S1. The user sends the cache table generated by the local database to the local server, and the local server saves the cache table. The cache table includes: local computer ID, file name, file keyword vector. The user generates a local computer ID through a random program and confirms the uniqueness of the local computer ID with the server.

[0016] S2. After the local server receives the cache table, it will generate three tables. One table is a table of Chinese characters corresponding to keywords. When corresponding to keywords, the keywords need to be encoded first, starting from 1 to the maximum value, and the position of the word in the keyword needs to be noted; one table is a correspondence table between keywords and file names, and one table is a correspondence table between file names and local computer IDs.

[0017] S3. When the local database logs in or out, the computer login status will be recorded in the computer ID list.

[0018] S4. When the user submits a search term, the keyword table corresponding to the Chinese characters is searched, the keyword encoding is used as the dictionary key, and the matching value between the keyword and the search term is calculated. The matching value calculation formula is: After calculating the matching degree of the keyword, the priority queue is called to sort the keywords and find the keywords that match from high to low.

[0019] S5. Return the file name corresponding to the keyword and the computer ID of the online computer to the search user software. After receiving the file name and computer ID, the user software displays the content to the user and also returns the credit value corresponding to the computer ID.

[0020] S6. When the terminal user selects a connection to download, after receiving the download request, the server will establish a tunnel between the terminal user and the terminal database, allowing both terminals to complete data transmission. After the terminal user completes the data download, the data download completion status is fed back to the server, and the server saves this data in the server database.

[0021] S7. When there are multiple keywords, the basic idea is to calculate the distance between each input word and the keyword, and then add up all the distances. There is a problem with this method, that is, if some files do not have as many keywords as the input keywords, then even if they are more matched, they will be ranked lower and filtered out. In this case, we propose a solution, that is, when there are too few keywords, we will randomly add the file results with the longest distance between the current keyword and the search term in the terminal application. This file result will give the user a reminder, allowing the user to choose whether to need such a search.

[0022] S8. When the terminal database goes online or offline, the login status of the terminal database needs to be recorded on the local server.

[0023] S9. When the terminal database needs to go offline, the terminal database needs to send a message to the server. After receiving the message, the server will no longer add the terminal database to the online database list. Only when all currently downloading tasks are completed can the terminal database completely go offline.

[0024] S10. When the terminal database goes offline unexpectedly, the server will receive the event and send it to the terminal user. After receiving the message, the terminal user terminates the download and selects another computer ID to download. If it is an accidental offline, the credit value corresponding to the computer ID will be reduced.

[0025] S11. When searching is required on multiple servers, a long connection is established between the servers. When the terminal user sends the search term to the local server, the local server sends the search term to other connected servers and obtains the search term results. The search term results include: server IP, file name and computer ID of the online computer, which are returned to the search user software. When the user software needs to download files across servers, it is necessary to first establish a connection with the corresponding server, and then establish a tunnel between the terminal and the terminal database to download the file.

[0026] The keyword search method of the present invention supports dynamic addition of keywords during the search process. When keywords are added dynamically, the keywords will dynamically adapt to the added keywords. The present invention quickly matches keywords in the form of a data table, thereby improving the keyword search speed. The present invention supports dynamic login and logout of a target database, thereby ensuring the availability of the database. The present invention provides a method for multiple servers to simultaneously obtain a keyword corresponding file list online.

[0027] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.

Claims

1. A method for implementing a distributed database recommendation algorithm based on web3.0, characterized in that: The following steps are involved: S1. The user sends the cache table generated by the local database to the local server, and the local server saves the cache table. The contents of the cache table include: local computer ID, file name, and file keyword vector; S2. The local server will generate three tables: (1) Table of Chinese characters corresponding to keywords (2) Correspondence table between keywords and file names (3) A table of correspondence between file names and local computer IDs; S3. When logging in or out of the local database, the computer login status will be recorded in the computer ID list; S4. When the user submits a search term, the Chinese character corresponding keyword table is searched, the keyword code is used as the dictionary key, the matching value between the keyword and the search term is calculated, and the priority queue is called to sort the keywords to find the keywords with the highest to lowest matching degree; S5. The file name corresponding to the keyword and the computer ID of the online computer are returned to the search user software. After the user software receives the file name and computer ID, the content is displayed to the user, and the credit value corresponding to the computer ID is also returned; S6. When the terminal user selects a connection to download, the server will establish a tunnel between the terminal user and the terminal database after receiving the download request, so that both terminals can complete the data transmission. After the terminal user completes the data download, the data download completion status is fed back to the server, and the server saves the data in the server database; S7. When multiple keywords appear, the distance between each input word and the keyword is calculated, and all distances are accumulated. When there are too few keywords, the file result with the longest distance between the current keyword and the search word is randomly added to the terminal application to prompt the user whether such search results are needed; S8. When the terminal database goes online or offline, the login status of the terminal database needs to be recorded on the local server; S9. When the terminal database needs to go offline, the terminal database needs to send a message to the server. After receiving the message, the server will no longer add the terminal database to the online database list. Only when all currently downloading tasks are completed can the terminal database completely exit offline; S10. When the terminal database goes offline unexpectedly, the server will receive the event and send it to the terminal user. After receiving the message, the terminal user terminates the download and selects another computer ID to download. If it goes offline unexpectedly, the credit value corresponding to the computer ID will be reduced; S11. When searching is required on multiple servers, a long connection is established between the servers. When the terminal user sends the search term to the local server, the local server sends the search term to other connected servers and obtains the search term result and returns it to the search user software. When the user software needs to download files across servers, it is necessary to first establish a connection with the corresponding server, and then establish a tunnel between the terminal and the terminal database to download the file.

2. The method for implementing a distributed database recommendation algorithm based on web3.0 according to claim 1, characterized in that: In S1, the user generates a local computer ID through a random program and confirms the uniqueness of the local computer ID with the server.

3. The method for implementing a distributed database recommendation algorithm based on web3.0 according to claim 1, characterized in that: In S2, when corresponding to a keyword, the keyword needs to be encoded first, starting from 1 to the maximum value, and the position of the word in the keyword needs to be noted.

4. The method for implementing a distributed database recommendation algorithm based on web3.0 according to claim 1, characterized in that: In S4, the matching value calculation formula is: .

5. The method for implementing a distributed database recommendation algorithm based on web3.0 according to claim 1, characterized in that: In S11, the search term results include: server IP, file name, and computer ID of the online computer.