Optimization suggestion generation method and device based on MRP structured data, equipment and medium
By integrating MRP structured data and calling the deep search model, standardized prompt words are generated, which solves the problems of low suggestion generation efficiency and information omission in MRP systems when facing customer order changes, and achieves efficient and accurate optimization suggestion generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INSPUR GENERSOFT CO LTD
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-21
AI Technical Summary
When faced with changes in customer order requirements, existing MRP systems are inefficient and prone to errors in generating planning suggestions. The lack of structured data leads to information omissions and suggestions that deviate from actual needs.
By systematically integrating MRP structured data, standardized prompts are generated and a deep search model is invoked to achieve intelligent optimization suggestion generation from data acquisition to decision support.
It improves the efficiency of generating optimization suggestions, ensures the integrity and timeliness of information sets, reduces interference from redundant data, enhances the accuracy of the deep search model in understanding requirements, and provides reusable decision-making basis.
Smart Images

Figure CN121903523A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of material data optimization technology, specifically relating to a method, apparatus, equipment, and medium for generating optimization suggestions based on MRP structured data. Background Technology
[0002] In the daily operations of manufacturing enterprises, changes in customer order requirements have a multi-dimensional impact on the planning of the MRP system (Material Requirements Planning), and have gradually evolved into a core risk of supply chain management. This challenge is intertwined with the inherent limitations of the MRP system, further amplifying the management difficulty.
[0003] The basic logic of the MRP system is: BOM decomposition, collection of available inventory, calculation of net demand using gross demand, and delivery dates based on "unlimited capacity" and lead time, which can basically ensure the rationality of the initial plan calculated by full rearrangement.
[0004] In MRP systems using related technologies, planned orders and dynamic inventory information are stored in different transaction tables with inconsistent field naming and formats. Analysis requires cross-table joins, which can easily lead to the omission of key information and subsequent recommendations deviating from actual needs. Furthermore, the suggestions generated by these technologies are often unstructured text, such as "Material A requires 1000 units, current inventory is 200 units," lacking standardized formatting and clear logical relationships. When using existing models for analysis, the inability to accurately interpret semantics often results in recommendations that deviate from core needs, failing to meet the daily operational requirements of manufacturing enterprises. Storing optimization suggestions in plain text without extracting key information necessitates subsequent statistical analysis relying on full-text search, which is inefficient and prone to errors. Summary of the Invention
[0005] This invention provides a method for generating optimization suggestions based on MRP structured data. By systematically integrating MRP structured data, standardizing AI input processes, and standardizing suggestion storage, it achieves intelligent processing from data acquisition to decision support, thereby improving the efficiency of generating optimization suggestions.
[0006] The methods include: S101: Obtain a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information; S102: Filter material information of interest; S103: Based on the filtered material information, generate prompts containing three parts: the first part is the required quantity and required date information of the material; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions. S104: Combine the three parts output in step S103 into a problem description prompt; S105: Use the generated problem description prompts and the API key of the preset deep exploration model as input parameters, and call the deep exploration model to generate optimization suggestion descriptions corresponding to the prompts; S106: Store the obtained optimization suggestion descriptions in the optimization suggestion report table.
[0007] This application also provides an apparatus for generating optimization suggestions based on MRP structured data, the apparatus comprising: The data collection module is used to acquire a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information. The filtering and identification module is used to filter information about materials of interest. The prompt word generation and integration module generates prompt words containing three parts based on the filtered material information: the first part is the required quantity and required date information of the material; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions. The description combination module is used to combine the three parts of the output into a problem description prompt; The model call optimization module is used to take the generated problem description prompts and the API key of the preset deep search model as input parameters, and call the deep search model to generate optimization suggestion descriptions corresponding to the prompts; The optimized storage settings module is used to store the obtained optimization suggestions descriptions into the optimization suggestion report table.
[0008] According to another embodiment of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the optimization suggestion generation method based on MRP structured data.
[0009] According to another embodiment of this application, a storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the optimization suggestion generation method based on MRP structured data.
[0010] As can be seen from the above technical solutions, the present invention has the following advantages: The optimization suggestion generation method based on MRP structured data provided by this invention obtains planned orders and dynamic inventory information in a structured manner, ensuring the integrity and timeliness of the information set and reducing redundant data interference. It filters materials of interest based on multi-dimensional rules, improving the processing efficiency of subsequent steps. The standardized prompt word generation process solves the problems of chaotic structure and semantic fragmentation in traditional prompt words, improving the accuracy of the deep search model's understanding of needs. By quickly locating optimization directions through field tagging and combining it with the structured storage of historical suggestions, it provides enterprises with reusable decision-making basis, improving the efficiency of optimization suggestion generation. Attached Figure Description
[0011] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram illustrating an embodiment of a method for generating optimization suggestions based on MRP structured data. Figure 2 A flowchart for generating optimization suggestions based on MRP structured data; Figure 3 A schematic diagram of an optimization suggestion generation device based on MRP structured data; Figure 4 This is a schematic diagram of an electronic device. Detailed Implementation
[0013] like Figure 1 As shown, an example diagram of the optimization suggestion generation method based on MRP structured data of the present invention is given. The method can intelligently analyze and process the net change calculation results of MRP after the change of requirements by connecting to a large data analysis model (such as DeepSeek), output optimized collaborative suggestions for various departments, and make up for the system defects of MRP with the help of AI tools, thereby helping enterprises optimize supply chain management.
[0014] The following describes in detail the optimization suggestion generation method based on MRP structured data involved in this application. Specific details such as particular system architectures and technologies are presented for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application can also be implemented in other embodiments without these specific details.
[0015] It should be understood that, when used in this specification, the term "comprising" indicates the presence of the described feature, integral, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.
[0016] The terms "one embodiment" or "some embodiments" used in this application mean that one or more embodiments of this application include the specific features, structures, or characteristics described in that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this application do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Please see Figure 2 The diagram shows a flowchart of an optimization suggestion generation method based on MRP structured data in a specific embodiment. The method includes: S101: Obtain a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information.
[0019] It should be noted that the dynamic inventory information set in this embodiment includes a planned order table and a dynamic inventory table. The planned order table includes attributes such as required material, required date, required quantity, available inventory, net demand, planned production (procurement) date, expected output (delivery) date, planned production (procurement) quantity, and expected output (delivery) quantity. The dynamic inventory table includes attributes such as dynamic inventory type, material, warehouse, quantity, business date, business document number, and key information summary.
[0020] Specifically, a data processing system with a dynamic inventory information set takes the structured data output by MRP and organizes and outputs prompts containing key information.
[0021] MRP output table 1 shows the contents of the <Planned Order>, and its basic data structure information is shown in Table 1.
[0022] Table 1: Basic Information on the Data Structure of <Planned Orders>
[0023] In this embodiment, the MRP output table 2 is <Dynamic Inventory>, and its basic data structure information is shown in Table 2.
[0024] Table 2: Basic Information on the Data Structure of <Dynamic Inventory>
[0025] In some embodiments, planned order information is extracted from the "Planning Management Module" of the MRP system. This information corresponds to the <Planned Order> table in this embodiment, and includes nine attributes: required materials (material list codes and names generated from BOM decomposition), required date (uniform format "YYYY year MM month DD day"), required quantity (original gross required value, rounded to the nearest integer), available inventory (inventory balance on the required date from the <Dynamic Inventory> table), and net demand (calculated as "required quantity - available inventory"). Dynamic inventory information is also extracted from the "Inventory Management Module," corresponding to the <Dynamic Inventory> table in this embodiment. Retrieve seven attributes: dynamic inventory type (including enumerated items such as current inventory, procurement plan, purchase order, and production order), material (consistent with the "required material" code in the planned order table), business date (the planned arrival date corresponds to the procurement plan, and the expected production date corresponds to the production order; empty if there is current inventory), business document number (the plan number corresponds to the procurement plan, and the purchase order number corresponds to the purchase order; empty if there is current inventory), and key information summary (including core information such as the purchaser's name, supplier's abbreviation, and workshop name). During the extraction process, the consistency of the UTF-8 characters of the "material" codes in the two tables must be checked simultaneously to avoid data mismatch caused by coding discrepancies.
[0026] S102: Filter the material information of interest.
[0027] In some embodiments, based on the material data in the <Planned Orders> table and the <Dynamic Inventory> table, relevant data rows of materials of interest are filtered out using screening dimensions. The screening dimensions are determined as follows: First, demand urgency: materials in the Planned Orders table whose "demand date - current system date ≤ 7 days" are filtered. The difference can be automatically calculated using the system's "date comparison tool." Second, inventory warning status: materials in the Dynamic Inventory table whose "current inventory level ≤ safety stock threshold" are filtered. Third, business priority: materials labeled "MTO (Made to Order)" or "ETO (Design to Order)" are filtered. During screening, the Planned Orders table and the Dynamic Inventory table must be linked based on the "material code." Only materials that simultaneously meet at least one screening dimension and exist in both tables are retained, forming a set of information on materials of interest. This set contains the complete planned order attributes and dynamic inventory attributes corresponding to the material.
[0028] In some specific embodiments, step S102 specifically includes the following steps: S1021: Define the filtering rule base for "materials of interest" through the configuration management tool, which includes four dimensions: basic attributes (material code, material type), time attributes (demand date range, planned effective period), quantity attributes (net demand quantity threshold, available inventory lower limit), and related attributes (production order number, procurement project number). Each rule supports logical combinations, and the creation, modification, and effective timestamps of the rules are recorded through the version control module to ensure the traceability of the filtering conditions.
[0029] S1022: Using the target material (initial focus material) as the root node, traverse its associated data in the material relationship database: obtain the direct subordinate materials (raw materials / parts) of the material through the BOM (Bill of Materials) table, obtain the associated work-in-process materials (semi-finished products of the material being processed in the current production order) through the production order table, and obtain the associated upstream materials (delivery records of the raw material suppliers of the material) through the purchase order table; construct the traversal results into a directed graph structure of "material-associated materials", where the graph nodes store basic material information, and the edges store the association relationship type (such as "production consumption" and "purchase dependency") and association strength (such as usage ratio and delivery frequency).
[0030] It should be noted that this step constructs a material relationship graph by traversing the BOM table, production order table, and purchase order table, identifying all related materials that directly or indirectly affect the demand for the target material, and supporting efficient relationship queries.
[0031] S1023: Calculate a priority score for each related material based on three dimensions: production planning stage (trial production / mass production), order type (urgent order / regular order), and inventory status (shortage / sufficiency). The production planning stage accounts for 40% of the weight (trial production stage 0.8, mass production stage 0.5), the order type accounts for 30% (urgent order 0.9, regular order 0.6), and the inventory status accounts for 30% (shortage status 1.0, sufficient status 0.3). The final priority score is the weighted sum of the scores from the three dimensions, and related materials are sorted from highest to lowest score.
[0032] S1024: Obtain financial cost data (such as standard cost and actual cost) for materials from the ERP system, production execution data (such as work-in-process quantity and equipment occupancy rate) from the MES system, and warehouse operation data (such as inbound / outbound records and inventory aging analysis) from the WMS system. Cross-validate these three types of data with the planned order data and dynamic inventory data in the MRP system. For example, check whether the work-in-process quantity in the MES system is consistent with the quantity in the "Production Order Material Plan" in the MRP dynamic inventory table. If the deviation exceeds 10%, mark the material as "to be reviewed" and do not include it in the current screening results.
[0033] As can be seen, this step obtains real-time data from other systems through interface calls and cross-validates it with MRP data. For example, the work-in-process inventory record in the MES system records the amount of materials currently being used on the production line. If the deviation from the quantity in the "Production Order Material Plan" in the MRP dynamic inventory table exceeds 10%, it indicates that the MRP data may not have been updated in a timely manner. In this case, the material is marked as "pending review" to avoid generating optimization suggestions based on erroneous data.
[0034] S1025: During the screening process, each screening condition (such as "requirement date ≥ 2025-09-01"), the path of the association graph traversal (such as "material A → lower-level material B → work-in-process material C"), and the priority calculation parameters (such as weight 0.8 in the trial production stage) are recorded throughout the entire process. The log contains five types of information: operation timestamp, operation module, input data, output results, and anomaly markers (such as missing data and rule conflicts), and is stored in the blockchain distributed ledger to ensure the immutability of the log.
[0035] S103: Based on the filtered material information, generate prompts containing three parts: the first part is the required quantity and date of the material; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions.
[0036] In some embodiments, the information on materials of interest to be screened includes three parts.
[0037] Part 1 combines the data from the planned order table, and the format is strictly as follows: "[Focus on the last 6 digits of the material code + material abbreviation] Required quantity [Required quantity value], Required date [Required date value]".
[0038] For example, “【030405-M20 Screw】Requirement quantity 100, Requirement date June 15, 2025”, the material abbreviation is extracted from the material master data.
[0039] Part 2 requires integrating the data from the <Dynamic Inventory> table according to the dynamic inventory type. For existing inventory, it should be described as "Existing inventory quantity [quantity value]". For procurement plans, it should be described as "There is a procurement plan with the number [business document number], planned procurement quantity [quantity value], planned delivery date [business date], and procurement officer [procurement officer name in the key information summary]". For production orders, it should be described as "There is a production order with the number [business document number], expected output quantity [quantity value], expected output date [business date], and workshop [workshop name in the key information summary]". Irrelevant content (such as "material storage temperature") in the key information summary needs to be filtered out.
[0040] Part 3 is generated based on the inventory types involved in Part 2. If Part 2 contains a purchase order, it is stated as ", What optimization suggestions are there for the purchase order", and if it contains a procurement plan + production order, it is stated as ", What optimization suggestions are there for the procurement plan and production order", ensuring that only the order types involved in Part 2 are mentioned.
[0041] Exemplarily, Part 1 = [Material A] demand quantity 100, demand date May 10, 2025; Part 2 = Existing inventory quantity 20, there is a purchase order numbered 001, planned purchase quantity 20, expected arrival date April 11, 2025, there is a purchase order numbered 002, planned purchase quantity 100, expected arrival date May 11, 2025; Part 3 = What optimization suggestions are there for the purchase order.
[0042] The prompt words generated in this embodiment fit the MRP business scenario. The first part clarifies the core information of material requirements, the second part fully presents the inventory support information, and the third part accurately locks the optimization direction, avoiding interference from irrelevant information in subsequent model calls, ensuring that the AI model can quickly capture the key business logic and improve the pertinence of optimization suggestions.
[0043] S104: Combine the three parts of content output in step S103 into a problem description prompt word.
[0044] In some embodiments, combine them in the fixed order of "Part 1 + Part 2 + Part 3", use "," as the connection symbol when combining, and perform format purification: delete the extra spaces in Part 1 and Part 2 (only keep 1 space between keywords such as "demand quantity" and "demand date" and the values), unify the formats of "demand date" in Part 1 and "business date" in Part 2 (both are "YYYY year MM month DD day", if "2025-06-10" appears in Part 2, it will be automatically converted to "2025 year 06 month 10 day"); after combination, verify the integrity of the prompt word to ensure that it contains "abbreviation of required material + demand quantity + demand date + at least one item of dynamic inventory information + optimization suggestion query", if a certain part is missing (such as Part 2 does not contain any dynamic inventory information), then return to S103 to regenerate.
[0045] The finally generated problem description prompt word conforms to the example format, such as "【030405-M20 screw】demand quantity 100, demand date June 15, 2025, existing inventory quantity 20, there is a purchase order numbered SDFG001, purchase order quantity 80, expected arrival date June 14, 2025, What optimization suggestions are there for the purchase order".
[0046] In some specific embodiments, step S104 specifically includes the following steps: S1041: When the quantity of the concerned materials exceeds the preset threshold, divide them into batches according to the preset priority, with no more than 5 materials in each batch; within the same batch, for materials with the same "business document number", uniformly associate the "business date" and "key information summary" corresponding to this document number, and separate the prompt words of each material with ";", and associate between batches through "batch association code + core business document number set".
[0047] S1042: Configure the deduplication rule for duplicate content containing key information, and scan the "business document number" in the second part of the combined content. If the same number appears repeatedly within the same batch: only retain the complete information of the first occurrence, and simplify the subsequent duplicates to "same number [business document number]"; for different requirements of the same material, sort them in ascending order of the required date, and associate each requirement with the "business document number + business date" combination of the corresponding dynamic inventory to avoid mismatches between requirements and inventory information.
[0048] S1043: Construct a field mapping verification table containing key information, and add "business date mapping item", "business document number mapping item", and "key information summary mapping item" to the table; During verification, compare the above field values output by S103 with the corresponding content in the combined prompt words one by one. If the business document number format does not match or the business date and summary fields are missing, mark "key information mapping exception".
[0049] S1044: Set the rules for special character escape and format retention of key information, and perform escape processing on the special characters contained in the "key information summary"; for the fixed format of the "business document number" and the "YYYY year MM month DD day" format of the "business date", prohibit escaping the "-" and " / year / month / day" characters in them to ensure that the number and date formats can be recognized by the model.
[0050] S1045: Generate a combined process log file containing key information traceability, and add a "key information record item" to the log: record the business document number corresponding to each material, the business date corresponding to each document number, and the original values of the core fields of the key information summary; at the same time, record the verification result of the key information; name the log file as "combined batch number_core document number.log" and store it in the "prompt word - key information log directory" of the MRP system, supporting retrieval of the log by document number.
[0051] In this way, a problem description prompt word with a complete structure and unified format is formed, eliminating the logical discontinuity when the three parts exist independently, ensuring that it can be obtained一次性 when the subsequent model is called, and improving the response accuracy.
[0052] S105: Using the generated problem description prompts and the API key of the preset depth search model as input parameters, call the depth search model to generate optimization suggestion descriptions corresponding to the prompts.
[0053] In some embodiments, the call parameters are configured, including the problem description prompt generated by S104 and the preset deepseek model API key. This key needs to be encrypted and stored in the "key management library" of the MRP system. It is temporarily decrypted by the "key decryption module" during the call and the key in memory is cleared immediately after the call. The call request is encapsulated in JSON format, where the "model" field is fixed as "deepseek-chat", the "temperature" field is set to 0.7, and the "messages" field only contains the "user" role and the problem description prompt. The channel interface is called; after receiving the response, the content in the response that is not related to the MRP business is filtered out, and only the specific optimization suggestions for "procurement plan / purchase order / production order" are retained, such as "It is recommended to advance the arrival date of purchase order number SDFG001 to June 12, 2025 to ensure that the requirements of June 15, 2025 are met."
[0054] In this way, by leveraging the data analysis capabilities of AI models, optimization suggestions can be generated for specific business scenarios in MRP. By encrypting and storing API keys and filtering response content, the security of the calling process and the practicality of the optimization suggestions can be ensured.
[0055] In some embodiments, step S105 specifically includes the following steps: S1051: The preset depth exploration model API key is divided into two parts: a "storage layer key fragment" and a "call layer decryption factor." The storage layer key fragment is encrypted and stored in the MRP system's "dedicated key database." The call layer decryption factor consists of "the last 6 digits of the combined batch number of the current call batch + the first 4 digits of the material code of interest + the last 4 digits of the current system timestamp." During decryption, the storage layer fragment is read through the MRP system's "key decryption module," and combined with the real-time generated decryption factor to form the complete API key. After decryption, the key is only temporarily stored in memory, and the complete key in memory is immediately cleared after the call ends.
[0056] S1052: Configure the MRP-specific request parameter set. In addition to the problem description prompt and the complete API key, add "MRP business association field", "model response format constraint field" and "dynamic parameter adjustment field". All parameters are encapsulated in "JSON format + MRP-specific field prefix".
[0057] In this embodiment, the MRP fields provide the model with a clear business context, avoiding the generation of general suggestions that are detached from the actual business of MRP; parameter adjustment makes the model output adapt to the complexity of prompt words, solving the problem in the prior art where fixed request parameters lead to a mismatch between model output and MRP business.
[0058] S1053: Establish model call channels divided by dynamic inventory type, and divide the call channels into "procurement channel" and "production channel". The two types of channels are configured with different call URL suffixes and retransmission trigger conditions; before the call, the inventory type is identified by the dynamic inventory details generated by S103 and the corresponding channel is matched.
[0059] This embodiment divides the call channels according to business type, which can reduce interference between different business requests; at the same time, it adapts the timeout time and retransmission rules to the characteristics of the business, avoiding premature interruption of procurement requests or invalid waiting of production requests due to uniform timeout settings.
[0060] S1054: Perform preliminary filtering and format validation of the model response data. After the response is returned, first scan the response text using the "Business Document Number Matching Script" to extract content fragments containing the business document number in S104, and filter out generic descriptions that do not mention any document number; then verify whether the response format meets the requirements of "text type + no special symbols".
[0061] As can be seen, this embodiment filters irrelevant content by matching document numbers, ensuring that the response focuses on the specific business of MRP; format verification fixes encoding and symbol problems, avoiding garbled characters or special characters from affecting the subsequent storage and parsing of S106, thus solving the problems of directly using model responses, excessive invalid information, and chaotic formats in the prior art.
[0062] S1055: Generate a temporary cache and status identifier for the call result, store the valid response content in the "temporary response cache area" of the MRP system, and record the status of the call, response time, and associated business document number in the "call status table"; if the call fails, the status identifier is set to "to be retried" and the reason for failure is recorded.
[0063] The temporary cache in this embodiment can avoid repeated calls to the same material within a short period of time, reducing the number of model calls and costs. Adjusting the validity period ensures that the cache can both reduce repeated calls and guarantee data timeliness.
[0064] S106: Store the obtained optimization suggestion descriptions in the optimization suggestion report table.
[0065] In some embodiments, the report is stored based on the <Optimization Suggestion Report> table structure. Before storage, the associated information is supplemented: the "Material" field is filled with the complete code and name of the material of interest, and the "Optimization Suggestion Content" field is filled with the description of the optimization suggestion after filtering in S105.
[0066] Based on the set optimization direction field, first scan the part2 content generated by S103. If it contains "Purchase Plan", initially mark "Whether it involves the optimization of the purchase plan" as "Pending Confirmation". The same applies to "Purchase Order" and "Production Order". Then scan the optimization suggestion description. If it mentions "Purchase Plan Adjustment" and part2 is marked "Pending Confirmation", then officially set it to "Yes". If it is not mentioned, set it to "No". Purchase orders and production orders are processed according to the same logic. After storage, it needs to be archived by "Material Category + Storage Date" and a storage log should be generated. This achieves standardized and traceable management of optimization suggestions, making it convenient for purchasing, production and other departments to quickly query the optimization suggestions and related business documents for the corresponding materials. Partitioned archiving improves the efficiency of subsequent queries.
[0067] In one embodiment of the present invention, based on step S101, the following is a possible embodiment and its specific implementation will be described in a non-limiting manner. Step S101 specifically includes the following steps: S1011: Construct an attribute-data source mapping table. The mapping table records the MRP system storage node, data read path, and data type identifier corresponding to the nine attributes such as required materials and required dates in the planned order table and the seven attributes such as dynamic inventory type and quantity in the dynamic inventory table. Each attribute is bound to a unique storage node and read path.
[0068] This embodiment establishes a mapping table to locate the physical storage location of each target attribute in the MRP system, avoiding the operation of traversing all database tables in the MRP to find the target data, clarifying the data type and verification requirements of each attribute, and solving the problems of redundant data introduction and verification omissions caused by ambiguous data reading paths.
[0069] S1012: Adopts a partitioned data access protocol, configuring the planned order table as the order data access channel and the dynamic inventory table as the dynamic data access channel.
[0070] This embodiment avoids mutual interference between data packets from different tables during transmission by configuring independent channels for the two tables; independent bandwidth and buffer configuration ensure stable data transmission speed, and the retransmission mechanism ensures the integrity of data transmission, which is different from the data confusion, transmission delay and format error data residue problems caused by single-channel transmission in the prior art.
[0071] S1013: Based on S1011, construct an attribute-data source mapping table, perform attribute-level filtering reads on the planned order table, and filter out redundant log fields such as data modification operator ID, historical modification timestamp, and system internal checksum in the MRP system; perform attribute-level filtering reads on the dynamic inventory table; S1014: Verify the attribute data format and verify the consistency of attribute associations for the same material in the planned order table and the dynamic inventory table; For example, the UTF-8 character encoding of "required materials" in the planned order table must be completely matched with the UTF-8 character encoding of "materials" in the dynamic inventory table, and differences in character case or symbol substitution are not allowed.
[0072] S1015: Using the timestamp obtained from the material code as the key field, the target attribute data of the planned order table that has passed the verification in S1014 is linked and integrated with the target attribute data of the dynamic inventory table.
[0073] Material coding adopts the unified 10-digit coding rule of the MRP system. After integration, a "data source identifier" is added to each group of data to generate a structured set of material requirements and dynamic inventory information.
[0074] In step S101, the physical storage location of each attribute is located to shorten the data location time. The partitioned data access protocol configures independent channels for the planned order table and the dynamic inventory table, with independent bandwidth and buffers to improve data transmission speed; attribute-level filtering reads remove redundant log fields, reducing the amount of invalid data and further reducing the load on subsequent data processing.
[0075] From the perspective of data quality and accuracy, clearly defining the data type identifiers for each attribute not only ensures the compliance of single-attribute data formats, but also resolves data inconsistencies by comparing each character bit by bit using UTF-8 character encoding.
[0076] In one embodiment of the present invention, based on step S103, the following is a possible embodiment and its specific implementation is described in a non-limiting manner. Step S103, based on the filtered material information of interest, generates prompts containing three parts, specifically including the following steps: S1031: Construct a mapping table of material-demand attributes and the prompt word format template in Part 1. The mapping table includes the material code, the demand quantity field identifier, the demand date field identifier, and the quantity unit identifier. Each material code is bound to the other three items one by one.
[0077] Optionally, the first part of the format template is fixed as follows: focus on the last 6 digits of the material code + material abbreviation + required quantity value + quantity unit + required date.
[0078] This embodiment uses a mapping table to accurately locate the required quantity and required date fields of the materials in the planned order table. A fixed format template unifies the description of the first part, ensuring uniqueness and facilitating model recognition.
[0079] S1032: Establish a database corresponding to dynamic inventory type information integration template, and configure integration templates according to dynamic inventory type.
[0080] This embodiment designs a dedicated integration template based on dynamic inventory types to ensure a consistent structure for different types of inventory information and avoid information clutter. The "Key Information Summary" whitelist filtering rules remove irrelevant information (such as "Remarks" and "Equipment"), retaining only content valuable for optimization suggestions, reducing redundant prompts, and solving the problems of information piling up in the second part and the model's inability to capture core data in existing technologies. S1033: Define the dynamic adaptation rules for the third part of the optimization suggestion query content. Scan the dynamic inventory details, extract the keywords of the dynamic inventory type, and then generate the corresponding query content based on the extracted keywords. If only the keywords are included, then query content is generated. Add supplementary explanations at the end of the query content.
[0081] This embodiment achieves accurate matching between the query content and the second part of the inventory type through keyword recognition. Combined with priority score ranking, it guides the model to give suggestions for high-priority inventory types first, ensuring the relevance of the optimization suggestions.
[0082] S1034: Perform a three-part correlation check on the prompt words field. The check includes comparing the last 6 digits of the first part, "Material Code of Concern," with the second part, "Material Code," to ensure complete consistency. In Part Two, the "Arrival Date" of the procurement plan / purchase order and the "Output Date" of the production order must be less than or equal to the "Requirement Date" in Part One. If any date exceeds this, it will be marked as "Date Logic Abnormal". The first part, "Demand Quantity," and the second part, "Existing Inventory Quantity / Purchase Quantity / Output Quantity," must be non-negative values. If a negative value exists, it will be marked as "Quantity Logic Abnormal." Only those three parts that pass all validations will proceed to the next step.
[0083] S1035: Generate a complete prompt word with metadata. Based on the valid combination of the three parts, add three types of metadata and finally output a complete prompt word containing metadata prefixes and three core parts.
[0084] Optionally, the three types of metadata include: prompt word version number, data source identifier, and generation timestamp.
[0085] This embodiment adds metadata to enable full lifecycle tracking of prompt words. If an abnormality is found in the optimization suggestion, the original planned order / dynamic inventory data can be located through the generation time and data source to investigate the cause of the problem. This also facilitates the differentiation of different versions of prompt words during subsequent template iterations.
[0086] In one embodiment of the present invention, based on step S106, the following is a possible embodiment and its specific implementation will be described in a non-limiting manner. Step S106 specifically includes the following steps: S1061: Construct the initial structure of the optimization suggestion report table associated with multiple MRP tables. Based on the original report table fields, add associated planned order number, dynamic inventory business document set, and data source identifier.
[0087] During initialization, the required materials are extracted from the S101 planned order table and populated into the material field. The optimization suggestion description obtained from S105 is used to populate the optimization suggestion content field. The three optimization direction fields are set to no by default. New fields are populated one by one according to the above rules to form a complete initialization record.
[0088] This embodiment establishes a direct link with the planned order table and dynamic inventory table by adding multiple table association fields, which facilitates subsequent query optimization and can also quickly locate the corresponding original planning and inventory data, solving the problem of difficulty in tracing the source.
[0089] S1062: Execute the structured breakdown of the optimization suggestions, and break down the optimization suggestion descriptions of S105 into three categories: suggestions related to procurement plans, suggestions related to purchase orders, and suggestions related to production orders. Add a unique identifier before each category of suggestions. When splitting, if the suggestion mentions the business document number of a certain type of order, then the number is bound to the corresponding suggestion. Suggestions that do not mention a specific category are marked as general suggestions, and the content field values of the original optimization suggestion are overwritten after splitting.
[0090] S1063: Establish a two-dimensional keyword matching setting optimization direction field rule. The first dimension scans the dynamic inventory details of S103. If the keyword "purchase plan" is included and the corresponding business document number exists in the split suggestions, then set whether the optimization involves the purchase plan to "yes". If the keyword "purchase order" is included and the corresponding document exists in the suggestions, then set whether the optimization involves the purchase order to "yes". If the suggestion contains keywords related to production orders and there are corresponding documents, then the optimization of production orders is set to yes. The second dimension scans the split suggestions. If a certain type of suggestion includes adjustments, optimizations, changes, etc., even if the first dimension is not triggered, the corresponding field is set to "yes" and the suggested action is marked as triggered.
[0091] S1064: Perform cross-table join logic validation. The validation includes: comparing the adjusted arrival / production date in the optimization suggestion with the demand date in the planned order table; verifying the matching of the number in the dynamic inventory business document set with the number in the dynamic inventory details; and verifying whether the "linked planned order number" is consistent with the order number format in the planned order table. Records that pass all validations proceed to the next step.
[0092] This embodiment performs cross-table verification of the associated MRP core business tables to ensure the logical compliance of the records in the optimization suggestion report table and improve data reliability.
[0093] S1065: Generate report table partitioning and traceability identifiers, and store report table records in partitions according to material category and time; add a traceability code to each record, and store the traceability code bound to the record.
[0094] In this embodiment, records are archived by material category and time. The traceability code enables one-code location, eliminating the need to traverse the entire table. The corresponding record and storage location can be quickly found through the traceability code, improving retrieval efficiency.
[0095] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0096] The following are embodiments of the optimization suggestion generation apparatus based on MRP structured data provided in this disclosure. This apparatus and the optimization suggestion generation method based on MRP structured data in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the optimization suggestion generation apparatus based on MRP structured data, please refer to the embodiments of the optimization suggestion generation method based on MRP structured data described above.
[0097] like Figure 3 As shown, the device includes: Data collection module 201 is used to acquire a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information; The filtering and identification module 202 is used to filter material information of interest; The prompt word generation and integration module 203 is used to filter the material information of interest and generate prompt words containing three parts: the first part is the demand quantity and demand date information of the material of interest; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions. Description module 204 is used to combine the three parts of the output into a problem description prompt; The model call optimization module 205 is used to take the generated problem description prompts and the API key of the preset depth search model as input parameters, and call the depth search model to generate optimization suggestion descriptions corresponding to the prompts; The optimized storage settings module 206 is used to store the obtained optimization suggestion descriptions into the optimization suggestion report table.
[0098] like Figure 4 As shown, this application also provides an electronic device, including a display module 103, a memory 102, a processor 101, and a computer program stored in the memory and executable on the processor 101. When the processor 101 executes the program, it implements the steps of an optimization suggestion generation method based on MRP structured data.
[0099] In embodiments of the present invention, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments described and / or claimed herein.
[0100] In this embodiment, processor 101 may be implemented using at least one of an application-specific integrated circuit, a programmable logic device, a field-programmable gate array, a processor, a controller, a microcontroller, a microprocessor, or an electronic unit designed to perform the functions described herein. In some cases, such an implementation may be implemented within a controller. For software implementation, implementations such as processes or functions may be implemented with separate software modules that allow the performance of at least one function or operation. Software code may be implemented by a software application (or program) written in any suitable programming language, and the software code may be stored in memory and executed by the controller.
[0101] The display module 103 is used to display information input by the user or information provided to the user. The display module 103 may include a display panel, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like.
[0102] The memory 102 can be used to store software programs and various data. The memory 102 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0103] This application also provides a storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of an optimization suggestion generation method based on MRP structured data.
[0104] The storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example,, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0105] In a storage medium, a readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying readable program code. This propagated data signal may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0106] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for generating optimization suggestions based on MRP structured data, characterized in that, The methods include: S101: Obtain a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information; S102: Filter material information of interest; S103: Based on the filtered material information, generate prompts containing three parts: the first part is the required quantity and required date information of the material; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions. S104: Combine the three parts output in step S103 into a problem description prompt; S105: Use the generated problem description prompts and the API key of the preset deep exploration model as input parameters, and call the deep exploration model to generate optimization suggestion descriptions corresponding to the prompts; S106: Store the obtained optimization suggestion descriptions in the optimization suggestion report table.
2. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S101 specifically includes the following steps: Construct an attribute-data source mapping table. The mapping table records information from the planned order table, information from the dynamic inventory table, as well as their respective MRP system storage nodes, data read paths, and data type identifiers. Each attribute is bound to a unique storage node and read path. A partitioned data access protocol is adopted, with the planned order table configured as the order data access channel and the dynamic inventory table configured as the dynamic data access channel; Based on the attribute-data source mapping table, attribute-level filtering is performed on the planned order table to filter out redundant log fields such as data modification operator ID, historical modification timestamp, and internal system check code in the MRP system. Perform attribute-level filtering reads on the dynamic inventory table; Verify the data format of attributes and verify the consistency of attribute associations for the same material between the planned order table and the dynamic inventory table; Using the timestamp obtained from the material code as the key field, the target attribute data of the planned order table and the target attribute data of the dynamic inventory table are linked and integrated.
3. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S102 specifically includes the following steps: Define a filtering rule base for "materials of interest". With the target material as the root node, iterate through its related data in the material relationship database: obtain the direct subordinate materials of the material through the BOM table, obtain the related work-in-process materials through the production order table, and obtain the related upstream materials through the purchase order table. The traversal results are constructed into a directed graph structure of material-related materials; Based on the production planning stage, order type, and inventory status, a priority score is calculated for each related material. The final priority score is the weighted sum of the scores from the three dimensions, and the related materials are sorted from high to low scores. Obtain financial cost data for materials from the ERP system, production execution data from the MES system, and warehouse operation data from the WMS system; cross-validate these three types of data with planned order data and dynamic inventory data from the MRP system.
4. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S103, which generates prompts containing three parts based on the filtered material information, specifically includes the following steps: Construct a mapping table of material-demand attributes and a prompt word format template for Part 1; Establish a database corresponding to dynamic inventory types and information integration templates, and configure integration templates for each dynamic inventory type. Define the dynamic adaptation rules for the third part of the optimization suggestion query content: scan the dynamic inventory details, extract the keywords of the dynamic inventory type, and then generate the corresponding query content based on the extracted keywords. If only the keywords are present, then query content is generated. Add supplementary explanations at the end of the query content. Perform correlation checks on the three prompt word fields to ensure complete consistency; Generate a complete prompt word with metadata. Based on the three valid content combinations, add three types of metadata, and finally output a complete prompt word containing metadata prefixes and three core content parts.
5. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S104 also includes the following steps: When the number of materials under monitoring exceeds the preset threshold, batches are divided according to the preset priority, the number of materials in each batch does not exceed the set value, and materials with the same business document number in the same batch are uniformly associated with the corresponding business information. Configure duplicate content deduplication rules to retain only the complete information of the first business document number that appears repeatedly in the same batch, simplify subsequent duplicate items, and sort different requirements for the same material in ascending order by the date of the requirement. Construct a field mapping verification table containing business date, business document number, and key information summary; compare the consistency of each field value with the corresponding content in the combined prompt words; and mark key information mapping anomalies. Set rules for escaping special characters and preserving format in key information. Perform escaping processing on special characters in the key information summary, while preserving the fixed format of business document number and business date without being affected by escaping. Generate a combined process log file containing key information traceability records, recording the business document number, business date, and key information summary for each material, and store the log file in a specified directory that supports retrieval by document number.
6. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S105 also includes the following steps: The API key of the depth exploration model is divided into two parts: storage layer fragment and call layer decryption factor. During decryption, the complete key is concatenated by the key decryption module and temporarily stored in memory, and cleared after the call is completed. Configure a dedicated set of request parameters, including MRP business association fields, model response format constraint fields, and dynamic parameter adjustment fields. All parameters are encapsulated in a structured format. Establish model call channels divided into procurement and production categories, and match the corresponding channel configuration based on the dynamic inventory type identification results; Perform preliminary filtering and format validation of the model response data, extract relevant content by matching business document numbers, and verify that the response format meets the text type requirements; Generate a temporary cache of call results and a status identifier, store the valid response content in the temporary response cache area, and record the call status and related information in the call status table.
7. The method for generating optimization suggestions based on MRP structured data according to claim 1, characterized in that, Step S106 specifically includes the following steps: Construct an initial structure for an optimization suggestion report table that is associated with multiple MRP tables. Based on the original report table fields, add associated planned order number, dynamic inventory business document set, and data source identifier. The optimization suggestions are structured and broken down into three categories: suggestions related to procurement plans, suggestions related to purchase orders, and suggestions related to production orders. Each category of suggestions is marked with a unique identifier. Establish a two-dimensional keyword matching setting optimization direction field rule. The first dimension scans dynamic inventory details. If the keyword "purchase plan" is present and the corresponding business document number exists in the split suggestions, then set whether the optimization involves the purchase plan to "yes". If the keyword "purchase order" is present and the corresponding document exists in the suggestions, then set whether the optimization involves the purchase order to "yes". Perform cross-table join logic validation; generate report table partitioning and traceability identifiers, and store report table records in partitions according to material category and time; add a traceability code to each record, and store the traceability code bound to the record.
8. An optimization suggestion generation device based on MRP structured data, characterized in that, The apparatus is used to implement the optimization suggestion generation method based on MRP structured data as described in any one of claims 1 to 7; The device includes: The data collection module is used to acquire a structured set of material requirements and dynamic inventory information, which includes planned order information and dynamic inventory information. The filtering and identification module is used to filter information about materials of interest. The prompt word generation and integration module generates prompt words containing three parts based on the filtered material information: the first part is the required quantity and required date information of the material; the second part is the integrated dynamic inventory details; and the third part is the description of optimization suggestions. The description combination module is used to combine the three parts of the output into a problem description prompt; The model call optimization module is used to take the generated problem description prompts and the API key of the preset deep search model as input parameters, and call the deep search model to generate optimization suggestion descriptions corresponding to the prompts; The optimized storage settings module is used to store the obtained optimization suggestions descriptions into the optimization suggestion report table.
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 program, it implements the steps of the optimization suggestion generation method based on MRP structured data as described in any one of claims 1 to 7.
10. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the optimization suggestion generation method based on MRP structured data as described in any one of claims 1 to 7.