A method and device for generating a product structure tree
By configuring data using template files and Excel spreadsheets, the system generates the structure tree name of the ship product structure tree and maps the node tree, solving the problem of complex and time-consuming structure tree creation in existing technologies and achieving efficient and clear structure tree generation.
Patent Information
- Application Number
- CN202111525094.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-14
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2041-12-14
AI Technical Summary
In existing technologies, the creation process of ship product structure trees is complex and time-consuming, resulting in low production design efficiency and a high susceptibility to errors.
By obtaining the root node cell and structure tree cell from the template file, configuring data in an Excel spreadsheet, generating the structure tree name of the product structure tree, and mapping it to generate the node tree, the process of creating the structure tree is simplified.
It enables the automatic generation of product structure trees, improving creation efficiency, reducing data input, providing a clear hierarchical structure, and shortening creation time.
Smart Images

Figure CN114185894B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of structure tree design, and in particular to a method and device for generating a product structure tree. Background Art
[0002] Usually, product assembly involves many parts and components, and the creation of the assembly structure tree is complex. Taking ship products as an example, the average number of nodes in a ship product structure tree is as many as hundreds. The chief process engineer and professional supervisor manually create nodes one by one, so it takes a long time to create the assembly structure tree, which is inefficient and easily affects the smooth progress of production design work. When the chief process engineer and professional supervisor manually create nodes, if there is no pre-prepared template file as a reference, the efficiency of creating the assembly structure tree will be lower and more prone to errors; if a template file is pre-prepared as a reference, after creating an assembly structure tree in the template file, another assembly structure tree must be created in the assembly software, resulting in duplication of work.
[0003] Therefore, how to simplify the creation process of the structure tree is a technical problem that needs to be solved urgently. Summary of the invention
[0004] In view of the above technical problems, a method and device for generating a product structure tree of the present invention simplifies the creation process of the structure tree.
[0005] The embodiment of the present invention provides the following solution:
[0006] In a first aspect, an embodiment of the present invention provides a method for generating a product structure tree, comprising:
[0007] Acquire a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data;
[0008] Generate a structure tree name of the product structure tree according to the text data in the root node cell;
[0009] According to the distributed structure tree data, a node tree is generated by mapping, wherein the node information of the node tree corresponds to the structure tree data one by one;
[0010] The product structure tree is obtained according to the structure tree name and the node tree.
[0011] In an optional embodiment, obtaining the template file includes:
[0012] Create an Excel table;
[0013] Configure the cells in the first column of the Excel table as the root node cells, and input the text data into the root node cells;
[0014] Configure cells in other columns of the Excel table as the structure tree cells, and input the structure tree data into the structure tree cells, wherein the number of columns of the structure tree cells corresponds to the level of the node tree;
[0015] The template file is obtained according to the text data and the structure tree data.
[0016] In an optional embodiment, generating a structure tree name of the product structure tree according to the text data in the root node cell includes:
[0017] Traverse the root node cell to obtain the text data;
[0018] The text data is extracted as the structure tree name.
[0019] In an optional embodiment, mapping and generating a node tree according to the distributed structure tree data includes:
[0020] Acquire a plurality of structure tree data, wherein the plurality of structure tree data include node texts distributed in m columns and n rows, where m and n are integers not less than 1;
[0021] Generate a current level node according to the node text existing in the current column;
[0022] Determine the parent node attachment position of the current level node according to the node text existing in the current row;
[0023] The node tree is generated according to the parent node attachment position and the current level node.
[0024] In an optional embodiment, determining the parent node attachment position of the current level node according to the node text in the current row includes:
[0025] Get the current node text, wherein the current node text is the node text existing in any cell in the current row;
[0026] Determine whether there is an adjacent node text in the adjacent cell of the previous column of the current node text;
[0027] If so, determining that the first node is the parent node attachment position of the current level node, wherein the first node is the current level node corresponding to the adjacent node text;
[0028] If not, then determine that the second node is the parent node attachment position of the current level node, wherein the second node is the current level node corresponding to the node text that appears most recently when searching upward from the adjacent cells in the previous column.
[0029] In an optional embodiment, generating the node tree according to the parent node attachment position and the current level node includes:
[0030] According to the parent node mounting position, obtaining the mounting parent node of the current level node;
[0031] All the current level nodes are correspondingly mounted to all the mounting parent nodes to obtain the node tree.
[0032] In an optional embodiment, the step of correspondingly attaching all the current level nodes to all the attachment parent nodes includes:
[0033] Repeat the following steps until all the current level nodes are mounted:
[0034] Obtain the attachment property of the attachment parent node;
[0035] If the current attachment attribute meets the attachment condition, the current level node is attached to the corresponding attachment parent node;
[0036] If the current mounting attribute does not meet the mounting condition, the current mounting attribute is updated to meet the mounting condition of the parent node mounting position, and then the current level node is mounted to the corresponding mounting parent node.
[0037] In a second aspect, an embodiment of the present invention further provides a device for generating a product structure tree, including:
[0038] An acquisition module, used for acquiring a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data;
[0039] A first generating module, used for generating a structure tree name of the product structure tree according to the text data in the root node cell;
[0040] A second generating module is used to map and generate a node tree according to the distributed structure tree data, wherein the node information of the node tree corresponds to the structure tree data one by one;
[0041] The obtaining module is used to obtain the product structure tree according to the structure tree name and the node tree.
[0042] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0043] Memory for storing computer programs;
[0044] A processor is used to execute the computer program to implement the steps of any method described in the first aspect.
[0045] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of any one of the methods described in the first aspect.
[0046] Compared with the prior art, the method and device for generating a product structure tree provided by the present invention have the following advantages:
[0047] The present invention generates a structure tree name of a product structure tree through text data in a root node cell, maps and generates a node tree through structure tree data in a template file, and constructs a product structure tree consistent with the template file through the structure tree name and the node tree. Since the node tree is generated by mapping, if multiple child nodes in the structure tree data correspond to one parent node, only one parent node needs to be input, and the structure tree data input by the template file is more intuitive and has a clearer hierarchical structure, thereby simplifying the creation process of the structure tree. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a method for generating a product structure tree provided by an embodiment of the present invention;
[0050] Figure 2 A schematic diagram of the format of a template file provided in an embodiment of the present invention;
[0051] Figure 3 A dialog box diagram of the operation interface in CATIA provided by an embodiment of the present invention;
[0052] Figure 4 A parent-child node logical relationship diagram in CATIA provided by an embodiment of the present invention;
[0053] Figure 5 A schematic diagram of a primary structure product structure tree provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of a secondary structure product structure tree provided by an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of a three-level product structure tree provided in an embodiment of the present invention;
[0056] Figure 8 A schematic diagram of a four-level product structure tree provided in an embodiment of the present invention;
[0057] Fig. 9 A flowchart of generating a product structure tree in CATIA provided in an embodiment of the present invention;
[0058] Fig.10 A schematic diagram of the structure of a device for generating a product structure tree provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0059] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention belong to the scope of protection of the embodiments of the present invention.
[0060] Those skilled in the art will appreciate that the method for generating a product structure tree in the embodiment of the present invention can be applied to the generation and creation of product structure trees in a variety of design software. The following will take the V6 version of CATIA engineering software as an example to specifically explain how to apply it to the generation of an assembly structure tree for ship products.
[0061] See also Figure 1 , Figure 1 A flowchart of a method for generating a product structure tree provided by an embodiment of the present invention includes:
[0062] S11, obtaining a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data;
[0063] Specifically, the settings of the root node cell and the structure tree cell in the template file can set the template format according to the needs. For example, if you need to generate a vertically expanded product structure tree, the template format of the template file can be set to vertical hierarchical distribution, where the structure tree data in each layer corresponds to the level of the product structure tree, and the root node cell is set in the first column of the template file. Of course, if you need to generate a horizontally expanded product structure tree, the template format of the template file can be set to horizontal hierarchical distribution, and the root node cell is set in the first row of the template file.
[0064] For ship products, the structure tree data involves various systems of the ship. In the actual process of creating the product structure tree, the chief process engineer creates the basic framework of the product structure tree, and the professional supervisor refines the sub-structure tree of his or her profession. The number of levels of the product structure tree they create may be inconsistent, which may easily cause hierarchy confusion and lead to errors in the creation of the product structure tree.
[0065] In a specific implementation, obtaining a template file includes: creating an Excel table; configuring cells in the first column of the Excel table as root node cells, and inputting text data into the root node cells; configuring cells in other columns of the Excel table as structure tree cells, and inputting structure tree data into the structure tree cells, wherein the number of columns of the structure tree cells corresponds to the level of the node tree; and obtaining the template file according to the text data and the structure tree data.
[0066] For details, please refer to Figure 2 , the root node cell is set as column A. In order to facilitate the corresponding input of text data, the header of the root node cell is set with "root node"; the structure tree cell includes columns B to E, and the header of each column is set with a corresponding level. The number of columns of the structure tree cell corresponds to the level of the node tree, which is convenient for improving the accurate and efficient input of the structure tree data. Based on the Excel table, the template file is obtained, and the corresponding columns can be classified, summarized or hidden, so it has good scalability and can compile Excel tables with the first layer, the second layer, the third layer and the fourth layer respectively according to actual needs. If the chief process engineer or professional supervisor only needs to create one layer of product structure tree, the relevant structure tree data is filled in the "first layer" column of the Excel template; if a two-layer product structure tree is to be created, the relevant structure tree data is filled in the first layer and the second layer columns of the Excel table, and so on. Of course, it is also possible to adopt the method that after the chief process engineer creates each level, the professional supervisor of each system enters the structure tree data accordingly, so as to accurately input the data into the template file. After obtaining the template file, step S12 is entered.
[0067] S12. Generate a structure tree name of the product structure tree according to the text data in the root node cell.
[0068] Specifically, the initial creation of the product structure tree is based on the command loading of the engineering software. CATIA software is composed of many functional application modules. Each functional application module contains a series of sections (Section) representing different functional categories, and each section contains a series of icon instructions (Command) to implement different functions. The functional command menus in CATIA are composed of sections and icon instructions. CATIA secondary development program CAA provides an implementation method for customizing functional command menus. In the CAA development method, at least one framework, that is, an engineering project (Framework), must be created. According to different functional modules, multiple modules (Module) are created in the engineering project, and icon instructions and dialog boxes can be customized to add to the modules.
[0069] Combined with the product structure tree, the function requirements are automatically created. When implementing the function command menu, the defined programs and configuration files are shown in Table 1 below.
[0070] Table 1:
[0071]
[0072] The file names in the above table can be defined according to the actual situation in actual applications. PipeSection.cpp mainly implements the definition of new Sections and Commands, as well as the combination of Sections and multiple different Commands. Files with suffixes in CATNls and CATRsc formats are resource files. Their names must be consistent with the resource file names in PipeSection.cpp. They mainly implement the Chinese and English name declarations of Sections, as well as the icons, Chinese and English names, and prompt information declarations of Commands. The image name in png format must be consistent with the name of the image pointed to in TSTCommandHeader.CATRsc. It is the icon displayed by each Command.
[0073] The above file configuration can be used to generate the product structure tree function command menu. Based on the defined file template and function command menu, the product structure tree can be automatically generated in CATIA. The main operation interface is a dialog box. For details, please refer to Figure 3 In this interface, the chief process engineer or professional supervisor only needs to select the root node attribute and the imported template file in CATIA to realize the automatic generation of the product assembly structure tree. When creating a product structure tree, select the root node attribute in CATIA through the dialog box. The root node attribute is the specific application scenario of the product structure tree, which can be assembly attributes or electrical attributes, etc. The structure tree name of the product structure tree is generated according to the text data in the root node cell.
[0074] In a specific implementation, generating a structure tree name of a product structure tree according to text data in a root node cell includes: traversing the root node cell to obtain text data; and extracting the text data as a structure tree name.
[0075] Specifically, there is only one text data in the root node cell. The text data can be in the column of the root node cell, or it can be filled in a fixed position in the root node cell, such as the cell in the first column and the second row. The column of the root node cell is only used for identification. The text data for recording the name of the generated structure tree is recorded. Please continue to refer to Figure 2 , extract and generate the structure tree name through the text data "WS001" in the node cell. After the structure tree name is generated, go to step S13.
[0076] S13, mapping and generating a node tree according to the distributed structure tree data, wherein the node information of the node tree corresponds one-to-one to the structure tree data;
[0077] Specifically, the node information of each node in the node tree is the text corresponding to each node in the node tree. Figure 6 , Figure 6 The generated node tree is Figure 2 The structure tree data in the mapping is generated. The structure tree name is "WS001A.1", which is generated by extracting the text data of the root node cell in the template file. The node information is generated one by one from the corresponding structure tree data. For example, the structure tree data "WS001-22000" in row 2 of column B corresponds to the generated node information "WS001-22000A.1". The generation by mapping can reduce the input amount of structure tree data. When there are multiple child nodes corresponding to one parent node, you only need to input the structure tree data of the parent node once, which effectively reduces the input amount of data, and the distribution level of several structure tree data is clearer and more concise.
[0078] In a specific implementation, a node tree is mapped and generated based on a number of distributed structure tree data, including: obtaining a number of structure tree data, wherein the number of structure tree data includes node texts distributed in m columns and n rows, and m and n are integers not less than 1; generating a current level node based on the node text existing in the current column; determining a parent node attachment position of the current level node based on the node text existing in the current row; and generating a node tree based on the parent node attachment position and the current level node.
[0079] Specifically, the node text in the current column corresponds to the generated current node. The node tree is a multi-level structure. Please continue to refer to Figure 2 and Figure 6 , Figure 2 The node text of the first layer corresponds to Figure 6The first-level node in the , the second-level node corresponding to the node text in the second layer, and so on. The parent node attachment position is the parent node of each current node, Figure 2 The current level node corresponding to the node text in the left column is the parent node of the current level node corresponding to the node text in the right column. After determining the parent node corresponding to each current level node, each current level node can be connected to generate a node number.
[0080] In the template file, the structure tree data is distributed in the structure tree cells. To reduce the workload of node text input, the node text existing in the current column generates the current level node correspondingly. Each current level node needs to determine the attachment position of its parent node.
[0081] In a specific implementation, the parent node attachment position of the current level node is determined based on the node text existing in the current row, including: obtaining the current node text, wherein the current node text is the node text existing in any cell in the current row; determining whether there is an adjacent node text in the adjacent cell in the previous column of the current node text; if so, determining the first node as the parent node attachment position of the current level node, wherein the first node is the current level node corresponding to the adjacent node text; if not, determining the second node as the parent node attachment position of the current level node, wherein the second node is the current level node corresponding to the node text that appeared most recently by searching upward from the adjacent cell in the previous column.
[0082] Specifically, Figure 2 For example, the node text "WS001-Ⅱ General Section" in the 3rd row of column C has the 3rd row of column B as the previous adjacent cell, and there is no adjacent node text in this cell. Then the parent node mounting position corresponding to the current level node of "WS001-Ⅱ General Section" is the current level node of "WS001-22000". The node text "WS001-40010" in the 7th row of column C has the 7th row of column B as the previous adjacent cell, and there is an adjacent node text "WS001-10" in this cell. Then the parent node mounting position corresponding to the current level node of "WS001-40010" is the current level node of "WS001-10". This method can quickly determine the parent node mounting position of each current level node, while reducing the workload of the node text input template file.
[0083] In a specific implementation, a node tree is generated according to the parent node mounting position and the current level node, including: obtaining the mounting parent node of the current level node according to the parent node mounting position; mounting all current level nodes to all mounting parent nodes to obtain a node tree.
[0084] Specifically, after determining the attachment position of the parent node of each current-level node, all current-level nodes are correspondingly attached to all attachment parent nodes, and thus the creation of the node tree can be completed.
[0085] The product structure tree created in CATIA for assembly classes is composed of multiple "physical products", each of which corresponds to an assembly part. If the chief process engineer or professional supervisor manually creates the product structure tree, multiple "physical products" are inserted under the corresponding current level node. If the manual node insertion action needs to be automatically completed by a computer program, it must comply with the program processing logic when inserting the node.
[0086] In a specific implementation, all current-level nodes are correspondingly mounted to all mounting parent nodes, including: repeatedly performing the following steps until all current-level nodes are mounted:
[0087] Get the attachment property of the attachment parent node; if the current attachment property meets the attachment condition, attach the current level node to the corresponding attachment parent node; if the current attachment property does not meet the attachment condition, update the current attachment property to meet the attachment condition of the parent node attachment position, and then attach the current level node to the corresponding attachment parent node.
[0088] For details, please refer to Figure 4 In CATIA, nodes of the "Physical Product" type have two states, namely VPMReference (reference) and VPMInstence (instance), and these two states have their own independent attribute information. When creating a next-level node of a "Physical Product", its default state is VPMReference. If you want to insert the node under a parent node, you must change its state from VPMReference to VPMInstence, otherwise the insertion cannot be achieved. By updating the attributes, the smooth attachment of each current-level node can be completed. It should be noted that since the structure tree name (or root node) of the node tree is not under any node, its state is still VPMReference.
[0089] S14. Obtain the product structure tree according to the structure tree name and the node tree.
[0090] Specifically, you can obtain the product structure tree by attaching the node tree to the structure tree name. Figures 5 to 8 The product structure tree can generate a product structure tree of a primary structure, a product structure tree of a secondary structure, a product structure tree of a tertiary structure, and a product structure tree of a quaternary structure according to the structure tree data mapping in the template file. Of course, the product structure tree generation method of the embodiment of the present invention can also generate product structures of more levels.
[0091] Take the ship assembly product structure tree as an example. Figure 7The structure tree name "WS001A.1" is the design name of the ship, "WS001-22000A.1" is the hull system, the sub-nodes of the hull system "WS001-I block" is the bow block, "WS001-II block" is the stern block, "WS001-III block" is the side block, "WS001-32000" is the cabin, "WS001-10" is the power system, and the sub-nodes of the power system correspond to the engine, gearbox, etc. Those skilled in the art can understand that the specific application products can also be generated for the product structure tree of related products such as automobiles and machine tools.
[0092] When generating a product structure tree in CATIA, the specific implementation process can be found in Fig. 9 First, create an Excel table outside CATIA, input text data and structure tree data accordingly to obtain a template file; then start the product structure tree creation program in CATIA, select the root node attribute, define the specific application scenario of the product structure tree, select the template file of the previously input data, click the "OK" button, import it into CATIA, and the product structure tree can be automatically generated.
[0093] Based on the same inventive concept as the generation method, the embodiment of the present invention also provides a device for generating a product structure tree, see Fig.10 ,include:
[0094] The acquisition module 101 is used to acquire a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data;
[0095] A first generating module 102, used to generate a structure tree name of the product structure tree according to the text data in the root node cell;
[0096] The second generating module 103 is used to map and generate a node tree according to the distributed structure tree data, wherein the node information of the node tree corresponds to the structure tree data one by one;
[0097] The obtaining module 104 is used to obtain the product structure tree according to the structure tree name and the node tree.
[0098] Based on the same inventive concept as the generating method, an embodiment of the present invention further provides an electronic device, including:
[0099] Memory for storing computer programs;
[0100] A processor is used to execute the computer program to implement the steps of any method described in the generation method.
[0101] Based on the same inventive concept as the generating method, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any method described in the generating method are implemented.
[0102] The technical solution provided in the embodiments of the present invention has at least the following technical effects or advantages:
[0103] 1. Generate the structure tree name of the product structure tree through the text data in the root node cell, map the structure tree data in the template file to generate the node tree, and build a product structure tree consistent with the template file through the structure tree name and the node tree. Since the node tree is generated by mapping, if multiple child nodes in the structure tree data correspond to one parent node, you only need to enter the parent node once. The structure tree data entered in the template file is more intuitive and the hierarchical structure is clearer, thus simplifying the process of creating the structure tree.
[0104] 2. A standardized and scalable file template was established through Excel tables, which enabled the automatic generation of a product structure tree and effectively improved creation efficiency. For example, when creating a product structure tree with 40 nodes, the time required was shortened from more than 10 minutes to less than 5 seconds.
[0105] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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.
[0106] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (modules, systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded computer, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0107] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0108] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0109] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.
[0110] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for generating a product structure tree, characterized in that: include: Acquire a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data; Generate a structure tree name of the product structure tree according to the text data in the root node cell; According to the distributed structure tree data, a node tree is generated by mapping, wherein the node information of the node tree corresponds to the structure tree data one by one; Obtain the product structure tree according to the structure tree name and the node tree; The step of mapping and generating a node tree according to the distributed structure tree data includes: Acquire a plurality of structure tree data, wherein the plurality of structure tree data include node texts distributed in m columns and n rows, where m and n are integers not less than 1; Generate a current level node according to the node text existing in the current column; Determine the parent node attachment position of the current level node according to the node text existing in the current row; Generate the node tree according to the parent node attachment position and the current level node; The step of determining the parent node attachment position of the current level node according to the node text existing in the current row includes: Get the current node text, wherein the current node text is the node text existing in any cell in the current row; Determine whether there is an adjacent node text in the adjacent cell of the previous column of the current node text; If so, determining that the first node is the parent node attachment position of the current level node, wherein the first node is the current level node corresponding to the adjacent node text; If not, determining that a second node is the parent node attachment position of the current level node, wherein the second node is the current level node corresponding to the node text that appears most recently found upward from the adjacent cells in the previous column; The step of generating the node tree according to the parent node attachment position and the current level node includes: According to the parent node mounting position, obtaining the mounting parent node of the current level node; All the current level nodes are correspondingly mounted to all the mounting parent nodes to obtain the node tree.
2. The method for generating a product structure tree according to claim 1, characterized in that: The obtaining of the template file comprises: Create an Excel table; Configure the cells in the first column of the Excel table as the root node cells, and input the text data into the root node cells; Configure cells in other columns of the Excel table as the structure tree cells, and input the structure tree data into the structure tree cells, wherein the number of columns of the structure tree cells corresponds to the level of the node tree; The template file is obtained according to the text data and the structure tree data.
3. The method for generating a product structure tree according to claim 1, characterized in that: The step of generating a structure tree name of the product structure tree according to the text data in the root node cell includes: Traverse the root node cell to obtain the text data; The text data is extracted as the structure tree name.
4. The method for generating a product structure tree according to claim 1, characterized in that: The step of correspondingly mounting all the current level nodes to all the mounting parent nodes includes: Repeat the following steps until all the current level nodes are mounted: Obtain the attachment property of the attachment parent node; If the current attachment attribute meets the attachment condition, the current level node is attached to the corresponding attachment parent node; If the current attachment attribute does not satisfy the attachment condition, the current attachment attribute is updated to satisfy the attachment condition of the parent node attachment position, and then the current level node is attached to the corresponding attachment parent node.
5. A device for generating a product structure tree, characterized in that: The generating device is a device corresponding to any generating method of claims 1 to 4, comprising: An acquisition module, used for acquiring a template file, wherein the template file includes a root node cell and a structure tree cell, and the structure tree cell contains a plurality of structure tree data; A first generating module, used for generating a structure tree name of the product structure tree according to the text data in the root node cell; A second generating module is used to map and generate a node tree according to the distributed structure tree data, wherein the node information of the node tree corresponds to the structure tree data one by one; The obtaining module is used to obtain the product structure tree according to the structure tree name and the node tree.
6. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Multiuser cooperative table processing method, device and equipment
CN108363732A
An implementation method of a component type custom product structure tree
CN109446719A