Service design methods, systems, media, and equipment that support monolithic architecture and microservice architecture
By modularizing and componentizing the OA system, building a module support layer, and using virtual routers and interceptors to achieve compatibility between monolithic architecture and microservice architecture, the problem of enterprise development costs and insufficient resources during business expansion is solved. , improving the scalability and stability of the system.
Patent Information
- Application Number
- CN202311540149.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-20
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-11-20
AI Technical Summary
In the existing technology, monolithic architecture and microservice architecture are difficult to be compatible, causing enterprises to need to redevelop business functions when expanding their business, increasing implementation costs, and it is difficult to implement microservice architecture when resources are insufficient.
By modularizing and componentizing the target business system, we build a module support layer between the component layer and the system layer, and deploy the system as a single architecture or microservice architecture through preset site deployment rules, using virtual routing and interception. The server implements the transfer and registration of business components to form a compatible microservice architecture system.
It achieves the seamless connection between monolithic architecture and microservice architecture, reduces development costs, improves the scalability and stability of the system, and meets the information system architecture needs of enterprises at different stages.
Smart Images

Figure CN117270819B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software application architecture, and in particular to a service design method, system, medium and device that supports monolithic architecture compatible with microservice architecture. Background Art
[0002] OA usually refers to "Office Automation", which is an office automation system used to coordinate and manage the daily work processes of an office. The architecture of an office automation system mainly includes two types: a monolithic architecture and a microservice architecture. The choice of an enterprise information system architecture needs to consider multiple factors. Although the monolithic architecture system is simple in design, easy to maintain, and has high stability and low failure rate, its scalability is poor. Once a failure occurs, the entire system may collapse. In contrast, the microservice architecture has good scalability and can dynamically add or delete services to reduce the coupling degree of the system. However, the operation and maintenance cost of the microservice architecture is high, and it needs to manage multiple independent services, and the requirements for administrators are also high. When implementing a domestic OA system, there are two situations: one is that the enterprise begins to choose a monolithic OA system for implementation, but as the business expansion becomes more complicated, it turns to implement an OA system with a microservice architecture. However, due to the inconsistency of the two architectures, the enterprise needs to redevelop the same business functions, which increases the implementation cost; the second is that in order to have good scalability, the enterprise chooses to implement a microservice OA system from the beginning, but when implementing a microservice OA system in the secondary unit of the enterprise, due to insufficient resources, the implementation becomes very difficult. Summary of the invention
[0003] To this end, the present invention provides a service design method and system, medium, and device that support monolithic architecture compatibility with microservice architecture, aiming to solve the technical problem in the prior art that microservice architecture and monolithic architecture are difficult to coexist and be compatible.
[0004] To achieve the above objectives, the present invention adopts the following technical solutions:
[0005] According to a first aspect of the present invention, the present invention provides a service design method that supports a monolithic architecture compatible with a microservice architecture, characterized in that the method is applied to a target business system to be constructed, and comprises:
[0006] Modularize and componentize the target business system to obtain business components corresponding to multiple business modules included in the target business system;
[0007] Build the module support layer between the component layer and the system layer;
[0008] Deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or deploy the target business system as a microservice architecture business system through a second preset site deployment rule;
[0009] When the target business system is a monolithic architecture business system, in response to a microservice architecture deployment request, a corresponding business site is registered for each business module, and the business components contained in the business module are transferred to the corresponding business site to form a microservice architecture business system including multiple business sites.
[0010] Furthermore, modularizing and componentizing the target business site includes:
[0011] Dividing the target business site into a plurality of business modules according to a first preset division rule;
[0012] Dividing each of the business modules into a plurality of business components according to a second preset division rule;
[0013] Wherein, the first preset division rule is to divide the corresponding business modules according to the different business functions included in the target business site; the business modules include at least one of an authentication module, an organization module, a document sending module, a document receiving module, a report module, a conference module, an organization module and a role module;
[0014] The second preset division rule is to encapsulate the different business resources contained in each business module into corresponding business components; the business components include front-end components, back-end components, form components, view components, page components, process components, background service components, data source components, scheduled task components and at least one of front-end static resource components.
[0015] Furthermore, the module support layer between the building component layer and the system layer includes:
[0016] Sending encapsulation requests to each of the business components through a virtual router, and using an interceptor to intercept and encapsulate multiple business components corresponding to the business module to form a module support layer;
[0017] Among them, the module support layer includes at least one of the front-end engine, back-end engine, routing engine, form engine, view engine, process engine, page engine, background service engine, data source engine, scheduled task engine and front-end static resource engine.
[0018] Furthermore, the step of deploying the target business system as a monolithic business system by using a first preset site deployment rule includes:
[0019] The multiple business modules included in the target business system, the business components corresponding to each of the business modules, and the module support layer are deployed at the same site to obtain a monolithic architecture business system that can switch to a microservice architecture system.
[0020] Further, the target business system is deployed as a microservice architecture business system by using a second preset site deployment rule, including:
[0021] A corresponding business site is registered for each of the business modules, and the business components corresponding to each of the business modules and the module support layer are deployed at different sites according to different business modules to obtain a microservice architecture business system.
[0022] Furthermore, transferring the business components included in the business module into the corresponding business site includes:
[0023] Utilizing the module support layer to parse component routing information corresponding to each of the service sites;
[0024] By virtual routing, based on the component routing information, the business component is transferred to a corresponding business site;
[0025] The component routing information is used to determine multiple service components corresponding to each service site.
[0026] Further, the transferring of the business component to a corresponding business site based on the component routing information through virtual routing includes:
[0027] forwarding the designated site transfer instruction to the plurality of the service components according to the component routing information by using virtual routing;
[0028] Each of the business components is exported from the monolithic architecture in the form of a package and is respectively imported into the business site corresponding to the business module.
[0029] According to a second aspect of the present invention, the present invention provides a service design system that supports a monolithic architecture compatible with a microservice architecture, the system comprising:
[0030] A system modularization unit, used to modularize and componentize the target business system to obtain business components corresponding to multiple business modules included in the target business system;
[0031] A support layer construction unit, used to construct a module support layer between the component layer and the system layer;
[0032] A system deployment unit, configured to deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or to deploy the target business system as a microservice architecture business system through a second preset site deployment rule;
[0033] The architecture switching unit is used to respond to the microservice architecture deployment request when the target business system is a monolithic architecture business system, register a corresponding business site for each business module, transfer the business components contained in the business module into the corresponding business site, and form a microservice architecture business system including multiple business sites.
[0034] According to the third aspect of the present invention, the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the service design method supporting a monolithic architecture compatible with a microservice architecture as described in any one of the first aspect of the present invention.
[0035] According to a fourth aspect of the present invention, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the service design method supporting a monolithic architecture compatible with a microservice architecture as described in any one of the first aspect of the present invention is implemented.
[0036] The present invention adopts the above technical solution and has at least the following beneficial effects:
[0037] Through the scheme of the present invention, the target business system is modularized and componentized to obtain business components corresponding to multiple business modules contained in the target business system; a module support layer is constructed between the component layer and the system layer; the target business system is deployed as a monolithic architecture business system through a first preset site deployment rule; or, the target business system is deployed as a microservice architecture business system through a second preset site deployment rule; when the target business system is a monolithic architecture business system, in response to a microservice architecture deployment request, a corresponding business site is registered for each of the business modules, and the business components contained in the business module are transferred to the corresponding business site, forming a microservice architecture business system containing multiple business sites. Thus, a microservice framework is added to the monolithic architecture system, and the system is split into functional modules under multiple microservice structures, thereby realizing seamless connection between the monolithic architecture system and the microservice architecture system.
[0038] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 A schematic diagram of a process flow of a service design method supporting a monolithic architecture compatible with a microservice architecture provided by an embodiment of the present invention is shown;
[0041] Figure 2 A schematic diagram showing the results of system modularization provided by an embodiment of the present invention is shown;
[0042] Figure 3 A schematic diagram showing the construction of a single-frame business system provided by an embodiment of the present invention is shown;
[0043] Figure 4 A schematic diagram showing the construction of a microservice architecture business system provided by an embodiment of the present invention is shown;
[0044] Figure 5 A schematic diagram showing a target business deployment method supporting a monolithic architecture compatible with a microservice architecture provided by an embodiment of the present invention;
[0045] Figure 6 A schematic diagram of the structure of a service design system supporting a monolithic architecture compatible with a microservice architecture provided by an embodiment of the present invention is shown;
[0046] Figure 7 A schematic diagram of the physical structure of a computer device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0047] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0048] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0049] First, the terms appearing in the embodiments of the present invention are explained:
[0050] Monolithic architecture: A software architecture that builds the entire application as a single executable program or code base. In a monolithic architecture, all functions and components are packaged into a single unit and interact and communicate through internal functions and methods. A monolithic OA system refers to an office automation system with only one instance in an organization or enterprise, which is used to manage the workflow and information management of the entire organization. The advantages of a monolithic OA system are simple design, easy implementation and maintenance; small resource usage and fast operation speed; high stability and low failure rate. However, it also has some disadvantages, including poor scalability. Once a failure occurs, the entire system may crash; the functions are relatively single and cannot meet the needs of complex applications; reliability and security require a high degree of assurance, and once a problem occurs, the consequences may be very serious.
[0051] Microservice architecture: A software architecture that splits an application into a set of smaller, independent services. Each service runs in its own process and interacts with other services using lightweight communication mechanisms. A microservice architecture OA system is an office automation system that uses a microservice architecture, splitting the different functions of the office automation system into multiple independent services, each of which can be independently developed, tested, deployed, and expanded. The advantages of a microservice architecture OA system are that each service focuses on a single business function or field and can use different programming languages, databases, and technology stacks; each service can be independently developed, tested, deployed, and expanded, making the system more flexible and reliable; each service can be expanded as needed without having to expand the entire application, thereby achieving better scalability. However, it also has some disadvantages, including the need for good system design and planning to ensure coordination and communication between services; the need for effective version control and service governance to ensure the stability and reliability of the system; and the need to invest more time and effort in development and maintenance.
[0052] Site: A website is a complete website system, including the website's domain name, server, application, and related database and file system. Site is a relatively high-level concept in Web development, used to organize and manage Web applications. A site usually consists of multiple Web pages, script files, CSS files, pictures, multimedia files, etc., and can be accessed through a Web browser.
[0053] Module: It is composed of a group of related components that together realize a certain function or business process. Module is a high-level concept, which can be composed of multiple low-level components. For example, in an OA system, a "document management" module can include multiple components such as "document filling", "document approval", and "document printing".
[0054] Group (component): a unit of code that is independent, reusable, combinable, and testable. It can be deployed and used independently, and can be combined with other components to form more complex modules. In the OA system, different functional components can be split into different components, such as form components, view components, process components, background service components, scheduled task components, etc. A "document issuance form" component can be used in multiple modules, such as "document issuance application process", "document issuance record management", etc.
[0055] The embodiment of the present invention provides a service design method that supports monolithic architecture compatible with microservice architecture. Figure 1 As shown, at least the following steps S101 to S104 may be included:
[0056] Step S101 : modularize and componentize the target business system to obtain business components corresponding to a plurality of business modules included in the target business system.
[0057] The target business system in the embodiment of the present invention can be a business system to be constructed based on the J2EE architecture. First, the business profile information of the target business system can be obtained, and the business profile information can be the business functions that the target business system to be constructed can perform and the business resources required to support these business functions. Based on the business functions and business resources of the target business system, the target business system can be modularized and componentized, that is, modularized. Modularization in the embodiment of the present invention refers to decomposing the target business system into multiple independent modules and components to achieve independent development, testing, deployment and maintenance of these modules and components. At the same time, by combining different modules and components, new functions and business processes can also be quickly constructed, thereby improving the scalability and reusability of the system and providing users with a better experience.
[0058] Specifically, the target business site is modularized and componentized, and the target business site can be divided into multiple business modules according to a first preset division rule; and each business module can be divided into multiple business components according to a second preset division rule.
[0059] In an embodiment of the present invention, the first preset division rule is to divide the corresponding business modules according to the different business functions contained in the target business site; the business modules include authentication module, organization module, document sending module, document receiving module, report module, meeting module, organization module and role module, etc.; the second preset division rule is to encapsulate the different business resources contained in each business module into corresponding business components; the business components include front-end components, back-end components, form components, view components, page components, process components, background service components, data source components, scheduled task components and front-end static resource components, etc. Figure 2 The result diagram of modularization for an OA site. The OA site can execute multiple business functions, and each business function corresponds to a corresponding business module. For each business module, multiple business resources are required to support the realization of the corresponding business function, that is, each business module contains multiple business components, and the business components contained in each business module may be repeated. Multiple business components are combined to form a business module with business functions. It can be understood that in order to realize the front-end execution and back-end execution of business functions, it is necessary to distinguish the components deployed at the front end and back end of each business module, which are respectively front-end components and back-end components. The front-end component can be a combination of menu components, form components, view components, front-end process components, front-end resource components, etc.; the back-end component can be a combination of back-end service components, data source components, timer task components, data query components, back-end process components, etc. When the embodiment of the present invention performs componentization for business resources, it is also necessary to identify the business components for distinction. Specifically, the menu resources in the business components can be abstracted into menu components, the view resources can be abstracted into view components, the form resources can be abstracted into form components, the process resources can be abstracted into process components, the interface services can be abstracted into back-end service components, and the timers can be abstracted into timer task components.
[0060] Step S102, constructing a module support layer between the component layer and the system layer.
[0061] Specifically, a packaging request can be sent to each business component through a virtual router, and an interceptor can be used to intercept and package multiple business components corresponding to the business module to form a module support layer.
[0062] That is to say, in order to support the component support of monolithic deployment or microservice deployment, the embodiment of the present invention adds a layer of component encapsulation between the system layer and the component layer, so that the upper component resources are independent of the lower system layer interface, so that the corresponding business resources are independent business components. The module support layer may include a front-end engine, a back-end engine, a routing engine, a form engine, a view engine, a process engine, a page engine, a background service engine, a data source engine, a timed task engine, and a front-end static resource engine, etc. It should be noted that, in building the target business system, the system architecture includes a development framework and a system layer based on Java applications, a Web application container, and a platform container in addition to the above-mentioned business modules, business components, and module support layers. Among them, the development framework technology can apply Spring Boot, SpringCloud, SpringMVC, distributed cache, JWS, etc.; the Web application container library applies Tomcat, Jboss, etc.; the platform container is a portable container that allows developers to store applications and their dependencies, so as to easily deploy and run business systems, and the platform container can apply Docker, etc.
[0063] Step S103: deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or, deploy the target business system as a microservice architecture business system through a second preset site deployment rule.
[0064] According to the actual needs of the enterprise, the target business system of monolithic architecture or microservice architecture can be built based on the unique differences between monolithic architecture and microservice architecture.
[0065] like Figure 3 As shown, it is a schematic diagram of the construction of a monolithic architecture business system taking the OA system as an example. For the target business system of the monolithic architecture, the embodiment of the present invention can deploy multiple business modules contained in the target business system, the business components corresponding to each business module, and the module support layer at the same site, and obtain a monolithic architecture business system of a switchable microservice architecture system, that is, based on virtual routing, all business modules and the business components corresponding to each business module are deployed in the same web site for operation. Since these business modules are stored in the same system, there is no need to consider cross-process and cross-server issues when calling each other.
[0066] like Figure 4As shown, it is a schematic diagram of the construction of a microservice architecture business system taking the OA system as an example. For the target business system of the microservice architecture, the embodiment of the present invention can register a corresponding business site for each business module, and deploy the business components and module support layers corresponding to each business module at different sites according to different business modules to obtain a microservice architecture business system. In other words, the microservice architecture contains multiple business sites. For each business module, a separate web site needs to be registered, and then all business components contained in each business module are deployed in a web site. Thus, a microservice architecture business system containing multiple business sites is obtained.
[0067] Step S104, when the target business system is a monolithic architecture business system, in response to the microservice architecture deployment request, a corresponding business site is registered for each business module, and the business components contained in the business module are transferred to the corresponding business site to form a microservice architecture business system including multiple business sites.
[0068] When the target business system initially deployed by the enterprise is a monolithic business system, in some practical application scenarios, it is necessary to convert the monolithic architecture into a microservice business system. Specifically, to switch the monolithic business system to a microservice business system, the module support layer can be used to parse the component routing information corresponding to each business site; through virtual routing, based on the component routing information, the business components can be transferred to the corresponding business site. Figure 5As shown, it is a schematic diagram of the target business deployment method supporting the monolithic architecture compatible with the microservice architecture. In the original monolithic architecture business system, all business modules are deployed on the same business site. When the user sends a request to switch the microservice architecture to the monolithic architecture business system, the component routing information corresponding to the business site is parsed by the module support layer, and the component routing information is used to determine the multiple business components corresponding to each business site. Then, the virtual routing is used to forward the designated site transfer instruction to the specific business component node on the monolithic architecture business system based on the component routing information to perform the site transfer operation. That is to say, when the business component in the embodiment of the present invention is transferred to the site, the virtual routing can be used to forward the designated site transfer instruction to multiple business components according to the component routing information; each business component is exported from the monolithic architecture in the form of a package and imported into the business site corresponding to the business module. For example, the receiving module in the monolithic architecture business system includes business components such as form components, view components, page components, process components, background service components, data source components, timed task components, and front-end static resource components. The component routing information parsed by the module support layer includes the component information contained in the receiving module. The virtual routing forwards the registered transfer instructions for the receiving site to these business components. These business components are exported from the monolithic environment in the form of packages, and then the exported packages are imported into the corresponding receiving sites in the microservice environment. As a result, the target business system is switched to a microservice architecture business system. It should be noted that when the target business system is switched to a microservice architecture business system, the internal structure and situation of each business component do not change. What changes are the modes of the module support layer and virtual routing.
[0069] The embodiment of the present invention provides a service design method that supports monolithic architecture compatible with microservice architecture, modularizes and components the target business system, obtains business components corresponding to multiple business modules contained in the target business system; constructs a module support layer between the component layer and the system layer; deploys the target business system as a monolithic architecture business system through a first preset site deployment rule; or, deploys the target business system as a microservice architecture business system through a second preset site deployment rule; when the target business system is a monolithic architecture business system, in response to a microservice architecture deployment request, registers a corresponding business site for each business module, transfers the business components contained in the business module into the corresponding business site, and forms a microservice architecture business system containing multiple business sites. Through the present invention, enterprises can implement monolithic architecture without changing business modules, and can also implement business systems with microservice architecture, which meets the needs of enterprises for information system architecture at different stages, saves development costs, and improves the scalability and stability of the system.
[0070] Further, as Figure 1The specific implementation of the present invention provides a service design system that supports a monolithic architecture compatible with a microservice architecture, such as Figure 6 As shown, the system may include: a system modularization unit 610 , a support layer construction unit 620 , a system deployment unit 630 and an architecture switching unit 640 .
[0071] The system modularization unit 610 can be used to modularize and componentize the target business system to obtain business components corresponding to multiple business modules included in the target business system;
[0072] A support layer construction unit 620 may be used to construct a module support layer between the component layer and the system layer;
[0073] The system deployment unit 630 may be used to deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or to deploy the target business system as a microservice architecture business system through a second preset site deployment rule;
[0074] The architecture switching unit 640 can be used to respond to a microservice architecture deployment request when the target business system is a monolithic architecture business system, register a corresponding business site for each business module, and transfer the business components contained in the business module to the corresponding business site to form a microservice architecture business system including multiple business sites.
[0075] Optionally, the system modularization unit 610 may also be used to divide the target business site into a plurality of business modules according to a first preset division rule;
[0076] Dividing each business module into multiple business components according to a second preset division rule;
[0077] The first preset division rule is to divide the corresponding business modules according to the different business functions included in the target business site; the business modules include at least one of the authentication module, organization module, document sending module, document receiving module, report module, meeting module, organization module and role module;
[0078] The second preset division rule is to encapsulate the different business resources contained in each business module into corresponding business components; the business components include front-end components, back-end components, form components, view components, page components, process components, background service components, data source components, scheduled task components and at least one of the front-end static resource components.
[0079] Optionally, the support layer construction unit 620 may also be used to send an encapsulation request to each business component through a virtual router, and use an interceptor to intercept and encapsulate multiple business components corresponding to the business module to form a module support layer;
[0080] Among them, the module support layer includes at least one of the front-end engine, back-end engine, routing engine, form engine, view engine, process engine, page engine, background service engine, data source engine, scheduled task engine and front-end static resource engine.
[0081] Optionally, the system deployment unit 630 can also be used to deploy multiple business modules included in the target business system, business components corresponding to each business module, and a module support layer at the same site to obtain a monolithic architecture business system that can switch between microservice architecture systems.
[0082] Optionally, the system deployment unit 630 can also be used to register a corresponding business site for each business module, and deploy the business components and module support layers corresponding to each business module at different sites according to different business modules to obtain a microservice architecture business system.
[0083] Optionally, the architecture switching unit 640 may also be used to parse component routing information corresponding to each business site using the module support layer;
[0084] Through virtual routing, business components are transferred to corresponding business sites based on component routing information;
[0085] The component routing information is used to determine multiple business components corresponding to each business site.
[0086] Optionally, the architecture switching unit 640 may also be used to forward the designated site transfer instruction to multiple business components according to the component routing information using virtual routing;
[0087] Each business component is exported from the monolithic architecture in the form of a package and imported into the business site corresponding to the business module.
[0088] It should be noted that for other corresponding descriptions of the functional modules involved in the service design system supporting a monolithic architecture compatible with a microservice architecture provided by an embodiment of the present invention, reference can be made to Figure 1 The corresponding description of the method shown will not be repeated here.
[0089] Based on the above Figure 1 The method shown, accordingly, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the service design method supporting a monolithic architecture compatible with a microservice architecture as described in any of the above embodiments are implemented.
[0090] Based on the above Figure 1 The method shown and Figure 6 The embodiment of the system shown in the figure, the embodiment of the present invention also provides a physical structure diagram of a computer device, such as Figure 7As shown, the computer device may include a communication bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit may communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the steps of the service design method supporting a monolithic architecture compatible with a microservice architecture as described in the above embodiment.
[0091] Those skilled in the art can clearly understand that the specific working processes of the systems, devices, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and for the sake of brevity, they are not further described here.
[0092] In addition, the functional units in various embodiments of the present invention may be physically independent of each other, or two or more functional units may be integrated together, or all functional units may be integrated into one processing unit. The above integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
[0093] A person skilled in the art can understand that if the integrated functional unit is implemented in the form of software and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, which includes several instructions to enable a computing device (such as a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention when running the instructions. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0094] Alternatively, all or part of the steps of implementing the aforementioned method embodiments may be accomplished by hardware associated with program instructions (such as a computing device such as a personal computer, a server, or a network device), and the program instructions may be stored in a computer-readable storage medium. When the program instructions are executed by a processor of the computing device, the computing device executes all or part of the steps of the method described in the various embodiments of the present invention.
[0095] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that within the spirit and principles of the present invention, the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate from the protection scope of the present invention.
Claims
1. A service design method that supports monolithic architecture and microservice architecture, characterized in that: Applied to a target business system to be constructed, the method comprises: Modularize and componentize the target business system to obtain business components corresponding to multiple business modules included in the target business system; Build the module support layer between the component layer and the system layer; Deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or deploy the target business system as a microservice architecture business system through a second preset site deployment rule; When the target business system is a monolithic business system, in response to a microservice architecture deployment request, a corresponding business site is registered for each business module, and the business components included in the business module are transferred to the corresponding business site to form a microservice architecture business system including multiple business sites; The module support layer between the building component layer and the system layer includes: Sending encapsulation requests to each of the business components through a virtual router, and using an interceptor to intercept and encapsulate multiple business components corresponding to the business module to form a module support layer; The transferring the business components included in the business module into the corresponding business site includes: Utilizing the module support layer to parse component routing information corresponding to each of the service sites; By virtual routing, based on the component routing information, the business component is transferred to a corresponding business site; The component routing information is used to determine a plurality of business components corresponding to each business site; and the modularization and componentization of the target business system includes: Dividing the target business system into a plurality of business modules according to a first preset division rule; Dividing each of the business modules into a plurality of business components according to a second preset division rule; Wherein, the first preset division rule is to divide the corresponding business modules according to the different business functions included in the target business system; the business modules include at least one of an authentication module, an organization module, a document sending module, a document receiving module, a report module, a conference module, an organization module and a role module; The second preset division rule is to encapsulate the different business resources contained in each of the business modules into corresponding business components; the business components include at least one of the front-end components, back-end components, form components, view components, page components, process components, background service components, data source components, scheduled task components and front-end static resource components; The transferring the service component to the corresponding service site based on the component routing information through virtual routing includes: Each of the business components is exported from the monolithic architecture in the form of a package and is respectively imported into the business site corresponding to the business module.
2. The method according to claim 1, characterized in that The module support layer includes at least one of a front-end engine, a back-end engine, a routing engine, a form engine, a view engine, a process engine, a page engine, a background service engine, a data source engine, a scheduled task engine, and a front-end static resource engine.
3. The method according to claim 1, characterized in that The step of deploying the target business system as a monolithic business system by using a first preset site deployment rule includes: The multiple business modules included in the target business system, the business components corresponding to each of the business modules, and the module support layer are deployed at the same site to obtain a monolithic architecture business system that can switch to a microservice architecture system.
4. The method according to claim 1, characterized in that: The step of deploying the target business system as a microservice architecture business system by using a second preset site deployment rule includes: A corresponding business site is registered for each of the business modules, and the business components corresponding to each of the business modules and the module support layer are deployed at different sites according to different business modules to obtain a microservice architecture business system.
5. The method according to claim 1, characterized in that Before each of the business components is exported from the monolithic architecture in the form of a package and respectively imported into the business site corresponding to the business module, it includes: The designated site transfer instruction is forwarded to the plurality of service components according to the component routing information by using virtual routing.
6. A service design system that supports monolithic architecture and microservice architecture, characterized in that: The system comprises: A system modularization unit, used to modularize and componentize the target business system to obtain business components corresponding to multiple business modules included in the target business system; A support layer construction unit, used to construct a module support layer between the component layer and the system layer; A system deployment unit, configured to deploy the target business system as a monolithic architecture business system through a first preset site deployment rule; or to deploy the target business system as a microservice architecture business system through a second preset site deployment rule; An architecture switching unit, for registering a corresponding business site for each of the business modules in response to a microservice architecture deployment request when the target business system is a monolithic architecture business system, and transferring the business components included in the business module into the corresponding business site to form a microservice architecture business system including multiple business sites; The support layer construction unit is further used to send an encapsulation request to each of the business components through a virtual router, and use an interceptor to intercept and encapsulate multiple business components corresponding to the business module to form a module support layer; The architecture switching unit is further used to parse the component routing information corresponding to each business site using the module support layer; Through virtual routing, business components are transferred to corresponding business sites based on component routing information; The component routing information is used to determine multiple business components corresponding to each business site; The system modularization unit is further used to divide the target business system into a plurality of business modules according to a first preset division rule; Dividing each of the business modules into a plurality of business components according to a second preset division rule; Wherein, the first preset division rule is to divide the corresponding business modules according to the different business functions included in the target business system; the business modules include at least one of an authentication module, an organization module, a document sending module, a document receiving module, a report module, a conference module, an organization module and a role module; The second preset division rule is to encapsulate the different business resources contained in each of the business modules into corresponding business components; the business components include at least one of the front-end components, back-end components, form components, view components, page components, process components, background service components, data source components, scheduled task components and front-end static resource components; The architecture switching unit is also used to export each of the business components from the monolithic architecture in the form of a package, and import them into the business sites corresponding to the business modules respectively.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, enables the processor to execute the service design method supporting a monolithic architecture compatible with a microservice architecture as described in any one of claims 1 to 5.
8. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the service design method supporting a monolithic architecture compatible with a microservice architecture according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method for micro service of monolithic application
CN108279926A
Service design method and system simultaneously supporting monomer architecture and micro-service architecture
CN113835842A
URL forwarding method, apparatus and device, and computer storage medium
CN114244654A
