A method and device for determining interface call relationship

Through the automated interface call relationship sorting method, the data in the production log is used to determine the interface call relationship in the banking system, which solves the problems of low efficiency and poor accuracy of manual sorting in the existing technology, and realizes more efficient interface call relationship management.

CN112433757BActive Publication Date: 2024-12-27CHINA CONSTRUCTION BANK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011357640.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-27
Publication Date
2024-12-27
Estimated Expiration
2040-11-27

AI Technical Summary

Technical Problem

In the prior art, the interface call relationship sorting of the banking system relies on manual viewing of production logs, resulting in long work cycles, low efficiency and low accuracy.

Method used

By obtaining the call data in the production log, the first calling interface that has not been called by other interfaces is automatically determined, and the call relationship between multiple interfaces is determined based on the interface and the call data, an interface call relationship tree is constructed, and an automated sorting is realized.

Benefits of technology

Improve the accuracy and work efficiency of interface call relationships, reduce manual intervention, and reduce errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112433757B_ABST
    Figure CN112433757B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for determining interface call relationships, and relates to the field of computer technology. A specific implementation of the method includes: obtaining a production log, the production log includes call data corresponding to multiple call interfaces respectively; determining a first call interface among multiple call interfaces that has not been called by other call interfaces according to the call data corresponding to the multiple call interfaces respectively; determining a call relationship among multiple call interfaces according to the first call interface and the call data. This implementation eliminates the need for manual sorting of interface call relationships, which not only improves work efficiency, but also improves the accuracy of the obtained interface call relationships.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for determining an interface calling relationship. Background Art

[0002] With the development of computer technology, the amount of data processed by computer systems is getting larger and larger, and the tasks are becoming more and more complex. Therefore, the computer system divides the tasks into multiple different subtasks, and then assigns different subtasks to the corresponding subsystems for processing. The results obtained by the subsystem processing are then passed to other subsystems through interface calls.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] For banking systems, there are a large number of complex interface call relationships within them, and architects need to sort out the interface call relationships. However, currently architects usually sort out the relationships manually by checking production logs and relying on their own experience. Not only is the work cycle long and inefficient, but the accuracy of the data obtained by manual sorting is also low. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for determining interface calling relationships. After obtaining the production log, the method and device can automatically determine the first calling interface that has not been called by other calling interfaces among multiple calling interfaces based on the calling data in the production log, and then determine the calling relationship between the multiple calling interfaces based on the first calling interface and the calling data. This eliminates the need for manual sorting of the interface calling relationships, which not only improves work efficiency, but also improves the accuracy of the obtained interface calling relationships.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for determining an interface calling relationship is provided.

[0007] A method for determining an interface calling relationship according to an embodiment of the present invention includes:

[0008] Obtain production logs, which include call data corresponding to multiple call interfaces;

[0009] Determine, according to the call data respectively corresponding to the multiple call interfaces, a first call interface among the multiple call interfaces that has not been called by other call interfaces;

[0010] According to the first calling interface and the calling data, a calling relationship among the plurality of calling interfaces is determined.

[0011] Optionally,

[0012] Determining a calling relationship among the plurality of calling interfaces according to the first calling interface and the calling data includes:

[0013] Use the first calling interface as the current calling interface;

[0014] The following steps are executed repeatedly until the current calling interface does not call other calling interfaces, and the current calling interface is regarded as the end of the calling relationship:

[0015] Determine, according to the calling data, a second calling interface among the multiple calling interfaces that is called by the current calling interface;

[0016] The calling relationship between the current calling interface and the second calling interface is recorded, and the second calling interface is used as the current calling interface.

[0017] Optionally,

[0018] The method further includes:

[0019] The first calling interface is used as the initiating end of the calling relationship.

[0020] Optionally,

[0021] The method further includes:

[0022] An interface call relationship tree is constructed, the initiator of the call relationship is used as the root node of the interface call relationship tree, and the node position of each calling interface in the interface call relationship tree is determined according to the initiator and the call relationship.

[0023] Optionally,

[0024] When the same initiator corresponds to multiple call relationships, an interface call relationship tree is constructed, including:

[0025] For the initiating end, determining a first identification code corresponding to each calling relationship;

[0026] When the first identification codes of multiple call relations are the same, the call relations corresponding to the duplicate first identification codes are deleted;

[0027] According to the deleted call relationships, an interface call relationship tree is constructed.

[0028] Optionally,

[0029] A first identification code is determined according to a hash value corresponding to the call relationship; wherein the hash value is included in the production log.

[0030] Optionally,

[0031] The production log also includes: a second identification code corresponding to the call data;

[0032] Determine and delete the call data corresponding to the repeated second identification code;

[0033] Determine the call relationship based on the deleted call data.

[0034] Optionally,

[0035] The production log also includes: the call conditions corresponding to the call data;

[0036] According to the calling conditions, determine the calling relationship of multiple calling interfaces;

[0037] According to the calling relationship, the calling conditions are recorded in the corresponding nodes in the interface calling relationship tree.

[0038] Optionally,

[0039] The calling conditions include: combined calling conditions and / or mutually exclusive calling conditions.

[0040] Optionally,

[0041] receiving an interface management request;

[0042] Respond to interface management requests based on the interface call relationship tree.

[0043] Optionally,

[0044] The interface management request is an interface call request, which indicates a request interface for initiating the interface call request and a target interface to be called by the request interface;

[0045] According to the interface call relationship tree, determine whether there is a call relationship between the request interface and the target interface;

[0046] When there is a calling relationship between the requesting interface and the target interface, it is determined whether the requesting interface has the authority to call the target interface, and if so, the interface calling request is responded to.

[0047] Optionally,

[0048] The interface management request is an interface maintenance request, which indicates the interface to be maintained and maintenance information;

[0049] Find the node corresponding to the interface to be maintained from the interface call relationship tree;

[0050] According to the maintenance information, the found node is maintained to respond to the interface maintenance request.

[0051] Optionally,

[0052] When there are multiple different first calling interfaces, the calling relationship corresponding to each first calling interface is determined in parallel or serially.

[0053] Optionally,

[0054] The method further includes:

[0055] The determined calling relationship is recorded in the interface calling relationship file.

[0056] Optionally,

[0057] The method further includes:

[0058] The service code description, subsystem information, and gateway information are recorded in the interface call relationship file.

[0059] To achieve the above objective, according to another aspect of an embodiment of the present invention, a device for determining an interface calling relationship is provided.

[0060] An apparatus for determining an interface call relationship according to an embodiment of the present invention includes a log acquisition module, an interface determination module, and a call relationship determination module; wherein:

[0061] The log acquisition module is used to obtain the production log, which includes the call data corresponding to multiple call interfaces respectively;

[0062] An interface determination module, used to determine a first calling interface among the multiple calling interfaces that has not been called by other calling interfaces according to the calling data respectively corresponding to the multiple calling interfaces;

[0063] The calling relationship determining module is used to determine the calling relationship of multiple calling interfaces according to the first calling interface and the calling data.

[0064] To achieve the above objective, according to another aspect of an embodiment of the present invention, an electronic device for determining an interface calling relationship is provided.

[0065] An electronic device for determining an interface calling relationship according to an embodiment of the present invention comprises: one or more processors; a storage device for storing one or more programs, and when the one or more programs are executed by one or more processors, the one or more processors implement a method for determining an interface calling relationship according to an embodiment of the present invention.

[0066] To achieve the above objective, according to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided.

[0067] A computer-readable storage medium according to an embodiment of the present invention stores a computer program, and when the program is executed by a processor, a method for determining an interface calling relationship according to an embodiment of the present invention is implemented.

[0068] One embodiment of the above invention has the following advantages or beneficial effects: after obtaining the production log, it can automatically determine the first calling interface that has not been called by other calling interfaces among multiple calling interfaces based on the calling data in the production log, and then determine the calling relationship between the multiple calling interfaces based on the first calling interface and the calling data, thereby eliminating the need for manual sorting of the interface calling relationships, which not only improves work efficiency, but also improves the accuracy of the obtained interface calling relationships.

[0069] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0071] Figure 1 is a schematic diagram of main steps of a method for determining an interface calling relationship according to an embodiment of the present invention;

[0072] Figure 2 is a schematic diagram of main steps of another method for determining interface call relationship according to an embodiment of the present invention;

[0073] Figure 3 is a structural schematic diagram of an interface call relationship tree according to an embodiment of the present invention;

[0074] Figure 4 is a schematic diagram of main steps of another method for determining an interface calling relationship according to an embodiment of the present invention;

[0075] Figure 5 and Figure 6 It is a screenshot of the implementation code of a method for preprocessing a production log according to an embodiment of the present invention;

[0076] Figure 7 is a screenshot of the implementation code of a sorting method according to an embodiment of the present invention;

[0077] Figure 8 is a screenshot of implementation code of a method for calculating conditional bits according to an embodiment of the present invention;

[0078] Fig. 9 is a schematic diagram of main modules of a device for determining an interface calling relationship according to an embodiment of the present invention;

[0079] Fig.10 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0080] Fig.11It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0081] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0082] It should be pointed out that the embodiments of the present invention and the technical features therein may be combined with each other without conflict.

[0083] Figure 1 It is a schematic diagram of main steps of a method for determining interface calling relationship according to an embodiment of the present invention.

[0084] like Figure 1 As shown, a method for determining an interface call relationship according to an embodiment of the present invention mainly includes the following steps:

[0085] Step S101: Obtain a production log, where the production log includes call data corresponding to a plurality of call interfaces.

[0086] In an embodiment of the present invention, the production log may include any one or more of the following call data: statistical time timestamp, hash value hashcode, transaction path hash code routeHashCode, subsystem identifier app (physical subsystem number), subsystem Chinese name appname (deployment platform + physical subsystem Chinese full name), service code tc, logical subsystem LOGICCODE, transaction path position code nodeNum, transaction node number nodeAmount, whether it is a leaf node leaf, leaf type leafType, average processing time aproc, total processing time tproc, transaction volume amt, parent node papp, parent node position parentNodeNum, deployment unit apgrpMap, transaction line identifier tradeLineId, initiator security node number sndnd, own security node number nd and last update time LASTUPDATE, etc.

[0087] In a preferred embodiment of the present invention, the call data and format included in the production log are shown in the following table, wherein the data in the transaction line id and the last update time LAST UPDATE columns may be automatically generated during the production process.

[0088]

[0089] Step S102: determining a first calling interface among the multiple calling interfaces that has not been called by other calling interfaces according to the calling data corresponding to the multiple calling interfaces respectively.

[0090] In the embodiment of the present invention, since the first calling interface has not been called by other calling interfaces, it means that the first calling interface is the starting point of a calling relationship, so the first calling interface can be used as the initiating end of the calling relationship. For example, as shown in the above table, the parent node position of interface A is 0, which means that interface A has no parent node, that is, interface A has not been called by other calling interfaces, so interface A is the first calling interface and can be used as an initiating end. Interfaces B, C, D, E and F all have parent nodes, so these nodes are not the first calling interface and cannot be used as the initiating end of the calling relationship.

[0091] In the embodiment of the present invention, due to the characteristics of the production log, each time an interface call occurs in the system, the production log will record an information, so the production log may include a large amount of duplicate data, which in turn causes duplication of the determined call relationship and excessive memory occupation. Therefore, after determining the first calling interface, i.e., the initiator, when the same initiator corresponds to multiple call relationships, it is necessary to filter the call relationships corresponding to the initiator to delete the duplicate call relationships corresponding to the initiator. Specifically, the first identification code corresponding to each call relationship of the initiator can be determined to determine whether there are identical call relationships; when the first identification codes of multiple call relationships are the same, it means that there are identical call relationships, and the call relationships corresponding to the duplicate first identification codes are deleted to reduce memory usage.

[0092] In the embodiment of the present invention, since there is a corresponding hash value hashcode for each call relationship in the production log, the first identification code can be determined according to the hash value hashcode corresponding to the call relationship. In a preferred embodiment of the present invention, the first identification code of each call relationship can be the same as its hash value hashcode.

[0093] For example, the method for deduplicating the initiator and its corresponding call relationship may be: traverse the production log and parse the json format file; put all hash values ​​hashcode with the same initiator (parentNodeNum is 0) together to form a map (initationMap), where the key is the service code tc of the initiator and the subsystem identifier app (physical subsystem number), and the value is a string composed of all tradeLineIds under the current initiator and their corresponding routeHashcode; then deduplicate the initiator and its corresponding call relationship based on the hash value hashcode.

[0094] Step S103: Determine the calling relationship among the multiple calling interfaces according to the first calling interface and the calling data.

[0095] In the embodiment of the present invention, after determining the first calling interface, i.e., the starting point of the calling relationship, the calling relationship of multiple calling interfaces can be determined based on the first calling interface and the calling data. Figure 2 As shown, Figure 2 1 is a schematic diagram of the main steps of another method for determining an interface call relationship according to an embodiment of the present invention. The method mainly includes the following steps:

[0096] Step S201: using the first calling interface as the current calling interface;

[0097] Step S202: Determine whether the currently called interface calls other interfaces, if yes, execute step S203, if no, execute step S205;

[0098] Step S203: determining a second calling interface called by the current calling interface among the multiple calling interfaces according to the calling data;

[0099] Step S204: record the calling relationship between the current calling interface and the second calling interface, and use the second calling interface as the current calling interface, and return to execute step S202;

[0100] Step S205: taking the current calling interface as the end of the calling relationship.

[0101] Still taking the table in the above embodiment as an example, after determining that interface A is the initiator, it is used as the current calling interface, and then it is determined whether there is interface A in the parent node position column. If yes, it means that the current calling interface A has called other interfaces. It is determined from the table that the parent node position of interface B is interface A, which means that the current calling interface A has called the second calling interface B. Then the calling relationship is recorded, and the second calling interface B is used as the current calling interface. Then it is determined whether there is interface B in the parent node position column, and so on, and then it is determined that interface B has called interfaces C and E, interface C has called interface D, and interface E has called interface F.

[0102] In an embodiment of the present invention, the currently called interface that has not called other interfaces can be used as the end of the calling relationship. For example, in the table of the above embodiment, when interface D or interface F is used as the currently called interface, there is no interface D or interface F in the parent node position column, which means that the currently called interface D or the currently called interface F has not called other interfaces. Therefore, the currently called interface D or the currently called interface F can be used as the end of their respective calling relationships.

[0103] In an embodiment of the present invention, it is also possible to determine whether the corresponding interface is the end of the call relationship based on the call data of "Is it a leaf node" in the production log. For example, in the table of the above embodiment, if the data in the "Is it a leaf node" column is 1, the corresponding interface is a leaf node, and the interface is the end of the call relationship; if the data in the "Is it a leaf node" column is 0, the corresponding interface is not a leaf node, and the interface is not the end of the call relationship. Therefore, it can be determined from the table that the data in the "Is it a leaf node" column for interface D and interface F are both 1, indicating that interface D and interface F are the ends of their respective call relationships, that is, interface D and interface F no longer call other interfaces.

[0104] In the embodiment of the present invention, due to the characteristics of the production log, each time an interface call occurs in the system, the production log will record a piece of information, so the production log may include a large amount of repeated data, which in turn causes duplication of the determined call relationship and excessive memory usage. Therefore, after each determination of the current call interface, when the same current call interface corresponds to multiple call relationships, the call relationships corresponding to the current call interface can be filtered to delete the repeated call relationships corresponding to the current call interface.

[0105] Specifically, the production log may also include: a second identification code corresponding to the call data. Among them, if the current calling interface is the initiator, the second identification code may be a hash value hashcode; if the current calling interface is not the initiator, the second identification code may be a service code tc, or a combination of the service code tc and the Chinese name appname of the subsystem to which it belongs, or other call data, and this scheme does not impose specific restrictions on this. After determining the second identification code and its corresponding call data, the call data corresponding to the duplicate second identification code may be deleted, and then the call relationship may be determined based on the deleted call data to reduce memory usage.

[0106] For example, the method for deduplicating the current call interface may be: traversing the production log and parsing the json format file; using the deep traversal algorithm to put the current call interfaces with the same hash value hashcode and the same initiator together to form a map (nodeMap), where the key is a string consisting of tradeLineId and its corresponding routeHashcode, and the value is a row of data corresponding to it; then deduplicating the current call interface based on the tradeLineId and its corresponding routeHashcode.

[0107] In an embodiment of the present invention, after deduplication of the current call interface, the second call interface can be arranged to facilitate the subsequent construction of the interface call relationship tree. Specifically, the production log can be traversed and the json format file can be parsed; all receivers with the same hashcode, initiator and sender are put together using the breadth traversal algorithm to form a map (endMap), where the key is a string composed of tradeLineId and its corresponding routeHashcode and parentNodeNum, and the value is a row of data corresponding to it.

[0108] In an embodiment of the present invention, after determining the calling relationships of multiple calling interfaces, an interface calling relationship tree can also be constructed to further clearly display the determined calling relationships. Specifically, the initiating end of the calling relationship can be used as the root node of the interface calling relationship tree, and then the node position of each calling interface in the interface calling relationship tree can be determined based on the initiating end and the calling relationship. Still taking the table in the above embodiment as an example, the constructed interface calling relationship tree can be in the form of the following:

[0109]

[0110] In the embodiment of the present invention, when the same initiator corresponds to multiple call relationships, the call relationships corresponding to the repeated first identification codes may be deleted, and then an interface call relationship tree may be constructed based on the deleted call relationships.

[0111] In an embodiment of the present invention, the production log may also include call conditions corresponding to the call data. In a preferred embodiment of the present invention, the call conditions include: combined call conditions and / or mutually exclusive call conditions. Among them, the combined call conditions refer to the conditions that require calling multiple interfaces at the same time. These interfaces that are called simultaneously are reflected in the interface call relationship tree as combined nodes. By numbering the combined nodes, the combined bits can be obtained; the mutually exclusive call conditions refer to the conditions that only one interface will be called at the same time. These interfaces that are mutually exclusive when called are reflected in the interface call relationship tree as conditional nodes. By numbering the conditional nodes, the conditional bits can be obtained.

[0112] In an embodiment of the present invention, when the production log includes calling conditions corresponding to the calling data, the calling relationship of multiple calling interfaces can be determined according to the calling conditions; and according to the calling relationship, the calling conditions are recorded at the corresponding nodes in the interface calling relationship tree. For example, according to a certain production log, it is determined that: the initiator A of the calling relationship calls interface B; interface B calls interface C, interface D and interface E at the same time under the combined calling condition; interface C and interface D no longer call other interfaces, and are respectively one end of the calling relationship; interface E calls interface F and interface G respectively under two mutually exclusive calling conditions; interface F no longer calls other interfaces, and is one end of the calling relationship; interface G calls interface H; interface H no longer calls other interfaces, and is one end of the calling relationship. At this time, the calling data in the production log has been traversed, and the constructed interface calling relationship tree is as follows: Figure 3 As shown. Among them, "combination 1", "combination 2" and "combination 3" are combination bits, that is, the numbers of combination nodes under the same combination call condition; "condition 1" and "condition 2" are condition bits, that is, the numbers of condition nodes corresponding to different mutually exclusive call conditions.

[0113] In the embodiment of the present invention, after the interface call relationship tree is constructed, an interface management request may be received; and the interface management request may be responded to according to the interface call relationship tree, so as to improve the response speed to the interface management request.

[0114] Specifically, when the interface management request is an interface call request, and the interface call request indicates the request interface that initiates the interface call request, and the target interface to be called by the request interface, it can be determined whether there is a call relationship between the request interface and the target interface based on the interface call relationship tree. When it is determined that there is a call relationship between the request interface and the target interface, it is determined whether the request interface has the authority to call the target interface. If so, the interface call request is responded to. If it is determined that there is no call relationship between the request interface and the target interface, an error can be directly prompted to increase the speed of response. Figure 3 Take the interface call relationship tree as an example: a certain interface management request is an interface call request, and the interface call request indicates that the request interface is interface A and the target interface to be called is interface H. Then, according to the interface call relationship tree, it can be determined first that there is a call relationship A→B→E→G→H, and then according to the configuration file, whether interface A has the authority to call interface H. If so, respond to the interface call request. Determining whether there is calling permission between interfaces according to the configuration file belongs to the prior art, and this solution will not go into details. If the interface call request indicates that the request interface is interface D and the target interface to be called is interface H, then according to the interface call relationship tree, it can be quickly determined that there is no calling relationship between interface D and interface H, and an error is directly prompted without performing other operations.

[0115] Specifically, when the interface management request is an interface maintenance request, and the interface maintenance request indicates the interface to be maintained and the maintenance information, the node corresponding to the interface to be maintained can be found from the interface call relationship tree according to the interface call relationship tree; then, the found node is maintained according to the maintenance information to respond to the interface maintenance request, thereby improving the response speed. Figure 3 Take the interface call relationship tree as an example: an interface management request is an interface maintenance request, which indicates that the interface to be maintained is interface E, and the maintenance information is that interface E is unresponsive. Then, according to the interface call relationship tree, the node corresponding to interface E and its upstream node (that is, the node corresponding to interface B) can be found from the interface call relationship tree, and the found nodes (that is, the nodes corresponding to interface E and interface B respectively) can be quickly checked and maintained to respond to the interface maintenance request.

[0116] In an embodiment of the present invention, when multiple different first calling interfaces are determined, the calling relationship corresponding to each first calling interface can be determined in parallel or serially, and then the interface calling relationship tree can be constructed in parallel or serially according to the calling relationship.

[0117] In an embodiment of the present invention, the determined call relationship can be recorded in an interface call relationship file, so as to construct an interface call relationship tree according to the interface call relationship file. The interface call relationship file can be in a table format, a json text format, or other formats, which is not specifically limited in this solution.

[0118] In a preferred embodiment of the present invention, the gateway information can also be recorded in the interface call relationship file. Specifically, all call relationships corresponding to the second call interface of all physical subsystems NCIMGW or NKBAGW can be obtained, and then the following steps are executed in a loop until the call relationship is traversed: obtain the service code tc of the current call relationship, and obtain the data corresponding to the service code in p6; take the called party of the current call relationship as the caller, and store the corresponding information in p6 as the called party under the current path, so that the relevant information in the interface call relationship file is more complete.

[0119] In another preferred embodiment of the present invention, the service code description and subsystem information can also be recorded in the interface call relationship file. Specifically, the service code description and subsystem information of other systems can be updated and written into the database in real time through a scheduled task, and then the updated service code description and subsystem information in the database can be queried based on the call data in the production log, and the service code description and subsystem information can be written into the interface call relationship file to make the relevant information in the interface call relationship file more complete.

[0120] In the embodiment of the present invention, configurable data can also be supported, with the minimum granularity being the initiator. If it does not need to be supplemented by production data, it can be configured through the interface. No data backfilling or extraction is performed, and the existing data will not be affected.

[0121] In the embodiment of the present invention, according to the interface call relationship file, data comparison between the design state and the production state can also be performed. The design state is the service call relationship designed in the process of architecture design, and the production state is the service call relationship in the actual execution process after code development is completed. Specifically, according to the interface call relationship file, the production state in the interface call relationship file can be compared with the preset design state to find out the difference, so as to adjust and improve the data on both sides to be the same during the subsequent operation and maintenance process.

[0122] The following is a relatively complete example to illustrate a method for determining an interface call relationship proposed in this solution. Figure 4 It is a schematic diagram of main steps of another method for determining interface calling relationship according to an embodiment of the present invention.

[0123] like Figure 4 As shown, another method for determining an interface call relationship according to an embodiment of the present invention mainly includes the following steps:

[0124] Step S401: Obtain a production log, wherein the production log includes call data corresponding to a plurality of call interfaces.

[0125] Step S402: determining a first calling interface among the multiple calling interfaces that has not been called by other calling interfaces according to the calling data corresponding to the multiple calling interfaces respectively, and taking the first calling interface as the initiating end of the calling relationship.

[0126] In the embodiment of the present invention, the corresponding initiator can also be determined from the database visual_jyx_line_version according to whether to pass the status filter_status of the production log hanging number, wherein the value of filter_status is 0 indicating that hanging number is required, and the value of filter_status is 1 indicating that hanging number is not required.

[0127] Step S403: Filter the initiator according to the production log.

[0128] In the embodiment of the present invention, when the same initiator corresponds to multiple call relations, the repeated call relations are deleted. Specifically, the call relations corresponding to the repeated hash values ​​hashcode can be deleted according to the hash values ​​hashcode of each call relation of the initiator to complete the filtering of the initiator.

[0129] Step S404: remove other duplicate call data according to the production log.

[0130] In the embodiment of the present invention, the repeated call relationships corresponding to other interfaces except the initiator can be removed according to the service code tc and the Chinese name appname of the corresponding subsystem (deployment platform + full Chinese name of the physical subsystem). Steps S403 and S404 are methods for preprocessing production logs, and their implementation code is as follows: Figure 5 and Figure 6 shown.

[0131] Step S405: determining a calling relationship according to the first calling interface and the calling data, and writing the determined calling relationship into an interface calling relationship file.

[0132] In an embodiment of the present invention, the process of writing the determined calling relationship into the interface calling relationship file is as follows: find all hash values ​​hashcode under the current initiator from the first map (initationMap); determine whether the current initiator and hash value hashcode have been operated (whether the transaction path under the initiator and hash value hashcode has been stored), if it has been operated, proceed to the next initiator, otherwise write the data into the interface calling relationship file; find all corresponding senders according to the currently obtained hash value hashcode and sort them, wherein the sorting uses the sorting method in the set; find all receivers belonging to this sender according to the current sender and sort them, wherein the sorting uses the sorting method in the set. The implementation code of the above sorting method is as follows: Figure 7 shown.

[0133] In an embodiment of the present invention, after sorting the sender and the receiver respectively, the conditional bits and the combination bits can be calculated again, and the obtained conditional bits and the combination bits can be written into the interface call relationship file. Specifically, the process of calculating the conditional bits is as follows: first determine whether the current sender has been calculated. If not, store the current sender, set the maximum value of its conditional bits to 1, and put the current sender as the key and the value composed of the current maximum conditional bits of the sender as a map under the current sender, and increment the conditional bits of the current sender by 1; if calculated, determine whether the current receiver has been calculated. If calculated, use its corresponding conditional bits. If not calculated, put the current sender as the key and the value composed of the current maximum conditional bits of the sender as a map under the current sender, and increment the conditional bits of the current sender by 1. The implementation code of the above method for calculating conditional bits is as follows. Figure 8 shown.

[0134] Specifically, the process of calculating the combination bit is as follows: set the initial value of the combination bit to 1, and then start increasing by 1 according to different receivers. The maximum value is the sum of all receivers under the current sender, and if the nodeNum of the current receiver is greater than 10000 and the parentNodeNum is less than 10000, then the combination bit of the current path is 9999.

[0135] Step S406: Fill in the service code description in the interface call relationship file.

[0136] Step S407: Fill in the subsystem information in the interface call relationship file.

[0137] Step S408: Supplement the P4-P6 gateway information in the interface call relationship file.

[0138] It can be seen from a method for determining interface calling relationships according to an embodiment of the present invention that after obtaining the production log, it is able to automatically determine the first calling interface that has not been called by other calling interfaces among multiple calling interfaces based on the calling data in the production log, and then determine the calling relationship between the multiple calling interfaces based on the first calling interface and the calling data, thereby eliminating the need for manual sorting of the interface calling relationships, which not only improves work efficiency but also improves the accuracy of the obtained interface calling relationships.

[0139] Fig. 9 It is a schematic diagram of main modules of a device for determining interface calling relationship according to an embodiment of the present invention.

[0140] like Fig. 9 As shown, an apparatus 900 for determining an interface call relationship according to an embodiment of the present invention includes a log acquisition module 901, an interface determination module 902, and a call relationship determination module 903; wherein:

[0141] The log acquisition module 901 is used to acquire the production log, which includes the call data corresponding to the multiple call interfaces respectively;

[0142] The interface determination module 902 is used to determine a first calling interface among the multiple calling interfaces that has not been called by other calling interfaces according to the calling data respectively corresponding to the multiple calling interfaces;

[0143] The calling relationship determining module 903 is used to determine the calling relationship of multiple calling interfaces according to the first calling interface and the calling data.

[0144] In an embodiment of the present invention, the calling relationship determination module 903 is further used to: use the first calling interface as the current calling interface; loop the following steps until the current calling interface does not call other calling interfaces, and use the current calling interface as the end of the calling relationship: determine the second calling interface called by the current calling interface among multiple calling interfaces based on the calling data; record the calling relationship between the current calling interface and the second calling interface, and use the second calling interface as the current calling interface.

[0145] In the embodiment of the present invention, the interface determination module 902 is further configured to: use the first calling interface as the initiating end of the calling relationship.

[0146] In an embodiment of the present invention, the call relationship determination module 903 is further used to: construct an interface call relationship tree, take the initiating end of the call relationship as the root node of the interface call relationship tree, and determine the node position of each calling interface in the interface call relationship tree based on the initiating end and the call relationship.

[0147] In an embodiment of the present invention, when the same initiator corresponds to multiple call relationships, the call relationship determination module 903 is further used to: determine the first identification code corresponding to each call relationship for the initiator; when the first identification codes of multiple call relationships are the same, delete the call relationship corresponding to the duplicate first identification code; and construct an interface call relationship tree based on the deleted call relationships.

[0148] In the embodiment of the present invention, the calling relationship determination module 903 is further used to: determine the first identification code according to the hash value corresponding to the calling relationship; wherein the hash value is included in the production log.

[0149] In an embodiment of the present invention, the production log also includes: a second identification code corresponding to the call data; the call relationship determination module 903 is further used to: determine and delete the call data corresponding to the repeated second identification code; and determine the call relationship based on the deleted call data.

[0150] In an embodiment of the present invention, the production log also includes: calling conditions corresponding to the calling data; the calling relationship determination module 903 is further used to: determine the calling relationship of multiple calling interfaces according to the calling conditions; and record the calling conditions in the corresponding nodes in the interface calling relationship tree according to the calling relationship.

[0151] In the embodiment of the present invention, the calling condition includes: a combined calling condition and / or a mutually exclusive calling condition.

[0152] In the embodiment of the present invention, the calling relationship determining module 903 is further used to: receive an interface management request; and respond to the interface management request according to the interface calling relationship tree.

[0153] In an embodiment of the present invention, the interface management request is an interface call request, which indicates the request interface that initiates the interface call request and the target interface to be called by the request interface; the call relationship determination module 903 is further used to: determine whether there is a call relationship between the request interface and the target interface according to the interface call relationship tree; when there is a call relationship between the request interface and the target interface, determine whether the request interface has the authority to call the target interface, and if so, respond to the interface call request.

[0154] In an embodiment of the present invention, the interface management request is an interface maintenance request, which indicates the interface to be maintained and the maintenance information; the call relationship determination module 903 is further used to: search for the node corresponding to the interface to be maintained from the interface call relationship tree; and maintain the found node according to the maintenance information to respond to the interface maintenance request.

[0155] In the embodiment of the present invention, the calling relationship determining module 903 is further used to: when there are multiple different first calling interfaces, determine the calling relationship corresponding to each first calling interface in parallel or in series.

[0156] In the embodiment of the present invention, the calling relationship determining module 903 is further used to: record the determined calling relationship into an interface calling relationship file.

[0157] In the embodiment of the present invention, the calling relationship determining module 903 is further used to: record the service code description, subsystem information and gateway information in the interface calling relationship file.

[0158] It can be seen from a device for determining interface call relationships according to an embodiment of the present invention that, after obtaining the production log, it can automatically determine, from multiple call interfaces, a first call interface that has not been called by other call interfaces based on the call data in the production log, and then determine the call relationship between the multiple call interfaces based on the first call interface and the call data, thereby eliminating the need for manual sorting of the interface call relationships, which not only improves work efficiency, but also improves the accuracy of the obtained interface call relationships.

[0159] Fig.10 An exemplary system architecture 1000 is shown to which a method for determining an interface calling relationship or an apparatus for determining an interface calling relationship according to an embodiment of the present invention may be applied.

[0160] like Fig.10 As shown, the system architecture 1000 may include terminal devices 1001, 1002, 1003, a network 1004, and an electronic device 1005. The network 1004 is used to provide a medium for a communication link between the terminal devices 1001, 1002, 1003 and the electronic device 1005. The network 1004 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0161] The user can use the terminal devices 1001, 1002, 1003 to interact with the electronic device 1005 through the network 1004 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 1001, 1002, 1003, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0162] The terminal devices 1001 , 1002 , and 1003 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers, etc.

[0163] The electronic device 1005 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 1001, 1002, and 1003. The background management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information and product information) to the terminal device.

[0164] It should be noted that the method for determining an interface calling relationship provided in the embodiment of the present invention is generally executed by the electronic device 1005 , and accordingly, a device for determining an interface calling relationship is generally disposed in the electronic device 1005 .

[0165] It should be understood that Fig.10 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and electronic devices may be provided according to implementation requirements.

[0166] Reference below Fig.11 , which shows a schematic diagram of the structure of a computer system 1100 of a terminal device suitable for implementing an embodiment of the present invention. Fig.11 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0167] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 into a random access memory (RAM) 1103. In the RAM 1103, various programs and data required for the operation of the system 1100 are also stored. The CPU 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.

[0168] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0169] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the central processing unit (CPU) 1101, the above-mentioned functions defined in the system of the present invention are executed.

[0170] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0171] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0172] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be set in a processor. For example, they may be described as follows: a processor includes a log acquisition module, an interface determination module, and a call relationship determination module. The names of these modules do not, in some cases, constitute a limitation on the modules themselves. For example, the log acquisition module may also be described as a "module for obtaining production logs."

[0173] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: obtaining a production log, the production log includes call data corresponding to multiple call interfaces respectively; according to the call data corresponding to the multiple call interfaces respectively, determining the first call interface among the multiple call interfaces that has not been called by other call interfaces; according to the first call interface and the call data, determining the call relationship among the multiple call interfaces.

[0174] According to the technical solution of the embodiment of the present invention, after obtaining the production log, it is possible to automatically determine the first calling interface that has not been called by other calling interfaces among multiple calling interfaces based on the calling data in the production log, and then determine the calling relationship between the multiple calling interfaces based on the first calling interface and the calling data, thereby eliminating the need for manual sorting of the interface calling relationships, which not only improves work efficiency, but also improves the accuracy of the obtained interface calling relationships.

[0175] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for determining an interface call relationship, characterized in that: include: Acquire a production log, wherein the production log includes call data corresponding to a plurality of call interfaces and call conditions corresponding to the call data; The calling conditions include: combined calling conditions and / or mutually exclusive calling conditions; Determine, according to the call data respectively corresponding to the multiple call interfaces, a first call interface among the multiple call interfaces that has not been called by other call interfaces; Determining a calling relationship among the plurality of calling interfaces according to the first calling interface, the calling data and the calling condition; The determined calling relationship, combination bit and condition bit are recorded in the interface calling relationship file; wherein the interfaces called at the same time are combination nodes, and the combination nodes are numbered to obtain the combination bit; the mutually exclusive interfaces when called at the same time are condition nodes, and the condition nodes are numbered to obtain the condition bit; Constructing an interface call relationship tree based on the interface call relationship file; Compare the design state data and the production state data according to the interface calling relationship file; The determined call relationship is recorded in the interface call relationship file, including: obtaining all hash values ​​of the call relationship under the current initiator, judging whether the transaction path under the current initiator and the hash value has been stored in the warehouse, if it has been stored in the warehouse, obtaining all hash values ​​of the call relationship under the next initiator and making a judgment; if it has not been stored in the warehouse, writing all hash values ​​of the call relationship under the current initiator into the interface call relationship file, obtaining the sender based on the hash value and sorting the sender, obtaining the receiver corresponding to the sender based on the sender, and sorting the receiver.

2. The method according to claim 1, characterized in that The determining the calling relationship of the plurality of calling interfaces according to the first calling interface and the calling data comprises: Using the first calling interface as the current calling interface; The following steps are executed in a loop until the current calling interface does not call other calling interfaces, and the current calling interface is used as the end of the calling relationship: Determine, according to the calling data, a second calling interface among the multiple calling interfaces that is called by the current calling interface; The calling relationship between the current calling interface and the second calling interface is recorded, and the second calling interface is used as the current calling interface.

3. The method according to claim 2, characterized in that The method further includes: The first calling interface is used as the initiating end of the calling relationship.

4. The method according to any one of claims 1 to 3, characterized in that: The method further includes: The initiating end of the calling relationship is used as the root node of the interface calling relationship tree, and the node position of each calling interface in the interface calling relationship tree is determined according to the initiating end and the calling relationship.

5. The method according to claim 4, characterized in that When the same initiator corresponds to multiple call relationships, the construction of the interface call relationship tree includes: For the initiating end, determining a first identification code corresponding to each of the calling relationships; When the first identification codes of the multiple call relationships are the same, deleting the call relationships corresponding to the duplicate first identification codes; The interface call relationship tree is constructed according to the deleted call relationship.

6. The method according to claim 5, characterized in that The first identification code is determined according to the hash value corresponding to the calling relationship; wherein the hash value is included in the production log.

7. The method according to claim 1, characterized in that The production log also includes: a second identification code corresponding to the call data; Determine and delete the call data corresponding to the repeated second identification code; The calling relationship is determined according to the deleted calling data.

8. The method according to claim 4, characterized in that According to the calling relationship, the calling condition is recorded in a corresponding node in the interface calling relationship tree.

9. The method according to claim 8, characterized in that receiving an interface management request; The interface management request is responded to according to the interface call relationship tree.

10. The method according to claim 9, characterized in that The interface management request is an interface call request, and the interface call request indicates a request interface for initiating the interface call request and a target interface to be called by the request interface; Determining whether there is a calling relationship between the request interface and the target interface according to the interface calling relationship tree; When there is a calling relationship between the request interface and the target interface, it is determined whether the request interface has the authority to call the target interface, and if so, the interface calling request is responded to.

11. The method according to claim 9, characterized in that The interface management request is an interface maintenance request, and the interface maintenance request indicates the interface to be maintained and maintenance information; Searching for a node corresponding to the interface to be maintained from the interface call relationship tree; The found node is maintained according to the maintenance information to respond to the interface maintenance request.

12. The method according to claim 1, characterized in that When there are multiple different first calling interfaces, the calling relationship corresponding to each first calling interface is determined in parallel or serially.

13. The method according to claim 1, characterized in that The method further includes: The service code description, subsystem information and gateway information are recorded in the interface call relationship file.

14. A device for determining an interface call relationship, characterized in that: It includes a log acquisition module, an interface determination module and a call relationship determination module; wherein: The log acquisition module is used to acquire production logs, wherein the production logs include call data corresponding to a plurality of call interfaces and call conditions corresponding to the call data; the call conditions include: combined call conditions and / or mutually exclusive call conditions; The interface determination module is used to determine a first calling interface among the multiple calling interfaces that has not been called by other calling interfaces according to the calling data respectively corresponding to the multiple calling interfaces; The calling relationship determining module is used to determine the calling relationship of the multiple calling interfaces according to the first calling interface, the calling data and the calling condition; The calling relationship determination module is further used to record the determined calling relationship, combination bit and condition bit into an interface calling relationship file; construct an interface calling relationship tree based on the interface calling relationship file; wherein interfaces called at the same time are combination nodes, and the combination nodes are numbered to obtain combination bits; interfaces that are mutually exclusive when called at the same time are condition nodes, and the condition nodes are numbered to obtain condition bits; and data comparison between design state and production state is performed according to the interface calling relationship file; The call relationship determination module is also used to obtain all hash values ​​of the call relationship under the current initiator, determine whether the current initiator and the transaction path under the hash value have been stored in the warehouse, if it has been stored in the warehouse, obtain all hash values ​​of the call relationship under the next initiator and make a judgment; if it has not been stored in the warehouse, write all hash values ​​of the call relationship under the current initiator into the interface call relationship file, obtain the sender based on the hash value and sort the sender, obtain the receiver corresponding to the sender based on the sender, and sort the receiver.

15. An electronic device for determining an interface calling relationship, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 13.

16. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.