Method and device for controlling interface call relationship

By constructing and collecting and optimizing its structure, the problem of low query efficiency when the number of interfaces is large in the existing technology is solved, and efficient interface call relationship query is realized.

CN113656202BActive Publication Date: 2025-04-04AGRICULTURAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111006025.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-04-04
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

In the prior art, when processing a large number of interfaces, querying the interface call relationship is inefficient, and query results may not even be obtained.

Method used

By building an independent set for the n read systems and using the system with interface call relationship as the basis, iterates through the interface call relationship and iterates the collection to obtain and search. Then check whether the two systems to be verified for interface call relationship are in the same set and determine whether there is an interface call relationship.

Benefits of technology

The call relationship between interfaces is stored using the set and query mechanism, and the structure is optimized during the process of constructing and querying set, which improves the query efficiency of the interface call relationship and solves the problem of low query efficiency when there are too many interfaces.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113656202B_ABST
    Figure CN113656202B_ABST
Patent Text Reader

Abstract

The present invention provides a method and device for controlling interface call relationships, which constructs independent sets for n systems to be read respectively to obtain n sets; reads m pairs of known interface call relationships between n systems, where m is less than or equal to n; takes the system with interface call relationships as a benchmark, traverses the m pairs of interface call relationships and iteratively merges the sets corresponding to the systems to obtain a union-find set; queries whether each pair of two systems whose interface call relationships are to be verified are in the same union-find set; if so, determines that the two systems have an interface call relationship; if not, determines that the two systems do not have an interface call relationship. In this solution, a union-find set mechanism is used to store the call relationships between interfaces, and the structure of the union-find set is optimized in the process of constructing the union-find set, so as to facilitate the execution of subsequent search operations, realize effective optimization of the control method of interface call relationships, effectively improve the execution efficiency of interface call relationship control, and improve the efficiency of subsequent queries.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of application system management and control, and in particular to a method and device for managing and controlling interface call relations. Background Art

[0002] The interface is the link for communication and interaction between application systems. It is the core carrier for providing services between application system modules and to the outside world. The quality and efficiency of interface management are crucial to the management and control of enterprise application systems.

[0003] At present, there are two main methods for managing and controlling interface call relationships. One is to store the call relationships between interfaces in a relational database, build an interface call relationship table, and add a record to the table whenever an interface call relationship appears. However, with this method, when there are a large number of interfaces and the call relationships between interfaces are complex, multiple self-join operations on the relationship table are required to locate the interfaces with call relationships, and the query efficiency will drop sharply as the number of records increases.

[0004] Another method is to solidify the interface call relationship into a data structure such as a graph (such as storing it in a graph database), and obtain the connected components through conventional graph algorithms such as breadth-first traversal and depth-first traversal when querying the interface call relationship. However, when the number of interfaces is large, the construction and traversal of the graph will take up a lot of space and time, making it difficult to complete within an acceptable time or even impossible to obtain results.

[0005] It can be seen from this that when the existing technology is used to manage the interface call relationship, when the number of interfaces is large, the query efficiency will be very low and even the query results may not be obtained. Summary of the invention

[0006] In view of this, an embodiment of the present invention provides a method and device for managing and controlling interface call relationships, so as to optimize the management and control method of interface call relationships and improve the efficiency of subsequent queries.

[0007] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0008] A first aspect of an embodiment of the present invention discloses a method for managing and controlling interface call relationships, the method comprising:

[0009] Construct independent sets for the n systems read respectively, and obtain n sets, where the value of n is a positive integer greater than 2;

[0010] Read m pairs of known interface call relationships between the n systems, where m is less than or equal to n;

[0011] Taking the systems with interface call relationships as the benchmark, traverse m pairs of interface call relationships and iteratively merge the sets corresponding to the systems to obtain a union-find set;

[0012] Check whether the two systems whose interface call relationship is to be verified are in the same union check set;

[0013] If so, determining that the two systems have an interface calling relationship;

[0014] If not, it is determined that the two systems do not have an interface calling relationship.

[0015] Optionally, taking the systems with interface call relationships as a benchmark, traversing m pairs of interface call relationships and iteratively merging sets corresponding to the systems to obtain a union-find set includes:

[0016] Starting from the first pair of interface call relationships, merging sets corresponding to systems having the first pair of interface call relationships to obtain a first intermediate set;

[0017] The first intermediate set and other sets remaining after the first merging are used as the basis for the next merging, and the sets corresponding to the systems having all the second pair of interface calling relationships are merged to obtain a second intermediate set;

[0018] Determine whether there is an unused interface call relationship. If so, continue to traverse other interface call relationships to obtain a final union-find set, which is a mutually disjoint set.

[0019] Optionally, independent sets are constructed for the n systems to be read, respectively, to obtain n sets, including:

[0020] Read n systems and indicate each system with a system ID;

[0021] Taking the system identifier as an element, constructing a set corresponding to each system, and indicating the set corresponding to each system with the system identifier;

[0022] The reading of the m pairs of known interface call relationships between the n systems includes:

[0023] The m pairs of interface calling relationships known between the n systems are read, and each pair of interface calling relationships is indicated by a system identifier.

[0024] Optionally, taking the systems with interface call relationships as a benchmark, traversing m pairs of interface call relationships and iteratively merging sets corresponding to the systems to obtain a union-find set includes:

[0025] The set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier are respectively used as row and column items to construct an iteration state table;

[0026] Starting from the first pair of interface call relationships, traverse m pairs of interface call relationships, merge the sets corresponding to the systems with interface call relationships, and record the set state after each set merging in the construction iteration state table until a final union-find set is obtained, and the union-find set is a mutually disjoint set;

[0027] The set state is indicated by the system identifier contained in the merged set.

[0028] Optionally, also include:

[0029] Using any system identifier included in the union-find set to represent the union-find set;

[0030] The querying whether each system whose interface call relationship is to be verified is in the same union check set includes:

[0031] Check whether the system identifiers corresponding to the two systems whose interface call relationship is to be verified belong to the union-find set represented by the same system identifier;

[0032] If so, determine that the two systems belong to the same union-find set;

[0033] If not, it is determined that the two systems do not belong to the same union-find set.

[0034] Optionally, also include:

[0035] Each time a collection is merged, the collection containing fewer systems is merged into the collection containing more systems.

[0036] A second aspect of an embodiment of the present invention discloses a device for managing and controlling interface call relationships, the device comprising:

[0037] A construction module is used to construct independent sets for the n systems read, to obtain n sets, where the value of n is a positive integer greater than 2;

[0038] A reading module, used for reading m pairs of known interface call relationships between the n systems, where m is less than or equal to n;

[0039] A traversal module is used to traverse m pairs of interface call relationships based on the systems with interface call relationships, iteratively merge the sets corresponding to the systems, and obtain a union-find set;

[0040] The query module is used to query whether each of the two systems whose interface call relationship is to be verified is in the same union check set; if so, it is determined that the two systems have an interface call relationship; if not, it is determined that the two systems do not have an interface call relationship.

[0041] Optionally, the traversal module is specifically used for:

[0042] Starting from the first pair of interface call relationships, the sets corresponding to the systems having the first pair of interface call relationships are merged to obtain a first intermediate set; the first intermediate set and other sets remaining after the first merge are used as the basis for the next merge, and the sets corresponding to the systems having all the second pairs of interface call relationships are merged to obtain a second intermediate set; it is determined whether there are any unused interface call relationships, and if so, other pairs of interface call relationships are continued to be traversed to obtain a final union-find set, which is a mutually non-overlapping set.

[0043] Optionally, the building module is specifically used to:

[0044] Read n systems and indicate each system with a system identifier; construct a set corresponding to each system using the system identifier as an element, and indicate each set corresponding to the system with the system identifier;

[0045] Accordingly, the reading module is specifically used for:

[0046] The m pairs of interface calling relationships known between the n systems are read, and each pair of interface calling relationships is indicated by a system identifier.

[0047] Optionally, the traversal module is specifically used for:

[0048] The set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier are respectively used as row and column items to construct an iterative state table; starting from the first pair of interface call relationships, m pairs of interface call relationships are traversed, the sets corresponding to the systems with interface call relationships are merged, and the set state after each set merging is recorded in the constructed iterative state table until a final union-find set is obtained, and the union-find set is a mutually disjoint set;

[0049] The set state is indicated by the system identifier contained in the merged set.

[0050] Based on the above-mentioned embodiment of the present invention, a method and device for controlling interface call relationships are provided. By constructing independent sets for the n systems read, n sets are obtained, and the value of n is a positive integer greater than 2; the known m pairs of interface call relationships between the n systems are read, and m is less than or equal to n; based on the system with the interface call relationship, the m pairs of interface call relationships are traversed and the sets corresponding to the systems are iteratively merged to obtain a union-find set; it is queried whether each of the two systems whose interface call relationships are to be verified are in the same union-find set; if so, it is determined that the two systems have an interface call relationship; if not, it is determined that the two systems do not have an interface call relationship. In this scheme, the union-find set mechanism is used to store the call relationships between interfaces, and the structure of the union-find set is optimized in the process of constructing the union-find set, so as to facilitate the execution of subsequent search operations, realize the effective optimization of the control method of the interface call relationship, effectively improve the execution efficiency of the control of the interface call relationship, and improve the purpose of subsequent query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0052] Figure 1 A flowchart of a method for managing and controlling interface call relationships disclosed in an embodiment of the present invention;

[0053] Figure 2 A schematic diagram of a flow chart of another method for managing and controlling interface call relationships disclosed in an embodiment of the present invention;

[0054] Figure 3 A schematic diagram of the interface call relationship known to 9 systems disclosed in the embodiment of the present invention;

[0055] Figure 4 This is a schematic diagram of the state of the merge-check after reading (a, b) according to the embodiment of the present invention;

[0056] Figure 5 This is a schematic diagram of the state of the merge-find after reading (a, d) according to the embodiment of the present invention;

[0057] Figure 6 It is a schematic diagram of the union-find state after the iteration is completed according to the embodiment of the present invention;

[0058] Figure 7 A schematic diagram of the structure of a device for controlling interface call relationships disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0061] The following is an explanation of the terms involved in the embodiments of the present invention:

[0062] Service: A service is a collection of related computer instructions that completes a certain type of system operation.

[0063] Provider: Provider is the abbreviation of "service provider", which is an application system that provides one or more services to the outside world.

[0064] Consumer: Consumer is short for "service consumer", which refers to the application system that calls one or more services of the provider.

[0065] Interface: From a business perspective, the interface is the carrier for the provider to output business capabilities, providing business capabilities to consumers so that consumers and providers can cooperate to complete the operation of a business. From a technical perspective, the interface refers to the formal agreement on communications, messages, functions and data to meet the purpose of functional access or data transmission between application systems.

[0066] Interface call relationship: The interface call made by the consumer to the service provider is regarded as the existence of an interface consumption relationship between the two.

[0067] Call chain: A group of systems that have interface calling relationships with each other are considered to have a call chain between them.

[0068] Union-find set: Union-find set is a data structure that represents disjoint sets. Union-find set consists of a set of sets whose elements are different from each other. It is often used to represent a dynamic set consisting of a set of disjoint elements. In the union-find set structure, each set has a representative element to represent the set. The representative element can be selected arbitrarily from the elements in the set. Union-find set is an optimized data structure for solving graph traversal problems. In the problem of element partitioning and searching, it can effectively reduce the time complexity of solving the problem.

[0069] Basic operations of union-find set: There are three basic operations in union-find set, including building a new set (MAKE-SET), merging sets (UNION), and finding the set where an element is located (FIND-SET). Let x and y be elements in any set in the union-find set, and the details of each operation are as follows.

[0070] MAKE-SET(x): Build a new set. In the initialization phase, the elements need to be built into a union-find set structure. In this process, an independent set is created for all elements, and each new set contains only one element, that is, for the MAKE-SET(x) process, a set containing only the element x is built. Since the sets in the union-find set do not intersect, the element x will not appear in other sets.

[0071] UNION(x, y): merges two sets. In this process, the set Sx containing the element x and the set Sy containing the element y are merged into a new set. In order to maintain the non-intersecting characteristics of the sets in the union-find set, it is necessary to delete the original sets Sx and Sy after the merge is completed, and at the same time, select an element from the new set SxUSy as the representative element of the new set. In actual operation, in order to improve execution efficiency, one set is usually merged into the other set instead of deleting.

[0072] FIND-SET(x): Find the set that an element is in. In this process, given an element x, a pointer needs to be returned that points to the representative of the set that contains x.

[0073] As can be seen from the background technology, when the interface call relationship is managed and controlled in the way of the prior art, when the number of interfaces is large, the query efficiency will be very low, and even the query results may not be obtained. Therefore, an embodiment of the present invention discloses a method and device for managing and controlling interface call relationships. The call relationship between interfaces is stored using a union-find mechanism, and the structure of the union-find is optimized in the process of constructing a union-find set to facilitate the execution of subsequent search operations, thereby achieving an effective optimization of the management and control method of the interface call relationship, effectively improving the execution efficiency of the interface call relationship management and control, and improving the purpose of subsequent query efficiency. The specific implementation process is described in detail through the following embodiments.

[0074] like Figure 1 FIG. 1 is a flow chart of a method for managing and controlling an interface call relationship disclosed in an embodiment of the present invention. The method mainly includes the following steps:

[0075] S101: construct independent sets for the n systems read respectively, and obtain n sets.

[0076] In S101, the value of n is a positive integer greater than 2.

[0077] S102: Read m pairs of known interface calling relationships between the n systems.

[0078] In S102, m is less than or equal to n.

[0079] The value of m is related to the interface calling relationship between n systems.

[0080] Assume that the value of n is 3, that is, there are three systems: System A, System B and System C. There is an interface calling relationship between System A and System B, there is an interface calling relationship between System B and System C, there is an interface calling relationship between System A and System C, and there are three pairs of interface calling relationships between the three systems.

[0081] On the other hand, if it is known that there is an interface calling relationship between System A and System B, and there is an interface calling relationship between System B and System C, then it is also considered that System A, System B and System C are in the same calling chain.

[0082] S103: Taking the systems with interface call relationships as a benchmark, traverse m pairs of interface call relationships and iteratively merge the sets corresponding to the systems to obtain a union-find set.

[0083] In the specific implementation of S103, for the m pairs of interface calling relationships known to n systems, starting from the first pair of interface calling relationships, the sets corresponding to the systems having the first pair of interface calling relationships are merged to obtain a first intermediate set.

[0084] Then, the first intermediate set and other sets remaining after the first merging are used as the basis for the next merging, and the sets corresponding to the systems having all the second pair of interface calling relationships are merged to obtain the second intermediate set.

[0085] It should be noted that each time a set is merged, the set containing fewer systems is merged into the set containing more systems.

[0086] Finally, determine whether there are any unused interface call relationships. If so, continue to traverse other interface call relationships. If not, obtain the final union-find set.

[0087] The union-find sets are mutually disjoint sets.

[0088] S104: Check whether each of the two systems whose interface call relationship is to be verified is in the same check set. If so, execute S105; if not, execute S106.

[0089] S105: Determine whether the two systems have an interface calling relationship.

[0090] S106: Determine that the two systems do not have an interface calling relationship.

[0091] An embodiment of the present invention provides a method for managing and controlling interface call relationships, which constructs independent sets for the n systems read to obtain n sets, where the value of n is a positive integer greater than 2; reads the known m pairs of interface call relationships between the n systems, where m is less than or equal to n; takes the system with the interface call relationship as a benchmark, traverses the m pairs of interface call relationships and iteratively merges the sets corresponding to the systems to obtain a union-find set; queries whether each pair of two systems whose interface call relationships are to be verified are in the same union-find set; if so, determines that the two systems have an interface call relationship; if not, determines that the two systems do not have an interface call relationship. In this solution, a union-find set mechanism is used to store the call relationships between interfaces, and the structure of the union-find set is optimized in the process of constructing the union-find set, so as to facilitate the execution of subsequent search operations, realize effective optimization of the management and control method of the interface call relationship, effectively improve the execution efficiency of the interface call relationship management and control, and improve the efficiency of subsequent queries.

[0092] Based on the above-mentioned method for controlling interface call relationships disclosed in the embodiment of the present invention, the present invention also discloses another method for controlling interface call relationships, such as Figure 2 As shown, it mainly includes the following steps:

[0093] S201: Read n systems and indicate each system with a system identifier.

[0094] S202: Using the system identifier as an element, constructing a set corresponding to each system, and indicating the set corresponding to each system with the system identifier.

[0095] S203: Read the m pairs of interface calling relationships known between the n systems, and indicate each pair of interface calling relationships with a system identifier.

[0096] S204: constructing an iteration state table by using the system identifier to indicate the set corresponding to each system and each pair of interface call relationships indicated by the system identifier as row and column items respectively.

[0097] S205: Starting from the first pair of interface call relationships, traverse m pairs of interface call relationships, merge the sets corresponding to the systems having the interface call relationships, and record the set status after each set merging in the construction iteration status table until the final union-find set is obtained.

[0098] The union-find sets are mutually disjoint sets.

[0099] In one embodiment, the set status is indicated by the system identifiers included in the merged set.

[0100] In one embodiment, each time a set is merged, a set including fewer systems is merged into a set including more systems.

[0101] S206: Using any system identifier included in the union-find set to represent the union-find set.

[0102] S207: Query whether the system identifiers corresponding to the two systems whose interface call relationship is to be verified belong to the same union-find set represented by the system identifier. If so, execute S208; if not, execute S209.

[0103] S208: Determine that the two systems belong to the same union-find set.

[0104] S209: Determine that the two systems do not belong to the same union-find set.

[0105] The specific execution principles of the above S201 to S209 are described in detail through the following examples.

[0106] Assume that the value of n is 9, that is, there are 9 systems, and each system is indicated by a system identifier: a, b, c, d, e, f, g, h, and i. The 9 systems are known to have 7 pairs of interface call relationships, such as Figure 3 shown.

[0107] Specifically, through the MAKE-SET process, all 9 systems are constructed into 9 independent sets with system identifiers as elements, and the system identifier indicates the set corresponding to each system. As shown in Table 1, Table 1 is the initial state table for the union-find set construction.

[0108] Table 1

[0109]

[0110] Depend on Figure 3 It can be seen that there are 7 pairs of interface call relationships among the 9 systems, namely (a, b), (a, d), (b, d), (c, d), (e, f), (g, i) and (g, h). The two systems whose interface call relationships need to be verified are: (a, c) and (b, g).

[0111] The set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier are used as row and column items to construct an iteration state table. The specific iteration process is shown in Table 2.

[0112] Table 2

[0113]

[0114] The seven pairs of interface call relationships are traversed, and the two sets with interface call relationships are merged through the UNION process in each iteration, and the set state after each set merging is recorded in the construction iteration state table until the final union-find set is obtained. As shown in Table 2, three mutually disjoint sets are obtained: {a, b, c, d}, {e, f}, and {g, i, h}.

[0115] Optionally, during a specific iteration, read in the call relationships of each interface in turn, and use the UNION operation to merge the sets of two system elements with a call relationship. In order to reduce the number of elements that need to be found and updated, a strategy of merging smaller sets into larger sets is adopted. For example, after reading in (a, b), first obtain the system identifiers of the sets where the two system identifiers are located, and compare whether the two are equal. If the two are not equal, merge the sets where the two system identifiers are located. After the merge is completed, the state of the union-find set changes, and {a} and {b} are merged together to form a new set {a, b}, represented by system identifier a, such as Figure 4 shown.

[0116] Similarly, after reading (a, d), according to the strategy of merging smaller sets into larger sets, the set {d} is merged into {a, b}, and the system identifier a is also used as the representative. The system identifiers of other sets remain unchanged, such as Figure 5 shown.

[0117] Continue iterating, and the final union-find results are {a, b, c, d}, {e, f}, and {g, i, h}. The union-find status represented by the system identifier is as follows Figure 6 shown.

[0118] based on Figure 6 , use the FIND-SET(x) operation to query whether the system identifiers corresponding to the two systems of the interface call relationship to be verified (a, c) and (b, g) belong to the union-find set represented by the same system identifier. If the two system identifiers are equal, they are in the same set and the two systems belong to the same call chain. Otherwise, they are not in the same set and there is no call chain between the two systems.

[0119] After comparison, we can see that for {a, b, c, d}, {e, f} and {g, i, h}, the representative of the set to which a and c belong is a, which means that the two are in the same set and there is a call chain; for b and g, since the representative of the set to which b belongs is a and the representative of the set to which g belongs is g, the two are not equal, which means that the two are not in the same set and there is no call chain.

[0120] That is to say, there is a call chain between (a, c), but there is no call chain between (b, g).

[0121] In an embodiment of the present invention, a union-find mechanism is used to store the calling relationships between interfaces, and the structure of the union-find is optimized in the process of constructing the union-find. In the search process, the representative of the current element obtained in each iteration can be recorded, and the length of the retrieval path can be compressed to facilitate the execution of subsequent search operations, thereby achieving an effective optimization of the management and control of interface calling relationships, effectively improving the execution efficiency of interface calling relationship management and control, and improving the efficiency of subsequent queries.

[0122] Based on the method for controlling interface call relationships disclosed in the above embodiment of the present invention, the embodiment of the present invention also discloses a device for controlling interface call relationships, such as Figure 7 As shown, the interface call relationship management and control device includes: a construction module 701, a reading module 702, a traversal module 703 and a query module 704.

[0123] The construction module 701 is used to construct independent sets for the n systems read respectively, to obtain n sets, where the value of n is a positive integer greater than 2.

[0124] The reading module 702 is used to read the known m pairs of interface calling relationships between the n systems, where the value of m is a positive integer greater than 2.

[0125] The traversal module 703 is used to traverse m pairs of interface calling relationships based on the systems having the interface calling relationships, iteratively merge the sets corresponding to the systems, and obtain a union-find set.

[0126] The traversal module 703 is specifically used for:

[0127] Starting from the first pair of interface call relationships, the sets corresponding to the systems having the first pair of interface call relationships are merged to obtain a first intermediate set; the first intermediate set and other sets remaining after the first merge are used as the basis for the next merge, and the sets corresponding to the systems having all the second pairs of interface call relationships are merged to obtain a second intermediate set; it is determined whether there are any unused interface call relationships, and if so, other pairs of interface call relationships are continued to be traversed to obtain a final union-find set, which is a mutually non-overlapping set.

[0128] The query module 704 is used to query whether each of the two systems whose interface call relationship is to be verified is in the same union check set; if so, it is determined that the two systems have an interface call relationship; if not, it is determined that the two systems do not have an interface call relationship.

[0129] The construction module 701 is specifically used for:

[0130] n systems are read, and each system is indicated by a system identifier; the set corresponding to each system is constructed by taking the system identifier as an element, and each set corresponding to the system is indicated by the system identifier.

[0131] Accordingly, the reading module 702 is specifically used for:

[0132] The m pairs of interface calling relationships known between the n systems are read, and each pair of interface calling relationships is indicated by a system identifier.

[0133] The traversal module 703 is specifically used for:

[0134] An iterative state table is constructed by using the set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier as row and column items respectively; starting from the first pair of interface call relationships, m pairs of interface call relationships are traversed, the sets corresponding to the systems with interface call relationships are merged, and the set status after each set merging is recorded in the constructed iterative state table until a final union-find set is obtained, and the union-find set is a mutually disjoint set.

[0135] The set state is indicated by the system identifier contained in the merged set.

[0136] The construction module 701 is further configured to represent the union-find set with any system identifier included in the union-find set;

[0137] The query module 704 is also used to query whether the system identifiers corresponding to the two systems whose interface call relationship is to be verified belong to the same union-find set represented by the system identifier; if so, determine that the two systems belong to the same union-find set; if not, determine that the two systems do not belong to the same union-find set.

[0138] The traversal module 703 is also used to merge a set containing fewer systems into a set containing more systems each time a set is merged.

[0139] In the interface call relationship management and control device disclosed in the embodiment of the present invention, the call relationship between interfaces is stored by using a union-find mechanism, and the structure of the union-find is optimized in the process of constructing the union-find. In the search process, the representative of the current element obtained in each iteration process can be recorded, and the retrieval path length can be compressed to facilitate the execution of subsequent search operations, thereby achieving an effective optimization of the interface call relationship management and control method, effectively improving the execution efficiency of the interface call relationship management and control, and improving the subsequent query efficiency.

[0140] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0141] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this disclosure.

[0142] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for managing and controlling interface call relationships, characterized in that: The method comprises: Construct independent sets for the n systems read respectively, and obtain n sets, where the value of n is a positive integer greater than 2; Read m pairs of known interface call relationships between the n systems, where m is less than or equal to n; Taking the systems with interface call relationships as the benchmark, traverse m pairs of interface call relationships and iteratively merge the sets corresponding to the systems to obtain a union-find set; Check whether the two systems whose interface call relationship is to be verified are in the same union check set; If so, determining that the two systems have an interface calling relationship; If not, it is determined that the two systems do not have an interface calling relationship; Wherein, independent sets are constructed for the n systems to be read, respectively, to obtain n sets, including: Read n systems and indicate each system with a system ID; Taking the system identifier as an element, constructing a set corresponding to each system, and indicating the set corresponding to each system with the system identifier; The reading of the m pairs of known interface call relationships between the n systems includes: Reading m pairs of known interface call relationships between the n systems, and indicating each pair of interface call relationships with a system identifier; The method of taking the system with the interface call relationship as a benchmark, traversing m pairs of interface call relationships and iteratively merging the sets corresponding to the systems to obtain a union-find set includes: The set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier are respectively used as row and column items to construct an iteration state table; Starting from the first pair of interface call relationships, traverse m pairs of interface call relationships, merge the sets corresponding to the systems with interface call relationships, and record the set state after each set merging in the construction iteration state table until a final union-find set is obtained, and the union-find set is a mutually disjoint set; The set state is indicated by the system identifier contained in the merged set.

2. The method according to claim 1, characterized in that Also includes: Using any system identifier included in the union-find set to represent the union-find set; The querying whether each system whose interface call relationship is to be verified is in the same union check set includes: Check whether the system identifiers corresponding to the two systems whose interface call relationship is to be verified belong to the union-find set represented by the same system identifier; If so, determine that the two systems belong to the same union-find set; If not, it is determined that the two systems do not belong to the same union-find set.

3. The method according to claim 1 or 2, characterized in that: Also includes: Each time a collection is merged, the collection containing fewer systems is merged into the collection containing more systems.

4. A device for controlling interface call relations, characterized in that: The device comprises: A construction module is used to construct independent sets for the n systems read, to obtain n sets, where the value of n is a positive integer greater than 2; A reading module, used for reading m pairs of known interface call relationships between the n systems, where m is less than or equal to n; A traversal module is used to traverse m pairs of interface call relationships based on the systems with interface call relationships, iteratively merge the sets corresponding to the systems, and obtain a union-find set; A query module, used for querying whether each of the two systems whose interface call relationship is to be verified is in the same check set; if so, determining that the two systems have an interface call relationship; if not, determining that the two systems do not have an interface call relationship; Wherein, the building module is specifically used for: Read n systems and indicate each system with a system identifier; construct a set corresponding to each system using the system identifier as an element, and indicate each set corresponding to the system with the system identifier; Accordingly, the reading module is specifically used for: Reading m pairs of known interface call relationships between the n systems, and indicating each pair of interface call relationships with a system identifier; The traversal module is specifically used for: The set corresponding to each system indicated by the system identifier and each pair of interface call relationships indicated by the system identifier are respectively used as row and column items to construct an iterative state table; starting from the first pair of interface call relationships, m pairs of interface call relationships are traversed, the sets corresponding to the systems with interface call relationships are merged, and the set state after each set merging is recorded in the constructed iterative state table until a final union-find set is obtained, and the union-find set is a mutually disjoint set; The set state is indicated by the system identifier contained in the merged set.

Citation Information

Patent Citations

  • Service relationship query method and device, electronic equipment and storage medium

    CN112214662A