CN117240905A - Service link determining method and device, electronic equipment and storage medium - Google Patents
Service link determining method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117240905A CN117240905A CN202311093567.3A CN202311093567A CN117240905A CN 117240905 A CN117240905 A CN 117240905A CN 202311093567 A CN202311093567 A CN 202311093567A CN 117240905 A CN117240905 A CN 117240905A
- Authority
- CN
- China
- Prior art keywords
- target
- api
- service
- equipment
- service component
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 71
- 238000013507 mapping Methods 0.000 claims abstract description 103
- 238000012216 screening Methods 0.000 claims abstract description 27
- 238000004891 communication Methods 0.000 claims description 122
- 238000010586 diagram Methods 0.000 claims description 20
- 238000004458 analytical method Methods 0.000 claims description 19
- 238000004590 computer program Methods 0.000 claims description 11
- 238000010276 construction Methods 0.000 claims description 3
- 239000010410 layer Substances 0.000 description 61
- 230000006870 function Effects 0.000 description 17
- 230000008569 process Effects 0.000 description 14
- 238000011144 upstream manufacturing Methods 0.000 description 13
- 102100021662 Baculoviral IAP repeat-containing protein 3 Human genes 0.000 description 4
- 101000896224 Homo sapiens Baculoviral IAP repeat-containing protein 3 Proteins 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 4
- SPBWHPXCWJLQRU-FITJORAGSA-N 4-amino-8-[(2r,3r,4s,5r)-3,4-dihydroxy-5-(hydroxymethyl)oxolan-2-yl]-5-oxopyrido[2,3-d]pyrimidine-6-carboxamide Chemical compound C12=NC=NC(N)=C2C(=O)C(C(=O)N)=CN1[C@@H]1O[C@H](CO)[C@@H](O)[C@H]1O SPBWHPXCWJLQRU-FITJORAGSA-N 0.000 description 3
- 102100021677 Baculoviral IAP repeat-containing protein 2 Human genes 0.000 description 3
- 102100021663 Baculoviral IAP repeat-containing protein 5 Human genes 0.000 description 3
- 102100037024 E3 ubiquitin-protein ligase XIAP Human genes 0.000 description 3
- 101000896157 Homo sapiens Baculoviral IAP repeat-containing protein 2 Proteins 0.000 description 3
- 101000896234 Homo sapiens Baculoviral IAP repeat-containing protein 5 Proteins 0.000 description 3
- 101000804865 Homo sapiens E3 ubiquitin-protein ligase XIAP Proteins 0.000 description 3
- 230000009471 action Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012905 input function Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 239000002346 layers by function Substances 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The embodiment of the application provides a service link determining method, a device, electronic equipment and a storage medium. The service link determining method comprises the steps of determining a target API corresponding to a target service to be analyzed; determining source equipment corresponding to the target API and target equipment corresponding to the target API based on association relation data between preset equipment; taking the target API as an API to be utilized; screening equipment meeting preset conditions from downstream equipment of target equipment based on a preset target mapping relation corresponding to the API to be utilized; and constructing a service link corresponding to the target service according to the service components deployed by the source equipment, the service components deployed by each target equipment and the upstream-downstream relation of each target equipment. Therefore, the scheme can determine the service link more simply and conveniently at lower cost.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for determining a service link, an electronic device, and a storage medium.
Background
A service system is composed of a plurality of service components, and when implementing a service, the service components in the service systems may work together, and the service components typically communicate in a manner of calling an API (Application Programming Interface, application program interface), which may be referred to as a lightweight mechanism communication manner. A complete business process can call a plurality of business components, and a business link is a call chain formed according to the call relation among the business components when the business is realized. The service link can help the staff to monitor and track the service flow in real time, which is beneficial to finding and solving the problems in time and improving the service operation efficiency; moreover, for any service, a worker is typically informed of the API of the service component that the service system first calls when implementing the service.
For the login service, the service system responds to a login instruction corresponding to the service and calls APIs of a service component A, a service component B and a service component C successively, so that a login process is realized, wherein the APIs of the service component A with a log in function are called first, the service component A calls the APIs of the service component B to process user information, and calls the APIs of the service component C to process account information; then the service link for the login service is with respect to the calling relationship between service component a, service component B and service component.
In the prior art, a method of analyzing network data is generally used to analyze a link of a service, but the method needs to know a network protocol, and some special network protocols cannot be processed, and have high cost. Therefore, how to determine service links more cost effectively and easily becomes a problem to be solved.
Disclosure of Invention
The embodiment of the application aims to provide a service link determining method so as to realize lower cost and simpler and more convenient service link determination. The specific technical scheme is as follows:
in a first aspect of the present application, there is provided a service link determining method, where the method is applied to an electronic device, the method including:
determining a target API corresponding to a target service to be analyzed; the target API is the first API required to be called when the target service is executed;
determining source equipment corresponding to the target API and target equipment corresponding to the target API based on association relation data between preset equipment; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
Taking the target API as an API to be utilized;
screening equipment meeting preset conditions from downstream equipment of target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
taking a reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the preset API to be utilized, and screening equipment meeting preset conditions from downstream equipment of the target equipment until the target equipment does not exist; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
And constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
Optionally, the determining, based on the association relationship data between the preset devices, the source device corresponding to the target API, and the target device corresponding to the target API include:
based on the association relation of the devices in the association relation data between the devices, a device group with a communication relation and utilizing a target API in communication is found;
determining equipment which communicates through equipment calling the target API when communicating from the searched equipment group as source equipment corresponding to the target API;
and determining the devices except the source device in the searched device group as target devices.
Optionally, the determining manner of the association relationship data between the devices includes:
determining the designated equipment where the service component is deployed and the designated information corresponding to the service component based on the log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
For each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with the communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when the designated equipment with the communication relationship communicates.
Optionally, the determining manner of the target mapping relationship corresponding to any API includes:
determining log information having the same specified unique identifier based on the log information of each business component of the target business system; the appointed unique identifier characterizes a service identifier of a service which calls any API when being executed;
determining an API of a service component conforming to a specified condition from the determined log information, and constructing any API and the API conforming to the specified condition to obtain a mapping relation corresponding to any API; the appointed condition is that an API call instruction sent by the service component with any API is received.
Optionally, after the service link corresponding to the target service is constructed according to the source device, each target device, and the upstream-downstream relationship of each target device, the method further includes:
And generating a topological relation diagram of the service link of the target service by taking each device in the service link as a node according to the service link corresponding to the target service.
In a second aspect of the present application, there is also provided a service link determining apparatus, the apparatus being applied to an electronic device, the apparatus comprising:
the first determining module is used for determining a target API corresponding to the target service to be analyzed; the target API is the first API required to be called when the target service is executed;
the second determining module is used for determining source equipment corresponding to the target API and target equipment corresponding to the target API based on the preset association relation data between the equipment; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
The module to be utilized is used for taking the target API as an API to be utilized;
the first screening module is used for screening equipment meeting preset conditions from downstream equipment of the target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
the second screening module is used for taking the reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the API to be utilized based on the preset, and screening equipment meeting the preset condition from downstream equipment of the target equipment until the downstream equipment does not exist in the target equipment; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
And the construction module is used for constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
Optionally, the second determining module includes:
the searching unit is used for searching a device group which has a communication relationship and utilizes a target API in communication based on the association relationship of the devices in the association relationship data between the devices;
a first determining unit, configured to determine, from the found device group, a device that performs communication by calling a device of the target API as a source device corresponding to the target API when performing communication;
and a second determining unit that determines the devices other than the source device in the found device group as target devices.
Optionally, the determining manner of the association relationship data between the devices includes:
determining the designated equipment where the service component is deployed and the designated information corresponding to the service component based on the log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
For each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with the communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when the designated equipment with the communication relationship communicates.
Optionally, the determining manner of the target mapping relationship corresponding to any API includes:
determining log information having the same specified unique identifier based on the log information of each business component of the target business system; the appointed unique identifier characterizes a service identifier of a service which calls any API when being executed;
determining an API of a service component conforming to a specified condition from the determined log information, and constructing any API and the API conforming to the specified condition to obtain a mapping relation corresponding to any API; the appointed condition is that an API call instruction sent by the service component with any API is received.
Optionally, after the building module, the apparatus further includes:
and the generating module is used for generating a topological relation diagram of the service link of the target service by taking each device in the service link as a node according to the service link corresponding to the target service.
In yet another aspect of the present application, there is also provided an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory perform communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the service link determining methods when executing the program stored in the memory.
In yet another aspect of the implementation of the present application, there is also provided a computer readable storage medium, in which a computer program is stored, the computer program implementing any one of the above-mentioned service link determination methods when executed by a processor.
The embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the above-described traffic link determination methods.
The embodiment of the application has the beneficial effects that:
in the method, source equipment and target equipment corresponding to a target API are determined based on association relation data among preset equipment; then, taking a target API as an API to be utilized, screening devices meeting preset conditions from downstream devices of the target devices contained in preset association relation data between the devices based on a preset target mapping relation corresponding to the API to be utilized, taking the screened devices as target devices by taking a reference API corresponding to the screened devices as the API to be utilized, returning the preset target mapping relation corresponding to the API to be utilized, and screening the devices meeting the preset conditions from the downstream devices of the target devices until the target devices do not exist; and finally, constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
The association relation data between the devices and the data of the target mapping relation corresponding to the API are obtained by analyzing the log information of the service component, and when the service link analysis is carried out, the association relation data between the devices and the target mapping relation corresponding to the API can be combined to determine the upstream and downstream relation of each device and the device utilized when the target service is realized, so that the service link for realizing the target service is further determined. It can be seen that the present application allows for a lower cost and simpler determination of the traffic link.
Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the application, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a schematic flow chart of a service link determining method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an API mapping relationship provided in an embodiment of the present application;
FIG. 3 is a flowchart illustrating a determination method of an API mapping relationship according to an embodiment of the present application;
fig. 4 is a schematic diagram of a service system layering provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a service link according to an embodiment of the present application;
fig. 6 is a schematic flow chart of another service link determining method according to an embodiment of the present application;
fig. 7 is a schematic flow chart of another service link determining method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a service link determining apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
In order to determine a service link more simply and conveniently at lower cost, the embodiment of the application provides a service link determining method, a device, electronic equipment and a storage medium.
The following first describes a service link determining method provided by the embodiment of the present application. The service link determining method provided by the embodiment of the application is applied to the electronic equipment. In a specific application, the electronic device may be a terminal device, a server, etc., and the terminal device may be a tablet computer, a desktop computer, etc.; the application is not limited in this regard.
The method for determining the service link provided by the embodiment of the application can comprise the following steps:
determining a target API corresponding to a target service to be analyzed; the target API is the first API required to be called when the target service is executed;
determining source equipment corresponding to the target API and target equipment corresponding to the target API based on association relation data between preset equipment; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
Taking the target API as an API to be utilized;
screening equipment meeting preset conditions from downstream equipment of target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
taking a reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the preset API to be utilized, and screening equipment meeting preset conditions from downstream equipment of the target equipment until the target equipment does not exist; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
And constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
In the method, source equipment and target equipment corresponding to a target API are determined based on association relation data among preset equipment; then, taking a target API as an API to be utilized, screening devices meeting preset conditions from downstream devices of the target devices contained in preset association relation data between the devices based on a preset target mapping relation corresponding to the API to be utilized, taking the screened devices as target devices by taking a reference API corresponding to the screened devices as the API to be utilized, returning the preset target mapping relation corresponding to the API to be utilized, and screening the devices meeting the preset conditions from the downstream devices of the target devices until the target devices do not exist; and finally, constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
The association relation data between the devices and the data of the target mapping relation corresponding to the API are obtained by analyzing the log information of the service component, and when the service link analysis is carried out, the association relation data between the devices and the target mapping relation corresponding to the API can be combined to determine the upstream and downstream relation of each device and the device utilized when the target service is realized, so that the service link for realizing the target service is further determined. It can be seen that the present application allows for a lower cost and simpler determination of the traffic link.
The following describes a service link determination method provided by the embodiment of the present application with reference to the accompanying drawings.
As shown in fig. 1, a service link determining manner provided by the embodiment of the present application may include the following steps:
s101, determining a target API corresponding to a target service to be analyzed; the target API is the first API required to be called when the target service is executed;
for any service, a worker can generally learn the API of the service component which is called first when the target service system realizes the service, so that in the scheme of the application, the target API corresponding to the target service to be analyzed can be determined by receiving the information about the API of the service component which is called first when the worker sends the information about the API of the service component which is called first to realize the target service to the electronic equipment. The information of any API may be the name of the API, the label, etc. may be information that characterizes the API.
It should be noted that, the target service is any service that can be implemented by the designated target service system, and the number of target service systems may be one or more, and when the number of target service systems is multiple, the multiple target service systems cooperate with each other to implement each service.
S102, determining source equipment corresponding to the target API and target equipment corresponding to the target API based on association relation data between preset equipment; the method comprises the steps that the association relation data between preset devices are obtained by analysis based on log information of a target service system, and the association relation data between the preset devices record APIs (application program interfaces) which are needed to be utilized by any two devices with association relation when the devices communicate; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
it can be known that the preset association relationship data between the devices includes service links of a plurality of services, the target service to be analyzed refers to only one service of the plurality of services, and the information known to the staff is an API of the service component that is called first when the target service system implements the service. As the API of the service component that is called first, the device deployed by the service component that issues the API call instruction is: the source device in the service link of the target service, and the device deployed by the service component that receives the API call instruction is: a target device in a traffic link of a target traffic.
When a user realizes transaction service by clicking an operation button on a terminal device, the user triggers a service component A deployed on the terminal to call an API of a service component B, after the API of the service component B is called, an instruction for calling the API of the service component C is sent to a service component C, and an instruction for calling the API of the service component D is sent to a service component D, wherein the service components A, B, C and D are service components for realizing transaction service; since the service component a is a service component that firstly invokes the API of the other service components in the login service, in the association relationship data between the devices, the device for characterizing the device where the service component a is located is: the source device, the service component B is a service component having an API called by the service component a, the API of the service component B is the API called first in the transaction service, that is, the target API, and the device with the service component B deployed is the device characterized in the association relationship data between the devices, that is, the target device.
Optionally, the determining, based on the association relationship data between the preset devices, the source device corresponding to the target API, and the target device corresponding to the target API include steps A1-A3:
A1, searching a device group with a communication relationship and utilizing a target API during communication based on the association relationship of devices in the association relationship data between the devices;
in the association relationship data between the devices, the communication direction between the two devices with communication relationship is recorded, when the target API is utilized between the two devices with communication relationship, the communication relationship between the two devices is recorded with the target API, therefore, the device group with communication relationship can be found in the association relationship data between the devices through the mark of the API between the devices, and the target API is utilized during communication.
When the target API is the API of the service component that is called first when the target service is implemented, it can be known that the device that is deployed by the service component that typically calls the target API is the source device, but it is also possible that the target API is called again in the implementation process of the target service, and when the target service is implemented, the source device is the first device of the service link, and has no upstream device, and only the downstream device, where the upstream device is the device that sends the instruction, and step A1 is essentially to screen out the device group that includes the source device, so that the device group that utilizes the target API can be screened by determining whether the upstream device in the device group has the upstream device, so that the screened device group is the device group that includes the source device.
A2, determining equipment for communication through equipment calling the target API from the searched equipment group as source equipment corresponding to the target API when the equipment is communicated;
since the communication direction of each device group is known and the source device is the device that gives the instruction in the device groups, the source device in the device groups, that is, the source device is the upstream device in the device groups, can be determined according to the communication direction of the edges of the device groups, and although there are a plurality of device groups, the source device is usually one, for example, the device groups a-B, a-C, a-D, although there are three device groups, the source device is the device a, and of course, the case that the source device is a plurality of devices is also possible, which is not limited in the present application.
A3, determining the devices except the source device in the searched device group as target devices.
The device group is essentially the source device and the downstream devices thereof, and thus the devices other than the source device, i.e., the downstream devices of the source device, in the device group are considered as target devices.
Optionally, the determining method of the association relationship data between the devices includes steps B1-B3:
B1, determining designated equipment where the service component is deployed and designated information corresponding to the service component based on log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
the log information is extracted in various ways, for example, a filecoat (a lightweight transport tool for forwarding and centralizing log data) is used to collect the service component log into kafka (a high throughput distributed publish-subscribe message system), and then a logstack (an open source data collection engine with a real-time pipeline function) is used to dynamically unify the data from different data sources and normalize the data to a destination selected by you) to parse the log of the service component, so as to extract the key information. The method for extracting the log information is not limited in the application. The extracted key information may include: the source address of the request, the call-out address of the request, the API interface of the request, and the source address of the log. The specified information corresponding to the service component may include the extracted key information.
B2, aiming at each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with a communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when communicating;
for each service component, there may be a plurality of devices that communicate with the designated device where the service component is disposed, the communication relationship between the designated device where the service component is disposed and the device having a communication relationship with the designated device where the service component is disposed, and the API that needs to be utilized when performing communication are recorded in association relationship data between the devices, and it may be known that the communication relationship between the devices may be one-to-one, one-to-many, many-to-many, and the specific correspondence is determined by the actual service.
By using the source address of the request, the call-out address of the request and the API interface of the request obtained from the log, it is possible to determine that the device having a communication relationship, for example, service component a is disposed in device 1, service component B is disposed in device 2, log information in service component a records that the call-out address of the request Q is the address of device 2, log information in service component B records that the source address of the request Q is the address of device 1, and then it is indicated that device 1 has a communication relationship with device 2, where the address of the device may be an IP address or a label of the device, and may represent a label of device uniqueness. Further, since the service components are in essence communicating, even if a plurality of service components are disposed in the same device, the service component having a communication relationship in practice can be determined from the request information recorded in the log, for example, in the embodiment described above, the log information in the service component a records the call-out address of the request Q as the address of the device 2, the log information in the service component B records the source address of the request Q as the address of the device 1, the devices disposed in the two components have a communication relationship, and both the service components are processing the service component concerning the same request Q, and therefore, the service component a and the service component B can be determined to have a communication relationship. The example request Q described above is only one of a plurality of requests utilized in implementing a service and is not limiting of the application.
The service components typically communicate in a manner of calling an API, so that the determined communication relationship is also typically a relationship for communication by using the API, and then the API used by the communication relationship between devices can be recorded in the association relationship data between the devices, for example, the device A calls the API of the device B, and then the communication relationship between A and B can record the API of the device B.
In addition, the scheme of the application determines the association relation between the devices instead of directly determining the association relation between the service components, because in practical application, a plurality of identical service components are involved to work together, have the same functions and the same names, are different only in deployed devices, if only the association relation between the service components is determined, the identical components cannot be distinguished, and by determining the association relation between the devices, the service components deployed on the devices can be distinguished by the information of the devices; the service components F are illustratively deployed on different devices, which are called service components F, but according to the device on which the service components are deployed, each service component F can be divided into f.ip1, f.ip2, f.ip3, and the like.
Typically, a device deploys a service component, so that the service link in the present application can also be represented by a communication relationship between devices deployed by each service component.
In one implementation, a specified service component needs to receive an API call instruction and forward the same API call instruction to a downstream device of the specified service component, where the specified service component is a function of implementing the API call instruction forwarding. At this time, the communication relationship between the device deployed by the specified service component and the device deployed by the service component sending the instruction to the specified service component may record the API represented by the API call instruction, and the communication relationship between the device deployed by the specified service component and the device downstream thereof may also record the API represented by the API call instruction.
S103, taking the target API as an API to be utilized;
the scheme of the application screens the equipment meeting the preset conditions through the target mapping relation among the APIs, so that the target APIs are used as APIs to be utilized in the subsequent steps.
S104, screening equipment meeting preset conditions from downstream equipment of the target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called by a service component with the API to be utilized when the target service is realized; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
In the process of realizing the target service, the application considers that the calling relationship between the APIs is a certain relationship, for example, in the service link of the service realizing the transaction in the embodiment, the API of the service component B is called before the API of the service component D is called, so that the API of the service component B is related to the API of the service component D, and in the application, the relationship between the APIs is called as a mapping relationship between the APIs.
The association relationship data between the devices contains service links of a plurality of services, and in different services, the mapping relationship of the API is different, for any device, the association relationship data between the devices may have a plurality of downstream devices, and for a target service, the downstream devices of the device are only a part of the plurality of downstream devices, so that for different services, the target mapping relationship of the API for the service needs to be utilized, and the downstream devices of the target device are found out from the association relationship data between the devices, and the devices meeting the preset conditions are screened. The downstream device is a device that is used as a data receiving side during communication between two devices having a communication relationship, for example, in the service link of the service for implementing the transaction in the above embodiment, the device corresponding to the device deployed by the service component B is a downstream device corresponding to the device deployed by the service component a.
The predetermined condition includes: when the target device is in communication with the target device, the API utilized by the target device is an API in the target mapping relationship, the API in the target mapping relationship actually includes the API to be utilized itself and a designated API having a mapping relationship with the API to be utilized in the target service, for example, the API to be utilized is API1, and when the target service is implemented, the API having a mapping relationship with the API to be utilized is API2, API3 and API4, then the API in the target mapping relationship includes API1, API2, API3 and API4, and for this example, when the API utilized by the target device is any one of API1, API2, API3 and API4 when the target device is in communication with the target device, the predetermined condition is met.
Typically, the service components communicate with each other through an API, and the API utilized by the target device may be the API of the service component deployed by the downstream device that is invoked by the service component deployed by the target device,
in the calling process of the API, the condition that the appointed service component needs to receive the API calling instruction and forward the same API calling instruction to the downstream equipment of the appointed service component exists, and the appointed service component is used for realizing the function of transferring the API calling instruction. For example, the service component Y sends an instruction for calling the API of the service component x to the service component Z, after the service component Z receives the instruction for calling the API of the service component x, the instruction for calling the API of the service component x is sent to the service component x, where the service component Z is an appointed service component, an API of the service component x may be marked between the service component Y and the service component Z, an API of the service component x may be marked between the service component Z and the service component x, when the service component Y is used as a target device, the API utilized is an API of the service component x, and when the service component Z is used as a target device, the API utilized is also an API of the service component x.
And when the service components do not communicate by calling the API, the API is not marked between the devices.
Optionally, the determining method of the target mapping relationship corresponding to any API includes steps C1-C2:
step C1, determining the log information with the same appointed unique identification based on the log information of each service component of the target service system; the appointed unique identifier characterizes a service identifier of a service which calls any API when being executed;
for the same service, log information related in the service implementation process has the same appointed unique identifier, the service calling any API during execution is essentially the target service, and it can be known that the target service implementation process can call a plurality of APIs, and any API is only one API called by the target service implementation process. The appointed unique identification of different services can be obtained by staff through log information acquisition.
By specifying the unique identifier, although the log information related to the realization of the target service can be determined, the service components utilized for realizing the target service can be determined, but the communication relationship between the service components in the target service cannot be determined, so that the scheme of the application determines the communication relationship between the service components in the target service by utilizing the association relationship data between the interface mapping relationship and the equipment, thereby obtaining the service link of the target service system, wherein the association relationship data between the interface mapping relationship and the equipment are generated by utilizing the data acquired by the log information of the service components.
Step C2, determining the API of the service component conforming to the specified condition from the determined log information, and constructing any API and the API conforming to the specified condition to obtain a mapping relation corresponding to any API; the appointed condition is that an API call instruction sent by the service component with any API is received.
The determined log information is the log information for realizing the same service, and from the log information for realizing the same service, an API call instruction sent by the service component with any API to other service components can be determined, the API represented by the API call instruction is sent to the other service components, the API has a mapping relation with any API, and the service component of any API can be the API represented by the API call instruction sent to the other service components after the other service components for realizing the same service call the any API. In the log information of the same service, after the API of the service component B is called by the call instruction sent by the service component a, an instruction for calling the API of the service component D is sent to the service component D, and then any one of the APIs may be the API of the service component B, where the specified condition is that the API call instruction sent by the service component B is received, and the API call instruction sent by the service component B indicates the API of the service component D, and the API of the service component D is the API that meets the specified condition, so that the API of the service component B has a mapping relationship with the API of the service component D.
In some cases, however, the APIs between business components are not directly called, but rather are called by designating a business component to forward call instructions, at which point the API utilized by the target device may be the API involved in the instructions issued by the target device to downstream devices,
in one implementation manner, a designated service component needs to receive an API call instruction and forwards the same API call instruction to a downstream device of a device deployed by the designated service component, where the designated service component is an API call instruction forwarding function, for example, service component Y sends an API call instruction for calling the API of service component x to service component Z, after receiving the API call instruction for calling the API of service component x, service component Z distributes the API call instruction for calling the API of service component x to service component x1, service component 2 and service component x3, so that service components x1, x2 and x3 work together, where service components x1, x2 and x3 may be the same component deployed on different devices, and their APIs are the same, where service component Z is a designated service component, where for the designated service component, when the device deployed by the designated service component is a downstream device, the API used by a target device corresponding to the downstream device is the API call instruction to be forwarded by the API call instruction to the downstream device, and when the designated device deployed by the downstream device is the designated API is the API call instruction representing that the designated device is the designated API, and the designated device deployed by the designated device is the target device.
Therefore, the API utilized by the target device when communicating with the target device may be various, and may be an API having a mapping relationship with the API of the target device, or may be the same API as the API of the target device.
S105, taking the reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the preset API to be utilized, and screening equipment meeting preset conditions from downstream equipment of the target equipment until the target equipment does not have the downstream equipment; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
this step is used to characterize the repetition of step S104, and determine the downstream device in the target service for each target device.
S106, constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
In the above steps, from the source device, the device for realizing the target service is sequentially found, and the upstream and downstream relations between each device are also determined, that is, the communication relations between the devices are all determined, so that the service link corresponding to the target service can be determined according to the communication relations between the devices. It should be emphasized that the service components in the source device are the service components in the designated device represented by the source device; similarly, the business components deployed in each target device are the business components in the designated device that each target device characterizes.
In addition, the determined service link corresponding to the target service is the communication relationship between the devices related to the service component, and one service component is usually deployed by one device, so that the connection relationship between the devices can represent the connection relationship between the service components. In addition, since one service component is usually deployed by one device, the service component deployed by each device can be determined, for example, the service component deployed by the device is determined by the IP address of the device, and then, the determined devices in the service link corresponding to the target service are converted or marked with the information of the service component deployed by the device, so that the communication relationship between the service components corresponding to the target service can be obtained.
Optionally, after the step of constructing the service link corresponding to the target service according to the source device, each target device, and the upstream-downstream relationship of each target device, the method further includes:
and generating a topological relation diagram of the business links of the target business according to the business links corresponding to the target business.
Of course, service components deployed in respective devices in the service link may also be used as nodes to generate a topology relationship diagram of the service link related to the target service.
The constructed service links corresponding to the target service may be expressed in text, table, image, etc., and for different expression modes, a topology relation diagram of the service links related to the target service may be generated according to the service links corresponding to the target service, for example, service link data is sent to a diagram database neo4j, so that the topology relation diagram of the service links may be visually displayed.
The topological relation diagram of the service link is more convenient for a user to check, and the service link is more attractive in the way of the topological relation diagram.
In the method, source equipment and target equipment corresponding to a target API are determined based on association relation data among preset equipment; then, taking a target API as an API to be utilized, screening devices meeting preset conditions from downstream devices of the target devices contained in preset association relation data between the devices based on a preset target mapping relation corresponding to the API to be utilized, taking the screened devices as target devices by taking a reference API corresponding to the screened devices as the API to be utilized, returning the preset target mapping relation corresponding to the API to be utilized, and screening the devices meeting the preset conditions from the downstream devices of the target devices until the target devices do not exist; and finally, constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
The association relation data between the devices and the data of the target mapping relation corresponding to the API are obtained by analyzing the log information of the service component, and when the service link analysis is carried out, the association relation data between the devices and the target mapping relation corresponding to the API can be combined to determine the upstream and downstream relation of each device and the device utilized when the target service is realized, so that the service link for realizing the target service is further determined. It can be seen that the present application allows for a lower cost and simpler determination of the traffic link.
In addition, the method for acquiring the log data is an offline method, so that the system performance is not affected when the service link is determined.
The service link determining mode is specifically described below with reference to the accompanying drawings.
As shown in fig. 2, where src in fig. 2 represents an IP address of an output instruction, that is, an IP address of a device disposed by a service component that outputs an API call instruction, dest represents an IP address of an input instruction, that is, an IP address of a device disposed by a service component that receives an API call instruction, it can be seen that there is a mapping relationship between an API of an address X1 and APIs 1-APIn of an address X2, which indicates that one API may have a mapping relationship with multiple APIs. When one API has a mapping relationship with a plurality of APIs, the APIs may be recorded into a data table, where the APIs in the data table have a mapping relationship with the one API. Wherein the data of src, dest and API are all extracted from the log information of the service component.
The mapping relationship between APIs may be stored in a database, and as shown in fig. 3, a flow chart of a determining manner of the mapping relationship of APIs is shown in the following specific scheme:
s301, inputting an API;
the API is the API corresponding to the request instruction for realizing a certain service, which is known by the user, and the input API is the target API in the above embodiment.
S302, inquiring the access layer log to obtain an API (application program interface): APIList1.
In the following description of the layering of service components of the system through fig. 4, fig. 4 is a layering schematic diagram of a service system provided by an embodiment of the present application, in fig. 4, the physical meaning of dest and src is the same as that of the foregoing description, typically, a plurality of service components are used to perform operations, and a micro-service architecture is used, where the architecture is used to layer the service components implementing services, the portion controlled by a dotted line in the diagram is a layering of the service components in a service system, typically, the service components in a service system are divided into an access layer, a service layer (or a functional layer) and a data layer, the service components of the access layer are typically used to receive a service request instruction of a user, and then send the service request instruction of the user to a plurality of service components of the service layer, in this process, the service components of the access layer are typically used to receive API call information of the service components of the service layer, and complete corresponding operations after the API is called, for example, the API call of the service components of other service layers are typically called, and in a call relationship between systems, typically, the service components of the service layer are called by the access layer are called by the API 2, the service components of the service layer 2 are transferred by the service components of the system, and the API 2 is required to be sent to the API layer 2, and the API call information of the service components of the service layer is transferred by the service components of the system is stored in the system, and the system is required to have the call layer 2, the service component of the service layer can acquire the data required for realizing the service function from the service component of the data layer for processing. The other access layer in fig. 4 is the access layer in other service systems.
The API of the service layer business component called by the business component of the access layer has a mapping relation with the input target API; the service request instruction of the user is usually sent to the access layer service component by the service component deployed by the terminal device operated by the user, the API represented by the service request instruction is known by the user, the API called first when the target service is implemented, that is, the API input in this embodiment, the access layer service component calls the service layer service component API after receiving the service request instruction, the log information of the access layer service component records the information of the access layer service component calling the service layer service component API, the APIList1 in fig. 3 is a table of the API having a mapping relation with the input target API, and the query statement "API" is used to query the data of the access layer service component log to obtain the result as the API: APIList1; APIList1 has a mapping relationship between APIs and target APIs.
S303, inquiring the service layer 1 log to obtain an APIList1 result: APIList2;
the service layer 1 refers to a service component of a service layer directly called by a service component of an access layer, the service component of the service layer 1 may continuously call other service components of the service layer, and the other service components of the service layer called by the service component of the service layer 1 may be called as service components of the service layer 2, so that an API calling the service component of the service layer 1 has a mapping relationship with an API calling the service component of the service layer 2, and the APIList2 is a table for recording an API having a mapping relationship with an API calling the service component of the service layer 1.
The data of the service layer 1 service component log is queried through a query statement APIList1, and a result is APIList1: APIList2, APIList1 indicates an API that each service component of service layer 1 has, APIList2 indicates an API that service component of service layer 2 has a mapping relation with the API that service component of service layer 1 has, APIList1 and APIList 2's corresponding APIs have a mapping relation, APIList1 and APIList 2's mapping relation is preserved, and not each API in APIList1 and each API in APIList2 have a mapping relation.
S304, inquiring the service layer 2 log to obtain an APIList2 result: APIList3;
after receiving the call instruction, the service component of the service layer 2 generally communicates with the service component such as a database, and an API of the service component of the call service layer 2 has a mapping relationship with an API represented by the communication instruction sent by the service component of the service layer 2.
Query statement "APIList2" is used for querying the data of service layer 2 service component logs, and the result is APIList2: APIList3.APIList2 represents an API possessed by a service component of each service layer 2, and APIList3 represents an API possessed by a service component having a mapping relation with an API possessed by a service component of the service layer 1; APIList2: APIList3 and APIList1 described above: APIList2 is similar and will not be described in detail herein.
In general, the service component of the service layer 2 is used as the component that issues the instruction last in the service link, so the corresponding relationship of the APIs in the service link is the APIs: APIList1: APIList2: APIList3 stores the API mapping relation of the service in a database, so as to obtain an interface splitting dictionary for recording the API mapping relation of the service, wherein the database is an elastic search in the figure, and the database can be other databases, and the application is not limited to the above. Of course, the determining manner of the interface splitting dictionary described in this embodiment is determined only for one service, and the dividing manner of different services for the service components of the service layer may not be the same, but it may be determined that for different services, the interface splitting dictionary of the service may be determined according to the calling relationship between the service components implementing the service.
As shown in fig. 5, the service link diagram of the service link related to the target service is determined by using the interface splitting dictionary and the relation dictionary. Wherein, the equipment is marked with the IP address of the equipment deployment equipment, the connection lines between the equipment are marked with the API utilized by the connection relation of the connection lines, and the arrows of the connection lines between the equipment represent the communication direction.
The interface splitting dictionary records the interface mapping relationship described in the above embodiment, the relationship dictionary in the figure is the association relationship data between the devices in the above embodiment, the function number is used to characterize the API utilized by the target service in the above embodiment, in some cases, the staff will number each API, for example, 001 represents API1,002 represents API2, etc., and the function number input in the figure is the function number corresponding to the target API in the above embodiment. Fig. 6 is a flow chart of a service link determining method, in which the source device in fig. 6 is the same as the source device in the above embodiment, and the specific implementation steps are steps D1-D3
Step D1, inputting a function number, and inquiring a source address and a target address in a system topology to obtain a first-layer calling relationship;
step D1 corresponds to S101-S102 in the above embodiment, the function number is used to characterize the API, the input function number characterizes the target API, the system topology is the association relationship data between the preset devices, and the source address is the address of the source device.
Step D2, inquiring whether the function number needs to be converted in the interface splitting dictionary, if not, taking the last output target address as the input address of the current layer, and inquiring the current layer target address in the system topology by combining the function number to obtain a second layer calling relation; if conversion is needed, the last output target address is used as the input address of the current layer, and the current layer target address is inquired in the system topology by combining the converted function number to obtain a second layer calling relation;
Step D2 corresponds to the step S104, and the API mapping relation is recorded in the interface splitting dictionary.
And D3, repeating the first step and the second step until the destination address cannot be found in the system topology.
Step D3 corresponds to the step S105, and after step D3, the step S106 may be executed to construct a service link corresponding to the target service according to the service component deployed by the source device, the service component deployed by each target device, and the upstream-downstream relationship between each target device.
Based on the service topology, service monitoring, fault positioning, capacity analysis and the like can be performed subsequently. The figure is similar to the figure implementation, except that the name of the API is directly utilized, rather than the function number corresponding to the API.
Fig. 7 is a flowchart of another service link determining method provided in this embodiment;
s701, inputting an interface API;
the input interface API is the API of the service component that is called first when the service system implements the target service, and step S701 corresponds to S101 in the foregoing embodiment, which is not described herein.
S702, inquiring srcIP and destIP according to the API;
for any device, the srcIP is the IP address of the upstream device of the device, the destIP is the IP address of the downstream device of the device, the input interface API is the target API, the source device corresponding to the input interface API and the target device corresponding to the input interface API target API can be determined by utilizing the association relation data between the devices, the address of the source device is the srcIP of the target device, and the address of the target device is the srcIP of the source device.
S703, API conversion;
for any target device, if the API of the connection relation mark between the device target and the upstream device is the same as the API of the connection relation mark between the target device and the downstream device, the step S705 is executed without API conversion, if not, the step S704 is executed by API conversion through the API mapping relation about the target service. The physical meaning of the target device is the same as in the above implementation, and is the downstream device of the source device.
S704, converting interfaces;
aiming at any target device, the API marked by the connection relation between the target device and the upstream device is different from the API marked by the connection relation between the target device and the downstream device, and the API has an API mapping relation, the API target API is converted into the API marked by the connection relation between the target device and the downstream device, and the converted API is the new target API of the current API.
S705, query destin ip according to api.src (last destin ip).
S706, query destin according to api.src (last destin).
Step S705 is similar to steps S706 and S702, and the downstream address of the target device is found for the target service according to the address of the target device in combination with the target API;
S707, the result exists;
the result is that for each target device, the pointer can determine the downstream devices of that target device. When the target device has no downstream device, the result is not present, indicating that the link is over. S702 to S707 correspond to S102 to S105 in the above-described embodiment.
S708, saving a link;
s708 corresponds to S106, and after determining the relationship between the devices related to the target service, constructs a service link corresponding to the target service, and stores the service link.
The above embodiment specifically describes the determination manner of the API mapping relationship and the specific determination manner of the service link in conjunction with fig. 2, 3, 4, 5, 6 and 7, and the association relationship data between devices utilized in the embodiment and the data utilized for determining the mapping relationship corresponding to the API are all obtained by analyzing the log data of the service component, which can be seen that the application can determine the service link more simply and with lower cost.
In addition, the method for acquiring the log data is an offline method, so that the system performance is not affected when the service link is determined.
Based on the embodiment content of the service link determining method, the embodiment of the application also provides a service link determining device. Fig. 8 is a schematic structural diagram of a service link determining apparatus according to an embodiment of the present application, where, as shown in fig. 8, the service link determining apparatus may include:
A first determining module 801, configured to determine a target API corresponding to a target service to be analyzed; the target API is the first API required to be called when the target service is executed;
a second determining module 802, configured to determine, based on association relationship data between preset devices, a source device corresponding to the target API and a target device corresponding to the target API; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
a to-be-utilized module 803, configured to take the target API as an API to be utilized;
a first screening module 804, configured to screen, based on a preset target mapping relationship corresponding to the API to be utilized, a device meeting a predetermined condition from downstream devices of the target device; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
A second screening module 805, configured to use the reference API corresponding to the screened device as an API to be utilized, use the screened device as a target device, and return to the target mapping relationship corresponding to the API to be utilized based on the preset, and screen a device meeting a predetermined condition from a downstream device of the target device until the target device does not have a downstream device; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
and a construction module 806, configured to construct a service link corresponding to the target service according to the source device, each target device, and the upstream-downstream relationship of each target device.
In the method, source equipment and target equipment corresponding to a target API are determined based on association relation data among preset equipment; then, taking a target API as an API to be utilized, screening devices meeting preset conditions from downstream devices of the target devices contained in preset association relation data between the devices based on a preset target mapping relation corresponding to the API to be utilized, taking the screened devices as target devices by taking a reference API corresponding to the screened devices as the API to be utilized, returning the preset target mapping relation corresponding to the API to be utilized, and screening the devices meeting the preset conditions from the downstream devices of the target devices until the target devices do not exist; and finally, constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
The association relation data between the devices and the data of the target mapping relation corresponding to the API are obtained by analyzing the log information of the service component, and when the service link analysis is carried out, the association relation data between the devices and the target mapping relation corresponding to the API can be combined to determine the upstream and downstream relation of each device and the device utilized when the target service is realized, so that the service link for realizing the target service is further determined. It can be seen that the present application allows for a lower cost and simpler determination of the traffic link.
Optionally, the second determining module includes:
the searching unit is used for searching a device group which has a communication relationship and utilizes a target API in communication based on the association relationship of the devices in the association relationship data between the devices;
a first determining unit, configured to determine, from the found device group, a device that performs communication by calling a device of the target API as a source device corresponding to the target API when performing communication;
and a second determining unit that determines the devices other than the source device in the found device group as target devices.
Optionally, the determining manner of the association relationship data between the devices includes:
Determining the designated equipment where the service component is deployed and the designated information corresponding to the service component based on the log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
for each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with the communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when the designated equipment with the communication relationship communicates.
Optionally, the determining manner of the target mapping relationship corresponding to any API includes:
determining log information having the same specified unique identifier based on the log information of each business component of the target business system; the appointed unique identifier characterizes a service identifier of a service which calls any API when being executed;
determining an API of a service component conforming to a specified condition from the determined log information, and constructing any API and the API conforming to the specified condition to obtain a mapping relation corresponding to any API; the appointed condition is that an API call instruction sent by the service component with any API is received.
Optionally, after the building module, the apparatus further includes:
and the generating module is used for generating a topological relation diagram of the service link of the target service by taking each device in the service link as a node according to the service link corresponding to the target service.
The embodiment of the present application also provides an electronic device, as shown in fig. 9, including a processor 901, a communication interface 902, a memory 903, and a communication bus 904, where the processor 901, the communication interface 902, and the memory 903 perform communication with each other through the communication bus 904,
a memory 903 for storing a computer program;
the processor 901 is configured to implement any of the service link determining methods described above when executing the program stored in the memory 903.
The communication bus referred to by the electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present application, there is also provided a computer readable storage medium having stored therein a computer program which when executed by a processor implements the steps of any of the above-described traffic link determination methods.
In yet another embodiment of the present application, there is also provided a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the traffic link determination methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (10)
1. A method for determining a service link, the method being applied to an electronic device, the method comprising:
determining a target API corresponding to a target service to be analyzed; the target API is the first API required to be called when the target service is executed;
determining source equipment corresponding to the target API and target equipment corresponding to the target API based on association relation data between preset equipment; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
taking the target API as an API to be utilized;
screening equipment meeting preset conditions from downstream equipment of target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
Taking a reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the preset API to be utilized, and screening equipment meeting preset conditions from downstream equipment of the target equipment until the target equipment does not exist; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
and constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
2. The method according to claim 1, wherein the determining, based on the association relationship data between the preset devices, the source device corresponding to the target API, and the target device corresponding to the target API include:
based on the association relation of the devices in the association relation data between the devices, a device group with a communication relation and utilizing a target API in communication is found;
determining equipment which communicates through equipment calling the target API when communicating from the searched equipment group as source equipment corresponding to the target API;
And determining the devices except the source device in the searched device group as target devices.
3. The method according to claim 1, wherein the determining manner of the association relationship data between the devices includes:
determining the designated equipment where the service component is deployed and the designated information corresponding to the service component based on the log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
for each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with the communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when the designated equipment with the communication relationship communicates.
4. The method of claim 1, wherein the determining manner of the target mapping relationship corresponding to any API includes:
Determining log information having the same specified unique identifier based on the log information of each business component of the target business system; the appointed unique identifier characterizes a service identifier of a service which calls any API when being executed;
determining an API of a service component conforming to a specified condition from the determined log information, and constructing any API and the API conforming to the specified condition to obtain a mapping relation corresponding to any API; the appointed condition is that an API call instruction sent by the service component with any API is received.
5. The method according to claim 1, wherein after the service link corresponding to the target service is constructed according to the source device, each target device, and the upstream-downstream relationship of each target device, the method further comprises:
and generating a topological relation diagram of the service link of the target service by taking each device in the service link as a node according to the service link corresponding to the target service.
6. A traffic link determination apparatus, characterized in that it is applied to an electronic device, the apparatus comprising:
the first determining module is used for determining a target API corresponding to the target service to be analyzed; the target API is the first API required to be called when the target service is executed;
The second determining module is used for determining source equipment corresponding to the target API and target equipment corresponding to the target API based on the preset association relation data between the equipment; the preset association relation data between the devices are obtained by analysis based on log information of a target service system, and the association relation data between the devices record communication relations existing between any two devices with association relations and APIs (application program interfaces) needed to be utilized in communication; the source device corresponding to the target API is: and calling the target API to communicate with at least one device, wherein the target device corresponding to the target API is: the source device communicates by calling the target API;
the module to be utilized is used for taking the target API as an API to be utilized;
the first screening module is used for screening equipment meeting preset conditions from downstream equipment of the target equipment based on a preset target mapping relation corresponding to the API to be utilized; the target mapping relation is a mapping relation which is obtained by analysis based on log information of a target service system and is related to the API to be utilized and a designated API, wherein the designated API is an API which is required to be called when equipment deployed by a service component with the API to be utilized realizes the target service; the downstream equipment of the target equipment is: a device that has a communication relationship and that is a data receiving party when communicating, the predetermined condition including: when the target equipment is communicated with, the API utilized by the target equipment is the API in the target mapping relation;
The second screening module is used for taking the reference API corresponding to the screened equipment as an API to be utilized, taking the screened equipment as target equipment, returning to the target mapping relation corresponding to the API to be utilized based on the preset, and screening equipment meeting the preset condition from downstream equipment of the target equipment until the downstream equipment does not exist in the target equipment; wherein, the reference API is: the screened device uses the API of the target device when communicating with the target device;
and the construction module is used for constructing a service link corresponding to the target service according to the source equipment, each target equipment and the upstream-downstream relation of each target equipment.
7. The apparatus of claim 6, wherein the second determining module comprises:
the searching unit is used for searching a device group which has a communication relationship and utilizes a target API in communication based on the association relationship of the devices in the association relationship data between the devices;
a first determining unit, configured to determine, from the found device group, a device that performs communication by calling a device of the target API as a source device corresponding to the target API when performing communication;
And a second determining unit configured to determine, as a target device, devices other than the source device in the found device group.
8. The apparatus of claim 6, wherein the determining the association relationship data between the devices comprises:
determining the designated equipment where the service component is deployed and the designated information corresponding to the service component based on the log information of each service component of the target service system; the specified information corresponding to the service component comprises specified equipment deployed by a target service component with a communication relation with the service component, and an API (application program interface) required to be utilized by the service component and the target service component in communication;
for each service component, determining the designated equipment which is arranged in the service component, the designated equipment recorded in the designated information corresponding to the service component as the designated equipment with the communication relationship, and determining the API in the designated information corresponding to the service component as the API which is required to be utilized by the designated equipment with the communication relationship when the designated equipment with the communication relationship communicates.
9. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
A memory for storing a computer program;
a processor for implementing the method of any of claims 1-5 when executing a program stored on a memory.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311093567.3A CN117240905A (en) | 2023-08-29 | 2023-08-29 | Service link determining method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311093567.3A CN117240905A (en) | 2023-08-29 | 2023-08-29 | Service link determining method and device, electronic equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117240905A true CN117240905A (en) | 2023-12-15 |
Family
ID=89083531
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311093567.3A Pending CN117240905A (en) | 2023-08-29 | 2023-08-29 | Service link determining method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117240905A (en) |
-
2023
- 2023-08-29 CN CN202311093567.3A patent/CN117240905A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10915508B2 (en) | Data linking | |
CN108092979B (en) | Firewall policy processing method and device | |
US6604208B1 (en) | Incremental alarm correlation method and apparatus | |
CN109033471B (en) | Information asset identification method and device | |
CN101772918B (en) | Operation, administration and maintenance (OAM) for chains of services | |
US8732259B2 (en) | Method and apparatus for providing notification of network alarms using a plurality of distributed layers | |
WO2019001312A1 (en) | Method and apparatus for realizing alarm association, and computer readable storage medium | |
CN108733698B (en) | Log message processing method and background service system | |
CN106790131B (en) | Parameter modification method and device and distributed platform | |
CN106203956A (en) | Project management system based on cloud computing | |
CN110334119A (en) | A kind of data correlation processing method, device, equipment and medium | |
CN107171873A (en) | A kind of method and apparatus of Message Processing | |
CN106648722B (en) | Method and device for processing Flume receiving terminal data based on big data | |
JP2006025434A (en) | System and method for high capacity fault correlation | |
Verma et al. | Reliability-based optimal task-allocation in distributed-database management systems | |
CN110609761B (en) | Method and device for determining fault source, storage medium and electronic equipment | |
CN112468400A (en) | Fault positioning method, device, equipment and medium | |
CN115118583B (en) | Log query method and device, electronic equipment and computer readable storage equipment | |
CN117240905A (en) | Service link determining method and device, electronic equipment and storage medium | |
CN115967730A (en) | Data acquisition method and system based on Internet of things | |
CN106959903A (en) | Trap instruction Trap processing method and processing device | |
CN108683533B (en) | Configuration updating method, configuration updating response method, server and system | |
CN112765010A (en) | Method, device, equipment and storage medium for centralized management of service parameters | |
CN113992664A (en) | Cluster communication method, related device and storage medium | |
US20030172154A1 (en) | Data server |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |