Component architecture design scheme compatible with micro-service and single body

By adopting a component architecture design scheme that is compatible with both microservices and monolithic systems, the problem of redundant development of component code in monolithic and microservice projects is solved, thereby achieving reusability of business logic components and reducing the risk of errors.

CN120687084APending Publication Date: 2025-09-23河钢数字技术股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510659706.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-21
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In project development, existing technologies require writing two sets of component code for the monolithic version and the microservice version, resulting in a large amount of repetitive work and an increased risk of errors.

Method used

This paper provides a component architecture design scheme that is compatible with both microservices and monolithic architectures. It includes backend component projects, microservice base projects, business logic related projects, and monolithic projects. Capabilities are provided through component JAR packages, and business logic is uniformly constructed using the Fegin interface.

Benefits of technology

It enables the use of the same business logic components in both monolithic and microservice project structures, improving component reusability, avoiding redundant development, and reducing the risk of errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687084A_ABST
    Figure CN120687084A_ABST
Patent Text Reader

Abstract

The invention relates to a micro-service and monomer compatible component architecture design scheme, which comprises a back-end component project, a micro-service basic project, a business logic related project and a monomer project, the back-end component project provides capability by providing a component jar package, the micro-service basic project provides capability by using the component jar package, and the monomer project provides capability by using the micro-service basic project. Basic micro-service items are constructed according to a micro-service mode, and a fegin interface is provided, and the business logic related items use the fegin interface of the micro-service basic items to construct background business logic. According to the overall structure provided by the embodiment of the invention, a component architecture design scheme compatible with the micro-service and the single body is realized, the component architecture design scheme comprises a back-end component project, a micro-service basic project, a business logic related project and a single body project, and the overall structure can support the single body and the micro-service project to use the same business logic component at the same time under the structure; the reusability of the business logic component is improved, and repeated development of business logic is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer software technology, and in particular to a component architecture design scheme compatible with microservices and monoliths. Background Art

[0002] At the Platform R&D Center, our primary goal is to effectively support the smooth delivery of projects. To this end, we provide numerous practical and efficient tool components and business components, enabling project teams to easily leverage these resources for development focused on project delivery. During actual project implementation, project teams will select the appropriate development model based on the specific scale, complexity, and other requirements. Whether it's a monolithic or microservices-based project, customized development will be performed accordingly.

[0003] However, this development model presented a challenge: to provide the same core component functionality across different project versions, we needed to write two sets of component code, one for the monolithic version and one for the microservices version. This approach not only resulted in a significant amount of duplication of effort but also increased the risk of omissions and errors during development. Therefore, we proposed a component architecture design that was compatible with both microservices and monoliths. Summary of the Invention

[0004] This application provides a component architecture design solution that is compatible with microservices and monoliths to solve the above-mentioned problems.

[0005] This application provides a component architecture design solution that is compatible with microservices and monoliths, including:

[0006] Backend component projects, microservice basic projects, business logic related projects and single projects, wherein the backend component projects provide capabilities by providing component jar packages, the microservice basic projects use component jar packages to build basic microservice projects in a microservice manner and provide fegin interfaces, the business logic related projects use the fegin interfaces of the microservice basic projects to build backend business logic, and the single projects use the business component jar packages of the backend component projects to build backend business logic.

[0007] Preferably, the backend component project includes basic business components, tool components and business logic components.

[0008] Preferably, the basic business components are used for the core functions used in project startup, including: basic rule core components, database core components and basic web core components;

[0009] The basic rule core component is used for the basic configuration rules of the project, including: basic constant configuration file, basic exception handling class, exception handling enumeration, basic enumeration class, basic tool class, basic thread variable processing class and general custom annotations;

[0010] The database core component is used to process general database configuration processing, including: mybatis plug-in base class, mybatis tenant plug-in, mybatis sorting plug-in, mybatis paging plug-in, mybatis scan path configuration, database basic field base class, tenant field base class;

[0011] The basic web-side core components are used to build the configuration required for the web project, including: URL request XSS filter, header information processing filter, secondary authentication filter, FegIn interface header processing filter, MVC configuration, and Swagger document configuration.

[0012] Preferably, the tool component provides independent tool capabilities for project use, including: regional code component, cache component, distributed transaction component, circuit breaker and current limiting component, link tracking component, system configuration component, database localization component, multiple data source component, mailbox component, file component, code generation component, log component, dynamic form component, message component, office file processing component, pinyin conversion component, security component, SMS component, socket component, scheduled task component, and parameter verification component.

[0013] Preferably, the business logic component provides basic business capabilities, including: basic business components, basic configuration components, message components, log components, workflow components, and low-code components.

[0014] Preferably, the basic business components provide basic business capabilities for the management platform project, including: login, authentication, users, tenants, applications, administrator management, management roles, menu resources, button resources, interface resources, business logic for resource authorization, and database storage persistence capabilities;

[0015] The basic configuration component provides the configuration capabilities used by the management platform project, including: regional code configuration management, system configuration management, dictionary configuration management, platform theme configuration management, and custom workbench configuration management;

[0016] The message component provides basic message configuration and sending capabilities, including: message channel configuration management, message category configuration management, message template configuration management, message logging, message sending by template, and message sending by channel;

[0017] The log component provides message recording and message query capabilities, including: recording login logs, recording operation logs, and the recording operation log recording methods support: interface method logging and annotation method logging;

[0018] The workflow component provides workflow configuration management capabilities for configuring the approval process, approval content, and approval node transfer functions;

[0019] The low-code component provides a drag-and-drop method for building low-code applications and low-code forms, supports dynamic creation of database forms and persistence in the database, and can be combined with the workflow component to build an approval process for dynamic forms.

[0020] Preferably, the microservice basic project uses business logic components to build a basic microservice project, including: a microservice gateway project, a microservice basic business project, a microservice basic configuration project, a microservice log center project, a microservice message center project, a microservice workflow project, and a microservice low-code project.

[0021] Preferably, the microservice gateway project builds the spring cloud gateway gateway used by the microservice, which is used for traffic distribution control of interface requests;

[0022] The microservice basic business project uses the basic business components to build a microservice basic business project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0023] The microservice basic configuration project uses the basic configuration component to build a microservice basic configuration project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0024] The microservice log center project uses the log component to build a microservice log center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0025] The microservice message center project uses the message component to build a microservice message center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0026] The microservice workflow project uses the workflow component to build a microservice workflow project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0027] The microservice low-code project uses the low-code component to build a microservice low-code project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface.

[0028] Preferably, the business logic-related projects use the fegin interface provided by the microservice gateway project, microservice basic business project, microservice basic configuration project, microservice log center project, microservice message center project, microservice workflow project, and microservice low-code project to write the business logic required for the business and complete the business logic function.

[0029] Preferably, the single project uses the service methods provided by the basic core components, tool components, and business logic components to write the business logic required for the business and complete the business logic functions.

[0030] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0031] Compared with the prior art, the overall structure provided by the embodiment of the present application achieves:

[0032] The component architecture design scheme that is compatible with microservices and monoliths includes: backend component projects, microservice basic projects, business logic-related projects, and monolithic projects. The overall structure can support the simultaneous use of the same business logic components under monolithic and microservice project structures, thereby improving the reusability of business logic components and avoiding repeated development of business logic. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0035] Figure 1 It is the overall principle diagram of the present invention;

[0036] Figure 2 The backend component project layer code of the present invention;

[0037] Figure 3 This is the microservice basic project layer code of the present invention. DETAILED DESCRIPTION

[0038] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0039] The various embodiments of the present application may be presented in the form of a range. It should be understood that the description in the form of a range is merely for convenience and brevity and should not be construed as a rigid limitation on the scope of the present application. Therefore, it should be considered that the range description has specifically disclosed all possible sub-ranges and single numerical values ​​within the range. For example, it should be considered that the range description from 1 to 6 has specifically disclosed sub-ranges, such as from 1 to 3, from 1 to 4, from 1 to 5, from 2 to 4, from 2 to 6, from 3 to 6, etc., as well as single numbers within the range, such as 1, 2, 3, 4, 5 and 6, regardless of the range. In addition, whenever a numerical range is indicated in this application, it is intended to include any quoted number (fraction or integer) within the indicated range. Unless otherwise specified, the various raw materials, reagents, instruments and equipment used in this application are all commercially available or can be prepared using existing equipment.

[0040] In this application, unless otherwise specified, the directional words used, such as "upper" and "lower", specifically refer to the directions of the drawings in the accompanying drawings. In addition, in this application, the terms "including", "comprising", etc. mean "including but not limited to". In this application, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. In this application, "and / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. Wherein A and B can be singular or plural. In this application, "at least one" means one or more, and "plurality" means two or more. "At least one", "at least one of the following" or similar expressions refer to any combination of these items, including any combination of singular or plural items. For example, "at least one of a, b, or c" or "at least one of a, b and c" can both mean: a, b, c, ab, i.e. a and b, ac, bc or abc, where a, b, c can be single or multiple.

[0041] like Figure 1-Figure 3As shown: The embodiment of the present application provides a component architecture design solution that is compatible with microservices and monoliths, including:

[0042] Backend component projects, microservice basic projects, business logic related projects and single projects, wherein the backend component projects provide capabilities by providing component jar packages, the microservice basic projects use component jar packages to build basic microservice projects in a microservice manner and provide fegin interfaces, the business logic related projects use the fegin interfaces of the microservice basic projects to build backend business logic, and the single projects use the business component jar packages of the backend component projects to build backend business logic.

[0043] The backend component project includes basic business components, tool components and business logic components.

[0044] The basic business components are used for the core functions used in project startup, including: basic rule core components, database core components and basic web core components;

[0045] The basic rule core component is used for the basic configuration rules of the project, including: basic constant configuration file, basic exception handling class, exception handling enumeration, basic enumeration class, basic tool class, basic thread variable processing class and general custom annotations;

[0046] The database core component is used to process general database configuration processing, including: mybatis plug-in base class, mybatis tenant plug-in, mybatis sorting plug-in, mybatis paging plug-in, mybatis scan path configuration, database basic field base class, tenant field base class;

[0047] The basic web-side core components are used to build the configuration required for the web project, including: URL request XSS filter, header information processing filter, secondary authentication filter, FegIn interface header processing filter, MVC configuration, and Swagger document configuration.

[0048] Preferably, the tool component provides independent tool capabilities for project use, including: regional code component, cache component, distributed transaction component, circuit breaker and current limiting component, link tracking component, system configuration component, database localization component, multiple data source component, mailbox component, file component, code generation component, log component, dynamic form component, message component, office file processing component, pinyin conversion component, security component, SMS component, socket component, scheduled task component, and parameter verification component.

[0049] The business logic components provide basic business capabilities, including: basic business components, basic configuration components, message components, log components, workflow components, and low-code components.

[0050] The basic business components provide the basic business capabilities of the management platform project, including: login, authentication, users, tenants, applications, administrator management, management roles, menu resources, button resources, interface resources, resource authorization business logic and database storage persistence capabilities;

[0051] The basic configuration component provides the configuration capabilities used by the management platform project, including: regional code configuration management, system configuration management, dictionary configuration management, platform theme configuration management, and custom workbench configuration management;

[0052] The message component provides basic message configuration and sending capabilities, including: message channel configuration management, message category configuration management, message template configuration management, message logging, message sending by template, and message sending by channel;

[0053] The log component provides message recording and message query capabilities, including: recording login logs, recording operation logs, and the recording operation log recording methods support: interface method logging and annotation method logging;

[0054] The workflow component provides workflow configuration management capabilities for configuring the approval process, approval content, and approval node transfer functions;

[0055] The low-code component provides a drag-and-drop method for building low-code applications and low-code forms, supports dynamic creation of database forms and persistence in the database, and can be combined with the workflow component to build an approval process for dynamic forms.

[0056] The microservice basic project uses business logic components to build basic microservice projects, including: microservice gateway project, microservice basic business project, microservice basic configuration project, microservice log center project, microservice message center project, microservice workflow project, and microservice low-code project.

[0057] The microservice gateway project builds the spring cloud gateway gateway used by the microservice, which is used for traffic distribution control of interface requests;

[0058] The microservice basic business project uses the basic business components to build a microservice basic business project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0059] The microservice basic configuration project uses the basic configuration component to build a microservice basic configuration project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0060] The microservice log center project uses the log component to build a microservice log center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0061] The microservice message center project uses the message component to build a microservice message center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0062] The microservice workflow project uses the workflow component to build a microservice workflow project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface;

[0063] The microservice low-code project uses the low-code component to build a microservice low-code project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface.

[0064] The business logic-related projects use the fegin interface provided by the microservice gateway project, microservice basic business project, microservice basic configuration project, microservice log center project, microservice message center project, microservice workflow project, and microservice low-code project to write the business logic required for the business and complete the business logic functions.

[0065] The single project uses the service methods provided by the basic core components, tool components, and business logic components to write the business logic required by the business and complete the business logic functions.

[0066] Principle: 3 is the backend component project layer code, including 3.1 business logic component, 3.2 core component, and 3.3 tool component.

[0067] 2 is the microservice basic project, including 2.1 microservice basic business project, 2.2 microservice log center project, 2.3 microservice low-code project, 2.4 microservice message center project, 2.5 microservice basic configuration project, and 2.6 microservice workflow project. Among them, 2.1 references the basic business component jar package of 3, 2.2 references the basic configuration component jar package of 3, 2.3 references the low-code component jar package of 3, 2.4 references the message component jar package of 3, 2.5 references the basic configuration component jar package of 3, and 2.6 references the workflow component jar package.

[0068] 1 is a business logic related project, including 1.1 is a microservice business logic project and 1.2 is a single business logic project;

[0069] 1.1 is a microservice business logic project, which references the jar packages provided by the microservice projects 2.1, 2.2, and 2.3, and calls the fegin interface to complete the business logic.

[0070] 1.2 is a single business logic project, which references the service methods provided in the component jar packages of 3.1, 3.2, and 3.3 to complete the business logic.

[0071] When implementing new business logic, add it in 3.1 and use it in microservice projects such as 2.1. Add a new feign interface and call the new feign interface in the 1.1 microservice business logic project to complete the business logic. Alternatively, call the newly added service method in 3.1 in the 1.2 monolithic project to complete the development of the new business logic.

[0072] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but rather is intended to conform to the broadest scope consistent with the principles and novel features claimed herein.

Claims

1. A component architecture design scheme compatible with microservices and monoliths, characterized by: include: Backend component projects, microservice basic projects, business logic related projects and single projects, wherein the backend component projects provide capabilities by providing component jar packages, the microservice basic projects use component jar packages to build basic microservice projects in a microservice manner and provide fegin interfaces, the business logic related projects use the fegin interfaces of the microservice basic projects to build backend business logic, and the single projects use the business component jar packages of the backend component projects to build backend business logic.

2. A component architecture design scheme compatible with microservices and monoliths according to claim 1, characterized in that: The backend component project includes basic business components, tool components and business logic components.

3. The component architecture design scheme compatible with microservices and monoliths according to claim 2 is characterized by: The basic business components are used for the core functions used in project startup, including: basic rule core components, database core components and basic web core components; The basic rule core component is used for the basic configuration rules of the project, including: basic constant configuration file, basic exception handling class, exception handling enumeration, basic enumeration class, basic tool class, basic thread variable processing class and general custom annotations; The database core component is used to process general database configuration processing, including: mybatis plug-in base class, mybatis tenant plug-in, mybatis sorting plug-in, mybatis paging plug-in, mybatis scan path configuration, database basic field base class, tenant field base class; The basic web-side core components are used to build the configuration required for the web project, including: URL request XSS filter, header information processing filter, secondary authentication filter, FegIn interface header processing filter, MVC configuration, and Swagger document configuration.

4. The component architecture design scheme compatible with microservices and monoliths according to claim 2 is characterized by: The tool components provide independent tool capabilities for project use, including: regional code component, cache component, distributed transaction component, circuit breaker and current limiting component, link tracking component, system configuration component, database localization component, multiple data source component, mailbox component, file component, code generation component, log component, dynamic form component, message component, office file processing component, pinyin conversion component, security component, SMS component, socket component, scheduled task component, and parameter verification component.

5. The component architecture design scheme compatible with microservices and monoliths according to claim 2 is characterized by: The business logic components provide basic business capabilities, including: basic business components, basic configuration components, message components, log components, workflow components, and low-code components.

6. The component architecture design scheme compatible with microservices and monoliths according to claim 5 is characterized by: The basic business components provide the basic business capabilities of the management platform project, including: login, authentication, users, tenants, applications, administrator management, management roles, menu resources, button resources, interface resources, resource authorization business logic and database storage persistence capabilities; The basic configuration component provides the configuration capabilities used by the management platform project, including: regional code configuration management, system configuration management, dictionary configuration management, platform theme configuration management, and custom workbench configuration management; The message component provides basic message configuration and sending capabilities, including: message channel configuration management, message category configuration management, message template configuration management, message logging, message sending by template, and message sending by channel; The log component provides message recording and message query capabilities, including: recording login logs, recording operation logs, and the recording operation log recording methods support: interface method logging and annotation method logging; The workflow component provides workflow configuration management capabilities for configuring the approval process, approval content, and approval node transfer functions; The low-code component provides a drag-and-drop method for building low-code applications and low-code forms, supports dynamic creation of database forms and persistence in the database, and can be combined with the workflow component to build an approval process for dynamic forms.

7. The component architecture design scheme compatible with microservices and monoliths according to claim 1 is characterized by: The microservice basic project uses business logic components to build basic microservice projects, including: microservice gateway project, microservice basic business project, microservice basic configuration project, microservice log center project, microservice message center project, microservice workflow project, and microservice low-code project.

8. The component architecture design scheme compatible with microservices and monoliths according to claim 7 is characterized by: The microservice gateway project builds the spring cloud gateway gateway used by the microservice, which is used for traffic distribution control of interface requests; The microservice basic business project uses the basic business components to build a microservice basic business project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface; The microservice basic configuration project uses the basic configuration component to build a microservice basic configuration project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface; The microservice log center project uses the log component to build a microservice log center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface; The microservice message center project uses the message component to build a microservice message center project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface; The microservice workflow project uses the workflow component to build a microservice workflow project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface; The microservice low-code project uses the low-code component to build a microservice low-code project in a microservice manner, and provides a feign interface for the business logic project to call related business logic through the interface.

9. The component architecture design scheme compatible with microservices and monoliths according to claim 1, characterized in that: The business logic-related projects use the fegin interface provided by the microservice gateway project, microservice basic business project, microservice basic configuration project, microservice log center project, microservice message center project, microservice workflow project, and microservice low-code project to write the business logic required for the business and complete the business logic functions.

10. The component architecture design scheme compatible with microservices and monoliths according to claim 1, characterized in that: The single project uses the service methods provided by the basic core components, tool components, and business logic components to write the business logic required by the business and complete the business logic functions.