Construction method of highly extensible plug-in architecture of operation system, medium and equipment
By using custom Java Classloader and plug-in development methods in the telecom operator resource management system, the system's complex code management and version instability in the implementation of business scalability is solved, and high scalability and rapid service support is achieved. .
Patent Information
- Application Number
- CN202411235381.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-04
- Publication Date
- 2025-02-07
AI Technical Summary
In the implementation of service scalability of telecom operator resource management systems, the existing technology has problems such as complex code management, high cost and unstable versions.
Use custom Java Classloader to manage the main program and business plug-in. By defining business interfaces and plug-in classes Java Classloader, plug-in development and dynamic loading of different business logics are realized, and new plug-ins are supported.
It realizes high scalability of the system and fast business support, stabilizes the core business code, and avoids the problems of complex code management and instability in versions.
Smart Images

Figure CN119396389A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of architecture design of complex application software systems of operators, and specifically relates to a construction method, medium and equipment for a highly scalable plug-in architecture of an operation system. Background Art
[0002] The telecom operator resource management system is a system with a rapidly growing scale and data volume. As time goes by and the business continues to develop, the business scenarios it faces become more and more complex, and the difficulty of understanding, maintaining, and iterating increases accordingly. Currently, in the actual development process of the telecom operator resource management system, the business scalability problem is usually solved using the following two methods: One is to develop different business implementations through different code branches, and develop new functions through code merging and other methods to achieve the purpose of scalability. However, this method has complex code management and high costs. Business changes are usually developed in parallel in multiple different branches, and finally integrated into the release version through code merging and selection. This method is prone to errors due to code conflicts and other reasons, resulting in instability of the mainline version, and code management is also relatively complicated.
[0003] Another method is to use "if else" branches in the core code of the system to handle the logic of different businesses and develop different versions or new functions to achieve scalability. However, this method lacks code isolation and usually directly adds business code to the core code block by block. This writing method will cause the core service to expand in a short time, with poor reusability or even no reusability. Frequent changes in the core code require full deployment and release, which can easily lead to unstable versions, high costs, and high risks. Summary of the invention
[0004] The purpose of the present invention is to provide a method, medium and device for constructing a highly scalable plug-in architecture of an operation system, aiming to solve the above-mentioned problems.
[0005] The present invention is mainly achieved through the following technical solutions: A method for constructing a highly scalable plug-in architecture for an operation system comprises the following steps: Step S1: Identify the core business code in the business code, separate the business logic from the core business logic; use the core business logic as the main program; define different business interfaces in the main program for different business logics, and the business logic is defined in the main program using the business interface Java Interface; Step S2: Create a custom Java Classloader to load class files under the specified path to achieve class loading of different versions and different dependencies; Step S3: Develop a plug-in class Java Classloader according to different business logics, and package different business logics into executable JARs as business plug-ins; Step S4: The main program introduces the custom main program class Java Classloader, and defines the configuration items of the business plug-in in the main program application.yml; Step S5: the main program starts the main program class Java Classloader, loads different business plug-ins according to the application.yml configuration file, and starts the business plug-in program; Step S6: The business plug-in starts the plug-in class Java Classloader and loads its own classes and dependencies; after all business plug-ins are started, the main program is started; Step S7: When the main program is running, the main program uninstalls the old service plug-in and hot-loads the new plug-in.
[0006] In order to better implement the present invention, further, in step S2, the Java Classloader is responsible for reading the binary data stream of the Class information into the Java virtual machine, converting it into a java.lang.Class object instance corresponding to the target class, and then handing it over to the Java virtual machine for linking and initialization operations.
[0007] In order to better implement the present invention, further, in step S3, different business logics are developed using the SpringBoot framework, the business interface Java Interface defined in the main program is implemented, a custom plug-in class Java Classloader is introduced to manage and load its own classes and dependent packages, and the implemented program is encapsulated into a business plug-in in the form of a JAR package.
[0008] In order to better implement the present invention, further, in step S4, the configuration items include any one or more of the main program startup class name, plug-in path, plug-in startup sequence configuration, and plug-in startup mode.
[0009] In order to better implement the present invention, further, in step S7, when the main program is running, if there is a new business function or a business function correction, the relevant new business plug-in is uploaded through the main program plug-in upload management interface, and after the upload is completed, the function expansion can be achieved without restarting the main program.
[0010] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for constructing a highly scalable plug-in architecture of an operating system.
[0011] A computer device includes one or more processors and a storage device, wherein the storage device is used to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method for constructing a highly scalable plug-in architecture of an operating system.
[0012] The beneficial effects of the present invention are as follows: The present invention aims to make up for the shortcomings of the telecom operator's resource management system in the service scalable implementation technology, such as the complex code management caused by the code branching method, the unstable version caused by the frequent modification method of the core code, etc. The present invention uses a custom Java Classloader to manage the main program and the service plug-in to achieve system expansion. The way of forming plug-ins for different business logic codes and core logic codes achieves the goal of quickly realizing business changes in the resource system, quickly realizing different business logic versions, stabilizing the core business code, and enabling the system to achieve rapid support for the business and high scalability of the system. The present invention combines the business needs of the telecommunications system, identifies the points in the system where different business logics are prone to change, and uses a custom Java Classloader class loader to realize a plug-in architecture method that separates code extension points and code implementations. Different custom class loaders load business plug-ins into the system to meet the rapid implementation of the business. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 The present invention is a flowchart of a method for constructing a highly scalable plug-in architecture for an operating system. DETAILED DESCRIPTION
[0014] Embodiment 1: A method for constructing a highly scalable plug-in architecture for an operating system, such as Figure 1 As shown, the following steps are included: ① Identify the core business and encapsulate it into the main program, and define different business interfaces in the main program. Identify the core business code in the business code and separate the different business logics that may exist from the core business logic. The core business logic is used as the main program, and different business logics are defined in the main program using the business interface Java Interface method.
[0015] A Java Interface is a special kind of abstract class that only defines the specification of methods without providing implementation. Interfaces are usually declared using the Interface keyword. An interface can contain method declarations that do not contain implementations (no method bodies).
[0016] ② Create a custom Java Classloader. By inheriting the Java Classloader class and overriding the findClass method, a custom Java Classloader is created that can load class files in the specified path and implement class loading of different versions and dependencies.
[0017] Java Classloader is a part of Java Runtime Environment, which is responsible for reading the binary data stream of Class information into JVM (Java Virtual Machine) through various means, converting it into a java.lang.Class object instance corresponding to the target class, and then handing it to Java Virtual Machine for linking, initialization and other operations.
[0018] ③Introduce plug-in class Java Classloader for independent development according to different business logics, and package different business logics into executable jars as business plug-ins. Different business logics are developed using the Spring Boot framework, and the business interface JavaInterface defined in the main program is implemented. A custom plug-in class Java Classloader is introduced to manage and load its own classes and dependent packages, and the implemented program is packaged into a business plug-in in the form of a JAR package.
[0019] Spring Boot is a framework provided by the Pivotal team. It is an open source framework for simplifying the initial construction and development process of Spring applications. The framework uses a specific method for configuration, so that developers no longer need to define boilerplate configurations.
[0020] JAR files are archive file formats in Java, commonly used to package multiple Java class files, related metadata, and resources (text, images, etc.) so that they can be easily copied and moved to any Java-enabled system. A JAR file is a ZIP file that usually has a .jar or .JAR file extension.
[0021] ④ Introduce a custom main program class Java Classloader in the main program. When the main program startup class is started, use this main program class Java Classloader to load the required plug-ins and guide the business plug-in to start according to the plug-in configuration items. Then the business plug-in's own Classloader loads its own required dependencies and classes, thereby completing the startup of the entire business system.
[0022] ⑤ Add business plug-in configuration items to the main program (the program that implements the core business logic) configuration file application.yml. The configuration items include the main program startup class name, plug-in path, plug-in startup sequence configuration, plug-in startup mode, etc.
[0023] application.yml is a common configuration file of Spring Boot, which is used to define the configuration of the application. It uses YAML format, which is a human-readable data serialization language.
[0024] ⑥ The main program starts its own main program class Java Classloader, loads different business plug-ins according to the application.yml configuration file, and starts the business plug-in program.
[0025] ⑦ The business plug-in starts its own plug-in class Java Classloader and loads its own classes and dependent packages. After all business plug-ins are started, the main program is started.
[0026] ⑧ When the main program is running, the main program uninstalls the old business plug-in and hot loads the new plug-in. If there is a new business function or a business function revision, upload the relevant new business plug-in through the main program plug-in upload management interface. After the upload is completed, the function can be expanded without restarting the main program.
[0027] Identify the core business code in the business code, separate different business logics from the core business logic, develop and implement different business logics using the general spring boot framework, introduce a custom plug-in class loader (java's ClassLoader) to load its own dependent packages, and encapsulate them into mutually isolated business plug-ins in the form of jar packages. In the implementation of the core business logic, introduce a custom main program class loader (java's ClassLoader). When the core program is started, this class loader independently loads each required business logic plug-in to create a complete business logic program.
[0028] In the code extension point of the core business, a set of business methods can be defined in Java by defining an interface, and then the mechanism of implementing these methods in different plug-ins can be used to achieve the purpose of dynamically expanding system functions. Each version of the business system uniformly uses the plug-in management function provided by the plug-in framework to complete the loading of the business plug-in package and assemble it into a complete business system. The present invention realizes high scalability in the entire system business by forming plug-ins for different business logic codes and core logic codes.
[0029] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for constructing a highly scalable plug-in architecture for an operating system, characterized in that: The following steps are involved: Step S1: Identify the core business code in the business code, separate the business logic from the core business logic; use the core business logic as the main program; define different business interfaces in the main program for different business logics, and the business logic is defined in the main program using the business interface Java Interface; Step S2: Create a custom Java Classloader to load class files under the specified path to achieve class loading of different versions and different dependencies; Step S3: Develop a plug-in class Java Classloader according to different business logics, and package different business logics into executable JARs as business plug-ins; Step S4: The main program introduces the custom main program class Java Classloader, and defines the configuration items of the business plug-in in the main program application.yml; Step S5: the main program starts the main program class Java Classloader, loads different business plug-ins according to the application.yml configuration file, and starts the business plug-in program; Step S6: The business plug-in starts the plug-in class Java Classloader and loads its own classes and dependencies; after all business plug-ins are started, the main program is started; Step S7: When the main program is running, the main program uninstalls the old service plug-in and hot-loads the new plug-in.
2. A method for constructing a highly scalable plug-in architecture for an operating system according to claim 1, characterized in that: In step S2, the Java Classloader is responsible for reading the binary data stream of the Class information into the Java virtual machine, converting it into a java.lang.Class object instance corresponding to the target class, and then handing it over to the Java virtual machine for linking and initialization operations.
3. A method for constructing a highly scalable plug-in architecture for an operating system according to claim 1 or 2, characterized in that: In step S3, different business logics are developed using the Spring Boot framework, the business interface Java Interface defined in the main program is implemented, a custom plug-in class Java Classloader is introduced to manage and load its own classes and dependent packages, and the implemented program is encapsulated into a business plug-in in the form of a JAR package.
4. The method for constructing a highly scalable plug-in architecture of an operation system according to claim 1, characterized in that: In step S4, the configuration items include any one or more of the main program startup class name, plug-in path, plug-in startup sequence configuration, and plug-in startup mode.
5. The method for constructing a highly scalable plug-in architecture of an operation system according to claim 1, characterized in that: In step S7, when the main program is running, if there is a new business function or a business function modification, the relevant new business plug-in is uploaded through the main program plug-in upload management interface. After the upload is completed, the function expansion can be achieved without restarting the main program.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements a method for constructing a highly scalable plug-in architecture for an operating system as described in any one of claims 1 to 5.
7. A computer device, characterized in that: It includes one or more processors and a storage device, wherein the storage device is used to store one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement a method for constructing a highly scalable plug-in architecture for an operating system as described in any one of claims 1-5.
Citation Information
Cited By
Fabricated hydraulic ring geological information system architecture
CN122089256A