Method and apparatus for constructing product structure information
By calculating the usage probability and weight coefficient of an object, a path model is constructed and path coding information is generated, which solves the problem that the optimal path cannot be quickly obtained from product structure information in the existing technology, and realizes the convenient determination of the optimized path from object to product.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- LENOVO (BEIJING) LTD
- Filing Date
- 2022-07-26
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, product structure information cannot quickly obtain the optimal path for constructing the product from the object, resulting in high complexity in determining the optimal construction path.
By determining the usage probability of an object, calculating weight coefficients, constructing a path model, and generating product structure information containing path coding information, the optimal path from the object to the product is optimized by representing the path coding.
It reduces the complexity of determining the optimization path from object to product, and enables quick and convenient determination of the optimization path from object to product.
Smart Images

Figure CN115238996B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of product composition description technology, and in particular to a method and apparatus for constructing product structure information. Background Technology
[0002] In enterprises, it is often necessary to construct product structure information to represent the relevant information of the various objects that make up the product. For example, product structure information can be a Bill of Materials (BOM). A BOM is a technical document that describes the product composition and other related information. The BOM can show the structural relationships between the product's main assembly, sub-assemblies, components, parts, and even raw materials, as well as the required quantities.
[0003] Currently, product structure information mainly reflects the predecessors and successors of objects required by the product, as well as the usage ratio of these objects. Based solely on this product structure information, it's not possible to quickly obtain the optimal path for constructing a product from objects. If a path for constructing a product from objects needs to be queried, it requires recursive searching based on the relationships between objects in the product structure information, resulting in high complexity in determining the optimal construction path for assembling the corresponding product from objects. Summary of the Invention
[0004] This application provides a method and apparatus for constructing product structure information.
[0005] One method for constructing product structure information includes:
[0006] Determine at least one object that constitutes the product and the attributes of the object, the attributes of the object including the probability of using the object;
[0007] The weight coefficient of the object is determined based on the probability of its use.
[0008] Based on the weight coefficients of the objects, a path model for constructing the product is determined for each object. The path model is used to represent the optimized path from each object to the product.
[0009] Based on the path model, determine the path encoding information corresponding to the optimized path from the object to the product;
[0010] Generate product structure information containing the path encoding information corresponding to the object.
[0011] In one possible implementation, determining the path model for constructing the product based on the weight coefficients of the objects includes:
[0012] Based on the principle of merging the two objects with the smallest weight coefficient, the at least one object is iteratively merged until the at least one object is merged into one object, thus obtaining the path model for the iterative merging of the at least one object.
[0013] In another possible implementation, the principle of merging the two objects with the smallest weight coefficients, and iteratively merging the at least one object until at least one object is merged into one object, includes:
[0014] The object sorting of the at least one object is determined according to the weight coefficient of the object;
[0015] Merge the last two objects in the sorted object sequence into one object;
[0016] The sum of the weight coefficients of the last two objects is determined as the weight coefficient of the merged object. Based on the weight coefficient of the merged object, the merged object and the remaining objects in the object sorting are reordered. Based on the sorted objects obtained by reordering, the operation of merging the last two objects in the object sorting into one object is returned to be executed until all objects in the object sorting are merged into one object.
[0017] In another possible implementation, during the process of reordering the merged objects and the remaining objects after the merger, if there is a target object among the remaining objects after the merger with the same weight coefficient as the merged objects, the sorting order of the merged objects is set to be before the target object.
[0018] In another possible implementation, after merging the last two objects in the object sorting into one object, the following is also included:
[0019] Set the code of the first path branch from the first object to the merged object to 0, and set the code of the second path branch from the second object to the merged object to 1. The first object and the second object are the two objects that are last in the object sorting, and the weight coefficient of the first object is not less than the weight coefficient of the second object.
[0020] The path model is used to characterize the encoded path from each of the objects to the product.
[0021] In another possible implementation, determining the path encoding information corresponding to the optimized path from the object to the product based on the path model includes:
[0022] Identify each path branch involved in the optimized path from the object to the product in the path model;
[0023] Based on the codes on each path branch in the optimized path corresponding to the object, the path coding information of the optimized path from the object to the product is determined.
[0024] In another possible implementation, determining the path encoding information corresponding to the optimized path from the object to the product based on the path model includes:
[0025] For any two merged path branches in the path model, codes are assigned to these two path branches based on their position order in the path model. Among any two merged path branches, one path branch is coded as 0, while the other path branch is coded as 1.
[0026] Determine the optimized path from the object to the product in the path model, and determine the path encoding information of the optimized path from the object to the product based on the encoding of each path branch on the optimized path.
[0027] Another possible implementation includes:
[0028] The weight coefficients of the object are stored in the product structure information of the product.
[0029] In another possible implementation, before generating the product structure information containing the path encoding information corresponding to the object, the method further includes:
[0030] Obtain the basic product structure information of the product, which includes the attributes of at least one object required by the product and the association relationship of at least one object;
[0031] The generation of product structure information containing path encoding information corresponding to the object includes:
[0032] Based on the basic product structure information and the path encoding information of the at least one object, the product structure information of the product is generated.
[0033] Furthermore, this application also provides an apparatus for constructing product structure information, comprising:
[0034] An object information determination unit is used to determine at least one object that makes up the product and the attributes of the object, wherein the attributes of the object include the probability of using the object;
[0035] A weight determination unit is used to determine the weight coefficient of the object based on the usage probability of the object;
[0036] The model building unit is used to determine the path model of the product for each object based on the weight coefficient of the object. The path model is used to represent the optimized path from each object to the product.
[0037] The encoding determination unit is used to determine the path encoding information corresponding to the optimized path from the object to the product based on the path model.
[0038] The structure information generation unit is used to generate product structure information containing path encoding information corresponding to the object.
[0039] As can be seen from the above, in this application, after determining the objects required to constitute the product, the usage probability of each object is determined. Based on the weight coefficients of the objects determined by their usage probabilities, a path model for each object to construct the product can be determined. This path model can represent the optimized path for each object to constitute the product. Based on this path model, the path encoding information corresponding to the optimized path from each object to the product can be determined. The path encoding information of the optimized path can represent and reconstruct the optimized path for objects to construct the product. Therefore, when the product structure information includes the path encoding information corresponding to the objects, combining the path encoding information corresponding to the objects can more conveniently determine the optimized path from the objects to the product, reducing the complexity of determining the optimized path for objects to construct the product. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0041] Figure 1 This invention illustrates a flowchart of a method for constructing product structure information according to an embodiment of the present application.
[0042] Figure 2 This illustration shows yet another flowchart of the method for constructing product structure information provided in an embodiment of this application;
[0043] Figure 3 This illustration shows a schematic diagram of constructing a path model in an embodiment of this application;
[0044] Figure 4 This illustration shows yet another flowchart of the method for constructing product structure information provided in an embodiment of this application;
[0045] Figure 5 This illustrates yet another schematic diagram of constructing a path model in an embodiment of this application;
[0046] Figure 6 This illustration shows a schematic diagram of the composition of an apparatus for constructing product structure information provided in an embodiment of this application;
[0047] Figure 7 A schematic diagram of the composition structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0048] The solution presented in this application can quickly and efficiently determine the optimized path for assembling the product from its constituent objects based on the generated product structure information. For example, this application can be applied to determining the bill of materials for a product in the field of intelligent supply chain management.
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0050] like Figure 1 As shown, it illustrates a method for constructing product structure information according to this application. This application can be applied to electronic devices, such as personal computers or servers; it can also be applied to systems such as clusters of multiple electronic devices or cloud platforms, without limitation.
[0051] The method in this embodiment may include:
[0052] S101, determine at least one object that constitutes the product and the attributes of the object.
[0053] The objects that make up a product can be considered as materials such as components or parts required to construct the product, without any restrictions.
[0054] Among the properties of an object is the probability of its use.
[0055] The probability of an object's use represents the likelihood that the object will be used as a material in a product. The probability of an object's use can be obtained by combining statistics on object usage during the construction process of similar products; the specific method of obtaining this probability is not restricted.
[0056] Of course, an object's attributes can also include other attribute information such as the object's identifier and name, without any restrictions.
[0057] S102, determine the weight coefficient of the object based on the probability of its use.
[0058] It's understandable that the higher the probability of an object's usage, the greater the likelihood that the product will need to use that object, and thus the greater its impact on the product. Based on this, the weighting coefficient can be positively correlated with the object's usage probability.
[0059] For example, the usage probability of each object can be normalized, and the normalized usage probability can be used as the object's weight coefficient; alternatively, the object's usage probability can be multiplied by a set base value to determine the object's weight coefficient. Of course, there are other ways to determine the weight coefficient, and there are no restrictions on these methods.
[0060] S103, based on the weight coefficients of the objects, determine the path model for each object to build the product.
[0061] This path model is used to characterize the optimized path from each object to the product.
[0062] In this context, the optimized path from object to product refers to a more efficient or shorter path for constructing the product from the object. Therefore, the optimized path of an object can be the optimal or best path for constructing the product from the object. For example, the shortest path for constructing the product from the object can be considered the optimal path.
[0063] In this application, the path model for building the product by combining the weight coefficients of the objects can be comprehensively determined so that the object with the larger weight coefficient has the shortest path to the final product, and the path for building the product by each object can be optimized to obtain the optimal path for each object.
[0064] S104, Based on the path model, determine the path coding information corresponding to the optimized path from the object to the product.
[0065] Understandably, the path model reflects the various paths that construct the final product from different objects. In order to characterize the optimized path corresponding to each object in the path model and facilitate storage, it is necessary to determine the path encoding information corresponding to each optimized path in combination with the path model.
[0066] The path encoding information of the optimization path corresponding to each object is the encoded expression of the optimization path corresponding to that object, and the optimization path corresponding to that object in the path model can be restored through the path encoding.
[0067] For example, if the path model is a path model obtained through encoding, the path encoding information corresponding to the optimized path can be determined based on the encoding of each path branch on each optimized path.
[0068] If there is no encoding on each path branch in the path model, encoding values can be assigned to each path branch according to the encoding rules. Based on this, for the optimized path of each object, the encoding values of each path branch on the optimized path can be combined to form the path encoding of the optimized path.
[0069] S105, Generate product structure information containing path encoding information corresponding to the object.
[0070] This product structure information can be used to represent various information required to construct the product, such as the various objects needed to assemble the product, the quantity of each object, and the preorder and successor relationships between different objects. For example, this product structure information can be the product's bill of materials, or other forms, without limitation.
[0071] Research into current product structure information reveals that the Bill of Materials (BOM) is commonly used to represent information about objects and materials within a product. While the BOM primarily reflects the order of precedence and the usage ratio of objects, it fails to quickly reflect object priority or rapid substitution relationships. Therefore, determining optimal object paths requires constructing a BOM tree representing the order of precedence among objects within the entire BOM program. This tree is then recursively searched for each link within the BOM tree to ultimately determine the possible paths for each object to contribute to the product.
[0072] However, in practical applications, the product involves many parts and materials, and there are many situations where they are interchangeable. Therefore, each time the optimal path for building the product is determined, it is necessary to continuously recursively search all possible paths for building the product for each object, which results in a large amount of data processing and high complexity.
[0073] In this application, the product structure information includes the path coding information of each object required to build the product. Based on this, the optimal path for building the product from the objects can be determined by combining the path coding information of the objects, thus realizing a more convenient way to determine the optimal path for building the product from the objects.
[0074] In an alternative approach, the weight coefficients of the objects can also be stored in the product structure information of the product to gain a more complete understanding of the importance of each object to the product.
[0075] There are several possible ways to generate this product structure information.
[0076] In one possible implementation, this application can obtain basic product structure information of the product. This basic product structure information may include attributes of at least one object required by the product and the relationships between at least one object. For example, the basic product structure information may be a bill of materials that can be generated in a currently common manner. Based on this, this application can also combine the basic product structure information and the path encoding information of the at least one object to generate the product structure information of the product.
[0077] For example, after obtaining the basic product structure information, this application adds the path encoding information of each object to the basic product structure information to obtain the product structure information of the product.
[0078] As can be seen from the above, in this application, after determining the objects required to constitute the product, the usage probability of each object is determined. Based on the weight coefficients of the objects determined by their usage probabilities, a path model for each object to construct the product can be determined. This path model can represent the optimized path for each object to constitute the product. Based on this path model, the path encoding information corresponding to the optimized path from each object to the product can be determined. The path encoding information of the optimized path can represent and reconstruct the optimized path for objects to construct the product. Therefore, when the product structure information includes the path encoding information corresponding to the objects, combining the path encoding information corresponding to the objects can more conveniently determine the optimized path from the objects to the product, reducing the complexity of determining the optimized path for objects to construct the product.
[0079] There are also many possible ways to determine the path model in this application. For example, the weight coefficient of the object can be used as a basis to construct the coding path from each object in the product to the product using various coding methods.
[0080] The following explanation will illustrate one possible implementation method.
[0081] In one possible scenario, this application can iteratively merge at least one object based on the principle of merging the two objects with the smallest weight coefficients, until at least one object is merged into one object, thus obtaining a path model for iterative merging of the at least one object.
[0082] In the process of iteratively merging at least one object required to make up the product, after each new object is merged, it is necessary to add the new object to the remaining objects to be iteratively merged and continue to iterate.
[0083] It is understandable that through the iterative merging of at least one object, the final merged object represents the product. And through the iterative merging of at least one object, a path is actually constructed that includes different objects leading to this final merged object (i.e., the product), thus obtaining the path model.
[0084] To facilitate understanding, the solution of this application will be described below with reference to a specific implementation method for this possible situation. For example... Figure 2 As shown, it illustrates another flowchart of the method for constructing product structure information provided in this application embodiment. The method of this embodiment may include:
[0085] S201, Identify at least one object that constitutes the product and the attributes of the object.
[0086] Among the properties of an object is the probability of its use.
[0087] S202, determine the weight coefficient of an object based on the probability of its use.
[0088] For example, in one possible implementation, the sum of the weight coefficients of at least one object is 1.
[0089] S203, determine the object sorting of the at least one object according to the weight coefficient of the object.
[0090] For example, the objects can be sorted in descending order of their weight coefficients to obtain the object sorting of the at least one object.
[0091] S204 merges the last two objects in the object sorting into one object.
[0092] Among them, the two objects that are last in the object sorting can be called the first object and the second object, respectively. By merging the second object and the second object, a new merged object is obtained. This new object will be added to the remaining unmerged objects and the iterative merging will continue.
[0093] For example, if objects are sorted in descending order of their weight coefficients, then the last two objects in the sort are essentially the two objects with the smallest weight coefficients. In this case, the two objects with the smallest weight coefficients are merged each time.
[0094] In one possible scenario, to facilitate the subsequent determination of the path encoding information of the optimized path corresponding to each object based on the constructed path model, an encoding can be assigned to each path branch in the process of this application. For example, the encoding can be 0 or 1. Based on this, the constructed path model can represent the encoded path from each object to the product.
[0095] For example, for the last two objects in the object sorting, the code for the first path branch from the first object to the merged object can be set to 0, and the code for the second path branch from the second object to the merged object can be set to 1. The weight coefficient of the first object is not less than the weight coefficient of the second object. For instance, if the weight coefficients of the last two objects in the object sorting are 0.1 and 0.2, then the object with a weight coefficient of 0.1 is designated as the first object, and the object with a weight coefficient of 0.2 is designated as the second object.
[0096] S205, the sum of the weight coefficients of the two last objects is determined as the weight coefficient of the merged object.
[0097] For example, if the last two objects are the first object and the second object, then the sum of the weight coefficients of the first object and the second object is used to determine the weight coefficient of the merged object. For instance, if the weight coefficient of the first object is 0.1 and the weight coefficient of the second object is 0.2, then the weight coefficient of the merged object is 0.3.
[0098] S206, detect whether all objects are merged into one object during object sorting. If yes, obtain the path model of merging at least one object into one object through iteration, and execute step S208; if no, execute step S207.
[0099] In this context, the sorting of objects means that all objects are merged into one object, indicating that there are no more objects that can be merged. Specifically, the last two objects in the sorted object sequence are the only two objects in that sequence. In this case, after the last two objects are merged into one object, at least one object is ultimately merged into a single object.
[0100] In one implementation, if the weight coefficient of all objects constituting the product is 1, and each time the last two objects in the object sorting are merged into one object, the sum of the weight coefficients of the last two objects is used as the weight coefficient of the newly merged object. Therefore, after all objects are finally merged into one object, the weight coefficient of the final merged object should be 1. Based on this, step S206 can also be to determine whether the weight coefficient of the merged object is 1. If it is, then the object merging is considered complete, and the final merged object is the product.
[0101] S207, based on the weight coefficients of the merged objects, reorder the merged objects and the remaining objects in the sorting of the merged objects, sort the objects based on the reordered objects, and return to step S204.
[0102] It is understandable that if there are still objects that need to be merged in the object sorting, it means that there are still one or more objects remaining after merging. In this case, this application needs to combine the weight coefficients of the merged objects and re-sort the newly merged objects with the remaining objects in the object sorting, so that the re-sorted objects are also sorted according to the weight coefficients.
[0103] For example, the weight coefficients of the latest merged objects and the remaining unmerged objects in the current object sorting can be sorted in descending order of weight coefficient.
[0104] Understandably, since the reordered object sort contains at least two objects, the object merging operation in step S204 still needs to be performed to finally determine the merging path from all objects to the final merged product.
[0105] It is understandable that merging two objects each time is equivalent to merging two path branches. Therefore, by continuously iterating and merging the various objects that make up the product, the construction path from the objects to the final product can eventually be constructed.
[0106] Because this application incorporates object weight coefficients during path determination, continuously optimizing and merging paths between objects, the constructed path model is essentially an optimal binary tree structure. Therefore, the construction path corresponding to an object is also an optimized path for building the product. An optimized path can contain multiple path branches.
[0107] S208, based on the path model, determines the path coding information corresponding to the optimized path from the object to the product.
[0108] In one possible scenario, during the construction of the path model, each time an encoding is assigned to the path branch from the two objects to be merged to the newly merged object, the determined path model can represent the encoded path from each object to the product.
[0109] Accordingly, for each object, the path branches involved in the optimized path from the object to the product in the path model can be determined. Based on the encoding of each path branch on the optimized path of the object, the path encoding information of the optimized path corresponding to the object can be determined.
[0110] In another possible implementation, for any two merged path branches in the path model, codes are assigned to these two path branches based on their positional order within the path model. In any two merged path branches, one path branch has a code of 0, while the other has a code of 1. Correspondingly, for each object, an optimized path from the object to the product is determined within the path model, and the path coding information for the optimized path from the object to the product is determined based on the codes of each path branch on this optimized path.
[0111] In this possible implementation, a path model is first constructed, and then codes are assigned to each path branch in the path model. However, the rules for assigning codes to path branches can be similar to the previous implementation. For example, the positional order of path branches in the path model can represent the size relationship of the weight coefficients of the starting objects of the path branches. For two path branches that are merged, the code of the path branch with the smaller weight of the corresponding starting object can be set to 1, while the code of the other path branch can be set to 0.
[0112] In this context, the starting object of a path branch refers to the object connected to the unmerged end of the path branch. For example, if object A needs to be merged with object B into object C, then object A is the starting object in the path branch from object A to object C.
[0113] For example, the objects that make up a product include object A and object B, where object A has a lower weight coefficient than object B. When constructing the path model, if we sort the objects from left to right according to their weight coefficients from largest to smallest, then in the two branches that need to be merged, the path branch on the left will be encoded as 1, while the path branch on the right will be encoded as 0. Following this rule, object A is to the left of object B, and path branch a1 derived from object A is to the left of path branch a2 derived from object B.
[0114] Suppose that objects A and B need to be merged into a new object C. Then the path branch a1 from object A and the path branch a2 from object B are merged into one path branch. That is, the path branch from object A to object C is merged with the path branch from object B to object C. Path branch a1 can be assigned code 1, and path branch a2 can be assigned code 0.
[0115] Suppose path branches a1 and a2 merge into path branch a3. Then, suppose path branch a3 merges with path branch a4 into path branch a5. Finally, path branch a5 merges with path branch a6, completing the merging of all objects. Therefore, for object A, the optimized path for building the product from object A includes path branches a1, a3, and a5. Assuming the code for path branch a1 is 1, the code for path branch a3 is 1, and the code for path branch a5 is 0, then the path code corresponding to the optimized path for building the product from object A can be 011.
[0116] S209, Generate product structure information containing path encoding information corresponding to the object.
[0117] This process can be referred to in the relevant descriptions of the previous embodiments, and will not be repeated here.
[0118] For ease of understanding Figure 2 The solution of the embodiment will be described below with reference to an example.
[0119] Assume that the objects that make up the product include object 1, object 2, object 3, object 4 and object 5. Based on the usage probability of each of these 5 objects, the weight coefficients of each of these 5 objects are determined to be 0.4, 0.2, 0.2, 0.1 and 0.1 respectively.
[0120] Based on this, the iterative merging process for these 5 objects can be found in [reference needed]. Figure 3 As shown.
[0121] Depend on Figure 3 As can be seen, after sorting these 5 objects according to their weight coefficients from largest to smallest, the sorting order of these 5 objects is as follows: Figure 3 As shown on the leftmost side, the objects are sorted as object 1, object 2, object 3, object 4, and object 5 in that order. For ease of distinction, this sorting is called the first object sorting, and the subsequent sorting of objects is called the second object sorting, the third object sorting, and so on. Based on this, objects 4 and 5 are the last two in the first object sorting, and it can also be seen that objects 4 and 5 are the two objects with the smallest weight coefficients among the five objects.
[0122] Accordingly, objects 4 and 5 are merged, and the weight coefficient of the merged object is the sum of the weight coefficients of objects 4 and 5, which is 0.2. Figure 3 The dashed boxes pointing to Object 4 and Object 5 represent the merged object and its weight coefficient, as shown in the second column from the left with the dashed box containing the number 0.2. For ease of distinction, the merged object is referred to as Object 45.
[0123] Based on this, still following the order of weight coefficients from largest to smallest, the merged object 45, along with the remaining unmerged objects 1, 2, and 3, are reordered to form the second object: object 1, object 45, object 2, and object 3. Figure 3 The object is represented by a weight coefficient. Accordingly, in the second object sorting, objects 2 and 3 are last, so they are merged. The weight coefficient of the merged object (called object 23) is the sum of the weight coefficients of objects 2 and 3, which is 0.4. Figure 3 In the second column from left to right, the two weight coefficients representing object 2 and object 3 are merged into 0.4 within the dashed box in the third column.
[0124] Similar to the previous steps, the newly merged object 23, the previously merged object 45, and the remaining unmerged object 2 need to be reordered to obtain the third object order. The third object order is as follows: object 23, object 1, and object 45. The third object order is based on the consistent vertical position of the weight coefficients of these three objects in the third column from left to right.
[0125] Furthermore, for sorting the third object corresponding to the third column from left to right, the last two objects, namely object 1 and object 45, need to be merged, such as... Figure 3 As shown, the weight coefficient of 0.4 corresponding to object 1 and the weight coefficient of 0.2 corresponding to object 45 are merged to form object 145, which has a weight coefficient of 0.6.
[0126] Accordingly, the only remaining objects are the newly merged object 145 and object 23 from the third object sorting. Therefore, the next step is to directly merge these two objects to create a single object with a weight coefficient of 1, thus merging objects 1 to 5 in the product into one. Figure 3 The rightmost object, with a weight coefficient of 1.0, actually represents the product that needs to be built.
[0127] Depend on Figure 3 The iterative merging process shows that objects 1 to 5 are continuously iterated and merged until they are finally merged into one product. In essence, the paths from each object to the product can be constructed, thus obtaining... Figure 3 The path model is shown.
[0128] In addition, Figure 3 During path iteration, each time two objects are merged, the two path branches corresponding to the two objects can be assigned codes separately. Figure 3This is based on the order in which the two objects to be merged are sorted in the current object ranking. The path branch corresponding to the object that is ranked lower is assigned a code of 1, while the path branch corresponding to the object that is ranked higher is assigned a code of 0. For example, for objects 4 and 5, if object 4 is ranked higher than object 5, then the path branch derived from object 5 is assigned a code of 1, while the path branch derived from object 4 is assigned a code of 0, and so on, so that each path branch in the path model has a corresponding code.
[0129] Of course, in practical applications, after constructing the path model, for any two path branches that need to be merged, the order of their corresponding positions (e.g., ...) is then followed. Figure 3 The same principle applies to assigning codes to two path branches (the path branches derived from objects in the same column are also ordered from top to bottom), and the principle is similar, so it will not be elaborated here.
[0130] Combination Figure 3 It can be seen that, for object 5, the process from object 5 to the final product ( Figure 3 The optimized path (shown in the rightmost box with a 1.0 icon) includes all the path branches from object 5 along the arrows to the product, such as... Figure 3 The bolded arrows indicate the path branches to be pointed to. Figure 3 It can be seen that object 5 needs to go through 3 path merging to finally reach the product. Therefore, combined with the codes on each path branch from object 5 to the product, the path code of the optimized path corresponding to object 5 can be represented as: 011. This path code is obtained by merging the codes of each path branch in the direction from the product to object 5 according to the order of their codes.
[0131] Similarly, the path code corresponding to the optimized path of object 1 is 00, the path code corresponding to the optimized path of object 2 is 10, the path code corresponding to the optimized path of object 3 is 11, and the path code corresponding to the optimized path of object 4 is 010.
[0132] It is understandable that during the iterative merging of at least one object of a product, for each merge of two objects, the weight coefficient of the newly merged object may be the same as the weight coefficient of an object among the remaining unmerged objects in the most recent object sorting. For ease of distinction, the object among the remaining unmerged objects in the object sorting that has the same weight coefficient as the newly merged object is called the target object. Of course, there can be one or more target objects.
[0133] Based on this, when reordering the newly merged object with the remaining unmerged objects in the object sorting, the newly merged object can be placed before or after the target object, without any restriction.
[0134] However, the newly merged objects may have a different sorting order than the target objects, which could lead to differences in the optimized paths and corresponding path codes of the final objects.
[0135] The inventors of this application discovered through research that when the sorting order of the newly merged objects is the same as that of the target objects, the sorting order of the newly merged objects is placed before that of the target objects, which is more conducive to making the optimization path of the product objects the shortest and thus obtaining the optimal path for constructing the product from the objects.
[0136] Based on this, Figure 2 In this embodiment, during the process of reordering the merged objects and the remaining objects after merging, if there is a target object with the same weight coefficient as the merged object among the remaining objects after merging, the sorting order of the merged objects is set to be before that target object.
[0137] The following section uses one implementation method as an example, combined with a flowchart, to introduce the solution of this application.
[0138] like Figure 4 As shown, it illustrates another flowchart of a method for constructing product structure information according to this application. This embodiment may include:
[0139] S401, determine at least one object that makes up the product and the attributes of the object.
[0140] Among the properties of an object is the probability of its use.
[0141] S402, determine the weight coefficient of an object based on the probability of its use.
[0142] Among them, the sum of the weight coefficients of at least one object is 1.
[0143] S403, determine the object sorting of the at least one object according to the object's weight coefficient in descending order.
[0144] S404, merge the last object and the second object in the object sorting into one object, and determine the sum of the weight coefficients of the first object and the second object as the weight coefficient of the merged object.
[0145] In this context, the first object is listed before the second object in the object sorting process. For example... Figure 3 As shown, for objects 4 and 5 that need to be merged, object 4 is the first object, and object 5 is the second object.
[0146] S405, set the code of the first path branch from the first object to the merged object to 0, and set the code of the second path branch from the second object to the merged object to 1.
[0147] Still with Figure 3 For objects 4 and 5, the path branch originating from object 4 is encoded as 0, while the path branch originating from object 5 is encoded as 1.
[0148] S406, check if the weight coefficient of the newly merged object is 1. If it is, use the most recently merged object to represent the product and obtain the path model of the product constructed by each object, and execute step 408; if not, execute step S407.
[0149] If the weight coefficient of the newly merged object is 1, it means that the various objects of the product are eventually merged into one object, that is, merged into the product, and thus the path model is obtained.
[0150] In the embodiments of this application, the constructed path model is actually an encoded path model, which is used to represent the encoded path from each object to the product.
[0151] S407, according to the weight coefficient from largest to smallest, reorder the most recently merged objects and other objects in the object sorting except the first and second objects, and return to the execution step S404 based on the reordered object sorting.
[0152] During the reordering process, if there is a target object with the same weight coefficient as the merged object among the other objects besides the first and second objects, the merged object will be ordered before the target object.
[0153] To better understand the benefits of having the newly merged objects sorted before the target objects, we will continue to discuss this further below. Figure 3 To illustrate with examples, in Figure 3 In the example, the objects that compose the product can include: object 1 through object 5. Furthermore, by... Figure 3 It can be seen that after merging two objects each time, if the weight coefficient of the newly merged object is the same as that of the target object among the remaining objects in the object sorting, then during resorting, the newly merged object will be placed before the target object.
[0154] like Figure 3 As shown, after merging objects 4 and 5, the weight coefficient of the merged object is 0.2. The remaining unmerged objects include objects 1, 2, and 3, and the weight coefficient of objects 2 and 3 is also 0.2. In this case, the newly merged object will be ranked before objects 2 and 3. Figure 3The second column from left to right with numbers in the box indicates that object 23, which is the result of merging object 2 and object 3, is a dashed box with the number 0.2. This dashed box is located above the solid box indicating the corresponding number 0.2 for object 2 and object 3.
[0155] Similarly, when iterating to the point where objects 2 and 3 need to be merged, the weight coefficient of object 23, resulting from the merger of object 2 and object 3, is 0.4, while the weight coefficient of object 1, which remains in the object sorting, is also 0.4. Therefore, the newly merged object 23 will be placed before object 1, as shown below. Figure 3 As shown in the third column from left to right, the dashed box with the number 0.4 represents the newly merged object 23, which is located above the solid box with the number 0.4 corresponding to object 1.
[0156] like Figure 5 As shown, it illustrates another schematic diagram of building a path model based on objects 1 to 5.
[0157] exist Figure 5 In this process, after merging two objects to create a new object, during the reordering process, if there is a target object with the same weight coefficient as the merged object among the other objects besides the first and second objects, the merged object will be ordered after the target object.
[0158] like Figure 5 As shown, after merging objects 4 and 5, the weight coefficient of the merged object 45 is 0.2. This newly merged object 45 has the same weight coefficient as objects 2 and 3. Therefore, when reordering objects 1, 2, 3, and the newly merged object 45, object 45 will be placed after objects 2 and 3. Figure 5 The second column from left to right shows the boxes with numbers. The dashed box with the number 0.2 corresponding to object 45 is located below the solid boxes with the number 0.2 corresponding to objects 2 and 3.
[0159] Based on this, the second object, after reordering Object 1, Object 2, Object 3, and the newly merged Object 45, is ordered as: Object 1, Object 2, Object 3, Object 45. This is consistent with... Figure 3 The sorting order obtained by the reordering is different: object 1, object 45, object 2, object 3.
[0160] Correspondingly, in Figure 5Based on this, the second object is sorted as follows: Object 1, Object 2, Object 3, Object 45. The last two objects in the sort are Object 3 and Object 45, so they need to be merged to obtain the merged object 345, which has a weight coefficient of 0.4. Therefore, when sorting the remaining Object 1, Object 2, and Object 345, since both Object 1 and Object 345 have a weight coefficient of 0.4, Object 345 is placed after Object 1. The resulting third object sort is: Object 1, Object 345, Object 2. Figure 5 As shown in the third column from the left, the dashed box with the number 0.4 in this column represents the weight coefficient of object 345. Based on this, the final result is obtained through continuous iteration. Figure 5 The path model is shown.
[0161] contrast Figure 3 and Figure 5 It can be seen that the path models obtained by using two different reordering methods during object iteration and merging are different. Furthermore, a comparison... Figure 3 The optimization path from object 5 to product and Figure 5 The optimization path from object 5 to the product, such as Figure 3 and Figure 5 As shown by the bolded lines, Figure 3 The optimization path from the object to the product is shorter, which is an optimal path.
[0162] pass Figure 3 as well as Figure 5 The path encoding corresponding to the optimized path of object 5 can also be explained. Figure 3 The method is better, such as in Figure 3 The path code for the optimized path of object 5 is 011, while... Figure 5 The path code for the optimized path of object 5 is 0011. Figure 5 The optimized path for object 5 has a longer path encoding length, while Figure 3 The optimized path for object 5 has a shorter path encoding.
[0163] and, Figure 5 The average length of the path encoding for each object in the code is also greater than Figure 3 The average length of the path encoding for each object in the dataset.
[0164] S408, For any object that assembles the product, determine each path branch involved in the optimized path from the object to the product in the path model, and determine the path coding information of the optimized path from the object to the product based on the coding on each path branch in the optimized path corresponding to the object.
[0165] The path model constructed in this application is essentially an optimal binary tree built based on the weight coefficient probability of each object. Objects with high weight coefficients use shorter codes, while those with low weight coefficients use longer codes, thereby reducing the average expected length of the encoded string.
[0166] In this embodiment, the optimization is actually based on Huffman coding. The path compression is achieved by combining the idea of Huffman coding to obtain the optimal path for each object to build the product, and finally obtain the encoded representation of each optimal path.
[0167] Correspondingly, the path encoding information based on the optimized path of each object can provide a reliable basis for quickly determining the optimal construction path of the object based on the path encoding information in the product structure information.
[0168] S409, Generate product structure information containing path encoding information for each object.
[0169] As shown above, in this embodiment, the product structure information is supplemented with path encoding information for the optimized paths corresponding to each object used to build the product. Based on the path encoding information, the optimized path for building the product by that object can be reconstructed.
[0170] Steps S408 and S409 can be found in the relevant descriptions of the previous embodiments, and will not be repeated here.
[0171] Corresponding to the method for constructing product structure information in this application, this application also provides an apparatus for constructing product structure information.
[0172] like Figure 6 The diagram illustrates a structural composition of an apparatus for constructing product structure information according to an embodiment of this application. The apparatus in this embodiment may include:
[0173] The object information determination unit 601 is used to determine at least one object that makes up the product and the attributes of the object, wherein the attributes of the object include the probability of using the object.
[0174] The weight determination unit 602 is used to determine the weight coefficient of the object based on the usage probability of the object;
[0175] The model building unit 603 is used to determine the path model of the product for each object based on the weight coefficient of the object, and the path model is used to characterize the optimized path from each object to the product;
[0176] The encoding determination unit 604 is used to determine the path encoding information corresponding to the optimized path from the object to the product based on the path model;
[0177] The structure information generation unit 605 is used to generate product structure information containing path encoding information corresponding to the object.
[0178] In one possible implementation, the model building unit is specifically used to iteratively merge the at least one object based on the principle of merging the two objects with the smallest weight coefficients, until the at least one object is merged into one object, thereby obtaining a path model for iterative merging of the at least one object.
[0179] In yet another possible implementation, the model building unit includes:
[0180] An object sorting unit is used to determine the object sorting of the at least one object according to the weight coefficient of the object;
[0181] The object merging unit is used to merge the last two objects in the object sorting into one object;
[0182] The iterative control unit is used to determine the sum of the weight coefficients of the last two objects as the weight coefficient of the merged object, and based on the weight coefficient of the merged object, to reorder the merged object and the remaining objects in the object sorting. Based on the reordered object sorting, the operation of the object sorting unit is returned until all objects in the object sorting are merged into one object, thus obtaining the path model of the iterative merging of the at least one object.
[0183] In another possible implementation, the iterative control unit is further configured to, during the process of reordering the merged objects and the remaining objects after merging in the object sorting, if there is a target object among the remaining objects after merging that has the same weight coefficient as the merged objects, set the sorting order of the merged objects to be before the target object.
[0184] In yet another possible implementation, the device further includes:
[0185] The path encoding unit is used to set the encoding of the first path branch from the first object to the merged object to 0 and the encoding of the second path branch from the second object to the merged object to 1 after the object merging unit merges the last two objects in the object sorting into one object. The first object and the second object are the last two objects in the object sorting, and the weight coefficient of the first object is not less than the weight coefficient of the second object.
[0186] The path model obtained by the iterative control unit is used to characterize the coded path from each object to the product.
[0187] In another possible implementation, the encoding determination unit includes:
[0188] The branch determination subunit is used to determine each path branch involved in the optimized path from the object to the product in the path model;
[0189] The first encoding determination subunit is used to determine the path encoding information of the optimized path from the object to the product based on the encoding on each path branch in the optimized path corresponding to the object.
[0190] In yet another possible implementation, the encoding determination unit includes:
[0191] The coding allocation subunit is used to assign codes to any two merged path branches in the path model based on their position order in the path model. In any two merged path branches, one path branch is coded as 0, while the other path branch is coded as 1.
[0192] The second encoding determination subunit is used to determine the optimized path from the object to the product in the path model, and to determine the path encoding information of the optimized path from the object to the product based on the encoding of each path branch on the optimized path.
[0193] In yet another possible implementation, the device further includes:
[0194] A coefficient storage unit is used to store the weight coefficients of the object into the product structure information of the product.
[0195] In yet another possible implementation, the device further includes:
[0196] The basic structure acquisition unit is used to obtain basic product structure information of the product before the structure information generation unit generates product structure information containing path encoding information corresponding to the object. The basic product structure information includes the attributes of at least one object required by the product and the association relationship of at least one object.
[0197] The structure information generation unit includes:
[0198] The structure information generation subunit is used to generate product structure information of the product based on the basic product structure information and the path encoding information of the at least one object.
[0199] Furthermore, this application also provides an electronic device, such as Figure 7 As shown, it illustrates a schematic diagram of the composition structure of the electronic device. The electronic device can be any type of electronic device, and the electronic device includes at least a processor 701 and a memory 702.
[0200] The processor 701 is used to execute the method for constructing product structure information as described in any of the above embodiments.
[0201] The memory 702 is used to store the programs required for the processor to perform operations.
[0202] It is understood that the electronic device may also include a display unit 703 and an input unit 704.
[0203] Of course, the electronic device can also have more than Figure 7 There are no restrictions on the number of components, whether more or fewer.
[0204] On the other hand, this application also provides a computer-readable storage medium storing at least one instruction, at least one program, code set, or instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the method for constructing product structure information as described in any of the above embodiments.
[0205] This application also proposes a computer program comprising computer instructions stored in a computer-readable storage medium. When executed on an electronic device, the computer program performs the method for constructing product structure information as described in any of the above embodiments.
[0206] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. Furthermore, the features described in the various embodiments of this specification can be substituted or combined with each other, enabling those skilled in the art to implement or use this application. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0207] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, 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 a process, method, article, or apparatus. Without further limitations, 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 the element.
[0208] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. 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 this application. Therefore, this application 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.
[0209] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for constructing product structure information, comprising: Identify at least one object that constitutes a product and the attributes of the object, the attributes of the object including the probability of use of the object; wherein, the object constituting the product is a component or part required to construct the product; The weight coefficient of the object is determined based on the probability of its use. Based on the weight coefficients of the objects, a path model for constructing the product is determined for each object. The path model is used to represent the optimized path from each object to the product. Based on the path model, determine the path encoding information corresponding to the optimized path from the object to the product; Generate product structure information containing the path encoding information corresponding to the object; The step of determining the path model for constructing the product based on the weight coefficients of the objects includes: Based on the principle of merging the two objects with the smallest weight coefficient, the at least one object is iteratively merged until the at least one object is merged into one object, thus obtaining the path model for the iterative merging of the at least one object.
2. The method according to claim 1, wherein the principle of merging the at least one object based on the two objects with the smallest weight coefficient, and iteratively merging the at least one object until the at least one object is merged into one object, includes: The object sorting of the at least one object is determined according to the weight coefficient of the object; Merge the last two objects in the sorted object sequence into one object; The sum of the weight coefficients of the last two objects is determined as the weight coefficient of the merged object. Based on the weight coefficient of the merged object, the merged object and the remaining objects in the object sorting are re-sorted. Based on the sorted objects obtained by re-sorting, the operation of merging the last two objects in the object sorting into one object is returned to be executed until all objects in the object sorting are merged into one object.
3. According to the method of claim 2, during the process of reordering the merged objects and the remaining objects after merging in the sorting of the merged objects, if there is a target object among the remaining objects after merging that has the same weight coefficient as the merged objects, the sorting order of the merged objects is set to be before the target object.
4. The method according to claim 2, after merging the last two objects in the object sorting into one object, further comprising: Set the code of the first path branch from the first object to the merged object to 0, and set the code of the second path branch from the second object to the merged object to 1. The first object and the second object are the two objects that are last in the object sorting, and the weight coefficient of the first object is not less than the weight coefficient of the second object. The path model is used to characterize the encoded path from each of the objects to the product.
5. The method according to claim 4, wherein determining the path encoding information corresponding to the optimized path from the object to the product based on the path model includes: Identify each path branch involved in the optimized path from the object to the product in the path model; Based on the codes on each path branch in the optimized path corresponding to the object, the path coding information of the optimized path from the object to the product is determined.
6. The method according to claim 2, wherein determining the path encoding information corresponding to the optimized path from the object to the product based on the path model includes: For any two merged path branches in the path model, codes are assigned to these two path branches based on their position order in the path model. Among any two merged path branches, one path branch is coded as 0, while the other path branch is coded as 1. Determine the optimized path from the object to the product in the path model, and determine the path encoding information of the optimized path from the object to the product based on the encoding of each path branch on the optimized path.
7. The method according to claim 1, further comprising: The weight coefficients of the object are stored in the product structure information of the product.
8. The method according to claim 1, further comprising, before generating product structure information containing path encoding information corresponding to the object: Obtain the basic product structure information of the product, which includes the attributes of at least one object required by the product and the association relationship of at least one object; The generation of product structure information containing path encoding information corresponding to the object includes: Based on the basic product structure information and the path encoding information of the at least one object, the product structure information of the product is generated.
9. An apparatus for constructing product structure information, comprising: An object information determination unit is used to determine at least one object constituting a product and the attributes of the object, wherein the attributes of the object include the probability of use of the object; wherein, the object constituting the product is a component or part required to construct the product; A weight determination unit is used to determine the weight coefficient of the object based on the usage probability of the object; The model building unit is used to determine the path model of the product for each object based on the weight coefficient of the object. The path model is used to represent the optimized path from each object to the product. The model building unit determines the path model for constructing the product based on the weight coefficients of the objects. Specifically, it is used to: iteratively merge at least one object based on the principle of merging the two objects with the smallest weight coefficients until at least one object is merged into one object, thereby obtaining the path model of the iteratively merged at least one object; the encoding determination unit is used to determine the path encoding information corresponding to the optimized path from the object to the product based on the path model. The structure information generation unit is used to generate product structure information containing path encoding information corresponding to the object.
Citation Information
Patent Citations
Method and device used for generating schema of not-only-structured-query-language database
CN105095237A
Object attribute determination method and device, computer equipment and storage medium
CN113656589A