Product quality tracing credible report generation method and device, equipment and storage medium
By obtaining information from the product quality traceability platform and external knowledge base, and generating reports in combination with large language models, the problems of low efficiency and error-prone traditional report generation are solved, and the accuracy and credibility of product quality traceability reports are improved.
Patent Information
- Application Number
- CN202411951712.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
AI Technical Summary
Traditional product quality traceability reports are inefficient and error-prone, and lack in-depth analysis and credibility, resulting in low accuracy.
By obtaining the background information of the target product from the product quality traceability platform, obtaining the target text information from the external knowledge base based on this information, determining the model input information, determining the report template based on the model input information, and generating a trusted report on product quality traceability through a large language model.
No need to fill in data manually, reducing the error rate in the report and improving the accuracy and credibility of product quality traceability reports.
Smart Images

Figure CN119887236A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of quality management technology, and in particular, relates to a method, device, equipment and storage medium for generating a product quality traceability credible report. Background Art
[0002] The product quality traceability system can ensure that the product is traceable throughout the entire process from production, circulation to consumption, and is an important part of the national strategy.
[0003] Traditional product quality traceability reports are usually written manually or semi-automatically. In the process of manually writing reports, manual data processing is prone to errors, such as data entry errors, omission of important information, etc. In order to improve the efficiency of report generation, some companies have adopted semi-automatic report generation tools. These tools are usually based on templates. Workers only need to fill in the corresponding data into the template to generate a report. However, when manually filling in data based on the template, data entry errors may also occur, resulting in low accuracy of the generated product quality traceability report.
[0004] Therefore, how to improve the accuracy of product quality traceability reports has become an urgent problem to be solved. Summary of the invention
[0005] The present application provides a method, device, equipment and storage medium for generating a reliable product quality traceability report, aiming to improve the accuracy of the product quality traceability report.
[0006] In a first aspect, an embodiment of the present application provides a method for generating a product quality traceability credible report, the method comprising: obtaining background information of a target product from a product quality traceability platform, the background information comprising product information and traceability information of the target product; obtaining target text information from an external knowledge base based on the background information, the external knowledge base comprising official documents related to product quality traceability; determining model input information based on the background information and the target text information; determining a report template based on the model input information; and generating a product quality traceability credible report for the target product through a large language model based on the model input information and the report template.
[0007] In a possible implementation, before acquiring the target text information from the external knowledge base based on the background information, the method further includes: obtaining segmented text by performing text segmentation processing based on the official documents related to product quality traceability; vectorizing the segmented text to obtain a text vector; and constructing the external knowledge base based on the text vector.
[0008] In a possible implementation, the acquiring the target text information from the external knowledge base based on the background information includes: extracting keywords from the background information, the keywords including one or more of product name, product category and standard name; vectorizing the keywords to obtain the keyword vector; and acquiring the target text information from the external knowledge base based on the keyword vector.
[0009] In a possible implementation, the target text information includes a target text vector; and obtaining the target text information from the external knowledge base based on the keyword vector includes: calculating cosine similarity based on the text vector in the external database and the keyword vector; and determining the target text vector from the external knowledge base based on the cosine similarity.
[0010] In a possible implementation, the determining of the model input information based on the background information and the target text information includes: determining the relevance ranking of the target text information through a context sorter based on the target text information; determining related information from the target text information based on the relevance ranking; generating matching text through a conditional text generator based on the related information; and determining the model input information based on the background information and the matching text.
[0011] In a possible implementation, the report template includes traceability results and conclusions, and the generating of a product quality traceability credible report of the target product based on the model input information and the report template through a large language model includes: determining a rational explanation of the product quality traceability credible report based on the model input information, the external knowledge base and the large language model, the rational explanation including an official standard document or link; and matching the rational explanation with the traceability results and conclusions in the report template to generate a product quality traceability credible report of the target product.
[0012] In a possible implementation, after generating the product quality traceability credible report of the target product through the large language model based on the model input information and the report template, the method further includes: obtaining questions to be answered; updating the report template based on the questions to be answered to obtain an updated report template; calling an interface of a meta search engine through the large language model; determining answer information of the questions to be answered based on the large language model and the meta search engine; and updating the product quality traceability credible report of the target product based on the answer information and the updated report template.
[0013] In a second aspect, an embodiment of the present application provides a device for generating a product quality traceability credible report, the device comprising: a first acquisition module, used to acquire background information of a target product from a product quality traceability platform, the background information comprising product information and traceability information of the target product; a second acquisition module, used to acquire target text information from an external knowledge base based on the background information, the external knowledge base comprising official documents related to product quality traceability; an information determination module, used to determine model input information based on the background information and the target text information; a template determination module, used to determine a report template based on the model input information; and a report generation module, used to generate a product quality traceability credible report for the target product through a large language model based on the model input information and the report template.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method described in the first aspect or any one of the implementation methods thereof is implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect or any one of the implementation methods thereof is implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device executes the method described in the first aspect or any one of the implementation methods thereof.
[0017] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the model input information is determined by obtaining background information such as product information and traceability information of the target product from the product quality traceability platform, and the target text information obtained from the external knowledge base based on the background information; the report template is determined based on the model input information; and a product quality traceability credible report is generated based on the model input information and the report template through a large language model. Compared with the prior art in which product quality traceability reports are generated by manual writing or semi-automatic methods, the large language model technology is used to automatically extract and organize product-related information in the product quality traceability platform and the external knowledge base, and a product quality traceability credible report is automatically generated based on product-related information, without the need to manually fill in data, thereby reducing the error rate in the product quality traceability report and improving the accuracy of the product quality traceability report.
[0018] It can be understood that the product quality traceability credible report generation device, electronic device, computer-readable storage medium and computer program product provided in the embodiments of the present application have the same beneficial effects as the above-mentioned product quality traceability credible report generation method, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 A schematic diagram of the architecture of a product quality traceability trusted report generation system provided in one embodiment of the present application;
[0021] Figure 2 A schematic diagram of information processing in a product quality traceability trusted report generation system provided in one embodiment of the present application;
[0022] Figure 3 A flowchart of a method for generating a product quality traceability credible report provided in an embodiment of the present application;
[0023] Figure 4 A structural block diagram of a device for generating a product quality traceability credible report provided in one embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0025] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0026] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0027] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0028] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0029] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0030] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0031] The product quality traceability system can ensure that the product is traceable throughout the entire process from production, circulation to consumption, and is an important part of the national strategy. Traditional product quality traceability reports are usually written manually or generated semi-automatically. Manually writing reports requires a lot of time and human resources, especially when the amount of data is large, it is less efficient, and manual data processing is prone to errors, such as data entry errors, omissions of important information, etc. When product information changes, manual reports are often not updated in a timely manner. In order to improve the efficiency of report generation, some companies have adopted semi-automated report generation tools, which are usually template-based. Staff only need to fill in the corresponding data into the template to generate a report. Although this method is an improvement over manual writing, the following problems still exist:
[0032] 1. Template limitation: The report format and content are limited by the template, which lacks flexibility;
[0033] 2. Limited data processing capabilities: Lack of complex data processing capabilities;
[0034] 3. Lack of in-depth analysis and credibility: The generated reports can only present surface data and lack in-depth and credible data analysis.
[0035] In summary, the existing product quality traceability report generation technology has problems such as low efficiency, prone to errors, lack of in-depth analysis and credibility.
[0036] In order to solve the above technical problems, the present application provides a method for generating a product quality traceability credible report, which obtains background information of a target product from a product quality traceability platform, the background information including product information and traceability information of the target product; obtains target text information from an external knowledge base based on the background information, the external knowledge base including official documents related to product quality traceability; determines model input information based on the background information and target text information; determines a report template based on the model input information; generates a product quality traceability credible report for the target product through a large language model based on the model input information and the report template, thereby improving the accuracy of the product quality traceability report.
[0037] For ease of understanding, the technical solution of the present application will be described in detail below with reference to the accompanying drawings.
[0038] Figure 1 This is a schematic diagram of the architecture of a product quality traceability trustworthy report generation system provided in one embodiment of the present application. Figure 1 As shown, the product quality traceability trusted report generation system 100 includes a background knowledge input module 110 , an external knowledge base enhancement module 120 , a prompt template module 130 , a networking module 140 and a report automatic generation module 150 .
[0039] Specifically, the background knowledge input module 110 is used to input background information such as product information and traceability information of the target product in the product quality traceability platform; the external knowledge base enhancement module 120 includes a keyword extractor, a knowledge retriever, a contextual knowledge sorter and a conditional text generator, wherein the external knowledge base includes official documents such as testing standards and quality and safety traceability, and the external knowledge base enhancement module 120 is used to obtain target text information related to the target product from the external knowledge base; the prompt template module 130 is used to determine the report template based on the background information and target text information of the target product; the report automatic generation module 150 is used to use a large language model, based on the model input information such as the background information and target text information of the target product, and the determined report template, to automatically generate a product quality traceability credible report for the target product; the networking module 140 is used to search the Internet for relevant document descriptions that can prove the feasibility of the product quality traceability credible report based on the content in the previous text of the product quality traceability credible report.
[0040] In the specific implementation, Figure 2As shown, background information such as product information and traceability information of the target product is obtained through the background knowledge input module 110, and the obtained background information is respectively input into the large language model and the external knowledge base enhancement module 120, and then input into the large language model after the keyword extraction, knowledge base search sorting and conditional text generation respectively performed by the keyword extractor, context knowledge sorter and conditional text generator in the external knowledge base enhancement module 120; the prompt template module 130 determines the report template based on the information input into the large language model by the background knowledge input module 110 and the external knowledge base enhancement module 120, and inputs the determined report template into the large language model; the networking module 140 inputs the obtained Internet information related to the target product into the large language model; the large language model automatically generates a product quality traceability credible report based on the relevant information of the target product input by the background knowledge input module 110 and the external knowledge base enhancement module 120, the report template input by the prompt template module 130 and the Internet information related to the target product input by the networking module 140.
[0041] As an example, the large language model includes Chat Generative Pre-trained Transformer (Chat-GPT), Chat Global Language Model (Chat-GLM), Bidirectional Encoder Representations from Transformers (BERT), etc. The technical solution provided in this application is applicable to any large language model, and this application does not limit this.
[0042] Understandably, Figure 1 The schematic diagram of the architecture shown is only an example of the product quality traceability credible report generation system provided by the present application. In other embodiments of the present application, the product quality traceability credible report generation system 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware, and the present application does not limit this.
[0043] Figure 3 The following is a flow chart of a method for generating a product quality traceability credible report provided in an embodiment of the present application. For the sake of convenience, only the part related to the present embodiment is shown. The method provided in the present embodiment includes the following steps:
[0044] S310, obtaining background information of the target product from the product quality traceability platform, where the background information includes product information and traceability information of the target product.
[0045] Specifically, product information includes but is not limited to product name, product category, specification model, production date, product batch number, inspection report and implementation standards; traceability information includes but is not limited to supplier information, manufacturer information, distributor information and consumer information.
[0046] In a specific implementation, the product information and traceability information of the target product are obtained from the product quality traceability platform according to the identification information of the target product as the background information input to the large language model. The identification information of the target product may be the name or number of the target product.
[0047] S320, acquiring target text information from an external knowledge base based on the background information, where the external knowledge base includes official documents related to product quality traceability.
[0048] Specifically, the external knowledge base includes official documents such as testing standards (such as national standards, local standards, industry standards, etc.) and quality and safety traceability, and is stored in the form of vectors; based on the background information of the target product, target text information related to the target product is obtained from the external knowledge base.
[0049] In a specific implementation, before executing step S320, the official documents related to product quality traceability (such as testing standards and quality and safety traceability documents, etc.) are first processed through text segmentation to obtain segmented text, the segmented text is vectorized to obtain text vectors, and then an external knowledge base is constructed based on the text vectors.
[0050] In one possible implementation, keywords are extracted from background information, and the keywords are vectorized to obtain keyword vectors; based on the keyword vectors, target text information is obtained from an external knowledge base, wherein keywords generally refer to product names, product categories, standard names, etc.
[0051] In a specific implementation, the target text information includes a target text vector. By using vector similarity matching, the keyword vector extracted from the background information is compared with the text vector in the external knowledge base, the cosine similarity between each keyword vector and each text vector is calculated, and based on the calculated cosine similarity, the target text vector is determined from the external knowledge base.
[0052] As an example, the text vector corresponding to the cosine similarity exceeding a preset threshold is used as the target text vector.
[0053] As another example, the text vectors in the external knowledge base are sorted from large to small according to the calculated cosine similarity, and the text vectors ranked in the top preset number are used as target text vectors.
[0054] S330, determining model input information based on the background information and the target text information.
[0055] Specifically, the model input information is information obtained based on the background information and target text information of the target product and input into the large language model.
[0056] As an example, a keyword vector obtained from the background information of the target product and a target text vector included in the target text information are directly used as model input information.
[0057] As another example, a keyword vector obtained from the background information of the target product and a target text vector included in the target text information are subjected to data filtering and then used as model input information.
[0058] S340, determining a report template based on the model input information.
[0059] In a specific implementation, the format of the report template is determined based on the specific content in the model input information and the large language model.
[0060] As an example, the report template looks like this:
[0061] (1) Product name: XXX
[0062] (2) Product type: XXX
[0063] (3) Specifications: XXX
[0064] (4) Date of production: XXX
[0065] (5) Product batch number: XXX
[0066] (6) Implementation standard: XXX
[0067] (7) Traceability scope:
[0068] Supplier: XXX;
[0069] Producer: XXX;
[0070] Dealer: XXX;
[0071] Consumer: XXX;
[0072] (8) Traceability results and conclusions: Reasonable explanation of the credible report on product quality traceability, such as official documents and links.
[0073] S350, based on model input information and report template, generates a product quality traceability credible report for the target product through a large language model.
[0074] In the specific implementation, the model input information is filled into the corresponding position in the report template through the large language model to generate a credible product quality traceability report for the target product.
[0075] In a possible implementation, the report template includes traceability results and conclusions. When generating a product quality traceability credible report for a target product, first determine the reasonableness explanation of the product quality traceability credible report based on model input information, external knowledge base, and large language model. The reasonableness explanation includes official standard documents or links, etc. Then, correspond the reasonableness explanation with the traceability results and conclusions in the report template to generate a product quality traceability credible report for the target product.
[0076] As an example, a reasonable explanation of the product quality traceability credible report is given based on the external knowledge base and the networking module.
[0077] The technical solution provided by this application determines the model input information through background information such as product information and traceability information of the target product obtained from the product quality traceability platform, and the target text information obtained from the external knowledge base based on the background information; determines the report template based on the model input information; and then generates a product quality traceability credible report based on the model input information and the report template through a large language model. Compared with the prior art of generating product quality traceability reports by manual writing or semi-automatic methods, the large language model technology is used to automatically extract and organize product-related information in the product quality traceability platform and the external knowledge base, and automatically generate a product quality traceability credible report based on product-related information, without the need to manually fill in data, which reduces the error rate in the product quality traceability report and improves the accuracy of the product quality traceability report.
[0078] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, based on the background information and the target text information, the model input information is determined, including:
[0079] Based on the target text information, determining the relevance ranking of the target text information through a context sorter;
[0080] Determine relevant information from the target text information based on the relevance ranking;
[0081] Based on the associated information, matching text is generated through the conditional text generator;
[0082] Based on the background information and the matching text, the model input information is determined.
[0083] In a specific implementation, the target text information retrieved from the external knowledge base by the knowledge retriever is not all strongly related to the generated content context, but is often noisy; therefore, the target text information is sorted by the context sorter according to the relevance to the context to obtain a relevance ranking of the target text information; based on the relevance ranking, a preset number of target text information ranked high in the context sorter is input as relevance information into the conditional text generator to guide generation, and by providing knowledge sentences and basic context information, rich relevance information is provided to the conditional text generator, helping the large language model to better understand the basic principles between sentences and generate matching text; the background information and matching text are determined as model input information.
[0084] Furthermore, before inputting the model input information into the large language model, the model input information is filtered to ensure that the final model input information has complete semantic information and does not contain other content that interferes with the semantics, thereby providing the large language model with clean and reliable data information for subsequent reasoning processes.
[0085] The technical solution provided in this embodiment processes text information through a context sorter and a conditional text generator to obtain matching text, and then uses the background information of the target product and the matching text as model input information, thereby improving the accuracy of the model input information and further improving the accuracy of the product quality traceability credible report.
[0086] On the basis of the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, after generating a product quality traceability credible report of the target product through a large language model based on model input information and a report template, it also includes:
[0087] Get questions to be answered;
[0088] The report template is updated based on the question to be answered to obtain an updated report template;
[0089] Call the interface of the meta-search engine through a large language model;
[0090] Determine the answer information to the question based on the large language model and meta-search engine;
[0091] Based on the reply information and the updated report template, the product quality traceability credible report of the target product is updated.
[0092] In a specific implementation, a user inputs questions to be answered through a human-computer interaction interface, and the questions to be answered input by the user are added to a report template to obtain an updated report template. The application programming interface (API) of a meta search engine is called through a large language model, and search results for the questions to be answered are obtained based on the meta search engine. The answers to the questions to be answered by the large language model itself are combined to determine answer information for the questions to be answered, and the answer information for the questions to be answered is written into a corresponding position in the updated report template to update a product quality traceability credible report for a target product.
[0093] As an example of this, a searxng meta-search engine is deployed on the server. After obtaining the question to be answered, the big language model calls the API of the searxng meta-search engine, obtains the search results of the question to be answered based on searxng, combines the search results and the big language model's own answer to the question to be answered, and merges them into a complete answer, that is, the response information of the question to be answered, and outputs it to the generated product quality traceability trusted report.
[0094] The technical solution provided in this embodiment can solve the problems related to product quality traceability in real time, and update the product quality traceability credible report thereby, thereby improving the accuracy and flexibility of the product quality traceability credible report.
[0095] In summary, the technical solution provided by this application expands the knowledge of the large language model without additional model training, fully utilizes the generation capability of the large language model, realizes the automatic generation of credible reports for product quality traceability, and can combine scattered information within the traceability system, external knowledge, and relevant information on the Internet. It uses large language model technology to automatically extract and organize information, greatly reducing the error rate in the report and improving the efficiency and accuracy of report generation. At the same time, the generated report is more objective and fair, ensuring that the content of the report is based on actual data and facts, thereby enhancing the credibility and authority of the report. The large language model can extract key information from massive data, and through the analysis capability of the model, it can generate traceability reports containing deep insights, which can significantly improve the quality of the report and provide effective methods and tools for the construction of a national quality and safety traceability system.
[0096] Figure 4 This is a structural block diagram of a device for generating a product quality traceability credible report provided in an embodiment of the present application. For the sake of convenience, only the part related to the embodiment of the present application is shown. Figure 4 The product quality traceability trusted report generating device 400 may include a first acquisition module 401 , a second acquisition module 402 , an information determination module 403 , a template determination module 404 and a report generation module 405 .
[0097] The first acquisition module 401 is used to acquire background information of the target product from the product quality traceability platform, where the background information includes product information and traceability information of the target product.
[0098] The second acquisition module 402 is used to acquire target text information from an external knowledge base based on the background information, and the external knowledge base includes official documents related to product quality traceability.
[0099] The information determination module 403 is used to determine model input information based on the background information and the target text information.
[0100] The template determination module 404 is used to determine a report template based on the model input information.
[0101] The report generation module 405 is used to generate a product quality traceability credible report of the target product based on the model input information and the report template through the large language model.
[0102] A product quality traceability credible report generation device provided in an embodiment of the present application has the same beneficial effects as the above-mentioned product quality traceability credible report generation method.
[0103] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0104] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0105] Figure 5 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 5 of this embodiment includes: at least one processor 50 ( Figure 5Only one is shown in the figure), a memory 51, and a computer program 52 stored in the memory 51 and executable on at least one processor 50, the processor 50 executes the computer program 52 to implement the above Figure 3 The steps in the method embodiment, or the implementation of the above Figure 4 Functions of each module / unit in the device embodiment.
[0106] The electronic device 5 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device 5 may include but is not limited to a processor 50 and a memory 51. Those skilled in the art will appreciate that Figure 5 It is only an example of the electronic device 5 and does not constitute a limitation on the electronic device 5. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0107] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0108] In some embodiments, the memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or memory of the electronic device 5. In other embodiments, the memory 51 may also be an external storage device of the electronic device 5, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 5. Further, the memory 51 may also include both an internal storage unit of the electronic device 5 and an external storage device. The memory 51 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 51 may also be used to temporarily store data that has been output or is to be output.
[0109] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0110] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include at least: any entity or device capable of carrying the computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk.
[0111] A computer-readable storage medium provided in an embodiment of the present application has the same beneficial effects as the above-mentioned method for generating a product quality traceability credible report.
[0112] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0113] A computer program product provided in an embodiment of the present application has the same beneficial effects as the above-mentioned method for generating a product quality traceability credible report.
[0114] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0115] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0116] In the embodiments provided in the present application, it should be understood that the disclosed devices / equipment and methods can be implemented in other ways. For example, the device / equipment embodiments described above are merely schematic, for example, the division of the modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0117] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0118] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for generating a reliable product quality traceability report, characterized in that: The method comprises: Acquire background information of the target product from a product quality traceability platform, wherein the background information includes product information and traceability information of the target product; Acquiring target text information from an external knowledge base based on the background information, wherein the external knowledge base includes official documents related to product quality traceability; Determining model input information based on the background information and the target text information; Determining a report template based on the model input information; Based on the model input information and the report template, a product quality traceability credible report of the target product is generated through a large language model.
2. The method according to claim 1, characterized in that Before acquiring target text information from an external knowledge base based on the background information, the method further includes: Based on the official documents related to product quality traceability, a segmented text is obtained through text segmentation processing; Vectorizing the segmented text to obtain a text vector; Based on the text vector, the external knowledge base is constructed.
3. The method according to claim 2, characterized in that The acquiring target text information from an external knowledge base based on the background information includes: Extracting keywords from the background information, wherein the keywords include one or more of product name, product category and standard name; Vectorizing the keyword to obtain the keyword vector; The target text information is acquired from the external knowledge base based on the keyword vector.
4. The method according to claim 3, characterized in that The target text information includes a target text vector; and obtaining the target text information from the external knowledge base based on the keyword vector includes: Calculating cosine similarity based on the text vector in the external database and the keyword vector; Based on the cosine similarity, the target text vector is determined from the external knowledge base.
5. The method according to claim 1, characterized in that The determining of model input information based on the background information and the target text information includes: Based on the target text information, determining a relevance ranking of the target text information through a context sorter; Determining related information from the target text information based on the relevance ranking; Based on the association information, generating matching text through a conditional text generator; The model input information is determined based on the background information and the matching text.
6. The method according to claim 1, characterized in that The report template includes traceability results and conclusions. Based on the model input information and the report template, a product quality traceability credible report of the target product is generated through a large language model, including: Determine a reasonable explanation of the product quality traceability credible report based on the model input information, the external knowledge base and the large language model, wherein the reasonable explanation includes an official standard document or link; The rationality explanation is matched with the traceability results and conclusions in the report template to generate a product quality traceability credible report for the target product.
7. The method according to claim 1, characterized in that After generating a product quality traceability credible report of the target product through a large language model based on the model input information and the report template, the method further includes: Get questions to be answered; Update the report template based on the question to be answered to obtain an updated report template; Calling the interface of the meta search engine through the large language model; Determining answer information of the question to be answered based on the large language model and the meta search engine; Based on the reply information and the updated report template, the product quality traceability credible report of the target product is updated.
8. A device for generating a reliable product quality traceability report, characterized in that: The device comprises: A first acquisition module is used to acquire background information of a target product from a product quality traceability platform, wherein the background information includes product information and traceability information of the target product; A second acquisition module is used to acquire target text information from an external knowledge base based on the background information, wherein the external knowledge base includes official documents related to product quality traceability; An information determination module, used to determine model input information based on the background information and the target text information; A template determination module, used to determine a report template based on the model input information; A report generation module is used to generate a product quality traceability credible report of the target product based on the model input information and the report template through a large language model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.