Service design method and system that supports both monolithic architecture and microservice architecture
Through a service design method, obtain business configuration files, identify business modules and service interfaces, define service release protocols, solve the problem of difficulty supporting single architecture and microservices architecture at the same time, and realize the flexible deployment and stability of the system run.
Patent Information
- Application Number
- CN202111147062.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2041-09-28
AI Technical Summary
The existing technology is difficult to support single-unit architecture and microservice architecture at the same time, resulting in maintaining two systems with the same core business but different technical implementation methods, increasing the difficulty of development, testing, operation and maintenance, and it is difficult to ensure the stability of core business. .
Provide a service design method to determine business modules, identify atomic services and composite services by obtaining business configuration files, define the service interface of service release, determine the client call interface and calling method, and respond to user deployment instructions, realize single applications or be single applications or to realize it Deployment of microservices.
It realizes the support of the single structure and microservice architecture at the same time, simplifies system maintenance, reduces the difficulty of development and operation and maintenance, and improves the stability and reuse of the core business.
Smart Images

Figure CN113835842B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of software deployment and architecture, and more specifically to a service design method, system, device, medium, and program product that support both a monolithic architecture and a microservice architecture. Background Art
[0002] With the development of Internet technology, new requirements are put forward for the design of business systems. Not only must they be able to make flexible and rapid adjustments according to market changes, but they must also support high-concurrency access requirements in the Internet environment.
[0003] When a business system needs to support both monolithic applications and microservice applications to meet different customer needs, the basic solution is to maintain two independent application systems, one using a monolithic architecture style to meet the needs of customers who need monolithic application cluster deployment; the other using a microservice architecture style to meet the needs of customers who need microservice applications.
[0004] However, the two systems are consistent in implementing core business, but the technical solutions are different. Maintaining two systems with the same core business but different technical implementation methods not only increases the difficulty of development, testing, operation, and maintenance, but also makes it difficult to ensure the stability of core business. Summary of the invention
[0005] In view of the above problems, the present disclosure provides a service design method, system, device, medium and program product that support both monolithic architecture and microservice architecture.
[0006] According to a first aspect of the present disclosure, there is provided a service design method that supports both a monolithic architecture and a microservice architecture, comprising: obtaining a service profile of a target service;
[0007] Determining a service module of the target service according to the service configuration file;
[0008] Determine, according to the business module, an atomic service and a composite service corresponding to the business module, wherein the atomic service is an underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements;
[0009] Defining the service publishing protocol interface of the atomic service and the composite service;
[0010] Determine the service client calling interface and calling method according to the service publishing protocol interface; and
[0011] In response to the user's deployment instruction, the target business is deployed as a single application or a microservice application.
[0012] According to an embodiment of the present disclosure, in response to a deployment instruction from a user, deploying a single application or a microservice application for the target business includes:
[0013] Determine the system architecture of the target business based on the user's deployment instructions;
[0014] The target service is deployed according to the system architecture.
[0015] According to an embodiment of the present disclosure, deploying the target service according to the system architecture includes:
[0016] If it is determined that the system architecture is a monolithic architecture, the modules required for the monolithic application are configured through the configuration file, and a project component package is generated through Maven construction;
[0017] The project component package is directly deployed on a Java virtual machine.
[0018] According to an embodiment of the present disclosure, deploying the target service according to the system architecture further includes:
[0019] If it is determined that the system architecture is a microservice architecture, the modules required for the microservice application are configured through the configuration file, and multiple project component packages are generated through Maven construction;
[0020] Deploy each project component package separately on the JAVA virtual machine in the mode of a single application.
[0021] According to an embodiment of the present disclosure, determining the service client calling interface and calling method according to the service publishing protocol interface includes:
[0022] Determine the service publishing protocol according to the service publishing protocol interface;
[0023] The service client calling method is determined according to the service publishing protocol.
[0024] According to an embodiment of the present disclosure, the service publishing protocol includes local service, Restful style service, DubboRPC and SOFA RPC.
[0025] According to an embodiment of the present disclosure, the calling methods include local calling, OpenFeign, Dubbo RPC client and SOFA RPC client.
[0026] A second aspect of the present disclosure provides a service design system that supports both a monolithic architecture and a microservice architecture, including: an acquisition module, configured to acquire a service profile of a target service;
[0027] A first determining module, configured to determine a service module of the target service according to the service configuration file;
[0028] A second determination module is used to determine the atomic service and composite service corresponding to the business module according to the business module, wherein the atomic service is the underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements;
[0029] An interface module, used to define the service publishing protocol interface of the atomic service and the composite service;
[0030] A third determination module is used to determine the service client calling interface and calling method according to the service publishing protocol interface; and
[0031] The deployment module is used to deploy a single application or a microservice application for the target business in response to a deployment instruction from a user.
[0032] A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; and a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned service design method that supports both a monolithic architecture and a microservice architecture.
[0033] The fourth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned service design method that supports both a monolithic architecture and a microservice architecture.
[0034] The fifth aspect of the present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned service design method that supports both a monolithic architecture and a microservice architecture. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] The above contents and other purposes, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0036] Figure 1 An application scenario diagram schematically illustrates a service design method that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure;
[0037] Figure 2 A flowchart of a service design method that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown;
[0038] Figure 3 A schematic diagram schematically shows a target service deployment method according to an embodiment of the present disclosure; and
[0039] Figure 4A structural block diagram of a service design system that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown; and
[0040] Figure 5 A block diagram of an electronic device suitable for implementing a service design method that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0041] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.
[0042] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.
[0043] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification, and should not be interpreted in an idealized or overly rigid manner.
[0044] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).
[0045] First, the terms appearing in this embodiment are explained:
[0046] Monolithic architecture: An application deploys all functions together, that is, the presentation layer, business layer, and data access layer of all business scenarios are placed in one project, and finally compiled, packaged, and deployed on a server to reduce deployment nodes and costs.
[0047] Microservice: An independent, deployable service that focuses on doing one thing and doing it well, which can usually be a business capability or the smallest unit service that provides business value.
[0048] Microservice architecture: Divide a complex system into dozens or even hundreds of small services, each of which is responsible for implementing an independent business logic. Each service in the system is usually deployed independently and is loosely coupled to each other.
[0049] With the rapid development of Internet technology, businesses must not only be able to adjust flexibly and quickly according to market changes, but also have the ability to innovate quickly. At the same time, they must also support high-concurrency access requirements in the Internet environment. At this time, the microservice architecture came into being and provided a solution to these problems. The emergence of the microservice architecture, while solving the above problems, also introduced technical complexity, including development, testing, operation, and operation and maintenance stages. As a result, some companies dare not introduce the microservice architecture, but choose a relatively simple monolithic architecture and perform cluster deployment to provide high availability of the system and deal with high concurrency issues.
[0050] At this stage, for a project, it is basically in the project feasibility analysis stage, according to specific business needs, combined with the technical level of the project team, the company's technical accumulation and other factors, to choose between monolithic applications and microservice applications.
[0051] When a business system needs to support both monolithic applications and microservice applications to meet different customer needs, the basic solution is to maintain two independent application systems, one using a monolithic architecture style to meet the needs of customers who need monolithic application cluster deployment; the other using a microservice architecture style to meet the needs of customers who need microservice applications. However, these two systems are consistent in the implementation of core business, but the technical solutions are different. Maintaining two systems with the same core business but different technical implementation methods not only increases the difficulty of development, testing, operation, and maintenance, but also makes it difficult to ensure the stability of the core business.
[0052] Based on the above technical problems, an embodiment of the present disclosure provides a service design method that supports both a monolithic architecture and a microservice architecture, the method comprising: obtaining a business configuration file of a target business; determining a business module of the target business based on the business configuration file; determining an atomic service and a composite service corresponding to the business module based on the business module, wherein the atomic service is an underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements; defining a service publishing protocol interface for the atomic service and the composite service; determining a service client calling interface and a calling method based on the service publishing protocol interface; and deploying a monolithic application or a microservice application for the target business in response to a user's deployment instruction.
[0053] Figure 1An application scenario diagram of a service design method that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown.
[0054] like Figure 1 As shown, the network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0055] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptops, desktop computers, etc.
[0056] The server 105 may be a server that provides various services, such as a background management server (only an example) that supports websites browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results to the terminal device (for example, packaging the business module and deploying it to generate an application according to the user deployment instruction, etc.).
[0057] It should be noted that the service design method for supporting both the monolithic architecture and the microservice architecture provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the service design system for supporting both the monolithic architecture and the microservice architecture provided in the embodiment of the present disclosure can generally be set in the server 105. The service design method for supporting both the monolithic architecture and the microservice architecture provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the service design system for supporting both the monolithic architecture and the microservice architecture provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. The method provided in the embodiment of the present disclosure can be used in related aspects of the financial field, and can also be used in any field other than the financial field. The application field of the service design method for supporting both the monolithic architecture and the microservice architecture provided in the embodiment of the present disclosure is not limited.
[0058] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0059] The following will be based on Figure 1The scene described by Figure 2-3 A service design method that supports both a monolithic architecture and a microservice architecture in a disclosed embodiment is described in detail.
[0060] Figure 2 The flowchart of the service design method supporting both the monolithic architecture and the microservice architecture according to an embodiment of the present disclosure is schematically shown.
[0061] like Figure 2 As shown, the service design method of this embodiment that supports both the monolithic architecture and the microservice architecture includes operations S210 to S260.
[0062] In operation S210, a service profile of a target service is obtained.
[0063] In operation S220, a service module of the target service is determined according to the service configuration file.
[0064] In one example, the business requirements of the target business are first analyzed, and the boundaries of the target business domain are divided, and each business domain corresponds to a business module. The business module of the target business can be determined according to the business configuration file in operation S210.
[0065] In operation S230, atomic services and composite services corresponding to the business modules are determined according to the business modules, wherein the atomic services are underlying core services, and the composite services are services formed by calling different atomic services according to business scenario requirements.
[0066] In one example, for each business module, the atomic services of the business domain corresponding to the business module are extracted according to the DDD design concept to achieve maximum service reuse, and the core business remains basically unchanged, ensuring the stability of the core business, improving the reusability of the core business, and reducing repeated development. The composite services of the business domain of the target business design are designed according to the actual business scenario to meet the actual business needs and functional requirements of users.
[0067] Design an atomic service interface for each independent and complete business function, and provide a specific atomic service implementation for each atomic service interface. Similarly, the composite service concrete implementation class implements the composite service interface. The service interface and service implementation adopt the interface design pattern, decoupling the interface definition and interface implementation, and supporting the dynamic and flexible addition of interface implementation according to actual business needs.
[0068] In operation S240 , service publishing protocol interfaces of atomic services and composite services are defined.
[0069] In an example, based on the specific implementation of the service interface, a service publishing protocol interface is designed and defined, including atomic service and composite service publishing protocol interfaces. According to the service publishing protocol interface, different publishing protocols are implemented in combination with actual business needs. For example, when the target business requires a monolithic architecture, local services are selected; when the target business requires a microservice architecture, Dubbo services, Rest services, etc. are selected.
[0070] In operation S250, the service client calling interface and calling method are determined according to the service publishing protocol interface.
[0071] According to the embodiment of the present disclosure, different service publishing protocols are implemented according to the service publishing protocol interface, wherein the service publishing protocols include local services, Restful style services, Dubbo RPC and SOFA RPC. The service client calling method is determined according to the service publishing protocol, and the calling methods include local calling, OpenFeign, Dubbo RPC client and SOFA RPC client.
[0072] In one example, a service client calling interface is designed according to the service publishing protocol interface in operation S240; based on the service client calling interface, corresponding service client calling implementations are implemented for the publishing protocol implemented by the server, such as local service client, Dubbo service client, Rest service client, etc.
[0073] For each service, a set of service interfaces are defined on the server and client. On the server, different service publishing methods are implemented for different network protocols, such as local service, Dubbo service, Rest service, etc. On the client, different protocols for different servers to provide external services are different, and corresponding client call interface implementations are provided, such as local service client, Dubbo service client, Rest service client, etc.
[0074] The service protocol interface and service protocol implementation, client interface and client implementation adopt the interface design pattern, decouple the interface definition and interface implementation, and support dynamic and flexible addition of interface implementation according to actual business needs.
[0075] In operation S260 , in response to a deployment instruction from a user, a single application or a microservice application is deployed to the target business.
[0076] In one example, the target business is deployed according to the user's deployment requirements. The design method provided by the embodiment of the present disclosure can enable the target business to support both the monolithic architecture and the microservice architecture. Figure 3 Describe the target service deployment method in detail. Figure 3The following is a schematic diagram showing a target service deployment method according to an embodiment of the present disclosure. Figure 3 As shown, operation S310 to operation S330 are included.
[0077] In operation S310 , a system architecture of a target business is determined according to a deployment instruction of a user.
[0078] The user's deployment requirements are determined according to the user's deployment instructions, and a corresponding configuration file is determined. In operation S320, the target service is deployed according to the system architecture.
[0079] Operation S320 specifically includes operations S330 to S340.
[0080] In operation S330, if it is determined that the system architecture is a monolithic architecture, the modules required for the monolithic application are configured through the configuration file, and a project component package is generated through Maven construction; in operation S331, the project component package is directly deployed on the Java virtual machine.
[0081] In one example, in a monolithic architecture style, the composite services and atomic services of each business module are implemented locally, using local services and local service clients directly, and all business modules are packaged into a component package, that is, a SpringBoot executable Jar, and then directly deployed to the Java virtual machine. Monolithic applications support cluster deployment mode.
[0082] In operation S340, if it is determined that the system architecture is a microservice architecture, the modules required for the microservice application are configured through the configuration file, and multiple project component packages are generated through Maven construction; in operation S341, each project component package is deployed separately on the JAVA virtual machine in the mode of a single application.
[0083] In one example, in the microservice architecture style, remote services (Dubbo services, Rest services, etc.) and remote service clients (Dubbo service clients, Rest service clients) are used to make calls through RPC or HTTP protocols. Each business module is packaged as a component package, that is, SpringBoot can run Jar, and then each business module is deployed separately on the Java virtual machine in the mode of a single application. Different business modules are deployed separately, and all business modules constitute a microservice architecture style to provide services to the outside world. Each business module supports cluster deployment mode.
[0084] The service design method provided by the embodiment of the present disclosure supports both the monolithic architecture and the microservice architecture. In service design, a multi-module, business middle platform and interface-oriented design concept are adopted to achieve rapid conversion between monolithic applications and microservice applications.
[0085] In terms of design, first of all, for each business module, the atomic services of the business domain corresponding to the business module are extracted according to the DDD design concept to achieve maximum service reuse. Then, according to the actual business scenario, the composite services of the business domain involved in the project are designed to meet the actual business needs and functional requirements of users. Finally, the service interface and service implementation, service protocol interface and service protocol implementation, client interface and client implementation adopt the interface design pattern to decouple the interface definition and interface implementation, and support the dynamic and flexible addition of interface implementation according to actual business needs.
[0086] In terms of implementation, we adopt Maven-based multi-module development, package each module separately, build different product components based on different architectural styles, and shield the differences between local and remote service calls.
[0087] Based on the above service design method that supports both the monolithic architecture and the microservice architecture, the present disclosure also provides a service design system that supports both the monolithic architecture and the microservice architecture. Figure 4 The device is described in detail.
[0088] Figure 4 The structural block diagram of a service design system that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown.
[0089] like Figure 4 As shown, the service design system 400 of this embodiment that supports both monolithic architecture and microservice architecture includes a first acquisition module 410, a first determination module 420, a second determination module 430, an interface module 440, a third determination module 450 and a deployment module 460.
[0090] The first acquisition module 410 is used to acquire a service profile of a target service. In one embodiment, the first acquisition module 410 may be used to perform the operation S210 described above, which will not be described in detail herein.
[0091] The first determination module 420 is used to determine the service module of the target service according to the service configuration file. In one embodiment, the first determination module 420 can be used to perform the operation S220 described above, which will not be described in detail here.
[0092] The second determination module 430 is used to determine the atomic service and composite service corresponding to the business module according to the business module, wherein the atomic service is the underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements. In one embodiment, the second determination module 430 can be used to perform the operation S230 described above, which will not be repeated here.
[0093] The interface module 440 is used to define the service publishing protocol interface of the atomic service and the composite service. In one embodiment, the interface module 440 can be used to perform the operation S240 described above, which will not be described in detail here.
[0094] The third determination module 450 is used to determine the service client calling interface and calling mode according to the service publishing protocol interface. In one embodiment, the third determination module 450 can be used to perform the operation S250 described above, which will not be repeated here.
[0095] The deployment module 460 is used to deploy a single application or a microservice application to the target business in response to the user's deployment instruction. In one embodiment, the deployment module 460 can be used to perform the operation S260 described above, which will not be repeated here.
[0096] According to an embodiment of the present disclosure, any multiple modules of the first acquisition module 410, the first determination module 420, the second determination module 430, the interface module 440, the third determination module 450 and the deployment module 460 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the first acquisition module 410, the first determination module 420, the second determination module 430, the interface module 440, the third determination module 450 and the deployment module 460 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or by any one of the three implementation methods of software, hardware and firmware or by a suitable combination of any of them. Alternatively, at least one of the first acquisition module 410, the first determination module 420, the second determination module 430, the interface module 440, the third determination module 450 and the deployment module 460 can be at least partially implemented as a computer program module, which can perform corresponding functions when executed.
[0097] Figure 5 A block diagram of an electronic device suitable for implementing a service design method that supports both a monolithic architecture and a microservice architecture according to an embodiment of the present disclosure is schematically shown.
[0098] like Figure 5As shown, the electronic device 500 according to an embodiment of the present disclosure includes a processor 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. The processor 501 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 501 may also include an onboard memory for caching purposes. The processor 501 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0099] In RAM 503, various programs and data required for the operation of electronic device 500 are stored. Processor 501, ROM 502 and RAM 503 are connected to each other via bus 504. Processor 501 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 502 and / or RAM 503. It should be noted that the program can also be stored in one or more memories other than ROM 502 and RAM 503. Processor 501 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0100] According to an embodiment of the present disclosure, the electronic device 500 may further include an input / output (I / O) interface 505, which is also connected to the bus 504. The electronic device 500 may further include one or more of the following components connected to the I / O interface 505: an input portion 506 including a keyboard, a mouse, etc.; an output portion 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 508 including a hard disk, etc.; and a communication portion 509 including a network interface card such as a LAN card, a modem, etc. The communication portion 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage portion 508 as needed.
[0101] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0102] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 502 and / or RAM 503 described above and / or one or more memories other than ROM 502 and RAM 503.
[0103] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program includes a program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the service design method that supports both the monolithic architecture and the microservice architecture provided by the embodiment of the present disclosure.
[0104] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 501. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0105] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 509, and / or installed from the removable medium 511. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0106] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the processor 501, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0107] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0108] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0110] The embodiments of the present disclosure are described above. However, these embodiments are only for the purpose of illustration and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make various substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A service design method that supports both monolithic architecture and microservice architecture, characterized in that: The method comprises: Obtain a business profile of the target business; Determining a service module of the target service according to the service configuration file; Determine, according to the business module, an atomic service and a composite service corresponding to the business module, wherein the atomic service is an underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements; Defining the service publishing protocol interface of the atomic service and the composite service; Determine the service client calling interface and calling method according to the service publishing protocol interface; and In response to a deployment instruction from a user, deploying a single application or a microservice application to the target business, wherein in response to a deployment instruction from a user, deploying a single application or a microservice application to the target business includes: Determine the system architecture of the target business based on the user's deployment instructions; Deploy the target business according to the system architecture; The deploying the target service according to the system architecture includes: If it is determined that the system architecture is a monolithic architecture, the modules required for the monolithic application are configured through the configuration file, and a project component package is generated through Maven construction; Deploy the project component package directly to a Java virtual machine; or If it is determined that the system architecture is a microservice architecture, the modules required for the microservice application are configured through the configuration file, and multiple project component packages are generated through Maven construction; Deploy each project component package separately on the JAVA virtual machine in the mode of a single application.
2. The method according to claim 1, characterized in that Determining the service client calling interface and calling method according to the service publishing protocol interface includes: Determine the service publishing protocol according to the service publishing protocol interface; The service client calling method is determined according to the service publishing protocol.
3. The method according to claim 2, characterized in that The service publishing protocols include local services, RESTful style services, Dubbo RPC and SOFA RPC.
4. The method according to claim 2, characterized in that: The calling methods include local calling, OpenFeign, Dubbo RPC client and SOFA RPC client.
5. A service design system that supports both monolithic architecture and microservice architecture, comprising: An acquisition module, used to acquire a business configuration file of a target business; A first determining module, configured to determine a service module of the target service according to the service configuration file; A second determination module is used to determine the atomic service and composite service corresponding to the business module according to the business module, wherein the atomic service is the underlying core service, and the composite service is a service formed by calling different atomic services according to business scenario requirements; An interface module, used to define the service publishing protocol interface of the atomic service and the composite service; A third determination module is used to determine the service client calling interface and calling method according to the service publishing protocol interface; as well as A deployment module, used to deploy a single application or a microservice application for the target business in response to a deployment instruction of a user; The deployment module is also used to determine the system architecture of the target business according to the user's deployment instructions; Deploy the target business according to the system architecture; if it is determined that the system architecture is a monolithic architecture, configure the modules required for the monolithic application through the configuration file, generate a project component package through Maven construction; and deploy the project component package directly on the Java virtual machine; Or if it is determined that the system architecture is a microservice architecture, the modules required for the microservice application are configured through configuration files, and multiple project component packages are generated through Maven construction; each project component package is separately deployed on the JAVA virtual machine in a single application mode.
6. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 4.
7. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 4.
8. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Composite service selection method for supporting service quality association
CN101739385A
Business development method and device
CN102999338A