Program optimization method and device, program product and electronic equipment

By collecting and fusing the static, dynamic, and semantic features of the target program, and using a neural network model for program optimization, the problem of insufficient static scanning results in existing technologies is solved, and the program optimization is automated and efficient, thereby improving the performance of financial institution software systems.

CN121326338APending Publication Date: 2026-01-13INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511392521.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing technologies optimize programs based solely on static scanning results, resulting in poor optimization performance. This is especially true in scenarios involving high-concurrency transaction processing and big data analysis, as they fail to effectively capture the program's actual behavior and resource consumption during dynamic operation, leading to insufficient effectiveness and comprehensiveness of optimization measures.

Method used

The system collects static, dynamic, and semantic features of the target program, determines program labels through feature fusion, and optimizes performance using a neural network model based on historical programs of financial institutions. This includes creating control flow graphs, data dependency graphs, and function call graphs, combining hierarchical attention fusion and deep embedding clustering algorithms, dynamically generating test data, and performing automated optimization through a preset optimizer.

Benefits of technology

It has achieved automation, precision, and efficiency in program optimization, improved the efficiency and accuracy of program code optimization, reduced the workload of technical personnel, and can identify performance bottlenecks that are difficult to find in static analysis, thereby improving the performance of financial institution software systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326338A_ABST
    Figure CN121326338A_ABST
Patent Text Reader

Abstract

The invention discloses a program optimization method and device, a program product and electronic equipment, and relates to the field of financial science and technology, the method comprises the steps that static characteristics and dynamic characteristics of a target program are collected, the static characteristics are at least used for representing control flow information, data dependence information and function call information of the target program, and the dynamic characteristics are at least used for representing control flow information of the target program; the dynamic characteristics are at least used for representing function execution information in the target program; performing feature fusion on the static features and the dynamic features to obtain target features of the target program; based on the target feature, determining a program label of the target program, the program label being used for representing a program type of the target program; and performing performance optimization on the target program based on the target feature through a preset model corresponding to the program tag. The technical problem that in the prior art, the program optimization effect is poor due to the fact that the program is optimized only based on the static scanning result of the program is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of financial technology, and more specifically, to a program optimization method, apparatus, program product, and electronic device. Background Technology

[0002] In the fintech field, optimizing the performance of financial system programs is crucial for improving software efficiency, user experience, and system reliability. Traditional optimization methods primarily rely on static code analysis, which involves statically scanning and inspecting the source code to identify potential problems and provide corresponding improvement suggestions. However, with the increasing complexity and dynamic operating environments of software systems, optimizing programs solely based on static scanning results has revealed numerous limitations.

[0003] Currently, most enterprises use static code analysis tools that can effectively detect logical errors, redundant code, and coding style issues at the code level. However, static scanning is difficult to capture the actual behavior and resource consumption of a program during dynamic operation and cannot reach the deep performance bottlenecks in the code.

[0004] For example, in applications such as high-concurrency transaction processing and big data analysis, programs may suffer severe performance degradation due to memory leaks, low algorithm efficiency, and other reasons. These problems often cannot be predicted in advance through simple static code analysis. This means that although static analysis can identify some potential optimization points, it lacks insight into the runtime environment and dynamic behavior, making it difficult to ensure the effectiveness and comprehensiveness of optimization measures, thus causing the technical problem of poor code optimization effect in existing technologies.

[0005] There is currently no effective solution to the above problems. Summary of the Invention

[0006] This application provides a program optimization method, apparatus, program product, and electronic device to at least solve the technical problem of poor program optimization effect caused by optimizing the program based solely on the static scanning results of the program in the prior art.

[0007] According to one aspect of this application, a program optimization method is provided, comprising: collecting static features, dynamic features, and semantic features of a target program, wherein the static features are used to characterize at least the control flow information, data dependency information, and function call information of the target program; the dynamic features are used to characterize at least the function execution information in the target program; and the semantic features are used to characterize the function names, variable names, and comment information in the target program; performing feature fusion on the static features, dynamic features, and semantic features to obtain target features of the target program; determining program tags for the target program based on the target features, wherein the program tags are used to characterize the program type of the target program; and performing performance optimization on the target program based on the target features using a preset model corresponding to the program tags, wherein the preset model is a neural network model trained based on the program code and performance test results of historical programs of financial institutions.

[0008] Optionally, the step of collecting static features of the target program includes: creating a control flow graph, a data dependency graph, and a function call graph based on the program code of the target program, wherein the control flow graph is used to represent the logical branch flow of the target program, the data dependency graph is used to represent the dependency relationship between the data involved in the target program, and the function call graph is used to represent the call relationship between the functions included in the target program; and determining the static features of the target program based on the control flow graph, the data dependency graph, and the function call graph.

[0009] Optionally, the step of determining the static features of the target program based on the control flow graph, data dependency graph, and function call graph includes: extracting features from the control flow graph to obtain the first static feature of the target program, wherein the first static feature is used to characterize the number of nodes, the number of edges, and the loop complexity of the control flow graph; extracting features from the data dependency graph to obtain the second static feature of the target program, wherein the second static feature is used to characterize the critical path length and dependency chain depth of the data dependency graph; extracting features from the function call graph to obtain the third static feature of the target program, wherein the third static feature is used to characterize the in-degree and out-degree information corresponding to the function call graph; and using the first static feature, the second static feature, and the third static feature as the static features of the target program.

[0010] Optionally, the step of optimizing the performance of the target program based on the target features using a preset model corresponding to the program tag includes: determining a first parameter based on the program tag and the target features, wherein the first parameter is used to characterize the state of the target program; determining a second parameter based on the first parameter using the preset model corresponding to the program tag, wherein the second parameter is used to determine the action performed by the preset model; generating test data based on the second parameter using the preset model corresponding to the program tag; and optimizing the performance of the target program based on the test data and the program tag.

[0011] Optionally, the step of optimizing the performance of the target program based on test data and program tags includes: running the target program with test data as input parameters; detecting the performance indicators during the operation of the target program through a preset performance monitor; generating a target signal when the difference between the performance indicator and the preset indicator is greater than the preset difference; and optimizing the performance of the target program based on the performance indicators and program tags through the preset optimizer after receiving the target signal.

[0012] Optionally, the step of optimizing the target program based on performance metrics and program tags using a preset optimizer includes: determining the optimization strategy for the target program based on performance metrics and program tags using a preset optimizer; generating an optimization script for the target program based on the optimization strategy; and running the optimization script to automatically optimize the performance of the target program.

[0013] Optionally, after detecting the performance indicators during the execution of the target program through a preset performance monitor, the program optimization method further includes: updating the first parameter based on the performance indicators and test data to obtain a new first parameter; and iteratively optimizing the target program based on the new first parameter.

[0014] According to another aspect of this application, a program optimization apparatus is also provided, comprising: a feature acquisition unit for acquiring static features, dynamic features, and semantic features of a target program, wherein the static features are used to characterize at least the control flow information, data dependency information, and function call information of the target program; the dynamic features are used to characterize at least the function execution information in the target program; and the semantic features are used to characterize the function names, variable names, and comment information in the target program; a feature fusion unit for fusing the static features, dynamic features, and semantic features to obtain target features of the target program; a label determination unit for determining program labels of the target program based on the target features, wherein the program labels characterize the program type of the target program; and a target optimization unit for optimizing the performance of the target program based on the target features using a preset model corresponding to the program labels, wherein the preset model is a neural network model trained based on the program code and performance test results of historical programs of financial institutions.

[0015] According to another aspect of this application, a computer program product is also provided, which stores a computer program, wherein the program optimization method described above is used to control the computer program product to execute any of the above methods when the computer program is running.

[0016] According to another aspect of this application, an electronic device is also provided, wherein the electronic device includes one or more processors and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the program optimization method of any one of the above.

[0017] In this application, static features, dynamic features, and semantic features of the target program are first collected. Static features are used to characterize at least the control flow information, data dependency information, and function call information of the target program. Dynamic features are used to characterize at least the function execution information of the target program. Semantic features are used to characterize the function names, variable names, and comment information of the target program. Then, the static, dynamic, and semantic features are fused to obtain the target features of the target program. Next, based on the target features, this application determines the program tag of the target program, where the program tag characterizes the program type. Finally, this application optimizes the performance of the target program based on the target features using a preset model corresponding to the program tag. The preset model is a neural network model trained based on the program code and performance test results of historical programs from financial institutions.

[0018] As described above, this application employs a method of simultaneously collecting static, dynamic, and semantic features of the target program to obtain target features that comprehensively reflect the characteristics of the target program. Subsequently, this application determines the program label, i.e., the type of the target program, based on the target features. Then, this application automatically optimizes the performance of the target program through an intelligent agent (i.e., a preset model) that matches the program type. While reducing the workload of technical personnel, this application improves the efficiency and accuracy of program code optimization by controlling the intelligent agent to dynamically generate test data and monitor performance in a closed-loop optimization process. This achieves the technical effect of improving the program optimization effect and solves the technical problem of poor program optimization effect caused by optimizing the program based solely on the static scanning results in the prior art. Attached Figure Description

[0019] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0020] Figure 1 This is a hardware structure block diagram of an optional computer terminal (or mobile device) for implementing a program optimization method according to an embodiment of this application;

[0021] Figure 2 This is a flowchart of an optional program optimization method according to an embodiment of this application;

[0022] Figure 3 This is a schematic diagram of an optional program optimization apparatus according to an embodiment of this application;

[0023] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] It should also be noted that all information and data (including but not limited to information used for display and analysis) and data (including but not limited to the code data of the target program) involved in this application are information and data authorized by the user or fully authorized by all parties. For example, if there is an interface between this system and the relevant user or organization, before obtaining the relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information from the aforementioned user or organization.

[0027] Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of relevant information and data involved in this application all comply with the relevant laws, regulations, and standards of the relevant regions, and necessary confidentiality measures have been taken. This application does not violate public order and good morals. In addition, this application provides a corresponding operation entry point for users to choose to agree to or refuse authorization. If the user chooses to refuse authorization, the corresponding expert decision-making process will be initiated.

[0028] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0029] Control Flow Graph (CFG) characteristics: It includes the program's input, output, calls to other programs, branches, loops, and other features, which can be obtained through program analysis tools.

[0030] Data Dependency Graph (DDG) features include program nodes, operations on those nodes, and relationships between nodes, which can be obtained through program analysis tools.

[0031] Natural Language Processing (NLP) technology is used to extract the syntactic and semantic information of a program.

[0032] Hierarchical attention fusion mechanism: a technique for fusing features at different levels, which can overcome the shortcomings of simple fusion methods (such as splicing, addition, averaging) and make the fused features more comprehensively express information.

[0033] Deep embedding clustering algorithm: A classification algorithm that uses an embedding network to nonlinearly transform and refine the feature values ​​obtained by the hierarchical attention fusion mechanism, and uses soft assignment and sharpening of the target distribution to transform these features into a new space, while completing clustering in this space.

[0034] Reinforcement Learning Agent (RL-Agent): The core intelligent agent in the reinforcement learning framework, which influences the environment by perceiving the state of the environment, performing actions, and receiving reward signals from the environment, thereby learning how to adopt the optimal strategy to maximize its long-term cumulative reward.

[0035] According to an embodiment of this application, an embodiment of a program optimization method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0036] The methods and embodiments provided in this application can be executed on mobile terminals, computer terminals, or similar computing devices. Figure 1 This is a hardware structure block diagram of an optional computer terminal (or mobile device) for implementing a program optimization method according to an embodiment of this application. Figure 1As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0037] Optionally, it should be noted that the aforementioned one or more processors 102 and / or other data processing circuitry may generally be referred to herein as "data processing circuitry". This data processing circuitry may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuitry may be a single, independent processing module, or may be wholly or partially integrated into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuitry serves as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0038] Optionally, the memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the program optimization method in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned program optimization method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0039] Optionally, the transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0040] Alternatively, the display can be configured as a touchscreen liquid crystal display (LCD) that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0041] Optionally, under the above operating environment, this application provides a program optimization system (hereinafter referred to as the program optimization system) for executing the program optimization method in this application. Figure 2 This is a flowchart of an optional program optimization method according to an embodiment of this application, such as... Figure 2 As shown, the method includes the following steps:

[0042] Step S201: Collect the static features, dynamic features and semantic features of the target program. The static features are used to characterize at least the control flow information, data dependency information and function call information of the target program. The dynamic features are used to characterize at least the function execution information in the target program. The semantic features are used to characterize the function names, variable names and comment information in the target program.

[0043] Optionally, static features refer to features obtained by analyzing the structure and syntax of program code without running the program. These mainly include control flow graph features (i.e., first static features), data dependency graph features (i.e., second static features), and function call graph features (i.e., third static features).

[0044] Optionally, dynamic features refer to features obtained by monitoring the actual execution during program operation, such as function call frequency and execution frequency of basic program blocks. Dynamic features reveal the behavior and performance of the target program under specific input conditions.

[0045] In step S201, the program optimization system comprehensively evaluates the internal logic, operation status, and semantic information of the target program by collecting static features, dynamic features, and semantic features. This lays a solid feature foundation for subsequent feature fusion and personalized optimization. Compared with traditional methods that rely solely on static analysis, this comprehensive feature collection method significantly enhances the program optimization system's understanding of program operation behavior, thereby enabling it to identify performance bottlenecks that are difficult to find in static analysis.

[0046] Step S202: Perform feature fusion on static features, dynamic features and semantic features to obtain the target features of the target program.

[0047] Optionally, during the feature fusion process, the program optimization system utilizes a hierarchical attention fusion mechanism to fuse static features, dynamic features, and semantic features obtained from multiple dimensions into a highly condensed target feature. This ensures that all relevant information is fully utilized while avoiding interference from redundant information, thereby improving the efficiency of subsequent program label determination based on the target feature.

[0048] In step S202, the program optimization system effectively integrates the static, dynamic, and semantic information of the program through feature fusion, which solves the problems of single features and insufficient utilization of program information in traditional optimization methods. This is beneficial for the accurate determination of the program type and improves the accuracy of the subsequent specified optimization strategy.

[0049] Step S203: Based on the target features, determine the program tag of the target program, wherein the program tag is used to characterize the program type of the target program.

[0050] Optionally, the program label, which is the label assigned by the program optimization system after classifying the target features through a deep embedding clustering algorithm, is used to clearly indicate the specific type of the target program, such as computationally intensive or memory-intensive.

[0051] In step S203, by classifying the target programs, the program optimization system can select the corresponding agent according to the type of the target program and formulate targeted optimization strategies. This avoids the problem of low accuracy of the priority strategy that may be caused by a uniform optimization strategy, and achieves more refined and efficient program optimization.

[0052] Step S204: Optimize the performance of the target program based on the target features using the preset model corresponding to the program label. The preset model is a neural network model trained based on the program code and performance test results of historical programs of financial institutions.

[0053] Optionally, the aforementioned preset model refers to an intelligent agent trained based on a large amount of historical program code and performance test results from financial institutions, i.e., a neural network model.

[0054] Optionally, in step S204, the preset model proposes specific optimization suggestions based on the target characteristics, including but not limited to suggestions for improvement in code structure adjustment, algorithm optimization, and resource allocation strategies.

[0055] In step S204, the program optimization system automatically performs performance optimization through a preset model, realizing an automated and intelligent program optimization process. The preset model is trained based on historical data and can quickly and accurately propose optimization suggestions based on the target features of the target program, greatly reducing the manual cost and workload required for program code optimization. In addition, since the training samples of the preset model include specific application scenarios and optimization needs of financial institutions, this method is particularly suitable for improving the efficiency and response speed of financial institution software, and has high practical value and pertinence.

[0056] In summary, the technical solution of this application effectively solves the limitations of existing static scanning program optimization methods through comprehensive feature acquisition, efficient feature fusion, accurate program classification, and intelligent performance optimization, achieving automation, precision, and efficiency in program optimization, and promoting the performance improvement of financial institution software systems.

[0057] As described above, this application employs a method of simultaneously collecting static, dynamic, and semantic features of the target program to obtain target features that comprehensively reflect the characteristics of the target program. Subsequently, this application determines the program label, i.e., the type of the target program, based on the target features. Then, this application automatically optimizes the performance of the target program through an intelligent agent (i.e., a preset model) that matches the program type. While reducing the workload of technical personnel, this application improves the efficiency and accuracy of program code optimization by controlling the intelligent agent to dynamically generate test data and monitor performance in a closed-loop optimization process. This achieves the technical effect of improving the program optimization effect and solves the technical problem of poor program optimization effect caused by optimizing the program based solely on the static scanning results in the prior art.

[0058] In one optional embodiment, the program optimization system first creates a control flow graph, a data dependency graph, and a function call graph based on the program code of the target program. The control flow graph is used to represent the logical branch flow of the target program, the data dependency graph is used to represent the dependency relationship between the data involved in the target program, and the function call graph is used to represent the call relationship between the functions included in the target program. Then, the program optimization system determines the static characteristics of the target program based on the control flow graph, the data dependency graph, and the function call graph.

[0059] Optionally, logical branch flow refers to the different execution paths caused by conditional statements and loop structures in the program.

[0060] Optionally, the process of constructing a control flow graph includes: first, identifying all logical branch points in the program through syntax analysis, such as conditional statements, loop structures, and function calls; and drawing a logical branch flow graph of the program based on all identified logical branch points, where each node represents a basic block, and the connection between nodes represents the transfer of control flow. The control flow graph not only shows the execution path of the program, but also reveals the jumps and loops caused by various conditions in the code.

[0061] Optionally, the dependency relationship between data refers to the order of operations that must be completed before data can be used in a program.

[0062] Optionally, the process of constructing a data dependency graph includes: during program execution, the use of variables and data often has specific dependencies. The program optimization system constructs a data dependency graph by analyzing data flow and operation sequence, thereby visually showing which data is referenced by which operations, as well as the order and dependency of the references. The construction of the data dependency graph helps to identify potential code refactoring opportunities, such as eliminating unnecessary data locking or improving parallelism.

[0063] Optionally, the calling relationship between functions refers to the hierarchical structure and order of function calls in the program.

[0064] Optionally, function calls are a common pattern in modern programming. By tracing the occurrence and return of function calls, the program optimization system can construct a function call graph, thereby clearly marking the call hierarchy and dependencies between functions, and thus helping the program optimization system understand the modular architecture of the program and optimize the function call order.

[0065] In the above embodiments, the program optimization system creates control flow graphs, data dependency graphs, and function call graphs, and extracts static features from them. This allows for a comprehensive and detailed depiction of the target program's architecture and behavioral patterns. Through a series of graph analyses and feature extractions, it not only helps to deeply understand the program's static attributes but also provides high-quality input for subsequent advanced analysis techniques such as hierarchical attention fusion mechanisms and deep embedding clustering algorithms. This ensures the accuracy and effectiveness of program optimization suggestions, thereby improving the automation level and targeting of program optimization and reducing optimization biases caused by a lack of dynamic runtime information.

[0066] In one optional embodiment, the program optimization system first extracts features from the control flow graph to obtain the first static features of the target program, wherein the first static features are used to characterize the number of nodes, the number of edges, and the loop complexity of the control flow graph. Then, the program optimization system extracts features from the data dependency graph to obtain the second static features of the target program, wherein the second static features are used to characterize the critical path length and dependency chain depth of the data dependency graph. Subsequently, the program optimization system extracts features from the function call graph to obtain the third static features of the target program, wherein the third static features are used to characterize the in-degree and out-degree information of the corresponding function call graph. Finally, the program optimization system uses the first static features, the second static features, and the third static features as the static features of the target program.

[0067] Optionally, the first static feature, namely the control flow graph feature, reflects the complexity of the program structure and the diversity of the control flow. Specifically, the first static feature includes the number of nodes, the number of edges, and the loop complexity of the control flow graph. The number of nodes reflects the basic building blocks of the program, the number of edges reveals the complexity of the control flow, and the loop complexity indicates the depth and frequency of the loop structure.

[0068] Optionally, by extracting the first static features, the program optimization system can evaluate the control flow structure of the program in a quantitative way, thereby better understanding its execution logic and potential optimization space. Through the first static features, redundant paths, complex loop structures, etc. that may exist in the program can be identified, thus laying the foundation for subsequent program optimization.

[0069] Optionally, the second static feature, namely the data dependency graph feature, reveals the coherence of data processing and potential for efficiency improvement. Specifically, the second static feature covers the critical path length and dependency chain depth in the data dependency graph. These two metrics can help evaluate the effectiveness of data processing and the parallel potential of the program. The critical path length involves the longest dependency chain and has a significant impact on the program execution time, while the dependency chain depth indicates the level of data processing and is crucial for memory management and concurrent execution optimization.

[0070] Optionally, by extracting the second static feature, i.e. analyzing data dependencies, the program optimization system can locate data processing bottlenecks, optimize data flow to reduce unnecessary waiting and locking time, and accelerate the data processing process. In particular, the extraction of the second static feature helps to improve memory usage strategies and enhance the parallel execution capability of the program, thereby improving overall performance.

[0071] Optionally, the third static feature, namely the function call graph feature, reflects the frequency of function calls and the degree of modularity of the program. Specifically, the third static feature includes the in-degree and out-degree information of the function call graph, namely the number of times a function is called and the number of times a function calls other functions, thereby reflecting the degree of modularity of the program and the intensity of interaction between functions.

[0072] Optionally, by extracting third static features, the program optimization system can identify frequently called functional modules and possible module coupling problems, thereby providing guidance for optimizing function call order, reducing unnecessary function call overhead, and improving the modular design of the program. The introduction of third static features helps to simplify the code in the future, thereby enhancing the maintainability and execution efficiency of the target code.

[0073] In summary, the program optimization system achieves a deep understanding of the target program's structural characteristics by extracting the first, second, and third static features from the control flow graph, data dependency graph, and function call graph, respectively. This provides a solid foundation for subsequent feature fusion, program classification, and performance optimization based on neural network models. This comprehensive static feature analysis can accurately locate optimization points in the program, guide intelligent optimization strategies, and improve the automation level and optimization effect in the software development and maintenance process of financial institutions.

[0074] In one optional embodiment, the program optimization system first determines a first parameter based on program tags and target features, wherein the first parameter is used to characterize the state of the target program. Then, the program optimization system determines a second parameter based on the first parameter using a preset model corresponding to the program tag, wherein the second parameter is used to determine the action performed by the preset model. Next, the program optimization system generates test data based on the second parameter using the preset model corresponding to the program tag. Finally, the program optimization system optimizes the performance of the target program based on the test data and program tags.

[0075] Optionally, program tags, which are the results of marking the type of the target program, can be classified into at least compute-intensive, memory-intensive, and I / O-intensive types based on its control flow, data dependencies, and operating mode.

[0076] Optionally, the first parameter represents the feature value of the target program under different states, which is used to describe the program's current running configuration, performance status and test data characteristics, and serves as the basis for the preset model (RL-Agent, reinforcement learning agent) to select actions.

[0077] Optionally, the process of determining the first parameter is essentially to transform the program label and target features into an operable numerical form, which is convenient for the program optimization system to understand and process. This transformation enables the preset model to make action decisions based on the current program state, effectively guiding the generation of test data and the direction of performance optimization. Through the first parameter, the agent can quickly grasp the real-time state of the target program, ensuring that the optimization suggestions are highly consistent with the actual operation of the program, avoiding the misjudgments and delays that may exist in traditional optimization methods.

[0078] Optionally, the second parameter refers to the action to be performed by the preset model, i.e. the strategy for generating test data, such as data size, format, distribution, etc. These parameters will guide the specific generation process of test data.

[0079] Optionally, the determination of the second parameter is based on the selection of the first parameter (i.e., the current program state). This step ensures that the generated test data can effectively trigger the critical path and performance bottleneck in the target program. Different types of programs correspond to different preset models and strategies, which means that the generation of the second parameter has extremely high pertinence and flexibility, and can adapt to the testing needs of various program characteristics. Through the above mechanism, test data generation is no longer a blind operation, but ensures a deep understanding of the program state and type, thereby improving the representativeness of the subsequently generated test data and the reliability of the test results.

[0080] Optionally, the test data generated based on the second parameter can purposefully examine specific parts of the program, especially performance-sensitive areas that are not easily covered or ignored in regular tests. This process avoids the disadvantages of low testing efficiency and insufficient coverage that may be caused by regular random test data, ensuring that each test can have a substantial impact on program performance, thereby promoting the optimization process. Furthermore, the accurate generation of test data, combined with the learning history of the preset model, provides solid data support and strategy guidance for subsequent performance optimization.

[0081] Optionally, performance optimization is implemented based on feedback from test data and an understanding of the program type. This process forms a self-correcting closed loop, enabling iterative optimization of the target program. Compared to traditional static code analysis, this method can more accurately locate and resolve runtime performance issues, achieving true dynamic optimization. Through continuous testing and optimization, the target program can gradually overcome initial performance bottlenecks, achieving higher operating efficiency and a better user experience. Furthermore, by combining program tags, optimization strategies can be more focused on the core requirements of the target program, avoiding over-optimization or inappropriate optimization.

[0082] In summary, by combining program tags and target features, the above embodiments achieve intelligent, automated, and personalized program optimization through dynamically generating test data and iteratively optimizing the program. The above steps not only effectively overcome the limitations of static analysis methods in the prior art, but also significantly improve the accuracy and efficiency of program performance optimization.

[0083] In one optional embodiment, the program optimization system first uses the test data as input parameters for the target program and runs the target program. Then, the program optimization system uses a preset performance monitor to detect the performance indicators during the execution of the target program.

[0084] Optionally, if the difference between the performance index and the preset index is greater than the preset difference, the program optimization system generates a target signal. After the preset optimizer receives the target signal, the program optimization system optimizes the target program based on the performance index and program label through the preset optimizer.

[0085] Optionally, test data refers to the program code input parameters generated by the preset model corresponding to the program label based on the second parameter. By using test data as the program's input data, the target program's operating environment and load conditions in the real world can be simulated, ensuring the effectiveness and representativeness of the test. This process can expose the program's potential defects and performance bottlenecks under high load or specific conditions, providing a basis for subsequent performance indicator detection and optimization.

[0086] Optionally, a performance monitor is preset, which is a tool or component used to monitor and record key performance data of the target program in real time, such as execution time, memory usage, CPU (Central Processing Unit) utilization, etc.

[0087] Optionally, real-time performance monitoring via a preset performance monitor ensures an accurate grasp of the target program's running status and allows for the timely detection of any factors affecting performance, such as resource bottlenecks or low algorithm efficiency. This mechanism provides objective and quantitative data support, offering a clear direction for performance optimization.

[0088] Optionally, if the difference between the performance index and the preset index is greater than the preset difference, the program optimization system generates a target signal. The above target signal generation mechanism ensures that the optimization process will only be initiated when the performance gap reaches a certain severity, avoiding invalid or excessive optimization attempts and ensuring that resources are reasonably allocated to the places that really need optimization. This mechanism improves the targeting of the optimization process and improves the utilization rate of optimization resources.

[0089] Optionally, the intervention of the preset optimizer enables automatic performance optimization based on test feedback. It can intelligently adjust the program structure, algorithm, or resource configuration according to the performance indicators generated by the test data and the program type label, so as to improve execution efficiency and reduce resource consumption. This automatic optimization method greatly reduces the need for manual intervention and improves the speed and accuracy of optimization. Especially in large-scale software systems, it can significantly improve the performance and stability of the entire financial software system.

[0090] In summary, the above embodiments construct a complete dynamic program performance optimization system through the automated optimization process of dynamically generating test data, real-time performance indicator monitoring, target signal triggering mechanism, and preset optimizer. This mechanism can comprehensively and accurately capture and respond to the performance fluctuations of the target program during runtime, achieve targeted and timely performance improvement, reduce human interference and resource waste, and effectively improve the running performance of software programs.

[0091] In one optional embodiment, the program optimization system first determines the optimization strategy for the target program based on performance indicators and program tags using a preset optimizer. Then, the program optimization system generates an optimization script for the target program based on the optimization strategy. Finally, the program optimization system runs the optimization script to automatically optimize the performance of the target program.

[0092] Optionally, the optimization strategy, i.e. the optimization scheme determined by the preset optimizer based on the information obtained in the first step, includes but is not limited to algorithm improvement, resource scheduling optimization, and code rewriting.

[0093] Optionally, the program optimization system transforms optimization strategies into script files containing specific execution instructions, converting abstract optimization strategies into key steps of executable commands. This ensures that optimization strategies can be applied accurately to the target program, avoiding human errors that may result from manual modifications, and also making the optimization process more transparent and traceable.

[0094] Optionally, by running optimization scripts to automatically optimize the target program, not only is the speed of program code optimization improved, but errors caused by human intervention are also avoided, thus improving the accuracy of program code optimization.

[0095] In summary, by using the intelligent decision-making of the preset optimizer and the automated execution of the optimization script, the target program can be automatically identified, optimized in a targeted manner, and its performance continuously improved. This method overcomes the problems of subjective judgment and low efficiency in traditional optimization methods, and ensures the optimization results.

[0096] In one optional embodiment, after detecting the performance indicators during the execution of the target program through a preset performance monitor, the program optimization system updates the first parameter based on the performance indicators and test data to obtain a new first parameter. Then, the program optimization code iteratively optimizes the target program based on the new first parameter.

[0097] Optionally, the program optimization system updates the first parameter based on performance metrics and test data. It can integrate the latest round of test data and performance metric feedback into the first parameter to reflect the real-time status and performance of the target program. The updated first parameter (i.e., the new first parameter) can more accurately describe the current running status of the program, including potential performance bottlenecks and optimization space. The analysis and decision-making are carried out again based on the new first parameter, which ensures the real-time and targeted nature of the optimization strategy and avoids ineffective or counterproductive optimization that may be caused by optimization based on outdated information.

[0098] Optionally, after receiving the updated first parameters, the preset optimizer can re-evaluate the effectiveness of the optimization strategy based on more accurate program state information and make adjustments as necessary. The iterative optimization process allows the optimizer to continuously fine-tune the optimization strategy based on the dynamic feedback of the program, ensuring that each optimization brings actual performance improvement. This continuous optimization loop improves the accuracy and efficiency of optimization, enabling the target program to gradually approach or reach the upper limit of its performance potential, rather than just performing a one-time static optimization.

[0099] As described above, this application employs a method of simultaneously collecting both static and dynamic features of the target program to obtain target features that comprehensively reflect the characteristics of the target program. Subsequently, this application determines the program label, i.e., the type of the target program, based on the target features. Then, this application automatically optimizes the performance of the target program through an intelligent agent (i.e., a preset model) that matches the program type. While reducing the workload of technical personnel, this application improves the efficiency and accuracy of program code optimization by controlling the intelligent agent to dynamically generate test data and monitor performance in a closed-loop optimization process. This achieves the technical effect of improving the program optimization effect and solves the technical problem of poor program optimization effect caused by optimizing the program based solely on the static scanning results in the prior art.

[0100] In one alternative embodiment, a method is provided for automatically generating test data and optimizing a program based on the test data, the method comprising the following steps:

[0101] 1. Obtaining program assemblies: Control flow graph features are obtained by extracting the CFG, number of nodes, number of edges, and loop complexity of a single program; data dependency graph features are obtained by extracting the DDG and calculating critical path length and dependency chain depth; function call graph features are obtained by extracting function call relationships and calculating in-degree and out-degree. The features extracted above are static features.

[0102] 2. Run a single program using representative input, collect execution traces, and count the frequency of function calls and the execution frequency of basic blocks. The features extracted above are dynamic features.

[0103] 3. Use natural language processing techniques to extract semantic vectors for individual function names, variable names, and comments. The features extracted above belong to semantic features.

[0104] 4. Use a hierarchical attention fusion mechanism to fuse the features extracted from a single program to obtain the target features of the program.

[0105] 5. Using a deep embedding clustering algorithm, classify the target features obtained from the above steps for all programs in the program set, and obtain the program label for each target program.

[0106] 6. For each program label, a dedicated RL-Agent is used to guide fuzz testing. Different RL-Agents are used for different program categories. For example, for computationally intensive programs, the reward function of the reinforcement learning agent focuses on CPU execution time, instruction parallelism, etc.; while for memory-intensive programs, the reward function of the reinforcement learning agent focuses on cache hit rate, memory access latency, etc.

[0107] Optionally, this method uses State to represent the target program's current configuration, performance monitoring data, test data features, and program classification feature vector (i.e., target features and program labels); uses Action to represent the parameters for generating test data (such as generating an input file containing data of a specific size and distribution); and uses Reward to calculate rewards based on changes in performance metrics.

[0108] The specific optimization steps are as follows:

[0109] a) Based on the current state, RL-Agent selects a specific action (parameters for generating test data).

[0110] b) The test data generator generates test data based on the action parameters.

[0111] c) Input test data, run the target program, and record the performance metrics corresponding to the target program's execution process using a performance monitor.

[0112] d) Calculate rewards based on performance metrics and the optimization objectives corresponding to the target program (such as reducing execution time, reducing memory consumption, etc.).

[0113] e) Update the status, that is, update the performance metrics and test data characteristics.

[0114] f) Store the state transition (current state, action, reward, and new state) in the experience replay buffer.

[0115] g) Periodically sample from the experience replay buffer to update the RL (Reinforcement Learning) policy.

[0116] 7. When the RL-Agent iterates through the above steps and finds a performance bottleneck, it triggers the optimizer, which combines the collected performance data and program classification information to generate optimization suggestions and automatically modify the program.

[0117] 8. Repeat steps 6 and 7 to verify the performance of the optimized target program.

[0118] In summary, the above method for automatically generating test data and optimizing the program based on the test data achieves the following technical effects:

[0119] 1. This application automatically generates test data running programs, avoiding data deviation caused by manually generated data.

[0120] 2. This application achieves automation and integration of program execution, program optimization, and program testing, eliminating the need for manual processing by technical personnel.

[0121] 3. This application obtains the feature values ​​of the program through a hierarchical attention fusion mechanism, uses a deep embedding clustering algorithm for classification, and uses different RL-Agents for different categories of target programs. Compared with using a uniform RL-Agent directly without classification, this mechanism improves the resource utilization efficiency of RL-Agent and the program optimization effect.

[0122] This application embodiment can also provide a program optimization device. It should be noted that the program optimization device of this application embodiment can be used to execute the program optimization method provided in this application embodiment. The program optimization device provided in this application embodiment is described below.

[0123] According to an embodiment of this application, an apparatus for implementing the above-described program optimization method is also provided. Figure 3 This is a schematic diagram of an optional program optimization apparatus according to an embodiment of this application, such as... Figure 3 As shown, the device includes: a feature acquisition unit 301, a feature fusion unit 302, a label determination unit 303, and a target optimization unit 304.

[0124] Optionally, the feature acquisition unit is used to acquire static features, dynamic features, and semantic features of the target program. The static features at least characterize the control flow information, data dependency information, and function call information of the target program; the dynamic features at least characterize the function execution information in the target program; and the semantic features characterize the function names, variable names, and comment information in the target program. The feature fusion unit is used to fuse the static features, dynamic features, and semantic features to obtain the target features of the target program. The label determination unit is used to determine the program label of the target program based on the target features. The program label characterizes the program type of the target program. The target optimization unit is used to optimize the performance of the target program based on the target features using a preset model corresponding to the program label. The preset model is a neural network model trained based on the program code and performance test results of historical programs from financial institutions.

[0125] In one alternative embodiment, the feature acquisition unit includes: a graph creation subunit and a first determination subunit.

[0126] Optionally, a graph creation subunit is used to create a control flow graph, a data dependency graph, and a function call graph based on the program code of the target program. The control flow graph is used to represent the logical branch flow of the target program, the data dependency graph is used to represent the dependency relationship between the data involved in the target program, and the function call graph is used to represent the call relationship between the functions included in the target program. A first determination subunit is used to determine the static characteristics of the target program based on the control flow graph, the data dependency graph, and the function call graph.

[0127] In one optional embodiment, the first determining subunit includes: a first extraction module, a second extraction module, a third extraction module, and a determining module.

[0128] Optionally, the first extraction module is used to extract features from the control flow graph to obtain the first static features of the target program, wherein the first static features are used to characterize the number of nodes, the number of edges, and the loop complexity of the control flow graph; the second extraction module is used to extract features from the data dependency graph to obtain the second static features of the target program, wherein the second static features are used to characterize the critical path length and dependency chain depth of the data dependency graph; the third extraction module is used to extract features from the function call graph to obtain the third static features of the target program, wherein the third static features are used to characterize the in-degree and out-degree information of the function call graph; and the determination module is used to use the first static features, the second static features, and the third static features as the static features of the target program.

[0129] In one optional embodiment, the target optimization unit includes: a first parameter determination subunit, a second parameter determination subunit, a test data generation subunit, and a performance optimization subunit.

[0130] Optionally, the first parameter determination subunit is used to determine the first parameter based on the program label and target features, wherein the first parameter is used to characterize the state of the target program; the second parameter determination subunit is used to determine the second parameter based on the first parameter using a preset model corresponding to the program label, wherein the second parameter is used to determine the action performed by the preset model; the test data generation subunit is used to generate test data based on the second parameter using the preset model corresponding to the program label; and the performance optimization subunit is used to optimize the performance of the target program based on the test data and program label.

[0131] In one optional embodiment, the performance optimization subunit includes: a running module, a detection module, a signal generation module, and an optimization module.

[0132] Optionally, the program includes a running module for running the target program using test data as input parameters; a detection module for detecting performance indicators during the execution of the target program using a preset performance monitor; a signal generation module for generating a target signal when the difference between the performance indicator and the preset indicator is greater than the preset difference; and an optimization module for optimizing the performance of the target program based on the performance indicators and program labels after the preset optimizer receives the target signal.

[0133] In one optional embodiment, the optimization module includes: a strategy determination submodule, a script generation submodule, and an optimization submodule.

[0134] Optionally, the strategy determination submodule is used to determine the optimization strategy of the target program based on performance indicators and program tags through a preset optimizer; the script generation submodule is used to generate the optimization script of the target program based on the optimization strategy; and the optimization submodule is used to run the optimization script to automatically optimize the performance of the target program.

[0135] In one optional embodiment, the performance optimization subunit further includes a parameter update module and an iterative optimization module.

[0136] Optionally, the parameter update module is used to update the first parameter based on performance indicators and test data to obtain a new first parameter; the iterative optimization module is used to perform iterative optimization of the target program based on the new first parameter.

[0137] It should be noted that the feature acquisition unit 301, feature fusion unit 302, label determination unit 303, and target optimization unit 304 mentioned above correspond to steps S201 to S204 in the method embodiment. The four units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules can also be part of the device and run in the computer terminal 10 provided in the embodiment.

[0138] Embodiments of this application can also provide an electronic device. Figure 4 This is a structural block diagram of an electronic device according to an embodiment of this application, such as... Figure 4 As shown, the electronic device includes: one or more ( Figure 4 Only one of the following is shown: processor 402, memory 404, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0139] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0140] The processor can access information and applications stored in memory via a transmission device to perform the following steps: Collecting static, dynamic, and semantic features of the target program, wherein static features at least characterize the target program's control flow information, data dependency information, and function call information; dynamic features at least characterize the function execution information in the target program; and semantic features characterize the function names, variable names, and comment information in the target program; fusing the static, dynamic, and semantic features to obtain the target program's target features; determining the target program's program tag based on the target features, wherein the program tag characterizes the target program's program type; and optimizing the target program's performance based on the target features using a preset model corresponding to the program tag, wherein the preset model is a neural network model trained based on the program code and performance test results of historical programs from financial institutions.

[0141] This application provides a code optimization scheme. It employs a method of simultaneously collecting both static and dynamic features of the target program to obtain target features that comprehensively reflect the characteristics of the target program. Then, based on these target features, the application determines the program label, i.e., the type of the target program. Subsequently, the application automatically optimizes the performance of the target program using an intelligent agent (i.e., a preset model) matched to the program type. While reducing the workload of technical personnel, this application improves the efficiency and accuracy of program code optimization by controlling the intelligent agent to dynamically generate test data and monitor performance in a closed-loop optimization process. This achieves the technical effect of improving program optimization results, thereby solving the technical problem of poor program optimization results caused by prior art that only optimizes programs based on static scanning results.

[0142] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, PDAs, mobile internet devices, PADs, and other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0143] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0144] Embodiments of this application may also provide a storage medium.

[0145] Optionally, in this embodiment of the application, the storage medium can be used to store the program code executed by the code optimization method provided in the above method embodiment.

[0146] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0147] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing code optimization method steps.

[0148] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0149] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0150] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0151] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0152] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0153] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0154] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A program optimization method, characterized in that, include: The static features, dynamic features, and semantic features of the target program are collected. The static features are used to characterize at least the control flow information, data dependency information, and function call information of the target program. The dynamic features are used to characterize at least the function execution information in the target program. The semantic features are used to characterize the function names, variable names, and comment information in the target program. The static features, dynamic features, and semantic features are fused to obtain the target features of the target program. Based on the target features, the program tag of the target program is determined, wherein the program tag is used to characterize the program type of the target program; The target program is optimized for performance based on the target features using a preset model corresponding to the program tag. The preset model is a neural network model trained based on the program code and performance test results of historical programs of financial institutions.

2. The program optimization method according to claim 1, characterized in that, Collect the static characteristics of the target program, including: Based on the program code of the target program, a control flow graph, a data dependency graph, and a function call graph are created. The control flow graph is used to represent the logical branch flow of the target program, the data dependency graph is used to represent the dependency relationship between the data involved in the target program, and the function call graph is used to represent the call relationship between the functions included in the target program. Based on the control flow graph, data dependency graph, and function call graph, the static characteristics of the target program are determined.

3. The program optimization method according to claim 2, characterized in that, Based on the control flow graph, data dependency graph, and function call graph, the static characteristics of the target program are determined, including: Feature extraction is performed on the control flow graph to obtain the first static feature of the target program, wherein the first static feature is used to characterize the number of nodes, the number of edges, and the loop complexity of the control flow graph; Feature extraction is performed on the data dependency graph to obtain the second static feature of the target program, wherein the second static feature is used to characterize the critical path length and dependency chain depth in the data dependency graph; Feature extraction is performed on the function call graph to obtain the third static feature of the target program, wherein the third static feature is used to characterize the in-degree and out-degree information corresponding to the function call graph; The first static feature, the second static feature, and the third static feature are used as the static features of the target program.

4. The program optimization method according to claim 1, characterized in that, Based on the target features, the target program is optimized for performance using a preset model corresponding to the program tag, including: Based on the program tag and the target feature, a first parameter is determined, wherein the first parameter is used to characterize the state of the target program; Based on the first parameter, a second parameter is determined using a preset model corresponding to the program tag, wherein the second parameter is used to determine the action performed by the preset model; Based on the second parameter, test data is generated using the preset model corresponding to the program tag; Based on the test data and the program tags, the target program is optimized for performance.

5. The program optimization method according to claim 4, characterized in that, Based on the test data and the program tags, performance optimization is performed on the target program, including: The test data is used as input parameters for the target program, and the target program is run. The performance indicators of the target program during its execution are detected by a preset performance monitor. If the difference between the performance index and the preset index is greater than the preset difference, a target signal is generated. After the preset optimizer receives the target signal, it optimizes the target program based on the performance indicators and the program tags.

6. The program optimization method according to claim 5, characterized in that, The target program is optimized using the preset optimizer based on the performance metrics and the program tags, including: The optimization strategy for the target program is determined by the preset optimizer based on the performance metrics and the program tags. Based on the optimization strategy, an optimization script for the target program is generated; Run the optimization script to automatically optimize the performance of the target program.

7. The program optimization method according to claim 5, characterized in that, After detecting the performance indicators of the target program during its execution using a preset performance monitor, the program optimization method further includes: Based on the performance indicators and the test data, the first parameter is updated to obtain a new first parameter; The target program is iteratively optimized based on the new first parameter.

8. A program optimization device, characterized in that, include: The feature acquisition unit is used to acquire static features, dynamic features and semantic features of the target program. The static features are used to characterize at least the control flow information, data dependency information and function call information of the target program. The dynamic features are used to characterize at least the function execution information in the target program. The semantic features are used to characterize the function names, variable names and comment information in the target program. A feature fusion unit is used to fuse the static features, the dynamic features, and the semantic features to obtain the target features of the target program. A tag determination unit is configured to determine a program tag for the target program based on the target features, wherein the program tag is used to characterize the program type of the target program; The target optimization unit is used to optimize the performance of the target program based on the target features using a preset model corresponding to the program tag. The preset model is a neural network model trained based on the program code and performance test results of historical programs of financial institutions.

9. A computer program product, characterized in that, The computer program product includes a computer program, wherein, when the computer program is executed, it controls the computer program product to perform the program optimization method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the program optimization method according to any one of claims 1 to 7.