Method and apparatus for constructing a hierarchical relationship tree, and electronic device

By automatically constructing a hierarchical relationship tree by obtaining location information from an Excel file, the inefficiency of existing technologies is solved, and efficient hierarchical relationship tree construction is achieved.

CN115345131BActive Publication Date: 2026-07-21QINGDAO HAIER TECH +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
QINGDAO HAIER TECH
Filing Date
2021-05-12
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, constructing a hierarchical relationship tree between target cells and various area components in an Excel file is inefficient and requires manual operation.

Method used

By obtaining the first position information of each region component and the second position information of the target cell in the Excel file, a hierarchical relationship is constructed based on the size of the region range, and a hierarchical relationship tree between the region components and the target cell is automatically built.

Benefits of technology

It improves the efficiency of building hierarchical relationship trees, realizes the automated hierarchical relationship tree building process, and reduces manual intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345131B_ABST
    Figure CN115345131B_ABST
Patent Text Reader

Abstract

The application relates to the computer technical field, in particular to a method for constructing a hierarchical relationship tree, which comprises the following steps: obtaining first position information of each area component in an Excel file, determining a target cell in the area component, and obtaining second position information of the target cell; the Excel file comprises multiple area components. The area range size corresponding to each area component is obtained according to the first position information. The hierarchical relationship between each area component is constructed according to the area range size, and the first position relationship between the target cell and each area component is obtained according to the second position information. The first hierarchical relationship tree between each area component and the target cell is constructed according to the hierarchical relationship and the first position relationship. The method can improve the efficiency of constructing the first hierarchical relationship tree between each area component and the target cell. The application also discloses a device for constructing a hierarchical relationship tree and an electronic equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, specifically to a method, apparatus, and electronic device for constructing a hierarchical relationship tree. Background Technology

[0002] Currently, Excel, as one of the most well-known digital office software, is used by a large number of users as a carrier for building and generating HTML pages. When generating HTML pages from Excel files, it is necessary to describe the relative positions of the web page layout. This process requires generating a hierarchical relationship tree between the target cells and the components of each area in Excel, and then describing the relative positions of the web page layout based on the hierarchical relationship tree.

[0003] In the process of implementing the embodiments of this disclosure, at least the following problems were found in the related art:

[0004] Current technology can only construct the hierarchical relationship tree between the target cell and each area component manually, which is inefficient. Summary of the Invention

[0005] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.

[0006] This disclosure provides a method, apparatus, and electronic device for constructing a hierarchical relationship tree, thereby improving the efficiency of constructing a hierarchical relationship tree between a target cell and various regional components.

[0007] In some embodiments, the method includes: obtaining first position information of each region component in an Excel file; determining a target cell within the region component; and obtaining second position information of the target cell; the Excel file includes multiple region components; obtaining the region range size corresponding to each region component based on the first position information; constructing a hierarchical relationship between each region component based on the region range size; obtaining a first positional relationship between the target cell and each region component based on the second position information; and constructing a first hierarchical relationship tree between each region component and the target cell based on the hierarchical relationship and the first positional relationship.

[0008] In some embodiments, the apparatus includes a processor and a memory storing program instructions, the processor being configured to, when executing the program instructions, perform the method for constructing a hierarchical relationship tree as described above.

[0009] In some embodiments, the electronic device includes means for constructing a hierarchical relationship tree as described above.

[0010] The method, apparatus, and electronic device for constructing a hierarchical relationship tree provided in this disclosure can achieve the following technical effects: by obtaining the first position information of each regional component and the second position information of the target cell in an Excel file, determining the size of the region range corresponding to each regional component based on the first position information, constructing the hierarchical relationship between each regional component based on the size of the region range, obtaining the first position relationship between the target cell and each regional component based on the second position information, and constructing a first hierarchical relationship tree between each regional component and the target cell based on the hierarchical relationship and the first position relationship, the efficiency of constructing the first hierarchical relationship tree between each regional component and the target cell is improved.

[0011] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description

[0012] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:

[0013] Figure 1 This is a flowchart illustrating a method for constructing a hierarchical relationship tree provided in an embodiment of this disclosure;

[0014] Figure 2 This is a schematic diagram of the components of each area in an Excel file provided in an embodiment of this disclosure;

[0015] Figure 3 This is a schematic diagram of a second-level relational tree provided in an embodiment of this disclosure;

[0016] Figure 4 This is a schematic diagram of a first-level relational tree provided in an embodiment of this disclosure;

[0017] Figure 5 This is a schematic diagram of an apparatus for constructing a hierarchical relationship tree provided in an embodiment of this disclosure. Detailed Implementation

[0018] To provide a more detailed understanding of the features and technical content of the embodiments of this disclosure, the implementation of the embodiments of this disclosure will be described in detail below with reference to the accompanying drawings. The accompanying drawings are for illustrative purposes only and are not intended to limit the embodiments of this disclosure. In the following technical description, for ease of explanation, several details are used to provide a full understanding of the disclosed embodiments. However, one or more embodiments may still be implemented without these details. In other cases, well-known structures and devices may be simplified in their depiction to simplify the drawings.

[0019] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.

[0020] Unless otherwise stated, the term "multiple" means two or more.

[0021] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.

[0022] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.

[0023] Combination Figure 1 As shown, this disclosure provides a method for constructing a hierarchical relationship tree, including:

[0024] S01, obtain the first position information of each region component in the Excel file, determine the target cell in the region component, and obtain the second position information of the target cell; the Excel file includes multiple region components.

[0025] S02, obtain the size of the area range corresponding to each area component based on the first position information.

[0026] S03, construct the hierarchical relationship between each region component based on the size of the region range, and obtain the first positional relationship between the target cell and each region component based on the second positional information.

[0027] S04, construct the first-level relationship tree between each region component and the target cell based on the hierarchical relationship and the first positional relationship.

[0028] The method for constructing a hierarchical relationship tree provided in this disclosure involves obtaining the first position information of each region component in an Excel file and the second position information of the target cell determined from the region component. The method then determines the size of the region range corresponding to each region component based on the first position information and constructs a hierarchical relationship between the region components based on the region range size. The method also obtains the first positional relationship between the target cell and each region component based on the second position information. Finally, the method constructs a first hierarchical relationship tree between each region component and the target cell based on the hierarchical relationship and the first positional relationship, thereby improving the efficiency of constructing the first hierarchical relationship tree between each region component and the target cell.

[0029] Optionally, the first position information of the region component includes the start position coordinates and the end position coordinates of the region component; obtaining the region size corresponding to each region component based on the first position information includes: determining the rectangular region defined by the start position coordinates and the end position coordinates as the region size corresponding to each region component.

[0030] Optionally, obtaining the first position information of each region component in the Excel file includes: obtaining region label identifiers in the Excel file; the Excel file includes multiple region label identifiers; the region label identifiers include type information and name information, or, the region label identifiers include end identifiers and name information; determining the cell coordinates corresponding to the region label identifiers including type information and name information as the start position coordinates; and determining the cell coordinates corresponding to the region label identifiers including end identifiers and name information as the end position coordinates.

[0031] In some embodiments, the region label identifiers in the Excel file are obtained, the cell coordinates corresponding to the region label identifiers including type information and name information are determined as the start position coordinates, the cell coordinates corresponding to the region label identifiers including end identifiers and name information are determined as the end position coordinates, the name information in the cell corresponding to the start position coordinates is the same as the name information in the cell corresponding to the end position coordinates, and the rectangular area defined by the start position coordinates and the corresponding end position coordinates is determined as the area range size corresponding to each region component.

[0032] Compared to other methods, such as reading the start or end coordinates of region components in an Excel file row by row and column by column, this method involves reading multiple start coordinates before reading a single end coordinate. In such cases, the read end coordinate needs to be matched with the previously obtained start coordinates to determine the size of the region corresponding to the region component. This embodiment can obtain multiple region components in an Excel file and the size of the region corresponding to each region component more quickly.

[0033] Optionally, obtaining the second position information of the target cell includes: obtaining the row number and column number of the target cell in the Excel file; and obtaining the second position information of the target cell based on the row number and column number of the target cell in the Excel file.

[0034] In some embodiments, the row number of the target cell in the Excel file is determined as the x-coordinate of the second position information, and the column number of the target cell in the Excel file is determined as the y-coordinate of the second position information.

[0035] Optionally, the first positional relationship between the target cell and each region component is obtained based on the second positional information, including:

[0036] If the second position information of the target cell is within the area of ​​the area component, the first positional relationship between the target cell and each area component is determined as the target cell belonging to the area component; if the second position information of the target cell is not within the area of ​​the area component, the first positional relationship between the target cell and each area component is determined as the target cell not belonging to the area component.

[0037] Optionally, the hierarchical relationship between regional components is constructed based on the size of the regional range, including: sorting the regional components according to the size of the regional range to obtain the hierarchical relationship between the regional components.

[0038] Optionally, sorting the regional components according to the size of the regional range to obtain the hierarchical relationship between the regional components includes: sorting the regional components in descending order of the size of the regional range, and determining the sorting result as the hierarchical relationship between the regional components.

[0039] Optionally, a first-level relationship tree between each region component and the target cell is constructed based on the hierarchical relationship and the first positional relationship, including: constructing a second-level relationship tree between each region component based on the hierarchical relationship between each region component; and constructing a first-level relationship tree between each region component and the target cell based on the second-level relationship tree and the first positional relationship.

[0040] Optionally, constructing a first-level relationship tree between each region component and the target cell based on the second-level relationship tree and the first positional relationship includes: when the first positional relationship is that the target cell belongs to a region component, determining the region component with the smallest region range from the region components to which the target cell belongs; in the second-level relationship tree, determining the target cell as a child node of the region component with the smallest region range, thereby obtaining the first-level relationship tree.

[0041] Optionally, based on the hierarchical relationship between the components in each region, a second-level relationship tree between the components in each region is constructed, including: determining whether there is an inclusion relationship between any two components in each region based on the hierarchical relationship between the components in each region, and obtaining the determination result; and constructing a second-level relationship tree between the components in each region based on the determination result.

[0042] If the determination result indicates that there is an inclusion relationship between two region components, for example, if region component A is included in region component B, then region component A will be determined as a child node of region component B.

[0043] In some embodiments, based on the second-level relation tree, the node furthest from the root in the second-level relation tree is determined as the starting node for obtaining the first positional relationship. If the second positional information of the target cell does not belong to the corresponding region component in the current node, it is determined whether the second positional information of the target cell belongs to the region component corresponding to the parent node of the current node. This process continues until a positive result is obtained, at which point the current determination process ends, and the target cell is determined as a child node of the corresponding region component. The first-level relation tree between the target cell and each region component is obtained.

[0044] In some embodiments, combined with Figure 2 As shown, retrieve the first position information of each area component in the Excel file:

[0045] Region Component A: Start position coordinates (4, 3), end position coordinates (10, 9);

[0046] Region Component B: Start position coordinates (6, 5), end position coordinates (8, 7);

[0047] Region component C: Start position coordinates (3, 2), end position coordinates (11, 10);

[0048] Region component D: Start position coordinates (14, 2), end position coordinates (16, 4);

[0049] The initial arrangement order of the regional components is [A, B, C, D]. Based on the size of the region corresponding to each component, the regional components are sorted in descending order to obtain the hierarchical relationship between them. During sorting, each regional component is compared pairwise. For example, when comparing regional component A and regional component B, if the region size of regional component A is greater than that of regional component B, the order between regional component A and regional component B is maintained. When comparing regional component A and regional component C, if the region size of regional component A is smaller than that of regional component C, the order between regional component A and regional component C is swapped. At this point, the arrangement order of the regional components is [C, B, A, D]. Comparing component A, component B's area size is larger than component A's area size. The positions of component B and component A are swapped. The current arrangement of the components is [C, A, B, D]. Component A is then compared to component D; component A's area size is larger than component D's area size. The current arrangement of components A and D is maintained. Component B is then compared to component D; component B's area size is equal to component D's area size. The current arrangement of components B and D is maintained. The final arrangement of the components is [C, A, B, D], meaning the hierarchical relationship between the components is determined as [C, A, B, D].

[0050] Based on the hierarchical relationship [C, A, B, D] between the regional components, determine whether there is an inclusion relationship between any two regional components and obtain the determination results; then construct the second-level relationship tree between the regional components based on the determination results; first, determine regional component C. Since regional component C has the largest regional range, it cannot be included in other regional components, so regional component C is determined as the first child node of the root. Determine whether there is an inclusion relationship between regional component A and regional component C. If regional component A is included in regional component C, then regional component A is determined as a child node of regional component C. Determine whether there is an inclusion relationship between regional component B and regional component A. If regional component B is included in regional component A, then regional component B is determined as a child node of regional component A. The process involves determining whether region component D and region component B have an inclusion relationship. If they do not, it then checks whether region component D has an inclusion relationship with its parent region component (i.e., region component D and region component A). If this relationship also doesn't exist, it continues by checking whether region component D has an inclusion relationship with its parent region component (i.e., region component D and region component C). If this relationship also doesn't exist, since region component C is placed at the first child node of the root, region component D is determined to be at the same level as region component C and is thus designated as the second child node of the root. This constructs a structure as follows: Figure 3 The second-level relationship tree between the components in each region is shown.

[0051] Combination Figure 2 As shown, obtain the second position information of the target cell, for example:

[0052] The second position information of the target cell a is (15, 3);

[0053] The second position information of the target cell b is (7, 6).

[0054] Obtain the first positional relationship between target cell a and region component B. If the second positional information (15, 3) of target cell a does not belong to the region range of region component B, obtain the first positional relationship between target cell a and region component A. If the second positional information (15, 3) of target cell a does not belong to the region range of region component A, obtain the first positional relationship between target cell a and region component C. If the second positional information (15, 3) of target cell a does not belong to the region range of region component C, obtain the first positional relationship between target cell a and region component D. If the second positional information (15, 3) of target cell a belongs to the region range of region component D, determine that region component D is the region component with the smallest region range corresponding to target cell a. Since region component D has no child nodes, end this judgment process and determine target cell a as a child node of region component D.

[0055] Obtain the first positional relationship between target cell b and region component B. If the second positional information of target cell b is (7, 6), which belongs to the region range of region component B, determine that region component B is the region component with the smallest region range corresponding to target cell b, end the current judgment process, and determine target cell b as a child node of region component B. This constructs a structure as follows: Figure 4 The first-level relationship tree between the various region components and the target cell is shown.

[0056] The method for constructing a hierarchical relationship tree in this embodiment determines the node farthest from the root in the second-level relationship tree as the starting node for judgment. Based on the distance to the root, the method judges the region component with the smallest area corresponding to the target cell in order of distance from farthest to near. This can more quickly determine the region component with the smallest area corresponding to the target cell and improve the efficiency of constructing the first-level relationship tree between each region component and the target cell.

[0057] In some embodiments, combined with Figure 2 As shown, a first-level relationship tree between each region component and the target cell is constructed based on the second-level relationship tree and the first positional relationship.

[0058] For example:

[0059] The second position information of the target cell a is (15, 3);

[0060] The second position information of the target cell b is (7, 6).

[0061] Obtain the first positional relationship between target cell a and region component C. If the second positional information (15, 3) of target cell a does not belong to the region range of region component C, obtain the first positional relationship between target cell a and region component D. If the second positional information (15, 3) of target cell a belongs to the region range of region component D, determine that region component D is the region component with the smallest region range corresponding to target cell a. Since region component D has no child nodes, end this judgment process and determine target cell a as a child node of region component D.

[0062] First, obtain the first positional relationship between target cell b and region component C. If the second position information (7, 6) of target cell b belongs to the region range of region component C, then obtain the first positional relationship between target cell b and region group A. If the second position information (7, 6) of target cell b belongs to the region range of region component A, then obtain the first positional relationship between target cell b and region component B. If the second position information (7, 6) of target cell b belongs to the region range of region component B, then determine region component B as the region component with the smallest region range corresponding to target cell b. Since region component B has no child nodes, end this judgment process and determine target cell b as a child node of region component B. This constructs the following structure: Figure 4 The first-level relationship tree between the various region components and the target cell is shown.

[0063] Combination Figure 5 As shown, this disclosure provides an apparatus for constructing a hierarchical relationship tree, including a processor 100 and a memory 101 storing program instructions. Optionally, the apparatus may further include a communication interface 102 and a bus 103. The processor 100, communication interface 102, and memory 101 can communicate with each other via the bus 103. The communication interface 102 can be used for information transmission. The processor 100 can call logical instructions stored in the memory 101 to execute the method for constructing a hierarchical relationship tree described in the above embodiment.

[0064] Furthermore, the logic instructions in the aforementioned memory 101 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium.

[0065] The memory 101, as a computer-readable storage medium, can be used to store software programs and computer-executable programs, such as program instructions / modules corresponding to the methods in the embodiments of this disclosure. The processor 100 executes functional applications and data processing by running the program instructions / modules stored in the memory 101, that is, it implements the method for constructing a hierarchical relationship tree in the above embodiments.

[0066] The memory 101 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the terminal device. Furthermore, the memory 101 may include high-speed random access memory and may also include non-volatile memory.

[0067] This disclosure provides an apparatus for constructing a hierarchical relationship tree. By obtaining the first position information of each region component in an Excel file and the second position information of the target cell determined from the region component, the apparatus determines the size of the region range corresponding to each region component based on the first position information, constructs the hierarchical relationship between each region component based on the size of the region range, and automatically constructs the first hierarchical relationship tree between each region component and the target cell based on the hierarchical relationship and the second position information, thereby improving the efficiency of constructing the first hierarchical relationship tree between each region component and the target cell.

[0068] This disclosure provides an electronic device including the aforementioned apparatus for constructing a hierarchical relationship tree. The electronic device provided in this disclosure obtains first position information of each region component in an Excel file and second position information of a target cell determined from the region components. It then determines the size of the region range corresponding to each region component based on the first position information, constructs a hierarchical relationship between the region components based on the region range size, and automatically constructs a first-level relationship tree between each region component and the target cell based on the hierarchical relationship and the second position information, thereby improving the efficiency of constructing the first-level relationship tree between each region component and the target cell.

[0069] Optionally, electronic devices include: computers, smartphones, etc.

[0070] This disclosure provides a computer-readable storage medium storing computer-executable instructions configured to perform the method described above for constructing a hierarchical relationship tree.

[0071] This disclosure provides a computer program product, which includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the above-described method for constructing a hierarchical relationship tree.

[0072] The aforementioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transitory computer-readable storage medium.

[0073] The technical solutions of this disclosure can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes one or more instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in this disclosure. The aforementioned storage medium can be a non-transitory storage medium, including: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code; it can also be a transient storage medium.

[0074] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used in this application means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated features, integrals, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprises a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes said element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.

[0075] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0076] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed units may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0077] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

Claims

1. A method for constructing a hierarchical relationship tree, characterized in that, include: Obtain the first position information of each region component in the Excel file, determine the target cell in the region component, and obtain the second position information of the target cell; The Excel file includes multiple region components; The size of the region range corresponding to each region component is obtained based on the first location information. The hierarchical relationship between each region component is constructed based on the size of the region range, and the first positional relationship between the target cell and each region component is obtained based on the second positional information; Based on the hierarchical relationship between the various regional components, a second-level relationship tree is constructed between the various regional components; Given that the target cell belongs to a region component in the first positional relationship, determine the region component with the smallest region range from all the region components to which the target cell belongs; In the second-level relational tree, the target cell is identified as a child node of the region component with the smallest region range, thus obtaining the first-level relational tree.

2. The method according to claim 1, characterized in that, The first position information of the region component includes the start position coordinates and the end position coordinates of the region component; obtaining the region size corresponding to each region component based on the first position information includes: The rectangular area defined by the start position coordinates and the end position coordinates is determined as the area range size corresponding to each of the area components.

3. The method according to claim 2, characterized in that, Retrieving the first position information of each area component in an Excel file includes: Obtain the region label identifiers from the Excel file; the Excel file includes multiple region label identifiers; the region label identifiers include type information and name information, or, the region label identifiers include end identifiers and name information; The cell coordinates corresponding to the area label identifier, which includes type and name information, are determined as the start position coordinates; the cell coordinates corresponding to the area label identifier, which includes end and name information, are determined as the end position coordinates.

4. The method according to claim 1, characterized in that, Obtaining the second location information of the target cell includes: Obtain the row and column number of the target cell in the Excel file; The second position information of the target cell is obtained based on the row and column number of the target cell in the Excel file.

5. The method according to claim 1, characterized in that, Based on the size of the said region range, a hierarchical relationship is constructed between the various region components, including: The region components are sorted according to the size of the region range to obtain the hierarchical relationship between the region components.

6. The method according to claim 5, characterized in that, The region components are sorted according to their area size to obtain the hierarchical relationship between them, including: The region components are sorted in descending order of their area size, and the sorting result is used to determine the hierarchical relationship between the region components.

7. The method according to any one of claims 1 to 6, characterized in that, Based on the second-level relationship tree, the node furthest from the root in the second-level relationship tree is determined as the starting node for obtaining the first positional relationship. If the second positional information of the target cell does not belong to the corresponding region component in the current node, it is determined whether the second positional information of the target cell belongs to the region component corresponding to the parent node of the current node. This process continues until a positive result is obtained, at which point the current judgment process ends, and the target cell is determined as a child node of the corresponding region component. This process then obtains the first-level relationship tree between the target cell and each region component.

8. The method according to claim 1, characterized in that, Based on the hierarchical relationship between the various regional components, a second-level relationship tree is constructed between the various regional components, including: Based on the hierarchical relationship between the various regional components, determine whether there is an inclusion relationship between any two regional components, and obtain the determination result; Based on the judgment results, a second-level relationship tree is constructed between the regional components.

9. An apparatus for constructing a hierarchical relationship tree, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to, when executing the program instructions, perform the method for constructing a hierarchical relationship tree as described in any one of claims 1 to 8.

10. An electronic device, characterized in that, Includes the apparatus for constructing a hierarchical relationship tree as described in claim 9.