An instruction set-based microservice splitting method, device, and terminal device

Through the microservice splitting method based on instruction set, the problem of difficult data migration of independent and controllable cloud platform is solved, and the rapid transformation or migration of migration from foreign operating systems to domestic operating systems is realized, reducing the difficulty of migration and coping with the problem of fast software and hardware updates.

CN115033290BActive Publication Date: 2025-06-27SICHUAN INDEPENDENT CONTROLLABLE ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210529011.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-16
Publication Date
2025-06-27
Estimated Expiration
2042-05-16

AI Technical Summary

Technical Problem

The existing independent and controllable cloud platform encounters difficult problems in the process of data migration, especially in the process of migrating from foreign X86+ Windows/Linux systems to domestic LoongArch, Alpha, ARM, x86 and other architectures.

Method used

Using the instruction set-based microservice splitting method, by building an independent and controllable cloud platform base, extracting hardware resources and collecting hybrid instruction set heterogeneous virtualization resource pools, building a microservice container environment and continuous integration tool, reconstructing the operating system into a standard monolithic Java project, and microservice splitting is performed according to the DDD model theory and instruction set characteristics.

Benefits of technology

The process of rapidly transforming or migrating the system business of the second operating system to the first operating system is realized, reducing the difficulty of migration and coping with the problem of fast software and hardware updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033290B_ABST
    Figure CN115033290B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of software engineering technology, and provides a microservice splitting method, device and terminal device based on an instruction set. The method includes building an autonomous and controllable cloud platform base, which is used to extract the hardware resources of the first operating system and collect a heterogeneous virtualization resource pool of hybrid instruction sets based on the first operating system; building a microservice container environment and a continuous integration tool based on the instruction sets in the heterogeneous virtualization resource pool of hybrid instruction sets; reconstructing the second operating system into a standard monolithic Java project; and performing microservice splitting on the reconstructed second operating system according to the DDD model theory and the characteristics of the instruction sets in the heterogeneous virtualization resource pool of hybrid instruction sets. The present invention provides a splitting basis for the splitting of microservices, and solves the problem of the selection of technical routes in the rapid transformation or migration of the system business of the second operating system to the first operating system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software engineering, and in particular, to a microservice splitting method, device, and terminal device based on an instruction set. Background Art

[0002] In the previous information technology environment, China's IT underlying standards, architectures, products, ecosystems, etc. were highly dependent on non-domestic IT products, such as underlying CPU (Central Processing Unit) chips, to operating systems, middleware, databases, server software, desktop application software, etc. Now, the information technology application innovation industry has been accelerated, and establishing an independent and controllable information technology underlying architecture and standards can achieve domestic substitution in fields such as chips, sensors, basic software, and application software. Therefore, in key fields such as big data applications, smart cities, and government affairs informatization, domestic independent and controllable, trusted computing and storage products, such as domestic chips, operating systems, databases, servers, storage, etc., are gradually given priority for promotion and use.

[0003] However, many existing independent and controllable cloud platforms are mainly characterized by on-demand self-service application and elastic automatic delivery, which requires rapid transformation or migration of a large number of original foreign X86+Windows / Linux-based services to an independent and controllable platform based on domestic LoongArch, Alpha, ARM, x86, etc. architecture CPU chips and operating systems represented by domestic Tongxin or Kirin. Whether it is domestic hardware or software, the update and replacement are very fast, and the overall migration is difficult. Summary of the Invention

[0004] The main purpose of the present invention is to propose a microservice splitting method based on an instruction set to solve the problem of difficult data migration in existing independent and controllable cloud platforms.

[0005] To achieve the above object, a first aspect of an embodiment of the present invention provides a microservice splitting method based on an instruction set, including:

[0006] Build an independent and controllable cloud platform base, where the independent and controllable cloud platform base is used to extract hardware resources of a first operating system and collect and obtain a hybrid instruction set heterogeneous virtualization resource pool based on the first operating system;

[0007] Based on the instruction set in the hybrid instruction set heterogeneous virtualization resource pool, build a microservice container environment and a continuous integration tool;

[0008] Reconstruct a second operating system into a standard monolithic java project;

[0009] According to the DDD model theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, perform microservice splitting on the reconstructed second operating system.

[0010] Combined with the first aspect of the present invention, in the first embodiment of the present invention, based on the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, construct a microservice container environment and a continuous integration tool, including:

[0011] Deploy the basic software centrally on one management node server or separately on different virtual machines. The basic software includes a project management tool, a code management tool, a continuous integration tool, a microservice container environment, a microservice governance environment, and an access end entrance. The CPU instruction set in the management node server and the virtual CPU instruction set in the virtual machine are the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool.

[0012] Combined with the first aspect of the present invention, in the second embodiment of the present invention, according to the DDD model theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, perform microservice splitting on the reconstructed second operating system, including:

[0013] Sort out the business logic of the reconstructed second operating system;

[0014] According to the DDD theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, divide the business logic into different domains and generate corresponding jar packages; where each domain includes complete business logic and there is no intersection between domains;

[0015] Classify the divided domains to obtain multiple microservices to be registered;

[0016] Based on each microservice to be registered, create a new Java project and start a new process.

[0017] Combined with the first aspect, the first embodiment, and the second embodiment of the present invention, in the third embodiment of the present invention, the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool are divided into a complex instruction subset and a reduced instruction subset;

[0018] The representative architectures of the reduced instruction subset and the complex instruction subset are different.

[0019] Combined with the third embodiment of the first aspect of the present invention, in the fourth embodiment of the present invention, after performing microservice splitting on the reconstructed second operating system according to the DDD model theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, including:

[0020] Perform six normative inspections on the microservices to be registered;

[0021] After the above six normative tests are passed, the to-be-registered microservices after testing are registered in the registry center to obtain the registered microservices that start to provide services.

[0022] Combined with the fourth embodiment of the first aspect of the present invention, in the fifth embodiment of the present invention, registering the to-be-registered microservices after testing in the registry center includes:

[0023] Registering the Java project and the process in the registry center at the same time.

[0024] Combined with the fourth embodiment of the first aspect of the present invention, in the sixth embodiment of the present invention, after registering the to-be-registered microservices after testing in the registry center, it further includes:

[0025] According to business requirements and characteristics, deploy load balancing and fault tolerance strategies for each registered microservice, configure microservice orchestration strategies, and set service communication mechanisms.

[0026] The second aspect of the embodiments of the present invention provides a microservice splitting device based on an instruction set, including:

[0027] A resource pool aggregation module, which is used to build a self-controlled cloud platform base, and the self-controlled cloud platform base is used to extract the hardware resources of the first operating system and aggregate to obtain a hybrid instruction set heterogeneous virtualization resource pool based on the first operating system;

[0028] A container environment and tool construction module, which is used to build a microservice container environment and a continuous integration tool based on the instruction set in the hybrid instruction set heterogeneous virtualization resource pool;

[0029] A reconstruction module, which is used to reconstruct the second operating system into a standard monolithic java project;

[0030] A microservice splitting module, which is used to perform microservice splitting on the reconstructed second operating system according to the DDD model theory and the characteristics of the instruction set in the hybrid instruction set heterogeneous virtualization resource pool.

[0031] The third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method provided in the first aspect above are implemented.

[0032] The fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps of the method provided in the first aspect above are implemented.

[0033] An embodiment of the present invention provides a method for splitting microservices based on instruction sets. By leveraging the characteristics of instruction sets in a hybrid instruction set heterogeneous virtualized resource pool, a basis for splitting microservices is provided, which helps improve the splitting effect of microservices when classifying them by domain. The reasonable splitting of microservices completes the rapid transformation or migration of the system services of the second operating system to the first operating system, thus effectively solving the problem of choosing a technical route when quickly transforming or migrating a large number of services based on foreign X86+Windows / Linux systems to autonomous and controllable platforms such as CPU chips based on domestic LoongArch, Alpha, ARM, x86, etc. architectures and operating systems represented by domestic Tongxin or Kirin. Moreover, it can effectively address the migration obstacles caused by the rapid replacement of software and hardware during the above migration process. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic flowchart of the implementation of the method for splitting microservices based on instruction sets provided by an embodiment of the present invention;

[0035] Figure 2 It is a schematic structural diagram of the infrastructure as a service layer of an autonomous and controllable cloud platform base provided by an embodiment of the present invention;

[0036] Figure 3 It is a schematic structural diagram of the composition of the device for splitting microservices based on instruction sets provided by an embodiment of the present invention.

[0037] The implementation, functional features, and advantages of the objectives of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0038] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0039] It should be noted that in this article, the term "including", "comprising", or any other variant thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or device including a series of elements not only includes those elements but also includes other elements that are not explicitly listed, or further includes elements inherent to such process, method, article, or device. Without further limitations, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article, or device including that element.

[0040] In this article, suffixes such as "module", "component", or "unit" used to represent elements are only for the convenience of explaining the present invention and have no specific meaning in themselves. Therefore, "module" and "component" can be used interchangeably.

[0041] Such asFigure 1 As shown, an embodiment of the present invention provides a microservice splitting method based on an instruction set, comprising:

[0042] S101, building an autonomous and controllable cloud platform base, wherein the autonomous and controllable cloud platform base is used to extract hardware resources of the first operating system and to obtain a hybrid instruction set heterogeneous virtualized resource pool based on the first operating system;

[0043] In the above step S101, the autonomous and controllable cloud platform base mainly includes a nationally produced infrastructure as a service layer, wherein the mainstream development trend of Infrastructure as a Service (IaaS) is to evolve towards a software defined data center (SDDC). A software defined data center is all the resources of a virtualized and software-based data center, which extracts all hardware resources and aggregates them into a resource pool on various underlying hardware architectures, such as the underlying hardware architecture of the first operating system in the embodiment of the present invention.

[0044] In the above step S101, the first operating system is a domestic operating system, such as a CPU chip of LoongArch, Alpha, ARM, x86 and other architectures and an operating system represented by domestic Tongxin or Kylin.

[0045] like Figure 2 As shown, the embodiment of the present invention also exemplarily shows the structure of the infrastructure as a service layer of the autonomous and controllable cloud platform base, which is mainly composed of an infrastructure layer, a resource pool layer, a cloud service layer and a management layer, and the functions of each layer are as follows:

[0046] 1) Infrastructure layer

[0047] The infrastructure layer mainly includes servers, storage and various network switching equipment. The hardware and software facilities of the infrastructure layer not only support the second operating system (i.e.

[0048] A software and hardware resource pool for operating systems such as X86+Windows / Linux and CPU chips based on architectures such as Intel and AMD is also built, and a hybrid instruction set heterogeneous virtualization resource pool based on the first operating system (i.e., CPU chips based on domestic architectures such as LoongArch, Alpha, ARM, x86, and operating systems represented by domestic Tongxin or Kylin) is also built. The servers in the hybrid instruction set heterogeneous virtualization resource pool all support the latest hardware virtualization and have complete in-band and out-of-band management functions, so as to maximize the performance of the virtual machines and management node servers used in building a microservice container environment and continuous integration tools in the following step S102, and provide automated management functions.

[0049] 2) Resource Pool Layer

[0050] The resource pool layer is used to access computing (such as virtual machine pools, bare metal physical machine pools), storage (such as storage resource pools of Fibre Channel Storage Area Network FC - SAN, distributed storage resource pools), network resource pools, etc. Various resource pools can be constructed or trimmed according to the actual needs of the project.

[0051] 3) Cloud Service Layer

[0052] The cloud service layer is the management and operation platform for cloud services, mainly including the service automation layer, service access layer, and service portal layer. The service automation layer realizes functions such as discovery, routing, orchestration, metering, and access of cloud resource microservices through encapsulating infrastructure as a service, disaster recovery, and big data resources in the resource pool layer, showing the conversion from resources to services. The service access layer is the external presentation of the cloud management platform, divided into user portals and administrator portals.

[0053] 4) Management Layer

[0054] The management layer is divided into two parts: operation management and operation and maintenance management. Among them, operation management provides an operation management portal. In addition to providing cloud service applications and self - service consoles, the operation management portal supports operation management functions including dynamic control system management, tenant management, service catalog, service console, metering, etc. Operation and maintenance management provides an operation and maintenance management portal, supporting unified operation and maintenance management of multiple data centers, including resource management, alarm management, topology management, performance management, and statistical reports. The management and common capabilities layer is the management platform for the overall operation and maintenance management and common components of the Xinchuang cloud platform.

[0055] S102. Build a microservice container environment and continuous integration tools based on the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool;

[0056] In specific applications, microservices usually use containers as the infrastructure to achieve rapid deployment and rapid iteration. Therefore, in the embodiments of the present invention, before microservice splitting, a microservice container environment and continuous integration tools for managing containerized applications on multiple hosts are first built.

[0057] Based on this, an implementation manner of the above step S102 can be:

[0058] S1021. Centrally deploy basic software on a management node server or separately deploy basic software on different virtual machines. The basic software includes project management tools, code management tools, continuous integration tools, microservice container environment, microservice governance environment, and access - end entrances.

[0059] The CPU instruction set in the management node server and the virtual CPU instruction set in the virtual machine are the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool.

[0060] Among them, the project management tool is specifically Jira, the code management tool is specifically GitLab, the continuous integration tool is specifically jenkins, the microservices container environment is specifically Kubernetes, the microservices governance environment is specifically SpringCloud, and the access end entry is specifically Nginx.

[0061] S103. Reconstruct the second operating system into a standard monolithic Java project.

[0062] In the above step S103, the second operating system is a non-domestic operating system, corresponding to the first operating system. The second operating system is foreign X86 + Windows / Linux and other operating systems and CPU chips based on architectures such as Intel and AMD.

[0063] The embodiment of the present invention also shows the structure of the standard monolithic Java project in the above step S103, which includes an API (Application Programming Interface) interface package, an external service access package, external services, services and business logic, database mapping logic, a database access package, and a test folder. The functions of each component are as follows:

[0064] 1. API interface package: It includes all interface definitions, realizes internal calls, and interfaces. When microservices are split, local interface calls can become remote interface calls.

[0065] 2. External service access package: If this process needs to access other processes, the encapsulation of external access is all here. For unit testing, this part should be able to perform functional testing without depending on third parties.

[0066] 3. External services: The logic for providing services externally is here. For the providers of interfaces, it should be implemented here.

[0067] 4. Services and business logic: The main business logic is implemented here, and the split also starts from here.

[0068] 5. Database mapping logic: If you want to access the database, define the atomic data structure here.

[0069] 6. Database access package: All the logic for accessing the database is in this package.

[0070] 7. Test Folder: Each class should have unit tests. The unit test coverage should be audited, and integration tests are implemented through the EasyMock tool within the module.

[0071] In specific applications, the standard monolithic Java project is based on the anemic model. The core of its transaction script is the process. It can be considered that most business processes are a series of SQL statements. The transaction script organizes several SQL statements into a piece of business logic. When the business logic is executed, transactions are used to ensure the ACID of the logic. Among them, ACID are the four basic elements for the correct execution of database transactions: atomicity (or indivisibility), consistency, isolation (also known as independence), and durability. The advantage of doing this is that the hierarchical structure of the system is clear, and there is a one-way dependency between layers. Therefore, the system hierarchical structure of the standard monolithic Java project can be expressed as:

[0072] Client -> (BusinessFacade) -> BusinessLogic business logic -> DAO / DTO.

[0073] In actual applications, after the structure of a project is very standardized, for the microservice splitting of the following step S104, functional modules can be first separated from the original operating system services and business logic, and the input and output can be standardized to form a separation within the service. Before separating a new process, a new jar can be separated first. As long as a new jar can be separated, loose coupling is basically achieved.

[0074] S104. According to the DDD model theory and the characteristics of the instruction set in the hybrid instruction set heterogeneous virtualization resource pool, perform microservice splitting on the reconstructed second operating system.

[0075] In specific applications, after microservice splitting, it will be applied to the autonomous and controllable cloud platform base of the above step S101 to complete the rapid transformation or migration of the system business of the second operating system to the first operating system.

[0076] In the above step S104, the DDD (Domain - Driven Design) model theory is as follows: Before development, a large amount of business knowledge is sorted out. During the process of sorting out business knowledge, certain domain knowledge will inevitably be formed. Splitting services step by step according to domain knowledge is the basic concept of domain - driven design. The core of domain - driven design lies in establishing the correct domain - driven model.

[0077] In the embodiment of the present invention, the detailed implementation method of the microservice splitting in the above step S104 is:

[0078] S1041. Organize and reconstruct the business logic of the second operating system;

[0079] S1042. According to the DDD theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, divide the business logic into different domains and generate corresponding jar packages; wherein, each domain includes complete business logic and there is no intersection between domains;

[0080] S1043. Classify the divided domains to obtain multiple micro-services to be registered;

[0081] S1044. Based on each micro-service to be registered, create a new Java project and start a new process.

[0082] In one embodiment, the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool are divided into a complex instruction subset and a reduced instruction subset;

[0083] The representative architectures of the reduced instruction subset and the complex instruction subset are different.

[0084] Then, the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool can manage the CPU instruction sets in the node servers and the virtual CPU instruction sets in the virtual machines, and can be divided into a complex instruction subset and a reduced instruction subset according to their characteristics.

[0085] Among them, the representative architectures of domestic RISC instruction sets are LoongArch (Loongson), Alpha (Shenwei), ARM (Phytium, Kunpeng), while the representative architecture of the RISC instruction set is x86 (Hygon, Zhaoxin). Their main technical characteristics and application scenarios are as follows:

[0086] 1. LoongArch (Loongson) is a pure domestic architecture developed from the MIPS instruction set and is also one of the high-performance reduced instruction set computer architectures. Its greatest significance lies in its complete independent design, including 337 basic instructions, 10 virtual machine extensions, 176 binary translation extensions, 1024 128-bit vector extensions, and 1018 256-bit vector extensions, totaling 2565 native instructions. Compared with other CPU architectures, the advantage of LoongArch lies more in the industrial control and embedded fields and can be compatible with Linux programs of several instruction sets such as MIPS, x86, ARM, and RISC-V.

[0087] 2. Alpha (Shenwei) originally belonged to the Alpha camp, and its instruction set is also extended based on Alpha. The technical source of Alpha (Shenwei) is DEC's Alpha 21164, and it has the autonomy of independent extended instructions and development routes.

[0088] 3. The main features of the instruction set architectures of ARM (Phytium, Kunpeng): First, small size, low power consumption, low cost, and high performance; second, a large number of registers are used and most data operations are completed in registers, resulting in faster instruction execution speed; third, flexible and simple addressing modes and high execution efficiency; fourth, fixed instruction length, and the processing efficiency can be improved through the multi-pipeline method. Therefore, CPUs with the ARM instruction set are suitable for applications that carry a large number of database accesses.

[0089] 4. The instruction set architecture of x86 (Hygon, Zhaoxin) is a CISC architecture. Domestic manufacturers Hygon and Zhaoxin have respectively launched servers and desktop terminals based on the x86 architecture. The X86 system mainly has two major features: First, microcode is used, and the instruction set can be directly executed in the microcode unit in the CPU; second, it has a large instruction set, including various instruction types such as complex operations, image processing, register-to-memory, and memory-to-register. To implement complex operations, in addition to providing programmers with functions similar to various registers and machine instructions, the CPU also realizes extremely powerful functions through microprograms stored in read-only memory (ROM). After analyzing each instruction, the microprocessor executes a series of elementary instruction operations to complete the required functions.

[0090] Based on the above content, exemplarily, the domain categories formed after splitting microservices are: ARM microservices, x86 microservices, LoongArch microservices, Alpha microservices, and others.

[0091] The embodiments of the present invention utilize the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool, that is, the differences in the instruction representative architectures and application scenarios, to assist in the division of business logic, making the domain boundaries clearer, providing a basis for the splitting of microservices, and helping to improve the splitting effect of microservices when classifying domains. The reasonable splitting of microservices facilitates their subsequent smooth migration to a domestically controllable platform, effectively solves the technical route selection problem encountered when quickly transforming or migrating a large number of businesses based on foreign X86+Windows / Linux systems to a domestically controllable platform with CPU chips based on domestic architectures such as LoongArch, Alpha, ARM, x86, etc. and operating systems represented by domestic Tongxin or Kirin, and can effectively address the migration obstacles caused by the rapid replacement of software and hardware during the above migration process.

[0092] In the above steps S103 and S104, the reconstructed standard monomer Java project is based on the anemic model, with a clear system hierarchy and unidirectional dependencies between layers. In the embodiments of the present invention, when microservice splitting is performed on the reconstructed second operating system, according to the DDD model theory, a domain-driven model is established to transform the system hierarchy of the standard monomer Java project. Specifically, based on the business logic of the standard monomer Java project, most of the business logic and persistence are placed in the domain layer, while the business logic only simply encapsulates part of the business logic and controls transactions, permissions, etc. Then the transformed system hierarchy can be expressed as: Client->(BusinessFacade)->BusinessLogic->Domain Object->DataAccess Object.

[0093] In a specific application, after microservice splitting, due to the difficulties of the rich model in the DDD theory, there will be a large number of Java projects, which are prone to chaos and difficult to maintain. Therefore, in the embodiments of the present invention, a normative inspection is also performed on the split microservices to be registered. If the inspection fails, the process returns to step S104 to perform splitting again. After the above step S104, the following steps are further included:

[0094] Perform six normative inspections on the microservices to be registered;

[0095] After the six normative inspections pass, register the inspected microservices to be registered in the registry to obtain the registered microservices that start providing services.

[0096] In the embodiments of the present invention, the six normative inspections include: splitting normative inspection, dependency normative inspection, access normative inspection, atomicity normative inspection, interface normative inspection, and name normative inspection. The inspection principles and inspection purposes of the above six normative inspections are as follows:

[0097] 1. Splitting normative inspection:

[0098] Check whether the vertical splitting of the microservices to be registered is divided into three layers and called twice.

[0099] Since the service splitting in the embodiments of the present invention is for horizontal expansion, the business logic can only be horizontally split, rather than vertically split into a series.

[0100] For example, when splitting an e-commerce system, the products and orders should be split, rather than splitting the ten steps of placing an order and then calling one after another. Vertical splitting cannot involve business logic and can only be split into three layers according to the anemic model of the DDD theory, namely: the infrastructure layer, the cache layer, and the composite service layer. Among them, the interfaces in the infrastructure layer are used to shield various details of the infrastructure layer, including the database. The cache layer is used to provide atomic object query interfaces, etc. With this layer, when certain changes are made to the data layer, such as database sharding, database expansion, cache replacement, etc., it is transparent to the upper layer. The upper layer only calls the interfaces of this layer and does not directly access the database and cache. Composite service layer: This layer encapsulates and combines several domain models, completes relatively complex business logic and implements distributed transactions. The domain models call the interfaces of the infrastructure layer and cannot directly call each other. The presentation layer is the external service interface layer, which calls the composite service layer to provide services externally.

[0101] 2. Dependence normativity inspection:

[0102] Check whether the two calls for the above splitting normativity inspection are one-way calls, and circular calls are strictly prohibited.

[0103] After microservice splitting, the dependence relationships between services are complex. If there are circular calls, the upgrade order will be chaotic and difficult to maintain. Therefore, the two calls for the above splitting normativity inspection need to be one-way calls. Specifically, the following regulations must be set for calls between layers: The interfaces in the infrastructure layer mainly perform database operations and some simple business logic and are not allowed to call any other services; The composite service can call the interfaces of the infrastructure layer through the combination of various domain models to complete complex business logic, and can also call other composite services, but circular calls are not allowed, and it is not allowed to call services in the presentation layer; The presentation layer can call services in the composite business layer and is not allowed to be called by other services.

[0104] In one embodiment, if a circular call occurs, for example, A calls B and B also calls A, then it is split into two layers, the presentation layer and the composite service layer. The lower layer of B called by A, and the lower layer of A called by B. It is also possible to use a message queue to change the synchronous call to an asynchronous call.

[0105] 3. Access normativity inspection:

[0106] Check whether the serial call is changed to a parallel call or asynchronous when multiple microservices to be registered form a composite service.

[0107] In specific applications, when multiple microservices form a composite service, the processing flow is relatively long and multiple external services need to be called. Therefore, it is necessary to consider how to achieve asynchronization and decoupling through a message queue. The solution is to change the serial call to a parallel call or asynchronous.

[0108] For example, after placing an order, the cache needs to be refreshed and the warehouse needs to be notified, etc. These do not need to be completed when the order is successfully placed. Instead, a message can be sent to the message queue to asynchronously notify other services. Moreover, the advantage of using the message queue is that as long as you send a single message, whether there is one or ten downstream dependent parties, it can be handled with just one message. You just need a few more downstream services to listen for the message. For operations that must be completed simultaneously when placing an order, such as deducting inventory and coupons, parallel calls can be made, which will greatly shorten the processing time. It is not the sum of the times of multiple calls, but the call time of the system with the longest processing flow.

[0109] 4. Atomic Normative Inspection:

[0110] Check whether the interfaces of the microservices to be registered are idempotent.

[0111] After microservice splitting, when there are errors in the calls between the microservices to be registered, retries will be made. However, to avoid placing an order twice and paying twice, all interfaces need to be idempotent.

[0112] Among them, idempotency generally needs to be implemented by designing an idempotency table. The primary key or unique key in the idempotency table can be the transaction id or the business id. A unique operation can be identified by the uniqueness of this id. There are also idempotent operations that use a state machine. When a call arrives, it often triggers a change in the state. When the next call arrives and it is found that the state is no longer the same, it means that the previous call has already been made. The change in the state needs to be an atomic operation, that is, when there are concurrent calls, only one can be executed. It can be implemented using a distributed lock or an optimistic lock CAS (Compare and Swap) operation.

[0113] 5. Interface Normative Inspection:

[0114] Check whether there is embedding or pass-through in the interface data definition of the microservices to be registered and prohibit it.

[0115] In specific applications, when passing data between microservice interfaces, it often goes through data structures. If the data structures are pass-through, using the same data structure from the bottom layer to the upper layer, or the data structure of the upper layer embeds the data structure of the bottom layer, when a field is added or deleted in the data structure, the affected area will be very large. Therefore, for the interface data definition, it is agreed between every two interfaces to strictly prohibit embedding and pass-through. Even if they are almost the same, redefine them. This makes the change of the interface data definition only affect the calling party and the called party, and when the interface needs to be updated, it is more controllable and easier to upgrade.

[0116] 6. Name Normative Inspection:

[0117] Check whether the microservice to be registered has a standardized project name.

[0118] In a specific application, after microservice splitting, there are a large number of project names. If developers are to know the function of a project name or the name of a jar just by looking at it, a standardized convention is needed.

[0119] For example, including "pay" means payment, including "order" means placing an order, and including "account" means user. Another example is that including "compose" means the composition layer, "controller" means the interface layer, and "basic" means the basic service layer. The appearance of "api" means interface definition, and "impl" means implementation. "pay-compose-api" is the interface definition of the payment composition layer. "account-basic-impl" is the implementation of the user basic service layer.

[0120] In the embodiment of the present invention, after classifying the divided domains to obtain multiple microservices to be registered, for each microservice to be registered, a Java project is newly created and a new process is started. Based on this, the detailed implementation method of registering the inspected microservice to be registered into the registration center includes:

[0121] At the same time, register the Java project and the process into the registration center.

[0122] The registration center described in the embodiment of the present invention provides a running environment for microservices by kubernetes, and springcloud is responsible for the invocation and governance between microservices. In one embodiment, the Eureka module in the SpringCloudNetflix microservice architecture is selected as the registration center, which is responsible for the registration and discovery of each microservice. For example, in inventory services, warehousing services, and point services, there is an Eureka Client component in each of these microservices. The Eureka Client component is specifically responsible for registering the information of this service into the Eureka Server. And the Eureka Server is a registration center that stores a registration table, which saves the server IP addresses and port numbers of each service.

[0123] Among them, when the inspected microservice to be registered is registered into the registration center, the registered microservice starts to provide services. And the embodiment of the present invention also optimizes the invocation and governance of the registered microservice to ensure the running state of the self-controlled cloud platform, which includes:

[0124] According to business requirements and characteristics, deploy load balancing and fault tolerance strategies for each registered microservice, configure microservice orchestration strategies, and set service communication mechanisms.

[0125] In a specific application, the load balancing of microservices in the present invention selects the Ribbon module in the Spring Cloud Netflix microservice architecture. For example, a certain microservice is borne by 5 containers on a server cluster based on the ARM instruction set. When the upper layer calls this service, Ribbon will select a container each time a request is made, so as to evenly distribute the requests to each machine. The default load balancing algorithm used by Ribbon is the classic Round Robin algorithm, which can also be set by the administrator himself.

[0126] In addition, Ribbon works closely with the Feign and Eureka modules: First, Ribbon will obtain the corresponding service registry from the Eureka Client, and thus know on which servers all the services are deployed and which port numbers they are listening on. Then Ribbon can use the default Round Robin algorithm to select a machine from them. Feign will construct and initiate a request for this machine.

[0127] It should be noted that the invocation and governance of the registered microservices shown in the embodiments of the present invention are intelligent working processes realized by writing unit test cases and continuous integration tools, without the need for developers to manually configure docker and nginx. And the orchestrated microservices have relatively high quality after unit testing. The detailed implementation method is as follows:

[0128] Write unit test cases for each registered microservice, submit the code to the continuous integration tool, and monitor the running status of the production environment after the build is completed. The continuous integration tool compiles the code and performs unit tests. After the compilation and testing are successful, microservices are automatically orchestrated, the application is published, and deployed to the corresponding containers. Among them, in the DevOps platform (container continuous integration platform) implemented by docker and kubernetes, after the image is built, during deployment, kubernetes is responsible for regulating resources, allocating docker containers to node servers with different instruction sets according to the microservice orchestration strategy prepared, and at the same time updating the ip-related information of the containers to nginx.

[0129] As Figure 3 shown, the embodiments of the present invention also provide a microservice splitting device 50 based on an instruction set, including:

[0130] A resource pool aggregation module 31, which is used to build a base of an independently controllable cloud platform, and the base of the independently controllable cloud platform is used to extract the hardware resources of the first operating system and aggregate to obtain a hybrid instruction set heterogeneous virtualization resource pool based on the first operating system;

[0131] A container environment and tool construction module 32 for constructing a microservice container environment and a continuous integration tool based on the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool;

[0132] A reconstruction module 33 for reconstructing the second operating system into a standard monolithic Java project;

[0133] A microservice splitting module 34 for splitting the reconstructed second operating system into microservices according to the DDD model theory and the characteristics of the instruction sets in the hybrid instruction set heterogeneous virtualization resource pool.

[0134] In a specific application, after microservice splitting, it will be applied to the independent and controllable cloud platform base built by the above resource pool aggregation module 51 to complete the rapid transformation or migration of the system business of the second operating system to the first operating system.

[0135] An embodiment of the present invention also provides a terminal device including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it implements each step in the microservice splitting method based on instruction sets as described in the above embodiments.

[0136] An embodiment of the present invention also provides a storage medium, which is a computer-readable storage medium with a computer program stored thereon. When the computer program is executed by a processor, it implements each step in the microservice splitting method based on instruction sets as described in the above embodiments.

[0137] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the foregoing embodiments have described the present invention in detail, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A microservice splitting method based on an instruction set, characterized in that, Including: Build the foundation of an autonomous and controllable cloud platform, which is used to extract the hardware resources of the first operating system and gather a heterogeneous virtualization resource pool based on the first operating system. The autonomous and controllable cloud platform foundation mainly includes a nationalized infrastructure as a service layer, and the structure of the infrastructure as a service layer is mainly composed of an infrastructure layer, a resource pool layer, a cloud service layer, and a management layer; Build a microservice container environment and a continuous integration tool based on the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set; Reconstruct the second operating system into a standard monolithic Java project; According to the DDD model theory and the characteristics of the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set, perform microservice splitting on the reconstructed second operating system.

2. The microservice splitting method based on an instruction set according to claim 1, wherein, Build a microservice container environment and a continuous integration tool based on the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set, including: Centrally deploy basic software on a management node server or separately deploy it on different virtual machines. The basic software includes a project management tool, a code management tool, a continuous integration tool, a microservice container environment, a microservice governance environment, and an access end entrance; The CPU instruction set in the management node server and the virtual CPU instruction set in the virtual machine are the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set.

3. The microservice splitting method based on an instruction set according to claim 1, wherein According to the DDD model theory and the characteristics of the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set, after performing microservice splitting on the reconstructed second operating system, including: organizing the business logic of the reconstructed second operating system; According to the DDD theory and the characteristics of the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set, divide the business logic into different domains and generate corresponding jar packages; among them, each domain includes complete business logic and there is no intersection between domains; Classify the divided domains to obtain multiple microservices to be registered; Based on each microservice to be registered, create a new Java project and start a new process.

4. The method for splitting microservices based on an instruction set according to any one of claims 1 to 3, wherein The instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set are divided into a complex instruction subset and a reduced instruction subset; The representative architectures of the reduced instruction subset and the complex instruction subset are different.

5. The microservice splitting method based on an instruction set according to claim 3, wherein According to the DDD model theory and the characteristics of the instruction sets in the heterogeneous virtualization resource pool of the hybrid instruction set, after performing microservice splitting on the reconstructed second operating system, including: Conduct six normative inspections on the microservices to be registered; After the six normative inspections pass, register the inspected microservices to be registered into a registration center to obtain registered microservices that start providing services.

6. The method for splitting microservices based on an instruction set according to claim 5, wherein Register the inspected microservices to be registered into a registration center, including: Simultaneously register the Java project and the process into the registration center.

7. The method for splitting microservices based on an instruction set according to claim 5, characterized in that, After registering the inspected microservices to be registered into a registration center, it also includes: According to business requirements and characteristics, deploy load balancing and fault tolerance strategies for each registered microservice, configure microservice orchestration strategies, and set service communication mechanisms.

8. An instruction set-based microservice splitting device, characterized in that, Including: A resource pool aggregation module, which is used to build a foundation for a domestically controllable cloud platform. The domestically controllable cloud platform foundation is used to extract the hardware resources of the first operating system and aggregate to obtain a hybrid instruction set heterogeneous virtualization resource pool based on the first operating system; A container environment and tool construction module, which is used to build a microservice container environment and a continuous integration tool based on the instruction set in the hybrid instruction set heterogeneous virtualization resource pool; A reconstruction module, which is used to reconstruct the second operating system into a standard monolithic java project; A microservice splitting module, which is used to perform microservice splitting on the reconstructed second operating system according to the DDD model theory and the characteristics of the instruction set in the hybrid instruction set heterogeneous virtualization resource pool.

9. A terminal device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, each step in the instruction set-based microservice splitting method according to any one of claims 1 to 7 is implemented.

10. A storage medium, the storage medium being a computer-readable storage medium, having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, each step in the instruction set-based microservice splitting method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and system for managing industrial production based on micro-service architecture and process engine

    CN114331113A

  • Isolating service issues in a microservice architecture

    US20190340059A1