Communication level link switching method and device based on bytecode enhancement technology

Through the communication-level link switching method based on bytecode enhancement technology, the problems of hardware resource consumption, extended response time and high operation and maintenance costs during the transformation of IT system architecture are solved, and low-cost and low-risk protocol transformation and business continuity are achieved.

CN119814533APending Publication Date: 2025-04-11CHINA CITIC BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411774589.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

During the transformation of IT system architecture, existing technology requires additional deployment of expensive hardware resources, increasing system response time, and increasing operation and maintenance costs and complexity. In addition, traditional architecture transformation strategies rely on in-depth transformation of existing code, which is time-consuming and labor-intensive, and poses high costs and transformation risks.

Method used

The communication-level link switching method based on bytecode enhancement technology is adopted, and the original engineering method is intercepted by the mount agent, the new link switch status is judged, the request is distributed to the new link or the existing link, and the automatic turn-back is realized when the new link is abnormal to reduce risks.

Benefits of technology

A non-invasive, low-cost and low-risk protocol transformation has been realized, avoiding request errors caused by direct forwarding of full traffic to new links, and rapid shutdown has reduced operation and maintenance costs and risks, ensuring business continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814533A_ABST
    Figure CN119814533A_ABST
Patent Text Reader

Abstract

The invention discloses a communication-level link switching method and device based on a bytecode enhancement technology, and the method comprises the steps: mounting an agent program through a stock application, carrying out the recognition according to the configuration, and intercepting an original project to be replaced; when the agent program receives the request, judging whether a switch of a new link in the current service scene is turned on or not; when the link is opened, the request is distributed to the new link, the number of abnormities when the new link requests the downstream system is counted through monitoring, when the number of abnormities reaches a threshold value in unit time, the switch of the current new link is closed, and the subsequent request is processed through the stock link. On the premise that stock codes are not modified, expected code logic is implanted in an agent mounting mode, so that class behaviors are changed, and then function enhancement and replacement are achieved. For a stock application request protocol modification scene, an HTTP (Hyper Text Transport Protocol) or TCP (Transmission Control Protocol) calling method in an original project is intercepted, and an agent intercepted method is called by RPC (Remote Procedure Call), so that protocol modification is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of IT system communication link switching, bytecode enhancement, and automated operation and maintenance technology, in particular to the fields of communication-level link switching mechanism based on bytecode enhancement technology, and more particularly to a communication-level link switching method and device based on bytecode enhancement technology. Background Art

[0002] In the face of the challenges of deep system reconstruction and comprehensive protocol upgrades during the implementation of IT application system architecture transformation, existing approaches often tend to build service gateways as a bridge to transition from legacy communication protocols (such as HTTP and TCP) to modern, efficient RPC protocols. While effective, this strategy also comes with significant drawbacks: it not only requires the deployment of expensive additional hardware resources, but also inevitably increases overall system response time due to the lengthened network path, impacting user experience. Furthermore, the increased number of network hops exacerbates system complexity, leading to a surge in operational and maintenance costs and a sharp increase in maintenance difficulty.

[0003] What's particularly challenging is that traditional architecture transformation strategies often rely on extensive and in-depth modifications to existing codebases to adapt to emerging technology frameworks. This process is not only time-consuming and labor-intensive, but also comes with high costs and significant transformation risks. A single misstep could lead to system instability or functional degradation, posing a serious threat to business continuity. Therefore, developing a smoother, more efficient, and cost-effective transformation path has become a pressing technical challenge for those skilled in the art. Summary of the Invention

[0004] To this end, the present invention provides a non-invasive, low-cost, and low-risk protocol transformation solution; supports distributing the traffic between the new and old links according to a percentage, avoiding the large number of request errors caused by forwarding the full traffic directly to the new link; and supports rapid switching back when the new link is abnormal, reducing risks.

[0005] To achieve the above objectives, in a first aspect, the present invention provides a communication-level link switching method based on bytecode enhancement technology, comprising:

[0006] The existing application mounts an agent program, which identifies and intercepts the method of the original project to be replaced based on the configuration;

[0007] When the agent receives a request, it determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request will be distributed to the new link; if the switch is off, the existing link will handle it;

[0008] When the new link switch is in the on state, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, the switch of the current new link is turned off and subsequent requests are processed through the existing link.

[0009] Furthermore, the method of mounting an agent program on the existing application, wherein the agent program identifies according to the configuration and intercepts the original project to be replaced includes: the existing application mounting a bytecode enhancement agent to convert the existing TCP or HTTP protocol into the RPC protocol.

[0010] Furthermore, when a communication-level anomaly occurs, an automatic re-switching mechanism is implemented based on a sliding window anomaly statistics algorithm, which calculates in real time the number of anomalies that occur when the new link processes transactions within a unit time. When the accumulated number exceeds a pre-set threshold, it automatically switches back and distributes subsequent traffic to the existing link.

[0011] Furthermore, the bytecode enhancement framework includes but is not limited to bytecode enhancement tools such as ASM, AspectJ, Cglib, and bytebuddy.

[0012] In a second aspect, the present invention further provides a communication-level link switching device based on bytecode enhancement technology, comprising: an identification unit, an agent unit, and a processing unit;

[0013] The identification unit is used to mount an agent program on the existing application, and the agent program identifies the method according to the configuration and intercepts the original project to be replaced;

[0014] The proxy unit is configured to determine whether the switch of the new link in the current business scenario is turned on when the proxy program receives a request; if the switch is turned on, the current request is distributed to the new link; if the switch is turned off, the existing link is used to process the request;

[0015] The processing unit is used to, when the new link switch is in the on state, monitor and count the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, turn off the switch of the current new link and process subsequent requests through the existing link.

[0016] Furthermore, the method of mounting an agent program on the existing application, wherein the agent program identifies according to the configuration and intercepts the original project to be replaced includes: the existing application mounting a bytecode enhancement agent to convert the existing TCP or HTTP protocol into the RPC protocol.

[0017] Furthermore, when a communication-level anomaly occurs, an automatic re-switching mechanism is implemented based on a sliding window anomaly statistics algorithm, which calculates in real time the number of anomalies that occur when the new link processes transactions within a unit time. When the accumulated number exceeds a pre-set threshold, it automatically switches back and distributes subsequent traffic to the existing link.

[0018] Furthermore, the bytecode enhancement framework includes but is not limited to bytecode enhancement tools such as ASM, AspectJ, Cglib, and bytebuddy.

[0019] In a third aspect, the present invention provides a computing device, comprising:

[0020] a memory for storing program instructions;

[0021] The processor is used to call the program instructions stored in the memory and execute the above-mentioned communication-level link switching method based on bytecode enhancement technology according to the obtained program instructions.

[0022] In a fourth aspect, the present invention provides a computer-readable storage medium, including computer-readable instructions. When a computer reads and executes the computer-readable instructions, it implements the above-mentioned communication-level link switching method based on bytecode enhancement technology. The readable medium may be multiple, and the multiple readable media can operate independently of each other.

[0023] Compared to existing technologies, this solution leverages Java bytecode enhancement technology and AOP principles. Without modifying existing code, this solution embeds the intended code logic by mounting a proxy, thereby changing class behavior and achieving functional enhancement and replacement. For scenarios involving protocol modification of existing application requests, protocol modification is achieved by intercepting HTTP or TCP call methods in the original project and using RPC to call the intercepted proxy methods.

[0024] When switching online, existing applications face a completely new communication protocol and request link. Switching directly from the original communication link to the RPC link inevitably carries significant risks. To prevent transaction processing anomalies caused by RPC link instability, network jitter, and other factors, this invention provides an automatic fallback mechanism for communication-level anomalies, offering a solution from a technical framework level to ensure business continuity.

[0025] The automatic switchback mechanism for communication-level anomalies can achieve switchback in seconds when an anomaly is detected. It has the characteristics of automation and high timeliness, avoiding misoperation and delays caused by manual operation and maintenance. While reducing operation and maintenance costs, it also enables the existing system to transition to the new architecture system with low risk and smoothness. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0027] Figure 1 A flow chart of an embodiment of a communication-level link switching method based on bytecode enhancement technology provided by the present invention;

[0028] Figure 2 A schematic diagram of an automatic switching mechanism according to an embodiment of the communication-level link switching method based on bytecode enhancement technology provided by the present invention;

[0029] Figure 3 Schematic diagrams of transaction links before and after transformation in one embodiment of the communication-level link switching method based on bytecode enhancement technology provided by the present invention;

[0030] Figure 4 A structural block diagram of an embodiment of a communication-level link switching device based on bytecode enhancement technology provided by the present invention;

[0031] Figure 5 This is a structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0032] The following describes in detail embodiments of the present application. Examples of various embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present application and are not to be construed as limiting the present application.

[0033] It will be understood by those skilled in the art that, unless otherwise stated, the singular forms "a," "an," and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application refers to the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0034] In order to make the objectives, technical solutions and advantages of this application clearer, the specific implementation methods of this application will be further described in detail below with reference to the accompanying drawings.

[0035] The core of the present invention is to provide a communication-level link switching method based on bytecode enhancement technology. Figure 1 FIG. 1 is a flow chart of a communication-level link switching method based on bytecode enhancement technology provided in this embodiment. Figure 2 The figure shows the principle diagram of the automatic switching mechanism of the communication level link switching method based on the bytecode enhancement technology provided by this embodiment. In order to better understand the method, Figure 1 and Figure 2 The technical solution of this embodiment is discussed in detail:

[0036] Step S1: The existing application mounts an agent program, which identifies and intercepts the method of the original project to be replaced according to the configuration;

[0037] Step S2: When the agent receives the request, the agent determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request is distributed to the new link; if the switch is off, the existing link handles the request;

[0038] In a preferred implementation, an agent program is installed on existing applications. The agent program identifies and intercepts the original engineering method to be replaced based on the configuration. When a request is received, the agent program determines whether the switch for the new link in the current business scenario is on. If the switch is on, the current request is dispatched to the new link; otherwise, it is handled by the existing link.

[0039] Step S3: When the new link switch is in the on state, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, the switch of the current new link is turned off and subsequent requests are processed through the existing link.

[0040] In a preferred embodiment, when the new link switch is in the on state, the agent program will monitor and count the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches the threshold within a unit time, the switch of the current new link will be turned off and subsequent requests will be processed by the existing link.

[0041] In a preferred embodiment, the stock application mounts an agent program, and the agent program identifies according to the configuration and intercepts the original project to be replaced. The method includes: the stock application mounts a bytecode enhancement agent to convert the stock TCP or HTTP protocol into the RPC protocol.

[0042] In a preferred embodiment, when a communication-level anomaly occurs, an automatic re-switching mechanism is implemented based on a sliding window anomaly statistics algorithm, and the number of anomalies that occur when the new link processes transactions per unit time is calculated in real time. When the accumulated number exceeds a pre-set threshold, the mechanism automatically switches back and distributes subsequent traffic to the existing link.

[0043] In a preferred embodiment, the bytecode enhancement framework includes but is not limited to bytecode enhancement tools such as ASM, AspectJ, Cglib, and bytebuddy.

[0044] In the solution of this embodiment, the proxy program is mounted through the existing application, and the proxy program identifies according to the configuration and intercepts the method of the original project to be replaced; when the proxy program receives the request, it determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request will be distributed to the new link; otherwise, it will be processed by the existing link; when the new link switch is on, the proxy program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches the threshold within a unit time, the switch of the current new link is turned off, and subsequent requests are processed through the existing link. It is achieved by implanting the expected code logic by mounting the proxy without modifying the existing code, thereby changing the behavior of the class and achieving function enhancement and replacement. For the scenario of protocol modification of existing application request, the protocol modification is achieved by intercepting the HTTP or TCP call method in the original project and calling the intercepted method of the proxy with RPC.

[0045] Example 1: Transformation and switching of bill verification link, combined with Figure 3 Schematic diagram of the transaction link before and after transformation provided in this embodiment;

[0046] Scenario Background: In the bill verification transaction chain, the comprehensive financial external liaison platform is an existing application that cannot be adapted to the RPC protocol. Reconstruction is costly and risky. Therefore, bytecode technology is used to upgrade the architecture of the two systems and integrate them into the cloud-native system.

[0047] Comprehensive financial application: Convert the bill verification method from the original socket+JSON network request to crpc call.

[0048] External platform application: In addition to the original socket service, a new crpc service is started.

[0049] Implementation effect: The program runs smoothly in the mesh environment, and the success rate of ticket verification requests is 100%.

[0050] This embodiment is designed with minimal intrusion in mind. Leveraging Java bytecode enhancement technology, this approach embeds the intended code logic by mounting a proxy, without modifying existing code. This modifies class behavior and enables functional enhancement and replacement. This approach eliminates the need to modify source application code or increase machine resources for deployment, achieving seamless transformation while maintaining the application's original technical architecture.

[0051] This embodiment is suitable for implementing communication link modification scenarios in JAVA applications. Designed with a non-invasive approach, this embodiment does not require modifying the source application code or increasing machine resources for deployment. While maintaining the application's original technical architecture, it leverages JAVA bytecode enhancement technology to embed the intended code logic through a mounted agent without modifying the existing code, thereby changing class behavior and achieving communication protocol conversion and link switching.

[0052] In one embodiment, the present invention provides a communication-level link switching device based on bytecode enhancement technology, see Figure 4 The figure shows a structural block diagram of a communication-level link switching device based on bytecode enhancement technology provided by this embodiment, wherein the device includes: an identification unit 10, an agent unit 20, and a processing unit 30;

[0053] The identification unit 10 is used to mount an agent program on the existing application, and the agent program identifies the method of the original project to be replaced according to the configuration;

[0054] The proxy unit 20 is configured to determine whether the switch of the new link in the current business scenario is turned on when the proxy program receives a request; if the switch is turned on, the current request is distributed to the new link; if the switch is turned off, the existing link is used to process the request;

[0055] The processing unit 30 is used to, when the new link switch is in the on state, monitor and count the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, turn off the switch of the current new link and process subsequent requests through the existing link.

[0056] In the solution of this embodiment, the proxy program is mounted through the existing application, and the proxy program identifies according to the configuration and intercepts the method of the original project to be replaced; when the proxy program receives the request, it determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request will be distributed to the new link; otherwise, it will be processed by the existing link; when the new link switch is on, the proxy program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches the threshold within a unit time, the switch of the current new link is turned off, and subsequent requests are processed through the existing link. It is achieved by implanting the expected code logic by mounting the proxy without modifying the existing code, thereby changing the behavior of the class and achieving function enhancement and replacement. For the scenario of protocol modification of existing application request, the protocol modification is achieved by intercepting the HTTP or TCP call method in the original project and calling the intercepted method of the proxy with RPC.

[0057] The communication-level link switching device based on bytecode enhancement technology in this embodiment is used to implement the aforementioned communication-level link switching method based on bytecode enhancement technology. Therefore, the specific implementation method of the communication-level link switching device based on bytecode enhancement technology can be seen in the specific implementation method part of the communication-level link switching method based on bytecode enhancement technology in the previous text. For example, the identification unit 10 is used to implement step S1 in the above-mentioned communication-level link switching method based on bytecode enhancement technology, and the agent unit 20 is used to implement step S2 in the above-mentioned communication-level link switching method based on bytecode enhancement technology, etc. Therefore, its specific implementation method can refer to the description of the corresponding various parts of the embodiment. The device provided by the present invention is attached to the method provided by the present invention, and its specific effects can refer to the above-mentioned method, which will not be repeated here.

[0058] In one embodiment, a computing device is provided, comprising:

[0059] a memory for storing program instructions;

[0060] A processor is used to implement the steps of the communication-level link switching method based on bytecode enhancement technology as described above when executing the computer program.

[0061] As an example, Figure 5 A schematic diagram of the structure of an electronic device applicable to the embodiment of the present application is shown in FIG. Figure 5As shown, the electronic device 2000 includes: a processor 2001 and a memory 2003. The processor 2001 and the memory 2003 are connected, for example, via a bus 2002. Optionally, the electronic device 2000 may further include a transceiver 2004. It should be noted that in actual applications, the number of transceivers 2004 is not limited to one, and the structure of the electronic device 2000 does not constitute a limitation on the embodiments of the present application.

[0062] The processor 2001 is used in the embodiment of the present application to implement the method shown in the above method embodiment. The transceiver 2004 may include a receiver and a transmitter. The transceiver 2004 is used in the embodiment of the present application to implement the function of the electronic device of the embodiment of the present application communicating with other devices when executed.

[0063] Processor 2001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 2001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0064] The bus 2002 may include a path for transmitting information between the above components. The bus 2002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 2002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.

[0065] The memory 2003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0066] Optionally, the memory 2003 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 2001. The processor 2001 is used to execute the application code stored in the memory 2003 to implement the investment and financing project recommendation method provided in any embodiment of the present application.

[0067] The electronic device provided in the embodiments of the present application is applicable to any embodiment of the above method and will not be described in detail here.

[0068] The present invention provides a communication-level link switching method based on bytecode enhancement technology, which has obvious advantages and beneficial effects compared with the existing technology. The method is to mount an agent program on the existing application, and the agent program identifies according to the configuration and intercepts the original project to be replaced; when the agent program receives a request, it determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request will be distributed to the new link; otherwise, it will be processed by the existing link; when the new link switch is on, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches the threshold within a unit time, the switch of the current new link is turned off, and subsequent requests are processed through the existing link. It is achieved by implanting the expected code logic by mounting an agent without modifying the existing code, thereby changing the behavior of the class and achieving function enhancement and replacement. For the scenario of protocol modification of existing application request, the protocol modification is achieved by intercepting the HTTP or TCP call method in the original project and calling the intercepted method of the proxy with RPC.

[0069] In one embodiment, a computer-readable storage medium is provided, comprising computer-readable instructions. When a computer reads and executes the computer-readable instructions, the computer-readable instructions implement the steps of the communication-level link switching method based on bytecode enhancement technology described above. The communication-level link switching method based on bytecode enhancement technology provided by the present invention has obvious advantages and beneficial effects compared with the existing technology. The method includes mounting an agent program through an existing application, and the agent program identifies and intercepts the original project to be replaced according to the configuration. When the agent program receives a request, it determines whether the switch of the new link in the current business scenario is turned on. If the switch is turned on, the current request will be distributed to the new link; otherwise, it will be processed by the existing link. When the new link switch is turned on, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, the switch of the current new link is turned off, and subsequent requests are processed through the existing link. The method realizes the implantation of the expected code logic by mounting the agent without modifying the existing code, thereby changing the behavior of the class and achieving function enhancement and replacement. For existing application request protocol transformation scenarios, protocol transformation is achieved by intercepting the HTTP or TCP call method in the original project and using the RPC call proxy to intercept the method.

[0070] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional modules as needed, that is, the internal structure of the specific device can be divided into different functional modules to complete all or part of the functions described above.

[0071] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0072] In the several embodiments covered by this application, it should be understood that the disclosed devices, equipment, and methods can be implemented in other ways. For example, the division of modules is merely a logical functional division, and in actual implementation, other division methods may be used, such as multiple modules or components can be combined or integrated into another device, or some features can be ignored or not implemented. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or module, or can be an electrical, mechanical or other form of connection.

[0073] Modules described as separate components may or may not be physically separate, and components displayed as modules may or may not be physical modules, that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0074] In addition, each functional module in each embodiment of the present application can be implemented in the form of hardware or in the form of software functional modules. If these functional modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or partly contributed to the prior art, or all or part of the technical solution can be embodied in the form of a computer program product, which includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer program product is stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. Available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).

[0075] The above content is merely an example and explanation of the structure of the present invention. Those skilled in the art may make various modifications or additions to the described specific embodiments or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the scope of protection of the present invention.

Claims

1. A communication-level link switching method based on bytecode enhancement technology, characterized in that: include: The stock application mounts an agent program, which identifies and intercepts the method of the original project to be replaced according to the configuration; When the proxy program receives a request, the proxy program determines whether the switch of the new link in the current business scenario is turned on; if the switch is on, the current request will be distributed to the new link; if the switch is off, the existing link will process it; When the new link switch is in the on state, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, the switch of the current new link is turned off and subsequent requests are processed through the existing link.

2. The communication-level link switching method based on bytecode enhancement technology according to claim 1, characterized in that: The method of mounting an agent program on an existing application, wherein the agent program identifies according to a configuration and intercepts the original project to be replaced includes: the existing application mounting a bytecode enhancement agent to convert the existing TCP or HTTP protocol into an RPC protocol.

3. The communication-level link switching method based on bytecode enhancement technology according to claim 2 is characterized in that: When a communication-level anomaly occurs, an automatic reversal mechanism is implemented based on a sliding window anomaly statistics algorithm. The number of anomalies that occur when the new link processes transactions per unit time is calculated in real time. When the accumulated number exceeds a pre-set threshold, the mechanism automatically switches back and distributes subsequent traffic to the existing link.

4. The communication-level link switching method based on bytecode enhancement technology according to claim 3 is characterized in that: The bytecode enhancement framework includes but is not limited to: ASM, AspectJ, Cglib, bytebuddy and other bytecode enhancement tools.

5. A communication-level link switching device based on bytecode enhancement technology, characterized in that: The device comprises: an identification unit, an agent unit, and a processing unit; The identification unit is used to mount an agent program on the stock application, and the agent program identifies according to the configuration and intercepts the method of the original project to be replaced; The proxy unit is used for, when the proxy program receives a request, the proxy program determines whether the switch of the new link in the current business scenario is turned on; if the switch is in the on state, the current request will be distributed to the new link; if the switch is in the off state, the existing link will process it; The processing unit is used to, when the new link switch is in the on state, the agent program monitors and counts the number of exceptions when the new link requests the downstream system. When the number of exceptions reaches a threshold within a unit time, the switch of the current new link is turned off, and subsequent requests are processed through the existing link.

6. The communication-level link switching device based on bytecode enhancement technology according to claim 5, characterized in that: The method of mounting an agent program on an existing application, wherein the agent program identifies according to a configuration and intercepts the original project to be replaced includes: the existing application mounting a bytecode enhancement agent to convert the existing TCP or HTTP protocol into an RPC protocol.

7. The communication-level link switching device based on bytecode enhancement technology according to claim 6, characterized in that: When a communication-level anomaly occurs, an automatic reversal mechanism is implemented based on a sliding window anomaly statistics algorithm. The number of anomalies that occur when the new link processes transactions per unit time is calculated in real time. When the accumulated number exceeds a pre-set threshold, the mechanism automatically switches back and distributes subsequent traffic to the existing link.

8. The communication-level link switching device based on bytecode enhancement technology according to claim 7, characterized in that: The bytecode enhancement framework includes but is not limited to: ASM, AspectJ, Cglib, bytebuddy and other bytecode enhancement tools.

9. A computing device, characterized in that include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program instructions.

10. A computer-readable storage medium, characterized in that: It includes computer-readable instructions. When a computer reads and executes the computer-readable instructions, it implements the method as claimed in any one of claims 1 to 4. There can be multiple readable media, and the multiple readable media can operate independently of each other.