Method for generating a function tree and a computing device

By automating the determination of the target node's position in the main functional tree, the problems of low efficiency and poor accuracy caused by manual sorting are solved, and efficient and accurate fusion of functional tree fragments and regularization of hierarchical logic are achieved.

CN122431643APending Publication Date: 2026-07-21HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HENAN QINWEI DIGITAL TECHNOLOGY CO LTD
Filing Date
2026-03-13
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, the fusion of functional tree segments relies on manual sorting, which leads to low efficiency, difficulty in adapting to large-scale fusion and dynamic updates, and is easily affected by subjective experience, resulting in poor accuracy.

Method used

By acquiring the contextual information of the target node, including semantic, path, and parent-child relationship information, the similarity with nodes in the main functional tree is calculated, the position of the target node in the main functional tree is automatically determined, and it is merged or added, replacing manual sorting.

Benefits of technology

It achieves automated fusion of functional tree fragments, improves the accuracy and efficiency of fusion, adapts to large-scale and dynamically updated scenarios, and ensures hierarchical logic regularity and information integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122431643A_ABST
    Figure CN122431643A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a function tree generation method and a computing device, and relates to the technical field of computing devices. The method comprises the following steps: acquiring a first function tree segment, the first function tree segment comprising a target node, the target node corresponding to target context information, the target context information comprising one or more of semantic information, path information and parent-child relationship information, the semantic information being used for representing semantic content of the target node, the path information being used for representing name information of a path node passed through from a root node corresponding to the target node to the target node, and the parent-child relationship information being used for representing relationship information of the target node and a parent node of the target node; determining a position of the target node in a main function tree according to similarity of the target context information and context information of each node in the main function tree; and adding the target node in the main function tree based on the position of the target node in the main function tree. In this way, automatic fusion of function tree segments is realized, and fusion efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computing device technology, and in particular to a method for generating a function tree and a computing device. Background Technology

[0002] The fusion of functional tree fragments typically relies on manually sorting out the nodes in multiple functional tree fragments and manually determining the hierarchical affiliation of nodes in the fused functional tree. However, manual sorting is inefficient and difficult to adapt to scenarios involving large-scale functional tree fragment fusion and dynamic updates of functional tree fragments. Furthermore, manual sorting is easily influenced by subjective experience, making it difficult to identify deep logical relationships between nodes. This leads to problems such as low automation, inconsistent granularity of functional points, and ambiguous node affiliation, resulting in poor accuracy and low efficiency of the fusion results. Summary of the Invention

[0003] This application provides a method for generating a functional tree and a computing device for automatically fusing functional tree fragments, thereby improving fusion accuracy and efficiency.

[0004] In a first aspect, embodiments of this application provide a method for generating a functional tree. The method includes: obtaining a first functional tree segment, the first functional tree segment including a target node, the target node corresponding to target context information, the target context information including one or more of semantic information, path information, and parent-child relationship information, the semantic information being used to represent the semantic content of the target node, the path information being used to represent the name information of the path nodes traversed from the root node of the target node to the target node, and the parent-child relationship information being used to represent the relationship information between the target node and the parent node of the target node; determining the position of the target node in the main functional tree based on the similarity between the target context information and the context information of each node in the main functional tree; and adding the target node to the main functional tree based on the position of the target node in the main functional tree.

[0005] In this way, by utilizing the target node's contextual information (semantic information, path information, and parent-child relationship information), the functional attributes, hierarchical position, and subordinate logic of the target node can be comprehensively captured, resolving the issues of language style differences and inconsistent functional point granularity among functional tree fragments from different sources. Based on this, the target node's affiliation is determined by the similarity between the target contextual information and the contextual information of nodes in the main functional tree. This replaces the inefficient manual layer-by-layer sorting method, and is particularly suitable for scenarios involving large-scale functional tree fragment fusion or dynamic updates of functional tree fragments. Finally, the target node is added based on the precise matching position, avoiding ambiguity and hierarchical confusion in the main functional tree's affiliation, ensuring that the generated main functional tree has a regular and coherent hierarchical logic and complete functional information, achieving automated fusion of functional tree fragments, thereby improving fusion efficiency and accuracy.

[0006] In one possible implementation, the main function tree includes a first node and a second node, which correspond to the same parent node. The position of the target node in the function tree is determined based on the similarity between the target context information and the context information of each node in the main function tree. This includes: calculating a first similarity between the target context information and the first context information of the first node, and a second similarity between the target context information and the second context information of the second node; and determining the position of the target node in the main function tree based on the first similarity and the second similarity if both the first similarity and the second similarity are greater than or equal to a first preset threshold.

[0007] Thus, for the first and second nodes of the same parent node in the main function tree, the similarity between the target context information and the context information of the two nodes is first calculated. When both similarities reach the first preset threshold, the position of the target node in the function tree segment is determined based on the two similarities. This implementation method is adapted to the positioning scenario of multiple nodes at the same level of the main function tree, which can improve the accuracy of target node positioning.

[0008] In one possible implementation, determining the position of the target node in the main function tree based on a first similarity and a second similarity includes: if the first similarity is greater than the second similarity, then determining the position of the target node in the main function tree based on the position of the first node in the main function tree; if the first similarity is less than the second similarity, then determining the position of the target node in the main function tree based on the position of the second node in the main function tree.

[0009] Thus, a higher first similarity than a higher second similarity indicates a higher overall match between the target node's contextual information and the first node's contextual information, signifying a better fit in functional attributes, logical positioning, and hierarchical association. Conversely, a lower first similarity than a higher second similarity indicates a higher overall match between the target node's contextual information and the second node's contextual information, signifying a stronger association in functional semantics and hierarchical logic. By prioritizing the relationship between the first and second similarities, the target node's affiliation in the main functional tree is anchored by the position of the node with the higher similarity, accurately aligning with the tree-like hierarchical logic and avoiding the problem of ambiguous affiliation among nodes at the same level.

[0010] In one possible implementation, determining the position of the target node in the main function tree based on the position of the first node in the main function tree includes: if the first similarity is greater than or equal to a second preset threshold, determining the position of the first node in the main function tree as the position of the target node in the main function tree; the second preset threshold is greater than the first preset threshold.

[0011] Thus, by setting a second preset threshold, the position of the first node in the main function tree can be reused when the target node and the first node have a high degree of similarity, thereby improving the accuracy and structural compactness of function tree fusion.

[0012] In one possible implementation, the first functional tree segment further includes at least one target child node, the target node being the root node of the at least one target child node, and the target node is added to the main functional tree based on the position of the target node in the main functional tree, including: merging the target node with the first node; the method further includes: adding the at least one target child node as a child node of the first node.

[0013] Thus, primarily targeting scenarios where the position of the first node in the main functional tree is the same as the position of the target node in the main functional tree, by retaining the first node of the main functional tree and merging the target node with the first node, redundant nodes can be simplified. After merging the target node with the first node, the target child nodes are simultaneously attached to the target node, enabling complete inheritance of hierarchical logic of functional tree fragments, avoiding confusion in child node affiliation, and improving the automation efficiency of multi-node processing and the consistency of the main functional tree structure through iterative fusion.

[0014] In one possible implementation, the main function tree further includes at least one third node, which is a child node of the first node. The method further includes: if the first similarity is less than a second preset threshold, calculating the third similarity between the target context information and the context information of at least one third node respectively; and determining the position of the target node in the main function tree based on the third similarity.

[0015] Thus, when the first similarity does not reach the second preset threshold, the third similarity is calculated by extending downward to the child nodes (third nodes) of the first node. By comparing the similarity between the target context information and the context information of the third node, the logical relationship between the target node and the third node can be accurately identified, making the final affiliation of the target node more consistent with the hierarchical progression of the functional tree, thereby further improving the accuracy, logical rationality and structural compactness of the main functional tree fusion.

[0016] In one possible implementation, determining the position of the target node in the main function tree based on the third similarity includes: determining the target node as a child node of the first node when the third similarity of all third nodes is less than the first similarity.

[0017] Thus, by continuing to determine the hierarchical affiliation of the target node by the optimal reference node, the judgment logic of the progressive matching is clarified, ensuring that the positional affiliation of the target node matches the hierarchical progression relationship of the main function tree.

[0018] In one possible implementation, the child nodes of the first node include a first child node and a second child node. The method further includes: calculating the fourth similarity between the context information of the first child node and the context information of the second child node; if the fourth similarity is greater than or equal to a second preset threshold, then merging the first child node and the second child node.

[0019] Thus, for nodes at the same level in the main function tree, the similarity of the contextual information of two nodes is calculated. If the fourth similarity reaches the second preset threshold, it means that the two nodes have high consistency in functional attributes and logical positioning, and there is functional duplication or inconsistent granularity. In this way, by calculating the fourth similarity of the contextual information of the first child node and the second child node, nodes that reach the second preset threshold are automatically merged, effectively eliminating the redundancy of sibling nodes, simplifying the function tree structure, ensuring the consistency of semantics and hierarchical logic, and improving the quality and efficiency of function tree fusion.

[0020] In one possible implementation, the method further includes: if both the first similarity and the second similarity are less than a first preset threshold, determining that the target node, the first node, and the second node are child nodes of the same parent node.

[0021] In this way, by unifying the parent node affiliation, the logical relationship between the target node, the first node, and the second node is clarified, ensuring that each node in the function tree maintains the regularity of the hierarchical structure under the premise of semantic independence. This further improves the semantic accuracy and structural rationality of multi-source function tree fusion, and is mainly suitable for business scenarios where different functional points exist independently but belong to the same functional category.

[0022] Secondly, embodiments of this application provide a computing device, including: a memory and a processor. The memory is used to store program instructions. The processor is used to execute the program instructions, causing the computing device to perform the function tree generation method as described in the first aspect or any possible implementation thereof.

[0023] Thirdly, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed on a computing device, cause the computing device to perform a function tree generation method as described in the first aspect or any possible implementation thereof.

[0024] Fourthly, a computer program product is provided, the computer program product including computer execution instructions, which, when executed on a computing device, cause the computing device to perform a function tree generation method as described in the first aspect or any possible implementation of the first aspect.

[0025] The technical effects of any of the implementation methods in the second to fourth aspects can be found in the technical effects of different implementation methods in the first aspect, and will not be repeated here.

[0026] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description

[0027] Figure 1 A schematic diagram illustrating an application scenario provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application; Figure 3 A flowchart illustrating a method for generating a functional tree as provided in an embodiment of this application; Figure 4 A flowchart illustrating a process for determining context information of multiple nodes, provided in an embodiment of this application; Figure 5 A flowchart illustrating the process of determining vectorized context information of multiple nodes, provided in an embodiment of this application; Figure 6 This is a schematic diagram of a main function tree provided in an embodiment of this application; Figure 7 A flowchart illustrating the process of determining the position of a target node in the main function tree, provided for an embodiment of this application; Figure 8 A flowchart illustrating the process of determining the position of a target node in the main function tree, provided for an embodiment of this application; Figure 9 This is a schematic diagram illustrating a process for merging child nodes at the same level, as provided in an embodiment of this application. Detailed Implementation

[0028] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0029] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between the related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.

[0030] Furthermore, in the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0031] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and that "first" and "second" are not necessarily different. Meanwhile, in the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is being used as an example, illustration, or description. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of terms such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0032] The following provides an exemplary description of the application scenarios of the embodiments of this application.

[0033] This application's embodiments are primarily applied to scenarios involving the fusion / integration of multifunctional tree fragments. A functional tree is a structured data representation used to represent the hierarchical relationships between functional points in a system (such as an Enterprise Resource Planning (ERP) system). It is commonly used to describe the hierarchical structure and logical relationships in system, software, or module design. In a functional tree, each node represents a functional point, and the hierarchical structure between nodes reflects the subordinate relationships or logical dependencies between functional points. Functional tree fragments are the constituent units of a functional tree.

[0034] For example, in scenarios involving the integration of multiple modules in enterprise-level software, multiple R&D teams develop different modules of the same system in parallel (such as the transaction module, payment module, and logistics module of an e-commerce system). Each team independently outputs functional tree fragments, and these fragments need to be merged into a main functional tree to obtain a unified system functional architecture. Similarly, in scenarios involving the unified management of technical documents / user manuals, multiple documents (such as multiple versions of product manuals, technical white papers, and maintenance documents accumulated by the enterprise) each implicitly contain hierarchical relationships of product functions (such as user manuals for different versions of an ERP system describing sub-functions such as "employee management function" and "salary management function"). Multiple functional tree fragments corresponding to these documents need to be extracted and merged into a main functional tree to obtain a full-featured knowledge base. For example, in the scenario of managing long documents, due to the excessive length of the document, the functional hierarchy information contained therein is scattered in a massive amount of text, and the total length is too large for the context window limitation of the model. In this case, the long document can be segmented and input into the large model. The large model outputs multiple functional tree fragments based on the segmented document and merges them into the main functional tree. This achieves complete capture of all functional points in the long document, accurate restoration and unified integration of hierarchical logic, and avoids functional omissions, hierarchical breaks or semantic misjudgments caused by text segmentation.

[0035] like Figure 1 As shown, multiple documents, including document 1, document 2, ..., document N, are processed by a large model (such as a large language model (LLM)) to extract multiple function tree fragments, such as function tree fragment 1, function tree fragment 2, ..., function tree fragment N. Based on these multiple function tree fragments, a main function tree is generated. The main function tree is the function tree resulting from the fusion of the multiple function tree fragments.

[0036] The system architecture of the embodiments of this application will be described below as an example.

[0037] This application provides a computing device. Specifically, the computing device is used to acquire a first functional tree segment, which includes a target node. The target node corresponds to target context information, which includes one or more of semantic information, path information, and parent-child relationship information. The semantic information represents the semantic content of the target node, the path information represents the name information of the path nodes traversed from the root node of the target node to the target node, and the parent-child relationship information represents the relationship information between the target node and its parent node. The computing device is also used to determine the position of the target node in the main functional tree based on the similarity between the target context information and the context information of each node in the main functional tree. Furthermore, the computing device is also used to add a target node to the main functional tree based on the position of the target node in the main functional tree.

[0038] In some embodiments, the computing device deploys a large language model, which determines the target context information corresponding to the target node. For example, a first function tree fragment is input into the large language model to obtain the target context information corresponding to the target node output by the large language model.

[0039] In this embodiment, the computing device can be a server. The server can be a single physical server or logical server, or it can be composed of two or more physical servers or logical servers that share different responsibilities, working together to achieve various server functions such as data processing and service provision.

[0040] In terms of hardware form, servers can be blade servers, high-density servers, rack servers, or tower servers, which are suitable for different application scenarios such as high-density cluster deployment in data centers and small enterprise server rooms.

[0041] like Figure 2 As shown, this application embodiment provides a computing device 500. The computing device 500 includes a processor 510 and a memory 520 for storing processor-executable instructions. When the processor 510 is configured to execute instructions, the computing device 500 performs the various functions described above. For example, the processor 510 performs the various functions of the computing device described above.

[0042] Figure 2 The computing device 500 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.

[0043] The computing device 500 is manifested in the form of a general-purpose computing device. The components of the computing device 500 may include, but are not limited to: one or more processors 510, memory 520, communication bus 540 connecting different system components (including memory 520 and processor 510), and communication interface 530.

[0044] Communication bus 540 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnection (PCI) bus.

[0045] Memory 520 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. The computing device may further include other removable / non-removable, volatile / non-volatile computer system storage media. Although Figure 2 Not shown, a disk drive may be provided for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and a removable non-volatile optical disk (e.g., a compact disc read-only memory, CD). ROM, Digital Video Disc Read-Only Memory (DVD) An optical disc drive that reads and writes to ROM or other optical media. In these cases, each drive can be connected to the communication bus 540 through one or more data media interfaces. The memory 520 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0046] A program / utility having a set (at least one) of program modules can be stored in memory 520. Such program modules include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. The program modules typically perform the functions and / or methods described in the embodiments of this application.

[0047] The computing device 500 can also communicate with one or more external devices (e.g., keyboard, pointing device, display, etc.), and with one or more devices that enable a user to interact with the computing device, and / or with any device that enables the computing device to communicate with one or more other computing devices (e.g., network interface card, modem, etc.). This communication can be performed through the communication interface 530. Furthermore, the computing device 500 can also communicate through a network adapter (… Figure 2 (Not shown) communicates with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet). The aforementioned network adapter can communicate with other modules of the computing device via the communication bus 540. It should be understood that, although... Figure 2 As not shown, the computing device 500 may be used with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, disk arrays (RAID) systems, tape drives, and data backup storage systems.

[0048] Processor 510 executes various functional applications and data processing by running programs stored in memory 520, such as implementing the functions provided in the embodiments of this application as described below. Figure 3 The method for generating the function tree shown is illustrated.

[0049] It is understood that the interface connection relationships between the modules illustrated in the embodiments of this application are merely illustrative and do not constitute a structural limitation on the computing device 500. In other embodiments of this application, the computing device 500 may also employ different interface connection methods or combinations of multiple interface connection methods as described in the above embodiments.

[0050] It should be noted that the system architecture and application scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0051] For ease of understanding, the method for generating a function tree provided in the embodiments of this application will be described exemplarily below with reference to the above-described computing device and accompanying drawings.

[0052] like Figure 3 As shown, this application embodiment provides a specific implementation of a method for generating a function tree. This method can be implemented by... Figure 2The method is executed by a processor, such as a CPU, of the computing device shown. The method includes the following steps: S301-S303.

[0053] S301, Obtain the first functional tree segment, which includes the target node. The target node corresponds to the target context information.

[0054] For example, the first functional tree segment includes one or more functional tree segments. Each functional tree segment includes multiple nodes, including a root node and at least one child node. If the functional tree segment includes child nodes at different levels, the child nodes are divided into first-level child nodes (parent node is the root node), second-level child nodes (parent node is the first-level child node), third-level child nodes (parent node is the second-level child node), and so on, for easy distinction.

[0055] Each node's information includes a node name and a node summary. The node name identifies the node, and the node summary describes the node's function. This can be represented as... ,in, Information representing nodes, Indicates the node name. Represents a node summary.

[0056] The following explanation uses the ERP system user manual as an example: For example, functional tree segment 1 includes a root node, first-level child nodes, second-level child node 1, and second-level child node 2. The root node's information includes: Name: ERP Management System; Summary: Enterprise-level core resource planning system, an integrated management platform encompassing finance, human resources, procurement, sales, and other business processes. The first-level child node's information includes: Name: Sales Management Module; Summary: Responsible for customer management, sales order creation, shipment tracking, and sales data statistical analysis. Second-level child node 1's information includes: Name: Sales Order Management; Summary: Supports the creation, modification, review, and archiving of sales orders, and links customer information and product inventory data. Second-level child node 2's information includes: Name: Sales Performance Statistics; Summary: Statistically analyzes sales performance by time, region, and customer, generating sales reports and trend analysis charts.

[0057] For example, functional tree segment 2 includes a root node, first-level child node 1, first-level child node 2, and first-level child node 3. The root node's information includes: Name: Inventory Management Module; Summary: Responsible for monitoring, controlling inbound and outbound inventory, and optimizing inventory of raw materials, semi-finished products, and finished products. First-level child node 1's information includes: Name: Inventory Ledger Maintenance; Summary: Manages basic information on inventory items and records inventory changes (inbound, outbound, transfer). First-level child node 2's information includes: Name: Inventory Early Warning Management; Summary: Configures safety stock thresholds, monitors inventory levels in real time, triggers low inventory / overstock warnings, and pushes notifications. First-level child node 3's information includes: Name: Inbound and Outbound Process Control; Summary: Associates with sales / purchase orders, completes inbound acceptance and outbound approval, and automatically synchronizes inventory data.

[0058] The target node is any node in the first functional tree segment that needs to be added to the main functional tree.

[0059] Target context information includes one or more of the following: semantic information, path information, and parent-child relationship information. Semantic information represents the semantic content of the target node, that is, the semantic content of the target node itself. For example, the name and summary of second-level child node 1 in the functional tree segment 1 above can be used as the semantic content of second-level child node 1. Specific examples are provided below. Path information represents the name information of the path nodes traversed from the root node to the target node, that is, the complete link from the root node to the target node. Parent-child relationship information represents the relationship information between the target node and its parent node, that is, the relationship between the target node and its direct superior (its parent node).

[0060] The following example uses the target node as a second-level child node 1 in functional tree segment 1 for illustration: For example, the semantic information of the second-level child node 1 is: Sales Order Management, supporting the creation, modification, review, and archiving of sales orders, and associated with customer information and product inventory data. The path information of the second-level child node 1 is: ERP Management System > Sales Management Module > Sales Order Management. The parent-child relationship information of the second-level child node 1 is: Sales Management Module - Sales Order Management.

[0061] In some embodiments, if the target node is a root node, its corresponding target context information includes semantic information, and its path information and / or parent-child relationship information may be empty. If the target node is a child node, its corresponding target context information may include one or more of semantic information, path information, or parent-child relationship information.

[0062] In some embodiments, the method further includes: determining the target context information (i.e., the target context information corresponding to the target node) of the target node based on the node information of multiple nodes in the first functional tree segment. This enables accurate capture of the target node's own semantics, hierarchical path, and parent-child relationships. The following example illustrates the specific implementation of determining the target context information of the target node: In one possible implementation, determining the semantic information of the target node includes: inputting node information of multiple nodes in a first functional tree segment into a first model to obtain the semantic information of the target node output by the first model. The first model has the function of generating semantic information of a specific node (such as the target node) based on the node information of multiple nodes in the functional tree segment.

[0063] Specifically, the node information of multiple nodes in the first functional tree segment and the first prompt word are input into the first model to obtain the semantic information of the target node output by the first model. The first prompt word is used to instruct the first model to generate the semantic information of the target node based on the node information of multiple nodes in the first functional tree segment.

[0064] In one possible implementation, determining the path information of the target node includes: inputting the node information of multiple nodes in the first functional tree segment into a second model to obtain the path information of the target node output by the second model. The second model has the function of generating the path information of the target node based on the node information of multiple nodes in the functional tree segment.

[0065] Specifically, the node information of multiple nodes in the first functional tree segment and the second prompt word are input into the second model to obtain the path information of the target node output by the second model. The second prompt word is used to instruct the second model to generate the path information of the target node based on the node information of multiple nodes in the first functional tree segment.

[0066] In one possible implementation, determining the parent-child relationship information of the target node includes: inputting the node information of multiple nodes in the first functional tree segment into a third model to obtain the parent-child relationship information of the target node output by the third model. The third model has the function of generating the parent-child relationship information of the target node based on the node information of multiple nodes in the functional tree segment.

[0067] Specifically, the node information of multiple nodes in the first functional tree segment and the third prompt word are input into the third model to obtain the parent-child relationship information of the target node output by the third model. The third prompt word is used to instruct the third model to generate the parent-child relationship information of the target node based on the node information of multiple nodes in the first functional tree segment.

[0068] For example, the first model, the second model, and the third model can be the same model or different models; this is not a limitation. The first model, the second model, or the third model can be a large language model.

[0069] Understandably, this step can automate the acquisition of target context information for target nodes through a large language model, reducing reliance on manual processing and time consumption, and improving the accuracy of the extracted target context information. This further enhances the accuracy and rationality of function tree fusion.

[0070] In other embodiments, the method further includes: obtaining context information corresponding to all nodes in the first functional tree segment. The specific implementation can be found in the above-described implementation of determining the target context information corresponding to the target node based on the node information of the target node, and will not be repeated here.

[0071] In this embodiment, a first queue can be used to store the context information of nodes in the first functional tree segment. The following explains the use of a first queue to store the context information of nodes in the first functional tree segment: In one implementation, the method further includes setting a first queue to store the target context information of the target node. Optionally, the first queue may also store the node information of the target node. For example, the initial state of the first queue is an empty queue. Thus, by setting a first queue to store the target context information of the target node, or to store the node information of the target node, the information of the target node is structured and organized, which is beneficial for subsequent fast retrieval of the target context information of the target node.

[0072] In one implementation, when the first functional tree segment consists of multiple functional tree segments, each node in each functional tree segment is traversed to determine the context information of each node, until the context information of multiple nodes (such as all nodes) in multiple functional tree segments is determined. The context information of multiple nodes includes the target context information of the target node. The context information of multiple nodes (or node information of multiple nodes) is then added to a first queue. This first queue, storing the context information of multiple nodes, can later be referred to as the second queue. In this way, by traversing multiple functional tree segments, the context information (and optional node information) of each node can be comprehensively determined and centrally added to the first queue, resulting in the second queue, thus achieving the collection and structured organization of multiple nodes.

[0073] like Figure 4 As shown, a specific implementation method for determining the context information of multiple nodes is provided, including, for example, the following steps S401-S408: S401, Obtain the first functional tree segment.

[0074] S402, set the first queue for initialization.

[0075] The first queue is initialized as an empty queue.

[0076] S403: Determine if all function tree segments have been traversed. If yes, proceed to S408; otherwise, proceed to S404-S407.

[0077] S404, retrieve the untraversed function tree segment.

[0078] S405: For each untraversed function tree segment, obtain the node information of each node within it.

[0079] S406, based on the node information of each node, creates semantic information, path information and parent-child relationship information for each node.

[0080] Understandably, for the root node, its path information and parent-child relationship information are empty.

[0081] S407, add the semantic information, path information and parent-child relationship information of each node to the first queue until all nodes of all functional tree segments have been traversed.

[0082] For example, the semantic information, path information, and parent-child relationship information of all nodes in the first functional tree segment are added to the first queue.

[0083] S408, obtain the first queue (i.e. the second queue) that stores the context information of multiple nodes.

[0084] In this embodiment, by traversing all functional tree segments and extracting node information node by node, semantic information, path information and parent-child relationship information corresponding to each node are generated and uniformly stored in a queue. This enables the complete and standardized extraction and collection of context information of functional tree nodes, clearly representing the semantics, hierarchical position and association of nodes. The orderly and standardized storage of context information is achieved in the form of a queue, improving the standardization and efficiency of context information processing of functional tree nodes.

[0085] In some embodiments, the method further includes: vectorizing the target context information of the target node to obtain vectorized target context information.

[0086] Specifically, the semantic information of the target node is vectorized to obtain semantic vector information. And / or, the path information of the target node is vectorized to obtain path vector information. And / or, the parent-child relationship information of the target node is vectorized to obtain parent-child relationship vector information. The vectorized target context information includes one or more of the following: semantic vector information, path vector information, or parent-child relationship vector information.

[0087] For example, taking the target node as the second-level child node 1 (sales order management) mentioned above, its corresponding semantic vector information can be (0.89, 0.73, 0.68); the path vector information can be (0.66, 0.75, 0.71); and the parent-child relationship vector information can be (0.77, 0.70, 0.74).

[0088] In this embodiment, by vectorizing the target context information of the target node, a structured representation of unstructured semantics and structured information is achieved, accurately preserving the core features of the target node's own semantics, hierarchical path, and parent-child subordination relationship, thereby improving the efficiency of subsequent processing.

[0089] The following explains how to update the context information of nodes in the first functional tree segment stored in the second queue to vectorized context information: In other embodiments, the method further includes: traversing multiple nodes in the second queue, and for each node, vectorizing the context information of each node to obtain vectorized context information, wherein the vectorized context information of the multiple nodes includes the vectorized target context information of the target node. The context information of all nodes in the second queue is then updated to the vectorized context information. The updated second queue may subsequently be referred to as the third queue.

[0090] like Figure 5 As shown, a specific implementation method for determining the vectorized context information of multiple nodes is provided, including, for example, the following steps S501-S506: S501, retrieve the second queue.

[0091] Understandably, the context information of the multiple nodes stored in the second queue may or may not have been fully traversed. The purpose of traversal is to update the context information of the traversed nodes with vectorized context information.

[0092] S502, determine whether the traversal of multiple nodes (including the target node) in the second queue has been completed. If yes, proceed to S503. If no, proceed to S504-S506.

[0093] S503, obtain the second queue (i.e. the third queue) that stores vectorized context information of multiple nodes.

[0094] S504 retrieves the nodes that have not yet been traversed.

[0095] S505, for each node that has not been traversed, determine the first vector information, second vector information and third vector information of each node based on the semantic information, path information and parent-child relationship information of each node respectively.

[0096] Among them, the first vector information represents the vectorized semantic information, the second vector information represents the vectorized path information, and the third vector information represents the vectorized parent-child relationship information.

[0097] Understandably, for the root node, its second and third vector information are empty.

[0098] S506, update the context information (such as semantic information, path information and parent-child relationship information) of each node in the second queue to the vectorized context information (such as first vector information, second vector information and third vector information) until the context information of multiple nodes in the second queue is updated to their corresponding vectorized context information.

[0099] In this embodiment of the application, by obtaining the second queue of stored node context information and traversing the nodes therein, the semantic information, path information, and parent-child relationship information of each node are converted into corresponding vector information, and the original context information in the queue is updated to the vectorized context information, until the traversal of all nodes is completed.

[0100] The preceding text described the process of obtaining the context information of nodes in the first functional tree segment. The following text uses a node (such as a target node) in the first functional tree segment as an example to describe the process of determining the position of the target node in the main functional tree.

[0101] S302, determine the position of the target node in the main function tree based on the similarity between the target context information and the context information of each node in the main function tree.

[0102] The main functional tree is the hierarchical structure resulting from the fusion of multiple functional tree fragments. It's important to note that before the fusion, the main functional tree exists as a conceptual hierarchical framework and does not possess actual structured data entities. It is a pre-defined target benchmark used to carry the fusion result of multiple functional tree fragments. In other words, the main functional tree at this stage can be understood as an empty carrier, whose functional hierarchy needs to be gradually filled in during the fusion process.

[0103] The nodes in the main function tree include the root node of the main function tree, and may also include nodes that have been added to the main function tree from the first function tree segment.

[0104] In some embodiments, the method further includes: constructing the root node of the main function tree. The process of constructing the root node of the main function tree is illustrated below: In one example, the root node of the main functional tree can be a node pre-defined by the user. Based on business scenario requirements, the user can pre-define a top-level node that covers the core scope of all functional tree segments. For example, the information of this pre-defined root node could be: "Name: Enterprise Digital Management Platform; Summary: Integrates multiple enterprise management systems." By directly pre-defining a top-level node as the root node of the main functional tree, the global integration requirements of multiple module functional tree segments can be adapted, making it simple and efficient.

[0105] In another example, the root node of the main function tree can be a root node in one of the first function tree segments. Specifically, when the first function tree segment includes multiple function tree segments, the semantic coverage of multiple root nodes in the multiple function tree segments is determined, and the root node with the broadest semantic coverage is taken as the root node of the main function tree. For example, in the above-mentioned function tree segment 1 and function tree segment 2, the root nodes corresponding to "ERP Management System" and "Inventory Management Module" are respectively. Since "ERP Management System" has a broader semantic coverage, the root node "ERP Management System" of function tree segment 1 can be taken as the root node of the main function tree.

[0106] In another example, when the first functional tree segment includes multiple functional tree segments, the semantic coverage of multiple root nodes of the multiple functional tree segments is first determined. If the semantic coverage of multiple root nodes is similar, the node preset by the user is used as the root node. For example, the semantic coverage of the root node can be determined based on the functional dimensions covered by the summary of the root node. The more functional dimensions covered by the summary, the wider the semantic coverage. When the difference in the functional dimensions covered by the summaries of two root nodes is less than a preset difference, the semantic coverage of the root nodes is determined to be similar. For example, the preset difference can be set according to the user's actual needs.

[0107] For example, the position of the target node in the main function tree can be determined based on the similarity between the vectorized target context information and the vectorized context information of each node in the main function tree. For instance, if the context information of the first node in the main function tree has the highest similarity to the target context information, then the position of the target node in the main function tree is determined based on the position of the first node.

[0108] S303, add the target node to the main function tree based on the position of the target node in the main function tree.

[0109] After determining the position of the target node in the main function tree, the target node can be added at the corresponding position to complete the fusion of function tree segments.

[0110] In one example, if a node already exists at the corresponding position of the target node in the main function tree, then the target node and the existing node can be merged, retaining only one node. In this case, all child nodes under the target node in the function tree segment can be adopted (e.g., added) to the retained node. This achieves complete inheritance of hierarchical logic in the function tree segment, avoids confusion in child node ownership, and improves the automation efficiency of multi-node processing and the consistency of the main function tree structure through iterative fusion.

[0111] In another example, if the target node does not exist at its corresponding position in the main function tree, then the target node is added directly to the main function tree based on that position. Additionally, in the main function tree, all child nodes of the target node in the function tree segment are attached under that target node.

[0112] Combining steps S301-S303 above, the target node's own functional attributes, hierarchical position, and subordinate logic can be comprehensively captured through the target node's target context information (semantic information, path information, and parent-child relationship information). This solves the problems of language style differences and inconsistent functional point granularity among functional tree fragments from different sources. Based on this, the target node's belonging position is determined by the similarity between the target context information and the context information of nodes in the main functional tree. This replaces the inefficient manual layer-by-layer sorting mode, reduces reliance on manual intervention, and is especially suitable for scenarios with large-scale functional tree fragments or dynamically updated functional tree fragments. Finally, the target node is added based on the precise matching position, avoiding ambiguity and hierarchical confusion of nodes in the main functional tree. This ensures that the generated main functional tree has a regular and coherent hierarchical logic and complete functional information, achieving automated and precise optimization of main functional tree generation, and improving generation efficiency and accuracy.

[0113] The following section provides a detailed explanation of the process and implementation of S302, which determines the position of the target node in the main function tree based on the similarity between the target context information and the context information of each node in the main function tree, using different scenarios: Understandably, the positional relationships of nodes in the main function tree include: being parent-child nodes and being sibling nodes. The following section, using these two relationships, details how to determine the position of a node (such as the target node) in the main function tree within the aforementioned first function tree segment.

[0114] In one implementation, the main function tree includes a first node and a second node, both of which share the same parent node. That is, the first node and the second node are sibling nodes. For example... Figure 6 The diagram shows a schematic of a main function tree structure, which includes a first node and a second node, as well as the parent node to which the first node and the second node belong (such as parent node 1).

[0115] like Figure 7 As shown, determining the position of the target node in the main function tree may include, for example, the following steps S701-S703.

[0116] S701, calculate the first similarity between the target context information corresponding to the target node and the first context information of the first node, and the second similarity between the target context information and the second context information of the second node.

[0117] The following explains the specific implementation method for determining the similarity of contextual information between two different nodes: In one possible implementation, the similarity of the contextual information of two different nodes is determined based on a first weight, a second weight, a third weight, and the contextual information of the two nodes. Specifically, the first weight is used to adjust the influence of the semantic information of at least one of the two nodes on the similarity; the second weight is used to adjust the influence of the parent-child relationship information of at least one of the two nodes on the similarity; and the third weight is used to adjust the influence of the path information of at least one of the two nodes on the similarity.

[0118] For example, when calculating the similarity of contextual information between two different nodes, the similarity can be calculated based on the vectorized contextual information of the two different nodes.

[0119] For example, the similarity of contextual information between two different nodes is calculated using the following formula:

[0120] in For a node, such as the target node, For another node, such as the first node or the second node, for and The similarity of contextual information, for example, specifically cosine. Similarity. For semantic information (such as specifically, a vectorized semantic vector), This refers to parent-child relationship information (which could specifically be a vectorized semantic vector). This is path information (specifically, it could be a vectorized semantic vector). It is the first weight. It is the second weight. It is the third weight.

[0121] Example, , and The sum of is 1.

[0122] For example, if the target node is the root node, since its parent-child relationship information and path information are empty, the values ​​of the parent-child relationship information and path information corresponding to the target node in the above formula are all 0.

[0123] The following example illustrates the concept using the target context information and the first context information of the first node: If the semantic vector information, path vector information, and parent-child relationship information in the target context information of the target node are (0.89, 0.73, 0.68), (0.66, 0.75, 0.71), and (0.77, 0.70, 0.74), respectively; and the first node is the aforementioned first-level child node (sales management module), whose semantic information, path vector information, and parent-child relationship information are (0.87, 0.75, 0.69), (0.64, 0.73, 0.72), and (0.76, 0.72, 0.73), respectively. Furthermore, w1 = 0.4, w2 = 0.35, and w3 = 0.25; based on the above formula, the following calculation is obtained: ≈0.9998.

[0124] In another possible implementation, the similarity of the contextual information of two different nodes is determined based on a first weight, a second weight, a third weight, a moderating factor, and the contextual information of the two nodes. The moderating factor is used to adjust the influence of the semantic information, parent-child relationship information, and path information of the two nodes on the similarity.

[0125] For example, the similarity of contextual information between two different nodes is calculated using the following formula: =

[0126] in, , It is a regulating factor.

[0127] For example, the adjustment factor is determined based on a structural proximity reward mechanism. The structural proximity reward mechanism is a technique for optimizing function tree fusion by considering the structural positional relationships between different nodes in the function tree.

[0128] Example, ; r is the reward parameter.

[0129] In one implementation, r is calculated according to the following formula:

[0130] in This is the reward value of the parent node of v1. The parent node of v1, The reward value is the grandparent node of v1 (i.e., the parent node of its parent node). It is the grandparent node of v1. Indicates if for The direct parent node, then = ; Indicates if for The grandfather node, then = In other cases, =0. It needs to be explained here... for The direct parent node or grandparent node refers to the node in (e.g., in the functional tree segment where the target node is located) yes The direct parent node or grandparent node.

[0131] Example, and It can be set by the user according to their actual needs. For example, ,and .

[0132] The following example, using the target node as the aforementioned second-level sub-node 1 (sales order management) and the first node as the aforementioned first-level sub-node (sales management module), will be used for illustrative explanation: S ≈0.9998; Since the first node in functional tree segment 1 where the target node is located is the direct parent node of the target node, then = If the value is specifically 0.2, the result is obtained by calculating based on the above formula. ≈1.1998.

[0133] The similarity of context information between other nodes can be achieved by referring to the above implementation method, and will not be repeated here.

[0134] In one implementation, the context information of the nodes whose similarity needs to be determined is obtained from a third queue. For example, when determining the target context information of the target node and the first context information of the first node, the target context information and the first context information are obtained from the third queue. For instance, the first context information and the target context information here can be vector information in vector form. Thus, by uniformly storing and quickly retrieving the vector-form context information through the third queue, semantic similarity can be calculated directly and efficiently.

[0135] S702, determine whether both the first similarity and the second similarity are greater than or equal to the first preset threshold. If yes, determine the position of the target node in the main function tree based on the first similarity and the second similarity, which may specifically include step S703; if no, if both the first similarity and the second similarity are less than the first preset threshold, execute S704.

[0136] For example, the first preset threshold can be set based on the user's actual needs, such as setting the first preset threshold to be greater than or equal to 70% and less than 90%. For example, the first preset threshold can be 70%, 75%, or 80%, etc.

[0137] Thus, for the first and second nodes that are sibling nodes, the similarity between the target context information and the context information of the two nodes is first calculated. When both similarity scores reach a first preset threshold, the results of the two similarity scores are combined to determine the position of the target node in the functional tree segment. This method is suitable for positioning scenarios with multiple nodes at the same level in the main functional tree and can improve the accuracy of target node positioning.

[0138] S703, if the first similarity is greater than the second similarity, then the position of the target node in the main function tree is determined based on the position of the first node in the main function tree. Alternatively, if the first similarity is less than the second similarity, then the position of the target node in the main function tree is determined based on the position of the second node in the main function tree.

[0139] This step prioritizes the first and second similarity scores, anchoring the target node's affiliation in the main functional tree by identifying the node with the higher matching score. This accurately aligns with the hierarchical logic of the tree structure and avoids the problem of ambiguous affiliation of nodes at the same level.

[0140] The following explanation addresses the scenario where the first similarity is greater than the second similarity, in which case the position of the target node in the main function tree is determined based on the position of the first node. Understandably, in scenarios where the first similarity is less than the second similarity, the method of determining the target node's position in the main function tree based on the position of the second node is similar to the method described above, and will not be elaborated upon here.

[0141] Understandably, when the first similarity is greater than the second similarity, it indicates that the target context information of the target node and the context information of the first node have a higher overall matching degree, and the two have a better fit in terms of functional attributes, logical positioning and hierarchical association.

[0142] In one scenario, if the target node not only has a higher similarity to the first node (e.g., represented by the first similarity score), but its similarity to the first node also exceeds a second preset threshold, then the target node and the first node are considered to be the same node. The position of the first node in the main function tree can then be taken as the position of the target node in the main function tree. The following explains the specific implementation method for determining the position of the target node in the main function tree in this scenario: In one implementation, if the first similarity is greater than or equal to a second preset threshold, the position of the first node in the main function tree is determined as the position of the target node in the main function tree.

[0143] The second preset threshold is greater than the first preset threshold. For example, the second preset threshold can be set according to the user's actual needs, such as being greater than or equal to 90%. For instance, the second preset threshold can be set to 90% or 90%. It is understandable that when the first similarity is greater than the first preset threshold, it can be determined that the similarity between the target node and the first node is high enough to exceed the second preset threshold.

[0144] Understandably, when the similarity between the target node and the first node is very high, it can be determined that the target node and the first node are the same node. Therefore, the position of the first node in the main function tree is the same as the position of the target node in the main function tree.

[0145] In another scenario, if the target node has a higher similarity to the first node (e.g., represented by the first similarity score), but the similarity hasn't exceeded the second preset threshold, then the child nodes of the first node can be polled to find nodes with higher similarity to the target node. This progressive hierarchical positioning of the target node is achieved by polling the child nodes of the corresponding node and performing similarity matching again, improving the accuracy of location determination. In another case, if the first node has no child nodes, the target node can be directly used as a child node of the first node.

[0146] The following describes the process of continuing to poll the child nodes of the first node: During the polling of the child nodes of the first node, the position of the target node needs to be determined based on the similarity between the target node and the first node, as well as the similarity between the target node and the child nodes of the first node. In other words, the position of the target node in the main function tree needs to be determined based on two nodes that are parent and child nodes. This process is explained in detail below: Continue as Figure 6 As shown, the main function tree also includes at least one third node, and at least one third node is a child node of the first node. The third node and the first node are parent and child nodes of each other.

[0147] In some embodiments, the method further includes: if the first similarity is less than a second preset threshold, calculating a third similarity between the target context information and the context information of at least one third node, respectively. The position of the target node in the main function tree is then determined based on the third similarity.

[0148] In this embodiment of the application, when the first similarity does not reach the second preset threshold, the third similarity is further extended downward to the child node (third node) of the first node to calculate the third similarity. By comparing the similarity between the target context information and the context information of the third node, the logical association between the target node and the third node can be accurately identified, so that the final affiliation of the target node is more in line with the hierarchical progression of the function tree, and the accuracy, logical rationality and structural compactness of the main function tree fusion are further improved.

[0149] The following explains the specific implementation method for determining the position of the target node in the main function tree based on the third similarity: In one example, if the third similarity is greater than the second preset threshold, the position of the third node corresponding to that similarity in the main function tree is taken as the position of the target node in the main function tree. If there are multiple third nodes whose third similarity is greater than the second preset threshold, then the position of any one of the third nodes corresponding to the similarity greater than the second preset threshold in the main function tree can be taken as the position of the target node in the main function tree.

[0150] In another example, if the third similarity of all third nodes is less than the second preset threshold, the matching can continue to the lower-level nodes. If there are no lower-level nodes, the attribution is determined based on the current reference node, thus realizing the layer-by-layer deep positioning of the target node and making the position determination fit the deep-level progressive logic of the main function tree.

[0151] When the third node has no child nodes, a reference node can be determined on the path from the third node to the root node of the main function tree, and the target node can be taken as a child node of the reference node. The reference node is the node on the path with the highest similarity to the target node.

[0152] In this embodiment, the optimal level of the target node is determined by searching all nodes on the path from the current node to the root node of the main functional tree, thereby further improving the accuracy and rationality of the location determination.

[0153] The following combination Figure 6 The architecture shown, taking the current node as the third node as an example, illustrates the specific implementation method for determining the reference node: First, determine the path from the third node to the root node of the main function tree. (As mentioned above...) Figure 6For example, the path from the third node to the root node is: Third node → First node → Parent node 1 → ... Next, the third similarity of the third node, the first similarity of the first node, and the fifth similarity of the parent node 1 (the similarity between the context information of the parent node 1 and the target context information of the target node) are compared to determine the node with the highest similarity as the reference node. In a specific example, if the fifth similarity of the parent node 1 is the highest, then the parent node 1 is used as the reference node. The target node is then used as a child node of the parent node 1.

[0154] In this embodiment, the hierarchical affiliation of the target node is determined by continuing from the current node to the reference node corresponding to the best similarity on the root node, thus clarifying the judgment logic of progressive matching and ensuring that the position affiliation of the target node matches the hierarchical progression relationship of the main function tree.

[0155] S704, determine that the target node, the first node, and the second node are child nodes of the same parent node.

[0156] If both the first similarity and the second similarity are less than the first preset threshold, it indicates that the similarity between the target node and the first node and the second node is low. In this case, it is not suitable to be a child node of the first node or the second node at a level below. Therefore, the target node is regarded as a sibling node of the first node and the second node.

[0157] In this embodiment, the logical relationship between the target node, the first node, and the second node is clarified by unifying the parent node affiliation, ensuring that the hierarchical structure of each node in the function tree remains regular while maintaining semantic independence. This further improves the semantic accuracy and structural rationality of multi-source function tree fusion, mainly adapting to business scenarios where different functional points exist independently but belong to the same functional category.

[0158] The following, such as Figure 8 As shown, an exemplary description of the complete process for determining the position of a target node in the main function tree is provided, including, for example, the following steps S801-S822.

[0159] S801, determine the first similarity between the target node and the first node.

[0160] S802, determine whether the first similarity is greater than the second preset threshold. If yes, proceed to S803; otherwise, proceed to S804-S822.

[0161] S803, the position of the first node in the main function tree is taken as the position of the target node in the main function tree.

[0162] S804, determine the second similarity between the target node and the second node.

[0163] If the first similarity is less than or equal to the second preset threshold, the position of the first node cannot be directly used as the position of the target node. It is necessary to further compare the similarity of the second node at the same level as the first node to avoid missing the best matching node at the same level.

[0164] S805, determine whether the second similarity is greater than the second preset threshold. If yes, proceed to S806; otherwise, proceed to S807-S822.

[0165] S806, the position of the second node in the main function tree is taken as the position of the target node in the main function tree.

[0166] S807, determine whether the first node has child nodes (such as a third node). If yes, execute S808-S819; otherwise, execute S820-S822.

[0167] Understandably, if neither the first nor the second similarity score reaches the second preset threshold, the position of the first or second node cannot be used as the position of the target node. In this case, the target node's attribution has two possibilities: either it is a lower-level child node of the first node (requiring downward progressive matching), or it is a child node of the first node's parent node (requiring upward backtracking matching). Based on this, by determining whether the conditions for downward progressive matching are met, if there is a child node (a third node), the system prioritizes traversing downwards, attempting to find a more matching node within the first node's sub-levels, thus achieving progressive depth localization. If there is no child node, downward matching is not possible, and the system must backtrack upwards, comparing the similarity between the first node and its parent node to determine the final attribution of the target node. This approach covers both downward progressive matching and upward backtracking matching scenarios, avoiding localization omissions and ensuring the rigor of hierarchical matching.

[0168] S808, determine the third similarity between the target node and the third node.

[0169] S809, determine whether the third similarity is greater than the second preset threshold. If yes, proceed to S810; otherwise, proceed to S811.

[0170] S810, the position of the third node in the main function tree is taken as the position of the target node in the main function tree.

[0171] S811, determine whether the third node has child nodes. If yes, execute S812; otherwise, execute S813.

[0172] S812 polls the child nodes of the third node.

[0173] If the third similarity does not reach the second preset threshold, the position of the third node cannot be used as the position of the target node, and the third node has child nodes. This indicates that the target node may be located in a deeper sub-level of the third node. Therefore, the child nodes of the third node are polled, and the process continues to traverse deeper nodes, calculating the similarity between the target node and these child nodes one by one, until a node that reaches the second preset threshold is found, or until there are no lower-level nodes. This avoids positioning errors caused by not traversing deeper child nodes, ensures coverage of all possible levels of the main function tree, and maximizes the accuracy of target node positioning.

[0174] S813, determine whether the first similarity is greater than the similarity of the parent node of the first node. If yes, execute S814-S816; otherwise, execute S817-S819.

[0175] Here, the similarity score of the first node's parent node is the similarity score between the first node's parent node and the target node. It's understandable that determining whether the first similarity score is greater than the similarity score of the first node's parent node involves comparing the similarity score of the current node with the similarity score of the current reference node, where the current node is the first node and the reference node is the first node's parent node.

[0176] S814, determine if the third similarity is greater than the first similarity. If yes, proceed to S815. If no, proceed to S816.

[0177] By comparing the third similarity score and the first similarity score, we determine which node, the third or the first, has a higher match with the target node. The node with the higher match score has a better fit with the target node in terms of semantic information, path information, and parent-child relationship information. Therefore, the target node can be classified as its next-level child node, ensuring a more reasonable hierarchical logic for localization. S815 sets the target node as a child node of the third node.

[0178] If the third similarity score is greater than the first similarity score, it means that the target node matches the third node better than it matches the first node, indicating a better fit in semantic attributes and hierarchical relationships. Therefore, the target node is designated as a child node of the third node.

[0179] S816 sets the target node as a child node of the first node.

[0180] If the third similarity is less than or equal to the first similarity, it indicates that the target node matches the first node better than the third node, meaning their semantic and hierarchical relationship is stronger. Although the third node is a child node of the first node, the target node has a better fit with the first node. Classifying it as a child node of the third node would lead to a mismatch between hierarchical classification and the matching degree, which is logically unreasonable. Therefore, the target node is treated as a child node of the first node.

[0181] S817, determine if the third similarity is greater than the similarity of the parent node of the first node. If yes, proceed to S818. If no, proceed to S819.

[0182] By comparing the similarity between the third similarity and the similarity between the first node and its parent node, it is determined which node has a higher matching degree with the target node. The node with a higher matching degree is more suitable for carrying the target node at its corresponding level. This can avoid the attribution deviation when tracing back upwards and ensure the rationality of the target node's positioning.

[0183] S818 sets the target node as a child node of the third node.

[0184] If the third similarity is greater than the similarity of the parent node of the first node, it indicates that the target node matches the third node better than it matches the parent node of the first node, and their semantic and hierarchical relationship is closer. Although it is necessary to backtrack upwards in this case (to adapt to scenarios where the parent node of the first node has a higher similarity), the third node has a better fit with the target node. If the target node is classified as a child node of the parent node of the first node (at the same level as the first node), it would lead to a discrepancy between the hierarchical classification and the matching degree, resulting in a logical contradiction. Therefore, the target node is classified as a child node of the third node to ensure that the hierarchical classification of the target node is reasonable, while maintaining the continuity of the hierarchical structure of the main function tree.

[0185] S819, making the target node a child node of the parent node of the first node.

[0186] If the third similarity is less than or equal to the similarity of the first node's parent node, it means that the target node matches the first node's parent node better than it matches the third node, indicating a closer semantic and hierarchical relationship between them. In this case, the target node is more likely to be classified as a child node of the first node's parent node.

[0187] S820: Determine if the first similarity is greater than the similarity of the parent node of the first node. If yes, proceed to S821; otherwise, proceed to S822.

[0188] If the first node has no child nodes (making it impossible to proceed with matching downwards), and both the first and second similarity scores do not reach the second preset threshold (making it impossible to use the position of the first or second node as the position of the target node), then we can determine which node, the first or the first node's parent node, has a higher matching degree with the target node by comparing the first similarity score with the similarity score of the first node's parent node. The node with the higher matching degree is more suitable for hosting the target node at its corresponding level.

[0189] S821, making the target node a child node of the first node.

[0190] If the first similarity score is greater than the similarity score of the first node's parent node, it means that the target node matches the first node better than it matches the first node's parent node, indicating a closer semantic and hierarchical relationship between the two. Since the first node has no child nodes and cannot proceed further downwards, the target node is treated as a child node of the first node.

[0191] S822, the target node is taken as the child node corresponding to the parent node of the first node.

[0192] If the first similarity score is less than or equal to the similarity score of the first node's parent node, it means that the target node has a higher matching degree with the first node's parent node than with the first node itself, and their semantic and hierarchical relationship is closer. In this case, the target node is more suitable to be classified as a child node of the first node's parent node (i.e., a sibling node of the first node) rather than a child node of the first node.

[0193] In this embodiment, the similarity between the target node and the first node, second node and subsequent deep child nodes (such as the third node) in the main function tree is calculated layer by layer. Combined with the matching judgment of the second preset threshold and the dynamic update mechanism of the current reference node, the node levels are recursively traversed until a suitable belonging is found or all child nodes are exhausted. This fully explores the semantic association of nodes at each level to improve matching accuracy. Furthermore, the recursive traversal avoids the belonging deviation caused by shallow matching, ensuring the integrity of the fusion process and improving the semantic accuracy, logical rationality and automatic adaptation capability of function tree fusion.

[0194] For example, after determining the position of the target node in the main function tree, the child nodes under the target node in the first function tree segment are traversed sequentially, and each child node is used as a new target node. Then, the position of the new target node in the main function tree is determined. For details on how to determine the position of the target node in the main function tree, please refer to the specific implementation method. This approach covers all nodes in the first function tree segment, completely adding all nodes from the first function tree segment to the main function tree, thus improving the completeness of the function tree segment fusion.

[0195] In this embodiment of the application, before calculating the first similarity and the second similarity, the method further includes: determining the first node and the second node. That is, firstly, the hierarchical boundary of the target node in the main function tree is anchored (i.e., the range of the subtrees corresponding to the parent nodes of the first and second nodes), thereby limiting the target node to within that subtree. Then, it is matched sequentially with nodes at one or more levels to determine the position of the target node in the main function tree. The process of anchoring the first node and the second node in the main function tree is described below: In some embodiments, a reference parent node of the target node in the main function tree is determined, and the first node and the second node are determined based on the reference parent node. It is determined that the first node and the second node are nodes under the reference parent node.

[0196] In this embodiment, by determining the reference parent node of the target node, the hierarchical boundary of the target node in the main function tree is anchored, and the similarity of the context information between the target node and the nodes at the level below the reference parent node is limited to determine its belonging position. This narrows the search range of node matching, reduces invalid calculations, improves the efficiency and logical accuracy of determining the position of the target node in the main function tree, and ensures the hierarchical rationality of function tree fusion.

[0197] In one implementation of determining the reference parent node of a target node, it is determined whether the target node has a parent node in the first functional tree segment. If the target node does not have a parent node, the root node of the main functional tree is used as the reference parent node of the target node. If the target node has a parent node, and that parent node has been added to the main functional tree, then that parent node in the main functional tree is used as the reference parent node. For example, taking the second-level child node 1 "Sales Order Management" in functional tree segment 1 as the target node, its parent node in the original functional tree segment is the first-level child node "Sales Management Module". Assuming that "Sales Management Module" has been added to the main functional tree (the root node of the main functional tree is "ERP Management System"), since "Sales Management Module" is not the root node of the main functional tree, the parent node "Sales Management Module" is directly used as the reference parent node of the target node "Sales Order Management", and the subsequent position matching of the target node will be performed within the range of the child nodes corresponding to "Sales Management Module".

[0198] In other embodiments, any node at any level below the reference parent node of the target node is used as the parent node to which the first node and the second node belong. "Any level below" refers to the level where all nodes, such as the child nodes and grandchild nodes of the reference parent node, reside; it can also be called the subtree of the reference parent node of the target node. For example, the main function tree includes a root node, which has one child node 1, and child node 1 has two child nodes, namely the first node and the second node.

[0199] After adding the nodes of each functional tree segment to the main functional tree, the redundant nodes of the main functional tree can be further simplified to optimize its structure. The following explains how to simplify the redundant nodes of the main functional tree: Taking any node (the first node) in the main function tree as an example, the child nodes of the first node include the first child node and the second child node. The method also includes: calculating the fourth similarity between the context information of the first child node and the context information of the second child node; if the fourth similarity is greater than or equal to a second preset threshold, then the first child node and the second child node are merged.

[0200] Understandably, for nodes at the same level in the main function tree, the similarity of the contextual information of two nodes is calculated. If the fourth similarity reaches the second preset threshold, it means that the two nodes have high consistency in functional attributes and logical positioning, and there is functional overlap. Therefore, multiple nodes with similarity reaching the second preset threshold can be automatically merged, effectively eliminating redundancy of sibling nodes, simplifying the function tree structure, ensuring semantic and hierarchical logic consistency, and improving the quality and efficiency of function tree fusion.

[0201] Optionally, before calculating the fourth similarity between the context information of the first child node and the context information of the second child node, the connection between the first child node and the first node, and / or between the second child node and the first node, can be disconnected. This avoids process redundancy or structural conflicts caused by existing parent-child relationships during the merge operation, ensuring smooth execution of subsequent node merging operations.

[0202] In one possible implementation, when merging multiple nodes, all child nodes of the multiple nodes need to be attached to the merging node. In this way, the subordinate child nodes of the merged node are completely inherited to the retained node, which can preserve deep functional information without loss, maintain the continuity of the main functional tree hierarchy logic, and eliminate redundant nodes at the same level to simplify the structure.

[0203] like Figure 9 The diagram illustrates a method for merging child nodes at the same level. For example, it includes the following steps S901-S90.

[0204] S901, obtain the first node.

[0205] S902, if the first node has child nodes (such as the first child node, the second child node, etc.), add all child nodes of the first node to the candidate queue.

[0206] If the first node has no child nodes, then no action is taken.

[0207] S903, take out the unprocessed child nodes (such as the first child node) from the candidate queue in sequence.

[0208] S904: For each unprocessed child node, disconnect the original parent-child connection between that child node and the first node.

[0209] S905, based on the context information of the child node, calculate its fourth similarity with other unprocessed child nodes (such as the second child node) in the candidate queue.

[0210] S906, determine whether the fourth similarity is greater than or equal to the second preset threshold. If yes, proceed to S907. If no, proceed to S908.

[0211] S907, merge two child nodes whose fourth similarity is greater than or equal to the second preset threshold, and transfer all child nodes of one child node to the other child node.

[0212] S908, retain this child node as an independent node.

[0213] Repeat the above steps until all child nodes in the candidate queue have been traversed (e.g., the first child node, the second child node, etc. have all been traversed).

[0214] Optionally, the merged child nodes and independent nodes are marked as new child nodes, and their information is recorded. After all child nodes in the candidate queue have been traversed, the parent-child relationship between all the recorded new child nodes and the first node is re-established.

[0215] In this embodiment of the application, by determining the similarity between two child nodes, when the similarity reaches a second preset threshold, redundant nodes are removed and the information of the merged new child node is recorded; if the similarity does not reach the second preset threshold, the child nodes of the new child node (merged node or independent node) are recursively processed until there are no redundant nodes in the main functional tree.

[0216] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware 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 this application.

[0217] This application also provides a storage medium storing computer program instructions. When the computer program instructions are executed by a computing device, the computing device performs the method described above.

[0218] This application also provides a computer program product, which includes a computer program that, when at least one processor executes the computer program, causes the at least one processor to perform the methods described above in this application.

[0219] The computing device, storage medium, or computer program product provided in the embodiments of this application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.

[0220] Through the above description of the embodiments, those skilled in the art will clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The specific working process of the system, device, and unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0221] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for generating a functional tree, characterized in that, The method includes: Obtain a first functional tree segment, the first functional tree segment including a target node, the target node corresponding to target context information, the target context information including one or more of semantic information, path information, and parent-child relationship information, the semantic information being used to represent the semantic content of the target node, the path information being used to represent the name information of the path nodes traversed from the root node of the target node to the target node, and the parent-child relationship information being used to represent the relationship information between the target node and the parent node of the target node; The position of the target node in the main function tree is determined based on the similarity between the target context information and the context information of each node in the main function tree. Based on the position of the target node in the main function tree, add the target node to the main function tree.

2. The method according to claim 1, characterized in that, The main function tree includes a first node and a second node, where the first node and the second node correspond to the same parent node. Determining the position of the target node in the function tree based on the similarity between the target context information and the context information of each node in the main function tree includes: Calculate the first similarity between the target context information and the first context information of the first node, and the second similarity between the target context information and the second context information of the second node; If both the first similarity and the second similarity are greater than or equal to the first preset threshold, the position of the target node in the main function tree is determined based on the first similarity and the second similarity.

3. The method according to claim 2, characterized in that, Determining the position of the target node in the main function tree based on the first similarity and the second similarity includes: If the first similarity is greater than the second similarity, then the position of the target node in the main function tree is determined based on the position of the first node in the main function tree; If the first similarity is less than the second similarity, then the position of the target node in the main function tree is determined based on the position of the second node in the main function tree.

4. The method according to claim 3, characterized in that, Determining the position of the target node in the main function tree based on the position of the first node includes: If the first similarity is greater than or equal to the second preset threshold, the position of the first node in the main function tree is determined to be the position of the target node in the main function tree; the second preset threshold is greater than the first preset threshold.

5. The method according to claim 4, characterized in that, The first functional tree segment also includes at least one target child node, the target node being the root node of the at least one target child node, and the step of adding the target node in the main functional tree based on the position of the target node in the main functional tree includes: Merge the target node with the first node; The method further includes: Add the at least one target child node as a child node of the first node.

6. The method according to claim 4 or 5, characterized in that, The main function tree further includes at least one third node, wherein the at least one third node is a child node of the first node, and the method further includes: If the first similarity is less than the second preset threshold, the third similarity between the target context information and the context information of the at least one third node is calculated respectively. The position of the target node in the main function tree is determined based on the third similarity.

7. The method according to claim 6, characterized in that, Determining the position of the target node in the main function tree based on the third similarity includes: If the third similarity of all third nodes is less than the first similarity, the target node is determined to be a child node of the first node.

8. The method according to any one of claims 4 to 7, characterized in that, The child nodes of the first node include a first child node and a second child node, and the method further includes: Calculate the fourth similarity between the context information of the first child node and the context information of the second child node; If the fourth similarity is greater than or equal to the second preset threshold, then the first child node and the second child node are merged.

9. The method according to any one of claims 2 to 8, characterized in that, The method further includes: If both the first similarity and the second similarity are less than the first preset threshold, the target node, the first node, and the second node are determined to be child nodes of the same parent node.

10. A computing device, characterized in that, It includes a processor and a memory; the processor is coupled to the memory; The memory is used to store instructions; The processor is configured to execute instructions stored in the memory to cause the computing device to perform the method as described in any one of claims 1-9.