CN117640429A - Method, device, equipment and storage medium for calling link sampling - Google Patents

Method, device, equipment and storage medium for calling link sampling Download PDF

Info

Publication number
CN117640429A
CN117640429A CN202311596309.7A CN202311596309A CN117640429A CN 117640429 A CN117640429 A CN 117640429A CN 202311596309 A CN202311596309 A CN 202311596309A CN 117640429 A CN117640429 A CN 117640429A
Authority
CN
China
Prior art keywords
identifier
link
interface
piece
sampling
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
Application number
CN202311596309.7A
Other languages
Chinese (zh)
Inventor
王丛双
吴飞飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
AlipayCom Co ltd
Original Assignee
AlipayCom Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by AlipayCom Co ltd filed Critical AlipayCom Co ltd
Priority to CN202311596309.7A priority Critical patent/CN117640429A/en
Publication of CN117640429A publication Critical patent/CN117640429A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/02Capturing of monitoring data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/133Protocols for remote procedure calls [RPC]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

One or more embodiments of the present specification provide a method, apparatus, device, and storage medium for invoking link sampling. According to the method, by receiving the request information sent by the user side to the first interface, at least one piece of first calling link information can be determined according to the first interface identification and the request information, and then the target link is sampled according to the at least one piece of first calling link information. The first interface is any application programming interface for link sampling management of the link management device; the first interface identifier is the identifier of the first interface, and the first call link information is call link information associated with the target link requested to be called by the user terminal.

Description

Method, device, equipment and storage medium for calling link sampling
Technical Field
One or more embodiments of the present disclosure relate to the field of internet technologies, and in particular, to a method, an apparatus, a device, and a storage medium for sampling a call link.
Background
In a mobile internet application scenario, when different types of request terminals such as a personal computer station, a terminal website, a terminal application and the like communicate with a server, the request terminals are usually required to be implemented by calling an application programming interface (Application Programming Interface, API), and particularly for a complex communication scenario, a communication process between the request terminals and the server often involves a complex API call link, and when different request terminals initiate the same or similar requests to the server, the corresponding API call links may also have differences.
However, in practical applications, many operations such as quality monitoring, security scanning, and communication control are performed based on the API call links between the request end and the service end, so that it is necessary to timely, accurately and comprehensively obtain the API call links associated with various requests for use in various management scenarios.
Disclosure of Invention
In order to obtain more comprehensive information of various request-associated API call links, one or more embodiments of the present disclosure provide a call link sampling method, apparatus, device, and storage medium.
In a first aspect, one or more embodiments of the present disclosure provide a method for invoking link sampling, applied to a link management device, the method comprising: receiving request information sent by a user side to a first interface; the first interface is any application programming interface for carrying out link sampling management on the link management equipment; determining at least one piece of first calling link information according to the first interface identifier and the request information; the first interface identifier is an identifier of the first interface; the first calling link information is calling link information associated with a target link which is requested to be called by the user terminal at this time; and sampling the target link according to the at least one piece of first calling link information.
In a possible implementation manner, the request information includes a first request identifier and a first method identifier; the first request identifier is used for the link management equipment to carry out link tracking identification; the first method identifier is an identifier of a target method requested to be invoked by the user side.
In a possible implementation manner, the determining at least one piece of first call link information according to the first interface identifier and the request information includes: determining at least one application program file and a class and a method respectively packaged by the at least one application program file and a calling sequence among the at least one application program file which are associated in the process of calling the target method according to the directory structure of the project code file, the first interface identifier and the first method identifier which are managed by the link management equipment; determining the at least one piece of first call link information according to the first interface identifier, the first request identifier, the at least one application program file, the class and method of the at least one application program file package and the call sequence; each piece of first calling link information comprises the first interface identifier, the first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of a packaging method.
In a possible implementation manner, the determining at least one piece of first call link information according to the first interface identifier and the request information includes: determining the at least one piece of first calling link information from a pre-established calling link information table according to the first interface identifier, the first request identifier and the first method identifier; each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of an association method; the call link information table comprises at least one piece of second call link information, and each piece of second call link information comprises a second interface identifier, a second request identifier, a second call application identifier, a second called application identifier, a second class name of a second called application identifier associated class and a third method identifier of an associated method.
In a possible implementation manner, the sampling the target link according to the at least one piece of first call link information includes: determining a first quantity, a second quantity and a third quantity corresponding to the first interface identifier and the first request identifier according to the at least one piece of first calling link information; the first number is the number of different second method identifiers corresponding to the at least one piece of first call link information; the second number is the number of different first called application identifiers corresponding to the at least one piece of first calling link information; the third number is the number of different first type names corresponding to the at least one piece of first call link information; and sampling the target link according to the first quantity, the second quantity and the third quantity.
In a possible implementation manner, sampling the target link according to the first number, the second number and the third number includes: acquiring a fourth number, a fifth number and a sixth number; the fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application files associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampling link is a link which corresponds to the first interface and the first request identifier and is already sampled; if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, not sampling the target link; alternatively, if the first number is different from the fourth number, the second number is different from the fifth number, and/or the third number is different from the sixth number, the target link is added to the sampling link of the first interface.
In a second aspect, one or more embodiments of the present disclosure further provide a call link sampling apparatus, applied to a link management device, where the apparatus includes: the receiving module is used for receiving request information sent to the first interface by the user side; the first interface is any application programming interface for carrying out link sampling management on the link management equipment; the determining module is used for determining at least one piece of first calling link information according to the first interface identifier and the request information; the first interface identifier is an identifier of the first interface; the first calling link information is calling link information associated with a target link which is requested to be called by the user terminal at this time; and the sampling module is used for sampling the target link according to the at least one piece of first calling link information.
In a possible implementation manner, the request information includes a first request identifier and a first method identifier; the first request identifier is used for the link management equipment to carry out link tracking identification; the first method identifier is an identifier of a target method requested to be invoked by the user side.
In a possible implementation manner, the determining module determines at least one piece of first call link information according to the first interface identifier and the request information, where the first call link information is used for: determining at least one application program file and a class and a method respectively packaged by the at least one application program file and a calling sequence among the at least one application program file which are associated in the process of calling the target method according to the directory structure of the project code file, the first interface identifier and the first method identifier which are managed by the link management equipment; determining the at least one piece of first call link information according to the first interface identifier, the first request identifier, the at least one application program file, the class and method of the at least one application program file package and the call sequence; each piece of first calling link information comprises the first interface identifier, the first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of a packaging method.
In a possible implementation manner, the determining module determines at least one piece of first call link information according to the first interface identifier and the request information, where the first call link information is used for: determining the at least one piece of first calling link information from a pre-established calling link information table according to the first interface identifier, the first request identifier and the first method identifier; each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of an association method; the call link information table comprises at least one piece of second call link information, and each piece of second call link information comprises a second interface identifier, a second request identifier, a second call application identifier, a second called application identifier, a second class name of a second called application identifier associated class and a third method identifier of an associated method.
In a possible implementation manner, the determining module is further configured to: determining a first quantity, a second quantity and a third quantity corresponding to the first interface identifier and the first request identifier according to the at least one piece of first calling link information; the first number is the number of different second method identifiers corresponding to the at least one piece of first call link information; the second number is the number of different first called application identifiers corresponding to the at least one piece of first calling link information; the third number is the number of different first type names corresponding to the at least one piece of first call link information; the sampling module samples the target link according to the at least one piece of first calling link information, and is used for: and sampling the target link according to the first quantity, the second quantity and the third quantity.
In a possible implementation manner, the sampling module samples the target link according to the first number, the second number and the third number, and is configured to: acquiring a fourth number, a fifth number and a sixth number; the fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application files associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampling link is a link which corresponds to the first interface and the first request identifier and is already sampled; if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, not sampling the target link; alternatively, if the first number is different from the fourth number, the second number is different from the fifth number, and/or the third number is different from the sixth number, the target link is added to the sampling link of the first interface.
In a third aspect, one or more embodiments of the present specification also provide an electronic device including a memory and a processor; the memory is used for storing a computer program product; the processor is configured to execute a computer program product stored in the memory, and when the computer program product is executed, implement the call link sampling method of the first aspect.
In a fourth aspect, one or more embodiments of the present specification further provide a computer readable storage medium storing computer program instructions that, when executed, implement the call link sampling method of the first aspect described above.
In one or more embodiments of the present disclosure, according to request information sent by a user side, at least one piece of call link information associated with a target link that is requested to be called by the user side at this time may be determined; by comparing the at least one piece of call link information with the historical call link information of the user side, whether the target link called by the user side at the time of the request is a new link or not can be determined according to whether the at least one piece of call link information and the historical call link information of the user side are different, and under the condition that the target link is determined to be the new link, the target link is sampled. The whole sampling process is determined based on the information difference between the target link called by the user side and the link called by the history, so that the condition of sampling omission can be effectively reduced, and the sampling result is more reliable.
Drawings
In order to more clearly illustrate the technical solution of one or more embodiments of the present description, the drawings that are required for use in the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of one or more embodiments of the present description, and that other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1a is a flow diagram of a method of invoking link sampling provided in one or more embodiments of the present disclosure;
FIG. 1b is a flow diagram of another call link sampling method provided by one or more embodiments of the present disclosure;
FIG. 2 is a block diagram of a call link sampling apparatus according to one or more embodiments of the present disclosure;
fig. 3 is a block diagram of an electronic device according to one or more embodiments of the present disclosure.
Detailed Description
One or more embodiments of the present specification are described in further detail below with reference to the drawings and examples. Features and advantages of one or more embodiments of the present description will become apparent from the description.
The word "exemplary" is used herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are illustrated in the accompanying drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
In addition, the technical features mentioned in the different implementations of one or more embodiments of the present specification described below may be combined with each other as long as they do not conflict with each other.
In order to facilitate understanding, an application scenario of the technical solution provided in one or more embodiments of the present disclosure is first described below.
With the popularity of micro-service architecture, interactions between applications become more complex, and application programming interfaces (Application Programming Interface, APIs) become the primary way of data transfer and function invocation between different services. However, as service functions become more and more diverse, the complexity of the call links between different services is also increasing, for example, a request often needs to involve multiple services, and the call links between the multiple services are complicated. Therefore, for effective detection and security testing of system quality, it is particularly important for processing of API traffic, especially for effective sampling of coverage of the scheduling link.
Based on this, one or more embodiments of the present disclosure provide a call link sampling method, so as to implement full coverage sampling on an API call link, which provides effective guarantee for system quality detection and security test.
FIG. 1a is a flowchart illustrating a method for invoking link sampling, according to one or more embodiments of the present disclosure, where the method includes:
S102, receiving request information sent by a user side to a first interface, wherein the first interface is any one application programming interface for link sampling management of link management equipment;
s104, determining at least one piece of first calling link information according to the first interface identification and the request information; the first interface identifier is an identifier of the first interface, and the first call link information is call link information associated with a target link requested to be called by the user terminal at this time;
s106, sampling the target link according to at least one piece of first calling link information.
Before describing the processing procedure of calling each step in the link sampling method provided in one or more embodiments of the present specification, a description will be given first of all to an execution body that calls the link sampling method.
In one or more embodiments of the present disclosure, the method for calling link sampling may be applied to a processing device that provides a system service to each user side, and alternatively, the processing device may be a system server, or may be an intermediate device that works with the system server. For example, the intermediate device may be a separate device for performing task scheduling, data management, quality detection, and other auxiliary tasks between the system server and each user terminal. Further optionally, for the system server, one or more embodiments of the present disclosure do not limit the specific form corresponding to the system server, alternatively, the system server may be a separate computer device, or may be a cluster server, a cloud server, any processor in a distributed system, or a control device in the distributed system that is responsible for task distribution, management, and scheduling functions, where the specific form may be determined according to an actual system architecture.
Optionally, for the system server, a plurality of API interfaces for providing system services to each user side may be included, where each user side may send request information to the API interface for providing the corresponding system service in case of a system service call requirement, so as to obtain the corresponding system service from the called API interface. Further alternatively, in the case that an intermediate device is provided between the system server and each user side, when each user side may send request information to a corresponding API interface through the intermediate device, and obtain a corresponding system service from the corresponding API interface through the intermediate device.
In addition, for convenience of description, one or more embodiments of the present disclosure collectively refer to an execution body of the link sampling method as a link management device, regardless of the type of the execution body of the link sampling method and the corresponding mode. It is understood that the link management device is used for performing link management on a plurality of API interfaces included locally in the case of the link management device being a system server, and the link management device is used for performing link management on a plurality of API interfaces in the server device for performing task scheduling, data management, and quality detection in the case of the link management device being an intermediate device.
It should be further noted that, for convenience of explanation, in one or more embodiments of the present disclosure, an API interface requested to be invoked by any user side is referred to as a first interface, where the first interface is any API interface that performs link management by a link management device. Based on the above, when the user side has the system service call requirement, the request information can be sent to the first interface for link management of the link management device, and after the link management device receives the request information sent by the user side, the link management device can determine at least one piece of first call link information according to the first interface identifier and the request information, and sample the target link according to the at least one piece of first call link information.
In one or more implementations of the present disclosure, the type of the first interface and the specific function executed by the first interface are not limited, and the type of the first interface and the specific function executed by the first interface required to be called may be different according to different system service call requirements of the user side; the first interface identifier is an identifier of the first interface, for example, may be an interface name of the first interface, or may be an identifier of another form, so long as the identifier has a one-to-one correspondence with the first interface and can uniquely identify the first interface, which is applicable to the embodiments of the present specification; the first call link information is call link information associated with a target link that is requested to be called by the user terminal, and specific content of the first call link information can be referred to the description of the following embodiments, which is not described in detail herein.
Based on the above, a detailed description will be given below of a process of determining at least one piece of first call link information according to the received request information and sampling the target link according to the at least one piece of first call link information with respect to the link management device.
In one or more embodiments of the present disclosure, the specific content of the request information sent by the user side is not limited, and may be different according to the information required for the first interface to execute the specific function. Optionally, the request information sent by the user side at least includes a first request identifier for identifying the request and a first method identifier of a target method requested to be invoked by the user side; the first request identifier is used for carrying out link tracking identification by the link management equipment so as to determine a target link called by the request of the user side. The specific forms of the first request identifier and the first method identifier can be flexibly selected according to actual requirements, and one or more embodiments of the present specification are not limited. For example, the first request identifier may be a tracking identifier (TraceID), or may be another unique identifier agreed between the user terminal and the link management device; the first method identifier may be a method name of a target method requested to be invoked by the user side, or may be an identifier of another form, and any identifier that has a one-to-one correspondence with the target method and can uniquely identify the target method may be applied to the embodiments of the present disclosure.
In one or more embodiments of the present disclosure, the specific manner in which the link management device determines the at least one piece of first call link information is not limited, and may be different according to different link sampling requirements.
In an actual application scenario, a user side may need to call a plurality of application files in sequence in the process of requesting to call a target method, that is, a target link requested to be called by the user side may be composed of a plurality of application files serving as link nodes, so that a certain call sequence exists among the plurality of application files. Since various types and methods are encapsulated in each application file, the application files and the encapsulated types and methods are encapsulated in the project code managed by the link management device, the directory structure of the project code reflects the calling sequence among a plurality of application files and the belonged relation among the various types and methods in each application file to a certain extent.
Based on this, in an alternative embodiment, after receiving the request information sent by the user side, the link management device may determine, according to the directory structure of the project code, the first interface identifier and the first method identifier, a class and a method in which at least one application file and at least one application file associated in the process of calling the target method are respectively packaged, and a calling sequence between at least one application file. Further, at least one piece of first call link information is determined based on the first interface identifier, the first request identifier, the at least one application file, classes and methods encapsulated in the at least one application file, and a call order between the at least one application file.
In another alternative embodiment, after receiving the request information sent by the user side, the link management device may identify the first request identifier included therein, track, in real time, at least one application program file of the path of the first request identifier, and package class and method in each application program file of the path during the process of calling the target method. Based on this, at least one piece of path information of the path is recorded as at least one piece of first call link information.
In another alternative embodiment, in the development stage of the project code, a call link information table for representing the call sequence may be pre-established for each application program file having a call relationship in the project code, a class and a method encapsulated therein, and a request identifier corresponding to a request of each application end according to specific development requirements. Based on this, the link management device may determine at least one piece of first call link information from the pre-established call link information table according to the first interface identifier, the first request identifier, and the first method identifier after receiving the request information.
Optionally, each piece of first calling link information includes a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class, and a second method identifier of an association method. Accordingly, in such a manner that at least one piece of first calling link information is determined from the pre-established calling link information table, at least one piece of second calling link information may be included in the pre-established calling link information table, and each piece of second calling link information includes a second interface identifier, a second request identifier, a second calling application identifier, a second called application identifier, and a second class name of a second called application identifier association class and a third method identifier of an association method.
It should be noted that, in one or more embodiments of the present disclosure, the specific content of each piece of first call link information is not limited to the specific content of each piece of first call link information, and the specific content of each piece of first call link information may be different according to different link sampling requirements, which is merely illustrative and not limited to the foregoing, and in practical applications, the specific content of each piece of first call link information may be more or less than the foregoing, which is not described in detail herein.
The content of the at least one piece of first invoking link information determined by the link management apparatus is described below in connection with an example.
It is assumed that, in this example, a method name corresponding to a target method requested by a user side is used as a first method identifier, a first interface identifier "/proxy" included in request information sent by the user side, a first request identifier "0be5b18", a method name corresponding to an accessed target method is "order_info", and contents shown in table a are at least one piece of first call link information determined by the link management device.
As shown in table a, two pieces of first call link information are queried from the call link information table according to the first interface identifier "/proxy" and the first request identifier "be5b18", wherein in the first piece of first call link information, "caller_app1" is a call application identifier, "caller_app2" is a called application identifier, "com.alipay.app2. Acass2" is a class name corresponding to a class encapsulated in an application file corresponding to "caller_app2", and "user_info" is a method name corresponding to a method encapsulated in a class corresponding to "com.alipay.cale_app2. Acass2"; in the second piece of first call link information, "caller_app2" is a call application identifier, "caller_app3" is a called application identifier, "com.alipoy.caller_app3.aclass3" is a class name corresponding to a class encapsulated in an application file corresponding to "caller_app3", and "order_info" is a method name corresponding to a method encapsulated in a class corresponding to "com.alipoy.caller_app3.aclass3".
Therefore, the target link called by the user side at this time is associated with three application program files, namely a first file corresponding to 'impeller_app1', a second file corresponding to 'impeller_app2', and a third file corresponding to 'impeller_app3'. Therefore, the calling sequence among the three is that the first file calls the second file, and the second file calls the third file. Specifically, the first file invokes a "user_info" method in the "com.alipay.calie_app3.aclass3" class in the second text; the "user_info" method in the "com.alipay.calee_app3.aclass3" class in the second document recalls the "order_info" method in the "com.alipay.calee_app3.aclass3" class in the third document.
Table A
Based on the above, in the case of determining at least the first call link information, the link management device may sample the target link requested by the user terminal according to at least the first call link information.
It should be noted that, in one or more embodiments of the present disclosure, the specific manner of sampling the target link is not limited, for example, the link management device may mark whether the target link that is called by the current request of the user terminal is a new link or not. Optionally, when determining whether the target link called by the current request of the user terminal is a new link, the link management device may determine, according to at least one piece of first call link information, a first number, a second number, and a third number corresponding to the first interface identifier and the first request identifier; the first number is the number of different second method identifiers corresponding to at least one piece of first call link information; the second number is the number of different first called application program identifiers corresponding to at least one piece of first calling link information; the third number is the number of different first class names corresponding to at least one piece of first calling link information. For example, taking the contents shown in table a as an example, according to the two pieces of call link information corresponding to table a, a first number corresponding to the first interface identifier "/proxy" and the first request identifier "0be5b18" may be determined to be 2, a second number to be 3, and a third number to be 2.
Further, according to the first number, the second number and the third number, the link management device may determine whether the target link called by the current request of the user terminal is a new link, so as to sample the target link. Optionally, when determining whether the target link called by the current request of the user terminal is a new link, the link management device may further obtain a fourth number, a fifth number, and a sixth number corresponding to the first interface identifier and the first request identifier, and determine whether the target link called by the current request of the user terminal is a new link according to the first number, the second number, the third number, and the fourth number, the fifth number, and the sixth number. The fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application identities associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampled link is a link that has been sampled corresponding to the first interface and the first request identification.
Based on the above, if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, which indicates that there are duplicate links in the target link called by the user terminal this time and the link called by the history, it is determined that the target link called by the user terminal this time is not a new link, and the target link is not sampled; correspondingly, if any one of the first quantity, the fourth quantity, the second quantity, the fifth quantity, the third quantity and the sixth quantity is different, which means that the link called by the current request of the user terminal is not in the historically called links, determining that the target link called by the current request of the user terminal is a new link, and adding the target link called by the current request of the user terminal into the sampling link of the first interface.
For example, in one example, the fourth number, the fifth number and the sixth number acquired corresponding to the first interface identifier "/proxy" and the first request identifier "0be5B18" are shown in the first row in the table B, where the fourth number, the fifth number and the sixth number of the history statistics are respectively 2, 3 and 2, which are the same as the first number, the second number and the third number determined based on the table a, and it may be determined that the target link called by the current request of the user terminal is not a new link, and the target link is not sampled.
For another example, the fourth number, the fifth number and the sixth number obtained corresponding to the first interface identifier "/proxy" and the first request identifier "0be5b18" are shown in the first row in the table C, where the fourth number, the fifth number and the sixth number of the history statistics are respectively 2, 2 and 1, the fifth number is different from the second number determined based on the table a, and the sixth number is different from the third number determined based on the table a, which indicates that the user side determines that the request invokes a new application file and a new class. Based on the above, it may be determined that the target link called by the current request of the user terminal is a new link, and sampling needs to be performed on the target link, and then the link management device may add the target link to the sampled link of the first interface.
Table B
Table C
Interface identification Request identification Fourth quantity Fifth quantity Sixth quantity
/proxy 0be5b18 2 2 1
/proxy 0be5b19 12 7 3
Based on the foregoing, the overall flow of invoking a link sampling method provided in one or more embodiments of the present disclosure may be summarized as the flow shown in fig. 1 b.
Referring to fig. 1b, after receiving the request information sent by the user side, the link management device may determine, according to the request information, at least one piece of first call link information associated with the target link that is called by the user side in this time; further, according to at least one piece of first calling link information, whether the first calling link information corresponding to the target link requested to be called at this time is the same as the historical calling link information of the user side or not can be determined; further, under the condition that the different conditions are determined, sampling the target link, otherwise, ending the link sampling operation of the current request.
It should be noted that, for specific details of each step in the flowchart shown in fig. 1b, reference may be made to the description of the corresponding portion in the above embodiment, which is not described in detail herein.
It should be further noted that, each example in one or more embodiments of the present disclosure is merely an exemplary illustration, and the present disclosure is not limited to this in practical application, and the link management device may sample the target link that is requested to be invoked by the user side in other manners, and the specific manner may be determined according to the actual requirement.
Further optionally, after the link management device samples the target link, the link management device may generate corresponding sampling information for the current sampling process, so as to be used for performing quality detection and security test on the system according to the latest sampling information, or performing other operations such as tracking various inter-communication processes in the system. For the specific content of the sampling information, the embodiment of the present disclosure is not limited, and optionally, the sampling information may include at least one piece of first call link information and/or other information, and of course, different sampling information may also be generated according to different call scenarios, and may specifically be determined according to actual requirements.
In one or more embodiments of the present disclosure, according to request information sent by a user side, at least one piece of call link information associated with a target link that is requested to be called by the user side at this time may be determined; by comparing the at least one piece of call link information with the historical call link information of the user side, whether the target link called by the user side at the time of the request is a new link or not can be determined according to whether the at least one piece of call link information and the historical call link information of the user side are different, and under the condition that the target link is determined to be the new link, the target link is sampled. The whole sampling process is determined based on the information difference between the target link called by the user side and the link called by the history, so that the condition of sampling omission can be effectively reduced, and the sampling result is more reliable.
It should be understood that the foregoing embodiments are merely examples, and modifications may be made to the foregoing embodiments in actual implementation, and those skilled in the art may understand that the modification methods of the foregoing embodiments without performing any inventive effort fall within the protection scope of one or more embodiments of the present disclosure, and the embodiments are not repeated herein.
Based on the same inventive concept, one or more embodiments of the present disclosure further provide a call link sampling device, and since the principle of the problem solved by the call link sampling device is similar to that of the call link sampling method, the implementation of the call link sampling device can refer to the implementation of the call link sampling method, and the repetition is omitted.
Referring to fig. 2, fig. 2 is a block diagram illustrating a call link sampling apparatus according to one or more embodiments of the present disclosure. As shown in fig. 2, the call link sampling apparatus 200 may include: a receiving module 201, a determining module 202 and a sampling module 203. Wherein,
the receiving module 201 is configured to receive request information sent by a user side to the first interface; the first interface is any application programming interface for link sampling management of the link management device; the determining module 202 is configured to determine at least one piece of first call link information according to the first interface identifier and the request information; the first interface identifier is an identifier of the first interface; the first calling link information is calling link information associated with a target link requested to be called by the user side at this time; the sampling module 203 is configured to sample the target link according to at least one piece of first call link information.
In one possible implementation, the request information includes a first request identifier and a first method identifier; the first request identifier is used for the link management equipment to carry out link tracking identification; the first method identifier is an identifier of a target method requested to be invoked by the user side.
In a possible implementation manner, the determining module 202 determines at least one piece of first call link information according to the first interface identifier and the request information, where the first call link information is used to: determining at least one application program file and at least one class and method respectively packaged by the application program file and the calling sequence among the application program files which are associated in the process of calling the target method according to the directory structure, the first interface identifier and the first method identifier of the project code file managed by the link management equipment; determining at least one piece of first calling link information according to the first interface identifier, the first request identifier, at least one application program file, the class and method of at least one application program file package and the calling sequence; each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of a packaging method.
In a possible implementation manner, the determining module 202 determines at least one piece of first call link information according to the first interface identifier and the request information, where the first call link information is used to: determining at least one piece of first calling link information from a pre-established calling link information table according to the first interface identifier, the first request identifier and the first method identifier; each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of an association method; the call link information table comprises at least one piece of second call link information, and each piece of second call link information comprises a second interface identifier, a second request identifier, a second call application identifier, a second called application identifier, a second class name of a second called application identifier associated class and a third method identifier of an associated method.
In a possible implementation manner, the determining module 202 is further configured to: determining a first quantity, a second quantity and a third quantity corresponding to the first interface identifier and the first request identifier according to at least one piece of first calling link information; the first number is the number of different second method identifiers corresponding to at least one piece of first call link information; the second number is the number of different first called application identifiers corresponding to at least one piece of first calling link information; the third number is the number of different first class names corresponding to at least one piece of first calling link information; the sampling module 203 samples the target link according to at least one piece of first call link information, and is configured to: the target link is sampled according to the first number, the second number, and the third number.
In a possible implementation manner, the sampling module 203 samples the target link according to the first number, the second number and the third number, and is configured to: acquiring a fourth number, a fifth number and a sixth number; the fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application files associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampling link is a link which corresponds to the first interface and the first request identification and is already sampled; if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, the target link is not sampled; alternatively, if the first number is different from the fourth number, the second number is different from the fifth number, and/or the third number is different from the sixth number, the target link is added to the sampling link of the first interface.
Referring to fig. 3, fig. 3 is a block diagram of an electronic device according to one or more embodiments of the present disclosure. As shown in fig. 3, the electronic device 300 may include a processor 301 and a memory 302; memory 302 may be coupled into processor 301. Notably, this fig. 3 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one possible implementation, the functionality of call link sampling device 400 may be integrated into processor 301. Wherein the processor 301 may be configured to perform the following operations:
receiving request information sent by a user side to a first interface, wherein the first interface is any one application programming interface for link sampling management of link management equipment;
determining at least one piece of first calling link information according to the first interface identification and the request information; the first interface identifier is an identifier of the first interface, and the first call link information is call link information associated with a target link requested to be called by the user terminal at this time;
and sampling the target link according to at least one piece of first calling link information.
In another possible implementation, the call link sampling apparatus 200 may be configured separately from the processor 301, for example, the call link sampling apparatus 200 may be configured as a chip connected to the processor 301, and sampling of the call link is achieved through control of the processor 301.
Furthermore, in some alternative implementations, the electronic device 300 may further include: communication module, input unit, audio processor, display, power etc.. It is noted that the electronic device 300 need not include all of the components shown in fig. 3; in addition, the electronic device 300 may further include components not shown in fig. 3, to which reference is made to the prior art.
In some alternative implementations, the processor 301, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, with the processor 301 receiving inputs and controlling the operation of the various components of the electronic device 300.
The memory 302 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The above-described information related to the invocation of the link sampling device 200 may be stored, and a program for executing the related information may be stored. And the processor 301 may execute the program stored in the memory 302 to realize information storage or processing, etc.
The input unit may provide input to the processor 301. The input unit is for example a key or a touch input device. The power source may be used to provide power to the electronic device 300. The display can be used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 302 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, and the like. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. Memory 302 may also be some other type of device. Memory 302 includes a buffer memory (sometimes referred to as a buffer). The memory 302 may include an application/function storage for storing application programs and function programs or a flow for executing operations of the electronic device 300 by the processor 301.
Memory 302 may also include a data store for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by the electronic device. The driver store of memory 302 may include various drivers for the computer device for communication functions and/or for performing other functions of the computer device (e.g., messaging applications, address book applications, etc.).
The communication module is a transmitter/receiver that transmits and receives signals via an antenna. A communication module (transmitter/receiver) is coupled to the processor 301 to provide an input signal and receive an output signal, which may be the same as in the case of a conventional mobile communication terminal.
Based on different communication technologies, a plurality of communication modules, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same computer device. The communication module (transmitter/receiver) is also coupled to the speaker and microphone via the audio processor to provide audio output via the speaker and to receive audio input from the microphone to implement the usual telecommunications functions. The audio processor may include any suitable buffers, decoders, amplifiers and so forth. In addition, an audio processor is coupled to the processor 301 such that sound can be recorded locally by a microphone and sound stored locally can be played by a speaker.
One or more embodiments of the present disclosure further provide a computer-readable storage medium capable of implementing all steps in the call link sampling method in the above embodiments, where the computer-readable storage medium stores a computer program that, when executed by a processor, implements all steps in the call link sampling method in the above embodiments, for example, the processor implements the following steps when executing the computer program:
receiving request information sent by a user side to a first interface, wherein the first interface is any one application programming interface for link sampling management of link management equipment;
determining at least one piece of first calling link information according to the first interface identification and the request information; the first interface identifier is an identifier of the first interface, and the first call link information is call link information associated with a target link requested to be called by the user terminal at this time;
and sampling the target link according to at least one piece of first calling link information.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive labor. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented by an actual device or client product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment) as shown in the embodiments or figures.
It will be appreciated by those skilled in the art that embodiments of the present description may be provided as a method, apparatus (system) or computer program product. Accordingly, the present specification embodiments may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
One or more embodiments of the present specification are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to one or more embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for apparatus and system embodiments, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the description of method embodiments in part.
In this document, relational terms such as first and second, and the like may be 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. The specific meaning of the terms in one or more embodiments of the present specification may be understood by those of ordinary skill in the art in view of the specific circumstances.
It should be noted that, without conflict, one or more embodiments and features of the embodiments may be combined with each other. The one or more embodiments of the present specification are not limited to any single aspect, nor to any single embodiment, nor to any combination and/or permutation of these aspects and/or embodiments. Moreover, each aspect and/or embodiment of one or more embodiments of the present description may be utilized alone or in combination with one or more other aspects and/or embodiments.
Finally, it should be noted that: the above embodiments are merely for illustrating the technical solution of one or more embodiments of the present disclosure, and are not limiting thereof; while one or more embodiments of the present disclosure have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding embodiments from the scope of the one or more embodiments of the present disclosure, which are intended to be covered by the claims and the scope of the present disclosure.
The foregoing description of one or more embodiments of the present specification has been presented in conjunction with alternative embodiments, but such embodiments are merely exemplary and serve only as illustrations. On the basis of the above, various substitutions and improvements can be made on one or more embodiments of the present specification, and all of them fall within the protection scope of one or more embodiments of the present specification.

Claims (14)

1. A method of invoking link sampling, applied to a link management device, the method comprising:
Receiving request information sent by a user side to a first interface; the first interface is any application programming interface for carrying out link sampling management on the link management equipment;
determining at least one piece of first calling link information according to the first interface identifier and the request information; the first interface identifier is an identifier of the first interface; the first calling link information is calling link information associated with a target link which is requested to be called by the user terminal at this time;
and sampling the target link according to the at least one piece of first calling link information.
2. The method of claim 1, wherein the request information includes a first request identification and a first method identification; the first request identifier is used for the link management equipment to carry out link tracking identification; the first method identifier is an identifier of a target method requested to be invoked by the user side.
3. The method of claim 2, wherein determining at least one piece of first call link information based on the first interface identification and the request information comprises:
determining at least one application program file and a class and a method respectively packaged by the at least one application program file and a calling sequence among the at least one application program file which are associated in the process of calling the target method according to the directory structure of the project code file, the first interface identifier and the first method identifier which are managed by the link management equipment;
Determining the at least one piece of first call link information according to the first interface identifier, the first request identifier, the at least one application program file, the class and method of the at least one application program file package and the call sequence;
each piece of first calling link information comprises the first interface identifier, the first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of a packaging method.
4. The method of claim 2, wherein determining at least one piece of first call link information based on the first interface identification and the request information comprises:
determining the at least one piece of first calling link information from a pre-established calling link information table according to the first interface identifier, the first request identifier and the first method identifier; each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of an association method;
The call link information table comprises at least one piece of second call link information, and each piece of second call link information comprises a second interface identifier, a second request identifier, a second call application identifier, a second called application identifier, a second class name of a second called application identifier associated class and a third method identifier of an associated method.
5. The method according to claim 3 or 4, wherein said sampling said target link according to said at least one piece of first call link information comprises:
determining a first quantity, a second quantity and a third quantity corresponding to the first interface identifier and the first request identifier according to the at least one piece of first calling link information; the first number is the number of different second method identifiers corresponding to the at least one piece of first call link information; the second number is the number of different first called application identifiers corresponding to the at least one piece of first calling link information; the third number is the number of different first type names corresponding to the at least one piece of first call link information;
and sampling the target link according to the first quantity, the second quantity and the third quantity.
6. The method of claim 5, wherein sampling the target link according to the first, second, and third numbers comprises:
acquiring a fourth number, a fifth number and a sixth number; the fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application files associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampling link is a link which corresponds to the first interface and the first request identifier and is already sampled;
if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, not sampling the target link;
or,
the target link is added to the sampling link of the first interface if the first number is different from the fourth number, the second number is different from the fifth number, and/or the third number is different from the sixth number.
7. A call link sampling apparatus for use with a link management device, the apparatus comprising:
The receiving module is used for receiving request information sent to the first interface by the user side; the first interface is any application programming interface for carrying out link sampling management on the link management equipment;
the determining module is used for determining at least one piece of first calling link information according to the first interface identifier and the request information; the first interface identifier is an identifier of the first interface; the first calling link information is calling link information associated with a target link which is requested to be called by the user terminal at this time;
and the sampling module is used for sampling the target link according to the at least one piece of first calling link information.
8. The apparatus of claim 7, wherein the request information comprises a first request identification and a first method identification; the first request identifier is used for the link management equipment to carry out link tracking identification; the first method identifier is an identifier of a target method requested to be invoked by the user side.
9. The apparatus of claim 8, wherein the determining module determines at least one piece of first call link information based on the first interface identification and the request information for:
Determining at least one application program file and a class and a method respectively packaged by the at least one application program file and a calling sequence among the at least one application program file which are associated in the process of calling the target method according to the directory structure of the project code file, the first interface identifier and the first method identifier which are managed by the link management equipment;
determining the at least one piece of first call link information according to the first interface identifier, the first request identifier, the at least one application program file, the class and method of the at least one application program file package and the call sequence;
each piece of first calling link information comprises the first interface identifier, the first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of a packaging method.
10. The apparatus of claim 8, wherein the determining module determines at least one piece of first call link information based on the first interface identification and the request information for:
determining the at least one piece of first calling link information from a pre-established calling link information table according to the first interface identifier, the first request identifier and the first method identifier;
Each piece of first calling link information comprises a first interface identifier, a first request identifier, a first calling application identifier, a first called application identifier, a first class name of a first called application identifier association class and a second method identifier of an association method;
the call link information table comprises at least one piece of second call link information, and each piece of second call link information comprises a second interface identifier, a second request identifier, a second call application identifier, a second called application identifier, a second class name of a second called application identifier associated class and a third method identifier of an associated method.
11. The apparatus of claim 9 or 10, wherein the determining module is further configured to: determining a first quantity, a second quantity and a third quantity corresponding to the first interface identifier and the first request identifier according to the at least one piece of first calling link information;
the first number is the number of different second method identifiers corresponding to the at least one piece of first call link information; the second number is the number of different first called application identifiers corresponding to the at least one piece of first calling link information; the third number is the number of different first type names corresponding to the at least one piece of first call link information;
The sampling module samples the target link according to the at least one piece of first calling link information, and is used for: and sampling the target link according to the first quantity, the second quantity and the third quantity.
12. The apparatus of claim 11, wherein the sampling module samples the target link according to the first number, the second number, and the third number for:
acquiring a fourth number, a fifth number and a sixth number; the fourth number is the number of different method identifications associated with the sampling link; the fifth number is the number of different invoked application files associated with the sampling link; the sixth number is the number of different class names associated with the sampling link; the sampling link is a link which corresponds to the first interface and the first request identifier and is already sampled;
if the first number is the same as the fourth number, the second number is the same as the fifth number, and the third number is the same as the sixth number, not sampling the target link;
or,
the target link is added to the sampling link of the first interface if the first number is different from the fourth number, the second number is different from the fifth number, and/or the third number is different from the sixth number.
13. An electronic device, the electronic device comprising:
a memory for storing a computer program product;
a processor for executing a computer program product stored in said memory, which, when executed, implements the method of any of the preceding claims 1-6.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon computer program instructions, which when executed, implement the method of any of the preceding claims 1-6.
CN202311596309.7A 2023-11-27 2023-11-27 Method, device, equipment and storage medium for calling link sampling Pending CN117640429A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311596309.7A CN117640429A (en) 2023-11-27 2023-11-27 Method, device, equipment and storage medium for calling link sampling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311596309.7A CN117640429A (en) 2023-11-27 2023-11-27 Method, device, equipment and storage medium for calling link sampling

Publications (1)

Publication Number Publication Date
CN117640429A true CN117640429A (en) 2024-03-01

Family

ID=90022850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311596309.7A Pending CN117640429A (en) 2023-11-27 2023-11-27 Method, device, equipment and storage medium for calling link sampling

Country Status (1)

Country Link
CN (1) CN117640429A (en)

Similar Documents

Publication Publication Date Title
CN111784380B (en) Advertisement putting attribution method and device
CN111163130B (en) Network service system and data transmission method thereof
CN110377440B (en) Information processing method and device
CN113254105B (en) Resource processing method and device, storage medium and electronic equipment
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN115516840A (en) Information processing method, device, system, medium, chip and program
CN110310139B (en) Data delivery method and data delivery engine device
CN110543428A (en) Application system testing method and device
CN112328413A (en) Application service calling method, device and system
US20120210306A1 (en) System and Method for Application Testing
US20120102173A1 (en) Method and system for identifying an entity in a mobile device ecosystem
CN111858050A (en) Server cluster mixed deployment method, cluster management node and related system
CN111459822A (en) Method, device and equipment for extracting system component data and readable medium
CN117640429A (en) Method, device, equipment and storage medium for calling link sampling
CN113014650B (en) Processing method and device for data request, computing equipment and medium
CN111225075A (en) Configuration method and device for Internet of things directional access service
CN113986995A (en) Request distribution method and device, storage medium and electronic equipment
CN113709059A (en) Link flow recording method and node
CN109669679B (en) Service detection and processing method and device and electronic equipment
CN111930626A (en) Automatic testing method and device based on PaaS cloud service
CN111262794A (en) Gateway flow control method and device
CN111831530A (en) Test method and device
CN114244830B (en) File gateway application nonfunctional testing method and system
CN111198721A (en) Application program running method and device
CN111966700B (en) Information processing method, system, device and electronic equipment

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