A semantic retrieval method for building materials based on vector databases

By using a semantic retrieval method for building materials based on a vector database, the problem of material retrieval under multi-source heterogeneous data was solved. It enabled the identification of non-standard names and general terms, improved retrieval accuracy and recall, reduced manual screening costs, and provided effective extended retrieval results when there is no stock or date data.

CN122064791BActive Publication Date: 2026-06-30CHINA CONSTR EIGHTH BUREAU FIRST DIGITAL TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202610491647.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-04-15
Publication Date
2026-06-30
Estimated Expiration
2046-04-15

AI Technical Summary

Technical Problem

Existing building material retrieval systems struggle to handle multi-source heterogeneous data and cannot accurately identify non-standard names, regional customary terms, and material abbreviations entered by users, resulting in incomplete or empty search results. Furthermore, they cannot provide effective extended search results or alternative material recommendations when user search conditions are incomplete, dates are limited, or target materials are out of stock.

Method used

A semantic retrieval method for building materials based on vector databases is adopted. By acquiring building material data, cleaning and standardizing it, establishing synonym mapping and material-product name mapping information, using an embedding model to convert the data into material vectors, and combining natural language query understanding, vector retrieval and keyword retrieval, multiple candidate material sets are generated, fused and reordered, and finally extended search results are provided.

Benefits of technology

It improves the accuracy and recall of building material retrieval, can handle synonym and generic name queries, takes into account semantic matching and exact matching, reduces manual screening costs, and provides effective expanded search results when the results are empty or insufficient, thus improving the system's fault tolerance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064791B_ABST
    Figure CN122064791B_ABST
Patent Text Reader

Abstract

This invention discloses a semantic retrieval method for building materials based on a vector database, belonging to the field of building information management technology. The technical solution includes: acquiring building material data and performing cleaning and standardization processing; extracting material fields and business attribute information; establishing synonym mapping information or material-name mapping information; segmenting and vectorizing the processed building material data and storing it in a vector database; performing query understanding on user natural language queries, completing missing key fields and expanding general terms; expanding the query based on the processed query fields to generate retrieval expressions; performing vector retrieval and keyword retrieval, fusing and re-ranking to obtain the target retrieval results, and performing expanded re-retrieval when the results are empty or insufficient. The beneficial effects of this invention are: improving the retrieval accuracy, recall, and result usability in scenarios involving synonyms, general terms, and material abbreviations of building materials, while reducing the empty result rate and manual screening costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of building information management technology, and in particular to a semantic retrieval method for building materials based on a vector database. Background Technology

[0002] The construction industry uses a wide variety of materials, including steel, pipes, electrical materials, waterproofing materials, decorative materials, and electromechanical equipment. Material management is crucial throughout various stages of a project, from design and procurement to construction and settlement. As construction companies become increasingly information-driven, more and more companies are using material management systems to manage basic material data, purchase prices, supplier information, and inventory status in a unified manner, thereby improving procurement efficiency and reducing project costs.

[0003] Existing building material retrieval methods primarily rely on relational database queries or full-text search technology. Relational database searches typically require users to input accurate material names, specifications, or material codes to return relevant results; while full-text searches can perform keyword matching on text, they still depend on the consistency between the user's input and the literal meaning of the records in the database. When users use industry-specific terms, regional terms, generic expressions, or material abbreviations for their queries, existing systems often struggle to accurately identify and retrieve the target material. For example, the same material may have standard names, aliases, abbreviations, or different descriptions in different projects, regions, or supplier systems, leading to incomplete or even empty search results.

[0004] Furthermore, building material data typically originates from multiple data sources, including purchase orders, supplier directories, technical specifications, price lists, product manuals, and on-site material usage records. This data not only suffers from inconsistent field formats, data redundancy, and inconsistent naming conventions, but also contains a large amount of unstructured text and image information. Existing retrieval solutions have limited capacity to process this type of multi-source heterogeneous data, making it difficult to simultaneously consider semantic relevance, business constraints, and retrieval efficiency. Especially when user queries are incomplete, date-restricted, region-restricted, or the target material is out of stock, traditional retrieval systems often fail to provide effective extended query results or alternative material recommendations, leading to high costs for manual screening and secondary searches.

[0005] Therefore, there is an urgent need for a semantic retrieval method for building materials that can address multi-source heterogeneous data of building materials and support material synonym recognition, general term expansion, material code name mapping, semantic retrieval, candidate fusion ranking, and extended re-retrieval, so as to improve retrieval accuracy, recall capability, and business applicability. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention provides a semantic retrieval method for building materials based on a vector database.

[0007] The technical solution is as follows: 1. A semantic retrieval method for building materials based on a vector database, characterized by comprising the following steps:

[0008] S1. Obtain building material data, clean and standardize it, extract material fields and business attribute information, and establish synonym mapping information or material and product name mapping information.

[0009] S2. Divide the processed building material data into blocks, and use an embedding model to convert the blockped building material data into material vectors. Store the material vectors and their corresponding business attribute information in a vector database.

[0010] S3. Receive a natural language query input by the user, and perform query understanding on the natural language query. The query understanding includes extracting query fields, completing missing key fields, and expanding general terms.

[0011] S4. Based on the query fields after completion and expansion, and combined with synonym mapping information or material and product name mapping information, the natural language query is expanded to generate at least one search expression;

[0012] S5. Based on the search expression, perform vector search and keyword search to obtain the first candidate material set and the second candidate material set, respectively;

[0013] S6. Merge the first candidate material set and the second candidate material set, and reorder them according to the preset sorting rules to obtain the target retrieval result;

[0014] S7. When the target search result is empty or the number of results is lower than a preset threshold, the search expression is expanded and re-searched to output the expanded target search result.

[0015] Preferably, the establishment of synonym mapping information or material-product name mapping information specifically includes:

[0016] Based on the standard material name, establish the correspondence between the standard material name and its alias, abbreviation, industry custom name or regional custom name, and establish the correspondence between material information and candidate material name.

[0017] Preferably, the step of dividing the processed building material data into blocks specifically includes:

[0018] Structured tabular data is divided into blocks by record, and the corresponding header field information is retained in the block content; long text data is initially segmented by paragraph, and when the length of a single paragraph exceeds the preset range, it is further segmented by sentence boundaries. If it still exceeds the preset range, it is truncated to the preset length, and some overlapping content is retained between adjacent blocks; for text content containing key technology descriptions, the block boundaries are determined according to the semantic continuity between adjacent text segments to keep material parameters, usage descriptions or performance characteristics within the same semantic unit in the same block.

[0019] Preferably, the query understanding of the natural language query specifically includes:

[0020] The natural language query is segmented, redundant modifiers are removed, and the format is standardized. At least one of the following fields—material name, specifications, material requirements, usage scenario, region information, and date—is extracted from the standardized query content as the query field.

[0021] When the natural language query is missing a preset key field, the preset key field is automatically completed according to the preset completion rules. When the region information is missing, the default region is obtained from the user's project, the enterprise's default region configuration, or the most recent valid query record for completion. When the date field is missing, the current business date is used as the default date, and if the data corresponding to the current business date does not exist, the date is rolled back to the date with the most recent valid data.

[0022] Preferably, the query understanding of the natural language query further includes:

[0023] When the natural language query contains a general term, a superordinate name, or an incomplete name, the synonym mapping information is invoked to expand the general term, superordinate name, or incomplete name into at least one corresponding specific material name;

[0024] When the natural language query contains material information but not a specific material name, the material-to-name mapping information is invoked to convert the material information into at least one corresponding candidate material name, and the expanded or converted result is written into the query field.

[0025] Preferably, the natural language query is expanded based on the completed and expanded query fields, combined with synonym mapping information or material and product name mapping information, to generate at least one search expression, specifically including:

[0026] Using the material name field after completion and expansion as the core, obtain the standard name, alias, abbreviation, industry custom name or regional custom name corresponding to the material name field, and retain at least one of the specifications, material requirements, usage scenarios, regional information and date fields as constraint fields;

[0027] When there are multiple candidate material names or multiple candidate name expressions, multiple search expressions are generated respectively, and search expressions with the same or repeated semantics are merged.

[0028] Preferably, the step of performing vector retrieval and keyword retrieval based on the retrieval expression to obtain a first candidate material set and a second candidate material set respectively includes:

[0029] The retrieval expression is input into the embedding model corresponding to the building material data vectorization processing stage to obtain a query vector. Based on the query vector, a similarity retrieval is performed in the vector database to obtain a first set of candidate materials that are semantically related to the retrieval expression.

[0030] Simultaneously, using the material name, specification, material, or constraint fields in the search expression as keyword conditions, the original text field or index field of the material is matched and queried to obtain a second set of candidate materials.

[0031] Preferably, the step of merging the first candidate material set and the second candidate material set, and reordering them according to a preset sorting rule, specifically includes:

[0032] The candidate materials in the first candidate material set and the second candidate material set are uniformly identified and matched. Candidate materials with the same unique material identifier, the same standard name, or mapped to the same material master record are merged, and their matching source information from vector retrieval or keyword retrieval is retained.

[0033] Then, based on the query field hit rate, semantic relevance, and business attribute matching, the merged candidate materials are reordered to obtain the target retrieval results.

[0034] Preferably, the step of expanding and re-searching the search expression specifically includes:

[0035] When the target search result is empty or the number of results is less than a preset threshold, and the original search expression contains a date field, the date field is replaced with the date of the most recent valid material data and the search expression is regenerated.

[0036] When the original search expression contains a region field and the number of candidate materials within the region is less than a preset threshold, the region field is expanded to the next higher level region or an adjacent region, and a new search expression is generated. The search is then performed again based on the expanded search expression.

[0037] Preferably, the step of expanding and re-searching the search expression specifically includes:

[0038] When the target search result is empty or the number of results is less than a preset threshold, and the original search expression contains material information, the material and product name mapping information is called to convert the material information into at least one corresponding candidate material name and then the search expression is regenerated.

[0039] When the target material is not found in the target search results, is out of stock, has no supply record, or the number of results is still insufficient, an alternative search expression is generated based on the similarity of the material corresponding to the original search expression in terms of usage description, material, specification range, or usage scenario. The search is then performed again based on the alternative search expression to obtain the expanded target search results.

[0040] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: 1. The present invention can significantly improve the retrieval accuracy in scenarios of querying synonyms and general terms for building materials; by establishing synonym mapping information and material and product name mapping information, and combining general term expansion, missing field completion and query expansion processing in query understanding, non-standard names, regional customary names, industry abbreviations and material codes input by users can be converted into searchable standard expressions, thereby effectively solving the problems of missed detection, incorrect detection and empty results caused by inconsistent material names in the prior art.

[0041] 2. This invention can take into account both semantic matching ability and precise matching ability, thereby improving the completeness of candidate material recall. By dividing and vectorizing building material data and storing it in a vector database, and then combining a dual-path recall mechanism of vector retrieval and keyword retrieval, it can simultaneously cover material records with similar semantics but different expressions, as well as material records with precise matching in name, specifications, and model. Compared with a single retrieval method, this invention can obtain more comprehensive and reliable candidate results in complex building material data environments.

[0042] 3. This invention can improve the business usability of target retrieval results and reduce the cost of manual screening. By merging the first and second candidate material sets and re-sorting them according to the query field hit rate, semantic relevance, and business attribute matching, candidate materials that better meet procurement requirements, inventory conditions, and usage scenarios can be output first. This not only improves the quality of result sorting but also reduces the time spent by users manually verifying and screening multiple candidate results one by one.

[0043] 4. This invention can provide effective extended search results when the results are empty or insufficient, thereby improving the system's fault tolerance. By setting up date backtracking extension, region extension, material mapping extension, and alternative recommendation extension mechanisms, it can still generate extended target search results while maintaining the user's core search intent as much as possible when the original search fails or the recall is insufficient. This method effectively reduces the probability of returning empty results and improves the practical application value of the system in scenarios such as stockouts, strict regional restrictions, and missing date data. Attached Figure Description

[0044] Figure 1 The above is an overall flowchart of a semantic retrieval method for building materials based on a vector database, provided in Embodiment 1 of the present invention.

[0045] Figure 2 This is a system architecture diagram of a semantic retrieval system for building materials based on a vector database, provided in Embodiment 3 of the present invention. Detailed Implementation

[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. Of course, the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0047] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0048] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0049] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0050] Example 1

[0051] See Figure 1 This invention provides a semantic retrieval method for building materials based on a vector database, comprising the following steps:

[0052] S1. Obtain building material data, clean and standardize it, extract material fields and business attribute information, and establish synonym mapping information or material and product name mapping information.

[0053] Specifically, the building material data originates from multiple data sources, including historical purchase orders, project bills of materials, supplier product catalogs, contract attachments, material price lists, technical specifications, product specifications, product promotional materials, drawings, and construction site material usage records. For structured data, information such as material name, specifications, material, unit, brand, supplier, unit price, inventory status, project, region, and time is extracted. For unstructured data, product descriptions, usage instructions, technical parameters, and image addresses or file identifiers associated with the materials are extracted. By aggregating data from multiple sources, a raw building material dataset is formed to be processed.

[0054] After obtaining the original building material data, the data undergoes cleaning. Cleaning includes deleting duplicate records, removing blank, invalid, and irrelevant records, removing redundant spaces, line breaks, special symbols, and modifiers without practical search meaning from the name field, standardizing units of measurement, date formats, and numerical formats, and standardizing the delimiters in specifications and models. For data with missing fields or obviously abnormal field content, automatic correction is first performed according to preset rules; records that cannot be automatically corrected are marked as data to be verified to prevent erroneous data from entering subsequent processing steps.

[0055] After data cleaning, the building material data undergoes standardization. The purpose of standardization is to map heterogeneous fields from different data sources into a unified field system, enabling subsequent data segmentation, vectorization, and semantic retrieval based on a unified data structure. Standardized material fields include material name, specifications, material type, usage description, technical parameters, and image address. Standardized business attribute information includes material category, brand, supplier, price range, inventory status, project affiliation, region, data source, creation time, and update time. For fields from different sources but with the same business meaning, preset field mapping rules are used for merging. For example, "Product Name," "Material Name," and "Product Name Description" are unified into "Material Name"; "Model," "Specification," and "Specification Description" are unified into "Specification Model"; and "Scope of Application," "Application Scenarios," and "Usage Instructions" are unified into "Usage Description."

[0056] To address the issue of multiple names for the same material in the construction industry, a synonym mapping system is established. This system records the correspondence between the standard material name and multiple aliases, abbreviations, industry-specific names, and regional customary names. During construction, candidate names are first extracted from historical procurement data, supplier directories, price information tables, technical specifications, and manually maintained thesaurus. Then, based on the standard material name, names with the same semantic meaning or referring to the same material are merged into the same mapping unit. Each mapping unit stores the standard name, corresponding alias, and source identifier. The automatically merged candidate results are confirmed through synonym semantic judgment and manual verification to improve the accuracy of the mapping relationships.

[0057] For example, "rebar" can be used as the standard name, and "ribbed steel bar," "hot-rolled ribbed steel bar," and "HRB400 steel bar" can be grouped into the same mapping unit; "PPR hot water pipe" can be grouped into the same mapping unit as "random copolymer polypropylene pipe" and "PPR pipe"; "UPVC drainage pipe" can be grouped into the same mapping unit as "rigid polyvinyl chloride pipe" and "PVCU drainage pipe." By establishing synonym mapping information, users can still find unified standard material data when they use non-standard names for subsequent searches.

[0058] To handle searches where only material information is entered without directly inputting the material name, a material-to-name mapping system is established. This mapping system records the correspondence between material expressions and candidate material names. During its construction, material fields and corresponding material names are extracted from the enterprise's material master data, historical procurement records, and technical documents. Multiple names corresponding to the same material are merged and organized, and then filtered based on historical transaction frequency and material category to form a material-to-candidate-name association table. For ambiguous material expressions, material category restrictions are added to improve the accuracy of subsequent mapping results.

[0059] For example, when "HRB400" is identified, it can be associated with candidate product names such as rebar and coiled rebar; when "PPR" is identified, it can be associated with candidate product names such as PPR pipes. By establishing a mapping information between materials and product names, the system can convert material expressions into searchable material product name expressions in subsequent query processing, thereby improving retrieval recall capabilities.

[0060] After the above processing, a unified basic material dataset is formed. Each record in this dataset includes standardized material fields, business attribute information, and semantically related mapping information, all managed through a unique identifier. To facilitate subsequent retrieval, the material master record, synonym mapping records, and material-name mapping records can be stored separately and linked using the material's unique identifier or standard name. These technical methods resolve the issues of scattered data sources, inconsistent formats, and inconsistencies in naming of building materials, providing a unified and directly usable data foundation for subsequent data segmentation, vectorized database construction, query understanding, and semantic retrieval.

[0061] S2. Divide the processed building material data into blocks, and use the embedding model to convert the block building material data into material vectors. Store the material vectors and their corresponding business attribute information in the vector database.

[0062] After forming a unified basic material dataset, the data of different types of building materials are divided into blocks. The purpose of block processing is to transform material data of varying lengths and structures into basic units suitable for vectorization, thereby improving the accuracy and efficiency of subsequent vector retrieval while preserving semantic integrity.

[0063] For structured tabular data, a record-by-record block approach is used. Specifically, each record in tables such as price lists, purchase orders, and supplier directories is treated as an independent block, and the corresponding header fields are written into the block's content. This ensures that the block includes contextual information such as material name, specifications, material, brand, unit price, unit, supplier, and expiration date when it enters subsequent vectorization processing. This approach avoids the problem of missing field semantics caused by simply retaining cell content.

[0064] For long text data, a recursive block segmentation approach is used for processing. Specifically, the text content, such as technical specifications, product manuals, usage instructions, and technical parameter descriptions, is initially segmented according to paragraph boundaries. When the length of a single paragraph exceeds a preset range, it is further segmented according to sentence boundaries. If the text after further segmentation is still too long, it is truncated according to a preset length, and some overlapping content is retained between adjacent blocks to reduce semantic breaks caused by boundary segmentation.

[0065] For text content containing descriptions of key technologies, semantic segmentation optimization is further performed based on recursive segmentation. Specifically, a pre-trained language model is used to analyze the semantic continuity between adjacent text segments. When a significant weakening of the semantic connection between adjacent segments is detected, the corresponding position is determined as the segmentation boundary. For content that continuously describes material parameters, applicable scenarios, or performance characteristics within the same semantic unit, it is kept as the same segment to avoid breaking up the originally complete material description.

[0066] For image data, text-based segmentation is no longer used. Instead, each image from material pictures, product photos, and design drawings is treated as an independent processing unit. When an image is too large, it is first resized and compressed in resolution before being sent to the subsequent image feature extraction process. This ensures that images from different sources have a relatively consistent data scale when entering vectorization processing.

[0067] After segmentation, the text-based segmented data is vectorized. Specifically, the text content is first segmented into words, stop words without actual semantic function are removed, and the text expression format is standardized. Then, the processed text is input into a text embedding model adapted to the construction industry corpus to extract semantic vectors that can represent material names, specifications, usage descriptions, and technical features. The obtained vector results are then normalized to facilitate similarity retrieval in the unified vector space.

[0068] For image data, image vectorization processing is performed. Specifically, the image is first resized, pixel normalized, and formatted. Then, the processed image is input into the image embedding model to extract image vectors that can represent the appearance, structural, and visual features of the material and drawings. The extracted results are then normalized so that the image data can also enter a unified retrieval representation space.

[0069] When the same material contains both textual and image information, the text vector and image vector are fused to generate a unified material vector. Specifically, the text vector and image vector are first assigned preset weights, and then the weighted vectors are combined to form a fused vector that simultaneously represents the material's textual semantic information and image visual information. For material records that contain only textual information or only image information, the corresponding single-type vector is directly used as the retrieval vector for that material.

[0070] After obtaining the material vector, the material vector, along with the corresponding business attribute information, is written into the vector database. To facilitate subsequent retrieval and filtering, each material record is associated with at least the material's unique identifier, original text content or image identifier, vector field, material category, supplier, price range, inventory status, data source, and time information during storage. This allows the vector data and business attribute data to jointly participate in subsequent candidate recall, conditional filtering, and result ranking.

[0071] To improve vector retrieval efficiency, a similarity retrieval index is built for the stored material vectors in the vector database. This index is used to quickly locate the candidate vector that is closest to the query vector within a massive amount of material vectors, thereby shortening retrieval response time and ensuring high retrieval efficiency and scalability even as the scale of building material data continues to grow.

[0072] Through the above processing, building material data is converted into a searchable vectorized representation and stored together with business attribute information in a vector database. This not only preserves the semantic relationships between building material names, specifications, uses, parameters, and images, but also provides a unified data foundation for subsequent vector matching, hybrid retrieval, and result ranking in natural language queries.

[0073] S3. Receive natural language queries input by the user, perform query understanding on the natural language queries, including extracting query fields, completing missing key fields, and expanding general terms;

[0074] After completing the vectorized database of building material data, the system receives natural language queries input by users. Natural language queries can originate from search input boxes, dialog-based interactive windows, or business system API calls, and their content is typically a text description entered by the user based on their needs for procurement, price comparison, alternative selection, or inventory matching.

[0075] Because user-input queries are often colloquial, incomplete, inconsistently named, or only describe uses without specifying standard product names, query understanding processing is performed on natural language queries. The purpose of query understanding is to convert the original query statement into structured query information that can be directly used by subsequent retrieval modules, thereby reducing the impact of differences in natural language expression on the retrieval results for building materials.

[0076] In this embodiment, the natural language query is first preprocessed. Preprocessing includes word segmentation of the query statement, removal of redundant auxiliary words and modifiers without actual retrieval meaning, standardization of similar punctuation and space formats, and standardized replacement of obvious abbreviations, acronyms, or colloquial expressions, ensuring that the original query content can be stably parsed by the subsequent field recognition model.

[0077] After preprocessing, field extraction is performed on the natural language query. Field extraction is used to identify key information related to building material retrieval in the user query. The extracted query fields include material name, specifications, material requirements, usage scenario, region information, and date fields. For query statements containing multiple constraints, different fields are written into their corresponding field slots to form structured query results.

[0078] For example, when a user enters "waterproof conduit for damp basement environments," the product name field can be extracted as "conduit," the purpose description field as "waterproof," and the usage scenario field as "damp basement environment." As another example, when a user enters "today's PPR water pipe price in Jinan," the product name field can be extracted as "water pipe," the material field as "PPR," the region field as "Jinan," and the date field as "today's date."

[0079] For natural language queries with incomplete fields, further completion of missing key fields is performed. The purpose of completing missing key fields is to avoid subsequent searches being too broad or failing due to users not explicitly entering regions, dates, or other necessary constraints. Therefore, when a key field is identified as missing, preset completion rules are invoked to automatically fill in the missing items.

[0080] Specifically, when region information is missing in the query, the default region is retrieved from the user's project, the enterprise's default region configuration, or the most recent valid query record, and written into the structured query result. When the date field is missing in the query, the current business date is used as the default date; if the data corresponding to the current business date does not exist, the date is rolled back to the date of the most recent valid material data, and the rolled-back date is written into the structured query result as the date field.

[0081] For users who use generic terms, superordinate names, or incomplete names for their searches, further generic expansion processing is performed. The purpose of generic expansion processing is to expand the broad expression entered by the user into one or more specific material names that can be directly involved in the search, thereby expanding the effective recall scope and reducing omissions caused by inaccurate nomenclature.

[0082] Specifically, the system first determines whether there are preset generic terms or incomplete name terms in the query statement. Then, it calls the synonym mapping information and semantic similarity matching results to map these terms to the corresponding set of candidate specific product names. For generic expressions such as "rebar," "pipe," and "conduit," they can be expanded into candidate material names such as rebar, coiled rebar, PPR pipe, UPVC pipe, and electrical conduit. If there are multiple expanded results, the candidate results along with the original generic term field are retained for unified retrieval in subsequent search stages.

[0083] For users who only input a material description without a specific product name, the material-to-product-name mapping information can be used to assist in identification during the query understanding phase. Specifically, if the query is found to contain a material field but lack a product name field, the material-to-product-name mapping information is invoked to convert the material description into one or more candidate product names. The conversion result is then written into the structured query results so that subsequent retrieval processes can use the combination of product name and material information for recall.

[0084] Through the above processing, natural language queries are transformed into structured query information containing material name, specifications, material requirements, usage scenarios, regional information, date fields, and candidate expansion items. This not only improves the semantic correspondence between user input and building material data but also provides a unified and directly usable input foundation for subsequent query expansion, vector retrieval, and keyword retrieval.

[0085] S4. Based on the completed and expanded query fields, combined with synonym mapping information or material and product name mapping information, the natural language query is expanded to generate at least one search expression.

[0086] After extracting query fields, completing missing key fields, and expanding general terms, the structured query results are expanded. The purpose of query expansion is to transform the single expression in the user's original input into multiple candidate expressions suitable for both vector retrieval and keyword retrieval, thereby reducing retrieval omissions caused by inconsistencies between user expression methods and material database record methods.

[0087] In this embodiment, query expansion is based on the query fields after completion and expansion processing. For the identified material name field, synonym mapping information is first retrieved to obtain the standard name, alias, abbreviation, industry customary name, and regional customary name corresponding to the product name. Then, the standard name and each candidate name are written into the expanded term set. For multiple candidate product names obtained by expanding the general term, the expansion results are constructed with each candidate product name as the core, so that the subsequent retrieval process can simultaneously cover standard name retrieval and synonym expression retrieval.

[0088] For queries that only identify the material field but not the material name, the material-to-name mapping information is used for expansion processing. Specifically, the corresponding candidate name is searched in the material-to-name mapping information based on the material field. The candidate name is then combined with the original material field to form multiple expanded query candidates. If the same material corresponds to multiple candidate names, all candidate results are retained. The candidates can be sorted based on material category restrictions or historical matching priorities so that the expanded expressions with higher matching degrees are used preferentially in subsequent retrieval stages.

[0089] For fields such as specifications, usage descriptions, application scenarios, regional information, and date that are explicitly given in the query, the original constraints are not deleted during query expansion. Instead, they are retained as additional restrictions in the expanded results. In other words, during the expansion process, only fields that are prone to ambiguity, such as product name expressions, alias expressions, and material-related product name expressions, are supplemented and expanded. Meanwhile, constraint fields such as region, date, specifications, and usage retain their original semantics. This avoids expanding the recall scope while disrupting the search objectives in the user's input.

[0090] When generating search expressions, the expanded results are organized into at least one search expression that can be directly used in the search. Each search expression contains at least a core product name expression and its associated constraint fields. In cases where there are multiple candidate product names, multiple synonyms, or multiple material mapping results, multiple parallel search expressions are generated and these search expressions are combined into a search expression set. Each search expression can be sent to the subsequent search module separately, or it can be used as a unified query batch to participate in the recall calculation sequentially.

[0091] For example, when a user queries "waterproof pipes for basements," after the aforementioned query understanding, the usage scenario field can be identified as "basement," the purpose description field as "waterproofing," and the collective field as "pipes." During the query expansion stage, "pipes" can be expanded into candidate names such as water supply pipes, drainage pipes, and electrical conduits, and then combined with synonym mapping information to form multiple search expressions. As another example, when a user query only contains "HRB400 Jinan today's price," during the query expansion stage, "HRB400" can be converted into candidate names such as rebar and coiled rebar, and combined with the region and date fields to form multiple search expressions, so that the subsequent search module can perform recall accordingly.

[0092] To improve the usability of the expanded query results, this embodiment also deduplicates and normalizes the generated search expressions. Search expressions generated from different expansion paths but with essentially the same semantics are merged into the same candidate expression; for search expressions with semantic inclusion relationships, the more complete semantic and field-rich expressions are retained, thereby reducing subsequent duplicate searches and invalid recalls.

[0093] Through the above processing, natural language queries are expanded into at least one retrieval expression that can represent the semantics of material names, material correspondences, and business constraints. This not only improves the matching probability between the query statement and the material database records, but also provides unified, explicit, and directly callable input content for subsequent vector retrieval and keyword retrieval.

[0094] S5. Perform vector retrieval and keyword retrieval based on the retrieval expression to obtain the first candidate material set and the second candidate material set, respectively;

[0095] After generating at least one search expression, vector retrieval and keyword retrieval are performed based on the search expression. The purpose of using two types of retrieval methods in parallel is to simultaneously take into account semantic matching ability and exact matching ability, thereby avoiding the problems of insufficient recall or precision that occur when using only a single retrieval method.

[0096] During vector retrieval, each retrieval expression is first input into an embedding model consistent with the database construction stage to obtain the corresponding query vector. The reason for using an embedding model consistent with the material data vectorization stage is to ensure that the query vector and the material vector are in the same semantic representation space, thereby enabling the calculation of the closeness between the query vector and the material vector based on a unified similarity metric.

[0097] After obtaining the query vector, the similarity retrieval index in the vector database is invoked to perform a nearest neighbor search on the stored material vectors. During the retrieval process, the material vectors that are semantically close to the query vector are searched in the vector space, and a preset number of candidate results are output according to the similarity from high to low, so that material records that are semantically similar but not completely consistent can also be recalled.

[0098] In this embodiment, the results obtained by vector retrieval constitute the first candidate material set. Each candidate material in the first candidate material set is associated with at least a unique material identifier, material name, specifications, business attribute information, and similarity information corresponding to the query expression. This set can then be used for fusion processing and result reordering.

[0099] When performing keyword searches, the material name, alias, specification, material type, and other constraint fields in the search expression are used as keyword conditions to match the original text fields and index fields. Keyword searches are more suitable for handling material codes, models, exact names, and phrase-level matching scenarios. Therefore, for search expressions containing explicit specifications, codes, or standard names in user input, the corresponding material records can be quickly located.

[0100] Specifically, first, search criteria are established for the keywords in the search expression. Then, matching queries are performed on the original material text, standard name field, specification and model field, and business attribute field based on the inverted index or full-text index. For search expressions that contain multiple field constraints, joint searches can be performed according to the field combination relationship, so that the returned results not only meet the material name condition, but also additional constraints such as specifications, material, region, or date.

[0101] In this embodiment, the results obtained by keyword retrieval constitute the second candidate material set. Each candidate material in the second candidate material set is associated with at least a unique material identifier, matched field information, original text content, and keyword matching score, which are subsequently used to participate in the fusion processing together with the first candidate material set.

[0102] For multiple search expressions generated from multiple extended paths, vector search and keyword search can be performed separately, and the search results corresponding to each search expression can be aggregated into the first candidate material set and the second candidate material set. For material records that are repeatedly recalled, their matching sources from different search expressions and corresponding scoring information can be retained to comprehensively judge their relevance in the subsequent fusion and re-ranking stages.

[0103] Through the above processing, on the one hand, vector retrieval is used to recall candidate materials with similar semantics but different textual expressions; on the other hand, keyword retrieval is used to recall candidate materials whose names, codes, specifications, or models precisely match. The resulting first and second candidate material sets can cover material records related to user needs from different retrieval perspectives, providing a more complete candidate basis for subsequent fusion processing and reordering.

[0104] S6. Merge the first candidate material set and the second candidate material set, and reorder them according to the preset sorting rules to obtain the target retrieval results;

[0105] After obtaining the first and second candidate material sets, the two types of candidate results are fused. The purpose of the fusion process is to comprehensively utilize the semantic recall capability of vector retrieval and the precise matching capability of keyword retrieval to unify candidate materials from different retrieval paths into a sortable candidate result set, thereby improving the completeness and relevance of building material retrieval results.

[0106] In this embodiment, the fusion process first performs a unified identifier matching on the records in the two candidate material sets. Candidate results with the same unique material identifier, the same standard name, or mapped to the same material master record are determined to be the same candidate material, and their similarity information in the vector retrieval path and their matching score information in the keyword retrieval path are summarized into the same candidate record; for material records that exist only in one of the candidate material sets, they are directly retained in the fused candidate result set.

[0107] After merging the candidate results, the matching source information of each fused candidate material is retained. The matching source information is used to identify whether the candidate material comes from vector retrieval, keyword retrieval, or both types of retrieval paths. It further records the query fields it hits, the original expression it hits, vector similarity information, and keyword matching information, so as to comprehensively judge the degree of relevance between the candidate material and the user query during subsequent re-ranking.

[0108] In this embodiment, the merged candidate result set is reordered. The purpose of the reordering process is to perform secondary screening and priority adjustment on the recalled candidate materials, so that candidate materials that better match the user's query purpose, field constraints, and business needs are ranked higher, thereby improving the quality of result display and user efficiency.

[0109] The preset sorting rules include at least query field matching rules, similarity priority rules, and business attribute matching rules. Query field matching rules determine whether candidate materials simultaneously satisfy query fields such as product name, specifications, material, scenario, region, and date. The more complete the matching fields, the higher the sorting priority of the candidate material. Similarity priority rules compare the semantic similarity between candidate materials and the query expression, prioritizing candidate materials with higher semantic relevance. Business attribute matching rules compare whether candidate materials meet business requirements in terms of inventory status, supplier validity, price range, and data time validity.

[0110] In this embodiment, candidate materials retrieved by both vector retrieval and keyword retrieval are given higher priority than candidate materials retrieved by only a single path. For candidate materials that are semantically related but lack key field matching, their priority is appropriately reduced during sorting; for candidate materials that fully match the material name, specifications, and material requirements, and meet business requirements in terms of inventory status or supplier status, their ranking position is improved.

[0111] To avoid the ranking results being too concentrated in the same material category or the same supplier, this embodiment can also introduce result diversity constraints during the re-ranking process. Specifically, while ensuring high relevance, the top-ranked candidate results are processed by category dispersion or supplier dispersion, so that the returned results can simultaneously include multiple reasonable candidate materials, facilitating users to make alternative selections, price comparisons, or purchasing decisions.

[0112] Candidate materials that do not meet the minimum relevance requirements are filtered during the re-ranking process. Specifically, when a candidate material has too low semantic relevance, or although it is recalled, it clearly conflicts with the key field constraints in the query, the candidate material is removed from the ranking results to reduce irrelevant results from entering the final display list.

[0113] Through the above fusion and reordering processes, the target search results are generated. Each record in the target search results includes at least the material name, specifications, material, brand, supplier, price information, inventory status, and matching information related to the query, thus providing a foundation for subsequent result display, alternative recommendations, and further interaction.

[0114] S7. When the target search result is empty or the number of results is lower than the preset threshold, expand and re-search the search expression to output the expanded target search result.

[0115] After fusion and reordering, the validity of the target search results is determined. The purpose of the validity determination is to identify whether the current search results meet the basic output requirements, thereby avoiding returning empty results to the user directly when there are no results or too few results, and improving the usability and fault tolerance of semantic retrieval for building materials.

[0116] In this embodiment, if no candidate material record exists in the target search results, or if the number of candidate materials in the target search results is lower than a preset threshold, the current search results are determined not to meet the output requirements. The preset threshold can be set according to the business scenario. For example, in a procurement price inquiry scenario, it can be set to return no less than a predetermined number of candidate materials so that users can make horizontal comparisons and alternative selections.

[0117] When the current search results are determined not to meet the output requirements, the original search expression is expanded and re-searched. The purpose of expanded and re-searched is to appropriately broaden or replace the search scope, search conditions, or candidate expressions while preserving the user's core query intent as much as possible, thereby recalling more material records related to the user's needs.

[0118] In this embodiment, the expanded search includes at least date backtracking expansion, region expansion, material mapping expansion, and alternative recommendation expansion. Each expansion method can be used individually or triggered sequentially in a preset order, thereby progressively expanding the search scope based on different query failure reasons.

[0119] For date backtracking extension, when the original query contains a date field and the corresponding material data for that date does not exist, the original date is replaced with the date for which the most recent valid data exists, and the search expression is regenerated based on the replaced date. Date backtracking can handle situations such as holidays, weekends, or when data has not been updated by the target date, avoiding empty search results due to overly restrictive time fields.

[0120] For regional expansion, when the original query includes a region field and a sufficient number of candidate materials are not retrieved within that region, the regional criteria are expanded to the next higher level or adjacent regions. Specifically, the expansion can begin with the county / district where the project is located, then extend to the city / prefecture, and finally to other cities / prefectures within the province, prioritizing results from regions with closer logistics distances or higher historical transaction frequencies.

[0121] For material mapping extension, when the product name expression or combination expression in the original query does not recall enough candidate results, the material-to-product name mapping information is further invoked to replace or supplement other candidate product names corresponding to the material expression. In this way, the originally narrow product name retrieval range can be expanded to related categories under the same material, thereby improving the recall probability.

[0122] For the expansion of alternative recommendation, when the target material is out of stock, has no supply record, or the recall results are significantly insufficient, alternative search expressions are generated based on semantic similarity and business attribute similarity. The alternative search expressions prioritize material names that are similar to the original query in terms of use, material, specification range, or usage scenario, and retain the alternative source identifier in the subsequent output results so that users can identify that the result belongs to the alternative recommendation results.

[0123] After generating the expanded conditions, vector retrieval and keyword retrieval are performed again based on the expanded retrieval expression. The aforementioned fusion and re-ranking processes are then repeated on the candidate results obtained from the re-retrieval. For results that still have multiple expanded sources after the re-retrieval, the corresponding expanded type information can be retained in the output so that the subsequent result display module can distinguish between the original hit results, date-expanded results, region-expanded results, and alternative recommendation results.

[0124] Through the above processing, expanded target search results can be automatically generated when the original search results are empty or too few. This not only reduces the probability of empty results being returned in semantic searches for building materials, but also provides users with available candidate results that are as close as possible to their needs when user input conditions are incomplete, regional restrictions are too strict, date data is missing, or target materials are scarce.

[0125] Example 2 is an embodiment of the present invention, which provides an experiment on semantic retrieval of building materials based on a vector database.

[0126] To verify the practical effectiveness of this invention in searching for synonyms, generic terms, material substitutes, and in scenarios with no results, material master data, purchase orders, supplier directories, technical specifications, and on-site material feedback records generated by a construction company over the past eighteen months were selected as the basic experimental data. After deduplication, cleaning, and standardization, 1264 experimental samples were generated, including various business scenarios such as standard name search, synonym search, generic term search, material substitute search, search with regional constraints, search with date constraints, and out-of-stock substitution search.

[0127] The experiment included seven comparison groups: a traditional exact matching system, a full-text search system, a general vector search system, a general RAG system, the complete solution of this invention, the solution of this invention that removes general terms expansion, and the solution of this invention that removes extended re-searching.

[0128] During the experiment, traditional exact matching systems only searched based on standard material names and specifications; full-text search systems performed keyword matching on the original text fields; general vector search systems only performed text vector recall; general RAG systems adopted a general query understanding and recall process, but did not configure construction industry-specific synonym mapping and material-to-product name mapping; the complete solution of this invention sequentially performs material data cleaning and standardization, synonym mapping construction, material-to-product name mapping construction, structured segmentation and semantic segmentation, material vector database construction, query field extraction, missing field completion, general term expansion, query expansion, dual-path recall of vector retrieval and keyword retrieval, candidate fusion and reordering, as well as date backtracking, regional expansion, material mapping expansion, and alternative recommendation expansion.

[0129] To ensure the authenticity of the test, each type of query consisted of both real historical query statements from purchasing agents and manually constructed perturbation statements. For example, "rebar" was replaced with "ribbed steel bar," "PPR water supply pipe" was replaced with "PPR material water supply pipe," or only "HRB400 Jinan today's price" was entered as a material substitute. Evaluation metrics included synonym query hit rate, generic term query hit rate, material substitute query hit rate, Top 3 accuracy, purchasing matching accuracy, empty result rate, substitute recommendation availability rate, manual review time, and average response latency.

[0130] The hit rate and accuracy were calculated after manually verifying the correct material set. The procurement matching accuracy was determined based on whether a usable procurement material was ultimately matched. The availability of alternative recommendations was jointly confirmed by procurement and technical personnel. The time spent on manual review was recorded as the average time spent per 100 queries, and the average response latency was automatically calculated from the system logs. The following experimental data was generated as a result.

[0131] Table 1 Comparative Experimental Data on Semantic Retrieval of Building Materials

[0132]

[0133] As shown in Table 1, the complete solution of this invention significantly outperforms existing technologies in most key indicators. Furthermore, its advantages are not concentrated in a single indicator but are simultaneously reflected in four aspects: recall capability, ranking accuracy, business usability, and manual review costs. Firstly, in the most typical scenarios of synonym search, generic term search, and material code search in the construction industry, the complete solution of this invention achieved hit rates of 93.7%, 91.4%, and 89.5%, respectively, significantly higher than the 41.8%, 36.9%, and 29.7% of traditional exact matching systems, and also significantly higher than full-text search systems and general vector search systems.

[0134] The results demonstrate that this invention does not rely solely on vector semantic similarity to improve performance. Instead, it employs a collaborative mechanism of "synonym mapping information + material and product name mapping information + general term expansion + query expansion," enabling the system to understand various practical expressions within the construction industry. This allows it to retrieve the correct materials even when the user has not entered a standard name. In particular, regarding the general term query hit rate, the complete solution of this invention achieves 91.4%, while the solution without general term expansion only reaches 63.7%, a significant decrease. This indicates that general term expansion is not an auxiliary optimization but rather one of the key technical means employed by this invention to address the search habits of the construction industry. This directly reflects the industry-specific relevance and inventiveness of this invention compared to general search solutions.

[0135] Secondly, in terms of Top 3 accuracy and procurement matching accuracy, the complete solution of this invention achieves 92.6% and 95.1% respectively, both higher than the 79.1% and 84.3% of the general RAG system. This gap indicates that this invention not only expands the effective candidate range in the recall stage, but also, in the subsequent candidate fusion and re-ranking stage, performs joint ranking by query field hit, semantic relevance, and business attribute matching, so that materials that truly meet procurement needs are ranked higher.

[0136] For the construction industry, search results are not merely about "finding materials that look similar," but rather about supporting procurement orders, inventory substitution, and price comparisons. Therefore, procurement matching accuracy is a more valuable indicator of business performance than simple text similarity. The data in the table demonstrates that this invention has a significant advantage in terms of business feasibility. This advantage stems from linking technical search results with business attributes such as inventory status, supplier validity, and price ranges, rather than relying solely on the output of a general semantic model.

[0137] Furthermore, considering the empty result rate and the availability rate of alternative recommendations, the complete solution of this invention achieves rates of 1.9% and 81.3%, respectively, which are significantly improved compared to the 18.4% and 8.6% of traditional exact matching systems, and also significantly better than the 6.8% and 53.4% ​​of the general RAG system. This result directly proves that the extended re-search mechanism in this invention has practical effects. Further comparison shows that although the solution after removing extended re-search still maintains a high level in synonym hit rate, the empty result rate increases to 5.8%, and the availability rate of alternative recommendations decreases to 44.8%. This indicates that date backtracking extension, region extension, material mapping extension, and alternative recommendation extension together constitute another key advantage of this invention: when a search fails or results are insufficient, the system can automatically relax or transform the search conditions, outputting candidate results closer to the procurement target, thereby significantly reducing the probability of empty returns. In practical engineering scenarios, this mechanism can reduce the number of times procurement personnel repeatedly try keywords, improving the continuity and acceptability of system use.

[0138] Finally, considering the time spent on manual review and the average response latency, although the complete solution of this invention has a higher response latency than the traditional exact matching system, its average response time of 357 milliseconds is still within the acceptable range for engineering systems. Furthermore, the time spent on manual review has decreased to 18.6 minutes per 100 queries, far lower than the 71.4 minutes of the traditional exact matching system and the 58.9 minutes of the full-text search system. This indicates that the increased computational overhead achieved by this invention through front-end query understanding, mid-stage hybrid retrieval, and back-end extended re-retrieval is at the cost of significantly reducing manual screening time, resulting in a significant improvement in overall system usability.

[0139] Based on the comprehensive experimental results, the beneficial effects of this invention compared to existing technologies are mainly reflected in the following aspects: First, it significantly improves the hit rate in scenarios involving synonyms, general terms, and material substitutes for building materials; second, it significantly improves the accuracy of procurement matching and the quality of result ranking; third, it significantly reduces the rate of empty results and improves the practical usability of alternative recommendations; and fourth, it effectively reduces the cost of manual review while maintaining an acceptable response speed. This demonstrates that this invention is not a simple superposition of existing exact matching, full-text search, or general vector search technologies, but rather a dedicated semantic search solution with practical application, addressing the technical problems of complex material naming, diverse query expressions, and long procurement decision-making chains in the construction industry.

[0140] Example 3 is an embodiment of the present invention, proposing a semantic retrieval system for building materials based on a vector database. The system is used to implement the semantic retrieval method for building materials based on a vector database in Example 1. The system includes, from bottom to top, a data source layer, a data processing layer, a vector database layer, a retrieval service layer, and an application layer. The layers work together through data transmission and calling relationships to complete the acquisition, processing, database construction, retrieval, sorting, and result output of building material data.

[0141] The data source layer provides the original sources of building material data. Specifically, it connects to multiple business data sources, including purchase order data, project bill of materials data, supplier product catalog data, historical transaction records, technical specifications, product specifications, product promotional materials, drawings, and construction site material usage records. The data source layer can provide both structured and unstructured text and image data, thus providing the raw data foundation for subsequent semantic retrieval of building materials.

[0142] The data processing layer is used to clean, standardize, segment, vectorize, and map raw building material data. Specifically, the data processing layer includes a data cleaning unit, a standardization unit, a segmentation unit, a vectorization unit, and a synonym processing unit. The data cleaning unit deletes duplicate records, removes blank, invalid, and abnormal records unrelated to building materials, and removes redundant spaces, line breaks, special symbols, and decorative expressions without actual retrieval meaning from name fields. The standardization unit unifies units of measurement, date formats, and numerical formats, and merges fields from different sources but with the same business meaning into a unified field system. The segmentation unit segments structured tabular data by record, recursively segments long text data by paragraphs and sentences, and determines segmentation boundaries for key technical description text based on semantic continuity. The vectorization unit converts the segmented text and image data into corresponding vector representations; when the same material has both text and image information, the vectorization unit fuses the text vector and image vector to generate a unified material vector. The synonym processing unit is used to establish synonym mapping information and material-product name mapping information to support subsequent query understanding, general term expansion and material mapping processing.

[0143] The vector database layer stores material vectors and their corresponding business attribute information, and provides similarity retrieval capabilities. Specifically, the vector database layer includes a vector storage engine, an index management unit, and a data persistence unit. The vector storage engine stores material vectors, unique material identifiers, original text content or image identifiers, and associated business attribute information. Business attribute information includes at least one of the following: material category, supplier, price range, inventory status, data source, and time information. The index management unit builds a similarity retrieval index for the stored material vectors to quickly locate candidate material vectors that are close to the query vector in subsequent retrieval stages. The data persistence unit persistently saves the vector data and its associated business attribute data, and supports data backup, recovery, or version management to ensure data security and the stability of subsequent calls.

[0144] The retrieval service layer receives user queries and performs query understanding, vector retrieval, hybrid retrieval, reordering, and no-result processing; it is the core processing layer of the system. Specifically, the retrieval service layer includes a query understanding unit, a vector retrieval unit, a hybrid retrieval unit, a reordering unit, and a no-result processing unit. The query understanding unit preprocesses the user-input natural language query, extracts fields, completes missing key fields, and performs general term expansion. When the query contains material information but lacks a specific material name, it calls the material-to-name mapping information to convert the material expression into candidate material names. The vector retrieval unit converts the retrieval expression into a query vector and performs a similarity search in the vector database layer based on the query vector to obtain the first candidate material set. The hybrid retrieval unit performs vector retrieval and keyword retrieval based on the retrieval expression to obtain the first and second candidate material sets. The reordering unit performs unified identifier matching and merging on the candidate materials in the two candidate material sets, and reorders them according to query field hit rate, semantic relevance, and business attribute matching to obtain the target retrieval results. The no-results processing unit is used to perform date backtracking expansion, region expansion, material mapping expansion, or alternative recommendation expansion on the search expression when the target search result is empty or the number of results is less than a preset threshold. Based on the expanded search expression, the vector search unit and the hybrid search unit are called again to perform the search.

[0145] The application layer receives external query requests and outputs search results. Specifically, the application layer includes a web application, a mobile application, an API gateway, a result rendering unit, and an export function unit. The web application and mobile application provide users with a natural language query input interface and a result viewing interface. The API gateway provides unified interface access capabilities and forwards requests from the web application, mobile application, or external business systems to the search service layer. The result rendering unit presents the target search results or expanded target search results to the user in a structured format, and can retain the source information of the original hit results, date-extended results, region-extended results, and alternative recommendation results in the output results. The export function unit exports the search results to a preset format file to support subsequent procurement, price comparison, or archiving.

[0146] In this embodiment, the data source layer, data processing layer, vector database layer, retrieval service layer, and application layer work collaboratively in sequence. The data source layer provides multi-source building material data; the data processing layer completes data cleaning, standardization, segmentation, vectorization, and mapping construction; the vector database layer completes material vector storage, index creation, and data persistence; the retrieval service layer completes natural language query understanding, expansion, hybrid recall, reordering, and result-free handling; and the application layer is responsible for receiving query requests and outputting search results. Through the above system structure, effective support can be achieved for querying synonyms, generic terms, material code names, and extended search needs in scenarios with insufficient results for building materials, thereby improving the accuracy, recall capability, and result usability of semantic retrieval for building materials.

[0147] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A semantic retrieval method for building materials based on a vector database, characterized in that, Includes the following steps: S1. Obtain building material data, clean and standardize it, extract material fields and business attribute information, and establish synonym mapping information or material and product name mapping information. Specifically, based on the standard material name, a correspondence is established between the standard material name and its alias, abbreviation, industry custom name, or regional custom name, and a correspondence is established between material information and candidate material name; S2. Divide the processed building material data into blocks, and use an embedding model to convert the blockped building material data into material vectors. Store the material vectors and their corresponding business attribute information in a vector database. S3. Receive a natural language query input by the user, and perform query understanding on the natural language query. The query understanding includes extracting query fields, completing missing key fields, and expanding general terms. The natural language query is segmented, redundant modifiers are removed, and the format is standardized. At least one of the following fields—material name, specifications, material requirements, usage scenario, region information, and date—is extracted from the standardized query content as the query field. When the natural language query is missing a preset key field, the preset key field is automatically completed according to the preset completion rules. When the region information is missing, the default region is obtained from the user's project, the enterprise's default region configuration, or the most recent valid query record for completion. When the date field is missing, the current business date is used as the default date, and if the data corresponding to the current business date does not exist, the date is rolled back to the date with the most recent valid data. When the natural language query contains a general term, a superordinate name, or an incomplete name, the synonym mapping information is invoked to expand the general term, superordinate name, or incomplete name into at least one corresponding specific material name; When the natural language query contains material information but does not contain a specific material name, the material-to-name mapping information is invoked to convert the material information into at least one corresponding candidate material name, and the expanded or converted result is written into the query field. S4. Based on the query fields after completion and expansion, and combined with synonym mapping information or material and product name mapping information, the natural language query is expanded to generate at least one search expression; Among them, the material name field after completion and expansion is the core, and the standard name, alias, abbreviation, industry custom name or regional custom name corresponding to the material name field are obtained, and at least one of the specifications, material requirements, usage scenarios, regional information and date fields is retained as constraint fields; When there are multiple candidate material names or multiple candidate name expressions, multiple search expressions are generated respectively, and search expressions with the same or repeated semantics are merged. S5. Based on the search expression, perform vector search and keyword search to obtain the first candidate material set and the second candidate material set, respectively; S6. Merge the first candidate material set and the second candidate material set, and reorder them according to the preset sorting rules to obtain the target retrieval result; The candidate materials in the first candidate material set and the second candidate material set are uniformly identified and matched. Candidate materials with the same unique material identifier, the same standard name, or mapped to the same material master record are merged, and their matching source information from vector retrieval or keyword retrieval is retained. Then, based on the query field hit rate, semantic relevance, and business attribute matching, the merged candidate materials are reordered to obtain the target retrieval results; S7. When the target search result is empty or the number of results is lower than a preset threshold, the search expression is expanded and re-searched to output the expanded target search result. Specifically, when the target search result is empty or the number of results is less than a preset threshold, and the original search expression contains a date field, the date field is replaced with the date of the most recent valid material data and the search expression is regenerated. When the original search expression contains a region field and the number of candidate materials within the region is less than a preset threshold, the region field is expanded to the next higher level region or an adjacent region, and a new search expression is generated. The search is then performed again based on the expanded search expression. When the target search result is empty or the number of results is less than a preset threshold, and the original search expression contains material information, the material and product name mapping information is called to convert the material information into at least one corresponding candidate material name and then the search expression is regenerated. When the target material is not found in the target search results, is out of stock, has no supply record, or the number of results is still insufficient, an alternative search expression is generated based on the similarity of the material corresponding to the original search expression in terms of usage description, material, specification range, or usage scenario. The search is then performed again based on the alternative search expression to obtain the expanded target search results.

2. The semantic retrieval method for building materials based on a vector database according to claim 1, characterized in that, The process of dividing the processed building material data into blocks specifically includes: Structured tabular data is divided into blocks by record, and the corresponding header field information is retained in the block content; long text data is initially segmented by paragraph, and when the length of a single paragraph exceeds the preset range, it is further segmented by sentence boundaries. If it still exceeds the preset range, it is truncated to the preset length, and some overlapping content is retained between adjacent blocks; for text content containing key technology descriptions, the block boundaries are determined according to the semantic continuity between adjacent text segments to keep material parameters, usage descriptions or performance characteristics within the same semantic unit in the same block.

3. The semantic retrieval method for building materials based on a vector database according to claim 1, characterized in that, The step of performing vector retrieval and keyword retrieval based on the retrieval expression to obtain a first candidate material set and a second candidate material set, specifically includes: The retrieval expression is input into the embedding model corresponding to the building material data vectorization processing stage to obtain a query vector. Based on the query vector, a similarity retrieval is performed in the vector database to obtain a first set of candidate materials that are semantically related to the retrieval expression. Simultaneously, using the material name, specification, material, or constraint fields in the search expression as keyword conditions, the original text field or index field of the material is matched and queried to obtain a second set of candidate materials.

Citation Information

Patent Citations

  • Short-life-cycle commodity searching method and system and storage medium

    CN114429124A

  • Intelligent interaction method and device, medium and electronic equipment

    CN118585629A

  • Building material retrieval method

    CN121501978A