Engineering cost AI assistant hybrid retrieval sorting algorithm and distributed deployment method

CN122548016APending Publication Date: 2026-08-11SICHUAN HONGYE CONSTR SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-14
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

现有技术在工程造价领域适配性差,存在专业资料召回精度低、高并发场景服务稳定性不足的问题

Benefits of technology

1、检索专业性与时效性强。本发明自定义工程造价专业术语词库与无效分词词库,可精准识别领域专属词汇,解决通用检索术语识别偏差的问题。同时,本发明引入时间意图解析与指数衰减时间匹配算法,适配造价定额、政策文件时效性更新的行业特性,有效提升资料匹配精准度;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122548016A_ABST
    Figure CN122548016A_ABST
Patent Text Reader

Abstract

This invention discloses a hybrid retrieval and ranking algorithm and a distributed deployment method for an AI assistant for engineering cost estimation, belonging to the field of artificial intelligence retrieval technology. The invention involves an application server coordinating the entire process. First, it extracts the keyword set from the user's question and determines the time intent. Then, it calls the query server to perform keyword matching and coarse screening, returning data fragment IDs and scores. Next, the list of data fragment IDs and the time intent are passed to a re-ranking server cluster to perform semantic re-ranking, time similarity calculation, and weighted summation to obtain a second ranking criterion, which is then returned. The application server combines the two-level ranking criteria to complete the data ranking, and finally calls an online large-scale model to output the question-and-answer results. This invention employs a custom word segmentation lexicon and an exponential decay algorithm to improve the recognition of professional terms and timeliness matching capabilities. Simultaneously, it builds a distributed architecture, splitting computing tasks and equipping them with a load balancing mechanism. Servers only exchange data fragment IDs, significantly reducing network overhead.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence intelligent retrieval and distributed computer deployment technology, specifically to a hybrid retrieval and ranking algorithm and a distributed deployment method for an AI assistant for engineering cost estimation. Background Technology

[0002] Artificial intelligence technology has been widely applied in intelligent question-answering scenarios across various industries. Search-enhanced generation technology is currently the core technology for AI assistants to achieve accurate question answers. This technology first retrieves information from a professional knowledge base, and then generates answers based on the search results. This technology can effectively solve the problem of large models generating erroneous content out of thin air, helping various industries reduce costs and increase efficiency.

[0003] Professionals in the construction cost industry need to consult a large amount of data, including quota standards, policy documents, and software operation specifications. Manually reviewing these documents is tedious and time-consuming. Therefore, the industry urgently needs a dedicated AI assistant to improve efficiency. Existing general-purpose AI retrieval solutions applied to the construction cost industry have two major drawbacks. First, general semantic retrieval algorithms cannot accurately identify specialized terminology specific to the construction cost field and struggle to capture the implicit time intent in user queries. This results in low recall rates and poor matching accuracy for specialized data, causing AI responses to fall short of industry requirements. Second, the hybrid retrieval algorithms used to improve retrieval accuracy are computationally intensive, consuming significant GPU resources. Single-server deployments are prone to performance bottlenecks under high concurrency scenarios, leading to server lag, service interruptions, and poor system stability.

[0004] Existing technologies lack specialized and timely hybrid retrieval strategies adapted to the engineering cost industry. Furthermore, existing technologies fail to design reasonable computing power distribution architectures for intensive computational tasks, making it difficult to simultaneously ensure retrieval accuracy and system concurrency stability, thus hindering their application in engineering projects. Based on these technical shortcomings, this invention proposes a hybrid retrieval and ranking algorithm and a distributed deployment method adapted to engineering cost scenarios. Summary of the Invention

[0005] The purpose of this invention is to overcome the application shortcomings of existing general-purpose retrieval technologies. Existing technologies have poor adaptability in the field of engineering cost estimation, exhibiting problems such as low accuracy in recalling professional data and insufficient service stability in high-concurrency scenarios. This invention enables accurate retrieval and timely matching of professional data, while simultaneously achieving decoupling of computing power and elastic scaling through a distributed architecture, ensuring long-term stable system operation.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following solution: The hybrid retrieval and ranking algorithm and distributed deployment method of the engineering cost AI assistant are executed by the application server as follows: S1. Receive user questions, extract the keyword set corresponding to the user questions, and be responsible for determining the user's time intent in asking the questions; S2. Based on the keyword set, call the query server to perform keyword matching and coarse screening to obtain a candidate data set. The candidate data set contains a list of data fragment IDs and their corresponding keyword matching scores. S3. Send the list of data fragment IDs and time intent to the reordering server cluster; The reordering server cluster retrieves data fragments locally based on the list of data fragment IDs, calculates the semantic similarity score between each data fragment and the user's question, and calculates the time similarity score in combination with the time intent. The semantic similarity score and the time similarity score are then weighted and summed to obtain the second ranking criterion; The reordering server cluster returns each data fragment ID and its corresponding second ranking criterion to the application server. S4. Sort the candidate dataset in descending order based on the keyword matching score as the first sorting criterion and the second sorting criterion returned by the resorting server cluster as the second sorting criterion. S5. Call the online large model interface to combine the sorted data with user questions to generate Q&A results and output them externally.

[0007] Furthermore, in step S1, the jieba.analyse word segmentation tool is used to extract a set of keywords, and a whitelist of engineering cost professional terms and an invalid word segmentation blacklist are configured; the application server combines regular expression matching and domain rules to parse the user's question text and obtain standardized time intent.

[0008] Furthermore, in step S2, a preliminary screening of the data is completed using a keyword matching scoring method. The formula for calculating the keyword matching score is as follows: Where, d i For the i-th data segment, S(d) i ) represents the score of the i-th data segment, K is the set of keywords, and k j For a single keyword, |k j | represents the length of the keyword character set, I title (d i ,k j ) is the title matching indicator function, with a value of 1 for a successful match and a value of 0 for a failed match; I content (d i ,k j The function is the text matching indicator function. It takes a value of 1 for a successful match and a value of 0 for a failed match. The candidate data set is filtered out from high to low according to the data fragment score. The query server only returns to the application server a list of data fragment IDs and corresponding keyword matching scores of the top N data fragments with the highest keyword matching scores, as well as the name of the knowledge base set.

[0009] Furthermore, in step S3, the reordering server cluster uses the bge-reranker-base semantic reordering model to calculate the semantic similarity score, with the semantic similarity score ranging from 0 to 1.

[0010] Furthermore, in step S3, the formula for calculating the time similarity score is: Where, d i For the i-th data segment, S time (d i ) represents the time similarity score of the i-th data segment. This represents the absolute difference in months between the user's time intent and the data publication time. The decay coefficient is fixed at 0.15; when the user's question does not have a clear time intention, the time similarity score is not calculated.

[0011] Further, in step S3, the weighted summation is specifically as follows: the weighting coefficient for semantic similarity score is 0.65, and the weighting coefficient for temporal similarity score is 0.35; when there is no temporal similarity score, the weighting coefficient for semantic similarity score is 1; the reordering server cluster uses the weighted summation result as the second sorting basis for each data segment, and returns it to the application server along with the data segment ID list.

[0012] Furthermore, after the query server deploys the Pg database and performs keyword matching calculations, it only returns to the application server a list of data fragment IDs and corresponding scores for the top N data fragments with the highest keyword matching scores, as well as the name of the knowledge base set.

[0013] Furthermore, the reordering server cluster deploys the Qdrant vector library and uses a weighted load balancing mechanism to distribute tasks. Based on the list of data fragment IDs transmitted by the application server, the cluster retrieves the corresponding fragment content locally, completes semantic reordering, time similarity calculation, and weighted summation, and automatically switches to an available server when a server failure is detected.

[0014] Furthermore, the knowledge base used to support the retrieval and sorting process is divided into a cost knowledge base and a software operation knowledge base. The original data is cut into data fragments of 500 to 750 words. The data fragments are synchronously stored in the Qdrant vector library and the Pg database. Each data fragment has a unique ID, and the servers use this ID to index the fragments and retrieve the content.

[0015] Furthermore, the application server is equipped with an AI platform and Qdrant vector library, which is responsible for task scheduling, time intent judgment, data integration, and online large model interface calls, and uses the online version of the large model as the core text generator.

[0016] The beneficial effects of this invention are as follows: 1. Highly professional and timely search capabilities. This invention features a custom-defined thesaurus of engineering cost terminology and an invalid word segmentation thesaurus, which can accurately identify domain-specific terms and solve the problem of identification bias in general search terms. Simultaneously, this invention introduces time intent parsing and exponential decay time matching algorithms to adapt to the industry characteristics of timely updates in cost quotas and policy documents, effectively improving the accuracy of data matching. 2. Progressive retrieval accuracy. This invention employs a three-stage retrieval strategy of coarse screening, fine ranking, and time-based alignment, combined with a multi-factor fusion ranking mechanism that integrates keyword hard matching, semantic soft matching, and time dimension matching. This overcomes the technical shortcomings of single retrieval methods and significantly improves the recall priority of highly relevant data. 3. High system concurrency stability. This invention decouples lightweight keyword matching tasks from intensive semantic reordering and time-based sorting tasks through a distributed architecture, achieving computational power distribution. The reordering server cluster undertakes all intensive computations (semantic, time, and weighted), while the application server is only responsible for scheduling and final sorting. The reordering server cluster supports horizontal scaling and load balancing, effectively avoiding single-node computing power bottlenecks and failure risks. It can run stably in high-concurrency scenarios without service interruption issues. 4. Excellent Engineering Practicality. This invention completes data interaction between servers only by transmitting data fragment IDs, significantly reducing network transmission overhead. Simultaneously, the large model and algorithm architecture are decoupled, allowing for flexible iteration and upgrades to adapt to the long-term business iteration needs of the engineering cost industry. Practical application has proven that this invention can stably handle tens of thousands of user inquiries, demonstrating strong practicality. Attached Figure Description

[0017] Figure 1 This is a flowchart of the hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant of the present invention.

[0018] Figure 2 This is a diagram of the distributed processing architecture of the present invention. Detailed Implementation

[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the present invention or its application or use. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0020] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of the invention.

[0021] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.

[0022] Furthermore, for clarity and brevity, descriptions of well-known structures, functions, and configurations may have been omitted. Those skilled in the art will recognize that various changes and modifications can be made to the examples described herein without departing from the spirit and scope of this disclosure.

[0023] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.

[0024] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0025] like Figure 1 As shown, Figure 1 This is a flowchart of the hybrid retrieval and ranking algorithm and distributed deployment method for the engineering cost AI assistant of the present invention. The hybrid retrieval and ranking algorithm and distributed deployment method for the engineering cost AI assistant are executed by the application server in the following steps: S1. Receive user questions, extract the keyword set corresponding to the user questions, and be responsible for determining the user's time intent in asking the questions; S2. Based on the keyword set, call the query server to perform keyword matching and coarse screening to obtain a candidate data set. The candidate data set contains a list of data fragment IDs and their corresponding keyword matching scores. S3. Send the list of data fragment IDs and time intent to the reordering server cluster; The reordering server cluster retrieves data fragments locally based on the list of data fragment IDs, calculates the semantic similarity score between each data fragment and the user's question, and calculates the time similarity score in combination with the time intent. The semantic similarity score and the time similarity score are then weighted and summed to obtain the second ranking criterion; The reordering server cluster returns each data fragment ID and its corresponding second ranking criterion to the application server. S4. Sort the candidate dataset in descending order based on the keyword matching score as the first sorting criterion and the second sorting criterion returned by the resorting server cluster as the second sorting criterion. S5. Call the online large model interface to combine the sorted data with user questions to generate Q&A results and output them externally.

[0026] Furthermore, in step S1, the jieba.analyse word segmentation tool is used to extract a set of keywords, and a whitelist of engineering cost professional terms and an invalid word segmentation blacklist are configured; the application server combines regular expression matching and domain rules to parse the user's question text and obtain standardized time intent.

[0027] Furthermore, in step S2, a preliminary screening of the data is completed using a keyword matching scoring method. The formula for calculating the keyword matching score is as follows: Wherein S(d i ) represents the score of a single data segment, and K represents the set of keywords. j For a single keyword, |k j | represents the length of the keyword character set, I title (d i ,k j ) is the title matching indicator function, with a value of 1 for a successful match and a value of 0 for a failed match; I content (d i ,k j The function is the text matching indicator function. It takes a value of 1 for a successful match and a value of 0 for a failed match. The candidate data set is filtered out from high to low according to the data fragment score. The query server only returns to the application server a list of data fragment IDs and corresponding keyword matching scores of the top N data fragments with the highest keyword matching scores, as well as the name of the knowledge base set.

[0028] Furthermore, in step S3, the reordering server cluster uses the bge-reranker-base semantic reordering model to calculate the semantic similarity score, with the semantic similarity score ranging from 0 to 1.

[0029] Furthermore, in step S3, the formula for calculating the time similarity score is: Where, d i For the i-th data segment, S time (d i ) represents the time similarity score of the i-th data segment. This represents the absolute difference in months between the user's time intent and the data publication time. The decay coefficient is fixed at 0.15; when the user's question does not have a clear time intention, the time similarity score is not calculated.

[0030] Further, in step S3, the weighted summation is specifically as follows: the weighting coefficient for semantic similarity score is 0.65, and the weighting coefficient for temporal similarity score is 0.35; when there is no temporal similarity score, the weighting coefficient for semantic similarity score is 1; the reordering server cluster uses the weighted summation result as the second sorting basis for each data segment, and returns it to the application server along with the data segment ID list.

[0031] Furthermore, after the query server deploys the Pg database and performs keyword matching calculations, it only returns to the application server a list of data fragment IDs and corresponding scores for the top N data fragments with the highest keyword matching scores, as well as the name of the knowledge base set.

[0032] Furthermore, the reordering server cluster deploys the Qdrant vector library and uses a weighted load balancing mechanism to distribute tasks. Based on the list of data fragment IDs transmitted by the application server, the cluster retrieves the corresponding fragment content locally, completes semantic reordering, time similarity calculation, and weighted summation, and automatically switches to an available server when a server failure is detected.

[0033] Furthermore, the knowledge base used to support the retrieval and sorting process is divided into a cost knowledge base and a software operation knowledge base. The original data is cut into data fragments of 500 to 750 words. The data fragments are synchronously stored in the Qdrant vector library and the Pg database. Each data fragment has a unique ID, and the servers use this ID to index the fragments and retrieve the content.

[0034] Furthermore, the application server is equipped with an AI platform and Qdrant vector library, which is responsible for task scheduling, time intent judgment, data integration, and online large model interface calls, and uses the online version of the large model as the core text generator.

[0035] The invention will be further described in detail below with reference to typical application examples.

[0036] This embodiment operates on a distributed architecture consisting of an application server, a query server, and a reordering server cluster. The knowledge base is divided into a cost estimation knowledge base and a software operation knowledge base. All original data is uniformly segmented into data fragments of 500 to 750 characters, each fragment is assigned a unique ID, and is synchronously stored in the Pg database and the Qdrant vector library. The application server carries an AI platform and the Qdrant vector library, the query server deploys the Pg database, and the reordering server cluster deploys the Qdrant vector library and employs a weighted load balancing mechanism. The system uses an online version of a large model as the core text generator. This example uses a user's question, "What is the adjustment coefficient for labor costs in the 2022 second half-year quota of a certain city?" The detailed operation steps are as follows: Step S1: The application server receives the above user query, calls the jieba.analyse word segmentation tool, and extracts keywords based on the preset whitelist of engineering cost professional terms and the blacklist of invalid word segments to obtain the keyword set {20 quota, labor cost, adjustment coefficient, a certain city}; at the same time, the application server combines regular expression matching and domain rules to parse the text and convert "second half of 2022" into the standardized time intent "June 2022".

[0037] Step S2: The application server sends the keyword set to the query server. The query server performs keyword matching and scoring calculation based on the Pg database. It uses a preset calculation formula to obtain the keyword score of each data segment. The data segments with the highest keyword scores are sorted from high to low and the top N data segments are selected. The ID of these data segments, their corresponding scores, and the name of the knowledge base set are sent back to the application server. The application server then forms a candidate data set based on this.

[0038] Step S3: The application server distributes the list of candidate data fragment IDs and the time intent obtained in step S1 to the reordering server cluster through a load balancing mechanism. The reordering server cluster retrieves the corresponding data fragment content from its local Qdrant vector library based on the ID, calls the bge-reranker-base semantic reordering model, and calculates the semantic similarity between each data fragment and the user's question, obtaining a semantic similarity score ranging from 0 to 1. Simultaneously, it extracts the publication time of each data fragment, calculates the absolute month difference Δt between the two based on the time intent, and uses an exponential decay formula to calculate the time similarity score for each data fragment. If the user's question does not mention time, this step does not calculate the time similarity score. Then, the reordering server cluster weights and sums the semantic similarity score and the time similarity score (semantic coefficient 0.65, time coefficient 0.35; semantic coefficient is 1 when there is no time score) to obtain the second ranking criterion for each data fragment, and returns the data fragment ID and the corresponding second ranking criterion to the application server.

[0039] Step S4: The application server uses keyword matching scores as the first sorting criterion and the second sorting criterion returned by the re-sorting server cluster as the second sorting criterion, and sorts the candidate dataset in descending order according to the priority of "first sorting criterion first, second sorting criterion second".

[0040] This case study's candidate dataset contains three data segments: A-001, A-002, and A-003. A-001 and A-003 both have a keyword score of 177, while A-002 has a keyword score of 135. Further, based on the second ranking score returned by the re-ranking server, A-001 has a second ranking score of 0.8115, A-002 has a second ranking score of 0.6505, and A-003 has a second ranking score of 0.605. Following the principle of prioritizing the first ranking criterion, A-001 and A-003, both with a keyword score of 177, rank higher. Furthermore, the order between them is determined by the second ranking criterion (0.8115 > 0.605), therefore A-001 ranks higher than A-003. A-002, with a keyword score of only 135, ranks last. The final comprehensive ranking result is A-001, A-003, and A-002. This sorting method prioritizes the matching degree of professional terms, while taking into account semantic relevance and the timeliness of information, and avoids outdated information being pushed out of the way.

[0041] Step S5: Based on the final sorting result, the application server retrieves the corresponding complete data content from the Qdrant vector library using the data ID. It then combines the sorted data with the original user question into a standard call command and sends it to the online large model interface. After receiving the question-and-answer results returned by the large model, it outputs the answer and reference materials, completing this question-and-answer interaction.

[0042] like Figure 2 As shown, Figure 2 This is a diagram of the distributed processing architecture of the present invention. The architecture mainly includes an application server, a query server, and a reordering server cluster consisting of multiple reordering servers, as well as a client and an online large model server. Each device completes the entire process of task distribution, data interaction, and question-and-answer generation according to a pre-defined division of labor. The application server deploys an AI platform and a Qdrant vector library, undertaking tasks such as time intent judgment, question-and-answer processing, data organization, and overall task scheduling. The query server deploys a Pg database, responsible for executing keyword retrieval-related tasks and returning the matched data fragment IDs and corresponding scores to the application server. Each reordering server deploys a Qdrant vector library, receives the list of data fragment IDs and time intents from the application server, retrieves the corresponding fragment content locally, and jointly completes semantic reordering, time similarity calculation, and weighted summation, returning each data fragment ID and its corresponding second ranking criterion to the application server.

[0043] This system uses an online version of a large language model as its core generator to ensure the accuracy of responses and semantic understanding capabilities. At the same time, the system design maintains decoupling from the large model, allowing for rapid replacement and upgrades should a more powerful model be released in the future.

[0044] To comprehensively cover all kinds of questions that users in the engineering cost industry may ask, this system has built two types of professional knowledge bases, one for cost business knowledge and the other for software operation guidance.

[0045] (1) Cost Estimation Knowledge Base This knowledge base is used to answer professional questions related to engineering cost policies, standards, and quotas, including: Bill of Quantities Library: Includes the "2013 Bill of Quantities Items" and the "2024 Bill of Quantities Standards"; Quota database: includes "Sichuan Province 2020 Pricing Quotas" and "Sichuan Province 2015 Pricing Quotas"; Policy document library: Contains industry policy documents related to engineering cost over the years; (2) Software operation knowledge base This knowledge base is used to answer operational guidance questions related to Hongye Pricing Software, including: Software development requirements document (a detailed description of the components of the software's functions); Preset question and answer records; To facilitate subsequent retrieval, each original document undergoes structured preprocessing. The specific process is as follows: Chunking strategy: Each piece of data is divided into multiple segments of 500–750 characters each, using a period "." or a newline character "\n". This granularity of chunking strikes a balance between semantic completeness and retrieval accuracy.

[0046] Dual storage: All data fragments and their corresponding full texts are stored in the Qdrant vector library (for vector retrieval and semantic matching) and the Pg database (for structured queries and keyword matching). The Pg database only stores the text (original text) and title (title) fields for each data fragment to reduce storage redundancy.

[0047] Each piece of data or fragment stored in the Qdrant vector library is organized in JSON format. This structure records metadata such as the unique identifier of the data, original content, title, upload time, publication time, and source category, providing necessary data support for subsequent keyword matching, time sorting, and semantic retrieval.

[0048] Data storage format for each document in the Qdrant vector library { "id": "d6ac36de-82f2-4c74-a60f-c30449fdc4be", ## An ID for a document or fragment. "payload": { "text": "Major: Architectural and Decoration Engineering, Chapter Title: ......", ##Original text of the data or excerpt "chunk_id": -3, ##-1 indicates the full text of the document, -2 indicates the description of the list of quotas, -3 indicates the list of quotas. "w_id": "W-5e7a0f37c4f880c4a755d38a", ## Document ID, all segments of a document have the same ID. "bs_id": "aa5888287a334b288ea84524e6b38fa4", ##Upload ID "title": "Sichuan Province 2020 Pricing Quota: Professional Name: Building Construction and Decoration Engineering, Chapter Name: AD Masonry Engineering, AD1 Brick Masonry (Code: 010401), AD1.2 Brick Masonry Bored Pile Retaining Wall (Code: 010401002)", ##Document or Excerpt Title "update_time": "2025-11-26 03:42:28", ##upload time "source_time": "2021.4.1", ##Data release time "source_id": "5e7a0f37c4f880c4a755d38a", ##Original data source number "original_classification": "Sichuan Province 2020 Pricing Quotas" ##Original Data Classification }, "vector": ......., ## Vector of data or fragments (default is empty, this field is reserved for restoring semantic retrieval)}.

[0049] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Based on the technical essence of the present invention, any simple modifications, equivalent substitutions, and improvements made to the above embodiments within the spirit and principles of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A hybrid retrieval and ranking algorithm and distributed deployment method for an AI assistant for engineering cost estimation, characterized in that: The application server performs the following steps: S1. Receive user questions, extract the keyword set corresponding to the user questions, and be responsible for determining the user's time intent in asking the questions; S2. Based on the keyword set, call the query server to perform keyword matching and coarse screening to obtain a candidate data set. The candidate data set contains a list of data fragment IDs and their corresponding keyword matching scores. S3. Send the list of data fragment IDs and time intent to the reordering server cluster; The reordering server cluster retrieves data fragments locally based on the list of data fragment IDs, calculates the semantic similarity score between each data fragment and the user's question, and calculates the time similarity score in combination with the time intent. The semantic similarity score and the time similarity score are then weighted and summed to obtain the second ranking criterion; The reordering server cluster returns each data fragment ID and its corresponding second ranking criterion to the application server. S4. Sort the candidate dataset in descending order based on the keyword matching score as the first sorting criterion and the second sorting criterion returned by the resorting server cluster as the second sorting criterion. S5. Call the online large model interface to combine the sorted data with user questions to generate Q&A results and output them externally.

2. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, In step S1, the jieba.analyse word segmentation tool is used to extract a set of keywords, and a whitelist of engineering cost professional terms and a blacklist of invalid word segments are configured; the application server combines regular expression matching and domain rules to parse the user's question text and obtain standardized time intent.

3. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, In step S2, the data is initially screened using keyword matching scoring. The formula for calculating the keyword matching score is as follows: Where, d i For the i-th data segment, S(d) i ) represents the score of the i-th data segment, K is the set of keywords, and k j For a single keyword, |k j | represents the length of the keyword character set, I title (d i ,k j ) is the title matching indicator function, with a value of 1 for a successful match and a value of 0 for a failed match; I content (d i ,k j The function is the text matching indicator function. It takes a value of 1 for a successful match and a value of 0 for a failed match. The candidate data set is filtered out from high to low according to the data fragment score. The query server only returns to the application server a list of data fragment IDs and corresponding keyword matching scores of the top N data fragments with the highest keyword matching scores, as well as the name of the knowledge base set.

4. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, In step S3, the reordering server cluster uses the bge-reranker-base semantic reordering model to calculate the semantic similarity score, with the semantic similarity score ranging from 0 to 1.

5. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, In step S3, the formula for calculating the time similarity score is: Where, d i For the i-th data segment, S time (d i ) represents the time similarity score of the i-th data segment. This represents the absolute difference in months between the user's time intent and the data publication time. The decay coefficient is fixed at 0.15; when the user's question does not have a clear time intention, the time similarity score is not calculated.

6. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, In step S3, the weighted summation is specifically as follows: the weighting coefficient for semantic similarity score is 0.65, and the weighting coefficient for temporal similarity score is 0.35; when there is no temporal similarity score, the weighting coefficient for semantic similarity score is 1; the reordering server cluster uses the weighted summation result as the second sorting criterion for each data segment, and returns it to the application server along with the data segment ID list.

7. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, After querying the Pg database deployed on the server and performing keyword matching calculations, the system returns only the list of data fragment IDs and their corresponding scores for the top N data fragments with the highest keyword matching scores, along with the name of the knowledge base set, to the application server.

8. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, The reordering server cluster deploys the Qdrant vector library and uses a weighted load balancing mechanism to distribute tasks. Based on the list of data fragment IDs transmitted by the application server, it retrieves the corresponding fragment content locally, completes semantic reordering, time similarity calculation and weighted summation, and automatically switches to an available server when a server failure is detected.

9. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, The knowledge base used to support the retrieval and sorting process is divided into a cost knowledge base and a software operation knowledge base. The original data is cut into data fragments of 500 to 750 words. The data fragments are synchronously stored in the Qdrant vector library and the Pg database. Each data fragment has a unique ID, and the servers use this ID to index the fragments and retrieve the content.

10. The hybrid retrieval and sorting algorithm and distributed deployment method for the engineering cost AI assistant according to claim 1, characterized in that, The application server is equipped with an AI platform and Qdrant vector library, which is responsible for task scheduling, time intent judgment, data integration, and online large model interface calls. It uses the online version of the large model as the core text generator.