Application service publishing method and device, computer equipment and readable storage medium

By using the release rule engine to dynamically compile source code files in the business system of the financial technology industry, the problem of low efficiency of multiple versions and multiple frequency releases is solved, and the invisible release is realized, and the release efficiency and business iteration of application services are improved. speed.

CN119127225APending Publication Date: 2024-12-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411247048.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-05
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the process of business system development in the financial technology industry, the release of multi-version and multiple frequency application services leads to stability risks, and the release efficiency of existing technology is low.

Method used

Through the release rule engine, dynamically compile source code files, build dynamic compilation rules, realize sensorless release, and improve release efficiency.

Benefits of technology

It effectively improves the efficiency of application service release, supports fast and flexible business iteration requirements, and shortens the iteration cycle of developers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127225A_ABST
    Figure CN119127225A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of development assistance, can realize non-inductive release of a randomly changed source code file through a dynamic compiling rule, can effectively improve the efficiency of release of an application service, can greatly help developers to realize rapid, flexible and non-inductive iterative business requirements, and improves the development efficiency. And the demand iteration period of business and developers is improved. Relates to an application service publishing method and device, computer equipment and a readable storage medium. The application service publishing method comprises the following steps: acquiring a source code file corresponding to a to-be-published target application service; based on a preset release rule engine, dynamically compiling the source code file to obtain a target code file; storing the target code file into a preset dynamic compiling table; and releasing the target code file in the dynamic compilation table to a target instance corresponding to the target application service in the Java virtual machine.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of development assistance technology, and in particular to an application service publishing method, device, computer equipment and readable storage medium. Background Art

[0002] During the business system development process in the financial technology industry (such as agricultural insurance and banks), the business systems used in various places have different change times and the business systems themselves have operational transformation requirements. Therefore, the business systems need to release multiple versions and multiple frequencies of application services. However, the multiple versions and multiple frequencies of application service releases by business systems will bring stability risks to the launch of business systems. At present, in order to achieve multi-version and multi-frequency application service releases while taking into account stability, the relevant technologies usually implement real-time changes to configuration files through the configuration center or maintain permissions and business switches through the background management database to achieve application service release of the business system. However, these release methods are inefficient in releasing application services.

[0003] Therefore, how to improve the efficiency of publishing application services has become an urgent problem to be solved. Summary of the invention

[0004] The present application provides an application service publishing method, apparatus, computer equipment and readable storage medium, which can utilize the characteristics of the publishing rule engine itself in publishing business rules, construct dynamic compilation rules corresponding to the business rules to dynamically compile source code files, and realize seamless publishing of arbitrarily changed source code files through dynamic compilation rules, which can effectively improve the efficiency of publishing application services.

[0005] In a first aspect, the present application provides an application service publishing method, the method comprising:

[0006] Obtain the source code file corresponding to the target application service to be published; based on a preset publishing rule engine, dynamically compile the source code file to obtain a target code file; store the target code file in a preset dynamic compilation table; publish the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine.

[0007] In one embodiment, the preset publishing rule engine dynamically compiles the source code file to obtain the target code file, including:

[0008] The target business rules currently published by the publishing rule engine are obtained; and the source code file is dynamically compiled according to the target business rules to obtain the target code file.

[0009] In one embodiment, dynamically compiling the source code file according to the target business rule to obtain the target code file includes:

[0010] The preset dynamic compilation rule base class is called to dynamically compile the source code file based on the target business rule to obtain a bytecode file; and the target code file is determined according to the bytecode file.

[0011] In one embodiment, storing the target code file into a preset dynamic compilation table includes:

[0012] Determine a target field in the dynamic compilation table for storing the target code file; and store the content in the target code file into a storage space corresponding to the target field.

[0013] In one embodiment, publishing the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine includes:

[0014] The target code file is extracted from the dynamic compilation table according to the target field; and the target code file is loaded into the target instance based on a preset class loader.

[0015] In one embodiment, the loading of the target code file into the target instance based on a preset class loader includes:

[0016] The class loader is called to read the target code file into the method area of ​​the Java virtual machine memory; an initial class object is created according to the target code file; a data structure in the method area is encapsulated according to the initial class object to obtain a target class object; and the target class object is stored in the heap area of ​​the Java virtual machine memory.

[0017] In a second aspect, the present application also provides an application service publishing method, the method comprising:

[0018] Obtain the source code file corresponding to the target application service to be published; based on the business rules published by the preset publishing rule engine, dynamically compile the source code file to obtain the target code file; based on the preset class loader, publish the target code file to the target instance corresponding to the target application service in the Java virtual machine.

[0019] In a third aspect, the present application further provides an application service publishing device, the application service publishing device comprising:

[0020] A file acquisition module is used to obtain the source code file corresponding to the target application service to be released;

[0021] A dynamic compilation module, used to dynamically compile the source code file based on a preset publishing rule engine to obtain a target code file;

[0022] A file storage module, used for storing the target code file into a preset dynamic compilation table;

[0023] A publishing module is used to publish the target code file in the dynamic compilation table to a target instance corresponding to the target application service in a Java virtual machine.

[0024] In a fourth aspect, the present application further provides a computer device, the computer device comprising a memory and a processor;

[0025] The memory is used to store computer programs;

[0026] The processor is used to execute the computer program and implement the above-mentioned application service publishing method when executing the computer program.

[0027] In a fifth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the application service publishing method as described above.

[0028] The present application discloses an application service publishing method, device, computer equipment and readable storage medium, the method comprising: obtaining a source code file corresponding to a target application service to be published; based on a preset publishing rule engine, dynamically compiling the source code file to obtain a target code file; storing the target code file in a preset dynamic compilation table; publishing the target code file in the dynamic compilation table to a target instance corresponding to the target application service in a Java virtual machine. The embodiment of the present application dynamically compiles the source code file based on a preset publishing rule engine, stores the target code file obtained by dynamic compilation in a preset dynamic compilation table, and publishes the target code file in the dynamic compilation table to a target instance corresponding to the target application service in a Java virtual machine. The publishing rule engine can utilize its own business rule publishing characteristics to construct dynamic compilation rules corresponding to business rules to dynamically compile source code files, and can realize the senseless publishing of any changed source code files through dynamic compilation rules, which can effectively improve the efficiency of publishing application services, and can also greatly help developers to achieve fast, flexible, senseless iterative business needs, and improve the business and developer demand iteration cycle. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0030] Figure 1 is a structural schematic diagram of a computer device provided in an embodiment of the present application;

[0031] Figure 2 It is a schematic flow chart of an application service publishing method provided in an embodiment of the present application;

[0032] Figure 3 is a schematic flow chart of sub-steps of dynamically compiling a source code file provided by an embodiment of the present application;

[0033] Figure 4 is a schematic flow chart of a dynamically compiled source code file provided in an embodiment of the present application;

[0034] Figure 5 is a schematic flow chart of loading a code file provided in an embodiment of the present application;

[0035] Figure 6 is a schematic flow chart of another application service publishing method provided in an embodiment of the present application;

[0036] Figure 7 This is a schematic flow chart of a publishing application service provided by an embodiment of the present application;

[0037] Figure 8 It is a schematic block diagram of an application service publishing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0039] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0040] It should be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0041] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0042] At present, in order to achieve multi-version and multi-frequency application service release while taking into account stability, the relevant technologies include: (1) real-time changes to configuration files through the configuration center, which is usually used to handle switches and business value adjustments, but is relatively limited when it comes to business rules and conditions; (2) maintaining permissions and business switches through backend management database tables, which is usually used to handle functional permissions, switches, and business value adjustments, but is also not well supported when it comes to business rules and conditions; (3) changing business rules through the rule engine, which is usually used to handle business condition rules. Although it is more flexible for business rule conditions, it still requires a lot of code adjustments and re-release of the version for new business rules or business rule adjustments. These release methods are inefficient in releasing application services.

[0043] To this end, the embodiments of the present application provide an application service publishing method, device, computer equipment and readable storage medium. Among them, the application service publishing method can be applied to a computer device, dynamically compile the source code file based on the business rules published by the preset publishing rule engine, store the target code file obtained by the dynamic compilation into a preset dynamic compilation table, and publish the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine, and can utilize the characteristics of the publishing rule engine itself to publish business rules, construct dynamic compilation rules corresponding to the business rules to dynamically compile the source code file, and realize the senseless publishing of any changed source code file through dynamic compilation rules, which can effectively improve the efficiency of publishing application services, and at the same time can greatly help developers to achieve fast, flexible, and senseless iterative business needs, and improve the demand iteration cycle of business and developers.

[0044] Exemplarily, the computer device can be a server or a terminal. The server can be an independent server 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, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal can be an electronic device such as a smartphone, tablet computer, laptop computer, and desktop computer.

[0045] See also Figure 1 , Figure 1 1 is a schematic diagram of a computer device provided in an embodiment of the present application. The computer device may include a processor and a memory, wherein the processor and the memory may be connected via a bus, and the bus may be any applicable bus such as an Inter-integrated Circuit (I2C) bus.

[0046] The memory may include a storage medium and an internal memory. The storage medium may be a non-volatile storage medium or a volatile storage medium. The storage medium may store an operating system and a computer program, and the internal memory provides an environment for the operation of the computer program in the storage medium. The computer program includes program instructions, and when the program instructions are executed, the processor may execute the application service publishing method described in any embodiment.

[0047] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0048] The processor may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or any conventional processor.

[0049] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0050] Obtain the source code file corresponding to the target application service to be published; based on a preset publishing rule engine, dynamically compile the source code file to obtain a target code file; store the target code file in a preset dynamic compilation table; publish the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine.

[0051] In one embodiment, when the processor implements the preset publishing rule engine to dynamically compile the source code file to obtain the target code file, it is used to implement:

[0052] The target business rules currently published by the publishing rule engine are obtained; and the source code file is dynamically compiled according to the target business rules to obtain the target code file.

[0053] In one embodiment, when the processor dynamically compiles the source code file according to the target business rule to obtain the target code file, it is used to implement:

[0054] The preset dynamic compilation rule base class is called to dynamically compile the source code file based on the target business rule to obtain a bytecode file; and the target code file is determined according to the bytecode file.

[0055] In one embodiment, when implementing storing the target code file into a preset dynamic compilation table, the processor is used to implement:

[0056] Determine a target field in the dynamic compilation table for storing the target code file; and store the content in the target code file into a storage space corresponding to the target field.

[0057] In one embodiment, when the processor implements publishing the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine, it is used to implement:

[0058] The target code file is extracted from the dynamic compilation table according to the target field; and the target code file is loaded into the target instance based on a preset class loader.

[0059] In one embodiment, when the processor implements loading the target code file into the target instance based on a preset class loader, it is configured to implement:

[0060] The class loader is called to read the target code file into the method area of ​​the Java virtual machine memory; an initial class object is created according to the target code file; a data structure in the method area is encapsulated according to the initial class object to obtain a target class object; and the target class object is stored in the heap area of ​​the Java virtual machine memory.

[0061] In one embodiment, the processor is further configured to implement:

[0062] Obtain the source code file corresponding to the target application service to be published; based on the business rules published by the preset publishing rule engine, dynamically compile the source code file to obtain the target code file; based on the preset class loader, publish the target code file to the target instance corresponding to the target application service in the Java virtual machine.

[0063] Some embodiments of the present application are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features of the embodiments can be combined with each other. Figure 2 , Figure 2 FIG. 1 is a schematic flow chart of an application service publishing method provided in an embodiment of the present application. Figure 2 As shown, the application service publishing method may include steps S101 to S104.

[0064] Step S101: Obtain the source code file corresponding to the target application service to be released.

[0065] Exemplarily, the source code file corresponding to the target application service to be released may be obtained. The target application service to be released may be an application service in a business system. For example, an application service that needs to add new business requirements or adjust business requirements may be determined as the target application service.

[0066] Exemplarily, the business system may include but is not limited to an insurance system, a banking system, a trading system, a claims settlement system, etc. In the embodiment of the present application, an agricultural insurance system is taken as an example to illustrate how to implement application service publishing.

[0067] It should be noted that in the agricultural insurance system, when an application service needs to add new business rules or adjust business rules, the relevant technology needs to make a lot of adjustments to the source code of the application service and re-release the version. Since it involves modifying the source code, it takes a lot of time for developers, so the efficiency of the relevant technology when releasing application services is low and the labor cost is high. In the embodiment of the present application, the characteristic of the publishing rule engine itself publishing business rules is utilized to construct dynamic compilation rules corresponding to the business rules to dynamically compile the source code files. It can realize the seamless release of any changed source code files through dynamic compilation rules, without modifying the source code files, which can effectively improve the efficiency of publishing application services.

[0068] Step S102: Based on a preset publishing rule engine, the source code file is dynamically compiled to obtain a target code file.

[0069] It should be noted that in the embodiment of the present application, the publishing rule engine is an engine for publishing different business rule classes, and different business rules can be set based on the business requirements required by the business system. For example, for an agricultural insurance system, business rules such as quotation rules and underwriting rules can be published through the publishing rule engine.

[0070] Exemplarily, the source code file may be dynamically compiled based on the business rules published by the publishing rule engine to obtain the target code file.

[0071] It should be noted that dynamic compilation is different from static compilation. The dynamically compiled executable file needs to be accompanied by a dynamic link library. When executing the compilation, the commands in the dynamic link library need to be called.

[0072] See also Figure 3 , Figure 3 is a schematic flow chart of the sub-steps of dynamically compiling a source code file provided by an embodiment of the present application. Figure 3 As shown, the application service publishing method may include step S201 and step S202.

[0073] Step S201: Obtain the target business rule currently published by the publishing rule engine.

[0074] Exemplarily, the target business rule currently published by the publishing rule engine can be obtained. For example, if the business rule currently published by the publishing rule engine is a quotation rule, the quotation rule can be determined as the target business rule. For another example, if the business rule currently published by the publishing rule engine is an underwriting rule, the underwriting rule can be determined as the target business rule. Among them, the specific content of the quotation rule and the underwriting rule can be set according to the actual situation and is not limited here.

[0075] Step S202: dynamically compile the source code file according to the target business rule to obtain the target code file.

[0076] Exemplarily, after obtaining the target business rules currently published by the publishing rule engine, the source code file may be dynamically compiled according to the target business rules to obtain the target code file.

[0077] In some embodiments, dynamically compiling the source code file according to the target business rule to obtain the target code file includes: calling a preset dynamic compilation rule base class to dynamically compile the source code file based on the target business rule to obtain a bytecode file; and determining the target code file according to the bytecode file. The bytecode file is a binary file.

[0078] It should be noted that the preset dynamic compilation rule base class is a user-defined base class used to dynamically compile source code files according to business rules.

[0079] Exemplarily, the dynamic compilation rule base class may be called to dynamically compile the source code file according to the target business rule to obtain a bytecode file; then, the bytecode file is determined as the target code file.

[0080] In the above embodiment, the target code file is obtained by dynamically compiling the source code file according to the target business rules. The characteristic of the publishing rule engine itself in publishing business rules can be utilized to construct dynamic compilation rules corresponding to the business rules to dynamically compile the source code file. Any changed source code file can be seamlessly published through dynamic compilation rules, which can effectively improve the efficiency of publishing application services.

[0081] Step S103: storing the target code file in a preset dynamic compilation table.

[0082] See also Figure 4 , Figure 4 is a schematic flow chart of a dynamically compiled source code file provided by an embodiment of the present application. Figure 4 As shown, the source code file can be input into the publishing rule engine for dynamic compilation, and the publishing rule engine outputs the target code file, and then the target code file is stored in the dynamic compilation table. The following will explain in detail how to store the target code file.

[0083] In some embodiments, storing the target code file in a preset dynamic compilation table may include: determining a target field in the dynamic compilation table for storing the target code file; and storing the content in the target code file in a storage space corresponding to the target field.

[0084] Exemplarily, a target field for storing the target code file may be pre-set in the dynamic compilation table. For example, the target field may be a compiled_src_code field. The target field may be understood as a storage variable.

[0085] Exemplarily, the content in the target code file is stored in the storage space corresponding to the compiled_src_code field.

[0086] In the above embodiment, by storing the target code file in a preset dynamic compilation table, the target code file can be cached in the dynamic compilation table first, and the target code file can be cached in the dynamic compilation table first, so as to facilitate the subsequent rapid reading of the target code file from the dynamic compilation table, thereby effectively improving the speed of application service release.

[0087] Step S104: publishing the target code file in the dynamic compilation table to a target instance corresponding to the target application service in a Java virtual machine.

[0088] Exemplarily, after the target code file is stored in the preset dynamic compilation table, the target code file in the dynamic compilation table can be published to the target instance corresponding to the target application service in the Java virtual machine, and the target application service can be restarted to make the target application service effective.

[0089] It should be noted that the Java Virtual Machine (JVM) is a specification for computing devices. It is a fictional computer that is implemented by simulating various computer functions on an actual computer. The Java virtual machine includes a bytecode instruction set, a set of registers, a stack, a garbage collection heap, and a storage method domain. The Java virtual machine shields information related to the specific operating system platform, so that the Java program only needs to generate target code (bytecode) that runs on the Java virtual machine, and can run on multiple platforms without modification. When the Java virtual machine executes the bytecode, it actually needs to interpret the bytecode into machine instructions on the specific platform for execution.

[0090] In some embodiments, publishing the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine may include: extracting the target code file from the dynamic compilation table according to the target field; and loading the target code file into the target instance based on a preset class loader.

[0091] See also Figure 5 , Figure 5is a schematic flow chart of loading a code file provided by an embodiment of the present application. Figure 5 As shown, a SQL (Structured Query Language) query statement can be used to extract the target code file from the dynamic compilation table according to the target field; then, based on a preset class loader, the target code file is loaded into the target instance. It can be understood that the process of loading the target code file into the target instance through the class loader is equivalent to the process of rewriting the class loader.

[0092] Among them, the preset class loader can be a custom class loader, which refers to a class loader customized by the developer in the program, and can include extension class loader (Extension Class Loader), application class loader (App Class Loader), user-defined class loader (User-Defined Class Loader) and so on.

[0093] Exemplarily, the target code file may be loaded into the target instance based on a user-defined class loader.

[0094] In some embodiments, based on a preset class loader, loading the target code file into the target instance may include: calling the class loader to read the target code file into the method area of ​​the Java virtual machine memory; creating an initial class object according to the target code file; encapsulating the data structure in the method area according to the initial class object to obtain a target class object; storing the target class object in the heap area of ​​the Java virtual machine memory; connecting and initializing the target class object to load the target class object into the target instance.

[0095] It should be noted that the source code file stores the program logic to be executed and needs to be compiled into a ".class" file, i.e., an object code file, by a Java compiler. The ".class" file stores the binary information of the compiled virtual machine instructions. When a class is needed, the virtual machine will load the class and create a corresponding class object in memory. This process is called class loading. The life cycle of a class starts with the class being loaded, connected, and initialized. Only in the virtual machine memory can the iava program use the class.

[0096] The loading of a class includes searching for the bytecode file of the class using the fully qualified name (package name and class name), reading the binary data in the .class file of the class into the memory, and storing it in the method area of ​​the runtime data area; then creating a Class object using the bytecode file to encapsulate the data structure of the class in the method area and store it in the heap area. This process is completed by the class loader.

[0097] In an embodiment of the present application, the class loader can be called to read the target code file into the method area of ​​the Java virtual machine memory; an initial class object can be created according to the target code file; the data structure in the method area is encapsulated according to the initial class object to obtain a target class object; and the target class object is stored in the heap area of ​​the Java virtual machine memory. After the target class object is stored in the heap area of ​​the Java virtual machine memory, the target class object can be connected and initialized. The specific process of connection and initialization can be referred to the relevant technology and will not be described here.

[0098] An application service publishing method provided in an embodiment of the present application dynamically compiles source code files based on business rules published by a preset publishing rule engine, stores target code files obtained by dynamic compilation in a preset dynamic compilation table, and publishes the target code files in the dynamic compilation table to a target instance corresponding to a target application service in a Java virtual machine. The characteristic of the publishing rule engine itself in publishing business rules can be utilized to construct dynamic compilation rules corresponding to the business rules to dynamically compile source code files. Any changed source code files can be seamlessly published through dynamic compilation rules, which can effectively improve the efficiency of publishing application services. At the same time, it can also greatly help developers to achieve fast, flexible, and seamless iterative business needs, and improve the iteration cycle of business and developer needs.

[0099] See also Figure 6 , Figure 6 FIG. 1 is a schematic flow chart of another application service publishing method provided in an embodiment of the present application. Figure 6 As shown, the application service publishing method may include steps S301 to S303.

[0100] Step S301: Obtain the source code file corresponding to the target application service to be released.

[0101] Exemplarily, the source code file corresponding to the target application service to be released may be obtained. The target application service to be released may be an application service in a business system. For example, an application service that needs to add new business requirements or adjust business requirements may be determined as the target application service.

[0102] Step S302: Based on the business rules published by the preset publishing rule engine, the source code file is dynamically compiled to obtain a target code file.

[0103] Exemplarily, the target business rule currently published by the publishing rule engine can be obtained, and the source code file can be dynamically compiled according to the target business rule to obtain the target code file. The dynamically compiling the source code file according to the target business rule to obtain the target code file includes: calling a preset dynamic compilation rule base class to dynamically compile the source code file based on the target business rule to obtain a bytecode file; and determining the target code file according to the bytecode file.

[0104] In the above embodiment, the target code file is obtained by dynamically compiling the source code file according to the target business rules. The characteristic of the publishing rule engine itself in publishing business rules can be utilized to construct dynamic compilation rules corresponding to the business rules to dynamically compile the source code file. Any changed source code file can be seamlessly published through dynamic compilation rules, which can effectively improve the efficiency of publishing application services.

[0105] Step S303: Based on a preset class loader, the target code file is published to a target instance corresponding to the target application service in a Java virtual machine.

[0106] In some embodiments, based on a preset class loader, publishing the target code file to the target instance may include: calling the class loader to read the target code file into the method area of ​​the Java virtual machine memory; creating an initial class object according to the target code file; encapsulating the data structure in the method area according to the initial class object to obtain a target class object; storing the target class object in the heap area of ​​the Java virtual machine memory; connecting and initializing the target class object to load the target class object into the target instance.

[0107] See also Figure 7 , Figure 7 is a schematic flow chart of a publishing application service provided by an embodiment of the present application. Figure 7 As shown, the source code file can be dynamically compiled based on the business rules published by the preset publishing rule engine, and the target code file obtained by the dynamic compilation can be published to the target instance corresponding to the target application service in the Java virtual machine based on the class loader.

[0108] In the above-mentioned embodiment, the source code file is dynamically compiled based on the business rules published by the preset publishing rule engine, and the target code file obtained by the dynamic compilation is published to the target instance corresponding to the target application service in the Java virtual machine based on the class loader. The characteristic of the publishing rule engine itself in publishing business rules can be utilized to construct dynamic compilation rules corresponding to the business rules to dynamically compile the source code file, and any changed source code file can be seamlessly published through dynamic compilation rules, which can effectively improve the efficiency of publishing application services, and at the same time can greatly help developers to realize fast, flexible and seamless iterative business needs, and improve the demand iteration cycle of business and developers.

[0109] See also Figure 8 , Figure 8 The embodiment of the present application also provides a schematic block diagram of an application service publishing device 1000, which is used to execute the aforementioned application service publishing method. The application service publishing device 1000 can be configured in a computer device.

[0110] like Figure 8 As shown, the application service publishing device 1000 includes: a file acquisition module 1001, a dynamic compilation module 1002, a file storage module 1003 and a publishing module 1004.

[0111] The file acquisition module 1001 is used to acquire the source code file corresponding to the target application service to be released;

[0112] A dynamic compilation module 1002 is used to dynamically compile the source code file based on a preset publishing rule engine to obtain a target code file;

[0113] The file storage module 1003 is used to store the target code file into a preset dynamic compilation table;

[0114] The publishing module 1004 is used to publish the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine.

[0115] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0116] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any application service publishing method provided in the embodiment of the present application.

[0117] For example, the program is loaded by the processor and may execute the following steps:

[0118] Obtain the source code file corresponding to the target application service to be published; based on a preset publishing rule engine, dynamically compile the source code file to obtain a target code file; store the target code file in a preset dynamic compilation table; publish the target code file in the dynamic compilation table to the target instance corresponding to the target application service in the Java virtual machine.

[0119] For another example, when the program is loaded by the processor, the following steps may be executed:

[0120] Obtain the source code file corresponding to the target application service to be published; based on the business rules published by the preset publishing rule engine, dynamically compile the source code file to obtain the target code file; based on the preset class loader, publish the target code file to the target instance corresponding to the target application service in the Java virtual machine.

[0121] The computer-readable storage medium may be an internal storage unit of the computer device of the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital card (Secure Digital Card, SD Card), a flash card (Flash Card), etc. equipped on the computer device.

[0122] Furthermore, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of the blockchain node, etc.

[0123] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0124] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A method for publishing an application service, characterized in that: include: Obtain the source code file corresponding to the target application service to be released; Based on a preset publishing rule engine, dynamically compile the source code file to obtain a target code file; Storing the target code file in a preset dynamic compilation table; The target code file in the dynamic compilation table is published to a target instance corresponding to the target application service in a Java virtual machine.

2. The application service publishing method according to claim 1, characterized in that: The preset publishing rule engine dynamically compiles the source code file to obtain the target code file, including: Obtain the target business rules currently published by the publishing rule engine; The source code file is dynamically compiled according to the target business rule to obtain the target code file.

3. The application service publishing method according to claim 2, characterized in that: The dynamically compiling the source code file according to the target business rule to obtain the target code file includes: Calling a preset dynamic compilation rule base class to dynamically compile the source code file based on the target business rule to obtain a bytecode file; The target code file is determined according to the bytecode file.

4. The application service publishing method according to claim 1, characterized in that: The storing of the target code file into a preset dynamic compilation table includes: Determine a target field in the dynamic compilation table for storing the target code file; The content in the target code file is stored in the storage space corresponding to the target field.

5. The application service publishing method according to claim 4, characterized in that: The step of publishing the target code file in the dynamic compilation table to a target instance corresponding to the target application service in the Java virtual machine includes: Extracting the target code file from the dynamic compilation table according to the target field; Based on a preset class loader, the target code file is loaded into the target instance.

6. The application service publishing method according to claim 5, characterized in that: The method of loading the target code file into the target instance based on a preset class loader includes: Calling the class loader to read the target code file into the method area of ​​the Java virtual machine memory; Creating an initial class object according to the object code file; Encapsulating the data structure in the method area according to the initial class object to obtain a target class object; The target class object is stored in the heap area of ​​the Java virtual machine memory.

7. A method for publishing an application service, characterized in that: include: Obtain the source code file corresponding to the target application service to be released; Based on the business rules published by the preset publishing rule engine, the source code file is dynamically compiled to obtain a target code file; Based on a preset class loader, the target code file is published to a target instance corresponding to the target application service in a Java virtual machine.

8. An application service publishing device, characterized in that: include: A file acquisition module is used to obtain the source code file corresponding to the target application service to be released; A dynamic compilation module, used to dynamically compile the source code file based on a preset publishing rule engine to obtain a target code file; A file storage module, used for storing the target code file into a preset dynamic compilation table; A publishing module is used to publish the target code file in the dynamic compilation table to a target instance corresponding to the target application service in a Java virtual machine.

9. A computer device, characterized in that: The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the application service publishing method according to any one of claims 1 to 6, or the application service publishing method according to claim 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the application service publishing method according to any one of claims 1 to 6, or the application service publishing method according to claim 7.