Decoupling and compiling method and device for closed connection graph
By generating a dependency graph and assigning IDs, and decoupling and compiling closed connection graphs, the problem of low data movement efficiency in neural network computing systems is solved, and storage resources are optimized and efficiency is improved.
Patent Information
- Application Number
- CN202410828325.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-11-22
AI Technical Summary
In on-chip systems for neural network computing, existing data transfer schemes require pre-handshake matching information, which consumes hardware storage resources and is inefficient.
By generating a dependency graph, tracing dependency direction vectors, generating a minimum closed connection graph, deleting redundant connections, and assigning connection IDs and node IDs, the decoupling and compilation of the closed connection graph are achieved, improving data migration efficiency.
The handshake process was reduced, storage resource utilization was optimized, and data migration efficiency was improved.
Smart Images

Figure CN119005246A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data migration, and more specifically, to a method and device for decoupling and compiling a closed connection graph. Background Art
[0002] In a system-on-chip for neural network computing, a large amount of intermediate data movement is involved. This data movement may be one-to-one, one-to-many, or many-to-one or many-to-many. In a many-to-many data movement, multiple nodes send data packets to the specified destination, and the receiving node rearranges the data packets and stores them locally. However, the above data transmission exists in large quantities in the system and is not limited to the above types. The same sending node may perform multiple data transmissions, and the types of each transmission are different. The rearrangement rules of the receiving end also vary from data packet to data packet. Therefore, how to match the configuration of the sender and the receiver of a certain transmission has become a problem. The current solution is to add a random and globally unique ID to each data packet of the sender as the identity of the data. Under this solution, the data matching between the sender and the receiver requires a handshake before data transmission, and the matching information is stored in advance before the real data transmission can be carried out. However, this marking method has the following two disadvantages: 1. An additional handshake is required in advance to transmit the matching information; storing the matching information requires hardware storage resources. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a method and device for decoupling and compiling a closed connection graph.
[0004] According to one aspect of the present invention, a method for decoupling and compiling a closed connection graph is provided, comprising:
[0005] Generate a dependency graph according to the formula of the graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector;
[0006] Track the target direction vector of the dependency direction vector of each node in the dependency graph in turn, and generate a minimum closed connection graph for each node in the dependency graph;
[0007] Compare the minimum closed connection graphs of each node in the dependency graph, delete the redundant connection graphs in the multiple minimum closed connection graphs, and obtain multiple minimum closed connection graphs to be processed;
[0008] Assign a connection ID to each minimum closed connection graph to be processed, and assign a node ID to the upstream and downstream nodes in each minimum closed connection graph to be processed, so as to generate multiple closed graphs with IDs;
[0009] Multiple closed graphs with IDs are stored according to a preset format to complete the compilation of the graph to be generated.
[0010] Optionally, the target direction vector of the dependency direction vector of each node in the dependency graph is tracked in turn to generate a minimum closed connection graph of each node in the dependency graph, including:
[0011] Track each dependency direction vector of each node in the dependency graph in turn, and record the current node and each of its dependency direction vectors in the graph item list;
[0012] The target direction vector of each dependent direction vector in the traceback graph item list is recorded in the traversal list if the target direction vector of the dependent direction vector is not the currently traced node and has never been traced before. The traceback operation is then performed recursively on the traversal list to generate the minimum closed connection graph for each node in the dependency graph.
[0013] Optionally, the minimum closed connection graphs of each node in the dependency graph are compared, redundant connection graphs in multiple minimum closed connection graphs are deleted, and multiple minimum closed connection graphs to be processed are obtained, including:
[0014] Compare each minimum closed graph with other minimum closed graphs in turn. If the minimum closed graph is contained in other minimum closed graphs, delete the minimum closed graph.
[0015] After the comparison is completed, the retained minimum closed connection graph is used as the minimum closed connection graph to be processed.
[0016] Optionally, decoupling and splitting a plurality of minimum closed connection graphs to be processed to obtain a plurality of small decoupled split closed graphs of each minimum closed connection graph to be processed includes:
[0017] By inserting multicast into nodes of multiple targets, the connection of multiple targets corresponding to a common upstream node in the minimum closed connection graph to be processed is interrupted to generate a first decoupled split closed graph set;
[0018] By adopting a method of inserting multicast into nodes of multiple targets, the connection between multiple targets and a common upstream node in the first decoupled split closed graph set is interrupted to generate a second decoupled split closed graph set;
[0019] The above operation is iterated until all generated decoupled split closed graphs do not contain connections where multiple targets correspond to a common upstream node, and multiple small decoupled split closed graphs are generated for each minimum to-be-processed minimum closed connection graph.
[0020] Optionally, a connection ID is assigned to each minimum closed connection graph to be processed, and a node ID is assigned to the upstream and downstream nodes in each minimum closed connection graph to be processed, to generate multiple closed graphs with IDs, including:
[0021] Decoupling and splitting a plurality of to-be-processed minimum closed connection graphs, and obtaining a plurality of small decoupled split closed graphs of each to-be-processed minimum closed connection graph;
[0022] A connection ID is assigned to each small decoupled split closed graph, and a node ID is assigned to the upstream and downstream nodes in each small decoupled split closed graph, so as to generate multiple closed graphs with IDs.
[0023] Optionally, a node ID consists of a connection ID and a suffix tag.
[0024] According to another aspect of the present invention, a closed connection graph decoupling and compilation device is provided, comprising:
[0025] A first generating module, used to generate a dependency graph according to a formula of a graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector;
[0026] A second generation module is used to sequentially track the target direction vector of the dependency direction vector of each node in the dependency graph to generate a minimum closed connection graph for each node in the dependency graph;
[0027] A first acquisition module is used to compare the minimum closed connection graphs of each node in the dependency graph, delete redundant connection graphs in multiple minimum closed connection graphs, and obtain multiple minimum closed connection graphs to be processed;
[0028] A second acquisition module is used to assign a connection ID to each minimum closed connection graph to be processed, and to assign a node ID to the upstream and downstream nodes in each minimum closed connection graph to be processed, so as to generate a plurality of closed graphs with IDs;
[0029] The third generation module is used to store multiple closed graphs with IDs according to a preset format to complete the compilation of the graph to be generated.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method described in any one of the above aspects of the present invention.
[0031] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of the above aspects of the present invention.
[0032] Therefore, the present application provides a decoupling and compilation method for a closed connection graph, generating a dependency graph according to a graph formula to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector; sequentially tracking the target direction vector of the dependency direction vector of each node in the dependency graph, generating a minimum closed connection graph for each node in the dependency graph; comparing the minimum closed connection graphs of each node in the dependency graph, deleting redundant connection graphs in multiple minimum closed connection graphs, and obtaining multiple minimum closed connection graphs to be processed; assigning a connection ID to each minimum closed connection graph to be processed, and assigning a node ID to the upstream and downstream nodes in each small decoupled split closed graph, generating multiple closed graphs with IDs; compiling multiple closed graphs with IDs according to a preset format, generating multiple compiled closed graphs, and moving data according to multiple compiled closed graphs. In conjunction with the ConnectionID mechanism, compilation from formula to closed graph is realized. Improve data movement efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:
[0034] Figure 1 It is a flowchart of a method for decoupling and compiling a closed connection graph provided by an exemplary embodiment of the present invention;
[0035] Figure 2 is a schematic diagram of a dependency graph provided by an exemplary embodiment of the present invention;
[0036] Figure 3 is a schematic diagram of a minimum closed connection graph provided by an exemplary embodiment of the present invention;
[0037] Figure 4 is a schematic diagram of a process for generating a minimum closed connected graph to be processed provided by an exemplary embodiment of the present invention;
[0038] Figure 5 is a schematic diagram of a minimum closed connected graph to be processed provided by an exemplary embodiment of the present invention;
[0039] Figure 6 is a schematic diagram of a decoupling process of a minimum closed connection graph to be processed provided by an exemplary embodiment of the present invention;
[0040] Figure 7 It is a schematic diagram of a splitting process of a minimum closed connected graph to be processed provided by an exemplary embodiment of the present invention;
[0041] Figure 8 It is a schematic diagram of decoupling and splitting of a minimum closed connection graph to be processed provided by an exemplary embodiment of the present invention;
[0042] Fig. 9 It is a schematic diagram of connection ID allocation of a small decoupled split closed graph provided by an exemplary embodiment of the present invention;
[0043] Fig.10 It is a schematic diagram of node ID allocation of a small decoupled split closed graph provided by an exemplary embodiment of the present invention;
[0044] Fig.11 It is a structural schematic diagram of a closed connection graph decoupling and compilation device provided by an exemplary embodiment of the present invention;
[0045] Fig.12 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0046] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.
[0047] It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0048] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0049] It should also be understood that, in the embodiments of the present invention, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0050] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0051] In addition, the term "and / or" in the present invention is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present invention generally indicates that the associated objects before and after are in an "or" relationship.
[0052] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0053] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0054] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0055] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0056] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0057] Embodiments of the present invention can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0058] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0059] Exemplary Methods
[0060] Figure 1 FIG. 1 is a flow chart of a closed connection graph decoupling and compilation method provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the closed connection graph decoupling and compilation method 100 includes the following steps:
[0061] Step 101, generating a dependency graph according to a formula of a graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector;
[0062] Step 102, sequentially tracking the target direction vector of the dependency direction vector of each node in the dependency graph, and generating a minimum closed connection graph of each node in the dependency graph;
[0063] Step 103, comparing the minimum closed connection graphs of each node in the dependency graph, deleting redundant connection graphs in multiple minimum closed connection graphs, and obtaining multiple minimum closed connection graphs to be processed;
[0064] Step 104, assigning a connection ID to each minimum closed connection graph to be processed, and assigning a node ID to the upstream and downstream nodes in each minimum closed connection graph to be processed, to generate a plurality of closed graphs with IDs;
[0065] Step 105, storing multiple closed graphs with IDs according to a preset format, and completing the compilation of the graph to be generated.
[0066] Specifically, in order to solve the technical problems existing in the background technology, the present application proposes a connection graph mechanism for realizing data migration. The decoupling and compilation method of the closed connection graph specifically includes the following steps:
[0067] 1. Generate a dependency tree / graph based on the graph formula to be generated. For example, based on the following formula:
[0068] A=in0+in1
[0069] B=in2-in3
[0070] C=in4+in5
[0071] D=A+B
[0072] E=BC
[0073] F=D+E
[0074] G=FC
[0075] H=G+C
[0076] generate Figure 2 Dependency graph: Each node information contains two direction vectors, namely the dependency direction vector and the target direction vector. For example, the node information of node B is:
[0077] B:dependence:In2,in3;
[0078] destination:D,E.
[0079] 2. Track the target vector of each dependency of the node and obtain the minimum closed connection graph.
[0080] Trace each dependency of the node and record the current node and each of its dependencies in the preset graph item list (ignore if it already exists).
[0081] Then trace back to each dependent target of the node. If the dependent target is not the currently tracked node and has not been tracked before, record the target in the preset traversal list. Then recursively perform the above operation on the preset traversal list.
[0082] For example, for node E:
[0083] The dependencies of node E are: B, C. Record E, B, C in the preset item list. The current preset item list is: E, B, C
[0084] Going back to the goals of B and C
[0085] B's targets are: D and E, where E is the target being tracked and D has never been tracked, so it is recorded in the preset traversal list.
[0086] The targets of C are: E, G, H, where E is the node being tracked, G and H have never been tracked, and they are recorded in the preset traversal list
[0087] The current preset traversal list includes: D, G, H. Next, recursively perform the same operation on D:
[0088] D's dependencies are: A, B. Record D, A, and B in the preset item list. The current preset item list is: E, B, C, D, and A.
[0089] Let’s trace back to the goals of A and B:
[0090] The only target of A is D, and no further traversal is required;
[0091] Among them, B's targets are D and E. E has been tracked in the previous step. D is the target currently being tracked. There is no new target to be tracked, and no further operation is required;
[0092] The current preset traversal list includes: D, G, H, among which D has been tracked. Next, recursively perform the same operation on G:
[0093] G's dependencies are C and F. Record G, C, and F in the preset item list. The current preset item list is: E, B, C, D, A, G, and F.
[0094] Let’s trace back to the goals of C and F:
[0095] The targets of C are E, G, and H. E has been tracked previously, G is the target currently being tracked, and H already exists in the preset traversal list, so no further operation is required;
[0096] The target of F is only G, and no further traversal is required;
[0097] The current preset traversal list includes: D, G, H, among which D and G have been tracked. Next, recursively perform the same operation on H:
[0098] H's dependencies are G and C. H, G, and C are recorded in the preset item list. The current preset item list is: E, B, C, D, A, G, F, H
[0099] Let’s trace back to G and C’s goals:
[0100] The target of G is only H, and no further traversal is required;
[0101] The targets of C are E, G, and H. E and G have been tracked, and H is the target currently being tracked and does not need to be traversed further;
[0102] At this point, the preset traversal list has been completely traced. The recursion ends.
[0103] 3. Trace each node according to the above method to obtain several minimum closed connection graphs.
[0104] Following the operation in step 2, taking tracing node E as an example, a closed connection graph containing E, B, C, D, A, G, F, and H is obtained. The closed connection graph is as follows: Figure 3 shown.
[0105] According to step 2, the same operation is performed on all other nodes in the connection graph, and the original connection graph can be split into several closed connection graphs.
[0106] 4. Delete redundant connection diagrams.
[0107] If one of these split connected graphs is included in another graph, the included graph will be discarded. Figure 4 Tracing the F node will result in a connection graph that only contains D, E, and F. This graph is included in the connection graph obtained in step 2, so this graph is a redundant connection graph and is deleted from the result.
[0108] The result of step 3, after the above processing, will get several minimum closed connection graphs to be processed. In this example, there are 4 minimum closed connection graphs to be processed as shown in the figure below. Figure 5 As shown:
[0109] 5. Decoupling and splitting of closed-connection graph dependencies.
[0110] The closed graph obtained in step 2 has a long dependency. If a closed graph is too large and the dependency chain is too long, the waiting between dependencies will increase, greatly reducing the efficiency of data migration. Therefore, a dependency decoupling method is proposed for decoupling and splitting the dependency of the closed graph. Figure 6 shown.
[0111] You can interrupt the dependency of multiple targets on a common upstream by inserting multicast into the nodes of multiple targets. For example, if C is a 3-target node, you can insert a 1to3 multicast of the first-level C after the C node to interrupt the common dependency on the original C.
[0112] Each multicasted C participates in the calculation of the three subsequent targets independently without affecting each other. Therefore, after inserting the multicast, a subgraph that can be further split is generated, such as Figure 7 shown.
[0113] Furthermore, inserting multicast before B in the first subgraph can further split it, and the result after splitting is as follows Figure 8 shown.
[0114] After decoupling and splitting, such a large closed graph becomes several small closed graphs. The transmission of each small closed graph is carried out independently, and the waiting delay of dependencies will be greatly reduced. However, splitting will occupy additional storage resources. In actual use, the balance between performance and storage area can be made according to needs.
[0115] 6. Assign a Connection ID to each closed connection graph.
[0116] After the above steps, the calculation formula has been converted into several independent transmission closed graphs. The next step is to assign a globally unique Connection ID to each closed graph. For example, in the above example, you can follow Fig. 9 Assignment (Connection ID is marked in blue to distinguish the dependency tree):
[0117] 7. Assign Node ID to each upstream and downstream of each closed graph.
[0118] Node ID is composed of Connection ID + suffix. Both upstream and downstream are marked from 0. In the above example, the figure after assigning Node ID is as follows Fig.10 As shown:
[0119] The Connection ID can uniquely represent a closed graph and can be used as the basis for upstream and downstream matching. The Node ID can uniquely represent a group of configurations.
[0120] Therefore, the present application provides a closed connection graph decoupling and compilation method, and cooperates with the Connection ID mechanism to realize the compilation from formula to closed graph, thereby improving the data transfer efficiency.
[0121] Exemplary Devices
[0122] Fig.11FIG. 1 is a schematic diagram of a structure of a closed connection graph decoupling and compilation device provided by an exemplary embodiment of the present invention. Fig.11 As shown, the apparatus 1100 includes:
[0123] A first generating module 1110, used for the first generating module, is used to generate a dependency graph according to the formula of the graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector;
[0124] A second generation module 1120 is used to sequentially track the target direction vector of the dependency direction vector of each node in the dependency graph to generate a minimum closed connection graph for each node in the dependency graph;
[0125] A first acquisition module 1130 is used to compare the minimum closed connection graphs of each node in the dependency graph, delete redundant connection graphs in multiple minimum closed connection graphs, and obtain multiple minimum closed connection graphs to be processed;
[0126] A second acquisition module 1140 is used to assign a connection ID to each minimum closed connection graph to be processed, and to assign a node ID to the upstream and downstream nodes in each minimum closed connection graph to be processed, so as to generate a plurality of closed graphs with IDs;
[0127] The third generating module 1150 is used to store multiple closed graphs with IDs according to a preset format to complete the compilation of the graph to be generated.
[0128] Optionally, the second generating module 1120 includes:
[0129] A tracking submodule, used to track each dependency direction vector of each node in the dependency graph in turn, and record the current node and each dependency direction vector thereof in a graph item list;
[0130] The first generating submodule is used to trace the target direction vector of each of the dependent direction vectors in the graph item list. If the target direction vector of the dependent direction vector is not a currently traced node and has never been traced, the target direction vector is recorded in a traversal list, and the tracing operation is recursively performed on the traversal list in turn to generate the minimum closed connection graph for each node in the dependency graph.
[0131] Optionally, the first acquisition module 1130 includes:
[0132] A comparison submodule, used for comparing each of the minimum closed connection graphs with other minimum closed connection graphs in turn, and deleting the minimum closed connection graph if the minimum closed connection graph is included in other minimum closed connection graphs;
[0133] As a submodule, after the comparison is completed in sequence, the retained minimum closed connection graph is used as the minimum closed connection graph to be processed.
[0134] Optionally, the second acquisition module 1140 includes:
[0135] The second generation submodule is used to interrupt the connection of multiple targets corresponding to a common upstream node in the minimum closed connection graph to be processed by inserting multicast into the nodes of multiple targets, so as to generate a first decoupled split closed graph set;
[0136] The third generation submodule is used to interrupt the connection of multiple targets corresponding to a common upstream node in the first decoupled split closed graph set by inserting a multicast method into the nodes of multiple targets, so as to generate a second decoupled split closed graph set;
[0137] The fourth generation submodule is used to iterate the above operation until all the generated decoupled split closed graphs do not contain connections where multiple targets correspond to a common upstream node, and generate multiple small decoupled split closed graphs for each minimum to-be-processed minimum closed connection graph.
[0138] Optionally, the second acquisition module 1140 includes:
[0139] An acquisition submodule is used to decouple and split multiple minimum closed connection graphs to be processed, and obtain multiple small decoupled split closed graphs of each minimum closed connection graph to be processed;
[0140] The fifth generation submodule is used to assign a connection ID to each small decoupled split closed graph, and assign a node ID to the upstream and downstream nodes in each small decoupled split closed graph, so as to generate multiple closed graphs with IDs.
[0141] Optionally, a node ID consists of a connection ID and a suffix tag.
[0142] Exemplary Electronic Devices
[0143] Fig.12 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. Fig.12 As shown, the electronic device 120 includes one or more processors 121 and a memory 122 .
[0144] The processor 121 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0145] The memory 122 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 121 may run the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above and / or other desired functions. In one example, the electronic device may also include: an input device 123 and an output device 124, which are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0146] In addition, the input device 123 may also include, for example, a keyboard, a mouse, etc.
[0147] The output device 124 can output various information to the outside, and can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto.
[0148] Of course, to simplify, Fig.12 Only some of the components related to the present invention in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application conditions.
[0149] Exemplary computer program products and computer-readable storage media
[0150] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above-mentioned "Exemplary Method" section of this specification.
[0151] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the embodiments of the present invention, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0152] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0153] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, system or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0154] The basic principle of the present invention is described above in conjunction with specific embodiments. However, it should be pointed out that the advantages, strengths, effects, etc. mentioned in the present invention are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present invention. In addition, the specific details disclosed above are only for the purpose of illustration and facilitation of understanding, rather than limitation, and the above details do not limit the present invention to being implemented by adopting the above specific details.
[0155] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0156] The block diagrams of the devices, systems, equipment, and systems involved in the present invention are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, systems, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The word "such as" used here refers to the phrase "such as but not limited to", and can be used interchangeably with it.
[0157] The method and system of the present invention may be implemented in many ways. For example, the method and system of the present invention may be implemented by software, hardware, firmware or any combination of software, hardware, firmware. The above order of steps for the method is only for illustration, and the steps of the method of the present invention are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present invention may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers a recording medium storing a program for executing the method according to the present invention.
[0158] It should also be noted that in the system, device and method of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. The above description of the disclosed aspects is provided to enable any technician in the field to make or use the present invention. Various modifications to these aspects are very obvious to those skilled in the art, and the general principles defined here can be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown here, but in accordance with the widest range consistent with the principles and novel features disclosed here.
[0159] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present invention to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for decoupling and compiling a closed connection graph, It is characterized in that include: Generate a dependency graph according to a formula of the graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector; Tracking the target direction vector of the dependency direction vector of each node in the dependency graph in sequence to generate a minimum closed connection graph for each node in the dependency graph; Compare the minimum closed connection graphs of each node in the dependency graph, delete redundant connection graphs in a plurality of the minimum closed connection graphs, and obtain a plurality of minimum closed connection graphs to be processed; Assigning a connection ID to each of the minimum closed connection graphs to be processed, and assigning a node ID to the upstream and downstream nodes in each of the minimum closed connection graphs to be processed, to generate a plurality of closed graphs with IDs; The plurality of closed graphs with IDs are stored according to a preset format to complete the compilation of the graph to be generated.
2. The method according to claim 1, It is characterized in that Tracking the target direction vector of the dependency direction vector of each node in the dependency graph in sequence to generate a minimum closed connection graph for each node in the dependency graph includes: Tracking each dependency direction vector of each node in the dependency graph in turn, and recording the current node and each dependency direction vector thereof in a graph item list; The target direction vector of each of the dependent direction vectors in the graph item list is traced back. If the target direction vector of the dependent direction vector is not a currently traced node and has never been traced, the target direction vector is recorded in a traversal list, and the traversal list is recursively traced back in turn to generate the minimum closed connection graph for each node in the dependency graph.
3. The method according to claim 1, It is characterized in that Comparing the minimum closed connection graphs of each node in the dependency graph, deleting redundant connection graphs in a plurality of the minimum closed connection graphs, and obtaining a plurality of minimum closed connection graphs to be processed, including: Compare each of the minimum closed connected graphs with the other minimum closed connected graphs in turn, and if the minimum closed connected graph is included in the other minimum closed connected graphs, delete the minimum closed connected graph; After the comparison is completed, the minimum closed connected graph that is retained is used as the minimum closed connected graph to be processed.
4. The method according to claim 1, It is characterized in that Decoupling and splitting the plurality of minimum closed connection graphs to be processed, and obtaining a plurality of small decoupled split closed graphs of each of the minimum closed connection graphs to be processed, including: By inserting multicast into nodes of multiple targets, the connections of multiple targets in the to-be-processed minimum closed connection graph corresponding to a common upstream node are interrupted to generate a first decoupled split closed graph set; By adopting a method of inserting multicast into nodes of multiple targets, the connection between multiple targets and a common upstream node in the first decoupled split closed graph set is interrupted to generate a second decoupled split closed graph set; The above operation is iterated until all generated decoupled split closed graphs do not contain connections where multiple targets correspond to a common upstream node, and multiple small decoupled split closed graphs are generated for each minimum to-be-processed minimum closed connection graph.
5. The method according to claim 1, It is characterized in that Assigning a connection ID to each of the minimum closed connection graphs to be processed, and assigning a node ID to each of the upstream and downstream nodes in the minimum closed connection graphs to be processed, to generate a plurality of closed graphs with IDs, including: Decoupling and splitting the plurality of minimum closed connection graphs to be processed, and obtaining a plurality of small decoupled split closed graphs of each of the minimum closed connection graphs to be processed; A connection ID is assigned to each of the small decoupled split closed graphs, and a node ID is assigned to the upstream and downstream nodes in each of the small decoupled split closed graphs, so as to generate a plurality of closed graphs with IDs.
6. The method according to claim 5, It is characterized in that The node ID consists of the connection ID and a suffix tag.
7. A decoupling and compiling device for a closed connection graph, It is characterized in that include: A first generating module, configured to generate a dependency graph according to a formula of a graph to be generated, wherein each node information in the dependency graph includes a dependency direction vector and a target direction vector; A second generating module is used to sequentially track the target direction vector of the dependency direction vector of each node in the dependency graph to generate a minimum closed connection graph for each node in the dependency graph; A first acquisition module is used to compare the minimum closed connection graphs of each node in the dependency graph, delete redundant connection graphs in a plurality of the minimum closed connection graphs, and acquire a plurality of minimum closed connection graphs to be processed; A second acquisition module is used to assign a connection ID to each of the minimum closed connection graphs to be processed, and to assign a node ID to each of the upstream and downstream nodes in the minimum closed connection graphs to be processed, so as to generate a plurality of closed graphs with IDs; The third generating module is used to store the multiple closed graphs with IDs according to a preset format to complete the compilation of the graph to be generated.
8. The device according to claim 7, It is characterized in that The second generation module includes: A tracking submodule, used to track each dependency direction vector of each node in the dependency graph in turn, and record the current node and each dependency direction vector thereof in a graph item list; The first generating submodule is used to trace the target direction vector of each of the dependent direction vectors in the graph item list. If the target direction vector of the dependent direction vector is not a currently traced node and has never been traced, the target direction vector is recorded in a traversal list, and the tracing operation is recursively performed on the traversal list in turn to generate the minimum closed connection graph for each node in the dependency graph.
9. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.
10. An electronic device, It is characterized in that The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1 to 6.
