Method, device and equipment for determining incidence relation between application service and resource
By obtaining and analyzing the network packet and process attribute information of the application service, the association relationship between the application service and the resource is automatically determined, and the high cost and low accuracy problems caused by manual tagging in the prior art are solved, and the automated association annotation and Accuracy guarantee.
Patent Information
- Application Number
- CN202411512767.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-14
AI Technical Summary
In the prior art, the association relationship between application services and resources requires manual tagging, which leads to high labor costs and inability to adapt to changes, resulting in poor accuracy of the association relationship.
By obtaining the process attribute information, network address information and network data packets of the application process corresponding to the application service, the network data packet is identified through protocol to determine the network protocol information corresponding to the network data packet; based on process attribute information query, the service corresponding to the application process is determined by determining the service corresponding to the application process based on process attribute information query Package group information; request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on network address information, network protocol information and full resource information; associate and annotate these information, and automatically determine the application service and the The association relationship of the called resource.
It realizes automatic association labeling when the application service calls resources changes, ensuring the accuracy of the association relationship between the application service and the called resources, without manual tagging of jobs, and reducing labor costs.
Smart Images

Figure CN119449896A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a method, apparatus, and device for determining an association relationship between an application service and a resource. Background Art
[0002] With the widespread application of cloud computing and microservice architecture, the calling relationship between application services and resources has become increasingly complex. Application services can be deployed applications, and resources can be callable intermediate resources, such as domain name resources, database resources, etc. For application platforms, effectively recording the relationship between application services and called resources can play an important role in business development, monitoring, and analysis, and provide reference information for subsequent operation and maintenance and cost sharing.
[0003] In the related art, the association relationship between application services and resources needs to be manually marked, which has high labor costs and cannot be adaptively adjusted when the association relationship between application services and resources changes, resulting in poor accuracy of the association relationship, which needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a method, device and equipment for determining the association relationship between application services and resources, which solves the problem in the related art that the association relationship between application services and resources needs to be manually marked, the labor cost is high, and adaptive adjustment cannot be made when the association relationship between the application service and the resource changes, resulting in poor accuracy of the association relationship. Automatic association labeling is achieved to adapt to changes in the application service calling resources, thereby ensuring the accuracy of the association relationship between the application service and the called resources, eliminating the need for manual marking operations and reducing labor costs.
[0005] In a first aspect, an embodiment of the present application provides a method for determining an association relationship between an application service and a resource, the method comprising:
[0006] Obtaining process attribute information, network address information, and network data packets of an application process corresponding to the application service, performing protocol identification on the network data packets, and determining network protocol information corresponding to the network data packets;
[0007] Performing a query based on the process attribute information to determine the service package group information corresponding to the application process;
[0008] Requesting the metadata platform to obtain full resource information, and determining the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resources called by the application service;
[0009] The process attribute information, the network data packet, the service package group information and the resource information are associated and annotated to obtain an association relationship between the application service and the called resources.
[0010] In a second aspect, an embodiment of the present application further provides a device for determining an association relationship between an application service and a resource, the device comprising:
[0011] An acquisition module configured to acquire process attribute information, network address information, and network data packets of an application process corresponding to the application service;
[0012] A protocol identification module, configured to perform protocol identification on the network data packet and determine network protocol information corresponding to the network data packet;
[0013] A service package group determination module, configured to query and determine the service package group information corresponding to the application process based on the process attribute information;
[0014] a request resource determination module, configured to request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resource called by the application service;
[0015] The association marking module is configured to associate and mark the process attribute information, the network data packet, the service package group information and the resource information to obtain the association relationship between the application service and the called resource.
[0016] In a third aspect, an embodiment of the present application further provides a device for determining an association relationship between an application service and a resource, the device comprising:
[0017] one or more processors;
[0018] a storage device configured to store one or more programs,
[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the association relationship between application services and resources described in the embodiment of the present application.
[0020] In a fourth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the method for determining the association relationship between application services and resources described in the embodiment of the present application.
[0021] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor of the device reads and executes the computer program from the computer-readable storage medium, so that the device executes the method for determining the association relationship between application services and resources described in the embodiment of the present application.
[0022] In the embodiment of the present application, by obtaining the process attribute information, network address information and network data packet of the application process corresponding to the application service, the protocol identification of the network data packet is performed to determine the network protocol information corresponding to the network data packet; based on the process attribute information, the service package group information corresponding to the application process is determined by querying; the metadata platform is requested to obtain the full resource information, and the resource information requested by the network data packet is determined according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resources called by the application service; the process attribute information, the network data packet, the service package group information and the resource information are associated and annotated to obtain the association relationship between the application service and the called resources. In the above scheme, by determining the service package group information corresponding to the application process by querying based on the process attribute information, and determining the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, real-time reference information is provided for annotating the application service and the called resources, which can effectively adapt to the changes in the application service calling resources for automatic association annotation, ensure the accuracy of the association relationship between the application service and the called resources, and do not require manual marking operations, thereby reducing labor costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 A flowchart of a method for determining an association relationship between an application service and a resource provided in an embodiment of the present application;
[0024] Figure 2 A flowchart of a method for determining an association relationship including a process of adding a preset primary and secondary relationship between an application service and a resource provided in an embodiment of the present application;
[0025] Figure 3 A flowchart of a method for determining an association relationship including pushing update information of the relationship between application services and resources provided in an embodiment of the present application;
[0026] Figure 4 A flowchart of a method for determining an association relationship including a process for determining service package group information corresponding to an application process provided in an embodiment of the present application;
[0027] Figure 5 A flowchart of a method for determining an association relationship including a process for determining resource information requested by a network data packet provided in an embodiment of the present application;
[0028] Figure 6 A flowchart of a method for determining an association relationship including a process of determining network protocol information corresponding to a network data packet provided in an embodiment of the present application;
[0029] Figure 7 A structural block diagram of a device for determining an association relationship between application services and resources provided in an embodiment of the present application;
[0030] Figure 8 A structural diagram of a device for determining an association relationship between application services and resources provided in an embodiment of the present application. DETAILED DESCRIPTION
[0031] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0032] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0033] The method for determining the association relationship between application services and resources provided in the embodiments of the present application can effectively record the association relationship between application services and the resources called, and make adaptive adjustments when the association between application services and the resources called changes. The method for determining the association relationship between application services and resources can be applied to the operation and maintenance development of a communication service platform based on cloud computing technology and service models, and the embodiments of the present application do not limit this.
[0034] The embodiment of the present application provides a method for determining the association relationship between application services and resources. The executor of each step may be a computer device, which refers to any electronic device with data calculation, processing and storage capabilities, such as a server device, and the embodiment of the present application does not limit this.
[0035] Figure 1 A flowchart of a method for determining an association relationship between an application service and a resource provided in an embodiment of the present application. Figure 1As shown, the following steps are included:
[0036] Step S101: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service, perform protocol identification on the network data packets, and determine network protocol information corresponding to the network data packets.
[0037] Among them, the application service can be a deployed application, and the resource can be a callable intermediate resource, such as a domain name resource, a database resource, etc. The application process can be an instance of an application corresponding to the running application service. In one embodiment, taking the Linux operating system as an example, the eBPF (extended Berkeley Packet Filter) technology can be used to collect real-time information of the application process for sending and receiving network data packets, including process attribute information, network address information, and network data packets. Among them, the process attribute information can be a data set of various characteristics and states related to the application process, such as a process identifier, a container identifier, etc. The network address information can be the relevant address information for the application process to communicate with the network, such as an IP (Internet Protocol) address, a port, etc. Specifically, the developer can pre-write the eBPF program and determine the format of the eBPF program to collect data. The user-state application can load the eBPF program through a system call. During the loading process, the kernel will copy the code of the eBPF program to the kernel space. When running in the kernel, the eBPF program is usually mounted on a kernel hook so that it can be executed when a specific event occurs. For example, the eBPF program can be mounted to a certain location in the network protocol stack so that it can be executed when a network data packet is received. During operation, the eBPF program can access the kernel's data structure and interact with other components through the kernel interface. For example, the eBPF program can capture network packets and forward them to user-mode applications through the kernel interface. Of course, the eBPF technology can be extended to other operating systems that support virtual machine technology and kernel programming interface operations, which is not limited in this application.
[0038] Since network data packets may correspond to different network protocols, for example, BRPC (Baidu Remote Procedure Call) protocol, HTTP (HyperText Transfer Protocol) protocol, Redis (Remote Dictionary Server) protocol, Kafka protocol, MySQL (Structured Query Language) protocol, etc., and different network protocols correspond to different requested resources. Therefore, it is necessary to identify different network protocols for network data packets and determine the network protocol information corresponding to the network data packets. In one embodiment, taking the BRPC protocol as an example, the corresponding network data packet consists of a fixed 12-byte length of header information, metadata information, data information, and multimedia information, wherein the first four bytes in the header information are the characters "PRPC". For example, the process of identifying the BRPC protocol for a network data packet is as follows: First, since the data packet corresponding to the BRPC protocol contains a fixed 12-byte header information, the packet length of the network data packet can be determined. If the packet length of the network data packet is less than 12 bytes, the identification of the BRPC protocol is terminated and the next network protocol identification is entered. If the packet length of the network data packet is greater than or equal to 12 bytes, the identification of whether it is the BRPC protocol continues. Next, the first four bytes of the network data packet can be parsed to see if they are the characters "PRPC". If the first four bytes of the network data packet are not the characters "PRPC", the identification of the BRPC protocol is terminated and the next network protocol identification is entered. If the first four bytes of the network data packet are the characters "PRPC", the identification of whether it is the BRPC protocol continues. Then, the data content of the metadata information is cut according to the predefined length, and it is determined whether the data content contains request content or response content as defined by the BRPC protocol. For example, if the data content contains service_name and method_name, it can be regarded as having request content. For another example, if the data content includes error_code and error_text, it can be regarded as having response content. If the data content contains request content or response content as defined by the BRPC protocol, it is identified as the BRPC protocol. If the data content does not contain request content or response content, it enters the next network protocol identification. Of course, the corresponding protocol identification process can be set according to the protocol characteristics of different network protocols, which is not limited in this application.
[0039] Step S102: query based on the process attribute information to determine the service package group information corresponding to the application process.
[0040] Among them, the service package group information can be the package group name shared by instances of the same application service deployed on different machines, for example, the application name. Since users in the application platform are concerned with maintaining the service package group information and resource information corresponding to the application service, the service package group information corresponding to the application process can be determined by querying using the process attribute information, so that the process attribute information corresponding to the application process can be associated with the service package group information through subsequent association annotation operations. In one embodiment, if there is a process identifier and no container identifier in the process attribute information, the application process corresponds to running on a physical machine, and the service package group information corresponding to the application process can be queried based on the process identifier. In one embodiment, if there are both a process identifier and a container identifier in the process attribute information, the application process corresponds to running on a container, and therefore, determining the service package group information based on the process identifier may be inaccurate, and the service package group information corresponding to the application process can be queried based on the container identifier.
[0041] Step S103: Request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service.
[0042] Among them, the metadata platform can be a PaaS (Platform as a Service) platform, which provides users with a cloud computing form of a complete application software platform, for example, it can be a domain name certificate system, a database system, a cache system, and a message queue system. Different metadata platforms correspond to different full resource information. For example, the domain name certificate system can provide domain name resources, the database system can provide MySQL resources, the cache system can provide Redis resources, and the message queue system can provide Kafka resources. According to the network address information, network protocol information, and full resource information, the resource information requested by the network data packet can be determined corresponding to the resources provided by different metadata platforms. In one embodiment, if the network protocol type of the network data packet is the HTTP protocol, the corresponding full resource information can be a domain name resource, and the resource information is the target domain name information. Specifically, the requested domain name information can be determined based on the host field of the header information in the network data packet, and the validity judgment is performed in combination with the domain name resources provided by the domain name certificate system to determine the target domain name information. In one embodiment, if the network protocol type of the network data packet is the MySQL protocol, and the corresponding full resource information may be a MySQL resource, then the resource information is the target cluster information, and the network address information may be matched with the MySQL resource to determine the target cluster information, wherein the target cluster information may be the name of the cluster, and the cluster may include multiple requestable data nodes. Of course, the aforementioned resource information determination process is only an exemplary description, and the resource information determination process requested by the network data packet may be adjusted to suit different protocol types and the corresponding full resource information, and this application does not limit this.
[0043] Step S104: associate and annotate the process attribute information, network data packet, service package group information and resource information to obtain an association relationship between the application service and the called resources.
[0044] Among them, by associating and marking process attribute information, network data packets, service package group information and resource information, an association relationship between the application service and the called resources can be established. The record form of the association relationship can be a list, a mapping table, etc., which is not limited in this application.
[0045] In the above, by obtaining the process attribute information, network address information and network data packet of the application process corresponding to the application service, the protocol identification of the network data packet is performed to determine the network protocol information corresponding to the network data packet; based on the process attribute information, the service package group information corresponding to the application process is determined by querying; the metadata platform is requested to obtain the full resource information, and the resource information requested by the network data packet is determined according to the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service; the process attribute information, network data packet, service package group information and resource information are associated and annotated to obtain the association relationship between the application service and the called resources. In the above scheme, by determining the service package group information corresponding to the application process by querying based on the process attribute information, and determining the resource information requested by the network data packet according to the network address information, network protocol information and full resource information, real-time reference information is provided for annotating the application service and the called resources, which can effectively adapt to the changes in the application service calling resources for automatic association annotation, ensure the accuracy of the association relationship between the application service and the called resources, and do not require manual marking operations, thereby reducing labor costs.
[0046] Figure 2 A flowchart of a method for determining an association relationship including a process of adding a preset primary and secondary relationship between an application service and a resource provided in an embodiment of the present application. Figure 2 As shown, the following steps are included:
[0047] Step S201: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service, perform protocol identification on the network data packets, and determine network protocol information corresponding to the network data packets.
[0048] Step S202: Query and determine the service package group information corresponding to the application process based on the process attribute information.
[0049] Step S203: Request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service.
[0050] Step S204: associate and annotate the process attribute information, the network data packet, the service package group information, and the resource information to obtain an association relationship between the application service and the called resources.
[0051] Step S205: Aggregate the resource request information corresponding to the network data packet according to a preset time granularity to obtain the request statistics result of the resource called by the application service, and store the request statistics result in a preset database.
[0052] Among them, based on the association relationship obtained in step S204, the requested resource information corresponding to the network data packet can be a representation of the application service's call for resources, for example, it can be an application process requesting domain name resolution, or it can be an application process requesting to call a cluster. The preset time granularity can be adaptively set by the developer according to the update frequency requirements of the association relationship in the actual application scenario, and this application does not limit it here. For example, the preset time granularity can be minutes, and accordingly, the request statistics result can be the total number of times the application service requests to call each resource per minute. By storing the request statistics results in a preset database, it can be beneficial to subsequent data statistics.
[0053] Step S206: When the preset time node is reached, query the preset database for request statistics within the preset time range, and integrate the request statistics according to the preset resource category to obtain a classification result.
[0054] Among them, the preset time node can be determined according to a preset statistical period, for example, every hour, every day, etc. Taking the statistical period of every day as an example, when the preset time node is reached, the preset database can be queried for the request statistics within the time range corresponding to the day, and the request statistics can be the total number of times the application service requests to call each resource within the day. The preset resource categories can be domain name resources, MySQL resources, Redis resources, and Kafka resources, etc. Among them, the domain name information corresponding to the domain name resource is obtained from the called information, and the called information is an external request to the application service, and the cluster information corresponding to the MySQL resources, Redis resources, and Kafka resources is obtained from the main calling information, and the main calling information is the application service actively calling the external resource. The classification result can be the statistical result of the number of times each resource is called by different application services within the preset time range.
[0055] Step S207: adding a preset primary and secondary relationship between the application service and the called resource to the association relationship according to the classification result.
[0056] Among them, the preset primary and secondary relationship can be used to characterize the relationship between the number of calls between the application service and the requested resource. In one embodiment, the preset primary and secondary relationship can be defined as affiliation and dependency, wherein affiliation means that the resource is mainly called by the application service, which is specifically reflected in that within a preset time range, the number of requests from the application service to call the resource accounts for the largest proportion. Dependence means that among the application services that call the resource, except for the application service with the most calls, which is marked as affiliation, the rest are marked as dependencies, which is equivalent to the application service calling the resource, but it is not the service with the most calls. Of course, developers can also define other preset primary and secondary relationships based on the association analysis requirements of actual application scenarios, which is not limited in this application.
[0057] As described above, by adding a preset primary and secondary relationship between the application service and the called resources, it is possible to effectively divide the resources based on the number of application service request calls, accurately distinguish the resources mainly called by the application service, and assist in subsequent operation and maintenance analysis and cost sharing.
[0058] Figure 3 A flowchart of a method for determining an association relationship including pushing update information of the relationship between application services and resources provided in an embodiment of the present application. Figure 3 As shown, the following steps are included:
[0059] Step S301: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service, perform protocol identification on the network data packets, and determine network protocol information corresponding to the network data packets.
[0060] Step S302: Query and determine the service package group information corresponding to the application process based on the process attribute information.
[0061] Step S303: Request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service.
[0062] Step S304: associate and annotate the process attribute information, network data packet, service package group information, and resource information to obtain an association relationship between the application service and the called resources.
[0063] Step S305: Aggregate the resource request information corresponding to the network data packet according to the preset time granularity to obtain the request statistical results of the resources called by the application service, and store the request statistical results in a preset database.
[0064] Step S306: When the preset time node is reached, query the preset database for request statistics within the preset time range, and integrate the request statistics according to the preset resource category to obtain a classification result.
[0065] Step S307: Add the preset primary and secondary relationship between the application service and the called resource to the association relationship according to the classification result.
[0066] Step S308: Request the application management database to obtain the full relationship information and the historical association relationship, and determine the manual modification information according to the full relationship information and the historical association relationship.
[0067] The application management database may be used to record the relationship between the hardware, software, network and resources used by the application, the full relationship information may be all the relationship information recorded in the application management database, and the historical association relationship may be the association relationship between the application service and the called resource determined by the most recent association annotation. The manual modification information may be determined based on the inconsistent data between the full relationship information and the historical association relationship, and the manual modification information may be the relationship data manually modified by the user.
[0068] Step S309: remove the manually modified information from the association relationship to obtain the target association relationship.
[0069] Among them, by removing the manually modified information from the association relationship, the relationship data manually modified by the user can be retained, and this part of the relationship data will not be updated.
[0070] Step S310: Compare the target association relationship with the historical association relationship to determine the relationship update information, and push the relationship update information to the application management database.
[0071] By comparing the target association relationship with the historical association relationship, the changed part of the data can be determined as the relationship update information, and the relationship update information can be pushed to the application management database.
[0072] As described above, by removing the manually modified information from the association relationship to obtain the target association relationship, the relationship data manually modified by the user in the application management database can be reasonably retained, and the user's manual modification results can be respected. By pushing the relationship update information to the application management database, the association relationship between the application service and the called resources can be effectively maintained in the application management database, adapting to the changes in the relationship between the application service and the called resources, and realizing dynamic update of the association relationship.
[0073] Figure 4 A flowchart of a method for determining an association relationship including a process for determining service package group information corresponding to an application process provided by an embodiment of the present application. Figure 4 As shown, the following steps are included:
[0074] Step S401: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service, perform protocol identification on the network data packets, and determine network protocol information corresponding to the network data packets.
[0075] Step S402: Detect whether the process attribute information contains both the process identifier and the container identifier.
[0076] Among them, since the publishing platform may be deployed with both physical machines and containers, where the container is a lightweight virtualization configuration based on process-level isolation, different deployment methods determine the service package group information in different ways. For physical machines, the service package group information can be determined based on the process ID of the application process. For containers, the service package group information can be determined based on the container ID of the application process.
[0077] Step S403: When it is detected that the process attribute information contains a process identifier but does not contain a container identifier, the current publishing directory is obtained.
[0078] Among them, if there is a process identifier but no container identifier in the process attribute information, it can be regarded that the application process is running on a physical machine, and the current publishing directory can be obtained accordingly. The current publishing directory records the service package group information corresponding to the process identifier. For example, the publishing directory can be / data / services / *.
[0079] Step S404: query the current publishing directory based on the process identifier to obtain service package group information corresponding to the application process.
[0080] Among them, by traversing the current release directory, the service package group information corresponding to the process identifier can be queried, that is, the service package group information corresponding to the application process. In one embodiment, the target variable in the release directory can be obtained based on the process identifier traversal, for example, app.name, which records the service package group name. In one embodiment, in order to reduce the impact of data anomalies caused by frequent service restarts, the application process processed in this embodiment can be limited to processes with a survival time of more than 2 minutes.
[0081] Step S405: When it is detected that both the process identifier and the container identifier exist in the process attribute information, a query is performed based on the container identifier to determine the container group identifier corresponding to the container identifier.
[0082] Among them, if the process attribute information contains both the process ID and the container ID, it can be regarded that the application process is running in a container. The corresponding container group ID, such as the pod name, can be first queried based on the container ID, and then the corresponding service package group information can be queried based on the container group ID.
[0083] Step S406: Query based on the container group identifier to determine the service package group information corresponding to the application process.
[0084] Step S407: Request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service.
[0085] Step S408: associate and annotate the process attribute information, network data packet, service package group information, and resource information to obtain an association relationship between the application service and the called resources.
[0086] As described above, based on whether the process identifier and the container identifier exist in the process attribute information at the same time, the operating environment corresponding to the application process can be determined, and appropriate identification information can be selected to query the service package group information, which is conducive to the subsequent accurate association of the process attribute information and the service package group information.
[0087] Figure 5 A flowchart of a method for determining an association relationship including a process for determining resource information requested by a network data packet is provided in an embodiment of the present application. Figure 5 As shown, the following steps are included:
[0088] Step S501: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service, perform protocol identification on the network data packets, and determine network protocol information corresponding to the network data packets.
[0089] Step S502: Query and determine the service package group information corresponding to the application process based on the process attribute information.
[0090] Step S503: Request the metadata platform to obtain full resource information, where the full resource information includes domain name resources and data storage resources.
[0091] Among them, for the domain name certificate system, the full resource information can be domain name resources, and for the data storage system, the full resource information can be data storage resources, among which the data storage system can be a database system, a cache system, a message queue system, etc., and the corresponding full resource information can be MySQL resources, Redis resources, Kafka resources, etc.
[0092] Step S504: When the network protocol type in the network protocol information is a preset transmission protocol, the domain name information in the network protocol information is filtered based on the domain name resource to obtain the target domain name information corresponding to the network data packet.
[0093] The preset transmission protocol may be HTTP protocol, DNS protocol, etc. By checking whether the domain name information exists in the domain name resource, it is possible to verify whether the domain name information is registered in the domain name certificate system, thereby determining the validity of the domain name information, eliminating invalid domain names, and obtaining the target domain name information.
[0094] Step S505: When the network protocol type in the network protocol information is a preset communication protocol, extract the target cluster information corresponding to the network data packet from the data storage resource based on the network address information.
[0095] Among them, the preset communication protocol can be MySQL protocol, Redis protocol or Kafka protocol, etc. In one embodiment, the network protocol type is MySQL protocol or Redis protocol, and the IP address information and port information in the network address information can be first converted into all internal and external network IP information, and the target cluster information corresponding to the network data packet is extracted from the data storage resource based on the internal and external network IP information, for example, the target cluster name. In one embodiment, the network protocol type is Kafka protocol. Since Kafka clusters are often deployed in a hybrid manner, in addition to extracting the target cluster information corresponding to the network data packet from the data storage resource based on the network address information, the topic information requested by the network data packet can also be extracted.
[0096] Step S506: associate and annotate the process attribute information, the network data packet, the service package group information, and the resource information to obtain an association relationship between the application service and the called resources.
[0097] As described above, by determining the resource information requested by the network data packet corresponding to different network protocol types, the target domain name information or target cluster information corresponding to the network data packet can be effectively matched, which is conducive to accurately marking each resource called by the application service.
[0098] Figure 6 A flowchart of a method for determining an association relationship including a process of determining network protocol information corresponding to a network data packet provided by an embodiment of the present application. Figure 6 As shown, the following steps are included:
[0099] Step S601: Obtain process attribute information, network address information, and network data packets of an application process corresponding to an application service.
[0100] Step S602: parse the network data packet according to the set protocol identification sequence and protocol feature information to determine the network protocol information corresponding to the network data packet.
[0101] Among them, the protocol identification of each network data packet can be performed in sequence according to the set protocol identification order until the definition of a certain protocol is met, thereby determining the network protocol type corresponding to the network data packet. In one embodiment, the protocol identification order can be HTTP protocol, BRPC protocol, MySQL protocol, Redis protocol, Kafka protocol and DNS protocol in sequence, and the protocol sequence in the protocol identification order can be set based on the cumulative identification number of different protocols in historical statistics, wherein the more the cumulative identification number, the more priority the corresponding protocol is identified. In this way, the number of matches of useless protocols can be reduced and the efficiency of protocol identification can be improved. The protocol feature information can be a predefined feature corresponding to different protocols, which is used to quickly identify whether the network data packet meets the match of a certain protocol. In one embodiment, taking the identification of the BRPC protocol as an example, the packet length of the network data packet must be greater than or equal to 12 bytes, and the first 4 bytes must be the characters "PRPC". If the network data packet to be identified does not meet the aforementioned characteristics, it can quickly enter the identification of the next protocol without continuing to parse the content, thereby shortening the protocol identification time.
[0102] Step S603: Query and determine the service package group information corresponding to the application process based on the process attribute information.
[0103] Step S604: Request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet based on the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service.
[0104] Step S605: associate and annotate the process attribute information, network data packet, service package group information and resource information to obtain an association relationship between the application service and the called resources.
[0105] As described above, by presetting the protocol identification sequence and the protocol feature information, it is helpful to reduce the number of matches of useless protocols, shorten the protocol identification time, and improve the efficiency of protocol identification.
[0106] Figure 7 This is a structural block diagram of a device for determining the association relationship between application services and resources provided in an embodiment of the present application. The device is configured to execute the method for determining the association relationship between application services and resources provided in the above embodiment, and has functional modules and beneficial effects corresponding to the execution method. Figure 7 As shown, the device comprises:
[0107] The acquisition module 101 is configured to acquire process attribute information, network address information, and network data packets of the application process corresponding to the application service;
[0108] The protocol identification module 102 is configured to perform protocol identification on the network data packet and determine the network protocol information corresponding to the network data packet;
[0109] The service package group determination module 103 is configured to query and determine the service package group information corresponding to the application process based on the process attribute information;
[0110] The request resource determination module 104 is configured to request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resource called by the application service;
[0111] The association marking module 105 is configured to associate and mark the process attribute information, network data packet, service package group information and resource information to obtain the association relationship between the application service and the called resource.
[0112] In the above, by obtaining the process attribute information, network address information and network data packet of the application process corresponding to the application service, the protocol identification of the network data packet is performed to determine the network protocol information corresponding to the network data packet; based on the process attribute information, the service package group information corresponding to the application process is determined by querying; the metadata platform is requested to obtain the full resource information, and the resource information requested by the network data packet is determined according to the network address information, network protocol information and full resource information, wherein the resource information represents the resources called by the application service; the process attribute information, network data packet, service package group information and resource information are associated and annotated to obtain the association relationship between the application service and the called resources. In the above scheme, by determining the service package group information corresponding to the application process by querying based on the process attribute information, and determining the resource information requested by the network data packet according to the network address information, network protocol information and full resource information, real-time reference information is provided for annotating the application service and the called resources, which can effectively adapt to the changes in the application service calling resources for automatic association annotation, ensure the accuracy of the association relationship between the application service and the called resources, and do not require manual marking operations, thereby reducing labor costs.
[0113] In a possible embodiment, it further includes a primary-secondary relationship adding module configured to:
[0114] Aggregate the request resource information corresponding to the network data packet according to the preset time granularity, obtain the request statistical results of the resources called by the application service, and store the request statistical results in a preset database;
[0115] When a preset time node is reached, the preset database is queried for request statistics within the preset time range, and the request statistics are integrated according to the preset resource categories to obtain classification results;
[0116] According to the classification results, the preset primary and secondary relationships between the application service and the called resources are added to the association relationship.
[0117] In a possible embodiment, it further includes an update information push module configured as follows:
[0118] Request the application management database to obtain the full relationship information and the historical association relationship, and determine the manual modification information based on the full relationship information and the historical association relationship;
[0119] The manually modified information is removed from the association relationship to obtain the target association relationship;
[0120] The target association relationship is compared with the historical association relationship to determine the relationship update information, and the relationship update information is pushed to the application management database.
[0121] In a possible embodiment, the service package group determination module 103 is further configured to:
[0122] Detect whether the process ID and the container ID exist in the process attribute information at the same time;
[0123] When it is detected that the process attribute information contains a process identifier and does not contain a container identifier, the current publishing directory is obtained;
[0124] Based on the process ID, the current release directory is queried to obtain the service package group information corresponding to the application process.
[0125] In a possible embodiment, the service package group determination module 103 is further configured to:
[0126] When it is detected that both the process identifier and the container identifier exist in the process attribute information, a query is performed based on the container identifier to determine the container group identifier corresponding to the container identifier;
[0127] The service package group information corresponding to the application process is determined by querying based on the container group identifier.
[0128] In a possible embodiment, the full resource information includes domain name resources, the resource information includes target domain name information, and the request resource determination module 104 is configured as follows:
[0129] In the case where the network protocol type in the network protocol information is a preset transmission protocol, the domain name information in the network protocol information is filtered based on the domain name resource to obtain the target domain name information corresponding to the network data packet.
[0130] In a possible embodiment, the full resource information further includes data storage resources, and the resource information further includes target cluster information. The request resource determination module 104 is further configured to:
[0131] When the network protocol type in the network protocol information is a preset communication protocol, target cluster information corresponding to the network data packet is extracted from the data storage resource based on the network address information.
[0132] In a possible embodiment, the protocol identification module 102 is further configured to:
[0133] According to the set protocol identification order and protocol feature information, the network data packet is content parsed to determine the network protocol information corresponding to the network data packet.
[0134] Figure 8 A schematic diagram of a device for determining an association relationship between an application service and a resource provided in an embodiment of the present application, such as Figure 8 As shown, the device includes a processor 201, a memory 202, an input device 203 and an output device 204; the number of processors 201 in the device can be one or more. Figure 8 A processor 201 is taken as an example; the processor 201, memory 202, input device 203 and output device 204 in the device can be connected by a bus or other means. Figure 8 The example of connection via a bus is taken. The memory 202, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the method for determining the association relationship between application services and resources in the embodiment of the present application. The processor 201 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 202, that is, implements the above-mentioned method for determining the association relationship between application services and resources. The input device 203 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
[0135] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a method for determining an association relationship between an application service and a resource described in the above embodiment, which includes: obtaining process attribute information, network address information, and network data packets of an application process corresponding to the application service, performing protocol identification on the network data packets, and determining the network protocol information corresponding to the network data packets; performing a query based on the process attribute information to determine the service package group information corresponding to the application process; requesting a metadata platform to obtain full resource information, and determining the resource information requested by the network data packet based on the network address information, the network protocol information, and the full resource information, wherein the resource information represents the resources called by the application service; and associating and annotating the process attribute information, the network data packet, the service package group information, and the resource information to obtain the association relationship between the application service and the called resources.
[0136] It is worth noting that in the embodiment of the above-mentioned device for determining the association relationship between application services and resources, the various units and modules included are divided only according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0137] In some possible implementations, various aspects of the method provided in this application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is configured to enable the computer device to execute the steps of the method according to various exemplary embodiments of the present application described above in this specification. For example, the computer device may execute the method for determining the association relationship between application services and resources recorded in the embodiments of this application. The program product may be implemented in any combination of one or more readable media.
Claims
1. A method for determining the association relationship between application services and resources, characterized in that: include: Obtaining process attribute information, network address information, and network data packets of an application process corresponding to the application service, performing protocol identification on the network data packets, and determining network protocol information corresponding to the network data packets; Performing a query based on the process attribute information to determine the service package group information corresponding to the application process; Requesting the metadata platform to obtain full resource information, and determining the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resources called by the application service; The process attribute information, the network data packet, the service package group information and the resource information are associated and annotated to obtain an association relationship between the application service and the called resources.
2. The method for determining the association relationship between application services and resources according to claim 1, characterized in that: After obtaining the association relationship between the application service and the called resource, the method further includes: Aggregating the resource request information corresponding to the network data packet according to a preset time granularity to obtain a request statistical result of the resource called by the application service, and storing the request statistical result in a preset database; When a preset time node is reached, query the preset database for request statistics within a preset time range, and integrate the request statistics according to preset resource categories to obtain a classification result; The preset primary and secondary relationship between the application service and the called resource is added to the association relationship according to the classification result.
3. The method for determining the association relationship between application services and resources according to claim 2, characterized in that: After adding the preset primary and secondary relationship between the application service and the called resource in the association relationship according to the classification result, the method further includes: Requesting the application management database to obtain full relationship information and historical association relationship, and determining the manual modification information according to the full relationship information and the historical association relationship; Eliminating the manually modified information from the association relationship to obtain a target association relationship; The target association relationship is compared with the historical association relationship to determine the relationship update information, and the relationship update information is pushed to the application management database.
4. The method for determining the association relationship between application services and resources according to claim 1, characterized in that: The querying based on the process attribute information to determine the service package group information corresponding to the application process includes: Detecting whether the process attribute information contains both a process identifier and a container identifier; When it is detected that the process attribute information contains a process identifier but does not contain a container identifier, obtaining a current publishing directory; The current publishing directory is queried based on the process identifier to obtain service package group information corresponding to the application process.
5. The method for determining the association relationship between application services and resources according to claim 4, characterized in that: Also includes: When it is detected that both the process identifier and the container identifier exist in the process attribute information, querying based on the container identifier to determine the container group identifier corresponding to the container identifier; The service package group information corresponding to the application process is determined by querying based on the container group identifier.
6. The method for determining the association relationship between application services and resources according to claim 1, characterized in that: The full resource information includes a domain name resource, the resource information includes target domain name information, and determining the resource information requested by the network data packet according to the network address information, the network protocol information, and the full resource information includes: In the case where the network protocol type in the network protocol information is a preset transmission protocol, the domain name information in the network protocol information is filtered based on the domain name resource to obtain the target domain name information corresponding to the network data packet.
7. The method for determining the association relationship between application services and resources according to claim 6, characterized in that: The full resource information also includes data storage resources, the resource information also includes target cluster information, and the method further includes: In a case where the network protocol type in the network protocol information is a preset communication protocol, the target cluster information corresponding to the network data packet is extracted from the data storage resource based on the network address information.
8. The method for determining the association relationship between application services and resources according to claim 1, characterized in that: The performing protocol identification on the network data packet to determine the network protocol information corresponding to the network data packet includes: According to the set protocol identification sequence and protocol feature information, the network data packet is content parsed to determine the network protocol information corresponding to the network data packet.
9. A device for determining the association relationship between application services and resources, characterized in that: include: An acquisition module configured to acquire process attribute information, network address information, and network data packets of an application process corresponding to the application service; A protocol identification module, configured to perform protocol identification on the network data packet and determine network protocol information corresponding to the network data packet; A service package group determination module, configured to query and determine the service package group information corresponding to the application process based on the process attribute information; a request resource determination module, configured to request the metadata platform to obtain full resource information, and determine the resource information requested by the network data packet according to the network address information, the network protocol information and the full resource information, wherein the resource information represents the resource called by the application service; The association marking module is configured to associate and mark the process attribute information, the network data packet, the service package group information and the resource information to obtain the association relationship between the application service and the called resource.
10. A device for determining an association relationship between an application service and a resource, the device comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the method for determining the association relationship between application services and resources described in any one of claims 1-8.
11. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the method for determining an association relationship between an application service and a resource according to any one of claims 1 to 8 when executed by a computer processor.
12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method for determining the association relationship between application services and resources described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Method, apparatus and device for determining association relationship between application service and resource
WO2026092259A1