An assembly development method, system, computer device and storage medium

By using separation and packaging technology and resource microservices, the problems of resource conflicts and bean name duplication in monolithic applications are solved, enabling independent operation of components and resource isolation, reducing development costs and improving development efficiency.

CN116301918BActive Publication Date: 2026-02-27INSPUR GENERSOFT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310232784.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-09
Publication Date
2026-02-27
Estimated Expiration
2043-03-09

AI Technical Summary

Technical Problem

In traditional monolithic applications, increased business requirements lead to system bloat, modifications to one function may affect other functions, resource utilization is mutually affected, and bean name conflicts and resource conflicts occur when using Spring Cloud and Spring Boot applications, resulting in high development costs.

Method used

The component source code is packaged into a JAR file using a separate packaging technique. An entry component is defined to load configuration information and register it with the Spring container, thereby achieving resource microservices and isolation. The packaging mode is based on the JAR file specification, and resource conflicts are resolved through service registration and discovery components.

Benefits of technology

It enables independent operation and resource isolation of components, reduces development costs, solves the difficulties of converting monolithic applications to microservices, avoids overall deployment and resource conflicts, and improves development efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116301918B_ABST
    Figure CN116301918B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of software development, and particularly discloses a component development method and system, a computer device and a storage medium, the method comprising the following steps: packaging component source code into a component, and placing the component under a target file directory, wherein the component comprises a jar package; defining an entry component and starting in response to the entry component, loading a target component under the target file directory based on the entry component; analyzing configuration information of the target component under the target file directory, registering the analyzed configuration information to a container of Spring, and injecting a bean to the jar package of the target component; publishing a service corresponding to the target component and loading a corresponding resource file, and registering the service to a service registration center. The component realized by the application scheme is a deployable monomer architecture application, can be converted into a micro-service architecture through a service configuration mode, and solves the problem that the whole project needs to be deployed every time under the monomer architecture, so that application incremental publishing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of software development, and particularly relates to a component development method and system, computer equipment and a storage medium. BACKGROUND

[0002] In the traditional enterprise software system architecture, an object or a business type is usually used to construct a monolithic project for a business requirement. In the early stage of business development or in small and medium-sized enterprises, due to manpower, funds, business and other factors, it is relatively easy and convenient to develop, test and deploy all business logics in one application, which can meet the current business requirements. However, with the development of enterprises, the business requirements are increasing; the increasing requirements make the monolithic application become more and more bloated. The disadvantages of the monolithic application are exposed. Since the monolithic system is deployed in one process, when a small function is modified and deployed online, the operation of other functions may be affected. And the use scenarios, concurrency, resource types consumed by each module in the monolithic application are different, and the utilization of resources also affects each other.

[0003] With the development of mobile Internet and the popularity of application cloud, in order to solve the problem that the monolithic system becomes bloated and difficult to maintain, the micro-service architecture is born, and the micro-service has become the most popular design concept of enterprise application service architecture. We can split different functional modules in the system into multiple different services, and these services can be independently deployed and expanded. Since each service runs in its own process, there is a stable boundary in deployment, so the update of each service will not affect the operation of other services. At the same time, since each service is independently deployed, the performance capacity of each service can be more accurately evaluated, and at the same time, through the cooperation process between services, the bottleneck position of the system can be more easily found, and a more accurate system-level performance capacity evaluation can be given.

[0004] To meet the diverse needs of different enterprises, software companies recommend either monolithic applications or cloud services based on factors such as business scale, operational costs, and capital investment. This necessitates providing multiple application frameworks for the same business, increasing costs. Currently, Spring Boot and Spring Cloud are the most popular monolithic application and cloud service frameworks used by software companies. Common problems include: 1. Spring Cloud applications consist of multiple monolithic applications following their specifications, while Spring Boot consists of multiple starters. Deploying Spring Boot within Spring Cloud requires further encapsulation of the starters into a Spring Boot monolith; 2. When integrating starters developed in the Spring Cloud environment into Spring Boot monolithic applications, bean name conflicts inevitably occur during injection due to the large number of starters integrated, leading to runtime exceptions. This results in code adaptation issues across different architectures, wasting significant manpower and time. Summary of the Invention

[0005] In view of this, this invention proposes a component development method, system, computer equipment, and storage medium, solving the problem of needing to provide two sets of software for a single business application. This allows developers to focus on business development and reduces the investment of developers and development costs. This invention employs a separate packaging technology, solving the problem of needing to package and deploy the entire monolithic application when problems occur; only the modified components need to be deployed. By making components application-oriented, rather than simply using a starter approach, each component can run independently, solving the difficulty of converting monolithic applications to microservices and eliminating the need for a coexistence of monolithic and microservice application development. By abandoning the packaging mode provided by Spring Boot and adopting a packaging mode based on JAR file specifications, this invention solves the problem that JAR files cannot be referenced as libraries when used as applications. Furthermore, this invention microservices the component resources, resolving resource conflict issues.

[0006] To achieve the above objectives, one aspect of the present invention provides a component development method, specifically including the following steps:

[0007] The component source code is compiled to package the component source code into a component, and the component is placed in the target file directory, wherein the component includes a jar file;

[0008] Define an entry component, and in response to the entry component being started, load the target components in the target file directory based on the entry component;

[0009] In response to loading the target component, parsing configuration information of the target component under the target file directory;

[0010] Registering the parsed configuration information to a container of Spring, and injecting a bean of Spring to the jar package of the target component;

[0011] Publishing a service corresponding to the target component, loading resource files required by the service, and registering the service to a service registry center after loading is completed.

[0012] In some embodiments, the jar package comprises a META-INF folder, and the META-INF folder comprises a spring.factories file;

[0013] Compiling the component source code to package the component source code into a component, and placing the component under a target file directory, comprising:

[0014] Compiling the component source code, and declaring an annotation class in the component source code during the compiling process, and configuring a declared class corresponding to the annotation class in a spring.factories file of a META-INF folder;

[0015] Packaging the component source code after the compiling into a component.

[0016] In some embodiments, the component further comprises a config folder, a lib folder, and a static folder;

[0017] Placing the component under the target file directory comprises:

[0018] Placing the config folder, the lib folder, the static folder, and the jar package under the target file directory.

[0019] In some embodiments, parsing the configuration information of the target component under the target file directory comprises:

[0020] Parsing the declared class in the spring.factories file in the corresponding META-INF folder under the target file directory.

[0021] In some embodiments, registering the parsed configuration information to the container of Spring, and injecting the bean of Spring to the jar package of the target component comprises:

[0022] The Spring-based callback function registers the parsed configuration information to the Spring's ApplicationContext, and injects the bean into the jar package of the target component based on the Spring's BeanNameGenerator interface.

[0023] In some embodiments, defining the entry component comprises:

[0024] In some embodiments, the entry component configures a static resource mapping path based on a Spring-based configuration interface to map the static resource file of the target component into the static resource file of the entry component after the target component is loaded.

[0025] In some embodiments, the method further comprises:

[0026] In some embodiments, the entry component adds a front-end uniform access path for the target component and defines a front-end application name of the target component.

[0027] Another aspect of the embodiments of the present application further provides a component development system, comprising:

[0028] a packaging module configured to compile component source code to package the component source code into a component and place the component under a target file directory, wherein the component comprises a jar package;

[0029] a loading module configured to define an entry component and load the target component under the target file directory based on the entry component in response to the entry component starting;

[0030] a parsing module configured to parse configuration information of the target component under the target file directory in response to the target component being loaded;

[0031] a first registration module configured to register the parsed configuration information to a Spring container and inject a Spring bean into the jar package of the target component;

[0032] a second registration module configured to publish a service corresponding to the target component, load a resource file required by the service, and register the service to a service registry center after the loading is completed.

[0033] Still another aspect of the embodiments of the present application further provides a computer device, comprising: at least one processor; and a memory storing a computer program capable of running on the processor, wherein the computer program is executed by the processor to implement the steps of the above method.

[0034] In another aspect, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method steps.

[0035] This invention has at least the following beneficial technical effects: By employing a separate packaging technology, it solves the problem of needing to package and deploy the entire monolithic application when issues arise; only the modified components need to be deployed. By making components application-oriented, moving beyond a simple starter approach, each component can run independently, overcoming the difficulty of transitioning from monolithic applications to microservices and eliminating the need for a coexistence of monolithic and microservice application development. By abandoning the packaging mode provided by Spring Boot and adopting a packaging mode based on JAR file specifications, it solves the problem that JAR files cannot be referenced as libraries when used as applications. Furthermore, by microservice-izing component resources, resource isolation is achieved, resolving resource conflict issues. Attached Figure Description

[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained based on these drawings without creative effort.

[0037] Figure 1 A flowchart of an embodiment of the component development method provided by the present invention;

[0038] Figure 2 A flowchart illustrating an embodiment of loading components from a specified directory into an application, provided by the present invention;

[0039] Figure 3 A flowchart illustrating an embodiment of the present invention for registering components and invoking services;

[0040] Figure 4 A schematic diagram of an embodiment of the component development system provided by the present invention;

[0041] Figure 5 A schematic diagram of the structure of an embodiment of the computer device provided by the present invention;

[0042] Figure 6 A schematic diagram of an embodiment of the computer-readable storage medium provided by the present invention. Detailed Implementation

[0043] In order to make the objects, technical solutions and advantages of the present application clearer, the embodiments of the present application are further explained in detail below with reference to the drawings.

[0044] It should be noted that all the expressions of "first" and "second" in the embodiments of the present application are used to distinguish two same name different entities or different parameters, and it can be seen that "first" and "second" are only for the convenience of description, and should not be understood as a limitation of the embodiments of the present application. The subsequent embodiments will not be described one by one.

[0045] Based on the above purpose, a first aspect of the embodiments of the present application proposes a component development method. As shown in the embodiment of Figure 1 The method comprises the following steps:

[0046] S10, compiling the component source code to package the component source code into a component, and placing the component under a target file directory, wherein the component comprises a jar package;

[0047] S20, defining an entry component, and in response to the entry component starting, loading the target component under the target file directory based on the entry component;

[0048] S30, in response to loading the target component, parsing the configuration information of the target component under the target file directory;

[0049] S40, registering the parsed configuration information to the container of Spring, and injecting the bean of Spring into the jar package of the target component;

[0050] S50, publishing the service corresponding to the target component, loading the resource file required by the service, and after the loading is completed, registering the service to the service registration center.

[0051] Those skilled in the art can understand that the order of the steps of the above and below described method is not limited to the listed order, and in actual application, it can be adjusted according to the needs, and some steps can be combined or omitted without departing from the protection scope of the present application.

[0052] In step S10, the component uses a custom compilation tool to compile and package the component source code into a component. For example, a custom compilation tool complying with the JAR file specification can be used to place the packaged component in the specified file directory according to the storage rule. Subsequently, when the component is modified, the incremental deployment can be realized by cooperating with the file duplication checking tool.

[0053] The packaged component includes a jar package, a file structure of the jar package includes a META-INF, an org and a resource folder, and does not include a BOOT-INF folder, so that the jar package can be added to an application project as a class library reference, wherein the META-INF folder is used for storing component configuration files, the org folder is used for storing component referenced class libraries, and the resource folder is used for storing static resource files of the component.

[0054] In step S20, an entry component is defined, and loading of each component is implemented in the entry component.

[0055] In step S30, if a target component is loaded in the entry component, the target component is a compiled and packaged component, and a user can load based on an implementation project requirement, and configuration information of the target component in a target file directory, that is, configuration information in the jar package, is parsed.

[0056] In step S40, the parsed configuration information is registered to a Spring container, and a Spring bean is injected into the jar package of the target component, and dynamic loading of the jar package in a specified directory is implemented; when the bean is injected, the Spring implements naming of each bean based on a custom interface, and satisfies that the coding of each bean is unique in the spring container, so that the injected object does not cause a problem of repeated bean names.

[0057] In step S50, each component can be independently run, but in actual business, there is a relationship of calling each other between each component. In the application, there is no logic of calling each other. In order to solve this problem, a service registration and discovery component is added in the component. When the application is started, the component is registered to the corresponding service registration and discovery component, so that isolation between the components is ignored, and transparent calling of business logic is completed.

[0058] And by publishing a service corresponding to the target component, resource files required by the service are loaded, the service and the resource are registered to a service registration center, resource isolation is implemented, and the problem of resource conflict is solved.

[0059] Through the above scheme, each component is a deployable monolithic architecture application, and can be started using a java-jar command; each component is also a starter, and can add a reference to the jar package using a maven or gradle command. Each component is a deployable monolithic architecture application, and can be converted into a microservice architecture through service configuration.

[0060] The application scheme of the application applies the components, is no longer a simple starter mode, enables each component to be independently operated, discards the packaging mode provided by the spring boot when the components are packaged, adopts a packaging mode based on the JAR file specification, solves the problem that the jar package cannot be referenced as a class library when serving as an application, adopts a separate packaging technology, solves the problem that the monomer application needs to be packaged in its entirety and deployed in its entirety when a problem occurs, and only the modified component needs to be deployed, solves the difficulty of converting the monomer application into a micro service, and the monomer application and the micro service application development coexist mode is not used during development, the problem of name conflict of the background component type is solved through component type isolation, the resource is micro-serviced, resource isolation is realized, and the problem of resource conflict is solved.

[0061] In some embodiments, the jar package includes a META-INF folder, and the META-INF folder includes a spring.factories file.

[0062] The component source code is compiled to package the component source code into a component, and the component is placed under a target file directory, including:

[0063] The component source code is compiled, and in the compiling process, an annotation class is declared in the component source code, and a declaration class corresponding to the annotation class is configured in a spring.factories file of a META-INF folder.

[0064] The compiled component source code is packaged into a component.

[0065] In some embodiments, the component further includes a config folder, a lib folder, and a static folder.

[0066] Placing the component under the target file directory includes:

[0067] The config folder, the lib folder, the static folder, and the jar package are placed under the target file directory.

[0068] Specifically, the component packaged based on the compiling tool is composed of a config folder, a lib folder, a static folder, and a jar file, and the config folder, the lib folder, the static folder, and the jar file are placed in a specified file directory according to a storage rule. Subsequently, an incremental deployment can be realized by cooperating with a file duplication checking tool.

[0069] In some embodiments, parsing the configuration information of the target component under the target file directory includes:

[0070] Parse the declared class in the spring.factories file in the corresponding META-INF folder under the target file directory.

[0071] Specifically, when compiling the component source code, the scanning and registration of the service can be implemented in the declared @Configuration annotation class, and the org.springframework.boot.autoconfigure.EnableAutoConfiguration corresponding declared class is configured in the META-INF / spring.factories file under the class path classpath. Thus, when other programs need this component, the META-INF / spring.factories configuration file of the jar package can be found.

[0072] When searching for the META-INF / spring.factories configuration file of the jar package, the spring / springboot application extender of ApplicationContextInitializer is used to dynamically parse the spring.factories configuration file in the jar package under the specified directory, register the spring.factories configuration file to the ApplicationContext, and implement the injection of the bean in the spring to the jar package, thereby achieving the dynamic loading of the jar package under the specified directory.

[0073] Among them, ApplicationContextInitializer is a callback function used before the Spring container is refreshed, and is usually used to inject properties into the SpringBoot container; ApplicationContext is the core interface and container in Spring, which allows the container to create, obtain, and manage beans through the application context environment.

[0074] As shown in the flowchart for loading the components under the specified directory to the application, the specific steps are as follows: Figure 2

[0075] When it is necessary to load the components under the specified directory into the application, it is determined whether there are usable components under the specified directory, wherein the application is composed of an entry component and components;

[0076] If yes, the configuration information of the target component under the specified directory, i.e., the spring.factories configuration file in the target component jar package, is obtained;

[0077] ​Parse the configuration information of the target component and register it in the ApplicationContext;

[0078] According to the agreement, the business service is issued, and the corresponding resource file is loaded;

[0079] Register the service and the corresponding resource file in the service registry center.

[0080] In the present application, each component can run independently, but in actual business, each component will have a relationship between each other. But there is no reference between each other in the present application. In order to solve this problem, we add a service registration and discovery component in the component. As shown in Figure 3 When the application is started, the component is registered in the corresponding service registration and discovery component. After the SPI loads the component, the ApplicationListener interface and SmartInitializingSingleton are implemented, and the component is registered in the service registration and discovery component, that is, the service registry center, after the jar package is loaded. After the component is registered in the service registry center, it is embodied as a service. Subsequent users can call the corresponding service through service discovery to the service registry center when needed.

[0081] For example, the implemented component is nacos, which realizes the registration of the service through nacos, and deregisters the service when the application is closed. In this way, the system can call the required service through openfeign, rpc or event notification, ignore the isolation between components, and complete the transparent call of the business logic.

[0082] It should be understood that the embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application.

[0083] In some embodiments, the parsed configuration information is registered in the container of Spring, and the bean of Spring is injected into the jar package of the target component, including:

[0084] The parsed configuration information is registered in the ApplicationContext of Spring based on the callback function of Spring, and the bean is injected into the jar package of the target component based on the BeanNameGenerator interface of Spring.

[0085] Specifically, Spring names each bean when injecting the bean, generally the class name (declared Component and its subclasses) or the method name (declared Bean). In enterprise development, this can easily cause the same name, and in the case of not allowing the same name, it can also cause the application to fail to start normally. To solve this problem, a custom BeanNameGenerator interface is implemented when the SPI loads the component, so that the code of each bean is unique in the spring container, so that the injected object does not cause the problem of repeated bean names.

[0086] In some embodiments, the method further comprises:

[0087] In the entrance component, the static resource mapping path is configured based on the Spring configuration interface, so that the static resource files of the target component are mapped to the static resource files of the entrance component after the target component is loaded.

[0088] Specifically, the entrance component is defined, the WebFluxConfigurer interface is implemented in the entrance component of the system, the addResourceHandlers method is rewritten, and the static resource files of the component are mapped to the static resource files of the entrance component after the jar package is loaded, so that the management of static files is realized.

[0089] In some embodiments, the method further comprises:

[0090] In the entrance component, the front-end uniform access path of the target component is added and the front-end application name of the target component is defined.

[0091] Specifically, the front-end and back-end mixed development mode and the front-end and back-end separation mode can also be used for the component, so that the front-end UI of each component is independent in addition to the background application. When the system starts, a uniform access path and a front-end application name can be added for the front-end of each component. The application name of each component is used as a unique mark for the gateway, service registration and static files. In this way, the problem of conflicting resources caused by different components is avoided.

[0092] Based on the same inventive concept, according to another aspect of the present application, as Figure 4 shown, the embodiment of the present application also provides a component development system, which comprises:

[0093] The packaging module 110 is configured to compile the component source code to package the component source code into a component, and place the component under a target file directory, wherein the component comprises a jar package.

[0094] The loading module 120 is configured to define an entry component and load a target component under the target file directory based on the entry component in response to the entry component being started;

[0095] The parsing module 130 is configured to parse configuration information of the target component under the target file directory in response to the target component being loaded;

[0096] The first registration module 140 is configured to register the parsed configuration information to a container of Spring and inject a bean of Spring into a jar package of the target component;

[0097] The second registration module 150 is configured to publish a service corresponding to the target component, load a resource file required by the service, and register the service to a service registry center after the loading is completed.

[0098] Based on the same inventive concept, according to another aspect of the present application, as Figure 5 As shown in the figure, the embodiment of the present application also provides a computer device 30, wherein the computer device 30 comprises a processor 310 and a memory 320, the memory 320 stores a computer program 321 capable of running on the processor, and the processor 310 executes the steps of the method as above when executing the program.

[0099] The memory is a non-volatile computer readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as the program instructions / modules corresponding to the component development method in the embodiment of the present application. The processor executes various function applications and data processing of the system by running the non-volatile software programs, instructions and modules stored in the memory, that is, implements the component development method of the above method embodiment.

[0100] The memory can include a program storage area and a data storage area, wherein the program storage area can store an operating system and at least one application required by a function; the data storage area can store data created according to the use of the system, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the local module through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0101] Based on the same inventive concept, according to another aspect of the present application, as Figure 6As shown, the embodiments of the present application also provide a computer readable storage medium 40, which stores a computer program 410 executed by a processor to perform the above method.

[0102] Finally, it should be noted that those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of the method. Among them, the storage medium of the program can be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM) and the like. The above-mentioned embodiments of the computer program can achieve the same or similar effects as the corresponding any method embodiments.

[0103] Those of skill in the art will further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present embodiments.

[0104] The above is the exemplary embodiment disclosed by the present application, but it should be noted that various changes and modifications can be made without departing from the scope of the embodiments disclosed by the present application defined by the claims. The functions, steps and / or acts of the method claims described in connection with the embodiments disclosed herein need not be performed in any particular order. The above-mentioned embodiment numbers of the embodiments disclosed by the present application are only for description and do not represent the advantages and disadvantages of the embodiments. In addition, although the elements of the embodiments disclosed by the present application can be described or claimed in singular form, they can also be understood as plural unless explicitly limited to singular.

[0105] Those of ordinary skill in the art will understand that the above discussion of any embodiment is only exemplary and is not intended to limit the scope of the embodiments disclosed by the present application (including claims) to these examples; under the idea of the embodiments disclosed by the present application, the above embodiments or technical features between different embodiments can also be combined, and there are many other changes of the above aspects of the embodiments disclosed by the present application. In order to be brief, they are not provided in detail. Therefore, any omissions, modifications, equivalent replacements, improvements and the like made in the spirit and principles of the embodiments disclosed by the present application shall be included in the protection scope of the embodiments disclosed by the present application.

Claims

1. A method of component development, characterized by, The method comprises the following steps: compiling component source code to package the component source code into a component, and placing the component under a target file directory, wherein the component comprises a jar package; defining an entry component, and in response to the entry component starting, loading a target component under the target file directory based on the entry component; in response to loading the target component, parsing configuration information of the target component under the target file directory; registering the parsed configuration information to a container of Spring, and injecting a bean of Spring into the jar package of the target component; publishing a service corresponding to the target component, loading a resource file required by the service, and registering the service to a service registry center after the loading is completed.

2. The method of claim 1, wherein, The jar package comprises a META-INF folder, and the META-INF folder comprises a spring.factories file; The compiling of the component source code to package the component source code into a component, and placing the component under a target file directory comprises: compiling the component source code, and in the compiling process, declaring an annotation class in the component source code, and configuring a declared class corresponding to the annotation class in a spring.factories file of a META-INF folder; packaging the component source code after the compiling into a component.

3. The method of claim 2, wherein, The component further comprises a config folder, a lib folder, and a static folder; The placing of the component under the target file directory comprises: placing the config folder, the lib folder, the static folder, and the jar package under the target file directory.

4. The method of claim 2, wherein, The parsing of the configuration information of the target component under the target file directory comprises: parsing a declared class in a spring.factories file in the corresponding META-INF folder under the target file directory.

5. The method of claim 1, wherein, The registering of the parsed configuration information to the container of Spring, and the injecting of the bean of Spring into the jar package of the target component comprises: registering the parsed configuration information to an ApplicationContext of Spring based on a callback function of Spring, and injecting a bean into the jar package of the target component based on a BeanNameGenerator interface of Spring.

6. The method of claim 1, wherein, The defining of the entry component comprises: configuring a static resource mapping path in the entry component based on a configuration interface of Spring, so as to map a static resource file of a target component to a static resource file of the entry component after the target component is loaded.

7. The method of claim 6, wherein, The method further comprises the following steps: adding a front-end unified access path for the target component and defining a front-end application name of the target component in the entry component.

8. An assembly development system characterized by, The method comprises the following steps: a packaging module configured to compile component source code to package the component source code into a component, and place the component under a target file directory, wherein the component comprises a jar package; a loading module, configured to define an entry component and load target components under a target file directory based on the entry component in response to the entry component being started; a parsing module, configured to parse configuration information of the target components under the target file directory in response to the target components being loaded; a first registration module, configured to register the parsed configuration information to a container of Spring, and inject a bean of Spring into a jar package of the target components; a second registration module, configured to publish a service corresponding to the target components, load resource files required by the service, and register the service to a service registry center after the loading is completed. 9.A computer device, comprising: at least one processor; and a memory, the memory storing a computer program executable on the processor, wherein the processor executes the program to perform the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to perform the steps of the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Micro-service registration method and device, electronic equipment and readable storage medium

    CN109766080A

  • Web system upgrading method and device, electronic equipment and computer readable medium

    CN114816469A