Traffic interception method and device, electronic equipment and storage medium

By injecting traffic identification and interception logic into the access service framework of the application node and the bytecode of the external call client, the problem of distinguishing between voltage measurement traffic and business traffic in the bank application system is solved, and external call interception is realized, avoiding the intrusion of business source code.

CN119720200APending Publication Date: 2025-03-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411880318.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When stress testing is carried out in the production environment of bank application systems, it is difficult for the existing technology to accurately distinguish pressure measurement traffic from business traffic, resulting in pressure measurement traffic being called outward system, affecting the performance of the external system.

Method used

By injecting traffic identification logic code into the original bytecode of the access service framework of the application node and injecting traffic intercept logic code into the original bytecode of the external call client, external calls under the application requested traffic are identified and intercepted.

Benefits of technology

It realizes the accurate distinction between pressure measurement traffic and business traffic, and effectively intercepts external calls to pressure measurement traffic, avoids intrusion of business source code and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119720200A_ABST
    Figure CN119720200A_ABST
Patent Text Reader

Abstract

The invention discloses a traffic interception method and device, electronic equipment and a storage medium, and relates to the technical field of financial science and technology. The method comprises the following steps: injecting a traffic identification logic code into an original byte code of an access service framework of an application node, and enabling the traffic identification logic code to take effect; injecting a traffic interception logic code into an original byte code of an external calling client of the application node, and enabling the traffic interception logic code to take effect; after the application request traffic is received through the access service framework, identifying the traffic type of the application request traffic by executing the traffic identification logic code; and when the application request traffic is processed and external calling is generated, determining whether to intercept the external calling under the application request traffic according to the traffic type by executing the traffic interception logic code. By adopting the scheme of the invention, the application request traffic can be effectively intercepted under the condition that the service source code of the application node is not invaded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of financial technology, and in particular to a traffic interception method, device, electronic device and storage medium. Background Art

[0002] When implementing stress testing for bank application systems in a production environment, stress testing traffic and business traffic will be processed by the same application nodes because the application nodes in the production environment are reused. When an application node calls an external system, it is necessary to accurately distinguish between stress testing traffic and business traffic, and intercept external calls under stress testing traffic to prevent stress testing traffic from calling external systems.

[0003] At present, the commonly used traffic interception method is to modify the application business source code in a hard-coded form, such as adding interception logic in the application business source code. However, this method has certain shortcomings: modifying the application business source code is highly invasive to the original business logic. Therefore, a new traffic interception method is urgently needed. Summary of the invention

[0004] The present invention provides a flow interception method, device, electronic equipment, storage medium and computer program product.

[0005] According to one aspect of the present invention, there is provided a traffic interception method, comprising:

[0006] Injecting the traffic identification logic code into the original bytecode of the access service framework of the application node and making the traffic identification logic code effective;

[0007] Inject the traffic interception logic code into the original bytecode of the external call client of the application node, and make the traffic interception logic code effective;

[0008] After receiving the application request traffic through the access service framework, identifying the traffic type of the application request traffic by executing the traffic identification logic code;

[0009] When processing application request traffic and generating external calls, the traffic interception logic code is executed to determine whether to intercept the external calls under the application request traffic according to the traffic type.

[0010] According to another aspect of the present invention, there is provided a flow interception device, comprising:

[0011] A first injection module is used to inject the traffic identification logic code into the original bytecode of the access service framework of the application node, and make the traffic identification logic code effective;

[0012] The second injection module is used to inject the traffic interception logic code into the original bytecode of the application node for externally calling the client, and make the traffic interception logic code effective;

[0013] A traffic type identification module, used to identify the traffic type of the application request traffic by executing the traffic identification logic code after receiving the application request traffic through the access service framework;

[0014] The traffic interception module is used to determine whether to intercept the external call under the application request traffic according to the traffic type by executing the traffic interception logic code when processing the application request traffic and generating external calls.

[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0016] at least one processor; and

[0017] a memory communicatively connected to at least one processor; wherein,

[0018] The memory stores a computer program that can be executed by at least one processor, and the computer program is executed by at least one processor so that the at least one processor can execute the traffic interception method of the embodiment of the present invention.

[0019] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the traffic interception method of an embodiment of the present invention when executed by a processor.

[0020] According to another aspect of the present invention, a computer program product is provided, comprising a computer program, and when the computer program is executed by a processor, the steps in the above method are implemented.

[0021] The technical solution of the embodiment of the present invention injects the traffic identification logic into the original bytecode of the access service framework and injects the traffic interception logic into the original bytecode of the external call client through the bytecode enhancement technology, and then intercepts the external call under the application request traffic through the traffic identification logic and traffic interception logic. Compared with the existing traffic interception method, the solution of the present invention only modifies the bytecode level, and does not modify the business source code of the application node, which can effectively avoid the intrusion of the business source code.

[0022] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0024] Figure 1 It is a flow chart of a flow interception method provided by an embodiment of the present invention;

[0025] Figure 2a It is a flowchart of another traffic interception method provided by an embodiment of the present invention;

[0026] Figure 2b It is a diagram of the components involved in the flow interception and the process of flow interception provided by an embodiment of the present invention;

[0027] Figure 3 It is a timing logic diagram of a traffic interception method provided by an embodiment of the present invention;

[0028] Figure 4 It is a structural schematic diagram of a flow interception device provided by an embodiment of the present invention;

[0029] Figure 5 It is a structural schematic diagram of an electronic device for implementing the traffic interception method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0031] Embodiment 1

[0032] Figure 1 A flow chart of a traffic interception method is provided for an embodiment of the present invention. This embodiment can be applied to the situation where external calls under test traffic are intercepted in an application system testing scenario. The method can be executed by a traffic interception device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device.

[0033] like Figure 1 As shown, the traffic interception method includes:

[0034] S101. Inject the traffic identification logic code into the original bytecode of the access service framework of the application node, and make the traffic identification logic code effective.

[0035] In a distributed application system, the application is divided into multiple independent parts, each of which is deployed in a different server or container. Each independent part is an application node, and each application node can assume a specific function.

[0036] The access service framework is a functional framework integrated in the application node. The access service framework is an optional software architecture component that provides a standardized way to access or use the application node, that is, the application node can receive application request traffic sent by external devices through the access service framework.

[0037] Bytecode is a compiled binary file consisting of code and data for implementing the operation of specific software. The original bytecode of the access service framework in the present invention refers to the binary bytecode obtained by compiling the source code of the access service framework.

[0038] The traffic identification logic code is a section of program code used to distinguish different types of traffic. For example, the traffic identification logic code may be composed of a section of pseudo code.

[0039] In an optional implementation, the flow identification logic code can be injected into the original bytecode of the access service framework of the application node through the stub technology. The stub technology refers to the technology of inserting additional code fragments into the original bytecode of the access service framework by means of bytecode enhancement; and bytecode enhancement refers to the method of transforming the bytecode file to generate a new bytecode file. Therefore, in the present invention, the flow identification logic code is injected into the original bytecode of the access service framework, which is actually a modification of the binary original bytecode without invading the business source code of the application node.

[0040] After the traffic identification logic code is injected into the original bytecode of the access service framework of the application node, the modified original bytecode of the access service framework needs to be reloaded so that the traffic identification logic code can take effect.

[0041] S102: Inject the traffic interception logic code into the original bytecode of the application node for externally calling the client, and make the traffic interception logic code effective.

[0042] In an embodiment of the present invention, the external call client of the application node is a key tool for the application node to establish a connection with an external system or service, and the external call is implemented by executing the relevant call method through the external call client. The external call client may include at least one of the following: a hypertext transfer protocol client (i.e., http client), a remote procedure call protocol client (i.e., RPC client), and a message client. Different external call clients implement external calls by executing different call methods. The original bytecode of the external call client is a binary bytecode obtained by compiling the source code of the external call client. The traffic interception logic code is a program code for determining whether to intercept external calls under different application request flows; the traffic interception logic code may be composed of a pseudocode.

[0043] In the embodiment of the present invention, if there are multiple external call clients integrated in the application node, the flow interception logic code can be injected into the original bytecode of each external call client of the application node through the stub technology. Then, for each external call client, the modified original bytecode of each external call client can be reloaded to make the flow interception logic code effective.

[0044] S103: After receiving the application request traffic through the access service framework, identify the traffic type of the application request traffic by executing the traffic identification logic code.

[0045] In the application stress test scenario, the types of application request traffic received by the application node through the access service framework may include normal business traffic and stress test traffic (i.e., test traffic). In the application stress test scenario, stress test traffic is usually generated to test the performance of the application under high load. It is characterized by a large number of requests and a high frequency. If the stress test traffic calls the external system uncontrollably, it may cause the load of the external system to far exceed its normal processing capacity, thereby causing the external system to experience performance degradation, response delay, or even crash. Therefore, it is necessary to intercept external calls under the application request traffic of the type belonging to the stress test traffic. To accurately intercept, it is necessary to identify the traffic type of each application request traffic. In the scheme of the present invention, after receiving the application request traffic by accessing the service framework, the traffic type of the application request traffic (e.g., normal business traffic, stress test traffic) is identified by executing the traffic identification logic code. Optionally, by executing the traffic identification logic code, key field information (e.g., request header information, request source IP address, etc.) is obtained from the application request traffic, and then the traffic type of the application request traffic is determined according to the key field information. For example, after obtaining the request source IP address of the application request traffic, it is possible to determine whether the request source IP address is within the preset IP address range of normal business traffic. If so, the traffic type is determined to be normal business traffic, otherwise it is stress testing traffic.

[0046] S104: When processing application request traffic and generating external calls, determine whether to intercept external calls under the application request traffic according to the traffic type by executing the traffic interception logic code.

[0047] In the embodiment of the present invention, after the application node receives the application request traffic through the access service framework and determines the traffic type, it starts to process the application request traffic according to the specific business logic. During the processing, if an external call is generated, the traffic interception logic code can be executed first to determine whether to intercept the external call under the application request traffic according to the traffic type. For example, if the traffic type is stress testing traffic, the external call under the application request traffic is intercepted; if the traffic type is normal business traffic, the external system call is implemented by executing the corresponding external call method through the external call client.

[0048] In the embodiment of the present invention, the flow identification logic is injected into the original bytecode of the access service framework through the bytecode enhancement technology, and the flow interception logic is injected into the original bytecode of the external call client, and then the external call under the application request flow is intercepted through the flow identification logic and the flow interception logic. Compared with the existing flow interception method, the solution of the present invention only modifies the bytecode level, and does not modify the business source code of the application node, which can effectively avoid the intrusion of the business source code.

[0049] Embodiment 2

[0050] Figure 2a A flow chart of a traffic interception method is provided for an embodiment of the present invention. Figure 2a , the method comprises the following steps:

[0051] S201. Connect a traffic interception probe to an application node, and use the traffic interception probe to pull traffic identification logic code and traffic interception logic code for the application node from a configuration center.

[0052] In order to implement the traffic interception method of the present invention, a configuration center and a traffic interception probe are pre-built. Among them, the configuration center is responsible for managing the addition, maintenance and issuance of traffic interception strategies (such as traffic identification logic code and traffic interception logic code), and provides configuration management related interfaces for application developers to call and set traffic interception strategies; the configuration center also provides a policy pull interface for the traffic interception probe to pull strategies; the traffic interception probe docks with the application node, pulls the traffic interception strategy from the configuration center, and uses bytecode enhancement technology to implement the traffic identification logic plug-in under the access service framework (that is, inject the traffic identification logic code into the original bytecode of the access service framework), and at the same time implements the traffic interception logic plug-in for external calls to the client (that is, inject the traffic interception logic code into the original bytecode of the external call to the client).

[0053] S202. By using a traffic interception probe and a plugging technique, a traffic identification logic code is injected into the original bytecode of the access service framework of the application node.

[0054] In an optional implementation, a flow interception probe is used to employ the plugging technology to determine the first target location of the method for processing application request traffic from the original bytecode of the access service framework; wherein the first target location is the location where the flow identification logic code needs to be inserted; according to the first target location, the flow identification logic code is injected into the original bytecode of the access service framework, so that after the subsequent application node receives the application request traffic through the access service framework, it first identifies the traffic type of the application request traffic and then processes the application request traffic. It can be understood that, by employing the flow interception probe and employing the plugging technology to automatically identify the location in the original bytecode where the flow identification logic code needs to be inserted, the injection efficiency of the flow identification logic code can be improved compared to manually determining the insertion location.

[0055] S203. The flow identification logic code is made effective by reloading the original bytecode injected into the flow identification logic code.

[0056] In an embodiment of the present invention, the original bytecode of the access service framework is modified through step S202, and the modified original bytecode can be reloaded through the class loader, so that the newly added traffic identification logic code in the original bytecode can take effect, so as to facilitate subsequent traffic identification.

[0057] S204. Using the traffic interception probe and the plugging technology, the traffic interception logic code is injected into the original bytecode of the application node's external call client.

[0058] In an optional implementation, a flow interception probe is used to use the plugging technology to determine the second target location where the calling method is located in the original bytecode of the external call client of the application node; wherein the second target location is the location where the flow interception logic code needs to be injected, and the external call client is at least one of the hypertext transfer protocol client, the remote procedure call protocol client, and the message client; it should be noted that the calling methods of different clients are different, so that the second target location determined for the original bytecode of different external call clients is different. Then, according to the second target location, the flow interception logic code is injected into the original bytecode of the external call client, so that when the subsequent application node processes the application request traffic and generates an external call, the flow interception logic code can be executed first, and then it is determined whether to continue to execute the external call according to the interception result. It can be understood that, through the flow interception probe, the plugging technology is used to automatically identify the location where the flow interception logic code needs to be inserted in the original bytecode, which can improve the injection efficiency of the flow interception logic code compared to manually determining the insertion position.

[0059] S205. The traffic interception logic code is made effective by reloading the original bytecode injected into the traffic interception logic code.

[0060] In an embodiment of the present invention, after the original bytecode for externally calling the client is modified through step S204, the modified original bytecode can be reloaded through the class loader so that the newly added traffic interception logic code in the original bytecode can take effect, so as to facilitate subsequent traffic interception.

[0061] S206: After receiving the application request traffic through the access service framework, identify the traffic type of the application request traffic by executing the traffic identification logic code.

[0062] In an optional implementation, after receiving the application request traffic through the access service framework, the key field information included in the application request traffic is parsed by executing the traffic identification logic code; wherein the key field information may include request header information or request source IP address, etc.; according to the key field information, the traffic type of the application request traffic is identified and recorded in the form of type context; wherein the traffic type includes normal business traffic and stress test traffic. It can be understood that the traffic type can be accurately distinguished according to the key field information of the application request traffic.

[0063] S207: When processing application request traffic and generating external calls, determine whether to intercept external calls under the application request traffic according to the traffic type by executing the traffic interception logic code.

[0064] In an optional implementation, when the application node processes the application request traffic and generates an external call, the traffic interception logic code is executed to obtain the traffic type of the application request traffic from the type context, and when the traffic type is stress testing traffic, the external call under the application request traffic is intercepted. In addition, if the traffic type is normal business traffic, the call to the external system continues to be executed, specifically by executing the corresponding call method through the external call client.

[0065] For a detailed description of the above traffic interception method, please refer to Figure 2b , which shows the components involved in traffic interception and the process diagram of traffic interception. The specific process includes: for an application node, configuring the traffic identification logic code and traffic interception logic code about the application node in the configuration center; connecting the configured traffic interception probe to the application node. It can be understood that the traffic interception probe will run in the same process as the application node as part of the application node. When the traffic interception probe is running, it pulls the traffic identification logic code and traffic interception logic code from the configuration center, and then injects the traffic identification logic code into the original bytecode of the access service framework by inserting a pile, and injects the traffic interception logic code into the original bytecode of different external call clients. On this basis, after receiving the application request traffic (the traffic type includes normal business traffic and stress test traffic), the access service framework identifies the type of the application request traffic. After the identification is completed, the application node processes it according to the business logic; during the processing, if an external call is generated, the traffic interception logic code is executed to determine whether to intercept the generated external call; if the traffic type of the application request traffic is normal business traffic, it is not intercepted; if the traffic type of the application request traffic is stress test traffic, the external call under the application request traffic is intercepted.

[0066] In the embodiment of the present invention, the implementation of the entire traffic interception process does not require intrusion into the business source code of the application node. In addition, the present invention only needs to deploy a small number of configuration center nodes, and all traffic interception strategies are timely effective through remote configuration. Application developers do not need to understand the specific implementation process of traffic interception, which effectively reduces subsequent maintenance costs.

[0067] Embodiment 3

[0068] Figure 3 A schematic diagram of a time sequence logic flow of a traffic interception method is provided for an embodiment of the present invention. Figure 3 , the traffic interception method includes the following steps:

[0069] First, set the traffic interception strategy. Specifically, the application node R&D personnel determine the traffic interception strategy, that is, determine the interception strategy (including traffic identification logic code and traffic interception logic code) that the application node calls out in the stress testing scenario. Upload the configured interception strategy through the configuration management interface provided by the configuration center, and the configuration center writes the interception strategy into the data table for storage.

[0070] Furthermore, the traffic identification logic is instrumented: the traffic interception probe obtains the traffic identification logic code through the traffic interception policy acquisition interface provided by the configuration center; then, through the bytecode enhancement instrumentation, the traffic identification logic code is written into the original bytecode of the access service framework of the application node and made effective; after the application node receives the application request traffic through the access service framework, it executes the traffic identification logic code to identify whether it is stress test traffic, and marks the stress test traffic with a node-global identification.

[0071] Furthermore, the flow interception logic is inserted: the flow interception probe pulls the flow interception logic code through the flow interception policy acquisition interface provided by the configuration center, and injects it into the original bytecode of the external call client (HTTP client, RPC client, message client) through the bytecode enhancement insertion method; in this way, the flow interception logic code can be executed before the client executes the call method. Finally, the modified bytecode is submitted and reloaded through the class loader to make it effective.

[0072] The final traffic interception process includes: after the application node receives the application request traffic (including normal business traffic and stress testing traffic), the traffic identification logic code configured by the bytecode instrumentation identifies the traffic type and records it through the type context; when processing the application request traffic, for the application request traffic that generates external calls, by executing the traffic interception logic code and combining the traffic type of the application request traffic, it is determined whether to intercept the external calls under the application request traffic.

[0073] The above traffic interception method can avoid the intrusion of the service source code of the application node during the traffic interception process.

[0074] Embodiment 4

[0075] Figure 4 The structure diagram of a flow interception device provided by an embodiment of the present invention is shown in FIG. This embodiment can be applied to intercepting external calls under test flow in an application system test scenario. Figure 4 As shown, the flow interception device includes:

[0076] The first injection module 401 is used to inject the traffic identification logic code into the original bytecode of the access service framework of the application node, and make the traffic identification logic code effective;

[0077] The second injection module 402 is used to inject the traffic interception logic code into the original bytecode of the application node for externally calling the client, and make the traffic interception logic code effective;

[0078] The traffic type identification module 403 is used to identify the traffic type of the application request traffic by executing the traffic identification logic code after receiving the application request traffic through the access service framework;

[0079] The traffic interception module 404 is used to determine whether to intercept the external call under the application request traffic according to the traffic type by executing the traffic interception logic code when processing the application request traffic and generating the external call.

[0080] In some embodiments, the first injection module 401 includes:

[0081] A first pulling unit is used to connect a traffic interception probe to the application node, and pull a traffic identification logic code for the application node from the configuration center through the traffic interception probe;

[0082] The first injection unit is used to inject the traffic identification logic code into the original bytecode of the access service framework of the application node by using the traffic interception probe and the plugging technology;

[0083] The first validation unit is used to validate the traffic identification logic code by reloading the original bytecode injected into the traffic identification logic code.

[0084] In some embodiments, the first injection unit is specifically used for:

[0085] Through the flow interception probe, the instrumentation technology is used to determine the first target location of the method for processing application request traffic from the original bytecode of the access service framework;

[0086] According to the first target location, the traffic identification logic code is injected into the original bytecode of the access service framework.

[0087] In some embodiments, the second injection module 402 includes:

[0088] The second pulling unit is used to connect the traffic interception probe in the application node, and pull the traffic interception logic code for the application node from the configuration center through the traffic interception probe;

[0089] The second injection unit is used to inject the traffic interception logic code into the original bytecode of the external call client of the application node through the traffic interception probe and the plugging technology;

[0090] The second validation unit is used to validate the traffic interception logic code by reloading the original bytecode injected into the traffic interception logic code.

[0091] In some embodiments, the second injection unit is specifically used for:

[0092] By using a flow interception probe and a plugging technique, a second target location where a calling method is located is determined in the original bytecode of an external calling client of the application node; wherein the external calling client is at least one of a hypertext transfer protocol client, a remote procedure call protocol client, and a message client;

[0093] According to the second target location, the traffic interception logic code is injected into the original bytecode of the external calling client.

[0094] In some embodiments, the traffic type identification module 403 is specifically used to:

[0095] After receiving the application request traffic through the access service framework, the key field information included in the application request traffic is parsed by executing the traffic identification logic code;

[0096] According to the key field information, the traffic type of the application request traffic is identified and recorded in the form of type context; the traffic type includes business traffic and stress test traffic.

[0097] In some embodiments, the traffic interception module 404 is specifically used to:

[0098] When processing application request traffic and generating external calls, the traffic interception logic code is executed to obtain the traffic type of the application request traffic from the type context, and when the traffic type is stress testing traffic, the external calls under the application request traffic are intercepted.

[0099] The traffic interception device provided in the embodiment of the present invention can execute the traffic interception method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0100] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.

[0101] Embodiment 5

[0102] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to be a controller device in a new energy vehicle. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0103] like Figure 5 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0104] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0105] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as executing a traffic interception method.

[0106] In some embodiments, the traffic interception method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the traffic interception method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the traffic interception method in any other appropriate manner (e.g., by means of firmware).

[0107] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0108] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable traffic interception device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0109] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0110] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0111] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0112] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

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

Claims

1. A traffic interception method, characterized in that: include: Injecting the flow identification logic code into the original bytecode of the access service framework of the application node and making the flow identification logic code effective; Injecting traffic interception logic code into the original bytecode of the application node for externally calling the client, and making the traffic interception logic code effective; After receiving the application request traffic through the access service framework, identifying the traffic type of the application request traffic by executing the traffic identification logic code; When the application request traffic is processed and an external call is generated, the traffic interception logic code is executed to determine whether to intercept the external call under the application request traffic according to the traffic type.

2. The method according to claim 1, characterized in that The method of injecting the traffic identification logic code into the original bytecode of the access service framework of the application node and making the traffic identification logic code effective includes: A traffic interception probe is connected to the application node, and the traffic identification logic code for the application node is pulled from the configuration center through the traffic interception probe; By using the traffic interception probe and the plugging technology, the traffic identification logic code is injected into the original bytecode of the access service framework of the application node; The traffic identification logic code is made effective by reloading the original bytecode injected into the traffic identification logic code.

3. The method according to claim 2, characterized in that The method of injecting the traffic identification logic code into the original bytecode of the access service framework of the application node by using the traffic interception probe and the plugging technology includes: Through the flow interception probe, the instrumentation technology is used to determine the first target location of the method for processing application request traffic from the original bytecode of the access service framework; According to the first target location, the traffic identification logic code is injected into the original bytecode of the access service framework.

4. The method according to claim 1, characterized in that: The step of injecting the traffic interception logic code into the original bytecode of the application node for externally calling the client and making the traffic interception logic code effective includes: A traffic interception probe is connected to the application node, and the traffic interception logic code for the application node is pulled from the configuration center through the traffic interception probe; By using the traffic interception probe and the plugging technology, the traffic interception logic code is injected into the original bytecode of the application node for externally calling the client; The traffic interception logic code is made effective by reloading the original bytecode injected into the traffic interception logic code.

5. The method according to claim 4, characterized in that The flow interception probe is used to inject the flow interception logic code into the original bytecode of the application node for externally calling the client by using the plugging technology, including: By using a flow interception probe and a plugging technique, a second target location where a calling method is located is determined in the original bytecode of an external calling client of the application node; wherein the external calling client is at least one of a hypertext transfer protocol client, a remote procedure call protocol client, and a message client; According to the second target location, the traffic interception logic code is injected into the original bytecode of the external calling client.

6. The method according to claim 1, characterized in that After receiving the application request traffic through the access service framework, identifying the traffic type of the application request traffic by executing the traffic identification logic code includes: After receiving the application request traffic through the access service framework, parsing the key field information included in the application request traffic by executing the traffic identification logic code; According to the key field information, the traffic type of the application request traffic is identified and recorded in a type context; wherein the traffic type includes business traffic and stress testing traffic.

7. The method according to claim 6, characterized in that In the case of processing the application request traffic and generating an external call, determining whether to intercept the external call under the application request traffic according to the traffic type by executing the traffic interception logic code includes: When processing the application request traffic and generating external calls, the traffic type of the application request traffic is obtained from the type context by executing the traffic interception logic code, and when the traffic type is stress testing traffic, the external calls under the application request traffic are intercepted.

8. A flow interception device, characterized in that: include: A first injection module is used to inject a flow identification logic code into the original bytecode of the access service framework of the application node, and make the flow identification logic code effective; A second injection module is used to inject a traffic interception logic code into the original bytecode of the application node for externally calling the client, and make the traffic interception logic code effective; A traffic type identification module, configured to identify the traffic type of the application request traffic by executing the traffic identification logic code after receiving the application request traffic through the access service framework; The traffic interception module is used to determine whether to intercept the external call under the application request traffic according to the traffic type by executing the traffic interception logic code when processing the application request traffic and generating an external call.

9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method according to any one of claims 1 to 7 when executed.

11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.