Immediate compiling optimization method and device, electronic equipment and storage medium

By aggregating and classifying the hot code of Java virtual machines by distributed scheduling components, the automatic reuse and sharing of hot codes is achieved, and the problem of hot code compilation and optimization in containerized Java applications is solved, and performance and resource utilization are improved.

CN118963915APending Publication Date: 2024-11-15CHINA TELECOM ARTIFICIAL INTELLIGENCE TECHNOLOGY (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411026142.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In containerized Java applications, the Java virtual machine processes in each container do their own business, resulting in real-time scanning and compiling common code, wasting server resources, and lack of effective hot-spot code reuse and compilation optimization methods, resulting in performance bottlenecks and waste of resources.

Method used

By introducing distributed scheduling components, the initial hotspot code uploaded by each virtual machine is summarized and classified, the hotspot code collection is generated, and the new virtual machine is compiled and warmed up when it is started, avoiding duplicate compilation and realizing the automated reuse and sharing of hotspot codes. .

Benefits of technology

Effectively save server resources, improve the overall performance of containerized distributed Java applications, reduce server overhead, improve cold startup performance, and avoid duplicate compilation of hotspot code between distributed components or cluster instances.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118963915A_ABST
    Figure CN118963915A_ABST
Patent Text Reader

Abstract

The invention discloses a just-in-time compilation optimization method and device, electronic equipment and a storage medium. The method comprises the steps that initial hotspot codes uploaded by each virtual machine in a target cluster are summarized through a scheduling component; wherein the initial hotspot code is determined based on execution times corresponding to an execution method executed by the virtual machine; classifying and sorting all the initial hotspot codes in the scheduling component, and sorting based on a classifying and sorting result to obtain a hotspot code set; and when the target cluster accesses the new virtual machine, performing compilation preheating on the new virtual machine based on the hotspot code set in response to a starting operation of the new virtual machine. According to the embodiment of the invention, the hotspot code generated by each virtual level is automatically multiplexed in the distributed application, and a distributed component or a cluster instance copy is prevented from repeatedly compiling the hotspot code as far as possible, so that the purposes of improving the overall performance of the containerized distributed Java application and reducing the extra overhead of a server are achieved, and the efficiency of the distributed Java application is improved. The method can be widely applied to the technical field of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a just-in-time compilation optimization method, device, electronic device and storage medium. Background Art

[0002] With the development of cloud computing technology, clusters composed of large-scale containerized applications have become the mainstream application deployment method in modern data centers. For example, traditional application development languages ​​such as Java have gradually transformed into containerized applications. However, in the face of clustered applications with completely consistent code, the Java virtual machine process in each container is independent and only performs real-time scanning and compilation for the current instance. Each cluster instance and distributed component needs to scan and compile common code in real time at the expense of throughput, which will waste a lot of server resources to do almost the same work. Summary of the invention

[0003] The present invention proposes a just-in-time compilation optimization method, device, electronic device and storage medium, aiming to solve one of the technical problems in the related art at least to a certain extent. The embodiments of the present invention can save server resources and effectively realize just-in-time compilation optimization.

[0004] On the one hand, an embodiment of the present invention provides a just-in-time compilation optimization method, comprising:

[0005] The scheduling component aggregates the initial hotspot code uploaded by each virtual machine in the target cluster;

[0006] Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine;

[0007] Classify and sort all initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results;

[0008] When a new virtual machine is connected to the target cluster, in response to a startup operation of the new virtual machine, the new virtual machine is compiled and preheated based on the hotspot code set.

[0009] Optionally, the initial hotspot code uploaded by each virtual machine in the target cluster is aggregated by the scheduling component, including the following steps:

[0010] Configure the IP address and port of the scheduling component in the startup parameters of all virtual machines in the target cluster;

[0011] Establish a transmission connection between each virtual machine in the target cluster and the scheduling component based on the IP address and port;

[0012] The scheduling component aggregates the initial hotspot codes shared by each virtual machine in the target cluster based on the transport connection.

[0013] Optionally, a compilation cache pool is provided in the virtual machine; the method further comprises the following steps:

[0014] Loading the first bytecode through the virtual machine and determining an execution method corresponding to the first bytecode;

[0015] When the binary code of the execution method does not exist in the compilation cache pool, the first bytecode is interpreted and executed by the bytecode interpreter, and the first hash feature value of the first bytecode is recorded; the execution count corresponding to the execution method is increased by 1; wherein the execution count corresponding to each execution method is initialized to 0;

[0016] When the number of executions reaches a threshold, the first bytecode is compiled in real time to obtain a binary code corresponding to the execution method; the binary code corresponding to the execution method is stored in a compilation buffer pool;

[0017] When there is binary code of the execution method in the compilation buffer pool, the binary code is executed directly; the execution count corresponding to the execution method is increased by 1;

[0018] Initial hotspot codes are obtained based on the binary code, the first hash feature value, the number of executions, and a configuration file of the application's just-in-time compilation.

[0019] Optionally, when the binary code contains characteristic inline data, before arranging the initial hotspot code, the method further includes the following steps:

[0020] Remove feature inline data from binary code.

[0021] Optionally, the initial hotspot code includes a binary code and a first hash feature value corresponding to the bytecode loaded by the virtual machine, the number of executions of the execution method corresponding to the bytecode, and a configuration file of the instant compilation of the virtual machine application; the method further includes the following steps:

[0022] The configuration files and binary codes of the initial hotspot code are verified for legitimacy through the scheduling component;

[0023] When the initial hotspot code passes the legality verification, the first hash feature value is used as the key element, and the configuration file and the binary code are used as the value elements;

[0024] Based on the key element and the value element, the initial hotspot code is stored in the scheduling component in the form of a key-value pair;

[0025] The key-value pair is associated with the execution count in the initial hotspot code.

[0026] Optionally, the initial hotspot code includes the execution count corresponding to the execution method executed by the virtual machine; classifying and sorting all the initial hotspot codes in the scheduling component, and obtaining a hotspot code set based on the classification and sorting results, including the following steps:

[0027] Classify and sort all initial hotspot codes in the scheduling component according to the number of executions;

[0028] A preset number of initial hotspot codes with the largest number of execution times are obtained from the results of the classification and sorting as a hotspot code set.

[0029] Optionally, each hotspot code in the hotspot code set includes a binary code corresponding to a bytecode loaded by the virtual machine and a first hash feature value and a configuration file of a just-in-time compilation of the virtual machine application; in response to a startup operation of a new virtual machine, compiling and preheating the new virtual machine based on the hotspot code set includes the following steps:

[0030] In response to a startup operation of the new virtual machine, loading the second bytecode through the new virtual machine and recording a second hash characteristic value of the second bytecode;

[0031] Traversing and matching all hotspot codes in the hotspot code set based on the second hash feature value;

[0032] When a first hash feature value that is the same as the second hash feature value is matched, the hotspot code where the first hash feature value is located is used as the target hotspot code;

[0033] The new virtual machine is compiled and preheated using the binary code and configuration files of the target hotspot code.

[0034] On the other hand, an embodiment of the present invention provides a just-in-time compilation optimization device, comprising:

[0035] The first module is used to aggregate the initial hotspot code uploaded by each virtual machine in the target cluster through the scheduling component;

[0036] Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine;

[0037] The second module is used to classify and sort all the initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results;

[0038] The third module is used to compile and preheat the new virtual machine based on the hot code set in response to the startup operation of the new virtual machine when the target cluster accesses the new virtual machine

[0039] Optionally, a compilation cache pool is provided in the virtual machine; the device further comprises:

[0040] A fourth module is used to load the first bytecode through the virtual machine and determine an execution method corresponding to the first bytecode;

[0041] The fifth module is used for interpreting and executing the first bytecode through the bytecode interpreter when the binary code of the execution method does not exist in the compilation cache pool, and recording the first hash feature value of the first bytecode; adding 1 to the execution count corresponding to the execution method; wherein the execution count corresponding to each execution method is initialized to 0;

[0042] The sixth module is used for compiling the first bytecode in real time when the execution times reaches the times threshold, obtaining the binary code corresponding to the execution method; and storing the binary code corresponding to the execution method in the compilation buffer pool;

[0043] The seventh module is used to directly execute the binary code when there is a binary code of the execution method in the compilation cache pool; and increase the execution count corresponding to the execution method by 1;

[0044] The eighth module is used to obtain the initial hotspot code based on the binary code, the first hash feature value, the number of executions and the configuration file of the application real-time compilation.

[0045] Optionally, when the binary code contains characteristic inline data, before arranging the initial hotspot code, the device further includes:

[0046] The ninth module is used to remove the characteristic inline data in the binary code.

[0047] Optionally, the initial hotspot code includes a binary code and a first hash feature value corresponding to the bytecode loaded by the virtual machine, the number of executions of the execution method corresponding to the bytecode, and a configuration file of the instant compilation of the virtual machine application; the device further includes:

[0048] The tenth module is used to verify the legitimacy of the configuration files and binary codes of the initial hotspot code through the scheduling component;

[0049] The eleventh module is used to use the first hash feature value as a key element and the configuration file and the binary code as value elements when the initial hotspot code passes the legality verification;

[0050] The twelfth module is used to store the initial hotspot code in the form of a key-value pair in the scheduling component based on the key element and the value element;

[0051] The key-value pair is associated with the execution count in the initial hotspot code.

[0052] On the other hand, an embodiment of the present invention provides an electronic device, including: a processor and a memory; the memory is used to store programs; the processor executes the program to implement the above-mentioned just-in-time compilation optimization method.

[0053] On the other hand, an embodiment of the present invention provides a computer storage medium, in which a program executable by a processor is stored. The program executable by the processor is used to implement the above-mentioned just-in-time compilation optimization method when executed by the processor.

[0054] The embodiment of the present invention aggregates the initial hotspot codes uploaded by each virtual machine in the target cluster through a scheduling component; wherein the initial hotspot codes are determined based on the number of executions corresponding to the execution method executed by the virtual machine; all the initial hotspot codes in the scheduling component are classified and sorted, and a hotspot code set is obtained based on the classification and sorting results; when a new virtual machine is connected to the target cluster, in response to the startup operation of the new virtual machine, the new virtual machine is compiled and preheated based on the hotspot code set. The embodiment of the present invention automatically reuses the hotspot codes generated by each virtual level in the distributed application, and avoids the repeated compilation of hotspot codes by the distributed components or cluster instance copies as much as possible, thereby achieving the purpose of improving the overall performance of containerized distributed Java applications and reducing the additional server overhead. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation on the technical solution of the present invention.

[0056] Figure 1 A schematic diagram of an implementation environment for performing just-in-time compilation optimization provided by an embodiment of the present invention;

[0057] Figure 2 A flowchart of a just-in-time compilation optimization method provided by an embodiment of the present invention;

[0058] Figure 3 A schematic diagram of the expansion process of aggregating initial hotspot codes provided by an embodiment of the present invention;

[0059] Figure 4 A schematic diagram of an extended process of the just-in-time compilation optimization method provided by an embodiment of the present invention;

[0060] Figure 5 A schematic diagram of an example process of executing bytecode and compiling and uploading a Java virtual machine instance provided in an embodiment of the present invention;

[0061] Figure 6 A schematic diagram of the expansion process of preheating the compilation of a new virtual machine provided by an embodiment of the present invention;

[0062] Figure 7 A schematic diagram of an example process of accelerating a cold start state of a Java virtual machine provided by an embodiment of the present invention;

[0063] Figure 8A schematic diagram of the service architecture of a Java virtual machine system of a target cluster provided by an embodiment of the present invention;

[0064] Fig. 9 A structural schematic diagram of a just-in-time compilation optimization device provided by an embodiment of the present invention;

[0065] Fig.10 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0066] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0067] It should be noted that, although the functional modules are divided in the system schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowchart. The terms "first / S100", "second / S200", etc. in the specification, claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0068] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0069] It is understandable that the instant compilation optimization method provided by the embodiment of the present invention can be applied to any computer device with data processing computing capabilities, and this computer device can be various types of terminals or servers. When the computer device in the embodiment is a server, the server is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Optionally, the terminal is a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this.

[0070] To facilitate the understanding of the technical solution of the present invention, the technical feature terms that may appear in the embodiments of the present invention are first explained:

[0071] Cloud native: Cloud native is a methodology for building and running applications that makes full use of the advantages of the cloud computing model and achieves high availability, scalability, and flexibility of applications through technical means such as containerization, microservice architecture, continuous integration and continuous deployment (CI / CD), and automated management.

[0072] Container: Container is a lightweight, portable software packaging technology that packages applications and their dependencies in isolated containers, ensuring consistency and portability across different computing environments.

[0073] Distributed system: A system consisting of multiple physically or logically separated computer components that work together through a network to achieve common tasks and goals.

[0074] Cluster: A group of tightly coupled computer nodes that work together to provide high availability, scalability, and load balancing.

[0075] Explanation: The process of converting high-level programming language code into low-level machine code so that the computer can execute it.

[0076] Compilation: Converting source code into machine code before the program runs. This converted machine code is more efficient than the code generated by interpretation.

[0077] Hot code: Code segments that are frequently called or executed during program execution and usually need to be optimized to improve performance.

[0078] JIT: Just-In-Time Compilation, a technology that converts intermediate code into machine code while the program is running. Compared with the interpreter, JIT has higher execution efficiency.

[0079] Warm-up: The process of achieving optimal performance by pre-executing or loading necessary components before a system or application begins to run efficiently.

[0080] Java: An object-oriented programming language that not only absorbs the advantages of C++, but also abandons the difficult-to-understand concepts of multiple inheritance and pointers in C++. Therefore, Java has two characteristics: powerful functions and simple and easy to use. As a representative of static object-oriented programming languages, Java has implemented object-oriented theory very well, allowing programmers to perform complex programming with an elegant way of thinking. Java has the characteristics of simplicity, object-oriented, distributed, robust, secure, platform-independent and portable, multi-threaded, and dynamic. Java can be used to write desktop applications, Web applications, distributed systems, and embedded system applications.

[0081] JVM: Java Virtual Machine, a virtual computer that can execute Java bytecodes and provide a running environment for Java programs.

[0082] Code Cache: Code cache is used to store machine code generated by the JIT compiler for quick reuse and to reduce compilation overhead.

[0083] like Figure 1 FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present invention. Figure 1 The implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected to a network wirelessly or wired to complete data transmission and exchange.

[0084] Server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.

[0085] In addition, the server 101 can also be a node server in the blockchain network. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm.

[0086] The terminal 102 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 101 may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiment of the present invention.

[0087] Based on the example Figure 1In the implementation environment shown, an embodiment of the present invention provides a just-in-time compilation optimization method. The following is an example of applying the just-in-time compilation optimization method in the terminal 102. It can be understood that the just-in-time compilation optimization method can also be applied to the server 101.

[0088] Reference Figure 2 , Figure 2 The flowchart of the instant compilation optimization method applied to a terminal (for example, the terminal may be a DPU) provided in an embodiment of the present invention, the execution subject of the instant compilation optimization method may be any of the aforementioned computer devices (including a server or a terminal). Figure 2 , the method comprises the following steps:

[0089] S100, summarizing the initial hotspot code uploaded by each virtual machine in the target cluster through the scheduling component;

[0090] Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine;

[0091] It should be noted that in some embodiments, Figure 3 As shown, step S100 may include the following steps: S101, configuring the IP address and port of the scheduling component in the startup parameters of all virtual machines in the target cluster; S102, establishing a transmission connection between each virtual machine in the target cluster and the scheduling component based on the IP address and port; S103, summarizing the initial hotspot code shared by each virtual machine in the target cluster according to the transmission connection through the scheduling component.

[0092] Exemplarily, in some specific implementations, the present invention introduces a distributed scheduling center component (i.e., scheduling component) and exposes it to the cluster through a specific IP and port. All JVMs (i.e., virtual machines) in the cluster can configure this component in the startup parameters. After configuration, a connection will be established and JIT-related data (i.e., initial hotspot code) will be shared.

[0093] In some embodiments, a compilation cache pool is provided in the virtual machine; Figure 4As shown, the method may also include the following steps: T100, loading the first bytecode through a virtual machine and determining the execution method corresponding to the first bytecode; T200, when the binary code of the execution method does not exist in the compilation cache pool, interpreting and executing the first bytecode through a bytecode interpreter, and recording the first hash feature value of the first bytecode; adding 1 to the number of executions corresponding to the execution method; wherein the number of executions corresponding to each execution method is initialized to 0; T300, when the number of executions reaches a threshold, performing real-time compilation on the first bytecode to obtain the binary code corresponding to the execution method; storing the binary code corresponding to the execution method in the compilation cache pool; T400, when the binary code of the execution method exists in the compilation cache pool, directly executing the binary code; adding 1 to the number of executions corresponding to the execution method; T500, obtaining the initial hotspot code based on the binary code, the first hash feature value, the number of executions and the configuration file of the application real-time compilation.

[0094] Among them, in some embodiments, when the binary code contains characteristic inline data, before arranging the initial hotspot code, the method may also include the following steps: removing the characteristic inline data in the binary code.

[0095] For example, in some specific implementations, the Java virtual machine instance executes the bytecode and compiles the upload process as follows: Figure 5 As shown, including the following:

[0096] 1. The Java virtual machine still retains the local compilation cache pool. When executing the code, it will first scan whether there is JIT-compiled code in the local cache. If it exists, the binary code will be executed directly.

[0097] Second, if the compiled code does not exist, the bytecode interpreter is executed to interpret and execute, and the number of times the code is executed is recorded.

[0098] 3. If the number of times the code is executed reaches the threshold of the hot code, the JIT compilation logic is executed.

[0099] 4. The JIT-compiled code will be stored in the local compilation cache pool, and the hash feature value of the bytecode will be recorded and uploaded to the distributed scheduling center.

[0100] 5. If the code does not contain logic related to platform features, such as inline specific address pointers, the binary code of the trait value is uploaded to the distributed scheduling center. If the code contains relevant feature inline data, the relevant data is removed first.

[0101] 6. As the bytecode is continuously interpreted and compiled, the hot code features will be continuously uploaded to the distributed scheduling center, thereby realizing cluster hot spot collection.

[0102] 7. At the initial stage of Java virtual machine creation, the Top K cluster hotspot configuration files and codes will be downloaded from the distributed scheduling center to improve the performance during cold start.

[0103] S200, classify and sort all initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results;

[0104] It should be noted that the initial hotspot code includes the execution count corresponding to the execution method executed by the virtual machine; all initial hotspot codes in the scheduling component are classified and sorted, and a hotspot code set is obtained based on the results of the classification and sorting. In some embodiments, step S200 may include the following steps: classify and sort all initial hotspot codes in the scheduling component according to the execution count; obtain a preset number of initial hotspot codes with the largest number of executions from the results of the classification and sorting as a hotspot code set.

[0105] Among them, in some embodiments, the initial hotspot code includes the binary code and the first hash feature value corresponding to the bytecode loaded by the virtual machine, the execution count of the execution method corresponding to the bytecode, and the just-in-time compiled configuration file of the virtual machine application; the method may also include the following steps: verifying the legitimacy of the configuration file and binary code of the initial hotspot code through the scheduling component; when the initial hotspot code passes the legitimacy verification, the first hash feature value is used as the key element, and the configuration file and binary code are used as value elements; based on the key element and the value element, the initial hotspot code is stored in the scheduling component in the form of a key-value pair; wherein the key-value pair is associated with the execution count in the initial hotspot code.

[0106] For example, in some specific implementations, the distributed scheduling center mainly implements a distributed storage and statistical logic, including the following contents:

[0107] 1. Perform basic legitimacy checks on uploaded configuration files and binary codes.

[0108] 2. Perform KV storage on the configuration file and binary code according to the feature value, that is, Key = hash feature value, Value = configuration file and binary code, where the binary code can be empty.

[0109] 3. The distributed scheduling center will count and store the Top K of existing features. The feature codes within the Top K (the preset number can be adjusted according to the actual application scenario) are the hot codes in the cluster.

[0110] S300: When a new virtual machine is connected to the target cluster, in response to a startup operation of the new virtual machine, the new virtual machine is compiled and preheated based on a hotspot code set.

[0111] It should be noted that, in some embodiments, each hotspot code in the hotspot code set includes a binary code corresponding to the bytecode loaded by the virtual machine and a first hash feature value and a configuration file of the instant compilation of the virtual machine application; Figure 6 As shown, in response to the startup operation of the new virtual machine, the new virtual machine is compiled and preheated based on the hotspot code set, which may include the following steps: S301. In response to the startup operation of the new virtual machine, the second bytecode is loaded through the new virtual machine and the second hash feature value of the second bytecode is recorded; S302. All hotspot codes in the hotspot code set are traversed and matched based on the second hash feature value; S303. When the first hash feature value identical to the second hash feature value is matched, the hotspot code where the first hash feature value is located is used as the target hotspot code; S304. The new virtual machine is compiled and preheated through the binary code and configuration file of the target hotspot code.

[0112] For example, in some specific implementations, the specific implementation of the acceleration of the cold start state of the Java virtual machine is as follows: Figure 7 As shown, including the following:

[0113] 1. When the Java virtual machine starts, the normal bytecode loading process will be executed, and the loaded bytecode will record its hash characteristics.

[0114] 2. While loading the bytecode, the Java virtual machine asynchronously obtains the configuration information and binary code of the feature from the distributed scheduling center. If the code is found and meets the Top K hotspot determination, the configuration and code are downloaded.

[0115] 3. The downloaded binary code will be checked for legitimacy, mainly to check whether it contains specific platform features, such as unsupported CPU instruction sets, local specific memory pointers, etc. If relevant features exist, it will be recompiled according to the code configuration, and the binary code packaged with JIT can run locally.

[0116] 4. After the class loading work is completed, the normal Java application startup process begins, that is Figure 5 The process shown.

[0117] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.

[0118] First of all, it should be noted that with the development of cloud computing technology, clusters composed of large-scale containerized applications have become the mainstream application deployment method in modern data centers. For example, traditional application development languages ​​such as Java have gradually transformed into containerized applications. Java is an interpreted language. In order to achieve high performance that meets most scenarios, the Java virtual machine needs to compile the hotspot code of the application in real time. However, in the face of clustered applications with completely identical codes, the Java virtual machine process in each container is independent and only performs real-time scanning and compilation for the current instance. In addition, distributed Java applications all use similar basic libraries and face similar computing and I / O scenarios. The performance hotspots of most distributed components of the same Java application are almost the same. Each cluster instance and distributed component needs to scan and compile the hotspot code in real time at the expense of throughput. This will waste a lot of server resources to do almost the same work. Since the hotspot code is scanned and compiled in real time, the performance will also face bottlenecks when the application is just started, and the expected performance can only be achieved after sufficient warm-up.

[0119] Currently, most applications in the industry have not been optimized for this, and there are few solutions in the industry. The common solutions to this scenario in the industry are as follows:

[0120] Develop a Java virtual machine hotspot code recording function, that is, cache the hotspot code recorded in real time during the last execution of the application. When the virtual machine starts, read the recorded configuration and recompile the hotspot code. For cluster applications, a baseline configuration can be recorded in the test environment, and all cluster applications share this configuration when they are actually online.

[0121] This idea allows the application to obtain the expected performance after the test environment is preheated when it is just started, but it has obvious disadvantages:

[0122] 1. The baseline configuration requires a pre-built environment for preheating, which makes it difficult to update according to actual conditions.

[0123] 2. This method can only optimize cluster replicas, and each distributed component requires manual intervention for warm-up testing.

[0124] 3. Even if the virtual machine can update the configuration file based on the execution of the online hot spot code, each instance will generate an independent configuration file, and it is difficult for multi-copy applications to choose which instance to use as the configuration file.

[0125] In view of the problems existing in the prior art, the purpose of the present invention is to provide an optimization method, system or device for Java just-in-time compilation, the main goal of which is to automatically reuse the compilation results and configuration files generated by the Java JIT compiler in distributed applications, and to avoid repeated compilation of hot code by distributed components or cluster instance copies as much as possible. The hot code configuration of the basic library and the sharing of JIT compiled code are realized between all Java applications in the entire cluster without manual configuration. Thereby achieving the purpose of improving the overall performance of containerized distributed Java applications and reducing additional server overhead.

[0126] In some specific implementations, the technical solution provided by the present invention can realize a Java virtual machine system that automatically identifies applications, combines incremental updates, and shares JIT compilation configuration information and binary codes, including the following:

[0127] 1. Each Java virtual machine instance will record JIT compiled classes and methods.

[0128] Second, introduce a distributed scheduling center component, which is exposed to the cluster through a specific IP and port. All JVMs in the cluster can configure this component in the startup parameters. After configuration, a connection will be established and JIT-related data will be shared.

[0129] 3. For the standard library built into the Java SDK, the Java virtual machine will compile the hotspot code, remove the local specific inline binary code, and share the hash data of the corresponding bytecode with the distributed scheduling center.

[0130] 4. When each Java virtual machine instance is started, it will pull JIT configuration information and the top K most popular compiled binary codes from the distributed scheduling center according to the package name loaded by the class loader.

[0131] 5. The bytecode hash value, package name, class name, and method name of the hot code analyzed by each Java virtual machine instance will be uploaded to the distributed scheduling center component. The compiled binary code will also be shared with the distributed scheduling center.

[0132] 6. The distributed scheduling center will classify and sort the uploaded data, send data to the newly established Java virtual machine instances, help virtual machines share JIT analysis conclusions, and incrementally update configuration files.

[0133] Specifically, the system's service architecture is as follows: Figure 8 As shown, including the following:

[0134] 1. The overall system architecture includes a distributed scheduling center service and multiple different or identical Java virtual machine instances.

[0135] 2. A Java virtual machine instance runs a copy of a distributed Java application component or cluster. When starting, you need to configure the IP address of the distributed scheduling center in the startup parameters. If not configured, it will degenerate into a normal Java virtual machine startup application.

[0136] 3. The main function of the distributed scheduling center is to collect or distribute the application JIT configuration files generated by the Java virtual machine instance or the platform-independent binary code compiled by JIT.

[0137] 4. The distributed scheduling center will distribute and count the data according to the hash value of the bytecode, and send the data by collecting the top K code hot spots in the entire cluster.

[0138] 5. When the Java virtual machine is cold started, it will refer to the intersection of the hot code sent by the scheduling center and the bytecode loaded by itself, and pre-compile and preheat the code.

[0139] The Java virtual machine instance executes the bytecode and compiles the upload process as follows Figure 5 As shown, including the following:

[0140] 1. The Java virtual machine still retains the local compilation cache pool. When executing the code, it will first scan whether there is JIT-compiled code in the local cache. If it exists, the binary code will be executed directly.

[0141] Second, if the compiled code does not exist, the bytecode interpreter is executed to interpret and execute, and the number of times the code is executed is recorded.

[0142] 3. If the number of times the code is executed reaches the threshold of the hot code, the JIT compilation logic is executed.

[0143] 4. The JIT-compiled code will be stored in the local compilation cache pool, and the hash feature value of the bytecode will be recorded and uploaded to the distributed scheduling center.

[0144] 5. If the code does not contain logic related to platform characteristics, such as inline specific address pointers, the binary code of the characteristic value is uploaded to the distributed scheduling center.

[0145] 6. As the bytecode is continuously interpreted and compiled, the hot code features will be continuously uploaded to the distributed scheduling center, thereby realizing cluster hot spot collection.

[0146] 7. At the initial stage of Java virtual machine creation, the Top K cluster hotspot configuration files and codes will be downloaded from the distributed scheduling center to improve the performance during cold start.

[0147] The specific implementation of the acceleration of the cold start state of the Java virtual machine is as follows Figure 7 As shown, including the following:

[0148] 1. When the Java virtual machine starts, the normal bytecode loading process will be executed, and the loaded bytecode will record its hash characteristics.

[0149] 2. While loading the bytecode, the Java virtual machine asynchronously obtains the configuration information and binary code of the feature from the distributed scheduling center. If the code is found and meets the Top K hotspot determination, the configuration and code are downloaded.

[0150] 3. The downloaded binary code will be checked for legitimacy, mainly to check whether it contains specific platform features, such as unsupported CPU instruction sets, local specific memory pointers, etc. If relevant features exist, it will be recompiled according to the code configuration, and the binary code packaged with JIT can run locally.

[0151] 4. After the class loading work is completed, the normal Java application startup process begins, that is Figure 5 The process shown.

[0152] The distributed scheduling center mainly implements a distributed storage and statistical logic, including the following:

[0153] 1. Perform basic legitimacy checks on uploaded configuration files and binary codes.

[0154] 2. Perform KV storage on the configuration file and binary code according to the feature value, that is: Key = hash feature value, Value = configuration file and binary code, where the binary code can be empty.

[0155] The distributed scheduling center will count and store the Top K of existing features, and the feature codes within the Top K range are the hot codes in the cluster.

[0156] In summary, the present invention innovatively introduces the hotspot code statistical logic at the granularity of distributed components. Since different components of the same distributed application in actual scenarios are likely to have similar underlying frameworks, the same I / O-intensive or compute-intensive processing logic, the cluster code hotspot can be the component's code hotspot with a high probability. At the same time, the present invention innovatively improves the cold start performance of distributed Java applications by pre-collecting code hotspots and dynamically updating components. At the beginning of the application startup, the hotspot code can be compiled according to the data in the existing cluster, thereby enhancing the application's cold start performance. In addition, since the JIT baseline configuration is dynamically adjusted and optimized according to the cluster operation status, there is no need to pre-set a configuration file for a single application. As long as the distributed scheduling center is connected, the hotspot code collection and cold start compilation process of the entire cluster can be automatically completed without manual intervention and configuration updates.

[0157] On the other hand, Fig. 9 As shown, the embodiment of the present invention provides a just-in-time compilation optimization device 900, comprising:

[0158] The first module 910 is used to aggregate the initial hotspot code uploaded by each virtual machine in the target cluster through a scheduling component;

[0159] Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine;

[0160] The second module 920 is used to classify and sort all the initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results;

[0161] The third module 930 is used to compile and preheat the new virtual machine based on the hotspot code set in response to the startup operation of the new virtual machine when the target cluster accesses the new virtual machine.

[0162] In some embodiments, a compilation cache pool is provided in the virtual machine; the apparatus may further include:

[0163] A fourth module is used to load the first bytecode through the virtual machine and determine an execution method corresponding to the first bytecode;

[0164] The fifth module is used for interpreting and executing the first bytecode through the bytecode interpreter when the binary code of the execution method does not exist in the compilation cache pool, and recording the first hash feature value of the first bytecode; adding 1 to the execution count corresponding to the execution method; wherein the execution count corresponding to each execution method is initialized to 0;

[0165] The sixth module is used for compiling the first bytecode in real time when the execution times reaches the times threshold, obtaining the binary code corresponding to the execution method; and storing the binary code corresponding to the execution method in the compilation buffer pool;

[0166] The seventh module is used to directly execute the binary code when there is a binary code of the execution method in the compilation cache pool; and increase the execution count corresponding to the execution method by 1;

[0167] The eighth module is used to obtain the initial hotspot code based on the binary code, the first hash feature value, the number of executions and the configuration file of the application real-time compilation.

[0168] In some embodiments, when the binary code contains characteristic inline data, before arranging the initial hotspot code, the device may further include:

[0169] The ninth module is used to remove the characteristic inline data in the binary code.

[0170] In some embodiments, the initial hotspot code includes a binary code and a first hash feature value corresponding to the bytecode loaded by the virtual machine, the number of executions of the execution method corresponding to the bytecode, and a configuration file of the just-in-time compilation of the virtual machine application; the device may also include:

[0171] The tenth module is used to verify the legitimacy of the configuration files and binary codes of the initial hotspot code through the scheduling component;

[0172] The eleventh module is used to use the first hash feature value as a key element and the configuration file and the binary code as value elements when the initial hotspot code passes the legality verification;

[0173] The twelfth module is used to store the initial hotspot code in the form of a key-value pair in the scheduling component based on the key element and the value element;

[0174] The key-value pair is associated with the execution count in the initial hotspot code.

[0175] The contents of the method embodiments of the present invention are all applicable to the device embodiments. The functions specifically implemented by the device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0176] On the other hand, an embodiment of the present invention further provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above sensitive information method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0177] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0178] like Fig.10 As shown, Fig.10 A specific example of the hardware structure of an electronic device according to an embodiment is shown, and the electronic device includes:

[0179] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention.

[0180] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the network node population optimization method of the embodiment of the present invention;

[0181] Input / output interface 1003, used to implement information input and output;

[0182] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0183] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0184] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0185] The electronic device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0186] The contents of the method embodiments of the present invention are all applicable to the electronic device embodiments. The functions specifically implemented by the electronic device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0187] Another aspect of an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a program, and the program is executed by a processor to implement the above method.

[0188] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (Compact Disc Read to Only Memory, CD to ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0189] The contents of the method embodiments of the present invention are all applicable to the computer-readable storage medium embodiments. The functions specifically implemented by the computer-readable storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0190] The embodiment of the present invention also discloses a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device can read the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the above method.

[0191] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0192] It should be noted that, although several modules of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to an embodiment of the present invention, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0193] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present invention can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD to ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation of the present invention.

[0194] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.

[0195] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified, one or more of the functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.

[0196] If the function is implemented in the form of 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 the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0197] The logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution device, apparatus or device (such as a computer-based device, a device including a processor, or other device that can fetch instructions from an instruction execution device, apparatus or device and execute the instructions), or in conjunction with such instruction execution device, apparatus or device. For purposes of this specification, "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution device, apparatus or device, or in conjunction with such instruction execution device, apparatus or device.

[0198] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0199] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0200] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0201] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

[0202] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of the present invention.

Claims

1. A just-in-time compilation optimization method, characterized in that: The following steps are involved: The scheduling component aggregates the initial hotspot code uploaded by each virtual machine in the target cluster; Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine; Classify and sort all the initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results; When the target cluster accesses a new virtual machine, in response to a startup operation of the new virtual machine, the new virtual machine is compiled and preheated based on the hotspot code set.

2. The just-in-time compilation optimization method according to claim 1, characterized in that: The method of aggregating the initial hotspot codes uploaded by each virtual machine in the target cluster through the scheduling component includes the following steps: Configuring the IP address and port of the scheduling component in the startup parameters of all the virtual machines in the target cluster; Establishing a transmission connection between each of the virtual machines in the target cluster and the scheduling component based on the IP address and port; The initial hotspot code shared by each of the virtual machines in the target cluster according to the transmission connection is aggregated by a scheduling component.

3. The just-in-time compilation optimization method according to claim 1, characterized in that: The virtual machine is provided with a compilation cache pool; the method further comprises the following steps: Loading a first bytecode through the virtual machine and determining an execution method corresponding to the first bytecode; When the binary code of the execution method does not exist in the compilation cache pool, the first bytecode is interpreted and executed by a bytecode interpreter, and a first hash feature value of the first bytecode is recorded; the execution count corresponding to the execution method is increased by 1; wherein the execution count corresponding to each execution method is initialized to 0; When the execution times reaches a times threshold, the first bytecode is compiled in real time to obtain the binary code corresponding to the execution method; the binary code corresponding to the execution method is stored in the compilation buffer pool; When the binary code of the execution method exists in the compilation buffer pool, the binary code is directly executed; and the execution count corresponding to the execution method is increased by 1; The initial hotspot code is obtained based on the binary code, the first hash feature value, the number of executions, and a configuration file using the just-in-time compilation.

4. The just-in-time compilation optimization method according to claim 3, characterized in that: When the binary code contains characteristic inline data, before arranging the initial hotspot code, the method further includes the following steps: The characteristic inline data in the binary code is removed.

5. The just-in-time compilation optimization method according to claim 1, characterized in that: The initial hotspot code includes a binary code and a first hash feature value corresponding to the bytecode loaded by the virtual machine, the execution count of the execution method corresponding to the bytecode, and a configuration file of the instant compilation of the virtual machine application; the method further includes the following steps: Performing legitimacy verification on the configuration file and the binary code of the initial hotspot code by the scheduling component; When the initial hotspot code passes the legitimacy verification, the first hash feature value is used as a key element, and the configuration file and the binary code are used as value elements; Based on the key element and the value element, storing the initial hotspot code in the scheduling component in the form of a key-value pair; The key-value pair is associated with the execution times in the initial hotspot code.

6. The just-in-time compilation optimization method according to claim 1, characterized in that: The initial hotspot code includes the execution number corresponding to the execution method executed by the virtual machine; the classification and sorting of all the initial hotspot codes in the scheduling component, and obtaining a hotspot code set based on the classification and sorting results, includes the following steps: Classify and sort all the initial hotspot codes in the scheduling component according to the execution times; A preset number of the initial hotspot codes with the largest number of execution times are obtained from the classification and sorting results as the hotspot code set.

7. The just-in-time compilation optimization method according to claim 1, characterized in that: Each hotspot code in the hotspot code set includes a binary code corresponding to the bytecode loaded by the virtual machine and a first hash feature value and a configuration file of the instant compilation of the virtual machine application; in response to the startup operation of the new virtual machine, compiling and preheating the new virtual machine based on the hotspot code set includes the following steps: In response to the startup operation of the new virtual machine, loading a second bytecode through the new virtual machine and recording a second hash feature value of the second bytecode; Traversing and matching all hotspot codes in the hotspot code set based on the second hash feature value; When the first hash feature value that is the same as the second hash feature value is matched, the hotspot code where the first hash feature value is located is used as the target hotspot code; The new virtual machine is compiled and preheated using the binary code and the configuration file of the target hotspot code.

8. A just-in-time compilation optimization device, characterized in that: include: The first module is used to aggregate the initial hotspot code uploaded by each virtual machine in the target cluster through the scheduling component; Wherein, the initial hotspot code is determined based on the number of executions corresponding to the execution method executed by the virtual machine; The second module is used to classify and sort all the initial hotspot codes in the scheduling component, and obtain a hotspot code set based on the classification and sorting results; The third module is used for compiling and preheating the new virtual machine based on the hotspot code set in response to a startup operation of the new virtual machine when the target cluster accesses the new virtual machine.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store programs; The processor executes the program to implement the method according to any one of claims 1 to 7.

10. A computer storage medium storing a program executable by a processor, characterized in that: The program executable by the processor is used to implement the method according to any one of claims 1 to 7 when executed by the processor.