A method for dynamically enhancing functionality based on an application
By listening to preset key events and using the JVM Tool Interface to call native plugins to dynamically adjust bytecode, the problems of intrusiveness and high coupling in application function enhancement in traditional technologies are solved. This enables the independent development and deployment of proxy programs, providing services for multiple target programs and improving application performance and user experience.
Patent Information
- Application Number
- CN202411226252.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2044-09-03
AI Technical Summary
In existing technologies, application function enhancement methods suffer from problems such as strong intrusion, high coupling, limited scenarios, and one-to-one engineering, resulting in limited applicability and poor flexibility.
By listening to preset key events and using the JVM Tool Interface to call local plugins, the original bytecode is dynamically adjusted to generate the modified target bytecode. Dynamic functional enhancements are achieved through custom registered callback methods, and the proxy program and the target program are dynamically associated at runtime.
It enables the independent development and deployment of proxy programs, allowing them to serve multiple target programs, enhancing code flexibility and applicability, and improving application performance and user experience.
Smart Images

Figure CN119201060B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of program enhancement, in particular to a method for dynamically enhancing the function of an application program. BACKGROUND
[0002] Currently, the application program in the terminal device needs to be continuously updated and enhanced in function. However, most of the requirements for enhancing the function of the application program are repetitive and abstract, such as monitoring some indicators (number of requests, response time) for the application in real time, and performing dynamic traffic control for the application. These requirements are non-business requirements that actually exist in each application system. Customers mostly focus on the implementation of their business functions in daily development, but find that such non-business requirements are crucial to the stability and reliability of the system after going online. However, the existing program enhancement method can be dynamically attached to the customer application program to provide such general non-business functions.
[0003] The traditional bytecode enhancement or code proxy method, although does not directly modify the target method or the target class by hard coding, still requires the code of the enhancement part to be physically in the same project as the target program, which has the following disadvantages:
[0004] Strong invasiveness: The invasiveness of the target program is high. The code of the enhancement part must be written in the target program. In the case where the source code of the target program cannot be obtained, the enhancement technology cannot be used.
[0005] High coupling degree: If the traditional bytecode enhancement technology is run independently, it cannot be associated with the target program, so it cannot modify the bytecode of the target program, resulting in the inability to enhance its function.
[0006] Single scene: The traditional bytecode enhancement technology needs to complete the static coding of the enhancement function in the original project in advance. It must be bound with the source code at the physical level, so it is only suitable for the case where the source code or the compiled source code project has been obtained. However, since the source code can be obtained, it can be directly modified on the source code, so the scope of application is narrow and the scene is limited.
[0007] One-to-one project: The traditional bytecode enhancement technology determines that the code of the enhancement part and the target program must be one-to-one, that is, the code of the enhancement part can only serve one target program. If other target programs also need the capabilities provided by the code of the enhancement part, the code project needs to be rewritten.
[0008] The reason why the traditional technology has the above-mentioned disadvantages is that the coupling degree between the code of the enhancement part and the target program is too high. SUMMARY
[0009] The application provides an application-based function dynamic enhancement method, which is used for solving the case that the code of an enhanced part is too high in coupling degree with a target program.
[0010] In a first aspect, the application provides an application-based function dynamic enhancement method, which comprises the following steps:
[0011] When the target program is running, it is listened whether there is a preset key event;
[0012] When the preset key event exists, event trigger information is acquired;
[0013] According to the event trigger information, a local plug-in is called through a JVM Tool Interface;
[0014] According to the local plug-in, the original bytecode is dynamically adjusted.
[0015] In combination with the first aspect, the key event corresponds to a unique callback mode, wherein the callback mode is loaded into the main program by a self-defined registration mode, and the callback mode is run before the main program of the target program.
[0016] In combination with the first aspect, the JVM Tool Interface comprises a first interface and a second interface, wherein the first interface is used for connecting the local plug-in, and the second interface is connected with the JVM of the target program;
[0017] The local plug-in is an agent program used for enhancing the running function of the target program;
[0018] The JVM Tool Interface is loaded by the JVM in the form of a dynamic link library.
[0019] In combination with the first aspect, the JVM Tool Interface further comprises a ClassFileLoadHook event, wherein when the ClassFileLoadHook event is triggered, the current time is taken as a modification time for modifying the bytecode of the target program.
[0020] In combination with the first aspect, the dynamic adjustment of the original bytecode comprises the following steps:
[0021] The modified bytecode of the local plug-in is acquired;
[0022] The modified bytecode and the original bytecode are fused to generate modified target bytecode.
[0023] In combination with the first aspect, after the dynamic adjustment of the original bytecode, the following steps are further included:
[0024] The function logic test includes a plurality of triggers, wherein the triggers are set based on the function logic of the target program;
[0025] The dynamically adjusted target bytecode is obtained as the input code of the function logic test of the target program;
[0026] Based on the input code, the first trigger result of the function logic test is obtained, and a webshell file of the execution parameter is generated;
[0027] The webshell file is input into the gain function, the output result is recorded, and when the gain function output result is positive, the first response is returned, wherein the first response is used to represent the function enhancement of the dynamically adjusted application program execution.
[0028] In combination with the first aspect, the fusion of the modified bytecode and the original bytecode further includes:
[0029] According to the original bytecode, a Token sequence is generated;
[0030] Based on the preset attention mechanism gate, the source code features of each Token bit in the Token sequence are determined;
[0031] The modified bytecode is subjected to SAT analysis to determine the enhancement features;
[0032] The enhancement features and the source code are fused through a joint decoder to determine the core logic of the target bytecode, and a text summary of the core logic is generated, wherein:
[0033] When the result of the text summary output by the joint decoder is positive, it indicates that dynamic adjustment can be performed;
[0034] When the result of the text summary output by the joint decoder is negative, it indicates that the current modified bytecode corresponding to the local plug-in cannot be dynamically adjusted.
[0035] In combination with the first aspect, the preset key event further includes:
[0036] The preset key event and the associated code segment in the original bytecode are taken as a listening group;
[0037] According to the listening group, one or more call buffers are set, and the local plug-in is cached in the call buffer, wherein the one or more call buffers are set in the local server of the target program;
[0038] When the preset key event is monitored, the target call buffer with the highest relevance to the preset key event in the local server is determined, and the target call buffer is taken as the most preferred call buffer, and:
[0039] In response to the registration information of the local plug-in corresponding to the target cache, and according to the registration information, the enhancement target of the target program dynamic enhancement is determined.
[0040] In combination with the first aspect, the calling of the local plug-in further meets the following states:
[0041] In response to the event trigger information, the first interface of the JVM Tool Interface is configured to be in an available state, and the original bytecode of the target program is configured to be in an insertable state;
[0042] In response to the target plug-in in the local plug-in, the modified bytecode in the target plug-in is configured to be in an authenticated state.
[0043] In combination with the first aspect, the callback mode is set through the following steps:
[0044] The main program is switched to a trusted registration mode, and according to a preset key event, a callback mode corresponding to each preset key event is defined.
[0045] The beneficial effects of the present application are:
[0046] Independent development: When the agent program is written, it does not need to care about the position it is in, and can be independently written, independently run, and independently debugged, and at the same time, it does not care about the position of the target program, and even when the agent program is written, the target program has not been created, and coding can still be performed.
[0047] Independent deployment: In the deployment stage, the agent program and the target program are completely separated physically, and they do not need to be in the same project, as long as they can directly network with each other, and they can be dynamically associated together automatically during program running. The problem of physical strong binding during deployment is solved, and such design makes the code of the enhancement part more flexible and the application scenarios wider.
[0048] Flexible reuse: The one-to-one strong coupling mode of the agent service and the target service in the prior art is abandoned, and is optimized to the agent program which can serve multiple target programs at the same time. The principle of realizing this effect is to let the target service actively find the agent program, that is, the address of the agent program is transmitted to the target program as a starting parameter when the target program starts, and is dynamically linked by the runtime. In this way, a piece of code of the enhancement part with general functions can provide services for multiple target services at the same time.
[0049] Other features and advantages of the present application will be set forth in the following description of the application, and in part will become apparent to those skilled in the art from the description, or can be learned by practice of the application. The objects and other advantages of the present application can be achieved and obtained by the structures particularly pointed out in the written description and drawings.
[0050] The technical solutions of the present application are described in further detail below with reference to the accompanying drawings and examples. BRIEF DESCRIPTION OF DRAWINGS
[0051] The accompanying drawings are included to provide a further understanding of the present application, and constitute a part of the specification, illustrate the present application, and are used together with the embodiments to explain the present application, and do not constitute a limitation on the present application. In the drawings:
[0052] Figure 1 A method flowchart of a function dynamic enhancement method based on an application program in an embodiment of the present application;
[0053] Figure 2 A fusion flowchart of fusing modified bytecode and original bytecode in an embodiment of the present application;
[0054] Figure 3 An actual implementation code diagram of performing dynamic enhancement of an application program in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The preferred embodiments of the present application are described below in conjunction with the accompanying drawings, and it should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and do not constitute a limitation on the present application.
[0056] As shown in Figure 1 and Figure 3 The present embodiment provides a function dynamic enhancement method based on an application program, comprising:
[0057] When the target program is running, whether there is a preset key event is listened to; specifically, some common key events can be set, such as window closing, user clicking button, etc. When these key events occur, the program will automatically trigger the corresponding operation.
[0058] When there is a preset key event, event trigger information is obtained; specifically, system logs or error messages when the key event occurs can be captured and converted into a readable format. These information will be used for subsequent dynamic enhancement operation.
[0059] According to the event trigger information, a local plug-in is called through JVM Tool Interface; specifically, a local plug-in can be written, which can execute specific operations according to the event trigger information. This plug-in can be loaded into the Java Virtual Machine (JVM) of the target program, so as to be quickly called at runtime.
[0060] According to the local plug-in, the original bytecode is dynamically adjusted. Specifically, the code in the plug-in can be embedded into the bytecode of the target program, and the original bytecode is replaced at runtime. In this way, dynamic modification of the target program can be realized without recompiling and deploying the application program.
[0061] The principle of the above technical solution is:
[0062] In the actual implementation process, the JVM exposed extension interface (JVM Tool Interface) is used, so that the developer can register the custom callback method in the program startup, class loading and other key events, and the callback method customized by the developer will be executed before the main program of the target program, ensuring that the JVM of the target program perceives that this startup is required to be enhanced by the external program. When the event occurs, the JVM Tool Interface calls the registered callback method, which is the enhancement function logic written by the developer, and the JVM Tool Interface is loaded by the JVM in the form of a dynamic link library. At the same time, since the JVM Tool Interface is a bidirectional interface, one end is connected to the proxy program customized by the developer, and the other end is connected to the JVM of the target program, so that the local program developed by the developer can communicate with the JVM of the target program. Through the above mechanism, the developer's own enhancement function and the target program can communicate when executing key and specific events. At the same time, dynamic modification of the loaded class bytecode is also required to finally achieve the effect of enhancing the target program.
[0063] The beneficial effects of the above technical solution are:
[0064] Independent development: When the proxy program is written, it does not need to care about its location, and can be independently written, independently run, and independently debuged. At the same time, it does not care about the location of the target program, and even when the proxy program is written, the target program has not been created, and the coding can still be performed.
[0065] Independent deployment: In the deployment stage, the proxy program and the target program are completely separated physically, and they do not need to be in the same project. As long as they can directly communicate with each other through the network, they can be dynamically associated together automatically when the program runs. This solves the problem of physical strong binding during deployment, and such design makes the code of the enhancement part more flexible and suitable for a wider range of scenarios.
[0066] Flexible reuse: The one-to-one strong coupling mode of the existing technology between the proxy service and the target service is abandoned, and the proxy program can serve multiple target programs at the same time. The principle of realizing this effect is to let the target service actively find the proxy program, that is, the address of the proxy program is passed to the target program as a startup parameter during the startup of the target program, and the dynamic link is run at runtime. In this way, a piece of code with general enhancement function can provide services for multiple target services at the same time.
[0067] As an embodiment of the present application: the key event corresponds to a unique callback mode, wherein the callback mode is loaded into the main program by custom registration, and the callback mode runs before the main program of the target program.
[0068] The principle of the above technical solution is:
[0069] When the key event occurs, the main program encapsulates the custom-registered callback mode and related information into a message object, and sends it to the running target program through a specific communication mechanism. After receiving the message, the target program will call the corresponding local plug-in to perform related operations according to the custom-registered callback mode and related information in the message. Since the custom-registered callback mode has been determined and registered before the main program runs, the target program can immediately start the plug-in and begin execution when calling the local plug-in, thereby greatly shortening the response time and delay of the application program. At the same time, since the custom-registered callback mode runs before the main program of the target program, a series of complex operations can be completed before the target program starts.
[0070] As an embodiment of the present application: the JVM Tool Interface includes a first interface and a second interface, wherein the first interface is used to connect the local plug-in, and the second interface is connected with the JVM of the target program;
[0071] The local plug-in is an agent program used to enhance the running function of the target program;
[0072] The JVM Tool Interface is loaded by the JVM in the form of a dynamic link library.
[0073] The principle of the above technical solution is:
[0074] Specifically, the present application can add multiple interfaces to the JVM Tool Interface, each interface having different purposes and functions. For example, an interface named "EventListener" can be added to receive event notifications from the application program and pass them to the corresponding local plug-in. In addition, an interface named "MethodInterceptor" can be added to intercept specific methods of the target program and modify or call other services before or after the methods are executed.
[0075] The JVM Tool Interface can be loaded and managed using dynamic link libraries. A dynamic link library is a reusable code module that can be loaded into the memory of an application and dynamically referenced and replaced at runtime. This loading method can make the loading and management of the JVM Tool Interface more flexible and efficient, and can also avoid compatibility problems caused by version and other reasons.
[0076] In addition, in order to make the native plug-in better interact with the JVM Tool Interface, some additional APIs and methods can be provided for it. For example, some APIs for accessing and managing target program resources can be provided for the native plug-in, such as opening, closing, reading and modifying files, database records, network requests, etc. These APIs can allow the native plug-in to directly operate the underlying resources of the target program, thereby further improving the performance and user experience of the application.
[0077] As an embodiment of the present application: the JVM Tool Interface further comprises a ClassFileLoadHook event, wherein when the ClassFileLoadHook event is triggered, the current time is the modification time of the modified bytecode of the target program.
[0078] The principle of the above technical solution is:
[0079] When the JVM detects the ClassFileLoadHook event, the type and parameter information of the event can be used to determine which strategy should be used to adjust the bytecode of the target program. For example, if the ClassFileLoadHook event is caused by a specific class, a new processing logic can be inserted into the method of the class to improve the efficiency of the method.
[0080] In addition, in actual application, in order to ensure that the JVM Tool Interface can be correctly loaded and used, the Tool Interface also needs to be properly encapsulated and designed. For example, some general callback functions can be defined for performing specific tasks at different stages of the tool chain. In this way, even if some parts of the tool chain change, it will not affect the normal work of the entire tool chain.
[0081] As an embodiment of the present application: the dynamic adjustment of the original bytecode comprises:
[0082] Obtaining the modified bytecode of the native plug-in;
[0083] Fusing the modified bytecode and the original bytecode to generate the modified target bytecode.
[0084] The principle of the above technical solution is:
[0085] In the process of dynamically adjusting the original bytecode, the modified bytecode of the local plug-in needs to be obtained first. This step usually involves analysis, optimization and modification of the plug-in code to enable the plug-in to function in a wider range of application scenarios.
[0086] Next, the modified bytecode and the original bytecode are fused. The key to this process is how to ensure compatibility between the two to avoid exceptions or potential problems caused by incompatibility. For this purpose, various technical means can be used, such as string concatenation, array copying, pointer operation, etc. The ultimate goal is to generate the modified target bytecode, which contains the dynamically adjusted plug-in code and the original bytecode, thereby achieving comprehensive optimization of the target program.
[0087] Such dynamic adjustment can not only solve the performance problems of the application program in specific scenarios, but also improve the user experience. At the same time, since this adjustment is made without affecting the original code, it is easier to find and fix potential problems during later maintenance and updates.
[0088] As an embodiment of the present application: the dynamically adjusted original bytecode further comprises:
[0089] Setting a function logic test, wherein the function logic test includes a plurality of triggers, wherein the triggers are based on the function logic of the target program;
[0090] Obtaining the dynamically adjusted target bytecode as the input code of the function logic test of the target program;
[0091] Based on the input code, obtain the first trigger result of the function logic test, and generate a Webshell file of the execution parameter;
[0092] Input the Webshell file into the gain function, record the output result, and return the first response when the gain function output result is positive, wherein the first response is used to represent the execution function enhancement of the dynamically adjusted application program.
[0093] The principle of the above technical solution is:
[0094] The present application uses the dynamically adjusted target bytecode as the input code of the function logic test of the target program. At this time, various analysis techniques and models, such as fuzzy testing, simulation testing, etc., can be used to determine which tests are most important and add them to the function logic test set.
[0095] According to the input code, the first trigger result of the function logic test is obtained. These results will be used as an important basis for evaluating the effect of the enhanced application execution function after dynamic adjustment.
[0096] A webshell file for generating execution parameters is generated. This file is a special script that can be executed in the dynamically adjusted application, which can be used to start an additional test to verify the effect of the enhanced function of the dynamically adjusted application.
[0097] The generated webshell file is input into the gain function, and the output result is recorded. The gain function is a special algorithm that can improve or improve the performance of the application, which can improve the performance of the dynamically adjusted application to a new level.
[0098] When the output result of the gain function is positive, the first response is returned, which will be used to represent the enhanced execution function of the dynamically adjusted application.
[0099] As an embodiment of the present application: the modified bytecode and the original bytecode are also fused, which includes:
[0100] According to the original bytecode, a Token sequence is generated;
[0101] Based on the preset attention mechanism gate, the source code features of each Token bit in the Token sequence are determined;
[0102] The modified bytecode is analyzed by SAT to determine the enhancement features;
[0103] The enhancement features and the source code are fused by the joint decoder to determine the core logic of the target bytecode, and a text summary of the core logic is generated, wherein:
[0104] When the result of the text summary output by the joint decoder is positive, it means that dynamic adjustment can be performed;
[0105] When the result of the text summary output by the joint decoder is negative, it means that the current modified bytecode corresponding to the local plug-in cannot be dynamically adjusted.
[0106] The principle of the above technical solution is:
[0107] As shown in Figure 2 According to the original bytecode, a Token sequence is generated. Token is the smallest executable unit in the application, which can be code, data, string, etc. By generating a Token sequence, we can better understand the structure and logic of the application.
[0108] According to the preset attention mechanism gate, the source code features of each Token bit in the Token sequence are determined. The attention mechanism gate can identify the key parts in the Token sequence and determine their source and purpose. These information can help us better understand the behavior and logic of the application.
[0109] Static analysis is performed on the modified bytecode to determine the enhancement features. Static analysis is a method of identifying potential problems and opportunities in the code by analyzing the code. Through static analysis, we can find problems in the modified bytecode and optimize and improve it.
[0110] Joint decoding is performed on the enhancement features and the source code to determine the core logic of the target bytecode. Joint decoding is a method of combining enhancement features and decoders to generate new bytecode. Through joint decoding, we can ensure that the modified bytecode is consistent with the original bytecode and can improve the performance and stability of the application.
[0111] A text summary of the core logic is generated. Through the generation of the core logic, we can get a new, optimized application whose performance and user experience have been improved.
[0112] When the result of the text summary output by the joint decoder is positive, it means that dynamic adjustment can be performed. This means that we can change the way the core logic is executed to achieve dynamic adjustment of the application. This adjustment can be fine-grained or coarse-grained, depending on our needs.
[0113] As an embodiment of the present invention: the preset key event further includes:
[0114] The preset key event and the code segment associated with it in the original bytecode are taken as a listening group;
[0115] According to the listening group, one or more call buffers are set, and the local plug-in is cached in the call buffer, wherein the one or more call buffers are set in the local server of the target program;
[0116] When the preset key event is monitored, the target call buffer with the highest relevance to the preset key event in the local server is determined, and the target call buffer is taken as the most preferred call buffer, and:
[0117] In response to the registration information of the local plug-in corresponding to the target buffer, and according to the registration information, the enhancement target of the dynamic enhancement of the target program is determined.
[0118] The principle of the above technical solution is:
[0119] The application comprises: presetting a key event; setting a call cache according to the listening group; determining the highest priority call cache; and responding to the registration information of the target cache.
[0120] As an embodiment of the application, the call local plug-in also meets the following conditions:
[0121] In response to the event trigger information, the first interface of the JVM Tool Interface is configured to be in an available state, and the original bytecode of the target program is configured to be in an insertable state.
[0122] In response to the target plug-in in the local plug-in, the modified bytecode in the target plug-in is configured to be in an authenticated state.
[0123] The principle of the above technical solution is:
[0124] The application responds to the event trigger information and configures the first interface of the JVM Tool Interface to be in an available state, which allows developers to use the tool interface to write and load plug-ins. The original bytecode of the target program is configured to be in an insertable state, which means that the functionality of the target program can be enhanced without changing the original code. In response to the target plug-in in the local plug-in, the modified bytecode in the target plug-in is configured to be in an authenticated state. This step ensures the security and stability of the plug-in, and only authenticated plug-ins can be successfully loaded and used. Through the above technical solution, the embodiments of the application can dynamically enhance the application at runtime, realize real-time improvement and optimization of the application functionality, and ensure the stability and security of the system.
[0125] In practical applications, we can extend and improve the above technical solution for different types of applications and scenarios. For example, we can add more interfaces and plug-ins to support more types of functionality enhancement requirements. At the same time, we can also develop more intelligent and automated tools to simplify the process of plug-in writing, loading and management, and improve work efficiency.
[0126] As an embodiment of the present application: the callback mode is set by the following steps:
[0127] Switch the main program to a trusted registration mode, and define the callback mode corresponding to each preset key event according to the preset key event.
[0128] The principle of the above technical solution is that:
[0129] In the process of calling back on the key events, the main program is adjusted to a trusted registration mode when the administrator registers the callback mode, and then the callback registration is realized.
[0130] Obviously, those skilled in the art can make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application belong to the scope of the claims of the present application and their equivalents, the present application also intends to include these modifications and variations.
Claims
1. A method for dynamically enhancing functionality based on an application, the method comprising: The method comprises the following steps: monitoring whether a preset key event exists when a target program runs; obtaining event trigger information when the preset key event exists; calling a local plug-in through a JVM Tool Interface according to the event trigger information; dynamically adjusting original bytecode according to the local plug-in; the dynamically adjusting original bytecode comprises the following steps: obtaining modified bytecode of the local plug-in; fusing the modified bytecode and the original bytecode to generate modified target bytecode; the fusing the modified bytecode and the original bytecode further comprises the following steps: generating a Token sequence according to the original bytecode; determining source code features of each Token bit in the Token sequence based on a preset attention mechanism gate; performing SAT analysis on the modified bytecode to determine enhanced features; fusing the enhanced features and the source code features through a joint decoder to determine core logic of the target bytecode and generate a text summary of the core logic, wherein: when the result of the text summary output by the joint decoder is positive, it indicates that dynamic adjustment can be performed; when the result of the text summary output by the joint decoder is negative, it indicates that the current local plug-in corresponding to the modified bytecode cannot be dynamically adjusted.
2. The method of claim 1, wherein the application-based function dynamic enhancement method is characterized by, The key event corresponds to a unique callback mode, wherein the callback mode is loaded into the main program by a self-defined registration mode, and the callback mode runs before the main program of the target program.
3. The method of claim 1, wherein the application-based function is dynamically enhanced by: The JVM Tool Interface comprises a first interface and a second interface, wherein the first interface is used to connect the local plug-in, and the second interface is connected with the JVM of the target program; the local plug-in is an agent program used to enhance the running function of the target program; the JVM Tool Interface is loaded by the JVM in the form of a dynamic link library.
4. The method of claim 1, wherein the application-based function dynamic enhancement method is characterized by, The JVM Tool Interface further comprises a ClassFileLoadHook event, wherein when the ClassFileLoadHook event is triggered, the current time is taken as a modification time for modifying the bytecode of the target program.
5. The method of claim 1, wherein the application-based function dynamic enhancement method is characterized by, After the dynamically adjusting the original bytecode, the method further comprises the following steps: setting a function logic test, wherein the function logic test comprises a plurality of triggers, and the triggers are set based on the function logic of the target program; obtaining the dynamically adjusted target bytecode as input code for the function logic test of the target program; based on the input code, obtaining a first trigger result of the function logic test and generating a Webshell file of an execution parameter; inputting the Webshell file into a gain function, recording an output result, and returning a first response when the output result of the gain function is positive, wherein the first response is used to represent the execution function enhancement of the dynamically adjusted application program.
6. The method of claim 1, wherein the application-based function dynamic enhancement is performed by a function enhancement module of the application. 5 The preset key event further comprises the following steps: taking the preset key event and a code segment associated with the original bytecode as a monitoring group; setting one or more call buffers according to the monitoring group and caching the local plug-in in the call buffers, wherein the one or more call buffers are set in a local server of the target program; When a preset key event is monitored, a target call cache with the highest correlation to the preset key event in a local server is determined, and the target call cache is taken as a most prior call cache, and In response to registration information of a local plug-in corresponding to the target cache, and according to the registration information, an enhancement target of dynamic enhancement of the target program is determined.
7. The method of claim 3, wherein the application-based function is dynamically enhanced by the application server based on the user's profile. 5 The calling local plug-in also meets the following states: In response to the event trigger information, a first interface of the JVM Tool Interface is configured to be in an available state, and original bytecode of the target program is configured to be in an insertable state; In response to a target plug-in in the local plug-in, modified bytecode in the target plug-in is configured to be in an authenticated state.
8. The method of claim 2, wherein the application-based function is dynamically enhanced by, The callback mode is set through the following steps: The main program is switched to a trusted registration mode, and according to preset key events, a callback mode corresponding to each preset key event is defined.
Citation Information
Patent Citations
Execution of asset tokenization and ownership with machine learning technology
WO2025046281A1