Methods, devices, storage media and processors for comparing bills of materials

By comparing the key-value pairs and change information of the bill of materials at different points in time, a material comparison report is generated, which solves the problem of rigid comparison logic of the bill of materials and improves comparison efficiency and the accuracy of cost management.

CN116894052BActive Publication Date: 2025-10-28ZHONGKE YUNGU TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310778666.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-28
Publication Date
2025-10-28
Estimated Expiration
2043-06-28

AI Technical Summary

Technical Problem

The rigid logic of bill of materials comparison in existing technologies leads to a large amount of data manipulation, consumes a lot of system resources and time costs, and makes it impossible to adjust product costs in a timely manner.

Method used

By obtaining the bill of materials for the target product at different points in time, determining the key-value pairs of each material, comparing the changes between materials, and generating material comparison reports to manage costs, the comparison efficiency is improved by using hash tables and string concatenation.

Benefits of technology

It enables the rapid and accurate generation of BOM structure comparison information for products at different times, reducing the time cost of BOM comparison and supporting adjustments and management by technical personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116894052B_ABST
    Figure CN116894052B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, storage medium, and processor for comparing bills of materials (BOMs). The method includes: acquiring first and second BOMs of a target product at different points in time, and a third BOM containing change information before and after the changes, and determining the key-value pairs for each item. For each first item in the first BOM, the key-value pairs of the first item are compared with those of each second item in the second BOM to obtain a first comparison result indicating whether they are the same or different. If no second item has a key-value pair identical to the first item, the key-value pairs of the first item are compared with those of each third item in the third BOM to obtain a second comparison result indicating replacement or modification. Based on all the first and second comparison results, a BOM comparison report for the target product is determined to manage the cost of the target product. In this way, the comparison information of the product's BOM structure at different times can be obtained quickly and accurately, enabling the control of product costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field, specifically to a method, apparatus, storage medium, and processor for comparing bills of materials. Background Technology

[0002] A Bill of Materials (BOM) is a technical document describing the composition of a company's products. In processing capital goods industries, it shows the structural relationships between the final assembly, sub-assemblies, components, parts, and even raw materials, as well as the required quantities. During product cost management, the BOM structure of a product may change at different points in time due to factors such as product design, technology, and market demand. For example, changes in the selection, quantity, or quality of raw materials or components can impact costs, requiring timely adjustments and management to maintain target cost achievement. However, in existing technologies, when synchronizing BOM data in enterprise information systems, the rigid comparison logic between BOMs necessitates modifications to the business logic and deletion / reconstruction of compared data when materials or their attributes change. This approach involves a large amount of data manipulation, consuming significant system resources and time. Summary of the Invention

[0003] The purpose of this application is to provide a method, apparatus, storage medium, and processor for comparing bills of materials.

[0004] To achieve the above objectives, the first aspect of this application provides a method for comparing bills of materials, comprising:

[0005] Obtain the first bill of materials for the target product at a first preset time point, the second bill of materials at a second preset time point, and the third bill of materials. The third bill of materials contains change information for each material between the second bill of materials and the first bill of materials. The change information includes the material price before and after the change.

[0006] Identify the key-value pairs for each item included in each bill of materials;

[0007] For each first material in the first bill of materials, compare the key-value pairs of the first material with each second material in the second bill of materials to determine the first comparison result between the first material and each second material. The first comparison result refers to whether they are the same or different.

[0008] For each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, the key-value pairs of the first material are compared with each third material in the third bill of materials to determine the second comparison result between the first material and each third material. The second comparison result includes replacement or modification.

[0009] Based on all the first and second comparison results, a material comparison report for the target product is determined to manage the cost of the target product through the material comparison report.

[0010] In embodiments of this application, the method further includes: for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is no third material in the third bill of materials with the same key-value pair as the first material, determining the third comparison result corresponding to the first material as deletion; determining the material comparison report of the target product based on all first comparison results and second comparison results includes: determining the material comparison report of the target product based on all first comparison results, second comparison results, and third comparison results.

[0011] In embodiments of this application, the method further includes: for each first material, if there is a second material in the second bill of materials with the same key-value pair as the first material, the second material with the same key-value pair is identified as the first target material; for each first material, the first target material is deleted to generate a new second bill of materials, and the new second bill of materials is compared with the first bill of materials.

[0012] In embodiments of this application, the method further includes: after comparing all the first materials included in the first bill of materials with the regenerated second bill of materials, determining the fourth comparison result corresponding to the remaining second materials in the second bill of materials as new additions; determining the material comparison report of the target product based on all the first comparison results and the second comparison results includes: determining the material comparison report of the target product based on all the first comparison results, the second comparison results, the third comparison results, and the fourth comparison results.

[0013] In embodiments of this application, for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, comparing the key-value pairs of the first material with each third material in the third bill of materials to determine the second comparison result between the first material and each third material includes: for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is a third material in the third bill of materials with the same key-value pair as the first material, identifying the third material with the same key-value pair as the second target material; and for each first material, determining the second comparison result between the first material and the second target material based on the change information of the second target material.

[0014] In embodiments of this application, the change information also includes the material code and coding path before and after the change. For each first material, determining the second comparison result between the first material and the second target material based on the change information of the second target material includes: for each first material, if the material code and / or coding path of the second target material are different before and after the change, determining the second comparison result between the first material and the second target material as replacement; for each first material, if the material code and coding path of the second target material are the same before and after the change, but the material price is different before and after the change, determining the second comparison result between the first material and the second target material as modification.

[0015] In embodiments of this application, determining the key-value pair of each material included in each bill of materials includes: determining the material code, coding path, and material price of each material included in each bill of materials, wherein the coding path refers to the path from the top-level material included in the bill of materials of that material to the parent material of that material; and determining the key-value pair of each material based on the material code, coding path, and material price of each material.

[0016] A second aspect of this application provides a processor configured to perform the above-described bill of materials comparison method.

[0017] A third aspect of this application provides a bill of materials comparison apparatus, including the processor configured to perform the bill of materials comparison method described above.

[0018] A fourth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the aforementioned bill of materials comparison method.

[0019] The above technical solution involves obtaining a first bill of materials (BOM) at a first preset time point, a second BOM at a second preset time point, and a third BOM for the target product. The third BOM contains change information for each material between the second and first BOMs, including the material price before and after the change. The solution also involves determining the key-value pairs for each material in each BOM; comparing the key-value pairs of each first material in the first BOM with those of each second material in the second BOM to determine a first comparison result (identical or different); for each first material, if no second material with the same key-value pair exists in the second BOM, comparing the key-value pairs of the first material with those of each third material in the third BOM to determine a second comparison result (including replacement or modification); and finally, determining a material comparison report for the target product based on all the first and second comparison results to manage the cost of the target product. In this way, the comparison information of the product's BOM structure at different times can be obtained quickly and accurately, which facilitates the adjustment and management by technical personnel, so as to control the product cost and reduce the time cost of comparing the bill of materials.

[0020] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description

[0021] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:

[0022] Figure 1 The schematic diagram illustrates a flowchart of a bill of materials comparison method according to an embodiment of this application;

[0023] Figure 2 This schematic diagram illustrates a structural block diagram of a bill of materials comparison device according to an embodiment of this application;

[0024] Figure 3 The diagram illustrates the internal structure of a computer device according to an embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0026] Figure 1 A schematic flowchart illustrating a bill of materials comparison method according to an embodiment of this application is shown. Figure 1 As shown, in one embodiment of this application, a method for comparing bills of materials is provided. This embodiment mainly uses the application of this method to a processor as an example, and includes the following steps:

[0027] S102, obtain the first bill of materials for the target product at a first preset time point, the second bill of materials at a second preset time point, and the third bill of materials. The third bill of materials contains change information for each material between the second bill of materials and the first bill of materials. The change information includes the material price before and after the change.

[0028] A Bill of Materials (BOM) is a technical document describing the composition of a company's products. In the processing capital goods industry, it shows the structural relationships and required quantities between the product's final assembly, sub-assemblies, components, parts, and raw materials. In this application, the cost of the target product is managed and adjusted by comparing the BOMs of the target product at different times. To better study the specific situation of product costs, the processor can obtain a first BOM at a first preset time point, a second BOM at a second preset time point, and a third BOM. The first BOM refers to the material information of the target product at the first preset time point. The second BOM refers to the material information of the target product at the second preset time point. The first preset time point is before the second preset time point. The first preset time point can be the start time of a cycle for reducing the target product's cost, and the second time point can be the end time of the cycle for reducing the target product's cost. During the cycle for reducing the target product's cost, the materials in the target product's BOM will be adjusted. The processor can track changes in the BOM structure, and after the material changes in the BOM are approved through the process, all material change information will be saved to a new database table. It contains change information for each material in the BOM before and after the change, including material prices, and records material changes during the period of target product cost reduction.

[0029] S104, determine the key-value pairs for each item included in each bill of materials.

[0030] S106, for each first material in the first bill of materials, compare the key-value pairs of the first material with each second material in the second bill of materials to determine the first comparison result between the first material and each second material, where the first comparison result refers to whether they are the same or different.

[0031] S108, for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, compare the key-value pairs of the first material with each third material in the third bill of materials to determine a second comparison result between the first material and each third material, the second comparison result including replacement or modification.

[0032] S110, Based on all the first comparison results and the second comparison results, determine the material comparison report of the target product, so as to manage the cost of the target product through the material comparison report.

[0033] The processor can generate key-value pairs based on the material information of each material in the bill of materials. These key-value pairs are generated based on the material information and attributes of each material. The key represents each material, and the key value represents the material information of each material. Key-value pairs allow for rapid comparison of materials. Therefore, for each first material in the first bill of materials, the processor can compare the key-value pairs of each second material in the second bill of materials with the key-value pairs of that first material. If the material information of the two compared materials is the same, then the key-value pairs of the two materials will also be the same, and the first comparison result is "same"; otherwise, the first comparison result is "different". For the first material, if all the key-value pairs of the second materials in the second bill of materials are different from those of the first material (i.e., there is no second material in the second bill of materials with the same key-value pairs as the first material), then the processor can further compare the key-value pairs of each third material in the third bill of materials with the key-value pairs of that first material. If the key-value pairs of the two compared materials are the same (i.e., there is a third material in the third bill of materials that is the same as the first material), then the second comparison result is "replacement" or "modification". This indicates a change in the first material. After comparing the first bill of materials (BOM) with the second and third BOMs, a material comparison report for the target product can be generated based on all the first and second comparison results. This report contains information on the differences in the BOM structure of the target product between a first and a second preset time point, including information on whether each material is the same, different, replaced, or modified. In one specific implementation, the processor can display the material comparison report in the front-end program, showing the BOM tree comparison report of the target product. This allows for quick and accurate comparison of the product's BOM structure at different times, facilitating adjustments and management by technical personnel, enabling cost control and reducing the time cost of BOM comparisons.

[0034] In one embodiment, the method further includes: for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is no third material in the third bill of materials with the same key-value pair as the first material, determining the third comparison result corresponding to the first material as deleted; determining the material comparison report of the target product based on all first comparison results and second comparison results includes: determining the material comparison report of the target product based on all first comparison results, second comparison results, and third comparison results.

[0035] The first, second, and third bills of materials can be in map format. Each first item in the first bill of materials (old_map) is denoted as `o_value`, and its key-value pair is denoted as `o_key`. Each second item in the second bill of materials (new_map) is denoted as `b_value`, and its key-value pair is denoted as `b_key`. The third bill of materials (change_map) is denoted as `c_value`, and its key-value pair is denoted as `c_key`. The processor can iterate through each second item in the second bill of materials (new_map), comparing the key-value pair `b_key` of each second item with the key-value pair `o_key` of the corresponding first item. For a given first item, if the key-value pair `b_key` of the second item is the same as the key-value pair `o_key` of the first item, then the first comparison result is "same". If there is no second item in the second bill of materials with the same key-value pair `o_key` as the first item, that is, if the key-value pair `b_key` of all second items in the second bill of materials is different from the key-value pair `o_key` of the first item, then the comparison result is "same". Then, the key-value pair c_key of each third material c_value in the third bill of materials change_map can be compared with the key-value pair o_key of the first material. If it is also different from all the key-value pairs of the third materials, that is, there is no third material c_value in the third bill of materials that is the same as the first material, then the third comparison result of the first material o_value is deletion. That is, the first material is deleted from the BOM structure of the target product. Then, after the comparison of the first bill of materials with the second and third bill of materials is completed, a material comparison report of the target product can be generated based on all the first comparison results, second comparison results, and third comparison results. The material comparison report contains information on whether each material is the same, different, deleted, replaced, or modified. The processor can display the material comparison report in the front-end program, showing the BOM tree comparison report of the target product.

[0036] In one embodiment, the method further includes: for each first material, if there is a second material in the second bill of materials with the same key-value pair as the first material, identifying the second material with the same key-value pair as the first target material; for each first material, deleting the first target material to regenerate the second bill of materials, and comparing the regenerated second bill of materials with the first bill of materials.

[0037] The processor can iterate through each second material in the second bill of materials (BOM) `new_map`, comparing the key-value pair `b_key` of each second material with the key-value pair `o_key` of the corresponding first material. If the key-value pair `b_key` of the second material is the same as the key-value pair `o_key` of the first material, the first comparison result is "same". Therefore, during the comparison process of all second materials in the second BOM for each first material, the processor can determine the first target material based on the `b_value` of the second material with the same key-value pair, delete the first target material from the second BOM `new_map`, and regenerate the second BOM `new_map`. Thus, when selecting the next first material to compare with the second BOM `new_map`, there is no need to compare it with the first target material again. By using hash calculations to obtain key-value comparisons of material information and deleting duplicate materials, the number of iterations in `new_map` is reduced, minimizing the time cost of looping. Furthermore, performing the complete BOM comparison in memory reduces the number of database accesses, thereby quickly generating report data and improving system response speed.

[0038] In one embodiment, the method further includes: after comparing all the first materials included in the first bill of materials with the regenerated second bill of materials, determining the fourth comparison result corresponding to the remaining second materials in the second bill of materials as new additions; determining the material comparison report of the target product based on all the first comparison results and the second comparison results includes: determining the material comparison report of the target product based on all the first comparison results, the second comparison results, the third comparison results, and the fourth comparison results.

[0039] After comparing all first material o_values ​​included in the first bill of materials old_map with the regenerated second bill of materials new_map, all first target materials in the second bill of materials new_map that have the same o_value as the first materials are deleted. The remaining second material b_values ​​in the second bill of materials new_map are the materials added based on the first bill of materials old_map. The processor can then determine the fourth comparison result corresponding to the remaining second material b_values ​​in the second bill of materials as newly added. After comparing the first bill of materials with the second and third bills of materials, a material comparison report for the target product can be generated based on all the first, second, third, and fourth comparison results. The material comparison report contains information on whether each material is the same, different, replaced, modified, deleted, or added. The processor can display the material comparison report in the front-end program, showing the BOM tree comparison report for the target product.

[0040] In one embodiment, for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, comparing the key-value pairs of the first material with each third material in the third bill of materials to determine the second comparison result between the first material and each third material includes: for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is a third material in the third bill of materials with the same key-value pair as the first material, identifying the third material with the same key-value pair as the second target material; and for each first material, determining the second comparison result between the first material and the second target material based on the change information of the second target material.

[0041] In one embodiment, the change information further includes the material code and coding path before and after the change. For each first material, determining the second comparison result between the first material and the second target material based on the change information of the target material includes: for each first material, if the material code and / or coding path of the second target material are different before and after the change, determining the second comparison result between the first material and the second target material as replacement; for each first material, if the material code and coding path of the second target material are the same before and after the change, but the material price is different before and after the change, determining the second comparison result between the first material and the second target material as modification.

[0042] For each first material o_value in the first bill of materials old_map, if there is no second material b_value in the second bill of materials new_map with the same key-value pair o_key, then the first material o_value can be compared with the key-value pair c_value of the third material in the third bill of materials change_map. If there is a third material c_value with the same key-value pair in the third bill of materials, then the third material c_value can be identified as the second target material. Based on the change information of the second target material, including the material code, code path, and material price before and after the change, the processor can determine whether the second comparison result between the first material and the second target material is replacement or modification.

[0043] Furthermore, if the key-value pair of the second target material is the same as that of the first material, the change information of the second target material is retrieved. The material code and coding path of the second target material before and after the change are compared. If either of these differs, the processor determines the second comparison result as a replacement. That is, the first material in the first bill of materials has been replaced with the corresponding second target material. If the material code and coding path are the same before and after the change, but the material price is different, the processor determines the second comparison result as a modification. That is, the price of the first material in the first bill of materials has been modified.

[0044] In one embodiment, determining the key-value pair for each item included in each bill of materials includes: determining the material code, coding path, and material price for each item included in each bill of materials, wherein the coding path refers to the path from the top-level item included in the bill of materials to the parent item of the item; and determining the key-value pair for each item based on the material code, coding path, and material price for each item.

[0045] A material code is a unique identifier for a material. Material codes are unique; a single material cannot have multiple material codes, and a single material code cannot correspond to multiple different specifications of materials. The coding path, based on the BOM tree structure, refers to the path from the top-level material in the bill of materials to the material's parent material. The processor can determine the key-value pairs for each material based on its material code, coding path, and material price.

[0046] In one embodiment, the processor can obtain a first bill of materials (old_table), a second bill of materials (new_table), and a third bill of materials (change_table), and convert them one by one into randomly accessible list formats: old_list, new_list, and change_list. The change_list contains information on changes in material prices. After converting the table-format bill of materials to list format, the processor can convert the three lists into map format using SDK conversion functions. Specifically, for each material in the list format bill of materials, its material code, code path, and the string representing its price are concatenated to generate a key-value pair for each material. Each element in the list (i.e., each material in the bill of materials) serves as its own key (value) to convert the first, second, and third bill of materials into map formats, denoted as old_map, new_map, and change_map, respectively. In a specific embodiment, the key-value pair for each material can be generated by calculating a hash value, thus obtaining three hashmap format bills of materials. Hashmaps, based on a hash table key-value pair storage structure, allow for fast insertion, deletion, and search operations. It achieves fast lookups by calculating the hash code of the key object and mapping it to an index position in the hash table. When a hash collision occurs, HashMap resolves the collision using linked lists or red-black trees. Furthermore, it improves comparison efficiency by quickly comparing the key-value pairs of old_map, new_map, and change_map to perform a BOM (Bill of Materials) comparison.

[0047] In one embodiment, after comparing the first bill of materials (old_map) with the second bill of materials (new_map) and the third bill of materials (change_map), a material comparison report for the target product can be generated based on all the first, second, third, and fourth comparison results. The material comparison report contains information on whether each material is the same, different, replaced, modified, deleted, or added. Specifically, the processor can use change flags to indicate changes to each first material. For first materials whose first comparison results are the same, their change flag remains unchanged. For first materials whose second comparison results indicate replacement or modification, their change flag is marked as the corresponding replacement or modification, and the change information for the corresponding second target material is added to the first material in the first bill of materials (old_map). For first materials whose third comparison result indicates deletion, their change flag is deleted. For second materials whose fourth comparison result indicates addition, their material information is added to the first bill of materials (old_map), and their change flag is marked as added. The processor can add change flag information to the change_flag field. The changed materials and their change information are then added to the original first bill of materials (old_map) to generate a new first bill of materials (old_map). The SDK's conversion functions convert the first bill of materials (BOM) `old_map` into a list, and then insert the data from the list into the `comparison_table` table in the database in batches to generate a material comparison report. The processor can then query the material comparison information for a specified product in `comparison_table`. Using attributes such as the material hierarchy and parent material code in its BOM structure, the processor can display the material comparison report in the front-end program, showing the BOM tree comparison report for the target product.

[0048] The above technical solution utilizes a hash table to convert the bill of materials (BOM) into a map format. It concatenates the material price, material code, and code path fields into key-value pairs (keys), with each material serving as the value. This allows for rapid comparison of two BOMs, significantly improving efficiency. `old_map` and `new_map` represent BOM data for the same product at different points in time. Since most material data remains unchanged, when iterating through the first material in `old_map`, unchanged data is promptly removed from `new_map`, greatly reducing the number of iterations in `new_map`. The time complexity of this solution is M+R, where M is the number of elements in `old_map` and R is the number of remaining elements in `new_map` after iterating through `old_map`. The time complexity clearly demonstrates a significant improvement in efficiency. Furthermore, this solution requires no manual intervention and eliminates the need for additional Excel or TXT files. By performing material BOM comparison using in-memory access rather than comparing individual materials with database data, it reduces database access time. In this way, the comparison information of the product's BOM structure at different times can be obtained quickly and accurately, which facilitates the adjustment and management by technical personnel, so as to control the product cost.

[0049] Figure 1 This is a flowchart illustrating a method for comparing bills of materials in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0050] In one embodiment, such as Figure 2 As shown, a bill of materials comparison device is provided, including a bill of materials acquisition module 202, a key-value pair determination module 204, a first comparison result determination module 206, a second comparison result determination module 208, and a report generation module 210, wherein:

[0051] The bill of materials acquisition module 202 is used to acquire the first bill of materials for the target product at a first preset time point, the second bill of materials at a second preset time point, and the third bill of materials. The third bill of materials contains change information for each material between the second bill of materials and the first bill of materials, including the material price before and after the change.

[0052] Key-value pair determination module 204 is used to determine the key-value pairs of each material included in each bill of materials.

[0053] The first comparison result determination module 206 is used to compare the key-value pairs of each first material in the first bill of materials with each second material in the second bill of materials to determine the first comparison result between the first material and each second material. The first comparison result refers to whether they are the same or different.

[0054] The second comparison result determination module 208 is used to compare the key-value pairs of the first material with each third material in the third material list when there is no second material in the second material list that has the same key-value pair as the first material, in order to determine the second comparison result between the first material and each third material. The second comparison result includes replacement or modification.

[0055] The report generation module 210 is used to determine the material comparison report of the target product based on all the first comparison results and the second comparison results, so as to manage the cost of the target product through the material comparison report.

[0056] In one embodiment, the apparatus further includes a third comparison result determination module (not shown in the figure), configured to determine, for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is no third material in the third bill of materials with the same key-value pair as the first material, that the third comparison result corresponding to the first material is to be deleted. The report generation module 210 is further configured to determine a material comparison report for the target product based on all the first comparison results, second comparison results, and third comparison results.

[0057] In one embodiment, the apparatus further includes a first bill of materials update module (not shown in the figure), configured to, for each first material, identify a second material in the second bill of materials that has the same key-value pair as the first material, determine the second material with the same key-value pair as the first target material; and, for each first material, delete the first target material to regenerate the second bill of materials, and compare the regenerated second bill of materials with the first bill of materials.

[0058] In one embodiment, the device further includes a fourth comparison result determination module (not shown in the figure), which, after comparing all the first materials included in the first bill of materials with the regenerated second bill of materials, determines the fourth comparison result corresponding to the remaining second materials in the second bill of materials as new additions; the report generation module 210 is also used to determine the material comparison report of the target product based on all the first comparison results, second comparison results, third comparison results and fourth comparison results.

[0059] In one embodiment, the fourth comparison result determination module (not shown in the figure) is further configured to, for each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, and there is a third material in the third bill of materials with the same key-value pair as the first material, determine the third material with the same key-value pair as the second target material; and for each first material, determine the second comparison result between the first material and the second target material based on the change information of the second target material.

[0060] In embodiments of this application, the change information also includes the material code and coding path before and after the change. The second comparison result module 208 is further configured to, for each first material, determine that the second comparison result between the first material and the second target material is a replacement if the material code and / or coding path before and after the change of the second target material are different; and to determine that the second comparison result between the first material and the second target material is a modification if the material code and coding path before and after the change of the second target material are the same, but the material price before and after the change is different.

[0061] In one embodiment, the key-value pair determination module 206 is further configured to determine the material code, coding path, and material price of each material included in each bill of materials, wherein the coding path refers to the path from the top-level material included in the bill of materials of that material to the parent material of that material; and to determine the key-value pair of each material based on the material code, coding path, and material price of each material.

[0062] The bill of materials comparison device includes a processor and a memory. The bill of materials acquisition module 202, key-value pair determination module 204, first comparison result determination module 206, second comparison result determination module 208, and report generation module 210 are all stored as program units in the memory. The processor executes the program modules stored in the memory to implement the corresponding functions.

[0063] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and the comparison method for the bill of materials can be implemented by adjusting the kernel parameters.

[0064] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0065] This application provides a storage medium storing a program that, when executed by a processor, implements the above-described bill of materials comparison method.

[0066] This application provides a processor for running a program, wherein the program executes the above-described bill of materials comparison method during runtime.

[0067] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A04. The database stores data for a bill of materials comparison method. The network interface A02 communicates with external terminals via a network connection. When the computer program B02 is executed by the processor A01, it implements a bill of materials comparison method.

[0068] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0069] This application provides an apparatus, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of a bill of materials comparison method.

[0070] This application also provides a computer program product that, when executed on a data processing device, is suitable for executing a program that initializes a comparison method step with a bill of materials.

[0071] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0072] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0073] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0074] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0075] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0076] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0077] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0078] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0079] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for comparing bills of materials, characterized in that, The method includes: Obtain a first bill of materials for the target product at a first preset time point, a second bill of materials at a second preset time point, and a third bill of materials. The third bill of materials contains change information for each material between the second bill of materials and the first bill of materials. The change information includes the material price before and after the change. Identify the key-value pairs for each item included in each bill of materials; For each first material in the first bill of materials, the key-value pairs of the first material and each second material in the second bill of materials are compared to determine a first comparison result between the first material and each second material, wherein the first comparison result indicates whether they are the same or different. For each first material, if there is no second material in the second bill of materials with the same key-value pair as the first material, the key-value pairs of the first material are compared with each third material in the third bill of materials to determine a second comparison result between the first material and each third material, the second comparison result including replacement or modification; Based on all the first comparison results and the second comparison results, a material comparison report for the target product is determined, so as to manage the cost of the target product through the material comparison report.

2. The method for comparing bills of materials according to claim 1, characterized in that, The method further includes: If, for each first material, there is no second material in the second material list that has the same key-value pair as the first material, and there is no third material in the third material list that has the same key-value pair as the first material, then the third comparison result corresponding to the first material is determined to be deleted. The material comparison report for determining the target product based on all the first comparison results and the second comparison results includes: Based on all the first comparison results, second comparison results, and third comparison results, a material comparison report for the target product is determined.

3. The method for comparing bills of materials according to claim 1, characterized in that, The method further includes: For each first material, if there is a second material in the second bill of materials that has the same key-value pair as the first material, the second material with the same key-value pair is identified as the first target material; For each first material, the first target material is deleted to generate a new second bill of materials, which is then compared with the first bill of materials.

4. The method for comparing bills of materials according to claim 3, characterized in that, The method further includes: After comparing all the first materials included in the first bill of materials with the regenerated second bill of materials, the fourth comparison result corresponding to the remaining second materials in the second bill of materials is determined as the addition; The material comparison report for determining the target product based on all the first comparison results and the second comparison results includes: Based on all the first comparison results, second comparison results, third comparison results, and fourth comparison results, a material comparison report for the target product is determined.

5. The method for comparing bills of materials according to claim 1, characterized in that, In the case that there is no second material in the second bill of materials with the same key-value pair as the first material, the second comparison result between the key-value pairs of the first material and each third material in the third bill of materials is determined by comparing the key-value pairs of the first material with each third material. This comparison includes: If, for each first material, there is no second material in the second bill of materials with the same key-value pair as the first material, but there is a third material in the third bill of materials with the same key-value pair as the first material, the third material with the same key-value pair is identified as the second target material. For each first material, a second comparison result between the first material and the second target material is determined based on the change information of the second target material.

6. The method for comparing bills of materials according to claim 5, characterized in that, The change information also includes the material code and code path before and after the change. For each first material, determining the second comparison result between the first material and the second target material based on the change information of the target material includes: For each first material, if the material code and / or code path before and after the change of the second target material are different, the second comparison result between the first material and the second target material is determined to be a replacement. For each first material, if the material code and code path are the same before and after the change of the second target material, but the material price is different before and after the change, the second comparison result between the first material and the second target material is determined to be modified.

7. The method for comparing bills of materials according to claim 1, characterized in that, The process of determining the key-value pairs for each item included in each bill of materials includes: Determine the material code, coding path, and material price for each material included in each bill of materials, wherein the coding path refers to the path from the top-level material included in the bill of materials to the parent material of the material; Each material's key-value pair is determined based on its material code, coding path, and material price.

8. A processor, characterized in that, It is configured to perform the bill of materials comparison method according to any one of claims 1 to 7.

9. A bill of materials comparison device, characterized in that, Includes the processor as described in claim 8.

10. A machine-readable storage medium storing instructions thereon, characterized in that, When executed by a processor, this instruction causes the processor to be configured to perform the comparison method of the bill of materials according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Rapid comparison method and device

    CN106855862A

  • Material bill editing method, device, equipment and storage medium

    CN111459599A