Chinese assignment divergence retrieval system based on Elasticsearch

By using Elasticsearch algorithm and indexing technology in the Hanfu divergence search system, Hanfu files are divided into main documents and attachments, and index relationships are established, which solves the problem that existing systems cannot perform complex queries, and achieves efficient and accurate Hanfu. Assign resource search and analysis.

CN119474256APending Publication Date: 2025-02-18JIMEI UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411489108.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-24
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing Hanfu divergence search system cannot conduct complex queries and is difficult to meet the needs of in-depth analysis.

Method used

A Hanfu divergence search system based on Elasticsearch was designed. By dividing Hanfu files into main documents and attachments, and establishing the correlation information between the main documents and attachments, as well as the index relationship between the main documents and the Elasticsearch algorithm, it realizes the Efficient search and access.

Benefits of technology

It enables users to efficiently search and access Hanfu resources, supports complex queries and in-depth analysis, and improves the accuracy and efficiency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474256A_ABST
    Figure CN119474256A_ABST
Patent Text Reader

Abstract

The invention provides a Chinese assignment divergence retrieval system based on Elasticsearch. The system comprises a front end, a rear end and a database, the front end is used for uploading a Chinese assignment file by an administrator, dividing the Chinese assignment file into a Chinese assignment main file and a Chinese assignment attachment, and establishing association information between the Chinese assignment main file and the Chinese assignment attachment; the front end is also used for the user to retrieve a Chinese assignment main document and a Chinese assignment attachment based on an Elasticsearch algorithm; and the rear end is used for receiving the Chinese assignment file uploaded by the front end, embedding a downloading link of the Chinese assignment attachment in the main Chinese assignment file, and establishing an index relationship between the main Chinese assignment file and the Elasticsearch algorithm. According to the method, the Chinese assignment file is divided into the Chinese assignment main document and the Chinese assignment attachment, the association information between the Chinese assignment main document and the Chinese assignment attachment is established, and the index relation between the Chinese assignment main document and the Elasticsearch algorithm is established, so that a user can efficiently search Chinese assignment resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of Chinese fu divergence retrieval, and in particular to a Chinese fu divergence retrieval system based on Elasticsearch. Background Art

[0002] Hanfu divergence search mainly belongs to the scope of classical literature research, especially Hanfu philology or a branch of Hanfu studies. Research in this field focuses on the detailed textual research and analysis of the divergences in the titles, contents, and authorship of Hanfu works. Hanfu divergence search requires researchers to read and examine a large number of ancient books and documents in depth, including paper ancient books and digital ancient book libraries that have been handed down to this day, in order to sort out the divergences in the titles and contents of Hanfu. Given that Hanfu works involve multiple fields such as literature, history, and culture, Hanfu divergence search usually requires the use of interdisciplinary research methods, such as history, philology, and cultural studies, to comprehensively examine Hanfu works. Therefore, the Hanfu divergence search system not only needs to conduct in-depth excavation and sorting of Hanfu texts, but also needs to establish a scientific and systematic classification and retrieval mechanism.

[0003] The existing Hanfu divergence retrieval system can only handle some basic query tasks, and is still insufficient for complex queries and in-depth analysis. Summary of the invention

[0004] The present invention aims to at least solve the technical problem that complex queries cannot be performed in the prior art, and in particular innovatively proposes a Chinese Fu divergence retrieval system based on Elasticsearch.

[0005] In order to achieve the above-mentioned object of the present invention, the present invention provides a Chinese Fu divergence retrieval system based on Elasticsearch, the system comprising a front end, a back end and a database;

[0006] The front end is used for the administrator to upload the Hanfu file, divide the Hanfu file into a Hanfu main document and a Hanfu attachment, and establish the association information between the Hanfu main document and the Hanfu attachment;

[0007] The front end is also used for users to retrieve the main document and attachments of Hanfu based on the Elasticsearch algorithm;

[0008] The backend is used to receive the Hanfu main document and Hanfu attachment uploaded by the frontend, embed the download link of the Hanfu attachment in the Hanfu main document, and establish an index relationship between the Hanfu main document and the Elasticsearch algorithm;

[0009] The database is used to store the Hanfu main document and Hanfu attachments.

[0010] As an optional embodiment of the present invention, optionally, establishing an index relationship between the Hanfu main document and the Elasticsearch algorithm includes:

[0011] A word segmentation component is used to perform word segmentation processing on the Hanfu main document to obtain a word list;

[0012] A language processing component, connected to the word segmentation component, for performing a deduplication process on the word list to generate a deduplication word list;

[0013] An index component, connected to the language processing component, for associating the deduplicated word list with the specific position of the word in the Hanfu main document to generate an inverted index, wherein the inverted index is used to establish an index relationship with the Elasticsearch algorithm;

[0014] An index library, connected to the index component, is used to store the inverted index.

[0015] As an optional embodiment of the present invention, optionally, the index component is also used to divide the inverted index into a plurality of shards, and the shards are used to be stored on different server nodes.

[0016] As an optional embodiment of the present invention, optionally, the index component is also used to replicate the shard.

[0017] As an optional embodiment of the present invention, optionally, the user retrieves the Hanfu main document and the Hanfu attachment based on the Elasticsearch algorithm, including:

[0018] The user enters a keyword in the search box of the front end, and the front end converts the keyword into an Elasticsearch query statement;

[0019] The backend receives the converted Elasticsearch query statement, and the Elasticsearch algorithm sends the Elasticsearch query statement to different server nodes, and each node locates the Chinese Fu file containing the Elasticsearch query statement based on the inverted index to obtain search results;

[0020] The similarity score between the search result and the keyword is calculated using the TF-IDF algorithm, and the Chinese Fu file with high similarity is sent to the front end.

[0021] As an optional embodiment of the present invention, optionally, the establishing of association information between the Hanfu main document and the Hanfu attachment includes:

[0022] The association component is arranged in the back end and is used to establish the association information between the Hanfu main document and the Hanfu attachment according to the ID information of the Hanfu main document and the ID information of the Hanfu attachment.

[0023] As an optional embodiment of the present invention, optionally, the backend further includes a file management component, and the file management component is used to name the Hanfu main document and the Hanfu attachment according to a preset naming rule.

[0024] As an optional embodiment of the present invention, optionally, the naming rule of the Hanfu main document is:

[0025] The main documents of Hanfu with different titles are named by combining English capital letters and three or more Arabic numerals;

[0026] The main documents of Hanfu with different copyrights or authors are named in combination of English capital letters and two or more Arabic numerals;

[0027] The main documents of Hanfu with different genres are named by combining English capital letters and two or more Arabic numerals.

[0028] As an optional embodiment of the present invention, optionally, the naming rule of the Hanfu attachment is the same as the naming rule of the Hanfu main document.

[0029] As an optional embodiment of the present invention, optionally, the administrator uploads the Chinese Fu file through the front end using an encryption algorithm;

[0030] The encryption algorithm includes:

[0031] Using the back end, select any two numbers m and n, and find mn=f, where both m and n are not equal to zero;

[0032] The front end randomly selects two numbers c and s i , c satisfies: J(c / m)=J(c / n)=-1, where J represents the Jacobi operation; s i Satisfaction: i ∈[1,f-1], and s i is an integer;

[0033] The backend publishes (c, f) as a public key and (m, n) as a secret key;

[0034] Let the Chinese Fu file be x, and represent x in binary, x=(x1,x2,...x i ), x i represents the i-th binary number, and x i ∈{0,1};

[0035] When xi =1, then k i =c si mod(f);

[0036] When x i = 0, then k i =s i 2 mod(f), where mod() represents the remainder operation;

[0037] The encrypted data packets are k1, k2, ...k i =D(x), k i Indicates x i The encrypted result, D(x) represents the result of data packet encryption;

[0038] Decryption includes:

[0039] Based on k1,k2,...k i =D(x) and (m,n), solve for each k i J(k i / m) and J(k i / n);

[0040] If J(k i / m)=J(k i / n)=1, then x i =0; if J(k i / m)=J(k i / n)=-1, then x i =1;

[0041] x i = 0, then and

[0042] x i =1, then and

[0043] * indicates multiplication operation;

[0044] Solve (k1,k2,...k i ) to obtain the decrypted data packet.

[0045] The beneficial effect of the present invention is that the present invention divides the Hanfu file into the Hanfu main document and the Hanfu attachment, establishes the association information between the Hanfu main document and the Hanfu attachment, and establishes an index relationship between the Hanfu main document and the Elasticsearch algorithm, so that users can efficiently search and access Hanfu resources. Specifically, the word segmentation component first performs word segmentation processing on the Hanfu main document to obtain a word list. The language processing component performs deduplication processing on the word list to generate a deduplication word list. The index component uses the deduplication word list to associate with the specific position of the word in the Hanfu main document to generate an inverted index. The index library stores the inverted index. In addition, the user can enter keywords through the search box of the front end, and the front end converts the keywords into Elasticsearch query statements. The back end receives the converted query statement and sends the query statement to different server nodes. Each node locates the Hanfu file containing the query statement based on the inverted index to obtain the search result. Then the TF-IDF algorithm is used to calculate the similarity score between the search result and the keyword, and the Hanfu file with high similarity is sent to the front end. The present invention realizes complex query by establishing an index relationship between the Hanfu main document and the Elasticsearch algorithm.

[0046] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0048] Figure 1 It is a flowchart of establishing index relationship of the Chinese Fu divergence retrieval system of the present invention.

[0049] Figure 2 It is a schematic diagram of the usage scenario of the Chinese Fu divergence retrieval system of the present invention.

[0050] Figure 3 It is a functional diagram of the Chinese Fu divergence retrieval system of the present invention.

[0051] Figure 4 It is a document classification schematic diagram of the Chinese Fu divergence retrieval system of the present invention.

[0052] Figure 5 It is a schematic diagram of the association information between the Hanfu main document and the Hanfu attachments of the Hanfu divergence retrieval system of the present invention.

[0053] Figure 6 It is a schematic diagram of the login frame of the Chinese Fu divergence retrieval system of the present invention.

[0054] Figure 7It is a document retrieval schematic diagram of the Chinese Fu divergence retrieval system of the present invention.

[0055] Figure 8 It is a schematic diagram of file uploading of the Chinese Fu divergence retrieval system of the present invention.

[0056] Fig. 9 It is a schematic diagram of the Chinese Fu divergence retrieval system of the present invention uploading files to a server.

[0057] Fig.10 It is a schematic diagram of the file management of the Chinese Fu divergence retrieval system of the present invention.

[0058] Fig.11 It is a schematic diagram of the file management of the Chinese Fu divergence retrieval system of the present invention.

[0059] Fig.12 It is a schematic diagram of file browsing of the Chinese Fu divergence retrieval system of the present invention.

[0060] Fig.13 It is a schematic diagram of the file preview of the Chinese Fu divergence retrieval system of the present invention.

[0061] Fig.14 It is a schematic diagram of file deletion of the Chinese Fu divergence retrieval system of the present invention.

[0062] Fig.15 It is a schematic diagram of the file downloading of the Chinese Fu divergence retrieval system of the present invention.

[0063] Fig.16 It is a schematic diagram of the classification of file reports of the Chinese Fu divergence retrieval system of the present invention.

[0064] Fig.17 It is a schematic diagram of the document search interface of the Chinese Fu divergence retrieval system of the present invention.

[0065] Fig.18 It is a schematic diagram of multiple joint search methods of the Chinese Fu divergence search system of the present invention. DETAILED DESCRIPTION

[0066] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.

[0067] like Figure 1 As shown, a Chinese Fu divergence retrieval system based on Elasticsearch, the system includes a front end, a back end and a database;

[0068] The front end is used for the administrator to upload the Hanfu file, divide the Hanfu file into a Hanfu main document and a Hanfu attachment, and establish the association information between the Hanfu main document and the Hanfu attachment;

[0069] It should be noted that the front end has a user interface, which guides administrators to easily complete file upload, classification and establishment of related information through an intuitive graphical interface. The interface design fully considers the user experience, provides a clear navigation menu, quick operation buttons and instant operation feedback, and improves the administrator's operation efficiency. During the file upload process, the front end will perform preliminary verification of the uploaded Hanfu files, such as file format, file size, etc., to ensure the compliance of the file and the stable operation of the system. Once the file passes the verification, the front end will temporarily store it locally and prepare to send it to the back end for further processing. The front end also integrates rich interactive functions, such as drag-and-drop upload, batch processing, real-time preview, etc., to meet the diverse needs of different administrators. These functions not only improve work efficiency, but also enhance the flexibility and ease of use of the system. The front end also realizes real-time communication with the back end. During the process of file upload, classification, establishment of related information, etc., the front end will continuously send requests to the back end and receive responses. This close collaboration mechanism ensures the timely transmission and processing of data and improves the response speed and stability of the entire system. As an important part of the Hanfu divergence retrieval system based on Elasticsearch, the front end not only provides a friendly user interface and rich interactive functions, but also realizes close collaboration with the back end and real-time data processing.

[0070] The front end is also used for users to retrieve the main document and attachments of Hanfu based on the Elasticsearch algorithm;

[0071] It should be noted that during the search process, the front-end interface will display a concise and clear search box where users can enter keywords. In order to improve the user experience, the front-end also provides automatic completion and keyword recommendation functions, which are based on the user's historical search records and the current popular Hanfu themes to help users find what they want faster. When the user enters a keyword and clicks the search button, the front-end will convert the keyword into an Elasticsearch query statement and send it to the back-end for processing through a network request. After receiving the query request from the front-end, the back-end will use the Elasticsearch engine for fast retrieval. Elasticsearch will quickly locate the Hanfu main document and Hanfu attachment containing the keyword based on the inverted index in the index library, and return relevant search results. In this process, the back-end will also use the TF-IDF algorithm to sort the search results to ensure that the content most relevant to the user's query keyword is ranked first, improving the accuracy and efficiency of the search. The front-end also provides result display and interaction methods. The search results will be displayed to the user in the form of a list or grid. Each result item will contain basic information such as the title and author of the Hanfu file, as well as a preview link or button. Users can view the detailed content of the Hanfu file by clicking the preview link or button, or perform further operations such as downloading. Throughout the retrieval process, the front-end and back-end maintain close communication and collaboration. The front-end is responsible for receiving user input and displaying search results, while the back-end is responsible for processing query requests, retrieving data and returning results. This front-end and back-end separation design not only improves the maintainability and scalability of the system, but also allows the front-end to focus more on optimizing the user interface and improving the interactive experience, while the back-end can focus more on optimizing data processing and retrieval algorithms. During the file upload process, the system will use encryption technology to ensure data security. At the same time, the system will regularly perform database backup and recovery drills to prevent data loss or damage from affecting the system.

[0072] The backend is used to receive the Hanfu main document and Hanfu attachment uploaded by the frontend, embed the download link of the Hanfu attachment in the Hanfu main document, and establish an index relationship between the Hanfu main document and the Elasticsearch algorithm;

[0073] It should be noted that in the processing flow of the backend, once the Hanfu main document and Hanfu attachments uploaded by the frontend are received, a series of data processing mechanisms will be immediately started. First, the backend will perform a detailed check on these files, including but not limited to file integrity verification, virus scanning, etc., to ensure that the uploaded files do not pose a threat to system security. Then, the backend will use Elasticsearch to build an index. Specifically, the word segmentation component first performs word segmentation on the Hanfu main document to obtain a word list. The language processing component performs deduplication processing on the word list to generate a deduplication word list. The index component uses the deduplication word list to associate the specific position of the word in the Hanfu main document to generate an inverted index. The index library stores the inverted index. In addition, the user can enter keywords through the search box of the front end, and the front end converts the keywords into Elasticsearch query statements. The backend receives the converted query statements and sends the query statements to different server nodes. Each node locates the Hanfu file containing the query statement based on the inverted index to obtain the search results. Then the TF-IDF algorithm is used to calculate the similarity score between the search results and the keywords, and the Hanfu files with high similarity are sent to the front end. This step is the key to achieving efficient retrieval. It enables the keywords entered by users to be quickly recognized by Elasticsearch and quickly locate the relevant Hanfu files. In order to further improve the performance and scalability of the system, the backend also adopts distributed deployment and load balancing technology. This means that the backend service can be deployed on multiple servers, and the user's requests can be distributed to different servers for processing through the load balancer. This not only improves the concurrent processing capability of the system, but also reduces the load pressure of a single server and improves the stability and reliability of the system. At the same time, the backend also provides a wealth of API interfaces for the frontend and other systems to call. These API interfaces adopt the RESTful design style, follow the HTTP protocol, and have a clear structure and easy-to-understand documents. Through these API interfaces, the frontend can easily call the services provided by the backend to realize file upload, retrieval, download and other functions.

[0074] The database is used to store the Hanfu main document and Hanfu attachments.

[0075] It should also be noted that in the design of the database, the present embodiment fully considers the integrity, security and maintainability of the data. First, the database adopts a relational database management system (RDBMS), such as MySQL or PostgreSQL, which has powerful transaction processing capabilities and strict data integrity constraints, and can ensure the consistency and accuracy of the data. Secondly, in order to ensure the security of the data, the database adopts a variety of security measures, including access control, data encryption, regular backup and recovery drills, etc. The access control mechanism can ensure that only authorized users can access the data in the database, and data encryption can protect the confidentiality of the data during transmission and storage. In addition, the backup and recovery strategy of the database is also crucial, which can quickly restore data when the system fails or data is lost, ensuring the continuity and stability of the system. In terms of data storage, the database designs a reasonable table structure and index strategy for the Hanfu main document and the Hanfu attachment. For the Hanfu main document, the present embodiment designs a table containing basic information such as document ID, title, author, creation time, and establishes appropriate indexes for these fields to improve query efficiency. For the attachment of Hanfu, this embodiment designs a table containing information such as attachment ID, file name, file type, storage path, etc., and associates the attachment with the main document through a foreign key to realize the associated query of data. In addition, the database also provides powerful query and optimization functions, which can support complex query statements and efficient query optimization algorithms to ensure that users can quickly and accurately obtain the required data. During the file upload process, the front end will send the file data to the back end, and the back end will be responsible for storing the file data in the database and updating the index information in the index library. During the file retrieval process, the back end will retrieve relevant data from the database according to the user's query request, and return the results to the front end for display through the API interface. This close collaboration mechanism ensures the real-time and consistency of the data, and improves the overall performance and user experience of the system.

[0076] like Figures 1 to 5As shown, in summary, when the user enters keywords, this embodiment uses the efficient full-text search capability of Elasticsearch to achieve rapid retrieval of the main document of Hanfu. First, the front end pre-processes the keywords entered by the user, such as removing stop words, stem extraction, etc., to improve the accuracy and efficiency of the search. Then, the front end encapsulates the processed keywords into HTTP requests and sends them to the back-end server. After receiving the request, the back-end server parses the keywords and constructs the query statement of Elasticsearch. Elasticsearch uses its built-in word segmenter and index structure to parse and expand the query statement to match as many relevant documents as possible. During the matching process, Elasticsearch will score the documents using the TF-IDF algorithm and sort them according to the relevance of the documents to the query statement. Next, the back-end server further processes the search results returned by Elasticsearch. First, filter out documents that do not meet the conditions, such as documents with insufficient permissions or documents that have been deleted. Then, format the remaining documents, such as extracting abstracts, highlighting keywords, etc., so that the front end can display them. Finally, the back-end server encapsulates the processed search results into response data in JSON format and sends them to the front end through HTTP response. After receiving the response data, the front end parses the data and displays it to the user. The user can see a list of search results on the front end interface, including the title, author and other information of the document, as well as highlighted keywords. This embodiment implements complex queries of Hanfu documents by using the Elasticsearch algorithm.

[0077] As an optional embodiment of the present invention, optionally, establishing an index relationship between the Hanfu main document and the Elasticsearch algorithm includes:

[0078] A word segmentation component is used to perform word segmentation processing on the Hanfu main document to obtain a word list;

[0079] like Figure 1 As shown, it should be noted that the word segmentation component obtains a series of words by performing operations such as word segmentation, removing punctuation marks, and taking out stop words on the document content in the Hanfu main document, and these words will serve as the basis for subsequent processing. Word segmentation is a technology in natural language processing, which directly affects the effect of subsequent text processing. In the present embodiment, the word segmentation component adopts an advanced word segmentation algorithm, which can accurately cut the text content in the Hanfu main document into independent words, while taking into account the characteristics and complexity of Chinese, such as the diversity of vocabulary, the flexibility of grammatical structure, etc., and then constructs a word list using the split words.

[0080] A language processing component, connected to the word segmentation component, for performing a deduplication process on the word list to generate a deduplication word list;

[0081] It should be noted that the language processing component converts the uppercase letters in the words in the vocabulary into lowercase letters, converts the plural letters into the singular, converts the past tense and future tense into the present tense, etc., to normalize the words to ensure the uniformity and comparability of the words. This step helps to reduce the redundancy caused by changes in word morphology and improve the efficiency of subsequent processing. The language processing component further deduplicates the words in the vocabulary, that is, deletes duplicate words and generates a vocabulary that does not contain duplicates. Such deduplication processing is helpful for building indexes and improving search efficiency.

[0082] An index component, connected to the language processing component, for associating the deduplicated word list with the specific position of the word in the Hanfu main document to generate an inverted index, wherein the inverted index is used to establish an index relationship with the Elasticsearch algorithm;

[0083] It should be noted that, in the process of generating an inverted index, the index component will first traverse each word in the deduplicated word list. For each word, the index component will record all the position information of the word in the main document of Hanfu, including the document ID, paragraph number, sentence number, and the specific position of the word in the sentence. These information together constitute the basic elements of the inverted index. The inverted index is one of the core technologies in the search engine, which greatly improves the search efficiency. The traditional forward index searches for the words contained in the document according to the document ID, while the inverted index searches for all documents containing the word and its position information according to the word. In this way, when the user enters the query keyword, the search engine can quickly locate all documents containing these keywords, and sort the relevance according to the position and frequency of the word in the document, so as to quickly return the most relevant search results to the user. In this embodiment, the generated inverted index will be used as the data source of the Elasticsearch algorithm. Elasticsearch is an open source search engine based on Lucene, which provides powerful full-text search and real-time analysis functions. Elasticsearch uses the inverted index structure to quickly respond to the user's query request and return a list of documents that are highly relevant to the keywords entered by the user.

[0084] An index library, connected to the index component, is used to store the inverted index.

[0085] It should be noted that the index library is placed in the database. The index library can persist the index data in the index library. Even if the system restarts or fails, the index data will not be lost, thus ensuring the stability and reliability of the system. The index library needs to support index update and deletion operations. When the content of the Hanfu main document changes, such as the addition, deletion or modification of the document, the index library needs to be able to update the index data in a timely manner to ensure the consistency of the index and document content.

[0086] As an optional embodiment of the present invention, optionally, the index component is also used to divide the inverted index into a plurality of shards, and the shards are used to be stored on different server nodes.

[0087] It should be noted that dividing the inverted index into multiple shards and distributing them on different server nodes is a key strategy to achieve high scalability and high availability of Elasticsearch. Through sharding technology, this embodiment can distribute the huge index data, effectively reduce the burden of a single server, and improve the query efficiency and processing capacity of the entire system. Each shard can be regarded as an independent index subset, which contains some documents and their corresponding inverted index information. Elasticsearch can automatically manage these shards, including the creation and replication of shards, to ensure the integrity of data and the continuity of services. When a query request arrives, Elasticsearch will perform query operations on multiple shards in parallel, and merge the results and return them to the user, thereby achieving a quick response. In addition, sharding technology also helps to achieve fault tolerance and recovery of data. Elasticsearch will create one or more replicas for each shard by default, and these replicas are distributed on different nodes to deal with data loss caused by node failure or network problems. When the primary shard is unable to provide services for some reason, its corresponding replica shard will automatically be promoted to the primary shard and take over the service, thereby ensuring the stable operation of the system. In the embodiment of the present invention, the number of shards and the number of copies can be flexibly set according to the number and size of the Hanfu main document, as well as the hardware resources of the system. Through reasonable configuration, the best balance between system performance and resource utilization can be achieved, providing users with efficient, stable and reliable search services.

[0088] As an optional embodiment of the present invention, optionally, the index component is also used to replicate the shard.

[0089] It should be noted that index replication can improve the high availability and fault tolerance of the Elasticsearch system. Through index replication, the system can ensure that data integrity and service continuity are maintained when any single node or shard fails. Specifically, the index component creates and stores one or more replicas of each shard on different server nodes. These replicas are synchronized with the primary shard and contain the same data and structure. In Elasticsearch, the replication mechanism not only enhances data redundancy, but also improves query performance through load balancing. When the system receives a query request, Elasticsearch can intelligently select the best shard (including primary and replica shards) to perform the query operation based on the current load situation and node health. This distributed parallel query capability greatly shortens the query response time and improves the user experience.

[0090] As an optional embodiment of the present invention, optionally, the user retrieves the Hanfu main document and the Hanfu attachment based on the Elasticsearch algorithm, including:

[0091] The user enters a keyword in the search box of the front end, and the front end converts the keyword into an Elasticsearch query statement;

[0092] The backend receives the converted Elasticsearch query statement, and the Elasticsearch algorithm sends the Elasticsearch query statement to different server nodes, and each node locates the Chinese Fu file containing the Elasticsearch query statement based on the inverted index to obtain search results;

[0093] The similarity score between the search result and the keyword is calculated using the TF-IDF algorithm, and the Chinese Fu file with high similarity is sent to the front end.

[0094] like Figure 2As shown in the figure, when the user enters keywords in the search box and clicks search, the system will immediately start the search process. First, the front end will process the keywords entered by the user and convert them into query statements that Elasticsearch can understand and execute. This process includes keyword cleaning (such as removing stop words, punctuation marks, etc.), word segmentation (decomposing long sentences into multiple vocabulary units), and possible stem extraction or word form restoration to improve the accuracy and relevance of the search. Subsequently, this query statement will be sent to the back-end server. After receiving the query request, the Elasticsearch algorithm in the back-end server will use its powerful distributed processing capabilities to distribute the query request to multiple server nodes that store inverted indexes. Each node will quickly locate the Hanfu main document and Hanfu attachments containing the user's query keywords based on its own inverted index data. These documents may be stored in the same shard or distributed on different shards, but the parallel processing capabilities of Elasticsearch ensure the efficiency of this process. After finding all relevant Hanfu files, the system will further use the TF-IDF (Term Frequency-Inverse DocumentFrequency) algorithm to sort these search results. TF-IDF is a statistical method for evaluating the importance of a word to a document set or one of the documents in a corpus. It takes into account the frequency of the word in the document (TF) and the general importance of the word in the document set (IDF). In this way, the system can calculate the similarity score between each search result and the keyword entered by the user, and display the documents with high scores to the user first. Finally, the sorted search results will be sent to the front-end interface, where users can see a list of Hanfu documents sorted by relevance. Some summary information, such as title, author, etc., may also be displayed next to each file to help users quickly determine whether the file meets their needs. The entire search process, from user input of keywords to return of search results, is highly automated and carried out in real time, greatly improving the user's search efficiency and experience. At the same time, through Elasticsearch's distributed architecture and index optimization technology, the system can handle large-scale Hanfu document sets, ensure the accuracy and response speed of the search, and provide users with efficient and reliable search services.

[0095] As an optional embodiment of the present invention, optionally, the establishing of association information between the Hanfu main document and the Hanfu attachment includes:

[0096] The association component is arranged in the back end and is used to establish the association information between the Hanfu main document and the Hanfu attachment according to the ID information of the Hanfu main document and the ID information of the Hanfu attachment.

[0097] like Figure 5 As shown, it should be noted that the association component establishes the association information between the Hanfu main document and the Hanfu attachment based on the ID information of the Hanfu main document and the ID information of the Hanfu attachment. Specifically, in the context of Elasticsearch, the association component is not only responsible for establishing and maintaining the logical connection between the Hanfu main document and the Hanfu attachment, but also ensures the consistency and integrity of the data. This mechanism is particularly important when dealing with complex document management systems, especially when the number of documents and attachments is large and changes frequently. The association component builds a lightweight index or mapping table by capturing and recording the ID information pair of each Hanfu main document and its corresponding attachment. This mapping table allows the system to quickly retrieve all attachments for any given main document, and vice versa. When data is stored or updated, the association component automatically detects and updates this mapping table to ensure the latest and accuracy of the information.

[0098] As an optional embodiment of the present invention, optionally, the backend further includes a file management component, and the file management component is used to name the Hanfu main document and the Hanfu attachment according to a preset naming rule.

[0099] As an optional embodiment of the present invention, optionally, the naming rule of the Hanfu main document is:

[0100] The main documents of Hanfu with different titles are named by combining English capital letters and three or more Arabic numerals;

[0101] The main documents of Hanfu with different copyrights or authors are named in combination of English capital letters and two or more Arabic numerals;

[0102] The main documents of Hanfu with different genres are named by combining English capital letters and two or more Arabic numerals.

[0103] It should be noted that the naming rules of the specific Hanfu main document are shown in the following table:

[0104] Category name + chapter rules + article name

[0105]

[0106] As an optional embodiment of the present invention, optionally, the naming rule of the Hanfu attachment is the same as the naming rule of the Hanfu main document.

[0107] It should be noted that the naming rules of Hanfu attachments are as shown in the following table:

[0108] Naming rules: Chapter naming rules + article name

[0109]

[0110]

[0111] As an optional embodiment of the present invention, optionally, the administrator uploads the Chinese Fu file through the front end using an encryption algorithm;

[0112] The encryption algorithm includes:

[0113] Using the back end, select any two numbers m and n, and find mn=f, where both m and n are not equal to zero;

[0114] The front end randomly selects two numbers c and s i , c satisfies: J(c / m)=J(c / n)=-1, where J represents the Jacobi operation; s i Satisfaction: i ∈[1,f-1], and s i is an integer;

[0115] The backend publishes (c, f) as a public key and (m, n) as a secret key;

[0116] Let the Chinese Fu file be x, and represent x in binary, x=(x1,x2,...x i ), x i represents the i-th binary number, and x i ∈{0,1};

[0117] When x i =1, then

[0118] When x i = 0, then Among them, mod() represents the remainder operation;

[0119] The encrypted data packets are k1, k2, ...k i =D(x), k i Indicates x i The encrypted result, D(x) represents the result of data packet encryption;

[0120] Decryption includes:

[0121] Based on k1,k2,...k i =D(x) and (m,n), solve for each k i J(k i / m) and J(k i / n);

[0122] If J(k i / m)=J(k i / n)=1, then x i=0; if J(k i / m)=J(k i / n)=-1, then x i =1;

[0123] x i = 0, then and

[0124] x i =1, then and

[0125] * indicates multiplication operation;

[0126] Solve (k1,k2,...k i ) to obtain the decrypted data packet.

[0127] It should be noted that the encryption algorithm is a technology used to protect data security, which protects the confidentiality of data by converting the original data into a form that is not easily understood by unauthorized persons. In the embodiment, the encryption algorithm includes two steps: first, the back end randomly selects two numbers and calculates their Jacobian operation results; then, the front end randomly selects two numbers that meet certain conditions, and uses the public key published by the back end as the encryption key and the secret key selected by the access end as the decryption key.

[0128] This system mainly includes the following functions:

[0129] File editing: According to the rules of Hanfu related file retrieval, edit the corresponding articles according to the rules and name them according to the agreed method. The file writing format and file naming are binding. Documents are divided into main documents and attachment documents. The main document is the main retrieval object, and the attachment exists in dependence on the main document, that is, the attachment document referenced in the main document. The attachment document exists independently.

[0130] File upload: After editing the file, upload it through the system; files can be uploaded in batches; after the system uploads successfully, the system will automatically archive and classify the documents and form search terms. In particular, it is divided into main documents and attachments. And the main document is automatically associated with the attachment document in terms of information.

[0131] File management: After uploading files, you can see the classification and number of files on the management interface, and the file naming is based on the agreed naming rules. Files that are not named according to the rules cannot be uploaded. Files can be deleted, and the association between files is also deleted after deletion.

[0132] Document search: Enter keywords to find the contents of related documents; you can also search for related attachments; you can search by keywords or long sentences. Keywords will be highlighted and related documents will be retrieved.

[0133] File download: You can download it in the file management interface, or in the retrieved content such as attachments.

[0134] It is important to note that the search information generated after the document is uploaded is automatically generated by the system. When the file is uploaded, the documents in the document library will first be preprocessed to create an index for the document. An index is an abstract representation of the document content, which can speed up the search and improve the search accuracy. Common indexing methods include full-text indexing, keyword indexing, and metadata indexing. When the user enters the query conditions, the search system will parse these conditions and match them with the document index. The matching algorithm will calculate the matching degree or score of each document based on factors such as the similarity between the query conditions and the document content and the weight of the keywords. Next, the search system will sort the documents according to the matching degree, and put the most relevant or highest-scoring documents in front so that users can quickly find the information they need. The sorting algorithm can be based on a variety of factors, such as the relevance of the document, the release time, the number of visits, etc.

[0135] When using it, first, the user enters the account number and password through the login interface to log in, such as Figure 6 As shown, the account includes an administrator account and a user account; through the account and password login mechanism, the retrieval system of this embodiment can ensure the security and privacy of user data and provide users with a safer and more convenient document retrieval service.

[0136] Secondly, through Figure 7 and 17 Enter keywords in the document search box shown to retrieve documents; document retrieval is a core function in the document retrieval system, which allows users to retrieve relevant document information from the system's document library by entering keywords, phrases or specific query conditions. This function is designed to help users quickly and accurately obtain the required document resources and improve research and work efficiency. During the document retrieval process, the system will match and filter in the document library based on the query conditions entered by the user. The matching process is usually based on multiple factors such as text content, keyword density, and document type. The system also considers the weight and relevance of the document to ensure the accuracy and reliability of the retrieval results. In addition to basic retrieval functions, the document retrieval system also provides a series of auxiliary tools and features to enhance the user experience and improve retrieval results. For example, users can refine the search scope by setting advanced query options, or use functions such as Boolean operators and wildcards to perform more complex query operations.

[0137] like Figure 8 and10 As shown in the figure, the document upload function is an important part of the system operation. It allows users to transfer document files in the local computer to the server through the network for storage, sharing or further processing. Through the file management function, users can organize, manage and protect their files more effectively, improve work efficiency and ensure the security and integrity of data. The document upload function also supports common file types, including PDF files. To ensure the security of the system and the integrity of the function. In order to optimize system performance and user experience, the document upload function usually limits the size of uploaded files. Oversized files may cause the upload speed to slow down, occupy too much server storage space, and even affect the normal operation of the system.

[0138] like Fig.12 As shown in the figure, when the user clicks the Select File button, a pop-up window will appear. Fig.12 As shown in the dialog box, after the dialog box pops up, the user first needs to browse the stored files through the file. This is usually presented as an intuitive interface, showing the hierarchical structure of the folder and the files and subfolders in it. In the file browser, users can use a variety of methods to locate the target file. Once the target file is located, the user can select the file by clicking the file icon or using keyboard shortcuts. If you want to select multiple files, the user usually holds down the Ctrl key (in Windows) or the Command key (in Mac) while clicking multiple files. If you want to select all files in a folder, the user can also use the Select All function. After selecting the file, make sure that the correct file is selected. The preview function may include displaying a thumbnail, summary information, or partial content of the file.

[0139] like Fig. 9 As shown, Fig. 9 It is a document upload interface. The administrator uploads the document to the server through the document upload interface. Uploading the server refers to the process of transferring files or data from the local computer or other device to the server for storage or processing. When performing the upload operation, the administrator usually needs to select a single file or multiple files to upload. In general, it is divided into selecting files, specifying servers (system default), identity authentication (system implementation) and finally transferring files: once the connection is established and the identity authentication is passed, the file begins to be transferred from the local computer to the server. This process may involve network transmission, data encryption, and error detection mechanisms to ensure the integrity and security of the file. Confirm the upload: After the upload is completed, the user will receive a confirmation message informing that the file has been successfully uploaded to the server.

[0140] like Fig.10 and 11As shown in the figure, file management is responsible for organizing and storing files. This includes classifying and archiving according to the naming rules, type, content, attributes, etc. of the uploaded files so that users can find them on demand. At the same time, file management is also responsible for allocating storage space for files to ensure the physical storage security of files. Secondly, the retrieval system is one of the core functions of file management. Through the retrieval system, users can search for files in a variety of ways such as keywords, file names, and file attributes. Effective retrieval algorithms and indexing technologies can ensure the accuracy and efficiency of retrieval, allowing users to quickly find target files. In addition, file management also includes permission management functions. Only administrators can access, modify, or delete specific files.

[0141] like Fig.13 As shown in the figure, the document preview function of the retrieval system provides users with a way to quickly view the content of a document during the retrieval process without opening the full document. This function greatly improves the efficiency of users in retrieving and filtering documents, and brings users a more convenient operation experience. Specifically, when users find relevant documents through the retrieval system, they can preview the contents of these documents directly on the retrieval result interface. The preview function usually supports PDF format, etc., so that users can easily preview any type of document. This is also a common reading method. Through preview, users can quickly determine whether the document meets their needs, and thus decide whether to further open and read the full document.

[0142] like Fig.14 As shown in the figure, the document deletion function of the retrieval system means that users can delete documents that are no longer needed or do not meet the requirements in the system. This function is usually used as part of file management to help users maintain the neatness of documents and the storage space of the system. When deleting documents, the system usually asks users to confirm to prevent accidental or unauthorized deletion. Users can select single or multiple documents to delete, and the system will handle them accordingly based on the selected documents. For example, if the main document content is deleted, the association relationship of the corresponding attachment is also deleted. The retrieval information corresponding to the document is also deleted.

[0143] like Fig.15As shown, the document download function of the retrieval system allows users to download retrieved documents from the system to a local device for viewing, editing or archiving without a network connection. This function provides users with great convenience and flexibility. When using the document download function of the retrieval system, users usually need to first find the required documents through the system's retrieval function. Once the target document is found, the user can select the download option and the system will start processing the download request. During the download process, the system may provide PDF format, etc. This helps ensure that users can choose the most common format according to their needs and device compatibility. After the download is complete, users can find the downloaded documents on their local device and view, edit or share them as needed. This provides users with the ability to access and use documents offline, making the retrieval system more complete and practical. In summary, the document download function of the retrieval system provides users with the ability to save retrieved documents to local devices conveniently and quickly, which helps users view, edit and share documents anytime and anywhere.

[0144] like Fig.16 As shown in the figure, the pie chart document classification of the retrieval system mainly relies on the specific function of the pie chart in data visualization, that is, to show the relative proportion of different categories or groups. Therefore, when using a pie chart to classify documents in the retrieval system, it is usually to intuitively show the proportion of each type of document in the total. Specifically, pie chart document classification can be applied to the following scenarios:

[0145] Document type distribution: classification of main documents and attachments. When the system draws a pie chart, each sector area represents a specific document category or group, and the angle of the sector is determined according to the number of documents in that category or group or the proportion of the weight to the total. In this way, users can quickly understand the distribution of various types of documents in the retrieval system by viewing the pie chart. It should be noted that although the pie chart can intuitively display the proportional relationship, it may not be easy to distinguish categories with too many or similar proportions. In this case, consider using other types of charts (such as column charts or bar charts) to display document classification. At the same time, in order to ensure the accuracy and reliability of the data, the data in the retrieval system should be updated and maintained regularly.

[0146] When using the search system, the user first enters keywords or query conditions, and the system will search the document library based on these conditions and return relevant search results. These results may include documents, web links, and attachments. For search results that include attachments, the system usually displays the file names of these attachments in the form of a list or summary. And form a link, the user can click the corresponding download link or button to trigger the download operation. In addition, the search also provides multiple joint search methods such as Fig.18 shown.

[0147] Although the 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 claims and their equivalents.

Claims

1. A Chinese Fu divergence retrieval system based on Elasticsearch, characterized in that: The system includes a front end, a back end and a database; The front end is used for the administrator to upload the Hanfu file, divide the Hanfu file into a Hanfu main document and a Hanfu attachment, and establish the association information between the Hanfu main document and the Hanfu attachment; The front end is also used for users to retrieve the main document and attachments of Hanfu based on the Elasticsearch algorithm; The backend is used to receive the Hanfu main document and Hanfu attachment uploaded by the frontend, embed the download link of the Hanfu attachment in the Hanfu main document, and establish an index relationship between the Hanfu main document and the Elasticsearch algorithm; The database is used to store the Hanfu main document and Hanfu attachments.

2. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 1, characterized in that: Establishing the index relationship between the Hanfu main document and the Elasticsearch algorithm includes: A word segmentation component is used to perform word segmentation processing on the Hanfu main document to obtain a word list; A language processing component, connected to the word segmentation component, for performing a deduplication process on the word list to generate a deduplication word list; An index component, connected to the language processing component, for associating the deduplicated word list with the specific position of the word in the Hanfu main document to generate an inverted index, wherein the inverted index is used to establish an index relationship with the Elasticsearch algorithm; An index library, connected to the index component, is used to store the inverted index.

3. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 2, characterized in that: The index component is also used to divide the inverted index into a plurality of shards, and the shards are used to be stored on different server nodes.

4. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 3, characterized in that: The index component is also used to replicate the shards.

5. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 4, characterized in that: The user retrieves the Hanfu main document and Hanfu attachments based on the Elasticsearch algorithm, including: The user enters a keyword in the search box of the front end, and the front end converts the keyword into an Elasticsearch query statement; The backend receives the converted Elasticsearch query statement, and the Elasticsearch algorithm sends the Elasticsearch query statement to different server nodes, and each node locates the Chinese Fu file containing the Elasticsearch query statement based on the inverted index to obtain search results; The similarity score between the search result and the keyword is calculated using the TF-IDF algorithm, and the Chinese Fu file with high similarity is sent to the front end.

6. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 1, characterized in that: The establishment of the association information between the Hanfu main document and the Hanfu attachment includes: The association component is arranged in the back end and is used to establish the association information between the Hanfu main document and the Hanfu attachment according to the ID information of the Hanfu main document and the ID information of the Hanfu attachment.

7. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 1, characterized in that: The backend also includes a file management component, which is used to name the Hanfu main document and the Hanfu attachment according to a preset naming rule.

8. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 6, characterized in that: The naming rules of the Hanfu main document are: The main documents of Hanfu with different titles are named by combining English capital letters and three or more Arabic numerals; The main documents of Hanfu with different copyrights or authors are named in combination of English capital letters and two or more Arabic numerals; The main documents of Hanfu with different genres are named by combining English capital letters and two or more Arabic numerals.

9. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 6, characterized in that: The naming rule of the Hanfu attachment is the same as the naming rule of the Hanfu main document.

10. The Chinese Fu divergence retrieval system based on Elasticsearch as claimed in claim 1, characterized in that: The administrator uploads the Chinese Fu file through the front end using an encryption algorithm; The encryption algorithm includes: Using the back end, select any two numbers m and n, and find mn=f, where both m and n are not equal to zero; The front end randomly selects two numbers c and s i , c satisfies: J(c / m)=J(c / n)=-1, where J represents the Jacobi operation; s i Satisfaction: i ∈[1,f-1], and s i is an integer; The backend publishes (c, f) as a public key and (m, n) as a secret key; Let the Chinese Fu file be x, and represent x in binary, x=(x1,x2,...x i ), x i represents the i-th binary number, and x i ∈{0,1}; When x i =1, then k i =c si mod(f); When x i = 0, then Among them, mod() represents the remainder operation; The encrypted data packets are k1, k2, ...k i =D(x), k i Indicates x i The encrypted result, D(x) represents the result of data packet encryption; Decryption includes: Based on k1,k2,...k i =D(x) and (m,n), solve for each k i J(k i / m) and J(k i / n); If J(k i / m)=J(k i / n)=1, then x i =0; if J(k i / m)=J(k i / n)=-1, then x i =1; x i = 0, then and x i =1, then and * indicates multiplication operation; Solve (k1,k2,...k i ) to obtain the decrypted data packet.

Citation Information

Cited By

  • Data synchronization method based on cloud search service, medium, electronic equipment and product

    CN120804045A