Method, device and equipment for generating structure tree based on table file
By automatically parsing and linking the hierarchical identifiers and path information in the table file, a structure tree is generated, which solves the problems of low efficiency and insufficient accuracy in building product structure trees in the existing technology. It realizes efficient and accurate structure tree generation, improving design efficiency and data consistency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- AVATR CO LTD
- Filing Date
- 2026-01-19
- Publication Date
- 2026-05-29
AI Technical Summary
Existing technologies for building product structure trees are inefficient and inaccurate. Manual construction methods are difficult to meet the needs of efficient and accurate design for complex products, and problems such as misjudgment of hierarchy, omissions, disordered order, non-standard naming, and duplicate or missing files exist.
By obtaining a table file containing hierarchical identifiers, component names, and path fields, the system automatically parses and generates component files, links them based on hierarchical relationships, and generates a structure tree, thus avoiding errors from manual operations.
It enables efficient and accurate generation of tree structures, eliminates hierarchical misjudgments and file errors, improves design efficiency and data consistency, and reduces human error.
Smart Images

Figure CN122113853A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, specifically to a method, apparatus, and device for generating a structure tree based on a table file. Background Technology
[0002] The electronic prototype constructs a complete product structure tree to clarify the hierarchical assembly relationships between parts, components, and subsystems. This structure tree serves not only as a blueprint in the design phase but also as the foundation for subsequent simulation analysis, process planning, manufacturing execution, and supply chain management.
[0003] However, with the increasing complexity of products (e.g., a complete automobile contains tens of thousands of parts), the current manual structure tree construction model is no longer able to meet the needs of efficient and accurate design. Summary of the Invention
[0004] In view of the above problems, embodiments of the present invention provide a method, apparatus and device for generating a structure tree based on a table file, which is used to solve the technical problems of low efficiency and accuracy in constructing a product structure tree in the prior art.
[0005] According to one aspect of the present invention, a method for generating a structure tree based on a table file is provided, the method comprising:
[0006] Obtain a table file to be processed containing preset fields, including: a hierarchy identifier field, a component name field, and a path field;
[0007] The hierarchical relationship between the various components in the table file is determined based on the hierarchical identifier field.
[0008] Based on the path field and the component name field, generate the corresponding component file;
[0009] Based on the hierarchical relationship between the components, the corresponding component files are linked to generate a structure tree.
[0010] According to another aspect of the present invention, an apparatus for generating a structure tree based on a table file is provided, comprising:
[0011] The acquisition module is used to acquire a table file to be processed containing preset fields, including: a hierarchy identifier field, a component name field, and a path field;
[0012] The determination module is used to determine the hierarchical relationship between various components in the table file based on the hierarchical identifier field.
[0013] The first generation module is used to generate the corresponding component file based on the path field and the component name field;
[0014] The second generation module is used to link the corresponding component files and generate a structure tree based on the hierarchical relationship between the various components.
[0015] According to another aspect of the present invention, an electronic device is provided, including: a processor, a memory, a communication interface, and a communication bus, wherein the processor, the memory, and the communication interface communicate with each other through the communication bus;
[0016] The memory is used to store at least one executable instruction that causes the processor to perform the operation of the table file-based structure tree generation method.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein at least one executable instruction is stored therein;
[0018] When the executable instructions are executed on the table file-based structure tree generation device / electronic device, the table file-based structure tree generation device / electronic device causes the table file-based structure tree generation device / electronic device to perform the operations of the table file-based structure tree generation method described above.
[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program that, when executed by a processor, causes a table file-based structure tree generation apparatus / electronic device to perform the operation of the above-described method.
[0020] This invention provides an embodiment of a table file containing preset fields, including a hierarchy identifier field, a component name field, and a path field. Based on the hierarchy identifier field, the hierarchical relationship between components in the table file is determined. Based on the path field and component name field, corresponding component files are generated. Based on the hierarchical relationship between components, the corresponding component files are linked to generate a structure tree. This solution first parses and establishes the hierarchical assembly relationship between components, thereby eliminating potential hierarchical misjudgments, omissions, or sequence errors that may occur during manual data interpretation and organization. Then, based on the parsed path and name information, corresponding component files are automatically generated, avoiding problems such as non-standard naming, incorrect storage paths, and duplicate or missing files that may occur when manually creating files. Finally, based on the established hierarchical relationship, the assembly linking between component files is automatically completed, overcoming operational errors such as incorrect assembly, omissions, and incorrect link pointers that are prone to occur during manual drag-and-drop assembly.
[0021] The above description is merely an overview of the technical solutions of the embodiments of the present invention. In order to better understand the technical means of the embodiments of the present invention and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0022] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0023] Figure 1 A flowchart of the first embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown;
[0024] Figure 2 A schematic diagram of the hierarchical relationship provided by the present invention is shown;
[0025] Figure 3 A schematic diagram of the structure tree provided by the present invention is shown;
[0026] Figure 4 A flowchart of a second embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown;
[0027] Figure 5 A flowchart of a third embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown;
[0028] Figure 6 A flowchart of the fourth embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown;
[0029] Figure 7 A schematic diagram of an embodiment of the structure tree generation apparatus based on a table file provided by the present invention is shown;
[0030] Figure 8 A schematic diagram of an embodiment of the electronic device provided by the present invention is shown. Detailed Implementation
[0031] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein.
[0032] In product design, especially in the design of complex machinery, aerospace, and automotive products, CATIA, as a mainstream 3D design software, uses its product structure tree as the core framework of the entire digital model. It clearly defines the hierarchical assembly relationships between products, components, and parts, serving as the foundation for design, analysis, process planning, and manufacturing.
[0033] Currently, creating product structure trees in the CATIA environment, especially for large assemblies containing hundreds or thousands of parts with complex hierarchical relationships, mainly relies on manual operations by designers. The typical workflow is:
[0034] Designers first organize the product hierarchy data in Excel based on the bill of materials, then return to CATIA to manually create components level by level and one by one, and organize them to the correct hierarchical positions by dragging and dropping.
[0035] However, this method currently has the following significant drawbacks:
[0036] 1) Extremely inefficient and time-consuming: For large and complex products, manually creating and organizing the structure tree is a heavy and repetitive task that requires designers to spend a lot of time and energy, seriously slowing down the overall product design process.
[0037] 2) Highly prone to errors and poor data consistency: Human operation inevitably leads to oversights, such as incorrect or missing parts, or incorrect hierarchical relationships. If these errors are not detected in time, they will directly cause deviations in downstream simulation analysis, process design, and even manufacturing processes, resulting in huge rework costs and delays in the production schedule.
[0038] 3) Difficulties in modification and collaboration: When design changes occur, modifications to the Bill of Materials (BOM) or Excel list cannot be automatically synchronized to the CATIA structure tree. Designers must perform tedious manual searches and modifications again, making version control difficult and making it hard to guarantee real-time synchronization and consistency between the design data source (Excel) and the 3D model (CATIA).
[0039] 4) Difficulty in knowledge transfer and standardization: Manual operation relies on the personal experience and habits of designers, making it difficult to form standardized and reusable processes, which is not conducive to the accumulation and transfer of corporate design standards and knowledge.
[0040] Based on the above-mentioned technical problems, the technical concept of this invention is as follows: First, the product structure information is pre-structured in an external table file. By defining hierarchical identifier fields, component name fields, and path fields, the assembly logic that originally relied on the designer's experience and manual operation is transformed into explicit data that can be automatically parsed by the program. Then, by reading and parsing the hierarchical identifier fields in the table, the complete parent-child and sibling relationships of components are automatically reconstructed, thereby replacing the manual judgment and organization of hierarchical relationships. Next, based on the predefined paths and names in the table, component files are automatically created in batches and accurately, replacing the manual creation and naming of each one. Finally, based on the parsed hierarchical relationship data, the assembly link between component files is realized, thereby replacing the tedious and error-prone manual drag-and-drop and pairing process.
[0041] The technical concept of the present invention has been briefly introduced above. The technical solution of the present invention will be described in detail below through specific embodiments. The subject of the present invention is an electronic device. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.
[0042] Figure 1 A flowchart illustrating a first embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown, as follows: Figure 1 As shown, the method includes the following steps:
[0043] Step 11: Obtain the table file to be processed containing preset fields;
[0044] The preset fields include: hierarchy identifier field, component name field, and path field;
[0045] In this step, a table file (e.g., Excel) containing preset key fields is obtained. These preset fields include at least: a hierarchy identifier field (used to indicate the hierarchy of the component, such as 1, 2, 3), a component name field (used to define the name of the component in the system, i.e., data naming), and a path field (used to specify the storage address of the component file on the computer or server).
[0046] This table file serves as the sole structured data input source for the entire automation process. By reading this file, all the basic information needed to subsequently build the structure tree can be obtained.
[0047] Optionally, the default fields also include: a link identifier field and a creation identifier field.
[0048] In this implementation, to further enhance the flexibility and automation of the structure tree construction, the preset fields may also include: a link identifier field and a creation identifier field. The link identifier field (e.g., represented by 0 or 1) is used to precisely control whether the component file corresponding to the row needs to establish a link relationship with its parent component, thereby achieving partial association or selective assembly; the creation identifier field (also represented by 0 or 1) is used to indicate whether the component file corresponding to the row needs to be actually created under a specified path, allowing users to pre-plan in the table but not immediately generate certain components, or skip existing files.
[0049] Table 1 shows a schematic diagram of the Excel architecture provided by this invention. As shown in Table 1, the architecture is as follows:
[0050] Table 1
[0051]
[0052] As shown in the table above, each row contains the following information: 1) Hierarchy: represented by 1, 2, 3, 4... where 1 represents the first level, 2 represents the second level, and so on. One or more child levels corresponding to a parent should be on the next line or more lines below the parent. If the file has no child levels, the next line should be the corresponding peer or parent level file; 2) Data Naming: The name set when creating the CATIA file; 3) Storage Location: The file location where the CATIA file is created; 4) Linking: represented by 0 or 1, where 0 indicates that the CATIA file corresponding to this line does not need to be linked with the parent level, and 1 indicates that it needs to be linked; 5) Creation: represented by 0 or 1, where 0 indicates that the CATIA file corresponding to this line does not need to be created in the corresponding path, and 1 indicates that it needs to be created.
[0053] Step 12: Determine the hierarchical relationship between the various components in the table file based on the hierarchy identifier field;
[0054] In this step, the hierarchy identifier field in the table file to be processed is read, and the parent-child hierarchy relationship and assembly order between all components in the file are determined by parsing the value of this field (e.g., a sequence of numbers).
[0055] That is, based on the increment and arrangement rules of the hierarchical numbering, it is usually automatically inferred which component belongs to which superior component, thereby constructing a complete and logically clear multi-level component relationship model in memory.
[0056] For example, Figure 2 A schematic diagram of the hierarchical relationship provided by the present invention is shown, such as... Figure 2 As shown, the 1 on the left has two children corresponding to the 2, and the 1 on the right has one child corresponding to the 2. The principle is similar downwards.
[0057] Step 13: Generate the corresponding component file based on the path field and component name field;
[0058] In this step, based on the path field and part name field of each record in the table file to be processed, the corresponding CATIA part file is automatically created or generated at the specified path location.
[0059] That is, the component name field is used to name the file, while the path field determines the directory where the file is stored.
[0060] Optionally, one possible implementation of step 13 could be:
[0061] Step 1: Determine if the first value of the creation identifier field is the preset creation value;
[0062] In this implementation, the creation identifier field of each record in the table file to be processed is read, and its value (i.e., the first value) is compared with the preset creation value (i.e., defined as 1 in the above embodiment).
[0063] This implementation allows users to flexibly control which components need to be actually generated, and which are only used as logical nodes in the structural relationship or not generated at all, by editing the table data in step 14 above.
[0064] Step 2: If the first value is the preset creation value, create the component file according to the location indicated by the path field. The file name of the component file is determined based on the component name field.
[0065] In this implementation, when the above condition is met (i.e., the first value is the preset creation value), the file creation process will be initiated.
[0066] Based on the directory address explicitly indicated by the path field in the current line, locate the target folder; simultaneously, generate the corresponding file according to the name defined in the part name field. Finally, create a CATIA part file with the part name as its reference in the specified path.
[0067] Correspondingly, if the first value is not the preset creation value, the creation process for that line will not be executed.
[0068] Step 14: Based on the hierarchical relationship between the components, link the corresponding component files to generate a structure tree.
[0069] In this step, after the component files are generated, the lower-level component files are automatically linked to their corresponding parent components according to the hierarchical relationship between the components determined in step 12. This organizes all the independent component files according to the preset hierarchical structure, and finally generates a complete product structure tree that is completely consistent with the table data.
[0070] Optionally, one possible implementation of linking the corresponding component files based on the hierarchical relationship between the various components in step 14 could be:
[0071] Step 1: Determine if the second value of the link identifier field is the preset link value;
[0072] In this implementation, the value of the link identifier field in the current row record (i.e., the second value) is checked and compared with the preset link value (e.g., the preset link value is 1).
[0073] This decision logic allows users to precisely specify which components need to establish assembly links with their parent components, and which components do not, by configuring the table data in step 14.
[0074] For example, some standard or purchased parts may only need to exist as BOM entries and do not need to be actually linked into the assembly structure.
[0075] Step 2: If the second value is a preset link value, link the current component file to its parent component file according to the hierarchical relationship.
[0076] In this implementation, when the link condition is met (i.e., the second value equals the preset link value), an automatic linking operation will be performed.
[0077] First, based on the parent-child relationship between components determined by the hierarchy identifier field in the table (e.g., the current component is level 3, and its parent is a level 2 component), locate the current component file and its corresponding parent component file from the generated or existing files. Then, invoke the link function to automatically assemble and link the current component as a child item to its parent component.
[0078] Correspondingly, if the second value is not a preset link value, the linking process for that line will not be executed.
[0079] Optionally, one possible implementation of step 14 is to link the corresponding component files using 3D design software to generate a structure tree based on the hierarchical relationship between the components.
[0080] In this implementation, the logical hierarchical relationship is transformed into the implementation of the physical three-dimensional assembly structure. That is, based on the hierarchical relationship between the various components that has been previously analyzed and determined, the application programming interface of the target three-dimensional design software (such as CATIA) is driven.
[0081] Using the linking, inserting, or assembling commands provided by the software, the independent component files already generated in the corresponding paths are automatically and sequentially linked and assembled according to predefined parent-child hierarchical relationships. Ultimately, this process creates a product structure tree in the assembly module of the 3D design software, containing a complete hierarchical structure and correct assembly constraints between the components.
[0082] For example, Figure 3 A schematic diagram of the structure tree provided by the present invention is shown, as follows: Figure 3 As shown, Figure 3 The file icon in the image represents a component file, and the corresponding white overlay indicates the file name.
[0083] The method for generating a structure tree based on a table file provided in this invention obtains a table file to be processed containing preset fields, including a hierarchy identifier field, a component name field, and a path field. Based on the hierarchy identifier field, the hierarchical relationship between each component in the table file is determined. Based on the path field and component name field, corresponding component files are generated. Based on the hierarchical relationship between each component, the corresponding component files are linked to generate a structure tree. This solution first parses and establishes the hierarchical assembly relationship between each component, thereby eliminating potential hierarchical misjudgments, omissions, or disordered sequences that may occur during manual data interpretation and organization. Then, based on the parsed path and name information, corresponding component files are automatically generated, avoiding problems such as non-standard naming, incorrect storage paths, and duplicate or missing files that may occur when manually creating files. Finally, based on the established hierarchical relationship, the assembly linking between component files is automatically completed, overcoming operational errors such as incorrect assembly, omissions, and incorrect link pointers that are prone to occur during manual drag-and-drop assembly.
[0084] Based on the above embodiments, Figure 4 A flowchart of a second embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown, as follows: Figure 4 As shown, step 12 may include the following steps:
[0085] Step 41: Construct a hierarchical dictionary, which is used to reflect the hierarchical relationship of components;
[0086] In this step, an empty dictionary, called the hierarchy dictionary, is initialized. The core function of this hierarchy dictionary is to record the complete parent chain of the currently processed component during the traversal of the aforementioned table file.
[0087] For example, when processing a level 3 component, the dictionary will store key information (such as name and path) of its corresponding level 1 and level 2 parent components, forming a structure like {1:A_path, 2:B_path, 3:C_path}.
[0088] Step 42: Read the table file to be processed line by line, and update the hierarchy dictionary according to the third value of the hierarchy identifier field of the current row;
[0089] In this step, the table file to be processed is read line by line. For each line, the value of its hierarchy identifier field is read (e.g., 1, 2, 3...).
[0090] Based on this value, the hierarchy dictionary is updated in real time. That is, if the current hierarchy value is greater than the maximum existing hierarchy value in the hierarchy dictionary, it means that a new sublevel has been encountered and a new entry needs to be added to the hierarchy dictionary; if the current hierarchy value is less than or equal to an existing hierarchy value, it means that a higher level has been returned to, and the hierarchy dictionary needs to be truncated and the corresponding values of that level and subsequent levels need to be updated.
[0091] Optionally, the third value of the hierarchy identifier field conforms to the numeric sequence rule;
[0092] In the numerical sequence rules, the size of the numbers represents the hierarchical depth, and the order of the numbers represents the parent-child and sibling relationships between components.
[0093] In this implementation, the size of the number in the number sequence rule directly represents the hierarchical depth of the component in the structure tree. For example, 1 represents the root node or the first-level component, 2 represents the second-level sub-component, and the larger the number, the deeper the hierarchy.
[0094] Meanwhile, the order in which numbers are arranged in the table rows (e.g., following a preorder traversal or a specific sequence pattern) strictly defines the parent-child and sibling relationships between components. For example, a component at level 3 must have its parent as the last component at level 2 immediately above it, while its sibling components are those at the same level and adjacent to it.
[0095] Step 43: After the table file to be processed is read, determine the hierarchical relationship between each component based on the latest hierarchy dictionary.
[0096] In this step, once the entire table file to be processed has been read, the dynamically updated hierarchy dictionary has fully recorded the nested hierarchical paths of all components in the file. By parsing this final hierarchy dictionary, it is possible to definitively deduce which component is the direct parent of any given component, as well as all its ancestor components.
[0097] In this way, the hierarchical relationship (i.e., parent-child and sibling relationship) between all components is determined, providing a precise and reliable assembly relationship for the subsequent automatic file linking (i.e., the implementation of step 14).
[0098] The method for generating a structure tree based on a table file provided in this invention constructs a hierarchical dictionary to reflect the hierarchical relationships between components. The method reads the table file to be processed line by line, updating the hierarchical dictionary based on the third value of the hierarchical identifier field of the current row. After the table file is read, the hierarchical relationships between each component are determined based on the latest hierarchical dictionary. This scheme pre-constructs and dynamically maintains a hierarchical dictionary to reflect and update the hierarchical relationships between components. During the process of reading the table file line by line, the dictionary is updated in real time based on the value of the hierarchical identifier field of the current row. Finally, after the table is read, the hierarchical affiliation and assembly relationships between all components are automatically determined based on the latest dictionary content. This achieves efficient, accurate, and automated generation from structured table data to a multi-level structure tree, effectively avoiding the tediousness and errors of manual step-by-step creation, and significantly improving the efficiency and consistency of digital design for complex products.
[0099] Based on the above embodiments, Figure 5 A flowchart of a third embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown, as follows: Figure 5 As shown, one implementation example of dictionary construction logic is as follows:
[0100] Step 51, Begin;
[0101] Step 52: Initialize the dictionary (i.e., the hierarchical dictionary): {};
[0102] Step 53: Obtain the current level;
[0103] Step 54: Does the dictionary contain the current level? If not, proceed to step 55; if yes, proceed to step 57.
[0104] Step 55: Add the current level to the dictionary;
[0105] Step 56: Add the current path and name to the corresponding dictionary; then proceed to step 58.
[0106] Step 57: Update the current path and name to the corresponding dictionary;
[0107] Step 58: Remove items from the dictionary that are lower than this level;
[0108] Step 59, End.
[0109] Based on the above embodiments, Figure 6 A flowchart of a fourth embodiment of the method for generating a structure tree based on a table file provided by the present invention is shown, as follows: Figure 6 As shown, one implementation example of creating and connecting logic follows these steps:
[0110] Step 61, Begin;
[0111] Step 62: Traverse the ecxcel information;
[0112] Step 63: Create? If yes, proceed to step 64; if no, proceed to step 66.
[0113] Step 64: Obtain the storage path and file name;
[0114] Step 65: Automatically create and name the CATIA file in the specified path;
[0115] Step 66: Is it linked? If yes, proceed to step 67; if no, proceed to step 69.
[0116] Step 67: Search for the parent file path and name using the dictionary;
[0117] Step 68: Perform automatic linking of CATIA files;
[0118] Step 69, End.
[0119] The method for generating a structure tree based on a table file provided in this invention has the following technical effects:
[0120] Technical benefits: 1. Eliminates human error at the source, ensuring data accuracy;
[0121] Technical benefit 2: Improved efficiency and automation of design;
[0122] Technical advantage 3: Powerful processing capabilities, easily handling complex assembly;
[0123] Technical effect 4: Ensure data consistency.
[0124] Figure 7 A schematic diagram of an embodiment of the apparatus for generating a structure tree based on a table file provided by the present invention is shown. Figure 7 As shown, the device includes:
[0125] The acquisition module 71 is used to acquire a table file to be processed containing preset fields, including: a hierarchy identifier field, a component name field, and a path field;
[0126] Module 72 is used to determine the hierarchical relationship between various components in the table file based on the hierarchical identifier field.
[0127] The first generation module 73 is used to generate the corresponding component file based on the path field and the component name field;
[0128] The second generation module 74 is used to link the corresponding component files and generate a structure tree based on the hierarchical relationship between the various components.
[0129] Based on one or more embodiments, the preset fields also include: a link identifier field and a creation identifier field.
[0130] Based on one or more embodiments, the first generation module 73 generates a corresponding component file based on the path field and the component name field, specifically for including:
[0131] Determine if the first value of the creation identifier field is the preset creation value;
[0132] If the first value is the preset creation value, the component file is created according to the location indicated by the path field, and the file name of the component file is determined based on the component name field.
[0133] Based on one or more embodiments, the second generation module 74 links the corresponding component files based on the hierarchical relationship between the various components, specifically for:
[0134] Determine if the second value of the link identifier field is a preset link value;
[0135] If the second value is a preset link value, the current component file will be linked to its parent component file according to the hierarchical relationship.
[0136] Based on one or more embodiments, module 72 determines the hierarchical relationship between various components in the table file according to the hierarchical identifier field, specifically for:
[0137] Construct a hierarchical dictionary, which is used to reflect the hierarchical relationship of components;
[0138] Read the table file to be processed line by line, and update the hierarchy dictionary according to the third value of the hierarchy identifier field of the current row;
[0139] After the table file to be processed is read, the hierarchical relationship between each component is determined based on the latest hierarchical dictionary.
[0140] Based on one or more embodiments, the third value of the hierarchy identifier field conforms to the rules of numerical sequence;
[0141] In the numerical sequence rules, the size of the numbers represents the hierarchical depth, and the order of the numbers represents the parent-child and sibling relationships between components.
[0142] Based on one or more embodiments, the second generation module 74, based on the hierarchical relationship between various components, links the corresponding component files to generate a structure tree, specifically used for:
[0143] Based on the hierarchical relationship between the various components, the corresponding component files are linked using 3D design software to generate a structure tree.
[0144] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical element, or they can be physically separated. Furthermore, these modules can be implemented entirely in software through processing element calls, or entirely in hardware. Alternatively, some modules can be implemented through processing element calls in software, while others can be implemented in hardware. Moreover, these modules can be integrated together or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.
[0145] As can be seen from the above, the structure tree generation device based on table files provided in this embodiment of the invention first parses and establishes the hierarchical assembly relationship between each component, thereby eliminating the hierarchical misjudgment, omission, or disordered order that may occur when manually interpreting and organizing data; then, it automatically generates the corresponding component files based on the parsed path and name information, avoiding problems such as non-standard naming, incorrect storage paths, and duplicate or missing files that may occur when manually creating files; finally, it automatically completes the assembly link between component files based on the established hierarchical relationship, overcoming operational errors such as misassembly, omission, and incorrect link pointing that are prone to occur in manual drag-and-drop assembly.
[0146] Figure 8 A schematic diagram of an embodiment of the electronic device provided by the present invention is shown, such as... Figure 8 As shown, the electronic device includes: a processor 82, a communications interface 84, a memory 86, and a communications bus 88.
[0147] The processor 82, communication interface 84, and memory 86 communicate with each other via communication bus 88. Communication interface 84 is used to communicate with other network elements such as clients or other servers. The processor 82 executes program 80, specifically performing the relevant steps in the above method embodiments.
[0148] Specifically, program 80 may include program code, which includes computer-executable instructions.
[0149] Processor 82 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The electronic device includes one or more processors, which may be processors of the same type, such as one or more CPUs, or processors of different types, such as one or more CPUs and one or more ASICs.
[0150] Memory 86 is used to store program 80. Memory 86 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0151] Program 80 can be called by processor 82 to enable the electronic device (cloud server) to perform the following operations:
[0152] Obtain the table file to be processed containing preset fields, including: hierarchy identifier field, component name field, and path field;
[0153] The hierarchical relationship between the various components in the table file is determined based on the hierarchy identifier field.
[0154] Generate the corresponding component file based on the path field and component name field;
[0155] Based on the hierarchical relationship between the components, the corresponding component files are linked to generate a structure tree.
[0156] Based on one or more embodiments, the preset fields also include: a link identifier field and a creation identifier field.
[0157] Based on one or more embodiments, a corresponding component file is generated based on the path field and the component name field, including:
[0158] Determine if the first value of the creation identifier field is the preset creation value;
[0159] If the first value is the preset creation value, the component file is created according to the location indicated by the path field, and the file name of the component file is determined based on the component name field.
[0160] Based on one or more embodiments, the corresponding component files are linked according to the hierarchical relationship between the various components, including:
[0161] Determine if the second value of the link identifier field is a preset link value;
[0162] If the second value is a preset link value, the current component file will be linked to its parent component file according to the hierarchical relationship.
[0163] Based on one or more embodiments, the hierarchical relationship between various components in a table file is determined according to the hierarchical identifier field, including:
[0164] Construct a hierarchical dictionary, which is used to reflect the hierarchical relationship of components;
[0165] Read the table file to be processed line by line, and update the hierarchy dictionary according to the third value of the hierarchy identifier field of the current row;
[0166] After the table file to be processed is read, the hierarchical relationship between each component is determined based on the latest hierarchical dictionary.
[0167] Based on one or more embodiments, the third value of the hierarchy identifier field conforms to the rules of numerical sequence;
[0168] In the numerical sequence rules, the size of the numbers represents the hierarchical depth, and the order of the numbers represents the parent-child and sibling relationships between components.
[0169] Based on one or more embodiments, and according to the hierarchical relationship between the various components, the corresponding component files are linked to generate a structure tree, including:
[0170] Based on the hierarchical relationship between the various components, the corresponding component files are linked using 3D design software to generate a structure tree.
[0171] As can be seen from the above, the electronic device provided in this embodiment of the invention first parses and establishes the hierarchical assembly relationship between each component, thereby eliminating the hierarchical misjudgment, omission, or disordered order that may occur when manually interpreting and organizing data; then, it automatically generates corresponding component files based on the parsed path and name information, avoiding problems such as non-standard naming, incorrect storage paths, and duplicate or missing files that may occur when manually creating files; finally, it automatically completes the assembly link between component files based on the established hierarchical relationship, overcoming operational errors such as misassembly, omission, and incorrect link pointing that are prone to occur in manual drag-and-drop assembly.
[0172] This invention provides a computer-readable storage medium storing at least one executable instruction that, when executed on a table file-based structure tree generation apparatus / electronic device, causes the table file-based structure tree generation apparatus / electronic device to perform the table file-based structure tree generation method described in the above embodiments.
[0173] Specifically, the executable instructions can be used to cause the apparatus / electronic device that generates a table-file-based structure tree to perform the following operations:
[0174] Obtain the table file to be processed containing preset fields, including: hierarchy identifier field, component name field, and path field;
[0175] The hierarchical relationship between the various components in the table file is determined based on the hierarchy identifier field.
[0176] Generate the corresponding component file based on the path field and component name field;
[0177] Based on the hierarchical relationship between the components, the corresponding component files are linked to generate a structure tree.
[0178] Based on one or more embodiments, the preset fields also include: a link identifier field and a creation identifier field.
[0179] Based on one or more embodiments, a corresponding component file is generated based on the path field and the component name field, including:
[0180] Determine if the first value of the creation identifier field is the preset creation value;
[0181] If the first value is the preset creation value, the component file is created according to the location indicated by the path field, and the file name of the component file is determined based on the component name field.
[0182] Based on one or more embodiments, the corresponding component files are linked according to the hierarchical relationship between the various components, including:
[0183] Determine if the second value of the link identifier field is a preset link value;
[0184] If the second value is a preset link value, the current component file will be linked to its parent component file according to the hierarchical relationship.
[0185] Based on one or more embodiments, the hierarchical relationship between various components in a table file is determined according to the hierarchical identifier field, including:
[0186] Construct a hierarchical dictionary, which is used to reflect the hierarchical relationship of components;
[0187] Read the table file to be processed line by line, and update the hierarchy dictionary according to the third value of the hierarchy identifier field of the current row;
[0188] After the table file to be processed is read, the hierarchical relationship between each component is determined based on the latest hierarchical dictionary.
[0189] Based on one or more embodiments, the third value of the hierarchy identifier field conforms to the rules of numerical sequence;
[0190] In the numerical sequence rules, the size of the numbers represents the hierarchical depth, and the order of the numbers represents the parent-child and sibling relationships between components.
[0191] Based on one or more embodiments, and according to the hierarchical relationship between the various components, the corresponding component files are linked to generate a structure tree, including:
[0192] Based on the hierarchical relationship between the various components, the corresponding component files are linked using 3D design software to generate a structure tree.
[0193] As can be seen from the above, the structure tree generation device / electronic device based on table files provided in this embodiment of the invention first parses and establishes the hierarchical assembly relationship between each component, thereby eliminating the hierarchical misjudgment, omission, or disordered order that may occur when manually interpreting and organizing data; then, it automatically generates the corresponding component files based on the parsed path and name information, avoiding problems such as non-standard naming, incorrect storage paths, and duplicate or missing files that may occur when manually creating files; finally, it automatically completes the assembly link between component files based on the established hierarchical relationship, overcoming operational errors such as misassembly, omission, and incorrect link pointing that are prone to occur in manual drag-and-drop assembly.
[0194] This invention provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method for generating a structure tree based on a table file.
[0195] Its implementation principle and technical effects are as disclosed above.
[0196] The description of the various embodiments above tends to emphasize the differences between the various embodiments. The similarities or similarities between them can be referred to, and for the sake of brevity, they will not be repeated here.
[0197] The methods disclosed in the various method embodiments provided by this invention can be arbitrarily combined without conflict to obtain new method embodiments.
[0198] The features disclosed in the various product embodiments provided by this invention can be arbitrarily combined without conflict to obtain new product embodiments.
[0199] The features disclosed in the various method or device embodiments provided by the present invention can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0200] It should be noted that the aforementioned computer-readable storage media can be ROM, Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory, Optical Disc, or Compact Disc Read-Only Memory (CD-ROM), etc. It can also be various vehicles that include one or any combination of the above-mentioned storage media.
[0201] It should be noted that, in this document, 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. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0202] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0203] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware nodes. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, vehicle terminal, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0204] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0205] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0206] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The algorithms or displays provided herein for the functions specified in the boxes or boxes are not inherently related to any particular computer, virtual system, or other device. Furthermore, the embodiments of this invention are not directed to any particular programming language.
[0207] It should be noted that the above embodiments are illustrative of the invention and not restrictive, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
Claims
1. A method for generating a structure tree based on a table file, characterized in that, The method includes: Obtain a table file to be processed containing preset fields, including: a hierarchy identifier field, a component name field, and a path field; The hierarchical relationship between the various components in the table file is determined based on the hierarchical identifier field. Based on the path field and the component name field, generate the corresponding component file; Based on the hierarchical relationship between the components, the corresponding component files are linked to generate a structure tree.
2. The method according to claim 1, characterized in that, The preset fields also include: a link identifier field and a creation identifier field.
3. The method according to claim 2, characterized in that, The step of generating the corresponding component file based on the path field and the component name field includes: Determine whether the first value of the creation identifier field is a preset creation value; If the first value is the preset creation value, a component file is created according to the location indicated by the path field, and the file name of the component file is determined based on the component name field.
4. The method according to claim 2 or 3, characterized in that, The linking of corresponding component files based on the hierarchical relationship between various components includes: Determine whether the second value of the link identifier field is a preset link value; If the second value is the preset link value, the current component file is linked to its parent component file according to the hierarchical relationship.
5. The method according to any one of claims 1-3, characterized in that, Determining the hierarchical relationship between various components in the table file based on the hierarchical identifier field includes: Construct a hierarchical dictionary, which is used to reflect the hierarchical relationship of components; The table file to be processed is read line by line, and the hierarchy dictionary is updated according to the third value of the hierarchy identifier field in the current row; After the table file to be processed is read, the hierarchical relationship between the various components is determined according to the latest hierarchical dictionary.
6. The method according to claim 5, characterized in that, The third value of the hierarchy identifier field conforms to the rules of numerical sequence; In the numerical sequence rule, the size of the numbers represents the hierarchical depth, and the order of the numbers represents the parent-child and sibling relationships between components.
7. The method according to any one of claims 1-3, characterized in that, The process of linking the corresponding component files based on the hierarchical relationship between the various components to generate a structure tree includes: Based on the hierarchical relationship between the various components, the corresponding component files are linked using 3D design software to generate the structure tree.
8. A device for generating a structure tree based on a table file, characterized in that, The device includes: The acquisition module is used to acquire a table file to be processed containing preset fields, including: a hierarchy identifier field, a component name field, and a path field; The determination module is used to determine the hierarchical relationship between various components in the table file based on the hierarchical identifier field. The first generation module is used to generate the corresponding component file based on the path field and the component name field; The second generation module is used to link the corresponding component files and generate a structure tree based on the hierarchical relationship between the various components.
9. An electronic device, characterized in that, include: The processor, memory, communication interface, and communication bus are provided, wherein the processor, memory, and communication interface communicate with each other via the communication bus. The memory is used to store at least one executable instruction that causes the processor to perform the operation of the table file-based structure tree generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores at least one executable instruction; When the executable instructions are executed on the table file-based structure tree generation apparatus / electronic device, the table file-based structure tree generation apparatus / electronic device causes the table file-based structure tree generation apparatus / electronic device to perform the operation of the table file-based structure tree generation method as described in any one of claims 1-7.