Intelligent part inventory substitution analysis method based on large language model

By combining a large language model with domain knowledge and structured Prompt, the problems of automation and verifiability in component substitution analysis are solved, enabling efficient and accurate component substitution analysis, adapting to complex supply chain environments, and ensuring production stability and cost optimization.

CN121788029APending Publication Date: 2026-04-03KRAUSSMAFFEI MACHINERY ZHEJIANG 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
2025-12-25
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing methods for analyzing component substitution rely on human experience, are highly subjective, struggle to handle complex semantic relationships, and lack a unified knowledge model and traceability mechanism, resulting in inaccurate and inconsistent results that cannot adapt to dynamic supply chain environments.

Method used

By constructing an intelligent substitution analysis method for parts inventory based on a large language model, and employing a hybrid recall strategy and structured Prompt, combined with domain knowledge and rule templates, we can achieve automated and verifiable substitution analysis.

Benefits of technology

It significantly improves the accuracy and efficiency of component substitution analysis, achieves traceability and transparency of results, enhances the system's adaptability in dynamic supply chain environments, and ensures production continuity and cost control.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention provides a part inventory intelligent replacement analysis method based on a large language model, and belongs to the technical field of intelligent manufacturing and enterprise digital supply chain management. The method comprises the steps that demand material data are collected in real time, the semantic similarity between demand materials and stock materials is calculated on the basis of a mixed recall strategy in combination with rule filtering and semantic vector retrieval, and most relevant candidate alternative materials are screened out from stock; and constructing a structured Prompt containing domain knowledge and a rule template, injecting the structured Prompt into a large language model, calling the model to carry out substitutability judgment and risk assessment on the candidate pair list, and generating structured output. According to the method, semantic understanding of a large language model is combined with supply chain domain knowledge, and high accuracy and high interpretability of alternative analysis are realized through structured Prompt and a multi-layer verification mechanism.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of intelligent manufacturing and enterprise digital supply chain management technology, specifically involving a component inventory intelligent substitution analysis method based on a large language model. Background Technology

[0002] In modern manufacturing and large-scale equipment support systems, spare parts inventory management is a crucial link in ensuring production continuity and the stable operation of maintenance systems. With the continuous improvement of enterprise informatization, companies typically accumulate vast amounts of material data, including demand materials, inventory materials, and master data. However, in situations of supply chain fluctuations, supplier shutdowns, or sudden emergencies, quickly and accurately identifying replaceable spare parts from existing inventory becomes a critical issue for enterprise operational efficiency and cost control. Existing spare parts substitution analysis mainly relies on manual comparison, rule-based screening, or simple keyword matching methods. These traditional solutions have significant shortcomings: First, manual analysis relies on experienced engineers, which is costly and highly subjective, with significant differences in results between different analysts; second, rule-based or keyword-based substitution judgments often cannot handle complex semantic relationships, and have limited ability to identify cases where material grades, dimensions, and performance parameters differ in description but are semantically similar; third, traditional systems lack a unified knowledge model and traceability mechanism, making it difficult to guarantee the accuracy and consistency of analysis results.

[0003] In recent years, with the rapid development of artificial intelligence and natural language processing technologies, semantic retrieval and large language models have demonstrated powerful capabilities in understanding and generating complex text. However, directly applying general-purpose large language models to the industrial parts sector still faces many challenges. On the one hand, general-purpose models lack domain knowledge and have insufficient understanding of technical terms, technical parameters, and engineering contexts, making them prone to "illusions" or logical errors. On the other hand, enterprise material data formats are complex and fields are diverse, making it impossible for traditional model calling methods to achieve structured interaction and verifiable output.

[0004] Therefore, how to build a structured, controllable, and traceable analysis process between large language models and enterprise-level data systems has become a key challenge in realizing intelligent alternative analysis. Summary of the Invention

[0005] One objective of this application is to provide a method for intelligent substitution analysis of parts inventory based on a large language model, so as to realize the automation, intelligence and verifiability of parts substitution analysis.

[0006] To achieve the above objectives, the first aspect of this application provides: 1. A method for intelligent substitution analysis of parts inventory based on a large language model, comprising the following steps: S1: Collect core data in real time and preprocess the core data to obtain the associated view; the core data includes demand material data, inventory material data and material master data containing complete technical specifications; S2: Based on the associated view, a hybrid recall strategy is adopted to calculate the semantic similarity between the demand material data and the inventory material data, and the candidate alternative materials most relevant to the demand material data are selected from the inventory material data according to the semantic similarity, thereby forming a candidate pair list to be analyzed; S3: Construct a structured prompt containing domain knowledge and rule templates, inject it into the large language model, and then call the large language model to perform alternative determination and risk assessment on the candidate pair list, generating structured output results; S4: Perform format verification, factual consistency verification, and logical self-consistency check on the structured output results, and summarize and output the verified alternative analysis results to form a traceable report.

[0007] Furthermore, the specific implementation steps of step S1 above are as follows: S101: Collect demand material data, inventory material data, and material master data from the enterprise resource database in real time; S102: Associate the three types of data based on the unique material number; S103: Perform standardized filling on missing fields and remove abnormal or duplicate data; S104: Generate related views for subsequent recall and analysis.

[0008] Furthermore, in step S2 above, the hybrid recall strategy sequentially includes hard constraint recall based on rule filtering and vector similarity recall based on semantic retrieval.

[0009] Furthermore, the hard constraint recall includes the following steps: The inventory material data in the associated view is filtered by rules to obtain a candidate set.

[0010] Furthermore, the rules include: Material category consistency constraint is used to ensure that the material category of the candidate inventory material is the same as that of the material required. Inventory availability constraints are used to exclude materials with zero inventory or those in a frozen state. Status exclusion constraints are used to filter out scrapped, discontinued, or expired materials; Key technology field matching constraints are used to compare the complete consistency of key parameter fields.

[0011] Furthermore, the hard constraint recall is implemented based on database field filtering, and a filtering log is recorded after each filtering to achieve traceability.

[0012] Furthermore, the vector similarity recall includes the following steps: S201: Call the pre-trained embedding model to embed and encode the text descriptions in the candidate set and demand material data to obtain the inventory vector and query vector respectively; S202: Calculate the semantic similarity between the inventory vector and the query vector; S203: Based on the semantic similarity score, select the candidate alternative materials that are most similar to the required material data to form a candidate pair list.

[0013] Furthermore, in step S201 above, a pre-trained embedding model is invoked to encode the technical descriptions, specifications, and long text descriptions in the candidate set and the demand material data, respectively, so as to obtain high-dimensional dense vectors that can be compared in the same semantic space.

[0014] Furthermore, in step S202 above, the semantic similarity is calculated using a cosine similarity algorithm to quantify the semantic closeness between the demand material data and the candidate set, and the candidate alternative materials in the candidate set are sorted according to the similarity score.

[0015] Furthermore, the specific implementation process of step S203 above is as follows: Based on a preset threshold, candidate alternative materials with semantic similarity scores higher than the threshold are selected from the candidate set. The semantic similarity scores obtained after screening are sorted from high to low and the top K candidate replacement materials are selected. The top K candidate substitute materials are combined with the required materials to form a candidate pair list of "required materials - candidate substitute materials".

[0016] Furthermore, the threshold can be dynamically adjusted based on historical manual verification data.

[0017] Furthermore, the specific implementation steps of step S3 above are as follows: S301: Construct a structured Prompt containing domain knowledge and rule templates and inject it into the large language model; S302: Call the large language model to perform alternative determination and risk assessment on the candidate pair list to obtain structured output results; S303: Perform structured parsing and temporary storage of the structured output results of the large language model to provide input for subsequent verification.

[0018] Furthermore, in step S301 above, the componentization process of the structured Prompt is as follows: S3-1: Loading domain knowledge and role definitions; S3-2: Perform JSON serialization on the required materials and candidate alternative materials; S3-3: Inject the judgment rule template corresponding to the material category; S3-4: Specify the reasoning path and output format constraints for the thought chain.

[0019] Furthermore, in step S3-1 above, the loaded domain knowledge is domain knowledge prompt words, and the role defined in the large language model is "a supply chain and materials engineering expert with twenty years of experience". Professional terms and judgment dimensions related to component categories are also imported to ensure that the model has the correct engineering context and task boundaries.

[0020] Furthermore, in step S3-2 above, the technical attributes of the required material and the candidate alternative material are serialized into a standard JSON object in the form of key-value pairs; the technical attributes include material grade, size specifications, performance parameters, surface treatment method, supplier information and inventory status; The JSON object is used to reduce the illusion of model output and enable direct parsing in subsequent programs.

[0021] Furthermore, in step S3-3 above, the corresponding judgment logic template is automatically extracted from the rule base according to the major category to which the material belongs, and injected into the structured Prompt in a structured form.

[0022] Furthermore, in steps S3-4 above, the reasoning path of the thought chain is: compare differences → assess impact → determine risk → give conclusion.

[0023] Furthermore, the output format constraint is a JSON Schema; the Schema includes the fields is_substitutable, confidence_score, reasoning, modifications_required, and risk_level, to ensure the structured, consistent, and traceable nature of the output results.

[0024] Furthermore, step S4 includes the following sub-steps: S401: Perform format parsing and JSON Schema validation on the structured output results; S402: Perform fact consistency verification to eliminate model illusion; S403: Perform a logical consistency check to detect contradictions in alternative judgments; S404: Summarize and output the validated structured output results and generate a traceable report.

[0025] Furthermore, in S401 above, a JSON parser is used to perform structured parsing on the structured output result and verify whether it conforms to the predefined JSON Schema.

[0026] Furthermore, when a key field is found to be missing or has a format error during the verification process, the system automatically triggers a retry mechanism and records an exception log to ensure the integrity of the results.

[0027] Furthermore, in S402 above, fact consistency verification is achieved through two levels of checks, namely, identifier consistency checks and parameter tampering checks. .Revise the inspection; The process of the identifier consistency check is as follows: cross-validate the candidate alternative material IDs suggested by the large language model with the candidate alternative material IDs in the candidate pair list. If no match is found, it is determined to be a hallucination and the result is discarded. The parameter tampering check process is as follows: the material parameters referenced by the large language model are compared item by item with the original data in the database. If any field modification is found that is inconsistent with the facts, it is marked as an unreliable result.

[0028] Furthermore, in the above S403, logical consistency verification is performed through a lightweight rule engine.

[0029] The embodiments of this application have the following technical effects: (1) This application provides a component inventory intelligent substitution analysis method based on a large language model. By integrating natural language processing technology and knowledge in the supply chain field, it significantly improves the accuracy and efficiency of component substitution analysis.

[0030] (2) This application achieves a high degree of traceability and transparency in the substitution analysis process. Traditional component substitution analysis is usually based on experience or unstructured rules, which often results in a lack of systematicity, traceability, and verification. However, by introducing a structured Prompt and a multi-level verification mechanism, this invention can not only ensure the logical rationality of the substitution judgment results, but also generate traceable reports to provide data support for subsequent auditing and optimization.

[0031] (3) This application significantly enhances the intelligence and adaptability of the substitution analysis system, enabling it to better cope with complex and dynamic supply chain environments. Traditional substitution analysis methods often only address limited material types and fixed rules, failing to adapt to rapidly changing market demands and supply chain disruptions. However, this invention, through the introduction of a large language model, allows the substitution analysis system to perform rapid and dynamic analysis and decision-making based on real-time collected material data, inventory status, and demand changes. Especially in the face of sudden supply chain crises or urgent needs, this application can quickly generate the most suitable substitute materials through real-time updated data and automated analysis processes, ensuring uninterrupted production and reducing production losses caused by insufficient supply. Detailed Implementation

[0032] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with the embodiments. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.

[0033] In the description of this application, it should be noted that the terms "upper", "lower", "front", "back", "left", "right", "vertical", "inner", "outer", etc., indicating the orientation or positional relationship, are only for the convenience of describing this application 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 of this application.

[0034] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "joining" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0035] Those skilled in the art should understand that the embodiments described below are merely a part of the embodiments of this application, and not all of the embodiments of this application. These partial embodiments are intended to explain the technical principles of this application and are not intended to limit the scope of protection of this application. Based on the embodiments provided in this application, all other embodiments obtained by those skilled in the art without creative effort should still fall within the scope of protection of this application.

[0036] In existing technologies, component substitution analysis often relies on the judgment of experienced human engineers, a process that is cumbersome, highly subjective, and lacks standardized support. Faced with massive amounts of material data and complex technical specifications, manual analysis is not only time-consuming but also prone to omissions or misjudgments, failing to meet the needs of modern enterprises for efficient, accurate, and traceable substitution analysis. Furthermore, while traditional algorithms based on keyword matching or rule filtering reduce human involvement to some extent, they still suffer from limitations such as insufficient understanding of technical semantics, overly rigid rules, inability to handle multi-dimensional parameter differences, and poor interpretability of results. These traditional methods cannot cope with the frequently changing material descriptions and multi-layered semantic relationships in real-world supply chain scenarios, resulting in deficiencies in the accuracy, rationality, and usability of substitution analysis results. Especially in enterprise resource planning and material master data management systems, material descriptions often suffer from non-standardization, missing fields, naming differences, or language mixing, making it difficult for systems relying solely on rule matching to effectively identify semantically equivalent or similar component relationships. The resulting substitution recommendation errors can lead to production delays, inventory backlogs, and even quality risks, severely impacting operational efficiency and supply chain resilience.

[0037] To address the aforementioned technical bottlenecks, the technical solution proposed in this invention achieves groundbreaking innovations in both architecture design and intelligent analysis mechanisms. Through the systematic process design from S1 to S4, this invention establishes a fully automated, intelligent, and verifiable alternative analysis framework. From a data perspective, this invention first introduces the concept of a "core data association view" in step S1. By collecting demand material data, inventory material data, and material master data containing complete technical specifications in real time, and using unique material numbers for automated association and cleaning, data silos are eliminated, ensuring the uniformity and integrity of the analysis foundation. This step not only standardizes and fills in missing fields and removes abnormal data, but also achieves full traceability of data sources and processing through log recording, solving the problems of data inconsistency and unclear sources in traditional systems. Building on this, this invention introduces a "hybrid recall strategy" in step S2. This strategy integrates hard-constraint recall based on rule filtering and vector similarity recall based on semantic retrieval. Hard-constraint recall uses multiple rules, including category consistency, inventory availability, status exclusion, and key technical field matching, to ensure that the initial screening results have engineering feasibility and data validity. The semantic recall stage utilizes a pre-trained embedding model to perform high-dimensional semantic encoding on the material technical descriptions, calculating the vector similarity between the required materials and the inventory materials, thereby accurately capturing potential substitution relationships at the semantic level. This design overcomes the problem of traditional matching algorithms relying solely on literal consistency, enabling the system to understand complex engineering descriptions that are "different expressions but have the same meaning," greatly improving the accuracy and coverage of substitution screening.

[0038] At the intelligent analysis level, this invention proposes a structured Prompt-guided large language model decision-making mechanism through the S3 steps, automating the entire process of alternative analysis from semantic understanding to logical reasoning. Unlike direct invocation of general models, this invention, through the injection of domain knowledge and rule templates into the structured Prompt, enables the model to possess the reasoning capabilities of supply chain and materials engineering experts. During the Prompt construction process, the system loads professional knowledge, role definitions, and corresponding decision logic templates for categories, and guides the model to conduct systematic analysis by specifying a thought chain reasoning path (comparing differences → assessing impact → determining risk → giving conclusions). In particular, this invention serializes the technical attributes of demand materials and candidate materials into standard JSON objects in key-value pairs, including material grade, size specifications, performance parameters, surface treatment methods, supplier information, and inventory status, thereby achieving structured input information and significantly reducing the probability of the model exhibiting "illusions" or generating irrelevant content. Meanwhile, the output is strictly limited to JSON Schema format, including fields such as substitutable, confidence score, reasoning, required modifications, and risk level, ensuring that the model output is structurally clear, logically consistent, and easy for the system to parse. Through this mechanism, this invention achieves intelligent component substitution based on semantic understanding and supported by logical reasoning, filling the gap in existing technologies where closed-loop control is lacking between semantic understanding, reasoning, and output verification.

[0039] At the result verification and output level, step S4 of this invention further demonstrates its excellent engineering usability and system robustness. This step constructs a reliable alternative analysis verification system through a three-layer mechanism of format parsing, factual consistency verification, and logical self-consistency check. Format verification uses JSON Schema to check whether the structure of the output result conforms to preset standards, and automatically triggers retry mechanisms and exception logs when key fields are missing or formatted incorrectly, ensuring output integrity. Factual consistency verification is divided into two levels: identifier consistency check and parameter tampering check. The former compares the candidate material IDs generated by the large language model with the original database records to eliminate false results, while the latter checks the model reference parameters against the original data item by item to prevent incorrect references or fabricated data. Logical self-consistency check uses a lightweight rule engine to perform logical consistency verification on the alternative judgment results, ensuring that there are no contradictions between different conclusion fields. Through this triple verification system, this invention not only effectively eliminates the "illusion" problem common in large language models in engineering applications, but also ensures the comprehensive consistency of the output results at the factual, logical, and structural levels, thereby achieving high reliability and strong traceability of the results. This mechanism has significant innovative significance in current AI-assisted decision-making systems.

[0040] Compared to existing technologies, the key technical problems solved by this invention can be summarized as follows: First, it solves the difficulty in substitution identification caused by inconsistent semantics in material data. Through semantic vector embedding and a hybrid recall mechanism, this invention achieves unified data semantics across languages, formats, and systems, significantly improving the understanding and matching capabilities of complex technical descriptions. Second, it solves the problem of unstable results caused by reliance on human experience in traditional substitution analysis. By introducing a structured Prompt and a large language model reasoning mechanism, the system can perform substitution judgment and risk assessment within a unified logical framework, outputting conclusions with clear reasoning paths and confidence scores, resulting in more objective and consistent results. Third, it solves the problem of existing substitution analysis lacking verifiable and traceable mechanisms. Through multi-level verification and log recording mechanisms, this invention ensures that the entire analysis process is reproducible and auditable, greatly enhancing the reliability and compliance of the system. Fourth, it overcomes the technical limitations of traditional algorithms in adapting to dynamic supply chain environments. This invention supports dynamic threshold adjustment and adaptive optimization of rule templates based on historical verification data, enabling the system to continuously evolve with data accumulation, thus possessing continuous learning and optimization capabilities.

[0041] In summary, this invention achieves a qualitative leap in the field of component inventory substitution analysis by constructing a comprehensive analytical framework integrating semantic understanding, intelligent reasoning, structured verification, and traceable output. This solution not only theoretically fills the gap in existing technologies regarding the combination of language models and industrial knowledge, but also demonstrates superior technical effects in practical applications: significantly improved substitution matching accuracy, drastically reduced manual review time, and a substitution analysis report generation cycle shortened from several days to several minutes. Furthermore, the system output results exhibit high consistency and strong interpretability. Through this innovative method, enterprises can achieve optimal utilization of inventory resources, enhanced supply chain resilience, and significant cost reduction, providing new technical paths and methodological support for the digital and intelligent transformation of the manufacturing industry.

[0042] This application provides a component inventory intelligent substitution analysis method based on a large language model, which includes the following steps: S1: Collect core data in real time and preprocess the core data to obtain the associated view; the core data includes demand material data, inventory material data and material master data containing complete technical specifications; S2: Based on the associated view, a hybrid recall strategy is adopted to calculate the semantic similarity between the demand material data and the inventory material data, and the candidate alternative materials most relevant to the demand material data are selected from the inventory material data according to the semantic similarity, thereby forming a candidate pair list to be analyzed; S3: Construct a structured prompt containing domain knowledge and rule templates, inject it into the large language model, and then call the large language model to perform alternative determination and risk assessment on the candidate pair list, generating structured output results; S4: Perform format verification, factual consistency verification, and logical self-consistency check on the structured output results, and summarize and output the verified alternative analysis results to form a traceable report.

[0043] Specifically, in step S1, the system first collects core data in real time and preprocesses it to form a unified relational view.

[0044] Specifically, the core data includes demand material data, inventory material data, and material master data containing complete technical specifications.

[0045] Specifically, the system extracts three types of data from the enterprise resource database in real time and uses unique material numbers to achieve multi-table association.

[0046] Specifically, the "unique material number" in the enterprise database is used as the connection key to unify the entries in the demand data, inventory ledger and master data table, ensuring that the records of the same material remain consistent across different systems.

[0047] Specifically, during the association process, the system performs field standardization on the collected data, filling in missing fields. For example, when some records lack supplier information or technical description fields, the system automatically extracts supplementary information from historical purchase records or the master data dictionary. For abnormal or duplicate data, the system performs deduplication and removal operations, and generates data cleaning logs for traceability.

[0048] Specifically, after processing, the system generates an associated view containing the required materials, inventory materials, and their master data relationships, which is used in the subsequent recall analysis phase.

[0049] Specifically, this associated view not only retains key attribute fields such as material category, specifications, quantity status, performance indicators, surface treatment method, supplier and technical document path, but also provides a unified input basis for subsequent semantic recall.

[0050] Specifically, in step S2, the system uses a hybrid recall strategy based on the generated associated view to calculate the semantic similarity between the required materials and the inventory materials, and selects the most relevant candidate alternative materials to form a candidate pair list.

[0051] Specifically, the hybrid recall strategy consists of two parts: hard-constraint recall based on rule filtering and vector similarity recall based on semantic retrieval.

[0052] Specifically, the first step is to implement hard constraint recall and filter inventory material data according to rules.

[0053] Specifically, the system has four built-in rule constraints: First, material category consistency constraint, which means that the classification code of candidate inventory materials must be consistent with the demand materials to prevent cross-category incorrect substitution; second, inventory availability constraint, which removes material records with zero inventory, frozen, or reserved inventory; third, status exclusion constraint, which automatically excludes materials marked as scrapped, discontinued, expired, or substandard; and fourth, key technical field matching constraint, which strictly compares key parameters such as thread standards, size specifications, and material grades, requiring complete consistency at the field level.

[0054] Specifically, the above filtering rules are implemented through database field filtering. Each filtering operation records a filtering log, including the filtering conditions, the quantities before and after filtering, and the reason for filtering, to ensure the traceability of the results. After hard constraint filtering, a preliminary candidate set is obtained, which then enters the semantic recall stage.

[0055] Specifically, in the semantic recall stage, the system calls a pre-trained embedding model to encode the technical description text of the demand materials and the candidate set, resulting in a high-dimensional dense vector representation.

[0056] Specifically, the embedding model can be a general text embedding model or an industrial semantic model fine-tuned with domain data to enhance the understanding of technical terms, specifications, and engineering descriptions.

[0057] Specifically, in step S201, the system encodes the technical descriptions, specifications, and long text descriptions in the candidate set and the demand material data respectively, generates inventory vectors and query vectors, and ensures that they are in the same semantic space.

[0058] Specifically, in step S202, the system calculates the semantic similarity between the inventory vector and the query vector, using a cosine similarity algorithm to quantify their semantic closeness. Each material pair corresponds to a similarity score, which measures the semantic fit between the candidate material and the required material.

[0059] Specifically, in step S203, the system then filters out candidate alternative materials with semantic similarity scores higher than the preset threshold, sorts the scores from high to low, and selects the top K items to form a candidate pair list of "demand material - candidate alternative material".

[0060] Specifically, the threshold can be dynamically adjusted based on historical manual validation data. The system continuously records the alternative results of manual validation and the matching accuracy of the model output, and automatically optimizes the threshold to balance recall and accuracy.

[0061] Specifically, in step S3, the system constructs a structured Prompt containing domain knowledge and rule templates and injects it into a large language model. The model is then invoked to perform alternative determination and risk assessment on the candidate pair list, generating structured output results.

[0062] Specifically, the S301 sub-step is executed first to load domain knowledge and role definitions. The large language model is defined as "a supply chain and materials engineering expert with twenty years of experience". Professional terms, judgment dimensions and domain knowledge prompts related to the component categories are imported to give the model the correct engineering context and reasoning boundaries.

[0063] Specifically, step S3-2 is then executed, where the technical attributes of the required material and the candidate alternative material are serialized into a standard JSON object in key-value pairs. The technical attributes include material grade, size specifications, performance parameters, surface treatment method, supplier information, and inventory status, in order to structure the input data and reduce the risk of illusion generation.

[0064] Specifically, in step S3-3, the system automatically extracts the corresponding judgment logic template from the rule base according to the major category to which the material belongs. The template contains alternative judgment rules, risk assessment standards and output constraint structures for each category. For example, for electronic component materials, the template defines electrical performance matching priority, interface compatibility requirements and temperature range evaluation logic; for mechanical parts materials, the focus is on material strength, dimensional tolerance and processing method differences.

[0065] Specifically, all logic templates are injected into the Prompt in a structured form.

[0066] Specifically, in steps S3-4, the reasoning path is specified as "compare differences → assess impact → determine risk → give conclusion," guiding the large language model to generate interpretable output along a deterministic reasoning path. The output format constraints are defined as a JSON Schema, containing the fields: is_substitutable (whether it is substitutable), confidence_score (confidence score), reasoning (reasoning), modifications_required (necessary modification descriptions), and risk_level (risk level). These fields ensure that the output is structured, consistent, and traceable.

[0067] Specifically, in sub-step S302, the large language model receives structured Prompt input and performs substitution determination and risk assessment on each pair of materials in the candidate pair list.

[0068] Specifically, the model assesses the impact of the differences in key technical attributes between the two on functional compatibility, quality risks, and supply feasibility, thereby making a judgment on the feasibility of the alternative.

[0069] Specifically, if the model determines that an alternative is feasible and has low risk, it outputs `is_substitutable` as `true` and gives a high confidence score. If some parameter adjustments or modifications are required, they are detailed in the `modifications_required` field. If the alternative poses potential performance or security risks, the `risk_level` field is marked as high. The structured output generated by the model is temporarily stored in the database, awaiting subsequent verification steps. The entire process records the Prompt content, model version, call time, and output results in the log system to ensure traceability.

[0070] Specifically, in step S4, the structured output results generated by the model are rigorously validated and a report is generated.

[0071] Specifically, the S401 sub-step is executed first. The system uses a JSON parser to parse the output and verify whether it conforms to the predefined JSON Schema. If a critical field is missing or the format is incorrect, the system automatically triggers a retry mechanism, re-invokes the model to generate the output, and logs the exception to ensure the integrity of the result.

[0072] Specifically, in sub-step S402, fact consistency verification is performed to eliminate model illusions. Fact consistency verification consists of two levels: identifier consistency check and parameter tampering check. The former cross-validates by comparing the model-suggested candidate alternative material IDs with the material IDs in the candidate pair list. If an ID generated by the model is found not to exist in the original candidate set, it is judged as an illusion and discarded. The latter checks each material parameter referenced by the model against the original database records. If a field content is found to be inconsistent with the facts, the result is marked as unreliable and excluded from the report generation scope. Through this two-level verification mechanism, the system ensures that every piece of data output by the model is consistent with the original facts, preventing logical forgery or parameter errors.

[0073] Specifically, in substep S403, the system performs a logical consistency check using a lightweight rule engine to verify the logical consistency of alternative judgments. For example, if the model outputs `is_substitutable` as true but `risk_level` is "high", the system will determine a logical contradiction and require a re-evaluation; if the reasoning in the `reasoning` field does not match the changes required in the `modifications_required` field, it will also be marked as a consistency error.

[0074] Specifically, through the verification of the logic engine, the system ensures that the alternative conclusions are consistent and reasonable at the semantic and logical levels.

[0075] Specifically, in the final S404 sub-step, the system summarizes the validated structured output results and generates a traceable report that includes alternative conclusions, confidence distributions, risk assessments, and reasoning explanations.

[0076] Specifically, the report is stored in standardized JSON and visual HTML formats, making it easy to import into the company's internal decision-making system or generate PDF reports for expert review.

[0077] Through the above implementation process, this embodiment realizes an end-to-end intelligent alternative analysis system for parts inventory. At the data layer, the system achieves automatic mapping from the original ERP and MDM systems to semantically related views. At the analysis layer, it deeply integrates rule-based judgment and semantic understanding through a hybrid recall mechanism. At the inference layer, it simulates human expert-level alternative decision-making through structured prompts and large language models. At the verification layer, it ensures the authenticity and logical consistency of the output results through multi-dimensional checks.

[0078] Compared to traditional technologies, this embodiment has the advantage of automatically identifying similar material relationships in complex technical semantic environments and outputting conclusions in a structured and auditable form, greatly improving the automation and reliability of substitution analysis. The system's hybrid recall mechanism resolves the conflict between semantic ambiguity and rule rigidity, enabling the recall process to have both high recall rate and avoid invalid matches; the introduction of structured prompts makes the reasoning process of large language models controllable and the output verifiable; and the multi-layered verification mechanism ensures the rigor and stability of engineering applications.

[0079] The above description is merely a preferred embodiment of this application and is not intended to limit this application in any way. Although this application has disclosed the preferred embodiment as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-mentioned technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. The implementation schemes in the above embodiments can be further combined or replaced. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the content of the technical solution of this application shall still fall within the scope of this application.

Claims

1. A method for intelligent substitution analysis of parts inventory based on a large language model, characterized in that, Includes the following steps: S1: Collect core data in real time and preprocess the core data to obtain the associated view; the core data includes demand material data, inventory material data and material master data containing complete technical specifications; S2: Based on the associated view, a hybrid recall strategy is adopted to calculate the semantic similarity between the demand material data and the inventory material data, and the candidate alternative materials most relevant to the demand material data are selected from the inventory material data according to the semantic similarity, thereby forming a candidate pair list to be analyzed; S3: Construct a structured prompt containing domain knowledge and rule templates, inject it into the large language model, and then call the large language model to perform alternative determination and risk assessment on the candidate pair list, generating structured output results; S4: Perform format verification, factual consistency verification, and logical self-consistency check on the structured output results, and summarize the verified alternative analysis results to form a traceable report.

2. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 1, characterized in that, The specific implementation steps of step S1 above are as follows: S101: Collect demand material data, inventory material data, and material master data from the enterprise resource database in real time; S102: Associate the three types of data based on the unique material number; S103: Perform standardized filling on missing fields and remove abnormal or duplicate data; S104: Generate related views for subsequent recall and analysis.

3. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 1, characterized in that, In step S2 above, the hybrid recall strategy includes hard constraint recall based on rule filtering and vector similarity recall based on semantic retrieval.

4. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 3, characterized in that, The hard constraint recall includes the following steps: The inventory material data in the associated view is filtered by rules to obtain a candidate set.

5. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 4, characterized in that, The rules include: Material category consistency constraint is used to ensure that the material category of the candidate inventory material is the same as that of the material required. Inventory availability constraints are used to exclude materials with zero inventory or those in a frozen state. Status exclusion constraints are used to filter out scrapped, discontinued, or expired materials; Key technology field matching constraints are used to compare the complete consistency of key parameter fields.

6. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 4, characterized in that, The hard constraint recall is implemented based on database field filtering, and a filtering log is recorded after each filtering to achieve traceability.

7. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 4, characterized in that, The vector similarity recall includes the following steps: S201: Call the pre-trained embedding model to embed and encode the text descriptions in the candidate set and demand material data to obtain the inventory vector and query vector respectively; S202: Calculate the semantic similarity between the inventory vector and the query vector; S203: Based on the semantic similarity score, select the candidate alternative materials that are most similar to the required material data to form a candidate pair list.

8. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 7, characterized in that, In step S201 above, a pre-trained embedding model is invoked to encode the technical descriptions, specifications, and long text descriptions in the candidate set and the demand material data, respectively, so as to obtain high-dimensional dense vectors that can be compared in the same semantic space.

9. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 7, characterized in that, In step S202 above, the semantic similarity is calculated using the cosine similarity algorithm to quantify the semantic closeness between the demand material data and the candidate set, and the candidate alternative materials in the candidate set are sorted according to the similarity score.

10. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 7, characterized in that, The specific implementation process of step S203 above is as follows: Based on a preset threshold, candidate alternative materials with semantic similarity scores higher than the threshold are selected from the candidate set. The semantic similarity scores obtained after screening are sorted from high to low and the top K candidate replacement materials are selected. The top K candidate substitute materials are combined with the required materials to form a candidate pair list of "required materials - candidate substitute materials".

11. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 10, characterized in that, The threshold can be dynamically adjusted based on historical manual verification data.

12. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 1, characterized in that, The specific implementation steps of step S3 above are as follows: S301: Construct a structured Prompt containing domain knowledge and rule templates and inject it into the large language model; S302: Call the large language model to perform alternative determination and risk assessment on the candidate pair list to obtain structured output results; S303: Perform structured parsing and temporary storage of the structured output results of the large language model to provide input for subsequent verification.

13. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 12, characterized in that, In step S301 above, the componentization process of the structured Prompt is as follows: S3-1: Loading domain knowledge and role definitions; S3-2: Perform JSON serialization on the required materials and candidate alternative materials; S3-3: Inject the judgment rule template corresponding to the material category; S3-4: Specify the reasoning path and output format constraints for the thought chain.

14. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 13, characterized in that, In step S3-1 above, the loaded domain knowledge is domain knowledge prompt words, and the role of the large language model is defined as "a supply chain and materials engineering expert with twenty years of experience". Professional terms and judgment dimensions related to component categories are imported to ensure that the model has the correct engineering context and task boundaries.

15. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 13, characterized in that, In step S3-2 above, the technical attributes of the required material and the candidate alternative material are serialized into a standard JSON object in the form of key-value pairs; the technical attributes include material grade, size specifications, performance parameters, surface treatment method, supplier information and inventory status; The JSON object is used to reduce the illusion of model output and enable direct parsing in subsequent programs.

16. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 13, characterized in that, In step S3-3 above, the corresponding judgment logic template is automatically extracted from the rule base according to the major category to which the material belongs, and injected into the structured Prompt in a structured form.

17. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 16, characterized in that, In steps S3-4 above, the reasoning path of the thought chain is: compare differences → assess impact → determine risk → give conclusion.

18. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 16, characterized in that, The output format constraint is a JSON Schema; the Schema includes the fields is_substitutable, confidence_score, reasoning, modifications_required, and risk_level, to ensure the structured, consistent, and traceable nature of the output results.

19. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 1, characterized in that, Step S4 includes the following sub-steps: S401: Perform format parsing and JSON Schema validation on the structured output results; S402: Perform fact consistency verification to eliminate model illusion; S403: Perform a logical consistency check to detect contradictions in alternative judgments; S404: Summarize and output verified structured outputs and generate traceable reports.

20. A method for intelligent substitution analysis of parts inventory based on a large language model according to claim 19, characterized in that, In step S401 above, a JSON parser is used to perform structured parsing on the structured output result and verify whether it conforms to the predefined JSON Schema.

21. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 20, characterized in that, When a critical field is found to be missing or has a formatting error during the verification process, the system automatically triggers a retry mechanism and records an exception log to ensure the integrity of the results.

22. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 19, characterized in that, In the above S402, fact consistency verification is achieved through two levels of verification, which include identifier consistency check and parameter tampering check; The process of the identifier consistency check is as follows: cross-validate the candidate alternative material IDs suggested by the large language model with the candidate alternative material IDs in the candidate pair list. If no match is found, it is determined to be a hallucination and the result is discarded. The parameter tampering check process is as follows: the material parameters referenced by the large language model are compared item by item with the original data in the database. If any field modification is found that is inconsistent with the facts, it is marked as an unreliable result.

23. The intelligent substitution analysis method for parts inventory based on a large language model according to claim 19, characterized in that, In the above S403, logical consistency verification is performed through a lightweight rule engine.